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 |
|---|---|---|---|---|---|---|---|---|---|---|
Bandwidth/java-bandwidth | src/main/java/com/bandwidth/sdk/model/Call.java | Call.get | public static Call get(final BandwidthClient client, final String callId) throws Exception {
"""
Convenience factory method for Call, returns a Call object given an id
@param client the client
@param callId the call id
@return the call
@throws Exception error.
"""
final String callsUri = clie... | java | public static Call get(final BandwidthClient client, final String callId) throws Exception {
final String callsUri = client.getUserResourceInstanceUri(BandwidthConstants.CALLS_URI_PATH, callId);
final JSONObject jsonObject = toJSONObject(client.get(callsUri, null));
retur... | [
"public",
"static",
"Call",
"get",
"(",
"final",
"BandwidthClient",
"client",
",",
"final",
"String",
"callId",
")",
"throws",
"Exception",
"{",
"final",
"String",
"callsUri",
"=",
"client",
".",
"getUserResourceInstanceUri",
"(",
"BandwidthConstants",
".",
"CALLS... | Convenience factory method for Call, returns a Call object given an id
@param client the client
@param callId the call id
@return the call
@throws Exception error. | [
"Convenience",
"factory",
"method",
"for",
"Call",
"returns",
"a",
"Call",
"object",
"given",
"an",
"id"
] | train | https://github.com/Bandwidth/java-bandwidth/blob/2124c85148ad6a54d2f2949cb952eb3985830e2a/src/main/java/com/bandwidth/sdk/model/Call.java#L44-L51 |
QSFT/Doradus | doradus-server/src/main/java/com/dell/doradus/service/spider/SpiderTransaction.java | SpiderTransaction.addTermIndexColumn | public void addTermIndexColumn(TableDefinition tableDef, DBObject dbObj, String fieldName, String term) {
"""
Index the given term by adding a Terms column for the given DBObject, field name,
and term. Non-sharded format:
<pre>
[field name]/[field value]> = {[object ID]:null}
</pre>
Term record for a sharded ... | java | public void addTermIndexColumn(TableDefinition tableDef, DBObject dbObj, String fieldName, String term) {
addColumn(SpiderService.termsStoreName(tableDef),
SpiderService.termIndexRowKey(tableDef, dbObj, fieldName, term),
dbObj.getObjectID());
} | [
"public",
"void",
"addTermIndexColumn",
"(",
"TableDefinition",
"tableDef",
",",
"DBObject",
"dbObj",
",",
"String",
"fieldName",
",",
"String",
"term",
")",
"{",
"addColumn",
"(",
"SpiderService",
".",
"termsStoreName",
"(",
"tableDef",
")",
",",
"SpiderService",... | Index the given term by adding a Terms column for the given DBObject, field name,
and term. Non-sharded format:
<pre>
[field name]/[field value]> = {[object ID]:null}
</pre>
Term record for a sharded object:
<pre>
[shard number]/[field name]/[field value] = {[object ID]:null}
</pre>
@param dbObj DBObject that owns... | [
"Index",
"the",
"given",
"term",
"by",
"adding",
"a",
"Terms",
"column",
"for",
"the",
"given",
"DBObject",
"field",
"name",
"and",
"term",
".",
"Non",
"-",
"sharded",
"format",
":",
"<pre",
">",
"[",
"field",
"name",
"]",
"/",
"[",
"field",
"value",
... | train | https://github.com/QSFT/Doradus/blob/ad64d3c37922eefda68ec8869ef089c1ca604b70/doradus-server/src/main/java/com/dell/doradus/service/spider/SpiderTransaction.java#L330-L334 |
cketti/ckChangeLog | ckChangeLog/src/main/java/de/cketti/library/changelog/ChangeLog.java | ChangeLog.getChangeLogComparator | protected Comparator<ReleaseItem> getChangeLogComparator() {
"""
Returns a {@link Comparator} that specifies the sort order of the {@link ReleaseItem}s.
<p>
The default implementation returns the items in reverse order (latest version first).
</p>
"""
return new Comparator<ReleaseItem>() {
... | java | protected Comparator<ReleaseItem> getChangeLogComparator() {
return new Comparator<ReleaseItem>() {
@Override
public int compare(ReleaseItem lhs, ReleaseItem rhs) {
if (lhs.versionCode < rhs.versionCode) {
return 1;
} else if (lhs.versi... | [
"protected",
"Comparator",
"<",
"ReleaseItem",
">",
"getChangeLogComparator",
"(",
")",
"{",
"return",
"new",
"Comparator",
"<",
"ReleaseItem",
">",
"(",
")",
"{",
"@",
"Override",
"public",
"int",
"compare",
"(",
"ReleaseItem",
"lhs",
",",
"ReleaseItem",
"rhs... | Returns a {@link Comparator} that specifies the sort order of the {@link ReleaseItem}s.
<p>
The default implementation returns the items in reverse order (latest version first).
</p> | [
"Returns",
"a",
"{",
"@link",
"Comparator",
"}",
"that",
"specifies",
"the",
"sort",
"order",
"of",
"the",
"{",
"@link",
"ReleaseItem",
"}",
"s",
"."
] | train | https://github.com/cketti/ckChangeLog/blob/e9a81ad3e043357e80922aa7c149241af73223d3/ckChangeLog/src/main/java/de/cketti/library/changelog/ChangeLog.java#L560-L573 |
dita-ot/dita-ot | src/main/java/org/dita/dost/module/reader/AbstractReaderModule.java | AbstractReaderModule.initXMLReader | void initXMLReader(final File ditaDir, final boolean validate) throws SAXException {
"""
Init xml reader used for pipeline parsing.
@param ditaDir absolute path to DITA-OT directory
@param validate whether validate input file
@throws SAXException parsing exception
"""
reader = XMLUtils.getXMLReade... | java | void initXMLReader(final File ditaDir, final boolean validate) throws SAXException {
reader = XMLUtils.getXMLReader();
reader.setFeature(FEATURE_NAMESPACE, true);
reader.setFeature(FEATURE_NAMESPACE_PREFIX, true);
if (validate) {
reader.setFeature(FEATURE_VALIDATION, true);
... | [
"void",
"initXMLReader",
"(",
"final",
"File",
"ditaDir",
",",
"final",
"boolean",
"validate",
")",
"throws",
"SAXException",
"{",
"reader",
"=",
"XMLUtils",
".",
"getXMLReader",
"(",
")",
";",
"reader",
".",
"setFeature",
"(",
"FEATURE_NAMESPACE",
",",
"true"... | Init xml reader used for pipeline parsing.
@param ditaDir absolute path to DITA-OT directory
@param validate whether validate input file
@throws SAXException parsing exception | [
"Init",
"xml",
"reader",
"used",
"for",
"pipeline",
"parsing",
"."
] | train | https://github.com/dita-ot/dita-ot/blob/ea776b3c60c03d9f033b6f7ea072349e49dbcdd2/src/main/java/org/dita/dost/module/reader/AbstractReaderModule.java#L186-L213 |
Ordinastie/MalisisCore | src/main/java/net/malisis/core/block/component/ItemTransformComponent.java | ItemTransformComponent.getTransform | public Matrix4f getTransform(Item item, TransformType transformType) {
"""
Gets the {@link Matrix4f transformation} for the specified {@link Item} and {@link TransformType}.
@param item the item
@param transformType the transform type
@return the transform
"""
switch (transformType)
{
case THIRD_PE... | java | public Matrix4f getTransform(Item item, TransformType transformType)
{
switch (transformType)
{
case THIRD_PERSON_LEFT_HAND:
return thirdPersonLeftHand;
case THIRD_PERSON_RIGHT_HAND:
return thirdPersonRightHand;
case FIRST_PERSON_LEFT_HAND:
return firstPersonLeftHand;
case FIRST_PERSON_RIGH... | [
"public",
"Matrix4f",
"getTransform",
"(",
"Item",
"item",
",",
"TransformType",
"transformType",
")",
"{",
"switch",
"(",
"transformType",
")",
"{",
"case",
"THIRD_PERSON_LEFT_HAND",
":",
"return",
"thirdPersonLeftHand",
";",
"case",
"THIRD_PERSON_RIGHT_HAND",
":",
... | Gets the {@link Matrix4f transformation} for the specified {@link Item} and {@link TransformType}.
@param item the item
@param transformType the transform type
@return the transform | [
"Gets",
"the",
"{",
"@link",
"Matrix4f",
"transformation",
"}",
"for",
"the",
"specified",
"{",
"@link",
"Item",
"}",
"and",
"{",
"@link",
"TransformType",
"}",
"."
] | train | https://github.com/Ordinastie/MalisisCore/blob/4f8e1fa462d5c372fc23414482ba9f429881cc54/src/main/java/net/malisis/core/block/component/ItemTransformComponent.java#L142-L165 |
Azure/azure-sdk-for-java | iothub/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/iothub/v2018_04_01/implementation/IotHubResourcesInner.java | IotHubResourcesInner.getByResourceGroupAsync | public Observable<IotHubDescriptionInner> getByResourceGroupAsync(String resourceGroupName, String resourceName) {
"""
Get the non-security related metadata of an IoT hub.
Get the non-security related metadata of an IoT hub.
@param resourceGroupName The name of the resource group that contains the IoT hub.
@p... | java | public Observable<IotHubDescriptionInner> getByResourceGroupAsync(String resourceGroupName, String resourceName) {
return getByResourceGroupWithServiceResponseAsync(resourceGroupName, resourceName).map(new Func1<ServiceResponse<IotHubDescriptionInner>, IotHubDescriptionInner>() {
@Override
... | [
"public",
"Observable",
"<",
"IotHubDescriptionInner",
">",
"getByResourceGroupAsync",
"(",
"String",
"resourceGroupName",
",",
"String",
"resourceName",
")",
"{",
"return",
"getByResourceGroupWithServiceResponseAsync",
"(",
"resourceGroupName",
",",
"resourceName",
")",
".... | Get the non-security related metadata of an IoT hub.
Get the non-security related metadata of an IoT hub.
@param resourceGroupName The name of the resource group that contains the IoT hub.
@param resourceName The name of the IoT hub.
@throws IllegalArgumentException thrown if parameters fail the validation
@return the... | [
"Get",
"the",
"non",
"-",
"security",
"related",
"metadata",
"of",
"an",
"IoT",
"hub",
".",
"Get",
"the",
"non",
"-",
"security",
"related",
"metadata",
"of",
"an",
"IoT",
"hub",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/iothub/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/iothub/v2018_04_01/implementation/IotHubResourcesInner.java#L254-L261 |
alkacon/opencms-core | src/org/opencms/db/generic/CmsUserDriver.java | CmsUserDriver.internalValidateUserInGroup | protected boolean internalValidateUserInGroup(CmsDbContext dbc, CmsUUID userId, CmsUUID groupId)
throws CmsDataAccessException {
"""
Checks if a user is member of a group.<p>
@param dbc the database context
@param userId the id of the user to check
@param groupId the id of the group to check
@return tr... | java | protected boolean internalValidateUserInGroup(CmsDbContext dbc, CmsUUID userId, CmsUUID groupId)
throws CmsDataAccessException {
boolean userInGroup = false;
PreparedStatement stmt = null;
ResultSet res = null;
Connection conn = null;
try {
conn = getSqlManager(... | [
"protected",
"boolean",
"internalValidateUserInGroup",
"(",
"CmsDbContext",
"dbc",
",",
"CmsUUID",
"userId",
",",
"CmsUUID",
"groupId",
")",
"throws",
"CmsDataAccessException",
"{",
"boolean",
"userInGroup",
"=",
"false",
";",
"PreparedStatement",
"stmt",
"=",
"null",... | Checks if a user is member of a group.<p>
@param dbc the database context
@param userId the id of the user to check
@param groupId the id of the group to check
@return true if user is member of group
@throws CmsDataAccessException if operation was not succesful | [
"Checks",
"if",
"a",
"user",
"is",
"member",
"of",
"a",
"group",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/db/generic/CmsUserDriver.java#L2883-L2913 |
Stratio/cassandra-lucene-index | plugin/src/main/java/com/stratio/cassandra/lucene/schema/mapping/GeoPointMapper.java | GeoPointMapper.readLatitude | private static Double readLatitude(Object o) {
"""
Returns the latitude contained in the specified {@link Object}.
A valid latitude must in the range [-90, 90].
@param o the {@link Object} containing the latitude
@return the latitude
"""
if (o == null) {
return null;
}
... | java | private static Double readLatitude(Object o) {
if (o == null) {
return null;
}
Double value;
if (o instanceof Number) {
value = ((Number) o).doubleValue();
} else {
try {
value = Double.valueOf(o.toString());
} catch... | [
"private",
"static",
"Double",
"readLatitude",
"(",
"Object",
"o",
")",
"{",
"if",
"(",
"o",
"==",
"null",
")",
"{",
"return",
"null",
";",
"}",
"Double",
"value",
";",
"if",
"(",
"o",
"instanceof",
"Number",
")",
"{",
"value",
"=",
"(",
"(",
"Numb... | Returns the latitude contained in the specified {@link Object}.
A valid latitude must in the range [-90, 90].
@param o the {@link Object} containing the latitude
@return the latitude | [
"Returns",
"the",
"latitude",
"contained",
"in",
"the",
"specified",
"{",
"@link",
"Object",
"}",
"."
] | train | https://github.com/Stratio/cassandra-lucene-index/blob/a94a4d9af6c25d40e1108729974c35c27c54441c/plugin/src/main/java/com/stratio/cassandra/lucene/schema/mapping/GeoPointMapper.java#L149-L164 |
google/j2objc | xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xalan/templates/ElemForEach.java | ElemForEach.callChildVisitors | public void callChildVisitors(XSLTVisitor visitor, boolean callAttributes) {
"""
Call the children visitors.
@param visitor The visitor whose appropriate method will be called.
"""
if(callAttributes && (null != m_selectExpression))
m_selectExpression.callVisitors(this, visitor);
int length = g... | java | public void callChildVisitors(XSLTVisitor visitor, boolean callAttributes)
{
if(callAttributes && (null != m_selectExpression))
m_selectExpression.callVisitors(this, visitor);
int length = getSortElemCount();
for (int i = 0; i < length; i++)
{
getSortElem(i).callVisitors(visitor);
}... | [
"public",
"void",
"callChildVisitors",
"(",
"XSLTVisitor",
"visitor",
",",
"boolean",
"callAttributes",
")",
"{",
"if",
"(",
"callAttributes",
"&&",
"(",
"null",
"!=",
"m_selectExpression",
")",
")",
"m_selectExpression",
".",
"callVisitors",
"(",
"this",
",",
"... | Call the children visitors.
@param visitor The visitor whose appropriate method will be called. | [
"Call",
"the",
"children",
"visitors",
"."
] | train | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xalan/templates/ElemForEach.java#L452-L465 |
ManfredTremmel/gwt-commons-lang3 | src/main/java/org/apache/commons/lang3/StringUtils.java | StringUtils.normalizeSpace | public static String normalizeSpace(final String str) {
"""
<p>
Similar to <a
href="http://www.w3.org/TR/xpath/#function-normalize-space">http://www.w3.org/TR/xpath/#function-normalize
-space</a>
</p>
<p>
The function returns the argument string with whitespace normalized by using
<code>{@link #trim(String)... | java | public static String normalizeSpace(final String str) {
// LANG-1020: Improved performance significantly by normalizing manually instead of using regex
// See https://github.com/librucha/commons-lang-normalizespaces-benchmark for performance test
if (isEmpty(str)) {
return str;
... | [
"public",
"static",
"String",
"normalizeSpace",
"(",
"final",
"String",
"str",
")",
"{",
"// LANG-1020: Improved performance significantly by normalizing manually instead of using regex",
"// See https://github.com/librucha/commons-lang-normalizespaces-benchmark for performance test",
"if",
... | <p>
Similar to <a
href="http://www.w3.org/TR/xpath/#function-normalize-space">http://www.w3.org/TR/xpath/#function-normalize
-space</a>
</p>
<p>
The function returns the argument string with whitespace normalized by using
<code>{@link #trim(String)}</code> to remove leading and trailing whitespace
and then replacing se... | [
"<p",
">",
"Similar",
"to",
"<a",
"href",
"=",
"http",
":",
"//",
"www",
".",
"w3",
".",
"org",
"/",
"TR",
"/",
"xpath",
"/",
"#function",
"-",
"normalize",
"-",
"space",
">",
"http",
":",
"//",
"www",
".",
"w3",
".",
"org",
"/",
"TR",
"/",
"... | train | https://github.com/ManfredTremmel/gwt-commons-lang3/blob/9e2dfbbda3668cfa5d935fe76479d1426c294504/src/main/java/org/apache/commons/lang3/StringUtils.java#L8691-L8720 |
Netflix/conductor | grpc-client/src/main/java/com/netflix/conductor/client/grpc/WorkflowClient.java | WorkflowClient.terminateWorkflow | public void terminateWorkflow(String workflowId, String reason) {
"""
Terminates the execution of the given workflow instance
@param workflowId the id of the workflow to be terminated
@param reason the reason to be logged and displayed
"""
Preconditions.checkArgument(StringUtils.isNotBlank(work... | java | public void terminateWorkflow(String workflowId, String reason) {
Preconditions.checkArgument(StringUtils.isNotBlank(workflowId), "workflow id cannot be blank");
stub.terminateWorkflow(WorkflowServicePb.TerminateWorkflowRequest.newBuilder()
.setWorkflowId(workflowId)
.set... | [
"public",
"void",
"terminateWorkflow",
"(",
"String",
"workflowId",
",",
"String",
"reason",
")",
"{",
"Preconditions",
".",
"checkArgument",
"(",
"StringUtils",
".",
"isNotBlank",
"(",
"workflowId",
")",
",",
"\"workflow id cannot be blank\"",
")",
";",
"stub",
"... | Terminates the execution of the given workflow instance
@param workflowId the id of the workflow to be terminated
@param reason the reason to be logged and displayed | [
"Terminates",
"the",
"execution",
"of",
"the",
"given",
"workflow",
"instance"
] | train | https://github.com/Netflix/conductor/blob/78fae0ed9ddea22891f9eebb96a2ec0b2783dca0/grpc-client/src/main/java/com/netflix/conductor/client/grpc/WorkflowClient.java#L267-L274 |
Azure/azure-sdk-for-java | network/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/network/v2018_04_01/implementation/VirtualNetworkGatewaysInner.java | VirtualNetworkGatewaysInner.getByResourceGroup | public VirtualNetworkGatewayInner getByResourceGroup(String resourceGroupName, String virtualNetworkGatewayName) {
"""
Gets the specified virtual network gateway by resource group.
@param resourceGroupName The name of the resource group.
@param virtualNetworkGatewayName The name of the virtual network gateway.... | java | public VirtualNetworkGatewayInner getByResourceGroup(String resourceGroupName, String virtualNetworkGatewayName) {
return getByResourceGroupWithServiceResponseAsync(resourceGroupName, virtualNetworkGatewayName).toBlocking().single().body();
} | [
"public",
"VirtualNetworkGatewayInner",
"getByResourceGroup",
"(",
"String",
"resourceGroupName",
",",
"String",
"virtualNetworkGatewayName",
")",
"{",
"return",
"getByResourceGroupWithServiceResponseAsync",
"(",
"resourceGroupName",
",",
"virtualNetworkGatewayName",
")",
".",
... | Gets the specified virtual network gateway by resource group.
@param resourceGroupName The name of the resource group.
@param virtualNetworkGatewayName The name of the virtual network gateway.
@throws IllegalArgumentException thrown if parameters fail the validation
@throws CloudException thrown if the request is reje... | [
"Gets",
"the",
"specified",
"virtual",
"network",
"gateway",
"by",
"resource",
"group",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/network/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/network/v2018_04_01/implementation/VirtualNetworkGatewaysInner.java#L376-L378 |
strator-dev/greenpepper | greenpepper/greenpepper-client/src/main/java/com/greenpepper/server/domain/Project.java | Project.addRepository | public void addRepository(Repository repo) throws GreenPepperServerException {
"""
<p>addRepository.</p>
@param repo a {@link com.greenpepper.server.domain.Repository} object.
@throws com.greenpepper.server.GreenPepperServerException if any.
"""
if (findRepositoryByName(repo.getName()) != null)
... | java | public void addRepository(Repository repo) throws GreenPepperServerException
{
if (findRepositoryByName(repo.getName()) != null)
{
throw new GreenPepperServerException( GreenPepperServerErrorKey.REPOSITORY_ALREADY_EXISTS, "Repository already exists");
}
repo.setProject(t... | [
"public",
"void",
"addRepository",
"(",
"Repository",
"repo",
")",
"throws",
"GreenPepperServerException",
"{",
"if",
"(",
"findRepositoryByName",
"(",
"repo",
".",
"getName",
"(",
")",
")",
"!=",
"null",
")",
"{",
"throw",
"new",
"GreenPepperServerException",
"... | <p>addRepository.</p>
@param repo a {@link com.greenpepper.server.domain.Repository} object.
@throws com.greenpepper.server.GreenPepperServerException if any. | [
"<p",
">",
"addRepository",
".",
"<",
"/",
"p",
">"
] | train | https://github.com/strator-dev/greenpepper/blob/2a61e6c179b74085babcc559d677490b0cad2d30/greenpepper/greenpepper-client/src/main/java/com/greenpepper/server/domain/Project.java#L121-L130 |
OpenLiberty/open-liberty | dev/com.ibm.ws.webcontainer.security/src/com/ibm/ws/webcontainer/security/internal/FormLogoutExtensionProcessor.java | FormLogoutExtensionProcessor.isRequestURLEqualsExitPageHost | private boolean isRequestURLEqualsExitPageHost(HttpServletRequest req, String logoutURLhost) {
"""
Attempt to match the request URL's host with the URL for the exitPage this might be
the case of a proxy URL that is used in the request.
@param req
@param acceptURL
@return
"""
boolean acceptURL = f... | java | private boolean isRequestURLEqualsExitPageHost(HttpServletRequest req, String logoutURLhost) {
boolean acceptURL = false;
try {
if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled())
Tr.debug(tc, "about to attempt matching the logout exit url with the domain of the ... | [
"private",
"boolean",
"isRequestURLEqualsExitPageHost",
"(",
"HttpServletRequest",
"req",
",",
"String",
"logoutURLhost",
")",
"{",
"boolean",
"acceptURL",
"=",
"false",
";",
"try",
"{",
"if",
"(",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
"&&",
"tc"... | Attempt to match the request URL's host with the URL for the exitPage this might be
the case of a proxy URL that is used in the request.
@param req
@param acceptURL
@return | [
"Attempt",
"to",
"match",
"the",
"request",
"URL",
"s",
"host",
"with",
"the",
"URL",
"for",
"the",
"exitPage",
"this",
"might",
"be",
"the",
"case",
"of",
"a",
"proxy",
"URL",
"that",
"is",
"used",
"in",
"the",
"request",
"."
] | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.webcontainer.security/src/com/ibm/ws/webcontainer/security/internal/FormLogoutExtensionProcessor.java#L359-L378 |
redisson/redisson | redisson/src/main/java/org/redisson/config/Config.java | Config.fromJSON | public static Config fromJSON(File file, ClassLoader classLoader) throws IOException {
"""
Read config object stored in JSON format from <code>File</code>
@param file object
@param classLoader class loader
@return config
@throws IOException error
"""
ConfigSupport support = new ConfigSupport();
... | java | public static Config fromJSON(File file, ClassLoader classLoader) throws IOException {
ConfigSupport support = new ConfigSupport();
return support.fromJSON(file, Config.class, classLoader);
} | [
"public",
"static",
"Config",
"fromJSON",
"(",
"File",
"file",
",",
"ClassLoader",
"classLoader",
")",
"throws",
"IOException",
"{",
"ConfigSupport",
"support",
"=",
"new",
"ConfigSupport",
"(",
")",
";",
"return",
"support",
".",
"fromJSON",
"(",
"file",
",",... | Read config object stored in JSON format from <code>File</code>
@param file object
@param classLoader class loader
@return config
@throws IOException error | [
"Read",
"config",
"object",
"stored",
"in",
"JSON",
"format",
"from",
"<code",
">",
"File<",
"/",
"code",
">"
] | train | https://github.com/redisson/redisson/blob/d3acc0249b2d5d658d36d99e2c808ce49332ea44/redisson/src/main/java/org/redisson/config/Config.java#L581-L584 |
VoltDB/voltdb | src/frontend/org/voltdb/planner/AbstractParsedStmt.java | AbstractParsedStmt.addTableToStmtCache | protected StmtTableScan addTableToStmtCache(Table table, String tableAlias) {
"""
Add a table to the statement cache.
@param table
@param tableAlias
@return the cache entry
"""
// Create an index into the query Catalog cache
StmtTableScan tableScan = m_tableAliasMap.get(tableAlias);
... | java | protected StmtTableScan addTableToStmtCache(Table table, String tableAlias) {
// Create an index into the query Catalog cache
StmtTableScan tableScan = m_tableAliasMap.get(tableAlias);
if (tableScan == null) {
tableScan = new StmtTargetTableScan(table, tableAlias, m_stmtId);
... | [
"protected",
"StmtTableScan",
"addTableToStmtCache",
"(",
"Table",
"table",
",",
"String",
"tableAlias",
")",
"{",
"// Create an index into the query Catalog cache",
"StmtTableScan",
"tableScan",
"=",
"m_tableAliasMap",
".",
"get",
"(",
"tableAlias",
")",
";",
"if",
"("... | Add a table to the statement cache.
@param table
@param tableAlias
@return the cache entry | [
"Add",
"a",
"table",
"to",
"the",
"statement",
"cache",
"."
] | train | https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/src/frontend/org/voltdb/planner/AbstractParsedStmt.java#L804-L812 |
Azure/azure-sdk-for-java | automation/resource-manager/v2015_10_31/src/main/java/com/microsoft/azure/management/automation/v2015_10_31/implementation/SchedulesInner.java | SchedulesInner.updateAsync | public Observable<ScheduleInner> updateAsync(String resourceGroupName, String automationAccountName, String scheduleName, ScheduleUpdateParameters parameters) {
"""
Update the schedule identified by schedule name.
@param resourceGroupName Name of an Azure Resource group.
@param automationAccountName The name o... | java | public Observable<ScheduleInner> updateAsync(String resourceGroupName, String automationAccountName, String scheduleName, ScheduleUpdateParameters parameters) {
return updateWithServiceResponseAsync(resourceGroupName, automationAccountName, scheduleName, parameters).map(new Func1<ServiceResponse<ScheduleInner>,... | [
"public",
"Observable",
"<",
"ScheduleInner",
">",
"updateAsync",
"(",
"String",
"resourceGroupName",
",",
"String",
"automationAccountName",
",",
"String",
"scheduleName",
",",
"ScheduleUpdateParameters",
"parameters",
")",
"{",
"return",
"updateWithServiceResponseAsync",
... | Update the schedule identified by schedule name.
@param resourceGroupName Name of an Azure Resource group.
@param automationAccountName The name of the automation account.
@param scheduleName The schedule name.
@param parameters The parameters supplied to the update schedule operation.
@throws IllegalArgumentException... | [
"Update",
"the",
"schedule",
"identified",
"by",
"schedule",
"name",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/automation/resource-manager/v2015_10_31/src/main/java/com/microsoft/azure/management/automation/v2015_10_31/implementation/SchedulesInner.java#L234-L241 |
alibaba/jstorm | jstorm-core/src/main/java/backtype/storm/security/auth/AuthUtils.java | AuthUtils.GetTransportPlugin | public static ITransportPlugin GetTransportPlugin(ThriftConnectionType type, Map storm_conf, Configuration login_conf) {
"""
Construct a transport plugin per storm configuration
@param conf storm configuration
@return
"""
ITransportPlugin transportPlugin = null;
try {
String tra... | java | public static ITransportPlugin GetTransportPlugin(ThriftConnectionType type, Map storm_conf, Configuration login_conf) {
ITransportPlugin transportPlugin = null;
try {
String transport_plugin_klassName = type.getTransportPlugin(storm_conf);
Class klass = Class.forName(transport_p... | [
"public",
"static",
"ITransportPlugin",
"GetTransportPlugin",
"(",
"ThriftConnectionType",
"type",
",",
"Map",
"storm_conf",
",",
"Configuration",
"login_conf",
")",
"{",
"ITransportPlugin",
"transportPlugin",
"=",
"null",
";",
"try",
"{",
"String",
"transport_plugin_kl... | Construct a transport plugin per storm configuration
@param conf storm configuration
@return | [
"Construct",
"a",
"transport",
"plugin",
"per",
"storm",
"configuration"
] | train | https://github.com/alibaba/jstorm/blob/5d6cde22dbca7df3d6e6830bf94f98a6639ab559/jstorm-core/src/main/java/backtype/storm/security/auth/AuthUtils.java#L230-L241 |
Samsung/GearVRf | GVRf/Extensions/widgetLib/src/org/gearvrf/widgetlib/widget/Widget.java | Widget.enableClipRegion | public void enableClipRegion() {
"""
Enable clipping for the Widget. Widget content including its children will be clipped by a
rectangular View Port. By default clipping is disabled.
"""
if (mClippingEnabled) {
Log.w(TAG, "Clipping has been enabled already for %s!", getName());
... | java | public void enableClipRegion() {
if (mClippingEnabled) {
Log.w(TAG, "Clipping has been enabled already for %s!", getName());
return;
}
Log.d(Log.SUBSYSTEM.WIDGET, TAG, "enableClipping for %s [%f, %f, %f]",
getName(), getViewPortWidth(), getViewPortHeight()... | [
"public",
"void",
"enableClipRegion",
"(",
")",
"{",
"if",
"(",
"mClippingEnabled",
")",
"{",
"Log",
".",
"w",
"(",
"TAG",
",",
"\"Clipping has been enabled already for %s!\"",
",",
"getName",
"(",
")",
")",
";",
"return",
";",
"}",
"Log",
".",
"d",
"(",
... | Enable clipping for the Widget. Widget content including its children will be clipped by a
rectangular View Port. By default clipping is disabled. | [
"Enable",
"clipping",
"for",
"the",
"Widget",
".",
"Widget",
"content",
"including",
"its",
"children",
"will",
"be",
"clipped",
"by",
"a",
"rectangular",
"View",
"Port",
".",
"By",
"default",
"clipping",
"is",
"disabled",
"."
] | train | https://github.com/Samsung/GearVRf/blob/05034d465a7b0a494fabb9e9f2971ac19392f32d/GVRf/Extensions/widgetLib/src/org/gearvrf/widgetlib/widget/Widget.java#L884-L910 |
git-commit-id/maven-git-commit-id-plugin | src/main/java/pl/project13/jgit/DescribeCommand.java | DescribeCommand.on | @Nonnull
public static DescribeCommand on(String evaluateOnCommit, Repository repo, LoggerBridge log) {
"""
Creates a new describe command which interacts with a single repository
@param repo the {@link Repository} this command should interact with
@param log logger bridge to direct logs to
"""
retur... | java | @Nonnull
public static DescribeCommand on(String evaluateOnCommit, Repository repo, LoggerBridge log) {
return new DescribeCommand(evaluateOnCommit, repo, log);
} | [
"@",
"Nonnull",
"public",
"static",
"DescribeCommand",
"on",
"(",
"String",
"evaluateOnCommit",
",",
"Repository",
"repo",
",",
"LoggerBridge",
"log",
")",
"{",
"return",
"new",
"DescribeCommand",
"(",
"evaluateOnCommit",
",",
"repo",
",",
"log",
")",
";",
"}"... | Creates a new describe command which interacts with a single repository
@param repo the {@link Repository} this command should interact with
@param log logger bridge to direct logs to | [
"Creates",
"a",
"new",
"describe",
"command",
"which",
"interacts",
"with",
"a",
"single",
"repository"
] | train | https://github.com/git-commit-id/maven-git-commit-id-plugin/blob/a276551fb043d1b7fc4c890603f6ea0c79dc729a/src/main/java/pl/project13/jgit/DescribeCommand.java#L85-L88 |
moparisthebest/beehive | beehive-netui-core/src/main/java/org/apache/beehive/netui/pageflow/PageFlowUtils.java | PageFlowUtils.removeSharedFlow | public static void removeSharedFlow( String sharedFlowClassName, HttpServletRequest request,
ServletContext servletContext ) {
"""
Destroy the current {@link SharedFlowController} of the given class name.
@param sharedFlowClassName the class name of the current SharedFlowC... | java | public static void removeSharedFlow( String sharedFlowClassName, HttpServletRequest request,
ServletContext servletContext )
{
StorageHandler sh = Handlers.get( servletContext ).getStorageHandler();
HttpServletRequest unwrappedRequest = unwrapMultipart( reque... | [
"public",
"static",
"void",
"removeSharedFlow",
"(",
"String",
"sharedFlowClassName",
",",
"HttpServletRequest",
"request",
",",
"ServletContext",
"servletContext",
")",
"{",
"StorageHandler",
"sh",
"=",
"Handlers",
".",
"get",
"(",
"servletContext",
")",
".",
"getS... | Destroy the current {@link SharedFlowController} of the given class name.
@param sharedFlowClassName the class name of the current SharedFlowController to destroy.
@param request the current HttpServletRequest. | [
"Destroy",
"the",
"current",
"{"
] | train | https://github.com/moparisthebest/beehive/blob/4246a0cc40ce3c05f1a02c2da2653ac622703d77/beehive-netui-core/src/main/java/org/apache/beehive/netui/pageflow/PageFlowUtils.java#L406-L415 |
aNNiMON/Lightweight-Stream-API | stream/src/main/java/com/annimon/stream/Stream.java | Stream.filterIndexed | @NotNull
public Stream<T> filterIndexed(@NotNull IndexedPredicate<? super T> predicate) {
"""
Returns a {@code Stream} with elements that satisfy the given {@code IndexedPredicate}.
<p>This is an intermediate operation.
<p>Example:
<pre>
predicate: (index, value) -> (index + value) > 6
stream: [... | java | @NotNull
public Stream<T> filterIndexed(@NotNull IndexedPredicate<? super T> predicate) {
return filterIndexed(0, 1, predicate);
} | [
"@",
"NotNull",
"public",
"Stream",
"<",
"T",
">",
"filterIndexed",
"(",
"@",
"NotNull",
"IndexedPredicate",
"<",
"?",
"super",
"T",
">",
"predicate",
")",
"{",
"return",
"filterIndexed",
"(",
"0",
",",
"1",
",",
"predicate",
")",
";",
"}"
] | Returns a {@code Stream} with elements that satisfy the given {@code IndexedPredicate}.
<p>This is an intermediate operation.
<p>Example:
<pre>
predicate: (index, value) -> (index + value) > 6
stream: [1, 2, 3, 4, 0, 11]
index: [0, 1, 2, 3, 4, 5]
sum: [1, 3, 5, 7, 4, 16]
filter: [ 7, 16]
result:... | [
"Returns",
"a",
"{",
"@code",
"Stream",
"}",
"with",
"elements",
"that",
"satisfy",
"the",
"given",
"{",
"@code",
"IndexedPredicate",
"}",
"."
] | train | https://github.com/aNNiMON/Lightweight-Stream-API/blob/f29fd57208c20252a4549b084d55ed082c3e58f0/stream/src/main/java/com/annimon/stream/Stream.java#L613-L616 |
OpenLiberty/open-liberty | dev/com.ibm.tx.core/src/com/ibm/ws/Transaction/JTA/JTAResourceBase.java | JTAResourceBase.processXAException | protected void processXAException(String operation, XAException xae) {
"""
Trace information about an XAException that was thrown by an
<code>XAResource</code>. This method will not rethrow the exception
but will simply trace it.
@param operation the method name that caught the exception
@param xae the <cod... | java | protected void processXAException(String operation, XAException xae)
{
if (tc.isEventEnabled())
{
Tr.event(tc, "XAResource {0} threw an XAException during {1}. The error code provided was {2}.", new Object[] {
_resource,
operation,
XARetur... | [
"protected",
"void",
"processXAException",
"(",
"String",
"operation",
",",
"XAException",
"xae",
")",
"{",
"if",
"(",
"tc",
".",
"isEventEnabled",
"(",
")",
")",
"{",
"Tr",
".",
"event",
"(",
"tc",
",",
"\"XAResource {0} threw an XAException during {1}. The erro... | Trace information about an XAException that was thrown by an
<code>XAResource</code>. This method will not rethrow the exception
but will simply trace it.
@param operation the method name that caught the exception
@param xae the <code>XAException</code> that was thrown | [
"Trace",
"information",
"about",
"an",
"XAException",
"that",
"was",
"thrown",
"by",
"an",
"<code",
">",
"XAResource<",
"/",
"code",
">",
".",
"This",
"method",
"will",
"not",
"rethrow",
"the",
"exception",
"but",
"will",
"simply",
"trace",
"it",
"."
] | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.tx.core/src/com/ibm/ws/Transaction/JTA/JTAResourceBase.java#L309-L330 |
networknt/light-4j | resource/src/main/java/com/networknt/resource/ResourceHelpers.java | ResourceHelpers.isResourcePath | public static boolean isResourcePath(String requestPath, PathResourceProvider[] pathResourceProviders) {
"""
Helper to check if a given requestPath could resolve to a PathResourceProvider.
@param requestPath The client request path.
@param pathResourceProviders The list of PathResourceProviders that could potent... | java | public static boolean isResourcePath(String requestPath, PathResourceProvider[] pathResourceProviders) {
boolean isResourcePath = false;
if (pathResourceProviders != null && pathResourceProviders.length > 0) {
for (PathResourceProvider pathResourceProvider : pathResourceProviders) {
... | [
"public",
"static",
"boolean",
"isResourcePath",
"(",
"String",
"requestPath",
",",
"PathResourceProvider",
"[",
"]",
"pathResourceProviders",
")",
"{",
"boolean",
"isResourcePath",
"=",
"false",
";",
"if",
"(",
"pathResourceProviders",
"!=",
"null",
"&&",
"pathReso... | Helper to check if a given requestPath could resolve to a PathResourceProvider.
@param requestPath The client request path.
@param pathResourceProviders The list of PathResourceProviders that could potentially resolve this path.
@return true if the path could resolve, false otherwise. | [
"Helper",
"to",
"check",
"if",
"a",
"given",
"requestPath",
"could",
"resolve",
"to",
"a",
"PathResourceProvider",
"."
] | train | https://github.com/networknt/light-4j/blob/2a60257c60663684c8f6dc8b5ea3cf184e534db6/resource/src/main/java/com/networknt/resource/ResourceHelpers.java#L72-L83 |
codeprimate-software/cp-elements | src/main/java/org/cp/elements/context/configure/AbstractConfiguration.java | AbstractConfiguration.getPropertyValueAs | @SuppressWarnings("unchecked")
public <T> T getPropertyValueAs(final String propertyName, final T defaultPropertyValue, final Class<T> type) {
"""
Gets the value of the configuration property identified by name as a value of the specified Class type.
The defaultPropertyValue parameter effectively overrides the ... | java | @SuppressWarnings("unchecked")
public <T> T getPropertyValueAs(final String propertyName, final T defaultPropertyValue, final Class<T> type) {
try {
return ObjectUtils.defaultIfNull(convert(getPropertyValue(propertyName, NOT_REQUIRED), type),
defaultPropertyValue);
}
catch (ConversionExcepti... | [
"@",
"SuppressWarnings",
"(",
"\"unchecked\"",
")",
"public",
"<",
"T",
">",
"T",
"getPropertyValueAs",
"(",
"final",
"String",
"propertyName",
",",
"final",
"T",
"defaultPropertyValue",
",",
"final",
"Class",
"<",
"T",
">",
"type",
")",
"{",
"try",
"{",
"... | Gets the value of the configuration property identified by name as a value of the specified Class type.
The defaultPropertyValue parameter effectively overrides the required attribute indicating that the property
is not required to be declared or defined.
@param propertyName a String value indicating the name of the c... | [
"Gets",
"the",
"value",
"of",
"the",
"configuration",
"property",
"identified",
"by",
"name",
"as",
"a",
"value",
"of",
"the",
"specified",
"Class",
"type",
".",
"The",
"defaultPropertyValue",
"parameter",
"effectively",
"overrides",
"the",
"required",
"attribute"... | train | https://github.com/codeprimate-software/cp-elements/blob/f2163c149fbbef05015e688132064ebcac7c49ab/src/main/java/org/cp/elements/context/configure/AbstractConfiguration.java#L274-L283 |
fcrepo3/fcrepo | fcrepo-server/src/main/java/org/fcrepo/server/Server.java | Server.createModuleBeanDefinition | protected static GenericBeanDefinition createModuleBeanDefinition(String className, Map<String,String> params, String role)
throws IOException {
"""
Generates Spring Bean definitions for Fedora Modules.
Server param should be unnecessary if autowired.
@param className
@param params
@param role
@return... | java | protected static GenericBeanDefinition createModuleBeanDefinition(String className, Map<String,String> params, String role)
throws IOException {
ScannedGenericBeanDefinition result = getScannedBeanDefinition(className);
result.setParentName(Module.class.getName());
result.setScope(BeanDe... | [
"protected",
"static",
"GenericBeanDefinition",
"createModuleBeanDefinition",
"(",
"String",
"className",
",",
"Map",
"<",
"String",
",",
"String",
">",
"params",
",",
"String",
"role",
")",
"throws",
"IOException",
"{",
"ScannedGenericBeanDefinition",
"result",
"=",
... | Generates Spring Bean definitions for Fedora Modules.
Server param should be unnecessary if autowired.
@param className
@param params
@param role
@return | [
"Generates",
"Spring",
"Bean",
"definitions",
"for",
"Fedora",
"Modules",
".",
"Server",
"param",
"should",
"be",
"unnecessary",
"if",
"autowired",
"."
] | train | https://github.com/fcrepo3/fcrepo/blob/37df51b9b857fd12c6ab8269820d406c3c4ad774/fcrepo-server/src/main/java/org/fcrepo/server/Server.java#L787-L807 |
DiUS/pact-jvm | pact-jvm-consumer-java8/src/main/java/io/pactfoundation/consumer/dsl/LambdaDslObject.java | LambdaDslObject.eachKeyLike | public LambdaDslObject eachKeyLike(String exampleKey, Consumer<LambdaDslObject> nestedObject) {
"""
Accepts any key, and each key is mapped to a map that must match the following object definition.
Note: this needs the Java system property "pact.matching.wildcard" set to value "true" when the pact file is verifie... | java | public LambdaDslObject eachKeyLike(String exampleKey, Consumer<LambdaDslObject> nestedObject) {
final PactDslJsonBody objectLike = object.eachKeyLike(exampleKey);
final LambdaDslObject dslObject = new LambdaDslObject(objectLike);
nestedObject.accept(dslObject);
objectLike.closeObject();
... | [
"public",
"LambdaDslObject",
"eachKeyLike",
"(",
"String",
"exampleKey",
",",
"Consumer",
"<",
"LambdaDslObject",
">",
"nestedObject",
")",
"{",
"final",
"PactDslJsonBody",
"objectLike",
"=",
"object",
".",
"eachKeyLike",
"(",
"exampleKey",
")",
";",
"final",
"Lam... | Accepts any key, and each key is mapped to a map that must match the following object definition.
Note: this needs the Java system property "pact.matching.wildcard" set to value "true" when the pact file is verified.
@param exampleKey Example key to use for generating bodies | [
"Accepts",
"any",
"key",
"and",
"each",
"key",
"is",
"mapped",
"to",
"a",
"map",
"that",
"must",
"match",
"the",
"following",
"object",
"definition",
".",
"Note",
":",
"this",
"needs",
"the",
"Java",
"system",
"property",
"pact",
".",
"matching",
".",
"w... | train | https://github.com/DiUS/pact-jvm/blob/2f447e9dd4ac152a6a36b7fcf8962d07de9ef3ef/pact-jvm-consumer-java8/src/main/java/io/pactfoundation/consumer/dsl/LambdaDslObject.java#L665-L671 |
google/error-prone-javac | src/jdk.compiler/share/classes/com/sun/source/util/SimpleDocTreeVisitor.java | SimpleDocTreeVisitor.visitStartElement | @Override
public R visitStartElement(StartElementTree node, P p) {
"""
{@inheritDoc} This implementation calls {@code defaultAction}.
@param node {@inheritDoc}
@param p {@inheritDoc}
@return the result of {@code defaultAction}
"""
return defaultAction(node, p);
} | java | @Override
public R visitStartElement(StartElementTree node, P p) {
return defaultAction(node, p);
} | [
"@",
"Override",
"public",
"R",
"visitStartElement",
"(",
"StartElementTree",
"node",
",",
"P",
"p",
")",
"{",
"return",
"defaultAction",
"(",
"node",
",",
"p",
")",
";",
"}"
] | {@inheritDoc} This implementation calls {@code defaultAction}.
@param node {@inheritDoc}
@param p {@inheritDoc}
@return the result of {@code defaultAction} | [
"{",
"@inheritDoc",
"}",
"This",
"implementation",
"calls",
"{",
"@code",
"defaultAction",
"}",
"."
] | train | https://github.com/google/error-prone-javac/blob/a53d069bbdb2c60232ed3811c19b65e41c3e60e0/src/jdk.compiler/share/classes/com/sun/source/util/SimpleDocTreeVisitor.java#L393-L396 |
banq/jdonframework | src/main/java/com/jdon/util/jdom/XMLFilterBase.java | XMLFilterBase.dataElement | public void dataElement (String localName, Attributes atts, String content)
throws SAXException {
"""
Add an element with character data content but no Namespace URI or qname.
<p>This is a convenience method to add a complete element
with character data content, including the start tag
and end tag. The ... | java | public void dataElement (String localName, Attributes atts, String content)
throws SAXException
{
dataElement("", localName, "", atts, content);
} | [
"public",
"void",
"dataElement",
"(",
"String",
"localName",
",",
"Attributes",
"atts",
",",
"String",
"content",
")",
"throws",
"SAXException",
"{",
"dataElement",
"(",
"\"\"",
",",
"localName",
",",
"\"\"",
",",
"atts",
",",
"content",
")",
";",
"}"
] | Add an element with character data content but no Namespace URI or qname.
<p>This is a convenience method to add a complete element
with character data content, including the start tag
and end tag. The method provides an empty string for the
Namespace URI, and empty string for the qualified name. It invokes
{@link #d... | [
"Add",
"an",
"element",
"with",
"character",
"data",
"content",
"but",
"no",
"Namespace",
"URI",
"or",
"qname",
"."
] | train | https://github.com/banq/jdonframework/blob/72b451caac04f775e57f52aaed3d8775044ead53/src/main/java/com/jdon/util/jdom/XMLFilterBase.java#L433-L437 |
phax/ph-commons | ph-cli/src/main/java/com/helger/cli/HelpFormatter.java | HelpFormatter._appendOptionGroup | private void _appendOptionGroup (final StringBuilder aSB, final OptionGroup aGroup) {
"""
Appends the usage clause for an OptionGroup to a StringBuilder. The clause
is wrapped in square brackets if the group is required. The display of the
options is handled by appendOption
@param aSB
the StringBuilder to ap... | java | private void _appendOptionGroup (final StringBuilder aSB, final OptionGroup aGroup)
{
if (!aGroup.isRequired ())
aSB.append ('[');
final ICommonsList <Option> optList = aGroup.getAllOptions ();
if (m_aOptionComparator != null)
optList.sort (m_aOptionComparator);
// for each option in the... | [
"private",
"void",
"_appendOptionGroup",
"(",
"final",
"StringBuilder",
"aSB",
",",
"final",
"OptionGroup",
"aGroup",
")",
"{",
"if",
"(",
"!",
"aGroup",
".",
"isRequired",
"(",
")",
")",
"aSB",
".",
"append",
"(",
"'",
"'",
")",
";",
"final",
"ICommonsL... | Appends the usage clause for an OptionGroup to a StringBuilder. The clause
is wrapped in square brackets if the group is required. The display of the
options is handled by appendOption
@param aSB
the StringBuilder to append to
@param aGroup
the group to append
@see #_appendOption(StringBuilder,Option,boolean) | [
"Appends",
"the",
"usage",
"clause",
"for",
"an",
"OptionGroup",
"to",
"a",
"StringBuilder",
".",
"The",
"clause",
"is",
"wrapped",
"in",
"square",
"brackets",
"if",
"the",
"group",
"is",
"required",
".",
"The",
"display",
"of",
"the",
"options",
"is",
"ha... | train | https://github.com/phax/ph-commons/blob/d28c03565f44a0b804d96028d0969f9bb38c4313/ph-cli/src/main/java/com/helger/cli/HelpFormatter.java#L688-L710 |
alibaba/jstorm | jstorm-core/src/main/java/backtype/storm/topology/TopologyBuilder.java | TopologyBuilder.setBolt | public BoltDeclarer setBolt(String id, IControlBolt bolt, Number parallelism_hint) {
"""
Define a new bolt in this topology. This defines a control bolt, which is a simpler to use but more restricted kind of bolt. Control bolts are intended for
making sending control message more simply
@param id the id of this ... | java | public BoltDeclarer setBolt(String id, IControlBolt bolt, Number parallelism_hint) {
return setBolt(id, new ControlBoltExecutor(bolt), parallelism_hint);
} | [
"public",
"BoltDeclarer",
"setBolt",
"(",
"String",
"id",
",",
"IControlBolt",
"bolt",
",",
"Number",
"parallelism_hint",
")",
"{",
"return",
"setBolt",
"(",
"id",
",",
"new",
"ControlBoltExecutor",
"(",
"bolt",
")",
",",
"parallelism_hint",
")",
";",
"}"
] | Define a new bolt in this topology. This defines a control bolt, which is a simpler to use but more restricted kind of bolt. Control bolts are intended for
making sending control message more simply
@param id the id of this component. This id is referenced by other components that want to consume this bolt's outputs.
@... | [
"Define",
"a",
"new",
"bolt",
"in",
"this",
"topology",
".",
"This",
"defines",
"a",
"control",
"bolt",
"which",
"is",
"a",
"simpler",
"to",
"use",
"but",
"more",
"restricted",
"kind",
"of",
"bolt",
".",
"Control",
"bolts",
"are",
"intended",
"for",
"mak... | train | https://github.com/alibaba/jstorm/blob/5d6cde22dbca7df3d6e6830bf94f98a6639ab559/jstorm-core/src/main/java/backtype/storm/topology/TopologyBuilder.java#L350-L352 |
undertow-io/undertow | core/src/main/java/io/undertow/util/FlexBase64.java | FlexBase64.encodeString | public static String encodeString(ByteBuffer source, boolean wrap) {
"""
Encodes a fixed and complete byte buffer into a Base64 String.
<p>This method is only useful for applications which require a String and have all data to be encoded up-front.
Note that byte arrays or buffers are almost always a better sto... | java | public static String encodeString(ByteBuffer source, boolean wrap) {
return Encoder.encodeString(source, wrap, false);
} | [
"public",
"static",
"String",
"encodeString",
"(",
"ByteBuffer",
"source",
",",
"boolean",
"wrap",
")",
"{",
"return",
"Encoder",
".",
"encodeString",
"(",
"source",
",",
"wrap",
",",
"false",
")",
";",
"}"
] | Encodes a fixed and complete byte buffer into a Base64 String.
<p>This method is only useful for applications which require a String and have all data to be encoded up-front.
Note that byte arrays or buffers are almost always a better storage choice. They consume half the memory and
can be reused (modified). In other ... | [
"Encodes",
"a",
"fixed",
"and",
"complete",
"byte",
"buffer",
"into",
"a",
"Base64",
"String",
"."
] | train | https://github.com/undertow-io/undertow/blob/87de0b856a7a4ba8faf5b659537b9af07b763263/core/src/main/java/io/undertow/util/FlexBase64.java#L232-L234 |
threerings/nenya | core/src/main/java/com/threerings/resource/FileResourceBundle.java | FileResourceBundle.setCacheDir | public static void setCacheDir (File tmpdir) {
"""
Specifies the directory in which our temporary resource files should be stored.
"""
String rando = Long.toHexString((long)(Math.random() * Long.MAX_VALUE));
_tmpdir = new File(tmpdir, "narcache_" + rando);
if (!_tmpdir.exists()) {
... | java | public static void setCacheDir (File tmpdir)
{
String rando = Long.toHexString((long)(Math.random() * Long.MAX_VALUE));
_tmpdir = new File(tmpdir, "narcache_" + rando);
if (!_tmpdir.exists()) {
if (_tmpdir.mkdirs()) {
log.debug("Created narya temp cache directory ... | [
"public",
"static",
"void",
"setCacheDir",
"(",
"File",
"tmpdir",
")",
"{",
"String",
"rando",
"=",
"Long",
".",
"toHexString",
"(",
"(",
"long",
")",
"(",
"Math",
".",
"random",
"(",
")",
"*",
"Long",
".",
"MAX_VALUE",
")",
")",
";",
"_tmpdir",
"=",... | Specifies the directory in which our temporary resource files should be stored. | [
"Specifies",
"the",
"directory",
"in",
"which",
"our",
"temporary",
"resource",
"files",
"should",
"be",
"stored",
"."
] | train | https://github.com/threerings/nenya/blob/3165a012fd859009db3367f87bd2a5b820cc760a/core/src/main/java/com/threerings/resource/FileResourceBundle.java#L353-L373 |
joniles/mpxj | src/main/java/net/sf/mpxj/mspdi/MSPDIWriter.java | MSPDIWriter.writeAvailability | private void writeAvailability(Project.Resources.Resource xml, Resource mpx) {
"""
This method writes a resource's availability table.
@param xml MSPDI resource
@param mpx MPXJ resource
"""
AvailabilityPeriods periods = m_factory.createProjectResourcesResourceAvailabilityPeriods();
xml.setAvail... | java | private void writeAvailability(Project.Resources.Resource xml, Resource mpx)
{
AvailabilityPeriods periods = m_factory.createProjectResourcesResourceAvailabilityPeriods();
xml.setAvailabilityPeriods(periods);
List<AvailabilityPeriod> list = periods.getAvailabilityPeriod();
for (Availability a... | [
"private",
"void",
"writeAvailability",
"(",
"Project",
".",
"Resources",
".",
"Resource",
"xml",
",",
"Resource",
"mpx",
")",
"{",
"AvailabilityPeriods",
"periods",
"=",
"m_factory",
".",
"createProjectResourcesResourceAvailabilityPeriods",
"(",
")",
";",
"xml",
".... | This method writes a resource's availability table.
@param xml MSPDI resource
@param mpx MPXJ resource | [
"This",
"method",
"writes",
"a",
"resource",
"s",
"availability",
"table",
"."
] | train | https://github.com/joniles/mpxj/blob/143ea0e195da59cd108f13b3b06328e9542337e8/src/main/java/net/sf/mpxj/mspdi/MSPDIWriter.java#L1012-L1027 |
derari/cthul | objects/src/main/java/org/cthul/objects/Boxing.java | Boxing.boxAll | public static Object[] boxAll(Class<?> type, Object src, int srcPos, int len) {
"""
Transforms a primitive array into an array of boxed values.
@param type target type
@param src source array
@param srcPos start position
@param len length
@return array
"""
switch (tId(type)) {
case I_B... | java | public static Object[] boxAll(Class<?> type, Object src, int srcPos, int len) {
switch (tId(type)) {
case I_BOOLEAN: return boxBooleans(src, srcPos, len);
case I_BYTE: return boxBytes(src, srcPos, len);
case I_CHARACTER: return boxCharacters(src, srcPos, len);
... | [
"public",
"static",
"Object",
"[",
"]",
"boxAll",
"(",
"Class",
"<",
"?",
">",
"type",
",",
"Object",
"src",
",",
"int",
"srcPos",
",",
"int",
"len",
")",
"{",
"switch",
"(",
"tId",
"(",
"type",
")",
")",
"{",
"case",
"I_BOOLEAN",
":",
"return",
... | Transforms a primitive array into an array of boxed values.
@param type target type
@param src source array
@param srcPos start position
@param len length
@return array | [
"Transforms",
"a",
"primitive",
"array",
"into",
"an",
"array",
"of",
"boxed",
"values",
"."
] | train | https://github.com/derari/cthul/blob/74a31e3cb6a94f5f25cc5253d1dbd42e19a17ebc/objects/src/main/java/org/cthul/objects/Boxing.java#L447-L459 |
virgo47/javasimon | console-embed/src/main/java/org/javasimon/console/ActionContext.java | ActionContext.getParameterAsEnum | public <T extends Enum<T>> T getParameterAsEnum(String name, Class<T> type, T defaultValue) {
"""
Get request parameter as a Enum.
@param name Parameter name
@param type Enum type
@param defaultValue Parameter default value (can be null)
@return Parameter value
"""
return defaultValue(stringToEnum(get... | java | public <T extends Enum<T>> T getParameterAsEnum(String name, Class<T> type, T defaultValue) {
return defaultValue(stringToEnum(getParameter(name), type), defaultValue);
} | [
"public",
"<",
"T",
"extends",
"Enum",
"<",
"T",
">",
">",
"T",
"getParameterAsEnum",
"(",
"String",
"name",
",",
"Class",
"<",
"T",
">",
"type",
",",
"T",
"defaultValue",
")",
"{",
"return",
"defaultValue",
"(",
"stringToEnum",
"(",
"getParameter",
"(",... | Get request parameter as a Enum.
@param name Parameter name
@param type Enum type
@param defaultValue Parameter default value (can be null)
@return Parameter value | [
"Get",
"request",
"parameter",
"as",
"a",
"Enum",
"."
] | train | https://github.com/virgo47/javasimon/blob/17dfaa93cded9ce8ef64a134b28ccbf4d0284d2f/console-embed/src/main/java/org/javasimon/console/ActionContext.java#L166-L168 |
jbundle/jbundle | base/base/src/main/java/org/jbundle/base/field/event/MainReadOnlyHandler.java | MainReadOnlyHandler.init | public void init(BaseField field, String keyName) {
"""
Constructor.
@param field The basefield owner of this listener (usually null and set on setOwner()).
@param iKeySeq The key area to read.
"""
super.init(field, keyName);
m_bReadOnly = true;
} | java | public void init(BaseField field, String keyName)
{
super.init(field, keyName);
m_bReadOnly = true;
} | [
"public",
"void",
"init",
"(",
"BaseField",
"field",
",",
"String",
"keyName",
")",
"{",
"super",
".",
"init",
"(",
"field",
",",
"keyName",
")",
";",
"m_bReadOnly",
"=",
"true",
";",
"}"
] | Constructor.
@param field The basefield owner of this listener (usually null and set on setOwner()).
@param iKeySeq The key area to read. | [
"Constructor",
"."
] | train | https://github.com/jbundle/jbundle/blob/4037fcfa85f60c7d0096c453c1a3cd573c2b0abc/base/base/src/main/java/org/jbundle/base/field/event/MainReadOnlyHandler.java#L47-L52 |
alkacon/opencms-core | src/org/opencms/ui/dialogs/CmsPublishScheduledDialog.java | CmsPublishScheduledDialog.computeProjectName | private String computeProjectName(String rootPath, Date date) {
"""
Creates the publish project's name for a given root path and publish date.<p>
@param rootPath the publish resource's root path
@param date the publish date
@return the publish project name
"""
// create the temporary project, w... | java | private String computeProjectName(String rootPath, Date date) {
// create the temporary project, which is deleted after publishing
// the publish scheduled date in project name
String dateTime = CmsDateUtil.getDateTime(date, DateFormat.SHORT, getLocale());
// the resource name to publis... | [
"private",
"String",
"computeProjectName",
"(",
"String",
"rootPath",
",",
"Date",
"date",
")",
"{",
"// create the temporary project, which is deleted after publishing",
"// the publish scheduled date in project name",
"String",
"dateTime",
"=",
"CmsDateUtil",
".",
"getDateTime"... | Creates the publish project's name for a given root path and publish date.<p>
@param rootPath the publish resource's root path
@param date the publish date
@return the publish project name | [
"Creates",
"the",
"publish",
"project",
"s",
"name",
"for",
"a",
"given",
"root",
"path",
"and",
"publish",
"date",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/ui/dialogs/CmsPublishScheduledDialog.java#L316-L334 |
b3dgs/lionengine | lionengine-game/src/main/java/com/b3dgs/lionengine/game/feature/collidable/ComponentCollision.java | ComponentCollision.checkOthers | private void checkOthers(Collidable objectA, Entry<Point, Set<Collidable>> current, Integer acceptedGroup) {
"""
Check others element.
@param objectA The collidable reference.
@param current The current group to check.
@param acceptedGroup The accepted group.
"""
final Map<Point, Set<Collidable>> ... | java | private void checkOthers(Collidable objectA, Entry<Point, Set<Collidable>> current, Integer acceptedGroup)
{
final Map<Point, Set<Collidable>> acceptedElements = collidables.get(acceptedGroup);
final Point point = current.getKey();
if (acceptedElements.containsKey(point))
{
... | [
"private",
"void",
"checkOthers",
"(",
"Collidable",
"objectA",
",",
"Entry",
"<",
"Point",
",",
"Set",
"<",
"Collidable",
">",
">",
"current",
",",
"Integer",
"acceptedGroup",
")",
"{",
"final",
"Map",
"<",
"Point",
",",
"Set",
"<",
"Collidable",
">",
"... | Check others element.
@param objectA The collidable reference.
@param current The current group to check.
@param acceptedGroup The accepted group. | [
"Check",
"others",
"element",
"."
] | train | https://github.com/b3dgs/lionengine/blob/cac3d5578532cf11724a737b9f09e71bf9995ab2/lionengine-game/src/main/java/com/b3dgs/lionengine/game/feature/collidable/ComponentCollision.java#L183-L191 |
qatools/properties | src/main/java/ru/qatools/properties/PropertyLoader.java | PropertyLoader.getKey | protected String getKey(String prefix, AnnotatedElement element) {
"""
Get property key for specified element with given prefix. Annotation {@link Property} should
be present.
"""
String value = element.getAnnotation(Property.class).value();
return concat(prefix, value);
} | java | protected String getKey(String prefix, AnnotatedElement element) {
String value = element.getAnnotation(Property.class).value();
return concat(prefix, value);
} | [
"protected",
"String",
"getKey",
"(",
"String",
"prefix",
",",
"AnnotatedElement",
"element",
")",
"{",
"String",
"value",
"=",
"element",
".",
"getAnnotation",
"(",
"Property",
".",
"class",
")",
".",
"value",
"(",
")",
";",
"return",
"concat",
"(",
"pref... | Get property key for specified element with given prefix. Annotation {@link Property} should
be present. | [
"Get",
"property",
"key",
"for",
"specified",
"element",
"with",
"given",
"prefix",
".",
"Annotation",
"{"
] | train | https://github.com/qatools/properties/blob/ae50b460a6bb4fcb21afe888b2e86a7613cd2115/src/main/java/ru/qatools/properties/PropertyLoader.java#L248-L251 |
banq/jdonframework | src/main/java/com/jdon/util/UtilDateTime.java | UtilDateTime.toSqlDate | public static java.sql.Date toSqlDate(String monthStr, String dayStr, String yearStr) {
"""
Makes a java.sql.Date from separate Strings for month, day, year
@param monthStr
The month String
@param dayStr
The day String
@param yearStr
The year String
@return A java.sql.Date made from separate Strings for m... | java | public static java.sql.Date toSqlDate(String monthStr, String dayStr, String yearStr) {
java.util.Date newDate = toDate(monthStr, dayStr, yearStr, "0", "0", "0");
if (newDate != null)
return new java.sql.Date(newDate.getTime());
else
return null;
} | [
"public",
"static",
"java",
".",
"sql",
".",
"Date",
"toSqlDate",
"(",
"String",
"monthStr",
",",
"String",
"dayStr",
",",
"String",
"yearStr",
")",
"{",
"java",
".",
"util",
".",
"Date",
"newDate",
"=",
"toDate",
"(",
"monthStr",
",",
"dayStr",
",",
"... | Makes a java.sql.Date from separate Strings for month, day, year
@param monthStr
The month String
@param dayStr
The day String
@param yearStr
The year String
@return A java.sql.Date made from separate Strings for month, day, year | [
"Makes",
"a",
"java",
".",
"sql",
".",
"Date",
"from",
"separate",
"Strings",
"for",
"month",
"day",
"year"
] | train | https://github.com/banq/jdonframework/blob/72b451caac04f775e57f52aaed3d8775044ead53/src/main/java/com/jdon/util/UtilDateTime.java#L117-L124 |
DataSketches/sketches-core | src/main/java/com/yahoo/sketches/hash/MurmurHash3.java | MurmurHash3.getLong | private static long getLong(final int[] intArr, final int index, final int rem) {
"""
Gets a long from the given int array starting at the given int array index and continuing for
remainder (rem) integers. The integers are extracted in little-endian order. There is no limit
checking.
@param intArr The given i... | java | private static long getLong(final int[] intArr, final int index, final int rem) {
long out = 0L;
for (int i = rem; i-- > 0;) { //i= 1,0
final int v = intArr[index + i];
out ^= (v & 0xFFFFFFFFL) << (i * 32); //equivalent to |=
}
return out;
} | [
"private",
"static",
"long",
"getLong",
"(",
"final",
"int",
"[",
"]",
"intArr",
",",
"final",
"int",
"index",
",",
"final",
"int",
"rem",
")",
"{",
"long",
"out",
"=",
"0L",
";",
"for",
"(",
"int",
"i",
"=",
"rem",
";",
"i",
"--",
">",
"0",
";... | Gets a long from the given int array starting at the given int array index and continuing for
remainder (rem) integers. The integers are extracted in little-endian order. There is no limit
checking.
@param intArr The given input int array.
@param index Zero-based index from the start of the int array.
@param rem Remai... | [
"Gets",
"a",
"long",
"from",
"the",
"given",
"int",
"array",
"starting",
"at",
"the",
"given",
"int",
"array",
"index",
"and",
"continuing",
"for",
"remainder",
"(",
"rem",
")",
"integers",
".",
"The",
"integers",
"are",
"extracted",
"in",
"little",
"-",
... | train | https://github.com/DataSketches/sketches-core/blob/900c8c9668a1e2f1d54d453e956caad54702e540/src/main/java/com/yahoo/sketches/hash/MurmurHash3.java#L346-L353 |
aerospike/aerospike-helper | java/src/main/java/com/aerospike/helper/Utils.java | Utils.printInfo | public static void printInfo(String title, String infoString) {
"""
Prints an "Info" message with a title to System.out
@param title Title to be printed
@param infoString Info string from cluster
"""
if (infoString == null) {
System.out.println("Null info string");
return;
}
String[] outerPar... | java | public static void printInfo(String title, String infoString) {
if (infoString == null) {
System.out.println("Null info string");
return;
}
String[] outerParts = infoString.split(";");
System.out.println(title);
for (String s : outerParts) {
String[] innerParts = s.split(":");
for (String parts :... | [
"public",
"static",
"void",
"printInfo",
"(",
"String",
"title",
",",
"String",
"infoString",
")",
"{",
"if",
"(",
"infoString",
"==",
"null",
")",
"{",
"System",
".",
"out",
".",
"println",
"(",
"\"Null info string\"",
")",
";",
"return",
";",
"}",
"Str... | Prints an "Info" message with a title to System.out
@param title Title to be printed
@param infoString Info string from cluster | [
"Prints",
"an",
"Info",
"message",
"with",
"a",
"title",
"to",
"System",
".",
"out"
] | train | https://github.com/aerospike/aerospike-helper/blob/eeb4a1464bc8d9c6716c014d250c8166b5caa82d/java/src/main/java/com/aerospike/helper/Utils.java#L36-L51 |
msteiger/jxmapviewer2 | jxmapviewer2/src/main/java/org/jxmapviewer/painter/AbstractPainter.java | AbstractPainter.setVisible | public void setVisible(boolean visible) {
"""
<p>Sets the visible property. This controls if the painter should
paint itself. It is true by default. Setting visible to false
is good when you want to temporarily turn off a painter. An example
of this is a painter that you only use when a button is highlighted.</... | java | public void setVisible(boolean visible) {
boolean old = isVisible();
this.visible = visible;
if (old != visible) setDirty(true); //not the most efficient, but I must do this otherwise a CompoundPainter
//or other aggregate painter won't know that it is... | [
"public",
"void",
"setVisible",
"(",
"boolean",
"visible",
")",
"{",
"boolean",
"old",
"=",
"isVisible",
"(",
")",
";",
"this",
".",
"visible",
"=",
"visible",
";",
"if",
"(",
"old",
"!=",
"visible",
")",
"setDirty",
"(",
"true",
")",
";",
"//not the m... | <p>Sets the visible property. This controls if the painter should
paint itself. It is true by default. Setting visible to false
is good when you want to temporarily turn off a painter. An example
of this is a painter that you only use when a button is highlighted.</p>
@param visible New value of visible property. | [
"<p",
">",
"Sets",
"the",
"visible",
"property",
".",
"This",
"controls",
"if",
"the",
"painter",
"should",
"paint",
"itself",
".",
"It",
"is",
"true",
"by",
"default",
".",
"Setting",
"visible",
"to",
"false",
"is",
"good",
"when",
"you",
"want",
"to",
... | train | https://github.com/msteiger/jxmapviewer2/blob/82639273b0aac983b6026fb90aa925c0cf596410/jxmapviewer2/src/main/java/org/jxmapviewer/painter/AbstractPainter.java#L211-L218 |
khuxtable/seaglass | src/main/java/com/seaglasslookandfeel/painter/CheckBoxMenuItemPainter.java | CheckBoxMenuItemPainter.paintCheckIconSelectedAndMouseOver | private void paintCheckIconSelectedAndMouseOver(Graphics2D g, int width, int height) {
"""
Paint the check mark in mouse over state.
@param g the Graphics2D context to paint with.
@param width the width.
@param height the height.
"""
Shape s = shapeGenerator.createCheckMark(0, 0, width, heig... | java | private void paintCheckIconSelectedAndMouseOver(Graphics2D g, int width, int height) {
Shape s = shapeGenerator.createCheckMark(0, 0, width, height);
g.setPaint(iconSelectedMouseOver);
g.fill(s);
} | [
"private",
"void",
"paintCheckIconSelectedAndMouseOver",
"(",
"Graphics2D",
"g",
",",
"int",
"width",
",",
"int",
"height",
")",
"{",
"Shape",
"s",
"=",
"shapeGenerator",
".",
"createCheckMark",
"(",
"0",
",",
"0",
",",
"width",
",",
"height",
")",
";",
"g... | Paint the check mark in mouse over state.
@param g the Graphics2D context to paint with.
@param width the width.
@param height the height. | [
"Paint",
"the",
"check",
"mark",
"in",
"mouse",
"over",
"state",
"."
] | train | https://github.com/khuxtable/seaglass/blob/f25ecba622923d7b29b64cb7d6068dd8005989b3/src/main/java/com/seaglasslookandfeel/painter/CheckBoxMenuItemPainter.java#L173-L178 |
actorapp/actor-platform | actor-sdk/sdk-core/core/core-shared/src/main/java/im/actor/core/Messenger.java | Messenger.unbindRawUploadFile | @ObjectiveCName("unbindRawUploadFileWithRid:withCallback:")
public void unbindRawUploadFile(long rid, UploadFileCallback callback) {
"""
Unbind Raw Upload File
@param rid randomId of uploading file
@param callback file state callback
"""
modules.getFilesModule().unbindUploadFile(rid, callb... | java | @ObjectiveCName("unbindRawUploadFileWithRid:withCallback:")
public void unbindRawUploadFile(long rid, UploadFileCallback callback) {
modules.getFilesModule().unbindUploadFile(rid, callback);
} | [
"@",
"ObjectiveCName",
"(",
"\"unbindRawUploadFileWithRid:withCallback:\"",
")",
"public",
"void",
"unbindRawUploadFile",
"(",
"long",
"rid",
",",
"UploadFileCallback",
"callback",
")",
"{",
"modules",
".",
"getFilesModule",
"(",
")",
".",
"unbindUploadFile",
"(",
"ri... | Unbind Raw Upload File
@param rid randomId of uploading file
@param callback file state callback | [
"Unbind",
"Raw",
"Upload",
"File"
] | train | https://github.com/actorapp/actor-platform/blob/5123c1584757c6eeea0ed2a0e7e043629871a0c6/actor-sdk/sdk-core/core/core-shared/src/main/java/im/actor/core/Messenger.java#L1964-L1967 |
Alluxio/alluxio | core/server/master/src/main/java/alluxio/master/file/meta/InodeTreePersistentState.java | InodeTreePersistentState.applyAndJournal | public void applyAndJournal(Supplier<JournalContext> context, UpdateInodeDirectoryEntry entry) {
"""
Updates an inode directory's state.
@param context journal context supplier
@param entry update inode directory entry
"""
try {
applyUpdateInodeDirectory(entry);
context.get().append(Journal... | java | public void applyAndJournal(Supplier<JournalContext> context, UpdateInodeDirectoryEntry entry) {
try {
applyUpdateInodeDirectory(entry);
context.get().append(JournalEntry.newBuilder().setUpdateInodeDirectory(entry).build());
} catch (Throwable t) {
ProcessUtils.fatalError(LOG, t, "Failed to ap... | [
"public",
"void",
"applyAndJournal",
"(",
"Supplier",
"<",
"JournalContext",
">",
"context",
",",
"UpdateInodeDirectoryEntry",
"entry",
")",
"{",
"try",
"{",
"applyUpdateInodeDirectory",
"(",
"entry",
")",
";",
"context",
".",
"get",
"(",
")",
".",
"append",
"... | Updates an inode directory's state.
@param context journal context supplier
@param entry update inode directory entry | [
"Updates",
"an",
"inode",
"directory",
"s",
"state",
"."
] | train | https://github.com/Alluxio/alluxio/blob/af38cf3ab44613355b18217a3a4d961f8fec3a10/core/server/master/src/main/java/alluxio/master/file/meta/InodeTreePersistentState.java#L250-L258 |
Azure/azure-sdk-for-java | labservices/resource-manager/v2018_10_15/src/main/java/com/microsoft/azure/management/labservices/v2018_10_15/implementation/GalleryImagesInner.java | GalleryImagesInner.getAsync | public Observable<GalleryImageInner> getAsync(String resourceGroupName, String labAccountName, String galleryImageName) {
"""
Get gallery image.
@param resourceGroupName The name of the resource group.
@param labAccountName The name of the lab Account.
@param galleryImageName The name of the gallery Image.
@... | java | public Observable<GalleryImageInner> getAsync(String resourceGroupName, String labAccountName, String galleryImageName) {
return getWithServiceResponseAsync(resourceGroupName, labAccountName, galleryImageName).map(new Func1<ServiceResponse<GalleryImageInner>, GalleryImageInner>() {
@Override
... | [
"public",
"Observable",
"<",
"GalleryImageInner",
">",
"getAsync",
"(",
"String",
"resourceGroupName",
",",
"String",
"labAccountName",
",",
"String",
"galleryImageName",
")",
"{",
"return",
"getWithServiceResponseAsync",
"(",
"resourceGroupName",
",",
"labAccountName",
... | Get gallery image.
@param resourceGroupName The name of the resource group.
@param labAccountName The name of the lab Account.
@param galleryImageName The name of the gallery Image.
@throws IllegalArgumentException thrown if parameters fail the validation
@return the observable to the GalleryImageInner object | [
"Get",
"gallery",
"image",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/labservices/resource-manager/v2018_10_15/src/main/java/com/microsoft/azure/management/labservices/v2018_10_15/implementation/GalleryImagesInner.java#L393-L400 |
orbisgis/h2gis | h2gis-functions/src/main/java/org/h2gis/functions/io/geojson/GeoJsonReaderDriver.java | GeoJsonReaderDriver.parseGeometryCollectionMetadata | private void parseGeometryCollectionMetadata(JsonParser jp) throws IOException, SQLException {
"""
Parses a GeometryCollection
the geometry objects are described above:
{ "type": "GeometryCollection", "geometries": [ { "type": "Point",
"coordinates": [100.0, 0.0] }, { "type": "LineString", "coordinates": [
[... | java | private void parseGeometryCollectionMetadata(JsonParser jp) throws IOException, SQLException {
jp.nextToken(); // FIELD_NAME geometries
String coordinatesField = jp.getText();
if (coordinatesField.equalsIgnoreCase(GeoJsonField.GEOMETRIES)) {
jp.nextToken();//START array
... | [
"private",
"void",
"parseGeometryCollectionMetadata",
"(",
"JsonParser",
"jp",
")",
"throws",
"IOException",
",",
"SQLException",
"{",
"jp",
".",
"nextToken",
"(",
")",
";",
"// FIELD_NAME geometries ",
"String",
"coordinatesField",
"=",
"jp",
".",
"getText",
... | Parses a GeometryCollection
the geometry objects are described above:
{ "type": "GeometryCollection", "geometries": [ { "type": "Point",
"coordinates": [100.0, 0.0] }, { "type": "LineString", "coordinates": [
[101.0, 0.0], [102.0, 1.0] ] } ]
@param jp
@throws IOException
@throws SQLException
@return GeometryCollecti... | [
"Parses",
"a",
"GeometryCollection",
"the",
"geometry",
"objects",
"are",
"described",
"above",
":"
] | train | https://github.com/orbisgis/h2gis/blob/9cd70b447e6469cecbc2fc64b16774b59491df3b/h2gis-functions/src/main/java/org/h2gis/functions/io/geojson/GeoJsonReaderDriver.java#L607-L625 |
google/cloud-reporting | src/main/java/com/google/cloud/metrics/MetricsUtils.java | MetricsUtils.buildVirtualPageTitle | static String buildVirtualPageTitle(Map<String, String> metadata) {
"""
Creates a virtual page title from a set of metadata key-value pairs.
@param metadata Metadata map.
@return Virtual page title constructed from the metadata, escaped as required by the format.
"""
checkNotNull(metadata);
List<St... | java | static String buildVirtualPageTitle(Map<String, String> metadata) {
checkNotNull(metadata);
List<String> escapedMetadata = new ArrayList<>();
for (Map.Entry<String, String> entry : metadata.entrySet()) {
escapedMetadata.add(METADATA_ESCAPER.escape(entry.getKey()) + "="
+ METADATA_ESCAPER.esc... | [
"static",
"String",
"buildVirtualPageTitle",
"(",
"Map",
"<",
"String",
",",
"String",
">",
"metadata",
")",
"{",
"checkNotNull",
"(",
"metadata",
")",
";",
"List",
"<",
"String",
">",
"escapedMetadata",
"=",
"new",
"ArrayList",
"<>",
"(",
")",
";",
"for",... | Creates a virtual page title from a set of metadata key-value pairs.
@param metadata Metadata map.
@return Virtual page title constructed from the metadata, escaped as required by the format. | [
"Creates",
"a",
"virtual",
"page",
"title",
"from",
"a",
"set",
"of",
"metadata",
"key",
"-",
"value",
"pairs",
"."
] | train | https://github.com/google/cloud-reporting/blob/af2a8ff6077a9763f7f2d405dd55c82efaead0ac/src/main/java/com/google/cloud/metrics/MetricsUtils.java#L152-L160 |
Azure/azure-sdk-for-java | redis/resource-manager/v2017_10_01/src/main/java/com/microsoft/azure/management/redis/v2017_10_01/implementation/FirewallRulesInner.java | FirewallRulesInner.listByRedisResourceWithServiceResponseAsync | public Observable<ServiceResponse<Page<RedisFirewallRuleInner>>> listByRedisResourceWithServiceResponseAsync(final String resourceGroupName, final String cacheName) {
"""
Gets all firewall rules in the specified redis cache.
@param resourceGroupName The name of the resource group.
@param cacheName The name of ... | java | public Observable<ServiceResponse<Page<RedisFirewallRuleInner>>> listByRedisResourceWithServiceResponseAsync(final String resourceGroupName, final String cacheName) {
return listByRedisResourceSinglePageAsync(resourceGroupName, cacheName)
.concatMap(new Func1<ServiceResponse<Page<RedisFirewallRuleIn... | [
"public",
"Observable",
"<",
"ServiceResponse",
"<",
"Page",
"<",
"RedisFirewallRuleInner",
">",
">",
">",
"listByRedisResourceWithServiceResponseAsync",
"(",
"final",
"String",
"resourceGroupName",
",",
"final",
"String",
"cacheName",
")",
"{",
"return",
"listByRedisRe... | Gets all firewall rules in the specified redis cache.
@param resourceGroupName The name of the resource group.
@param cacheName The name of the Redis cache.
@throws IllegalArgumentException thrown if parameters fail the validation
@return the observable to the PagedList<RedisFirewallRuleInner> object | [
"Gets",
"all",
"firewall",
"rules",
"in",
"the",
"specified",
"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/FirewallRulesInner.java#L154-L166 |
briandilley/jsonrpc4j | src/main/java/com/googlecode/jsonrpc4j/JsonRpcClient.java | JsonRpcClient.invokeAndReadResponse | @SuppressWarnings("unchecked")
public <T> T invokeAndReadResponse(String methodName, Object argument, Class<T> clazz, OutputStream output, InputStream input) throws Throwable {
"""
Invokes the given method on the remote service
passing the given arguments, a generated id and reads
a response.
@param methodNa... | java | @SuppressWarnings("unchecked")
public <T> T invokeAndReadResponse(String methodName, Object argument, Class<T> clazz, OutputStream output, InputStream input) throws Throwable {
return (T) invokeAndReadResponse(methodName, argument, Type.class.cast(clazz), output, input);
} | [
"@",
"SuppressWarnings",
"(",
"\"unchecked\"",
")",
"public",
"<",
"T",
">",
"T",
"invokeAndReadResponse",
"(",
"String",
"methodName",
",",
"Object",
"argument",
",",
"Class",
"<",
"T",
">",
"clazz",
",",
"OutputStream",
"output",
",",
"InputStream",
"input",... | Invokes the given method on the remote service
passing the given arguments, a generated id and reads
a response.
@param methodName the method to invoke
@param argument the argument to pass to the method
@param clazz the expected return type
@param output the {@link OutputStream} to write to
@param input ... | [
"Invokes",
"the",
"given",
"method",
"on",
"the",
"remote",
"service",
"passing",
"the",
"given",
"arguments",
"a",
"generated",
"id",
"and",
"reads",
"a",
"response",
"."
] | train | https://github.com/briandilley/jsonrpc4j/blob/d749762c9295b92d893677a8c7be2a14dd43b3bb/src/main/java/com/googlecode/jsonrpc4j/JsonRpcClient.java#L119-L122 |
btrplace/scheduler | choco/src/main/java/org/btrplace/scheduler/choco/constraint/mttr/VMPlacementUtils.java | VMPlacementUtils.canStay | public static boolean canStay(ReconfigurationProblem rp, VM vm) {
"""
Check if a VM can stay on its current node.
@param rp the reconfiguration problem.
@param vm the VM
@return {@code true} iff the VM can stay
"""
Mapping m = rp.getSourceModel().getMapping();
if (m.isRunning(vm)) {
... | java | public static boolean canStay(ReconfigurationProblem rp, VM vm) {
Mapping m = rp.getSourceModel().getMapping();
if (m.isRunning(vm)) {
int curPos = rp.getNode(m.getVMLocation(vm));
return rp.getVMAction(vm).getDSlice().getHoster().contains(curPos);
}
return false;... | [
"public",
"static",
"boolean",
"canStay",
"(",
"ReconfigurationProblem",
"rp",
",",
"VM",
"vm",
")",
"{",
"Mapping",
"m",
"=",
"rp",
".",
"getSourceModel",
"(",
")",
".",
"getMapping",
"(",
")",
";",
"if",
"(",
"m",
".",
"isRunning",
"(",
"vm",
")",
... | Check if a VM can stay on its current node.
@param rp the reconfiguration problem.
@param vm the VM
@return {@code true} iff the VM can stay | [
"Check",
"if",
"a",
"VM",
"can",
"stay",
"on",
"its",
"current",
"node",
"."
] | train | https://github.com/btrplace/scheduler/blob/611063aad0b47a016e57ebf36fa4dfdf24de09e8/choco/src/main/java/org/btrplace/scheduler/choco/constraint/mttr/VMPlacementUtils.java#L63-L70 |
Scalified/viewmover | viewmover/src/main/java/com/scalified/viewmover/movers/PositionViewMover.java | PositionViewMover.changeViewPosition | @TargetApi(Build.VERSION_CODES.JELLY_BEAN)
@Override
void changeViewPosition(float xAxisDelta, float yAxisDelta) {
"""
Changes the position of the view based on view's visual position within its parent container
@param xAxisDelta X-axis delta in actual pixels
@param yAxisDelta Y-axis delta in actual pixels
... | java | @TargetApi(Build.VERSION_CODES.JELLY_BEAN)
@Override
void changeViewPosition(float xAxisDelta, float yAxisDelta) {
float endLeftBoundPointX = calculateEndLeftBound(xAxisDelta);
float endTopBoundPointY = calculateEndTopBound(yAxisDelta);
getView().setX(endLeftBoundPointX);
getView().setY(endTopBoundPointY);
... | [
"@",
"TargetApi",
"(",
"Build",
".",
"VERSION_CODES",
".",
"JELLY_BEAN",
")",
"@",
"Override",
"void",
"changeViewPosition",
"(",
"float",
"xAxisDelta",
",",
"float",
"yAxisDelta",
")",
"{",
"float",
"endLeftBoundPointX",
"=",
"calculateEndLeftBound",
"(",
"xAxisD... | Changes the position of the view based on view's visual position within its parent container
@param xAxisDelta X-axis delta in actual pixels
@param yAxisDelta Y-axis delta in actual pixels | [
"Changes",
"the",
"position",
"of",
"the",
"view",
"based",
"on",
"view",
"s",
"visual",
"position",
"within",
"its",
"parent",
"container"
] | train | https://github.com/Scalified/viewmover/blob/e2b35f7d8517a5533afe8b68a4c1ee352d9aec34/viewmover/src/main/java/com/scalified/viewmover/movers/PositionViewMover.java#L57-L65 |
Chorus-bdd/Chorus | interpreter/chorus-util/src/main/java/org/chorusbdd/chorus/util/assertion/ChorusAssert.java | ChorusAssert.assertEquals | static public void assertEquals(String message, char expected, char actual) {
"""
Asserts that two chars are equal. If they are not
an AssertionFailedError is thrown with the given message.
"""
assertEquals(message, new Character(expected), new Character(actual));
} | java | static public void assertEquals(String message, char expected, char actual) {
assertEquals(message, new Character(expected), new Character(actual));
} | [
"static",
"public",
"void",
"assertEquals",
"(",
"String",
"message",
",",
"char",
"expected",
",",
"char",
"actual",
")",
"{",
"assertEquals",
"(",
"message",
",",
"new",
"Character",
"(",
"expected",
")",
",",
"new",
"Character",
"(",
"actual",
")",
")",... | Asserts that two chars are equal. If they are not
an AssertionFailedError is thrown with the given message. | [
"Asserts",
"that",
"two",
"chars",
"are",
"equal",
".",
"If",
"they",
"are",
"not",
"an",
"AssertionFailedError",
"is",
"thrown",
"with",
"the",
"given",
"message",
"."
] | train | https://github.com/Chorus-bdd/Chorus/blob/1eea7ca858876bce821bb49b43fd5b6ba1737997/interpreter/chorus-util/src/main/java/org/chorusbdd/chorus/util/assertion/ChorusAssert.java#L202-L204 |
matomo-org/piwik-java-tracker | src/main/java/org/piwik/java/tracking/PiwikRequest.java | PiwikRequest.setCustomVariable | private void setCustomVariable(String parameter, CustomVariable customVariable, Integer index) {
"""
Store a value in a json object at the specified parameter.
@param parameter the parameter to store the json object at
@param key the key of the value. Cannot be null
@param value the value. Removes the paramet... | java | private void setCustomVariable(String parameter, CustomVariable customVariable, Integer index){
CustomVariableList cvl = (CustomVariableList)parameters.get(parameter);
if (cvl == null){
cvl = new CustomVariableList();
parameters.put(parameter, cvl);
}
if ... | [
"private",
"void",
"setCustomVariable",
"(",
"String",
"parameter",
",",
"CustomVariable",
"customVariable",
",",
"Integer",
"index",
")",
"{",
"CustomVariableList",
"cvl",
"=",
"(",
"CustomVariableList",
")",
"parameters",
".",
"get",
"(",
"parameter",
")",
";",
... | Store a value in a json object at the specified parameter.
@param parameter the parameter to store the json object at
@param key the key of the value. Cannot be null
@param value the value. Removes the parameter if null | [
"Store",
"a",
"value",
"in",
"a",
"json",
"object",
"at",
"the",
"specified",
"parameter",
"."
] | train | https://github.com/matomo-org/piwik-java-tracker/blob/23df71d27a89e89dc7a539b2eda88c90a206458b/src/main/java/org/piwik/java/tracking/PiwikRequest.java#L1858-L1877 |
spring-projects/spring-boot | spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/AutoConfigurationImportSelector.java | AutoConfigurationImportSelector.getAutoConfigurationEntry | protected AutoConfigurationEntry getAutoConfigurationEntry(
AutoConfigurationMetadata autoConfigurationMetadata,
AnnotationMetadata annotationMetadata) {
"""
Return the {@link AutoConfigurationEntry} based on the {@link AnnotationMetadata}
of the importing {@link Configuration @Configuration} class.
@param... | java | protected AutoConfigurationEntry getAutoConfigurationEntry(
AutoConfigurationMetadata autoConfigurationMetadata,
AnnotationMetadata annotationMetadata) {
if (!isEnabled(annotationMetadata)) {
return EMPTY_ENTRY;
}
AnnotationAttributes attributes = getAttributes(annotationMetadata);
List<String> configu... | [
"protected",
"AutoConfigurationEntry",
"getAutoConfigurationEntry",
"(",
"AutoConfigurationMetadata",
"autoConfigurationMetadata",
",",
"AnnotationMetadata",
"annotationMetadata",
")",
"{",
"if",
"(",
"!",
"isEnabled",
"(",
"annotationMetadata",
")",
")",
"{",
"return",
"EM... | Return the {@link AutoConfigurationEntry} based on the {@link AnnotationMetadata}
of the importing {@link Configuration @Configuration} class.
@param autoConfigurationMetadata the auto-configuration metadata
@param annotationMetadata the annotation metadata of the configuration class
@return the auto-configurations tha... | [
"Return",
"the",
"{"
] | train | https://github.com/spring-projects/spring-boot/blob/0b27f7c70e164b2b1a96477f1d9c1acba56790c1/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/AutoConfigurationImportSelector.java#L112-L128 |
sarl/sarl | contribs/io.sarl.pythongenerator/io.sarl.pythongenerator.generator/src/io/sarl/pythongenerator/generator/generator/PyExpressionGenerator.java | PyExpressionGenerator._generate | protected XExpression _generate(XInstanceOfExpression operator, IAppendable it, IExtraLanguageGeneratorContext context) {
"""
Generate the given object.
@param operator the instance-of operator.
@param it the target for the generated content.
@param context the context.
@return the expression.
"""
appe... | java | protected XExpression _generate(XInstanceOfExpression operator, IAppendable it, IExtraLanguageGeneratorContext context) {
appendReturnIfExpectedReturnedExpression(it, context);
it.append("isinstance("); //$NON-NLS-1$
generate(operator.getExpression(), it, context);
it.append(", "); //$NON-NLS-1$
it.append(ope... | [
"protected",
"XExpression",
"_generate",
"(",
"XInstanceOfExpression",
"operator",
",",
"IAppendable",
"it",
",",
"IExtraLanguageGeneratorContext",
"context",
")",
"{",
"appendReturnIfExpectedReturnedExpression",
"(",
"it",
",",
"context",
")",
";",
"it",
".",
"append",... | Generate the given object.
@param operator the instance-of operator.
@param it the target for the generated content.
@param context the context.
@return the expression. | [
"Generate",
"the",
"given",
"object",
"."
] | train | https://github.com/sarl/sarl/blob/ca00ff994598c730339972def4e19a60e0b8cace/contribs/io.sarl.pythongenerator/io.sarl.pythongenerator.generator/src/io/sarl/pythongenerator/generator/generator/PyExpressionGenerator.java#L780-L788 |
jbundle/jbundle | base/message/jibx/src/main/java/org/jbundle/base/message/trx/message/external/convert/jibx/JibxContexts.java | JibxContexts.getMarshaller | public IMarshallingContext getMarshaller(String packageName, String bindingName) throws JiBXException {
"""
Get the shared unmarshaller for this context.
NOTE: Since this is shared, always synchronize on this object.
@param bindingName The JiBX binding name (defaults to 'binding')
@return
"""
JIBXCo... | java | public IMarshallingContext getMarshaller(String packageName, String bindingName) throws JiBXException
{
JIBXContextHolder jAXBContextHolder = this.get(packageName, bindingName);
if (jAXBContextHolder == null)
return null; // Never
return jAXBContextHolder.getMarshaller();
... | [
"public",
"IMarshallingContext",
"getMarshaller",
"(",
"String",
"packageName",
",",
"String",
"bindingName",
")",
"throws",
"JiBXException",
"{",
"JIBXContextHolder",
"jAXBContextHolder",
"=",
"this",
".",
"get",
"(",
"packageName",
",",
"bindingName",
")",
";",
"i... | Get the shared unmarshaller for this context.
NOTE: Since this is shared, always synchronize on this object.
@param bindingName The JiBX binding name (defaults to 'binding')
@return | [
"Get",
"the",
"shared",
"unmarshaller",
"for",
"this",
"context",
".",
"NOTE",
":",
"Since",
"this",
"is",
"shared",
"always",
"synchronize",
"on",
"this",
"object",
"."
] | train | https://github.com/jbundle/jbundle/blob/4037fcfa85f60c7d0096c453c1a3cd573c2b0abc/base/message/jibx/src/main/java/org/jbundle/base/message/trx/message/external/convert/jibx/JibxContexts.java#L81-L87 |
hibernate/hibernate-ogm | neo4j/src/main/java/org/hibernate/ogm/datastore/neo4j/dialect/impl/BaseNeo4jAssociationQueries.java | BaseNeo4jAssociationQueries.createEmbeddedTree | private EmbeddedNodesTree createEmbeddedTree(String collectionRole, String[] embeddedColumnNames, Object[] embeddedColumnValues, int offset) {
"""
/*
If the association is connected to embedded elements we also need to create the embedded relationships for this
elements. This method will create an tree containin... | java | private EmbeddedNodesTree createEmbeddedTree(String collectionRole, String[] embeddedColumnNames, Object[] embeddedColumnValues, int offset) {
EmbeddedNodesTree tree = new EmbeddedNodesTree();
for ( int i = 0; i < embeddedColumnNames.length; i++ ) {
String embeddedColumnName;
if ( embeddedColumnNames[i].start... | [
"private",
"EmbeddedNodesTree",
"createEmbeddedTree",
"(",
"String",
"collectionRole",
",",
"String",
"[",
"]",
"embeddedColumnNames",
",",
"Object",
"[",
"]",
"embeddedColumnValues",
",",
"int",
"offset",
")",
"{",
"EmbeddedNodesTree",
"tree",
"=",
"new",
"Embedded... | /*
If the association is connected to embedded elements we also need to create the embedded relationships for this
elements. This method will create an tree containing the information about the path to the embedded in a more
managabel way. | [
"/",
"*",
"If",
"the",
"association",
"is",
"connected",
"to",
"embedded",
"elements",
"we",
"also",
"need",
"to",
"create",
"the",
"embedded",
"relationships",
"for",
"this",
"elements",
".",
"This",
"method",
"will",
"create",
"an",
"tree",
"containing",
"... | train | https://github.com/hibernate/hibernate-ogm/blob/9ea971df7c27277029006a6f748d8272fb1d69d2/neo4j/src/main/java/org/hibernate/ogm/datastore/neo4j/dialect/impl/BaseNeo4jAssociationQueries.java#L498-L525 |
isisaddons-legacy/isis-module-security | dom/src/main/java/org/isisaddons/module/security/dom/permission/ApplicationPermissionRepository.java | ApplicationPermissionRepository.findByUserAndPermissionValue | @Programmatic
public ApplicationPermission findByUserAndPermissionValue(final String username, final ApplicationPermissionValue permissionValue) {
"""
Uses the {@link QueryResultsCache} in order to support
multiple lookups from <code>org.isisaddons.module.security.app.user.UserPermissionViewModel</code>.
... | java | @Programmatic
public ApplicationPermission findByUserAndPermissionValue(final String username, final ApplicationPermissionValue permissionValue) {
// obtain all permissions for this user, map by its value, and
// put into query cache (so that this method can be safely called in a tight loop)
... | [
"@",
"Programmatic",
"public",
"ApplicationPermission",
"findByUserAndPermissionValue",
"(",
"final",
"String",
"username",
",",
"final",
"ApplicationPermissionValue",
"permissionValue",
")",
"{",
"// obtain all permissions for this user, map by its value, and",
"// put into query ca... | Uses the {@link QueryResultsCache} in order to support
multiple lookups from <code>org.isisaddons.module.security.app.user.UserPermissionViewModel</code>. | [
"Uses",
"the",
"{"
] | train | https://github.com/isisaddons-legacy/isis-module-security/blob/a9deb1b003ba01e44c859085bd078be8df0c1863/dom/src/main/java/org/isisaddons/module/security/dom/permission/ApplicationPermissionRepository.java#L103-L130 |
Azure/azure-sdk-for-java | keyvault/data-plane/azure-keyvault/src/main/java/com/microsoft/azure/keyvault/implementation/KeyVaultClientBaseImpl.java | KeyVaultClientBaseImpl.recoverDeletedStorageAccountAsync | public Observable<StorageBundle> recoverDeletedStorageAccountAsync(String vaultBaseUrl, String storageAccountName) {
"""
Recovers the deleted storage account.
Recovers the deleted storage account in the specified vault. This operation can only be performed on a soft-delete enabled vault. This operation requires t... | java | public Observable<StorageBundle> recoverDeletedStorageAccountAsync(String vaultBaseUrl, String storageAccountName) {
return recoverDeletedStorageAccountWithServiceResponseAsync(vaultBaseUrl, storageAccountName).map(new Func1<ServiceResponse<StorageBundle>, StorageBundle>() {
@Override
pu... | [
"public",
"Observable",
"<",
"StorageBundle",
">",
"recoverDeletedStorageAccountAsync",
"(",
"String",
"vaultBaseUrl",
",",
"String",
"storageAccountName",
")",
"{",
"return",
"recoverDeletedStorageAccountWithServiceResponseAsync",
"(",
"vaultBaseUrl",
",",
"storageAccountName"... | Recovers the deleted storage account.
Recovers the deleted storage account in the specified vault. This operation can only be performed on a soft-delete enabled vault. This operation requires the storage/recover permission.
@param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net.
@param storage... | [
"Recovers",
"the",
"deleted",
"storage",
"account",
".",
"Recovers",
"the",
"deleted",
"storage",
"account",
"in",
"the",
"specified",
"vault",
".",
"This",
"operation",
"can",
"only",
"be",
"performed",
"on",
"a",
"soft",
"-",
"delete",
"enabled",
"vault",
... | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/keyvault/data-plane/azure-keyvault/src/main/java/com/microsoft/azure/keyvault/implementation/KeyVaultClientBaseImpl.java#L9459-L9466 |
couchbase/couchbase-java-client | src/main/java/com/couchbase/client/java/document/json/JsonObject.java | JsonObject.put | public JsonObject put(final String name, final Object value) {
"""
Stores a {@link Object} value identified by the field name.
Note that the value is checked and a {@link IllegalArgumentException} is thrown if not supported.
@param name the name of the JSON field.
@param value the value of the JSON field.
... | java | public JsonObject put(final String name, final Object value) {
if (this == value) {
throw new IllegalArgumentException("Cannot put self");
} else if (value == JsonValue.NULL) {
putNull(name);
} else if (checkType(value)) {
content.put(name, value);
} e... | [
"public",
"JsonObject",
"put",
"(",
"final",
"String",
"name",
",",
"final",
"Object",
"value",
")",
"{",
"if",
"(",
"this",
"==",
"value",
")",
"{",
"throw",
"new",
"IllegalArgumentException",
"(",
"\"Cannot put self\"",
")",
";",
"}",
"else",
"if",
"(",
... | Stores a {@link Object} value identified by the field name.
Note that the value is checked and a {@link IllegalArgumentException} is thrown if not supported.
@param name the name of the JSON field.
@param value the value of the JSON field.
@return the {@link JsonObject}. | [
"Stores",
"a",
"{",
"@link",
"Object",
"}",
"value",
"identified",
"by",
"the",
"field",
"name",
"."
] | train | https://github.com/couchbase/couchbase-java-client/blob/f36a0ee0c66923bdde47838ca543e50cbaa99e14/src/main/java/com/couchbase/client/java/document/json/JsonObject.java#L203-L214 |
cojen/Cojen | src/main/java/org/cojen/classfile/attribute/CodeAttr.java | CodeAttr.getLocalVariable | public LocalVariable getLocalVariable(Location useLocation, int number) {
"""
Returns local variable info at the given location, for the given number.
@return null if unknown
"""
int useLoc = useLocation.getLocation();
if (useLoc < 0) {
return null;
} else {
r... | java | public LocalVariable getLocalVariable(Location useLocation, int number) {
int useLoc = useLocation.getLocation();
if (useLoc < 0) {
return null;
} else {
return getLocalVariable(useLoc, number);
}
} | [
"public",
"LocalVariable",
"getLocalVariable",
"(",
"Location",
"useLocation",
",",
"int",
"number",
")",
"{",
"int",
"useLoc",
"=",
"useLocation",
".",
"getLocation",
"(",
")",
";",
"if",
"(",
"useLoc",
"<",
"0",
")",
"{",
"return",
"null",
";",
"}",
"e... | Returns local variable info at the given location, for the given number.
@return null if unknown | [
"Returns",
"local",
"variable",
"info",
"at",
"the",
"given",
"location",
"for",
"the",
"given",
"number",
"."
] | train | https://github.com/cojen/Cojen/blob/ddee9a0fde83870b97e0ed04c58270aa665f3a62/src/main/java/org/cojen/classfile/attribute/CodeAttr.java#L156-L163 |
alkacon/opencms-core | src/org/opencms/ui/sitemap/CmsSitemapExtension.java | CmsSitemapExtension.openPropertyDialog | public void openPropertyDialog(CmsUUID sitemapEntryId, CmsUUID rootId) {
"""
Opens the property dialog for the locale comparison view.<p>
@param sitemapEntryId the structure id for the sitemap entry to edit
@param rootId the structure id of the current tree's root
"""
getRpcProxy(I_CmsSitemapClien... | java | public void openPropertyDialog(CmsUUID sitemapEntryId, CmsUUID rootId) {
getRpcProxy(I_CmsSitemapClientRpc.class).openPropertyDialog("" + sitemapEntryId, "" + rootId);
} | [
"public",
"void",
"openPropertyDialog",
"(",
"CmsUUID",
"sitemapEntryId",
",",
"CmsUUID",
"rootId",
")",
"{",
"getRpcProxy",
"(",
"I_CmsSitemapClientRpc",
".",
"class",
")",
".",
"openPropertyDialog",
"(",
"\"\"",
"+",
"sitemapEntryId",
",",
"\"\"",
"+",
"rootId",... | Opens the property dialog for the locale comparison view.<p>
@param sitemapEntryId the structure id for the sitemap entry to edit
@param rootId the structure id of the current tree's root | [
"Opens",
"the",
"property",
"dialog",
"for",
"the",
"locale",
"comparison",
"view",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/ui/sitemap/CmsSitemapExtension.java#L345-L348 |
google/j2objc | jre_emul/android/platform/libcore/ojluni/src/main/java/java/util/Date.java | Date.toGMTString | @Deprecated
public String toGMTString() {
"""
Creates a string representation of this <tt>Date</tt> object of
the form:
<blockquote><pre>
d mon yyyy hh:mm:ss GMT</pre></blockquote>
where:<ul>
<li><i>d</i> is the day of the month (<tt>1</tt> through <tt>31</tt>),
as one or two decimal digits.
<li><i>mon<... | java | @Deprecated
public String toGMTString() {
// d MMM yyyy HH:mm:ss 'GMT'
long t = getTime();
BaseCalendar cal = getCalendarSystem(t);
BaseCalendar.Date date =
(BaseCalendar.Date) cal.getCalendarDate(getTime(), (TimeZone)null);
StringBuilder sb = new StringBuilder(32... | [
"@",
"Deprecated",
"public",
"String",
"toGMTString",
"(",
")",
"{",
"// d MMM yyyy HH:mm:ss 'GMT'",
"long",
"t",
"=",
"getTime",
"(",
")",
";",
"BaseCalendar",
"cal",
"=",
"getCalendarSystem",
"(",
"t",
")",
";",
"BaseCalendar",
".",
"Date",
"date",
"=",
"(... | Creates a string representation of this <tt>Date</tt> object of
the form:
<blockquote><pre>
d mon yyyy hh:mm:ss GMT</pre></blockquote>
where:<ul>
<li><i>d</i> is the day of the month (<tt>1</tt> through <tt>31</tt>),
as one or two decimal digits.
<li><i>mon</i> is the month (<tt>Jan, Feb, Mar, Apr, May, Jun, Jul,
Aug, ... | [
"Creates",
"a",
"string",
"representation",
"of",
"this",
"<tt",
">",
"Date<",
"/",
"tt",
">",
"object",
"of",
"the",
"form",
":",
"<blockquote",
">",
"<pre",
">",
"d",
"mon",
"yyyy",
"hh",
":",
"mm",
":",
"ss",
"GMT<",
"/",
"pre",
">",
"<",
"/",
... | train | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/libcore/ojluni/src/main/java/java/util/Date.java#L1136-L1152 |
eclipse/xtext-lib | org.eclipse.xtext.xbase.lib/src/org/eclipse/xtext/xbase/lib/CharacterExtensions.java | CharacterExtensions.operator_plus | @Pure
@Inline(value="($1 + $2)", constantExpression=true)
public static int operator_plus(char a, char b) {
"""
The binary <code>plus</code> operator. This is the equivalent to the Java <code>+</code> operator.
@param a a character.
@param b a character.
@return <code>a+b</code>
@since 2.3
"""
re... | java | @Pure
@Inline(value="($1 + $2)", constantExpression=true)
public static int operator_plus(char a, char b) {
return a + b;
} | [
"@",
"Pure",
"@",
"Inline",
"(",
"value",
"=",
"\"($1 + $2)\"",
",",
"constantExpression",
"=",
"true",
")",
"public",
"static",
"int",
"operator_plus",
"(",
"char",
"a",
",",
"char",
"b",
")",
"{",
"return",
"a",
"+",
"b",
";",
"}"
] | The binary <code>plus</code> operator. This is the equivalent to the Java <code>+</code> operator.
@param a a character.
@param b a character.
@return <code>a+b</code>
@since 2.3 | [
"The",
"binary",
"<code",
">",
"plus<",
"/",
"code",
">",
"operator",
".",
"This",
"is",
"the",
"equivalent",
"to",
"the",
"Java",
"<code",
">",
"+",
"<",
"/",
"code",
">",
"operator",
"."
] | train | https://github.com/eclipse/xtext-lib/blob/7063572e1f1bd713a3aa53bdf3a8dc60e25c169a/org.eclipse.xtext.xbase.lib/src/org/eclipse/xtext/xbase/lib/CharacterExtensions.java#L881-L885 |
Azure/azure-sdk-for-java | keyvault/data-plane/azure-keyvault/src/main/java/com/microsoft/azure/keyvault/implementation/KeyVaultClientBaseImpl.java | KeyVaultClientBaseImpl.deleteCertificateOperationAsync | public Observable<CertificateOperation> deleteCertificateOperationAsync(String vaultBaseUrl, String certificateName) {
"""
Deletes the creation operation for a specific certificate.
Deletes the creation operation for a specified certificate that is in the process of being created. The certificate is no longer cre... | java | public Observable<CertificateOperation> deleteCertificateOperationAsync(String vaultBaseUrl, String certificateName) {
return deleteCertificateOperationWithServiceResponseAsync(vaultBaseUrl, certificateName).map(new Func1<ServiceResponse<CertificateOperation>, CertificateOperation>() {
@Override
... | [
"public",
"Observable",
"<",
"CertificateOperation",
">",
"deleteCertificateOperationAsync",
"(",
"String",
"vaultBaseUrl",
",",
"String",
"certificateName",
")",
"{",
"return",
"deleteCertificateOperationWithServiceResponseAsync",
"(",
"vaultBaseUrl",
",",
"certificateName",
... | Deletes the creation operation for a specific certificate.
Deletes the creation operation for a specified certificate that is in the process of being created. The certificate is no longer created. This operation requires the certificates/update permission.
@param vaultBaseUrl The vault name, for example https://myvaul... | [
"Deletes",
"the",
"creation",
"operation",
"for",
"a",
"specific",
"certificate",
".",
"Deletes",
"the",
"creation",
"operation",
"for",
"a",
"specified",
"certificate",
"that",
"is",
"in",
"the",
"process",
"of",
"being",
"created",
".",
"The",
"certificate",
... | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/keyvault/data-plane/azure-keyvault/src/main/java/com/microsoft/azure/keyvault/implementation/KeyVaultClientBaseImpl.java#L7849-L7856 |
wildfly/wildfly-core | controller/src/main/java/org/jboss/as/controller/registry/NotificationHandlerNodeRegistry.java | NotificationHandlerNodeRegistry.getOrCreateSubregistry | NotificationHandlerNodeSubregistry getOrCreateSubregistry(final String key) {
"""
Create a {@code NotificationHandlerNodeSubregistry} for the give {@code key} or use the existing one if it already exists.
Copied from {@link org.jboss.as.controller.registry.ConcreteResourceRegistration#getOrCreateSubregistry(Str... | java | NotificationHandlerNodeSubregistry getOrCreateSubregistry(final String key) {
for (;;) {
final Map<String, NotificationHandlerNodeSubregistry> snapshot = childrenUpdater.get(this);
final NotificationHandlerNodeSubregistry subregistry = snapshot.get(key);
if (subregistry != nu... | [
"NotificationHandlerNodeSubregistry",
"getOrCreateSubregistry",
"(",
"final",
"String",
"key",
")",
"{",
"for",
"(",
";",
";",
")",
"{",
"final",
"Map",
"<",
"String",
",",
"NotificationHandlerNodeSubregistry",
">",
"snapshot",
"=",
"childrenUpdater",
".",
"get",
... | Create a {@code NotificationHandlerNodeSubregistry} for the give {@code key} or use the existing one if it already exists.
Copied from {@link org.jboss.as.controller.registry.ConcreteResourceRegistration#getOrCreateSubregistry(String)} | [
"Create",
"a",
"{",
"@code",
"NotificationHandlerNodeSubregistry",
"}",
"for",
"the",
"give",
"{",
"@code",
"key",
"}",
"or",
"use",
"the",
"existing",
"one",
"if",
"it",
"already",
"exists",
"."
] | train | https://github.com/wildfly/wildfly-core/blob/cfaf0479dcbb2d320a44c5374b93b944ec39fade/controller/src/main/java/org/jboss/as/controller/registry/NotificationHandlerNodeRegistry.java#L140-L154 |
OpenLiberty/open-liberty | dev/wlp.lib.extract/src/wlp/lib/extract/SelfExtractor.java | SelfExtractor.printNeededIFixes | public static void printNeededIFixes(File outputDir, List extractedFiles) {
"""
If necessary this will print a message saying that the installed files mean that an iFix needs to be re-installed.
@param outputDir The directory where the files were extracted to (typically the "wlp" directory)
@param extract... | java | public static void printNeededIFixes(File outputDir, List extractedFiles) {
try {
// To get the ifix information we run the productInfo validate command which as well as
// listing the state of the runtime, also displays any ifixes that need to be reapplied.
Runtime runtime =... | [
"public",
"static",
"void",
"printNeededIFixes",
"(",
"File",
"outputDir",
",",
"List",
"extractedFiles",
")",
"{",
"try",
"{",
"// To get the ifix information we run the productInfo validate command which as well as",
"// listing the state of the runtime, also displays any ifixes that... | If necessary this will print a message saying that the installed files mean that an iFix needs to be re-installed.
@param outputDir The directory where the files were extracted to (typically the "wlp" directory)
@param extractedFiles A list of Strings which are file paths within the directory | [
"If",
"necessary",
"this",
"will",
"print",
"a",
"message",
"saying",
"that",
"the",
"installed",
"files",
"mean",
"that",
"an",
"iFix",
"needs",
"to",
"be",
"re",
"-",
"installed",
"."
] | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/wlp.lib.extract/src/wlp/lib/extract/SelfExtractor.java#L1143-L1166 |
google/closure-compiler | src/com/google/javascript/jscomp/JSError.java | JSError.make | public static JSError make(DiagnosticType type, String... arguments) {
"""
Creates a JSError with no source information
@param type The DiagnosticType
@param arguments Arguments to be incorporated into the message
"""
return new JSError(null, null, -1, -1, type, null, arguments);
} | java | public static JSError make(DiagnosticType type, String... arguments) {
return new JSError(null, null, -1, -1, type, null, arguments);
} | [
"public",
"static",
"JSError",
"make",
"(",
"DiagnosticType",
"type",
",",
"String",
"...",
"arguments",
")",
"{",
"return",
"new",
"JSError",
"(",
"null",
",",
"null",
",",
"-",
"1",
",",
"-",
"1",
",",
"type",
",",
"null",
",",
"arguments",
")",
";... | Creates a JSError with no source information
@param type The DiagnosticType
@param arguments Arguments to be incorporated into the message | [
"Creates",
"a",
"JSError",
"with",
"no",
"source",
"information"
] | train | https://github.com/google/closure-compiler/blob/d81e36740f6a9e8ac31a825ee8758182e1dc5aae/src/com/google/javascript/jscomp/JSError.java#L68-L70 |
foundation-runtime/service-directory | 2.0/sd-api/src/main/java/com/cisco/oss/foundation/directory/config/ServiceDirectoryConfig.java | ServiceDirectoryConfig.getFloat | public float getFloat(String name, float defaultVal) {
"""
Get the property object as float, or return defaultVal if property is not defined.
@param name
property name.
@param defaultVal
default property value.
@return
property value as float, return defaultVal if property is undefined.
"""
if(... | java | public float getFloat(String name, float defaultVal){
if(this.configuration.containsKey(name)){
return this.configuration.getFloat(name);
} else {
return defaultVal;
}
} | [
"public",
"float",
"getFloat",
"(",
"String",
"name",
",",
"float",
"defaultVal",
")",
"{",
"if",
"(",
"this",
".",
"configuration",
".",
"containsKey",
"(",
"name",
")",
")",
"{",
"return",
"this",
".",
"configuration",
".",
"getFloat",
"(",
"name",
")"... | Get the property object as float, or return defaultVal if property is not defined.
@param name
property name.
@param defaultVal
default property value.
@return
property value as float, return defaultVal if property is undefined. | [
"Get",
"the",
"property",
"object",
"as",
"float",
"or",
"return",
"defaultVal",
"if",
"property",
"is",
"not",
"defined",
"."
] | train | https://github.com/foundation-runtime/service-directory/blob/a7bdefe173dc99e75eff4a24e07e6407e62f2ed4/2.0/sd-api/src/main/java/com/cisco/oss/foundation/directory/config/ServiceDirectoryConfig.java#L177-L183 |
jOOQ/jOOL | jOOL-java-8/src/main/java/org/jooq/lambda/Unchecked.java | Unchecked.toIntBiFunction | public static <T, U> ToIntBiFunction<T, U> toIntBiFunction(CheckedToIntBiFunction<T, U> function, Consumer<Throwable> handler) {
"""
Wrap a {@link CheckedToIntBiFunction} in a {@link ToIntBiFunction} with a custom handler for checked exceptions.
"""
return (t, u) -> {
try {
... | java | public static <T, U> ToIntBiFunction<T, U> toIntBiFunction(CheckedToIntBiFunction<T, U> function, Consumer<Throwable> handler) {
return (t, u) -> {
try {
return function.applyAsInt(t, u);
}
catch (Throwable e) {
handler.accept(e);
... | [
"public",
"static",
"<",
"T",
",",
"U",
">",
"ToIntBiFunction",
"<",
"T",
",",
"U",
">",
"toIntBiFunction",
"(",
"CheckedToIntBiFunction",
"<",
"T",
",",
"U",
">",
"function",
",",
"Consumer",
"<",
"Throwable",
">",
"handler",
")",
"{",
"return",
"(",
... | Wrap a {@link CheckedToIntBiFunction} in a {@link ToIntBiFunction} with a custom handler for checked exceptions. | [
"Wrap",
"a",
"{"
] | train | https://github.com/jOOQ/jOOL/blob/889d87c85ca57bafd4eddd78e0f7ae2804d2ee86/jOOL-java-8/src/main/java/org/jooq/lambda/Unchecked.java#L374-L385 |
UrielCh/ovh-java-sdk | ovh-java-sdk-telephony/src/main/java/net/minidev/ovh/api/ApiOvhTelephony.java | ApiOvhTelephony.directories_availableZipCodes_GET | public ArrayList<String> directories_availableZipCodes_GET(OvhNumberCountryEnum country, String number) throws IOException {
"""
Get all zip codes compatible for a number
REST: GET /telephony/directories/availableZipCodes
@param country [required] The country of the city
@param number [required] The number (c... | java | public ArrayList<String> directories_availableZipCodes_GET(OvhNumberCountryEnum country, String number) throws IOException {
String qPath = "/telephony/directories/availableZipCodes";
StringBuilder sb = path(qPath);
query(sb, "country", country);
query(sb, "number", number);
String resp = execN(qPath, "GET", ... | [
"public",
"ArrayList",
"<",
"String",
">",
"directories_availableZipCodes_GET",
"(",
"OvhNumberCountryEnum",
"country",
",",
"String",
"number",
")",
"throws",
"IOException",
"{",
"String",
"qPath",
"=",
"\"/telephony/directories/availableZipCodes\"",
";",
"StringBuilder",
... | Get all zip codes compatible for a number
REST: GET /telephony/directories/availableZipCodes
@param country [required] The country of the city
@param number [required] The number (can be a range terminated by XXXX) | [
"Get",
"all",
"zip",
"codes",
"compatible",
"for",
"a",
"number"
] | train | https://github.com/UrielCh/ovh-java-sdk/blob/6d531a40e56e09701943e334c25f90f640c55701/ovh-java-sdk-telephony/src/main/java/net/minidev/ovh/api/ApiOvhTelephony.java#L8712-L8719 |
BranchMetrics/android-branch-deep-linking | Branch-SDK/src/io/branch/referral/Branch.java | Branch.getAutoInstance | @TargetApi(Build.VERSION_CODES.ICE_CREAM_SANDWICH)
public static Branch getAutoInstance(@NonNull Context context, @NonNull String branchKey) {
"""
<p>Singleton method to return the pre-initialised, or newly initialise and return, a singleton
object of the type {@link Branch}.</p>
<p>Use this whenever you nee... | java | @TargetApi(Build.VERSION_CODES.ICE_CREAM_SANDWICH)
public static Branch getAutoInstance(@NonNull Context context, @NonNull String branchKey) {
isAutoSessionMode_ = true;
customReferrableSettings_ = CUSTOM_REFERRABLE_SETTINGS.USE_DEFAULT;
boolean isTest = BranchUtil.checkTestMode(context);
... | [
"@",
"TargetApi",
"(",
"Build",
".",
"VERSION_CODES",
".",
"ICE_CREAM_SANDWICH",
")",
"public",
"static",
"Branch",
"getAutoInstance",
"(",
"@",
"NonNull",
"Context",
"context",
",",
"@",
"NonNull",
"String",
"branchKey",
")",
"{",
"isAutoSessionMode_",
"=",
"tr... | <p>Singleton method to return the pre-initialised, or newly initialise and return, a singleton
object of the type {@link Branch}.</p>
<p>Use this whenever you need to call a method directly on the {@link Branch} object.</p>
@param context A {@link Context} from which this call was made.
@param branchKey A {@link Str... | [
"<p",
">",
"Singleton",
"method",
"to",
"return",
"the",
"pre",
"-",
"initialised",
"or",
"newly",
"initialise",
"and",
"return",
"a",
"singleton",
"object",
"of",
"the",
"type",
"{",
"@link",
"Branch",
"}",
".",
"<",
"/",
"p",
">",
"<p",
">",
"Use",
... | train | https://github.com/BranchMetrics/android-branch-deep-linking/blob/e3bee2ccfcbf6d4bf1a5815b5b86666e4ff8f848/Branch-SDK/src/io/branch/referral/Branch.java#L735-L753 |
james-hu/jabb-core | src/main/java/net/sf/jabb/util/db/StartAndStopSQL.java | StartAndStopSQL.executeSQL | protected void executeSQL(String sql) {
"""
Execute one SQL statement. RuntimeException will be thrown if SQLException was caught.
@param sql the statement to be executed
"""
Connection conn = null;
Statement stmt = null;
if (useAnt){
try{
AntSqlExec sqlExec = new AntSqlExec(dataSource, ... | java | protected void executeSQL(String sql){
Connection conn = null;
Statement stmt = null;
if (useAnt){
try{
AntSqlExec sqlExec = new AntSqlExec(dataSource, sql, delimiter, delimiterType);
sqlExec.execute();
log.info("SQL executed with Ant: " + sql);
}catch(BuildException be){
throw ... | [
"protected",
"void",
"executeSQL",
"(",
"String",
"sql",
")",
"{",
"Connection",
"conn",
"=",
"null",
";",
"Statement",
"stmt",
"=",
"null",
";",
"if",
"(",
"useAnt",
")",
"{",
"try",
"{",
"AntSqlExec",
"sqlExec",
"=",
"new",
"AntSqlExec",
"(",
"dataSour... | Execute one SQL statement. RuntimeException will be thrown if SQLException was caught.
@param sql the statement to be executed | [
"Execute",
"one",
"SQL",
"statement",
".",
"RuntimeException",
"will",
"be",
"thrown",
"if",
"SQLException",
"was",
"caught",
"."
] | train | https://github.com/james-hu/jabb-core/blob/bceed441595c5e5195a7418795f03b69fa7b61e4/src/main/java/net/sf/jabb/util/db/StartAndStopSQL.java#L86-L110 |
alkacon/opencms-core | src-setup/org/opencms/setup/CmsSetupBean.java | CmsSetupBean.sortModules | public List<String> sortModules(Collection<CmsModule> modules) {
"""
Sorts the modules for display.<p>
@param modules the list of {@link CmsModule} objects
@return a sorted list of module names
"""
List<CmsModule> aux = new ArrayList<CmsModule>(modules);
Collections.sort(aux, new Compara... | java | public List<String> sortModules(Collection<CmsModule> modules) {
List<CmsModule> aux = new ArrayList<CmsModule>(modules);
Collections.sort(aux, new Comparator<CmsModule>() {
public int compare(CmsModule module1, CmsModule module2) {
return getDisplayForModule(module1).comp... | [
"public",
"List",
"<",
"String",
">",
"sortModules",
"(",
"Collection",
"<",
"CmsModule",
">",
"modules",
")",
"{",
"List",
"<",
"CmsModule",
">",
"aux",
"=",
"new",
"ArrayList",
"<",
"CmsModule",
">",
"(",
"modules",
")",
";",
"Collections",
".",
"sort"... | Sorts the modules for display.<p>
@param modules the list of {@link CmsModule} objects
@return a sorted list of module names | [
"Sorts",
"the",
"modules",
"for",
"display",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src-setup/org/opencms/setup/CmsSetupBean.java#L2307-L2324 |
lecousin/java-framework-core | net.lecousin.core/src/main/java/net/lecousin/framework/xml/XMLStreamEvents.java | XMLStreamEvents.getAttributeWithNamespaceURI | public Attribute getAttributeWithNamespaceURI(CharSequence uri, CharSequence name) {
"""
Shortcut to get the attribute for the given namespace URI and local name.
"""
for (Attribute attr : event.attributes)
if (attr.localName.equals(name) && getNamespaceURI(attr.namespacePrefix).equals(uri))
return... | java | public Attribute getAttributeWithNamespaceURI(CharSequence uri, CharSequence name) {
for (Attribute attr : event.attributes)
if (attr.localName.equals(name) && getNamespaceURI(attr.namespacePrefix).equals(uri))
return attr;
return null;
} | [
"public",
"Attribute",
"getAttributeWithNamespaceURI",
"(",
"CharSequence",
"uri",
",",
"CharSequence",
"name",
")",
"{",
"for",
"(",
"Attribute",
"attr",
":",
"event",
".",
"attributes",
")",
"if",
"(",
"attr",
".",
"localName",
".",
"equals",
"(",
"name",
... | Shortcut to get the attribute for the given namespace URI and local name. | [
"Shortcut",
"to",
"get",
"the",
"attribute",
"for",
"the",
"given",
"namespace",
"URI",
"and",
"local",
"name",
"."
] | train | https://github.com/lecousin/java-framework-core/blob/b0c893b44bfde2c03f90ea846a49ef5749d598f3/net.lecousin.core/src/main/java/net/lecousin/framework/xml/XMLStreamEvents.java#L169-L174 |
j-a-w-r/jawr-main-repo | jawr/jawr-core/src/main/java/net/jawr/web/resource/bundle/locale/message/BundleStringJsonifier.java | BundleStringJsonifier.processKey | @SuppressWarnings("unchecked")
private void processKey(String key) {
"""
Creates a tree map structure from the message bundle. Each messages key
is split by the separator (.) and used as a key in the map, for whose
value a new map is created, and so forth until all keys form the tree
structure. For instance, c... | java | @SuppressWarnings("unchecked")
private void processKey(String key) {
StringTokenizer tk = new StringTokenizer(key, ".");
Map<String, Object> currentMap = this.keyMap;
while (tk.hasMoreTokens()) {
String token = tk.nextToken();
if (!currentMap.containsKey(token))
currentMap.put(token, new HashMap<String... | [
"@",
"SuppressWarnings",
"(",
"\"unchecked\"",
")",
"private",
"void",
"processKey",
"(",
"String",
"key",
")",
"{",
"StringTokenizer",
"tk",
"=",
"new",
"StringTokenizer",
"(",
"key",
",",
"\".\"",
")",
";",
"Map",
"<",
"String",
",",
"Object",
">",
"curr... | Creates a tree map structure from the message bundle. Each messages key
is split by the separator (.) and used as a key in the map, for whose
value a new map is created, and so forth until all keys form the tree
structure. For instance, com.example.message=foo
com.example.somethingelse=baz results in [com [example
[mes... | [
"Creates",
"a",
"tree",
"map",
"structure",
"from",
"the",
"message",
"bundle",
".",
"Each",
"messages",
"key",
"is",
"split",
"by",
"the",
"separator",
"(",
".",
")",
"and",
"used",
"as",
"a",
"key",
"in",
"the",
"map",
"for",
"whose",
"value",
"a",
... | train | https://github.com/j-a-w-r/jawr-main-repo/blob/5381f6acf461cd2502593c67a77bd6ef9eab848d/jawr/jawr-core/src/main/java/net/jawr/web/resource/bundle/locale/message/BundleStringJsonifier.java#L77-L87 |
looly/hutool | hutool-core/src/main/java/cn/hutool/core/util/ReflectUtil.java | ReflectUtil.setFieldValue | public static void setFieldValue(Object obj, Field field, Object value) throws UtilException {
"""
设置字段值
@param obj 对象
@param field 字段
@param value 值,值类型必须与字段类型匹配,不会自动转换对象类型
@throws UtilException UtilException 包装IllegalAccessException异常
"""
Assert.notNull(obj);
Assert.notNull(field);
field.setAc... | java | public static void setFieldValue(Object obj, Field field, Object value) throws UtilException {
Assert.notNull(obj);
Assert.notNull(field);
field.setAccessible(true);
if(null != value) {
Class<?> fieldType = field.getType();
if(false == fieldType.isAssignableFrom(value.getClass())) {
//对于类型不... | [
"public",
"static",
"void",
"setFieldValue",
"(",
"Object",
"obj",
",",
"Field",
"field",
",",
"Object",
"value",
")",
"throws",
"UtilException",
"{",
"Assert",
".",
"notNull",
"(",
"obj",
")",
";",
"Assert",
".",
"notNull",
"(",
"field",
")",
";",
"fiel... | 设置字段值
@param obj 对象
@param field 字段
@param value 值,值类型必须与字段类型匹配,不会自动转换对象类型
@throws UtilException UtilException 包装IllegalAccessException异常 | [
"设置字段值"
] | train | https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-core/src/main/java/cn/hutool/core/util/ReflectUtil.java#L250-L271 |
primefaces-extensions/core | src/main/java/org/primefaces/extensions/component/sheet/SheetRenderer.java | SheetRenderer.encodeData | protected void encodeData(final FacesContext context, final Sheet sheet, final WidgetBuilder wb)
throws IOException {
"""
Encode the row data. Builds row data, style data and read only object.
@param context
@param sheet
@param wb
@throws IOException
"""
final JavascriptVarBuilde... | java | protected void encodeData(final FacesContext context, final Sheet sheet, final WidgetBuilder wb)
throws IOException {
final JavascriptVarBuilder jsData = new JavascriptVarBuilder(null, false);
final JavascriptVarBuilder jsRowKeys = new JavascriptVarBuilder(null, false);
final Ja... | [
"protected",
"void",
"encodeData",
"(",
"final",
"FacesContext",
"context",
",",
"final",
"Sheet",
"sheet",
",",
"final",
"WidgetBuilder",
"wb",
")",
"throws",
"IOException",
"{",
"final",
"JavascriptVarBuilder",
"jsData",
"=",
"new",
"JavascriptVarBuilder",
"(",
... | Encode the row data. Builds row data, style data and read only object.
@param context
@param sheet
@param wb
@throws IOException | [
"Encode",
"the",
"row",
"data",
".",
"Builds",
"row",
"data",
"style",
"data",
"and",
"read",
"only",
"object",
"."
] | train | https://github.com/primefaces-extensions/core/blob/afdbca591f60f47898e3517e1e939bc2f63d5355/src/main/java/org/primefaces/extensions/component/sheet/SheetRenderer.java#L426-L470 |
CenturyLinkCloud/mdw | mdw-services/src/com/centurylink/mdw/services/task/TaskWorkflowHelper.java | TaskWorkflowHelper.updateDue | void updateDue(Instant due, String cuid, String comment)
throws ServiceException, DataAccessException {
"""
Updates the due date for a task instance.
The method should only be called in summary (or summary-and-detail) task manager.
"""
boolean hasOldSlaInstance;
EventServices eventManager ... | java | void updateDue(Instant due, String cuid, String comment)
throws ServiceException, DataAccessException {
boolean hasOldSlaInstance;
EventServices eventManager = ServiceLocator.getEventServices();
EventInstance event = eventManager.getEventInstance(ScheduledEvent.SPECIAL_EVENT_PREFIX + "TaskDu... | [
"void",
"updateDue",
"(",
"Instant",
"due",
",",
"String",
"cuid",
",",
"String",
"comment",
")",
"throws",
"ServiceException",
",",
"DataAccessException",
"{",
"boolean",
"hasOldSlaInstance",
";",
"EventServices",
"eventManager",
"=",
"ServiceLocator",
".",
"getEve... | Updates the due date for a task instance.
The method should only be called in summary (or summary-and-detail) task manager. | [
"Updates",
"the",
"due",
"date",
"for",
"a",
"task",
"instance",
".",
"The",
"method",
"should",
"only",
"be",
"called",
"in",
"summary",
"(",
"or",
"summary",
"-",
"and",
"-",
"detail",
")",
"task",
"manager",
"."
] | train | https://github.com/CenturyLinkCloud/mdw/blob/91167fe65a25a5d7022cdcf8b0fae8506f5b87ce/mdw-services/src/com/centurylink/mdw/services/task/TaskWorkflowHelper.java#L327-L348 |
alkacon/opencms-core | src/org/opencms/jsp/util/CmsJspContentAccessBean.java | CmsJspContentAccessBean.getPrintStructure | public String getPrintStructure() {
"""
Prints the XPaths of the available content values into an HTML ul list.<p>
@return the HTML list of XPaths
"""
if (getRawContent().hasLocale(m_requestedLocale)) {
List<I_CmsXmlContentValue> values = new ArrayList<I_CmsXmlContentValue>(
... | java | public String getPrintStructure() {
if (getRawContent().hasLocale(m_requestedLocale)) {
List<I_CmsXmlContentValue> values = new ArrayList<I_CmsXmlContentValue>(
getRawContent().getValues(m_requestedLocale));
Collections.sort(values, new Comparator<I_CmsXmlContentValue>()... | [
"public",
"String",
"getPrintStructure",
"(",
")",
"{",
"if",
"(",
"getRawContent",
"(",
")",
".",
"hasLocale",
"(",
"m_requestedLocale",
")",
")",
"{",
"List",
"<",
"I_CmsXmlContentValue",
">",
"values",
"=",
"new",
"ArrayList",
"<",
"I_CmsXmlContentValue",
"... | Prints the XPaths of the available content values into an HTML ul list.<p>
@return the HTML list of XPaths | [
"Prints",
"the",
"XPaths",
"of",
"the",
"available",
"content",
"values",
"into",
"an",
"HTML",
"ul",
"list",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/jsp/util/CmsJspContentAccessBean.java#L970-L992 |
codegist/crest | core/src/main/java/org/codegist/crest/CRestBuilder.java | CRestBuilder.bindDeserializer | public CRestBuilder bindDeserializer(Class<? extends Deserializer> deserializer, String[] mimeTypes, Map<String, Object> config) {
"""
<p>Binds a deserializer to a list of response Content-Type mime-types.</p>
<p>By default, <b>CRest</b> handle the following types:</p>
<ul>
<li>application/xml, text/xml for Xml... | java | public CRestBuilder bindDeserializer(Class<? extends Deserializer> deserializer, String[] mimeTypes, Map<String, Object> config) {
this.mimeDeserializerBuilder.register(deserializer, mimeTypes, config);
return this;
} | [
"public",
"CRestBuilder",
"bindDeserializer",
"(",
"Class",
"<",
"?",
"extends",
"Deserializer",
">",
"deserializer",
",",
"String",
"[",
"]",
"mimeTypes",
",",
"Map",
"<",
"String",
",",
"Object",
">",
"config",
")",
"{",
"this",
".",
"mimeDeserializerBuilder... | <p>Binds a deserializer to a list of response Content-Type mime-types.</p>
<p>By default, <b>CRest</b> handle the following types:</p>
<ul>
<li>application/xml, text/xml for Xml deserialization</li>
<li>application/json, application/javascript, text/javascript, text/json for Json deserialization</li>
</ul>
@param deser... | [
"<p",
">",
"Binds",
"a",
"deserializer",
"to",
"a",
"list",
"of",
"response",
"Content",
"-",
"Type",
"mime",
"-",
"types",
".",
"<",
"/",
"p",
">",
"<p",
">",
"By",
"default",
"<b",
">",
"CRest<",
"/",
"b",
">",
"handle",
"the",
"following",
"type... | train | https://github.com/codegist/crest/blob/e99ba7728b27d2ddb2c247261350f1b6fa7a6698/core/src/main/java/org/codegist/crest/CRestBuilder.java#L528-L531 |
wisdom-framework/wisdom | core/wisdom-maven-plugin/src/main/java/org/wisdom/maven/utils/DefaultMaven2OsgiConverter.java | DefaultMaven2OsgiConverter.getBundleSymbolicName | public static String getBundleSymbolicName(String groupId, String artifactId) {
"""
Get the symbolic name as groupId + "." + artifactId, with the following exceptions. Unlike the original method
from the Maven Bundle Plugin, this method does not use the bundle inspection,
as the artifact's file does not exist wh... | java | public static String getBundleSymbolicName(String groupId, String artifactId) {
int i = groupId.lastIndexOf('.');
String lastSection = groupId.substring(++i);
if (artifactId.equals(lastSection)) {
return groupId;
}
if (artifactId.equals(groupId)
|| a... | [
"public",
"static",
"String",
"getBundleSymbolicName",
"(",
"String",
"groupId",
",",
"String",
"artifactId",
")",
"{",
"int",
"i",
"=",
"groupId",
".",
"lastIndexOf",
"(",
"'",
"'",
")",
";",
"String",
"lastSection",
"=",
"groupId",
".",
"substring",
"(",
... | Get the symbolic name as groupId + "." + artifactId, with the following exceptions. Unlike the original method
from the Maven Bundle Plugin, this method does not use the bundle inspection,
as the artifact's file does not exist when this method is called.
<ul>
<li>if artifactId is equal to last section of groupId then g... | [
"Get",
"the",
"symbolic",
"name",
"as",
"groupId",
"+",
".",
"+",
"artifactId",
"with",
"the",
"following",
"exceptions",
".",
"Unlike",
"the",
"original",
"method",
"from",
"the",
"Maven",
"Bundle",
"Plugin",
"this",
"method",
"does",
"not",
"use",
"the",
... | train | https://github.com/wisdom-framework/wisdom/blob/a35b6431200fec56b178c0ff60837ed73fd7874d/core/wisdom-maven-plugin/src/main/java/org/wisdom/maven/utils/DefaultMaven2OsgiConverter.java#L112-L133 |
google/closure-compiler | src/com/google/javascript/jscomp/NodeUtil.java | NodeUtil.getNodeTypeReferenceCount | static int getNodeTypeReferenceCount(
Node node, Token type, Predicate<Node> traverseChildrenPred) {
"""
Finds the number of times a type is referenced within the node tree.
"""
return getCount(node, new MatchNodeType(type), traverseChildrenPred);
} | java | static int getNodeTypeReferenceCount(
Node node, Token type, Predicate<Node> traverseChildrenPred) {
return getCount(node, new MatchNodeType(type), traverseChildrenPred);
} | [
"static",
"int",
"getNodeTypeReferenceCount",
"(",
"Node",
"node",
",",
"Token",
"type",
",",
"Predicate",
"<",
"Node",
">",
"traverseChildrenPred",
")",
"{",
"return",
"getCount",
"(",
"node",
",",
"new",
"MatchNodeType",
"(",
"type",
")",
",",
"traverseChild... | Finds the number of times a type is referenced within the node tree. | [
"Finds",
"the",
"number",
"of",
"times",
"a",
"type",
"is",
"referenced",
"within",
"the",
"node",
"tree",
"."
] | train | https://github.com/google/closure-compiler/blob/d81e36740f6a9e8ac31a825ee8758182e1dc5aae/src/com/google/javascript/jscomp/NodeUtil.java#L4647-L4650 |
looly/hutool | hutool-db/src/main/java/cn/hutool/db/handler/HandleHelper.java | HandleHelper.handleRow | public static Entity handleRow(int columnCount, ResultSetMetaData meta, ResultSet rs) throws SQLException {
"""
处理单条数据
@param columnCount 列数
@param meta ResultSetMetaData
@param rs 数据集
@return 每一行的Entity
@throws SQLException SQL执行异常
"""
return handleRow(Entity.create(), columnCount, meta, rs, true);
... | java | public static Entity handleRow(int columnCount, ResultSetMetaData meta, ResultSet rs) throws SQLException {
return handleRow(Entity.create(), columnCount, meta, rs, true);
} | [
"public",
"static",
"Entity",
"handleRow",
"(",
"int",
"columnCount",
",",
"ResultSetMetaData",
"meta",
",",
"ResultSet",
"rs",
")",
"throws",
"SQLException",
"{",
"return",
"handleRow",
"(",
"Entity",
".",
"create",
"(",
")",
",",
"columnCount",
",",
"meta",
... | 处理单条数据
@param columnCount 列数
@param meta ResultSetMetaData
@param rs 数据集
@return 每一行的Entity
@throws SQLException SQL执行异常 | [
"处理单条数据"
] | train | https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-db/src/main/java/cn/hutool/db/handler/HandleHelper.java#L111-L113 |
CODAIT/stocator | src/main/java/com/ibm/stocator/fs/common/Utils.java | Utils.lastModifiedAsLong | public static long lastModifiedAsLong(String strTime) throws IOException {
"""
Transforms last modified time stamp from String to the long format
@param strTime time in string format as returned from Swift
@return time in long format
@throws IOException if failed to parse time stamp
"""
final SimpleDa... | java | public static long lastModifiedAsLong(String strTime) throws IOException {
final SimpleDateFormat simpleDateFormat = new SimpleDateFormat(TIME_PATTERN,
Locale.US);
try {
long lastModified = simpleDateFormat.parse(strTime).getTime();
if (lastModified == 0) {
lastModified = System.curr... | [
"public",
"static",
"long",
"lastModifiedAsLong",
"(",
"String",
"strTime",
")",
"throws",
"IOException",
"{",
"final",
"SimpleDateFormat",
"simpleDateFormat",
"=",
"new",
"SimpleDateFormat",
"(",
"TIME_PATTERN",
",",
"Locale",
".",
"US",
")",
";",
"try",
"{",
"... | Transforms last modified time stamp from String to the long format
@param strTime time in string format as returned from Swift
@return time in long format
@throws IOException if failed to parse time stamp | [
"Transforms",
"last",
"modified",
"time",
"stamp",
"from",
"String",
"to",
"the",
"long",
"format"
] | train | https://github.com/CODAIT/stocator/blob/35969cadd2e8faa6fdac45e8bec1799fdd3d8299/src/main/java/com/ibm/stocator/fs/common/Utils.java#L483-L495 |
Azure/azure-sdk-for-java | sql/resource-manager/v2017_03_01_preview/src/main/java/com/microsoft/azure/management/sql/v2017_03_01_preview/implementation/ExtendedDatabaseBlobAuditingPoliciesInner.java | ExtendedDatabaseBlobAuditingPoliciesInner.createOrUpdateAsync | public Observable<ExtendedDatabaseBlobAuditingPolicyInner> createOrUpdateAsync(String resourceGroupName, String serverName, String databaseName, ExtendedDatabaseBlobAuditingPolicyInner parameters) {
"""
Creates or updates an extended database's blob auditing policy.
@param resourceGroupName The name of the reso... | java | public Observable<ExtendedDatabaseBlobAuditingPolicyInner> createOrUpdateAsync(String resourceGroupName, String serverName, String databaseName, ExtendedDatabaseBlobAuditingPolicyInner parameters) {
return createOrUpdateWithServiceResponseAsync(resourceGroupName, serverName, databaseName, parameters).map(new Fu... | [
"public",
"Observable",
"<",
"ExtendedDatabaseBlobAuditingPolicyInner",
">",
"createOrUpdateAsync",
"(",
"String",
"resourceGroupName",
",",
"String",
"serverName",
",",
"String",
"databaseName",
",",
"ExtendedDatabaseBlobAuditingPolicyInner",
"parameters",
")",
"{",
"return"... | Creates or updates an extended database's blob auditing policy.
@param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal.
@param serverName The name of the server.
@param databaseName The name of the database.
@param... | [
"Creates",
"or",
"updates",
"an",
"extended",
"database",
"s",
"blob",
"auditing",
"policy",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/sql/resource-manager/v2017_03_01_preview/src/main/java/com/microsoft/azure/management/sql/v2017_03_01_preview/implementation/ExtendedDatabaseBlobAuditingPoliciesInner.java#L202-L209 |
google/j2objc | jre_emul/android/platform/external/icu/android_icu4j/src/main/java/android/icu/impl/IntTrie.java | IntTrie.getSurrogateValue | public final int getSurrogateValue(char lead, char trail) {
"""
Get the value associated with a pair of surrogates.
@param lead a lead surrogate
@param trail a trail surrogate
"""
if (!UTF16.isLeadSurrogate(lead) || !UTF16.isTrailSurrogate(trail)) {
throw new IllegalArgumentException(
... | java | public final int getSurrogateValue(char lead, char trail)
{
if (!UTF16.isLeadSurrogate(lead) || !UTF16.isTrailSurrogate(trail)) {
throw new IllegalArgumentException(
"Argument characters do not form a supplementary character");
}
// get fold position for the next ... | [
"public",
"final",
"int",
"getSurrogateValue",
"(",
"char",
"lead",
",",
"char",
"trail",
")",
"{",
"if",
"(",
"!",
"UTF16",
".",
"isLeadSurrogate",
"(",
"lead",
")",
"||",
"!",
"UTF16",
".",
"isTrailSurrogate",
"(",
"trail",
")",
")",
"{",
"throw",
"n... | Get the value associated with a pair of surrogates.
@param lead a lead surrogate
@param trail a trail surrogate | [
"Get",
"the",
"value",
"associated",
"with",
"a",
"pair",
"of",
"surrogates",
"."
] | train | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/external/icu/android_icu4j/src/main/java/android/icu/impl/IntTrie.java#L167-L183 |
xvik/dropwizard-guicey | src/main/java/ru/vyarus/dropwizard/guice/module/installer/util/JerseyBinding.java | JerseyBinding.bindSpecificComponent | public static void bindSpecificComponent(final AbstractBinder binder,
final Injector injector,
final Class<?> type,
final Class<?> specificType,
... | java | public static void bindSpecificComponent(final AbstractBinder binder,
final Injector injector,
final Class<?> type,
final Class<?> specificType,
... | [
"public",
"static",
"void",
"bindSpecificComponent",
"(",
"final",
"AbstractBinder",
"binder",
",",
"final",
"Injector",
"injector",
",",
"final",
"Class",
"<",
"?",
">",
"type",
",",
"final",
"Class",
"<",
"?",
">",
"specificType",
",",
"final",
"boolean",
... | Binds jersey specific component (component implements jersey interface or extends class).
Specific binding is required for types directly supported by jersey (e.g. ExceptionMapper).
Such types must be bound to target interface directly, otherwise jersey would not be able to resolve them.
<p> If type is {@link HK2Manage... | [
"Binds",
"jersey",
"specific",
"component",
"(",
"component",
"implements",
"jersey",
"interface",
"or",
"extends",
"class",
")",
".",
"Specific",
"binding",
"is",
"required",
"for",
"types",
"directly",
"supported",
"by",
"jersey",
"(",
"e",
".",
"g",
".",
... | train | https://github.com/xvik/dropwizard-guicey/blob/dd39ad77283555be21f606d5ebf0f11207a733d4/src/main/java/ru/vyarus/dropwizard/guice/module/installer/util/JerseyBinding.java#L142-L163 |
nguillaumin/slick2d-maven | slick2d-core/src/main/java/org/newdawn/slick/Graphics.java | Graphics.drawOval | public void drawOval(float x1, float y1, float width, float height) {
"""
Draw an oval to the canvas
@param x1
The x coordinate of the top left corner of a box containing
the oval
@param y1
The y coordinate of the top left corner of a box containing
the oval
@param width
The width of the oval
@param hei... | java | public void drawOval(float x1, float y1, float width, float height) {
drawOval(x1, y1, width, height, DEFAULT_SEGMENTS);
} | [
"public",
"void",
"drawOval",
"(",
"float",
"x1",
",",
"float",
"y1",
",",
"float",
"width",
",",
"float",
"height",
")",
"{",
"drawOval",
"(",
"x1",
",",
"y1",
",",
"width",
",",
"height",
",",
"DEFAULT_SEGMENTS",
")",
";",
"}"
] | Draw an oval to the canvas
@param x1
The x coordinate of the top left corner of a box containing
the oval
@param y1
The y coordinate of the top left corner of a box containing
the oval
@param width
The width of the oval
@param height
The height of the oval | [
"Draw",
"an",
"oval",
"to",
"the",
"canvas"
] | train | https://github.com/nguillaumin/slick2d-maven/blob/8251f88a0ed6a70e726d2468842455cd1f80893f/slick2d-core/src/main/java/org/newdawn/slick/Graphics.java#L915-L917 |
kohsuke/com4j | tlbimp/src/main/java/com4j/tlbimp/MethodBinder.java | MethodBinder.getReturnParam | private int getReturnParam() {
"""
Returns the index of the return value parameter, or -1 if none.
"""
// look for [retval] attribute
for (int i = 0; i < params.length; i++) {
if (params[i].isRetval()) {
return i;
}
}
// sometimes a COM method has only one [out] param.
... | java | private int getReturnParam() {
// look for [retval] attribute
for (int i = 0; i < params.length; i++) {
if (params[i].isRetval()) {
return i;
}
}
// sometimes a COM method has only one [out] param.
// treat that as the return value.
// this is seen frequently in MSHTML (... | [
"private",
"int",
"getReturnParam",
"(",
")",
"{",
"// look for [retval] attribute",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
"<",
"params",
".",
"length",
";",
"i",
"++",
")",
"{",
"if",
"(",
"params",
"[",
"i",
"]",
".",
"isRetval",
"(",
")",
... | Returns the index of the return value parameter, or -1 if none. | [
"Returns",
"the",
"index",
"of",
"the",
"return",
"value",
"parameter",
"or",
"-",
"1",
"if",
"none",
"."
] | train | https://github.com/kohsuke/com4j/blob/1e690b805fb0e4e9ef61560e20a56335aecb0b24/tlbimp/src/main/java/com4j/tlbimp/MethodBinder.java#L83-L105 |
apache/groovy | subprojects/groovy-nio/src/main/java/org/codehaus/groovy/runtime/NioGroovyMethods.java | NioGroovyMethods.newWriter | public static BufferedWriter newWriter(Path self, String charset, boolean append) throws IOException {
"""
Helper method to create a buffered writer for a file without writing a BOM.
@param self a Path
@param charset the name of the encoding used to write in this file
@param append true if in append mode
... | java | public static BufferedWriter newWriter(Path self, String charset, boolean append) throws IOException {
return newWriter(self, charset, append, false);
} | [
"public",
"static",
"BufferedWriter",
"newWriter",
"(",
"Path",
"self",
",",
"String",
"charset",
",",
"boolean",
"append",
")",
"throws",
"IOException",
"{",
"return",
"newWriter",
"(",
"self",
",",
"charset",
",",
"append",
",",
"false",
")",
";",
"}"
] | Helper method to create a buffered writer for a file without writing a BOM.
@param self a Path
@param charset the name of the encoding used to write in this file
@param append true if in append mode
@return a BufferedWriter
@throws java.io.IOException if an IOException occurs.
@since 2.3.0 | [
"Helper",
"method",
"to",
"create",
"a",
"buffered",
"writer",
"for",
"a",
"file",
"without",
"writing",
"a",
"BOM",
"."
] | train | https://github.com/apache/groovy/blob/71cf20addb611bb8d097a59e395fd20bc7f31772/subprojects/groovy-nio/src/main/java/org/codehaus/groovy/runtime/NioGroovyMethods.java#L1573-L1575 |
querydsl/querydsl | querydsl-lucene4/src/main/java/com/querydsl/lucene4/LuceneExpressions.java | LuceneExpressions.fuzzyLike | public static BooleanExpression fuzzyLike(Path<String> path, String value, int maxEdits) {
"""
Create a fuzzy query
@param path path
@param value value to match
@param maxEdits must be >= 0 and <= {@link LevenshteinAutomata#MAXIMUM_SUPPORTED_DISTANCE}.
@return condition
"""
Term term = new ... | java | public static BooleanExpression fuzzyLike(Path<String> path, String value, int maxEdits) {
Term term = new Term(path.getMetadata().getName(), value);
return new QueryElement(new FuzzyQuery(term, maxEdits));
} | [
"public",
"static",
"BooleanExpression",
"fuzzyLike",
"(",
"Path",
"<",
"String",
">",
"path",
",",
"String",
"value",
",",
"int",
"maxEdits",
")",
"{",
"Term",
"term",
"=",
"new",
"Term",
"(",
"path",
".",
"getMetadata",
"(",
")",
".",
"getName",
"(",
... | Create a fuzzy query
@param path path
@param value value to match
@param maxEdits must be >= 0 and <= {@link LevenshteinAutomata#MAXIMUM_SUPPORTED_DISTANCE}.
@return condition | [
"Create",
"a",
"fuzzy",
"query"
] | train | https://github.com/querydsl/querydsl/blob/2bf234caf78549813a1e0f44d9c30ecc5ef734e3/querydsl-lucene4/src/main/java/com/querydsl/lucene4/LuceneExpressions.java#L52-L55 |
JOML-CI/JOML | src/org/joml/AABBd.java | AABBd.setMin | public AABBd setMin(double minX, double minY, double minZ) {
"""
Set the minimum corner coordinates.
@param minX
the x coordinate of the minimum corner
@param minY
the y coordinate of the minimum corner
@param minZ
the z coordinate of the minimum corner
@return this
"""
this.minX = minX;
... | java | public AABBd setMin(double minX, double minY, double minZ) {
this.minX = minX;
this.minY = minY;
this.minZ = minZ;
return this;
} | [
"public",
"AABBd",
"setMin",
"(",
"double",
"minX",
",",
"double",
"minY",
",",
"double",
"minZ",
")",
"{",
"this",
".",
"minX",
"=",
"minX",
";",
"this",
".",
"minY",
"=",
"minY",
";",
"this",
".",
"minZ",
"=",
"minZ",
";",
"return",
"this",
";",
... | Set the minimum corner coordinates.
@param minX
the x coordinate of the minimum corner
@param minY
the y coordinate of the minimum corner
@param minZ
the z coordinate of the minimum corner
@return this | [
"Set",
"the",
"minimum",
"corner",
"coordinates",
"."
] | train | https://github.com/JOML-CI/JOML/blob/ce2652fc236b42bda3875c591f8e6645048a678f/src/org/joml/AABBd.java#L117-L122 |
orbisgis/h2gis | h2gis-functions/src/main/java/org/h2gis/functions/spatial/topology/ST_Graph.java | ST_Graph.createGraph | public static boolean createGraph(Connection connection,
String tableName) throws SQLException {
"""
Create the nodes and edges tables from the input table containing
LINESTRINGs.
<p/>
Since no column is specified in this signature, we take the first
geometry column we fin... | java | public static boolean createGraph(Connection connection,
String tableName) throws SQLException {
return createGraph(connection, tableName, null);
} | [
"public",
"static",
"boolean",
"createGraph",
"(",
"Connection",
"connection",
",",
"String",
"tableName",
")",
"throws",
"SQLException",
"{",
"return",
"createGraph",
"(",
"connection",
",",
"tableName",
",",
"null",
")",
";",
"}"
] | Create the nodes and edges tables from the input table containing
LINESTRINGs.
<p/>
Since no column is specified in this signature, we take the first
geometry column we find.
<p/>
If the input table has name 'input', then the output tables are named
'input_nodes' and 'input_edges'.
@param connection Connection
@param ... | [
"Create",
"the",
"nodes",
"and",
"edges",
"tables",
"from",
"the",
"input",
"table",
"containing",
"LINESTRINGs",
".",
"<p",
"/",
">",
"Since",
"no",
"column",
"is",
"specified",
"in",
"this",
"signature",
"we",
"take",
"the",
"first",
"geometry",
"column",
... | train | https://github.com/orbisgis/h2gis/blob/9cd70b447e6469cecbc2fc64b16774b59491df3b/h2gis-functions/src/main/java/org/h2gis/functions/spatial/topology/ST_Graph.java#L105-L108 |
albfernandez/itext2 | src/main/java/com/lowagie/text/pdf/BidiOrder.java | BidiOrder.findRunLimit | private int findRunLimit(int index, int limit, byte[] validSet) {
"""
Return the limit of the run starting at index that includes only resultTypes in validSet.
This checks the value at index, and will return index if that value is not in validSet.
"""
--index;
loop:
while (++index ... | java | private int findRunLimit(int index, int limit, byte[] validSet) {
--index;
loop:
while (++index < limit) {
byte t = resultTypes[index];
for (int i = 0; i < validSet.length; ++i) {
if (t == validSet[i]) {
continue loo... | [
"private",
"int",
"findRunLimit",
"(",
"int",
"index",
",",
"int",
"limit",
",",
"byte",
"[",
"]",
"validSet",
")",
"{",
"--",
"index",
";",
"loop",
":",
"while",
"(",
"++",
"index",
"<",
"limit",
")",
"{",
"byte",
"t",
"=",
"resultTypes",
"[",
"in... | Return the limit of the run starting at index that includes only resultTypes in validSet.
This checks the value at index, and will return index if that value is not in validSet. | [
"Return",
"the",
"limit",
"of",
"the",
"run",
"starting",
"at",
"index",
"that",
"includes",
"only",
"resultTypes",
"in",
"validSet",
".",
"This",
"checks",
"the",
"value",
"at",
"index",
"and",
"will",
"return",
"index",
"if",
"that",
"value",
"is",
"not"... | train | https://github.com/albfernandez/itext2/blob/438fc1899367fd13dfdfa8dfdca9a3c1a7783b84/src/main/java/com/lowagie/text/pdf/BidiOrder.java#L1038-L1052 |
springfox/springfox | springfox-spring-web/src/main/java/springfox/documentation/spring/web/plugins/Docket.java | Docket.directModelSubstitute | public Docket directModelSubstitute(final Class clazz, final Class with) {
"""
Directly substitutes a model class with the supplied substitute
e.g
<code>directModelSubstitute(LocalDate.class, Date.class)</code>
would substitute LocalDate with Date
@param clazz class to substitute
@param with the class whic... | java | public Docket directModelSubstitute(final Class clazz, final Class with) {
this.ruleBuilders.add(newSubstitutionFunction(clazz, with));
return this;
} | [
"public",
"Docket",
"directModelSubstitute",
"(",
"final",
"Class",
"clazz",
",",
"final",
"Class",
"with",
")",
"{",
"this",
".",
"ruleBuilders",
".",
"add",
"(",
"newSubstitutionFunction",
"(",
"clazz",
",",
"with",
")",
")",
";",
"return",
"this",
";",
... | Directly substitutes a model class with the supplied substitute
e.g
<code>directModelSubstitute(LocalDate.class, Date.class)</code>
would substitute LocalDate with Date
@param clazz class to substitute
@param with the class which substitutes 'clazz'
@return this Docket | [
"Directly",
"substitutes",
"a",
"model",
"class",
"with",
"the",
"supplied",
"substitute",
"e",
".",
"g",
"<code",
">",
"directModelSubstitute",
"(",
"LocalDate",
".",
"class",
"Date",
".",
"class",
")",
"<",
"/",
"code",
">",
"would",
"substitute",
"LocalDa... | train | https://github.com/springfox/springfox/blob/e40e2d6f4b345ffa35cd5c0ca7a12589036acaf7/springfox-spring-web/src/main/java/springfox/documentation/spring/web/plugins/Docket.java#L283-L286 |
apache/incubator-gobblin | gobblin-data-management/src/main/java/org/apache/gobblin/data/management/copy/CopyableFile.java | CopyableFile.resolveReplicatedOwnerAndPermissionsRecursively | public static List<OwnerAndPermission> resolveReplicatedOwnerAndPermissionsRecursively(FileSystem sourceFs, Path fromPath,
Path toPath, CopyConfiguration copyConfiguration) throws IOException {
"""
Compute the correct {@link OwnerAndPermission} obtained from replicating source owner and permissions and apply... | java | public static List<OwnerAndPermission> resolveReplicatedOwnerAndPermissionsRecursively(FileSystem sourceFs, Path fromPath,
Path toPath, CopyConfiguration copyConfiguration) throws IOException {
if (!PathUtils.isAncestor(toPath, fromPath)) {
throw new IOException(String.format("toPath %s must be an ance... | [
"public",
"static",
"List",
"<",
"OwnerAndPermission",
">",
"resolveReplicatedOwnerAndPermissionsRecursively",
"(",
"FileSystem",
"sourceFs",
",",
"Path",
"fromPath",
",",
"Path",
"toPath",
",",
"CopyConfiguration",
"copyConfiguration",
")",
"throws",
"IOException",
"{",
... | Compute the correct {@link OwnerAndPermission} obtained from replicating source owner and permissions and applying
the {@link PreserveAttributes} rules for fromPath and every ancestor up to but excluding toPath.
@return A list of the computed {@link OwnerAndPermission}s starting from fromPath, up to but excluding toPa... | [
"Compute",
"the",
"correct",
"{",
"@link",
"OwnerAndPermission",
"}",
"obtained",
"from",
"replicating",
"source",
"owner",
"and",
"permissions",
"and",
"applying",
"the",
"{",
"@link",
"PreserveAttributes",
"}",
"rules",
"for",
"fromPath",
"and",
"every",
"ancest... | train | https://github.com/apache/incubator-gobblin/blob/f029b4c0fea0fe4aa62f36dda2512344ff708bae/gobblin-data-management/src/main/java/org/apache/gobblin/data/management/copy/CopyableFile.java#L335-L351 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.