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 |
|---|---|---|---|---|---|---|---|---|---|---|
exoplatform/jcr | exo.jcr.component.ext/src/main/java/org/exoplatform/services/jcr/ext/backup/RepositoryChainLogPathHelper.java | RepositoryChainLogPathHelper.getPath | public static String getPath(String relativePath, String backupDirCanonicalPath) throws MalformedURLException {
"""
Will be returned absolute path.
@param relativePath
String, relative path.
@param backupDirCanonicalPath
String, path to backup dir
@return String
Will be returned absolute path.
@throws Mal... | java | public static String getPath(String relativePath, String backupDirCanonicalPath) throws MalformedURLException
{
String path = "file:" + backupDirCanonicalPath + "/" + relativePath;
URL urlPath = new URL(resolveFileURL(path));
return urlPath.getFile();
} | [
"public",
"static",
"String",
"getPath",
"(",
"String",
"relativePath",
",",
"String",
"backupDirCanonicalPath",
")",
"throws",
"MalformedURLException",
"{",
"String",
"path",
"=",
"\"file:\"",
"+",
"backupDirCanonicalPath",
"+",
"\"/\"",
"+",
"relativePath",
";",
"... | Will be returned absolute path.
@param relativePath
String, relative path.
@param backupDirCanonicalPath
String, path to backup dir
@return String
Will be returned absolute path.
@throws MalformedURLException | [
"Will",
"be",
"returned",
"absolute",
"path",
"."
] | train | https://github.com/exoplatform/jcr/blob/3e7f9ee1b5683640d73a4316fb4b0ad5eac5b8a2/exo.jcr.component.ext/src/main/java/org/exoplatform/services/jcr/ext/backup/RepositoryChainLogPathHelper.java#L68-L75 |
OpenLiberty/open-liberty | dev/com.ibm.ws.javaee.ddmodel.wsbnd/src/com/ibm/ws/javaee/ddmodel/wsbnd/impl/ServiceRefType.java | ServiceRefType.handleAttribute | @Override
public boolean handleAttribute(DDParser parser, String nsURI, String localName, int index) throws ParseException {
"""
parse the name and address attributes defined in the element.
"""
boolean result = false;
if (nsURI != null) {
return result;
}
if (... | java | @Override
public boolean handleAttribute(DDParser parser, String nsURI, String localName, int index) throws ParseException {
boolean result = false;
if (nsURI != null) {
return result;
}
if (NAME_ATTRIBUTE_NAME.equals(localName)) {
name = parser.parseStringA... | [
"@",
"Override",
"public",
"boolean",
"handleAttribute",
"(",
"DDParser",
"parser",
",",
"String",
"nsURI",
",",
"String",
"localName",
",",
"int",
"index",
")",
"throws",
"ParseException",
"{",
"boolean",
"result",
"=",
"false",
";",
"if",
"(",
"nsURI",
"!=... | parse the name and address attributes defined in the element. | [
"parse",
"the",
"name",
"and",
"address",
"attributes",
"defined",
"in",
"the",
"element",
"."
] | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.javaee.ddmodel.wsbnd/src/com/ibm/ws/javaee/ddmodel/wsbnd/impl/ServiceRefType.java#L85-L109 |
Alluxio/alluxio | core/server/master/src/main/java/alluxio/master/file/meta/InodeTree.java | InodeTree.lockInodePath | public LockedInodePath lockInodePath(AlluxioURI uri, LockPattern lockPattern)
throws InvalidPathException {
"""
Locks existing inodes on the specified path, in the specified {@link LockPattern}. The target
inode is not required to exist.
@param uri the uri to lock
@param lockPattern the {@link LockPatte... | java | public LockedInodePath lockInodePath(AlluxioURI uri, LockPattern lockPattern)
throws InvalidPathException {
LockedInodePath inodePath =
new LockedInodePath(uri, mInodeStore, mInodeLockManager, getRoot(), lockPattern);
try {
inodePath.traverse();
} catch (Throwable t) {
inodePath.cl... | [
"public",
"LockedInodePath",
"lockInodePath",
"(",
"AlluxioURI",
"uri",
",",
"LockPattern",
"lockPattern",
")",
"throws",
"InvalidPathException",
"{",
"LockedInodePath",
"inodePath",
"=",
"new",
"LockedInodePath",
"(",
"uri",
",",
"mInodeStore",
",",
"mInodeLockManager"... | Locks existing inodes on the specified path, in the specified {@link LockPattern}. The target
inode is not required to exist.
@param uri the uri to lock
@param lockPattern the {@link LockPattern} to lock the inodes with
@return the {@link LockedInodePath} representing the locked path of inodes
@throws InvalidPathExcep... | [
"Locks",
"existing",
"inodes",
"on",
"the",
"specified",
"path",
"in",
"the",
"specified",
"{",
"@link",
"LockPattern",
"}",
".",
"The",
"target",
"inode",
"is",
"not",
"required",
"to",
"exist",
"."
] | train | https://github.com/Alluxio/alluxio/blob/af38cf3ab44613355b18217a3a4d961f8fec3a10/core/server/master/src/main/java/alluxio/master/file/meta/InodeTree.java#L340-L351 |
evant/binding-collection-adapter | bindingcollectionadapter/src/main/java/me/tatarka/bindingcollectionadapter2/collections/MergeObservableList.java | MergeObservableList.mergeToBackingIndex | public int mergeToBackingIndex(@NonNull ObservableList<? extends T> backingList, int index) {
"""
Converts an index into this merge list into an into an index of the given backing list.
@throws IndexOutOfBoundsException for an invalid index.
@throws IllegalArgumentException if the given list is not backing th... | java | public int mergeToBackingIndex(@NonNull ObservableList<? extends T> backingList, int index) {
if (index < 0) {
throw new IndexOutOfBoundsException();
}
int size = 0;
for (int i = 0, listsSize = lists.size(); i < listsSize; i++) {
List<? extends T> list = lists.get... | [
"public",
"int",
"mergeToBackingIndex",
"(",
"@",
"NonNull",
"ObservableList",
"<",
"?",
"extends",
"T",
">",
"backingList",
",",
"int",
"index",
")",
"{",
"if",
"(",
"index",
"<",
"0",
")",
"{",
"throw",
"new",
"IndexOutOfBoundsException",
"(",
")",
";",
... | Converts an index into this merge list into an into an index of the given backing list.
@throws IndexOutOfBoundsException for an invalid index.
@throws IllegalArgumentException if the given list is not backing this merge list. | [
"Converts",
"an",
"index",
"into",
"this",
"merge",
"list",
"into",
"an",
"into",
"an",
"index",
"of",
"the",
"given",
"backing",
"list",
"."
] | train | https://github.com/evant/binding-collection-adapter/blob/f669eda0a7002128bb504dcba012c51531f1bedd/bindingcollectionadapter/src/main/java/me/tatarka/bindingcollectionadapter2/collections/MergeObservableList.java#L126-L143 |
alkacon/opencms-core | src/org/opencms/loader/CmsResourceManager.java | CmsResourceManager.addMimeType | public CmsMimeType addMimeType(String extension, String type) throws CmsConfigurationException {
"""
Adds a new MIME type from the XML configuration to the internal list of MIME types.<p>
@param extension the MIME type extension
@param type the MIME type description
@return the created MIME type instance
... | java | public CmsMimeType addMimeType(String extension, String type) throws CmsConfigurationException {
// check if new mime types can still be added
if (m_frozen) {
throw new CmsConfigurationException(Messages.get().container(Messages.ERR_NO_CONFIG_AFTER_STARTUP_0));
}
CmsMimeTyp... | [
"public",
"CmsMimeType",
"addMimeType",
"(",
"String",
"extension",
",",
"String",
"type",
")",
"throws",
"CmsConfigurationException",
"{",
"// check if new mime types can still be added",
"if",
"(",
"m_frozen",
")",
"{",
"throw",
"new",
"CmsConfigurationException",
"(",
... | Adds a new MIME type from the XML configuration to the internal list of MIME types.<p>
@param extension the MIME type extension
@param type the MIME type description
@return the created MIME type instance
@throws CmsConfigurationException in case the resource manager configuration is already initialized | [
"Adds",
"a",
"new",
"MIME",
"type",
"from",
"the",
"XML",
"configuration",
"to",
"the",
"internal",
"list",
"of",
"MIME",
"types",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/loader/CmsResourceManager.java#L504-L514 |
elki-project/elki | elki/src/main/java/de/lmu/ifi/dbs/elki/algorithm/clustering/correlation/CASH.java | CASH.runDerivator | private double[][] runDerivator(Relation<ParameterizationFunction> relation, int dim, CASHInterval interval, ModifiableDBIDs ids) {
"""
Runs the derivator on the specified interval and assigns all points having
a distance less then the standard deviation of the derivator model to the
model to this model.
@par... | java | private double[][] runDerivator(Relation<ParameterizationFunction> relation, int dim, CASHInterval interval, ModifiableDBIDs ids) {
Database derivatorDB = buildDerivatorDB(relation, interval);
PCARunner pca = new PCARunner(new StandardCovarianceMatrixBuilder());
EigenPairFilter filter = new FirstNEigenPair... | [
"private",
"double",
"[",
"]",
"[",
"]",
"runDerivator",
"(",
"Relation",
"<",
"ParameterizationFunction",
">",
"relation",
",",
"int",
"dim",
",",
"CASHInterval",
"interval",
",",
"ModifiableDBIDs",
"ids",
")",
"{",
"Database",
"derivatorDB",
"=",
"buildDerivat... | Runs the derivator on the specified interval and assigns all points having
a distance less then the standard deviation of the derivator model to the
model to this model.
@param relation the database containing the parameterization functions
@param interval the interval to build the model
@param dim the dimensionality ... | [
"Runs",
"the",
"derivator",
"on",
"the",
"specified",
"interval",
"and",
"assigns",
"all",
"points",
"having",
"a",
"distance",
"less",
"then",
"the",
"standard",
"deviation",
"of",
"the",
"derivator",
"model",
"to",
"the",
"model",
"to",
"this",
"model",
".... | train | https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki/src/main/java/de/lmu/ifi/dbs/elki/algorithm/clustering/correlation/CASH.java#L625-L650 |
Azure/azure-sdk-for-java | policyinsights/resource-manager/v2018_04_04/src/main/java/com/microsoft/azure/management/policyinsights/v2018_04_04/implementation/PolicyStatesInner.java | PolicyStatesInner.summarizeForResourceGroupLevelPolicyAssignment | public SummarizeResultsInner summarizeForResourceGroupLevelPolicyAssignment(String subscriptionId, String resourceGroupName, String policyAssignmentName) {
"""
Summarizes policy states for the resource group level policy assignment.
@param subscriptionId Microsoft Azure subscription ID.
@param resourceGroupNam... | java | public SummarizeResultsInner summarizeForResourceGroupLevelPolicyAssignment(String subscriptionId, String resourceGroupName, String policyAssignmentName) {
return summarizeForResourceGroupLevelPolicyAssignmentWithServiceResponseAsync(subscriptionId, resourceGroupName, policyAssignmentName).toBlocking().single()... | [
"public",
"SummarizeResultsInner",
"summarizeForResourceGroupLevelPolicyAssignment",
"(",
"String",
"subscriptionId",
",",
"String",
"resourceGroupName",
",",
"String",
"policyAssignmentName",
")",
"{",
"return",
"summarizeForResourceGroupLevelPolicyAssignmentWithServiceResponseAsync",... | Summarizes policy states for the resource group level policy assignment.
@param subscriptionId Microsoft Azure subscription ID.
@param resourceGroupName Resource group name.
@param policyAssignmentName Policy assignment name.
@throws IllegalArgumentException thrown if parameters fail the validation
@throws QueryFailur... | [
"Summarizes",
"policy",
"states",
"for",
"the",
"resource",
"group",
"level",
"policy",
"assignment",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/policyinsights/resource-manager/v2018_04_04/src/main/java/com/microsoft/azure/management/policyinsights/v2018_04_04/implementation/PolicyStatesInner.java#L3109-L3111 |
HubSpot/Singularity | SingularityClient/src/main/java/com/hubspot/singularity/client/SingularityClient.java | SingularityClient.getRequestGroup | public Optional<SingularityRequestGroup> getRequestGroup(String requestGroupId) {
"""
Retrieve a specific request group by id
@param requestGroupId
The request group ID to search for
@return
A {@link SingularityRequestGroup}
"""
final Function<String, String> requestUri = (host) -> String.format(RE... | java | public Optional<SingularityRequestGroup> getRequestGroup(String requestGroupId) {
final Function<String, String> requestUri = (host) -> String.format(REQUEST_GROUP_FORMAT, getApiBase(host), requestGroupId);
return getSingle(requestUri, "request group", requestGroupId, SingularityRequestGroup.class);
} | [
"public",
"Optional",
"<",
"SingularityRequestGroup",
">",
"getRequestGroup",
"(",
"String",
"requestGroupId",
")",
"{",
"final",
"Function",
"<",
"String",
",",
"String",
">",
"requestUri",
"=",
"(",
"host",
")",
"-",
">",
"String",
".",
"format",
"(",
"REQ... | Retrieve a specific request group by id
@param requestGroupId
The request group ID to search for
@return
A {@link SingularityRequestGroup} | [
"Retrieve",
"a",
"specific",
"request",
"group",
"by",
"id"
] | train | https://github.com/HubSpot/Singularity/blob/384a8c16a10aa076af5ca45c8dfcedab9e5122c8/SingularityClient/src/main/java/com/hubspot/singularity/client/SingularityClient.java#L1403-L1407 |
square/wire | wire-schema/src/main/java/com/squareup/wire/schema/Linker.java | Linker.dereference | Field dereference(Field self, String field) {
"""
Returns the field named {@code field} on the message type of {@code self}.
"""
if (field.startsWith("[") && field.endsWith("]")) {
field = field.substring(1, field.length() - 1);
}
Type type = protoTypeNames.get(self.type().toString());
i... | java | Field dereference(Field self, String field) {
if (field.startsWith("[") && field.endsWith("]")) {
field = field.substring(1, field.length() - 1);
}
Type type = protoTypeNames.get(self.type().toString());
if (type instanceof MessageType) {
MessageType messageType = (MessageType) type;
... | [
"Field",
"dereference",
"(",
"Field",
"self",
",",
"String",
"field",
")",
"{",
"if",
"(",
"field",
".",
"startsWith",
"(",
"\"[\"",
")",
"&&",
"field",
".",
"endsWith",
"(",
"\"]\"",
")",
")",
"{",
"field",
"=",
"field",
".",
"substring",
"(",
"1",
... | Returns the field named {@code field} on the message type of {@code self}. | [
"Returns",
"the",
"field",
"named",
"{"
] | train | https://github.com/square/wire/blob/4a9a00dfadfc14d6a0780b85810418f9cbc78a49/wire-schema/src/main/java/com/squareup/wire/schema/Linker.java#L239-L256 |
RestComm/sipunit | src/main/java/org/cafesip/sipunit/SipCall.java | SipCall.initiateOutgoingCall | public boolean initiateOutgoingCall(String fromUri, String toUri, String viaNonProxyRoute) {
"""
This basic method is used to initiate an outgoing call. That is, it applies to the scenario
where a UAC is originating a call to the network. There are two ways to make an outgoing call:
1) Use SipPhone.createSipCall... | java | public boolean initiateOutgoingCall(String fromUri, String toUri, String viaNonProxyRoute) {
return initiateOutgoingCall(fromUri, toUri, viaNonProxyRoute, null);
} | [
"public",
"boolean",
"initiateOutgoingCall",
"(",
"String",
"fromUri",
",",
"String",
"toUri",
",",
"String",
"viaNonProxyRoute",
")",
"{",
"return",
"initiateOutgoingCall",
"(",
"fromUri",
",",
"toUri",
",",
"viaNonProxyRoute",
",",
"null",
")",
";",
"}"
] | This basic method is used to initiate an outgoing call. That is, it applies to the scenario
where a UAC is originating a call to the network. There are two ways to make an outgoing call:
1) Use SipPhone.createSipCall() and then call this method, when you need to see
intermediate/provisional responses received - you wil... | [
"This",
"basic",
"method",
"is",
"used",
"to",
"initiate",
"an",
"outgoing",
"call",
".",
"That",
"is",
"it",
"applies",
"to",
"the",
"scenario",
"where",
"a",
"UAC",
"is",
"originating",
"a",
"call",
"to",
"the",
"network",
".",
"There",
"are",
"two",
... | train | https://github.com/RestComm/sipunit/blob/18a6be2e29be3fbdc14226e8c41b25e2d57378b1/src/main/java/org/cafesip/sipunit/SipCall.java#L1467-L1469 |
infinispan/infinispan | client/hotrod-client/src/main/java/org/infinispan/client/hotrod/event/impl/ContinuousQueryImpl.java | ContinuousQueryImpl.addContinuousQueryListener | public <C> void addContinuousQueryListener(Query query, ContinuousQueryListener<K, C> listener) {
"""
Registers a continuous query listener that uses a query DSL based filter. The listener will receive notifications
when a cache entry joins or leaves the matching set defined by the query.
@param listener the c... | java | public <C> void addContinuousQueryListener(Query query, ContinuousQueryListener<K, C> listener) {
addContinuousQueryListener(query.getQueryString(), query.getParameters(), listener);
} | [
"public",
"<",
"C",
">",
"void",
"addContinuousQueryListener",
"(",
"Query",
"query",
",",
"ContinuousQueryListener",
"<",
"K",
",",
"C",
">",
"listener",
")",
"{",
"addContinuousQueryListener",
"(",
"query",
".",
"getQueryString",
"(",
")",
",",
"query",
".",... | Registers a continuous query listener that uses a query DSL based filter. The listener will receive notifications
when a cache entry joins or leaves the matching set defined by the query.
@param listener the continuous query listener instance
@param query the query to be used for determining the matching set | [
"Registers",
"a",
"continuous",
"query",
"listener",
"that",
"uses",
"a",
"query",
"DSL",
"based",
"filter",
".",
"The",
"listener",
"will",
"receive",
"notifications",
"when",
"a",
"cache",
"entry",
"joins",
"or",
"leaves",
"the",
"matching",
"set",
"defined"... | train | https://github.com/infinispan/infinispan/blob/7c62b94886c3febb4774ae8376acf2baa0265ab5/client/hotrod-client/src/main/java/org/infinispan/client/hotrod/event/impl/ContinuousQueryImpl.java#L68-L70 |
voldemort/voldemort | src/java/voldemort/utils/StoreDefinitionUtils.java | StoreDefinitionUtils.validateNewStoreDefIsNonBreaking | public static void validateNewStoreDefIsNonBreaking(StoreDefinition oldStoreDef, StoreDefinition newStoreDef) {
"""
Ensure that new store definitions that are specified for an update do not include breaking changes to the store.
Non-breaking changes include changes to
description
preferredWrites
requiredWrit... | java | public static void validateNewStoreDefIsNonBreaking(StoreDefinition oldStoreDef, StoreDefinition newStoreDef){
if (!oldStoreDef.getName().equals(newStoreDef.getName())){
throw new VoldemortException("Cannot compare stores of different names: " + oldStoreDef.getName() + " and " + newStoreDef.getName(... | [
"public",
"static",
"void",
"validateNewStoreDefIsNonBreaking",
"(",
"StoreDefinition",
"oldStoreDef",
",",
"StoreDefinition",
"newStoreDef",
")",
"{",
"if",
"(",
"!",
"oldStoreDef",
".",
"getName",
"(",
")",
".",
"equals",
"(",
"newStoreDef",
".",
"getName",
"(",... | Ensure that new store definitions that are specified for an update do not include breaking changes to the store.
Non-breaking changes include changes to
description
preferredWrites
requiredWrites
preferredReads
requiredReads
retentionPeriodDays
retentionScanThrottleRate
retentionFrequencyDays
viewOf
zoneCountReads
zon... | [
"Ensure",
"that",
"new",
"store",
"definitions",
"that",
"are",
"specified",
"for",
"an",
"update",
"do",
"not",
"include",
"breaking",
"changes",
"to",
"the",
"store",
"."
] | train | https://github.com/voldemort/voldemort/blob/a7dbdea58032021361680faacf2782cf981c5332/src/java/voldemort/utils/StoreDefinitionUtils.java#L305-L324 |
google/error-prone-javac | src/jdk.javadoc/share/classes/com/sun/tools/doclets/internal/toolkit/builders/FieldBuilder.java | FieldBuilder.buildFieldDoc | public void buildFieldDoc(XMLNode node, Content memberDetailsTree) {
"""
Build the field documentation.
@param node the XML element that specifies which components to document
@param memberDetailsTree the content tree to which the documentation will be added
"""
if (writer == null) {
re... | java | public void buildFieldDoc(XMLNode node, Content memberDetailsTree) {
if (writer == null) {
return;
}
int size = fields.size();
if (size > 0) {
Content fieldDetailsTree = writer.getFieldDetailsTreeHeader(
classDoc, memberDetailsTree);
... | [
"public",
"void",
"buildFieldDoc",
"(",
"XMLNode",
"node",
",",
"Content",
"memberDetailsTree",
")",
"{",
"if",
"(",
"writer",
"==",
"null",
")",
"{",
"return",
";",
"}",
"int",
"size",
"=",
"fields",
".",
"size",
"(",
")",
";",
"if",
"(",
"size",
">... | Build the field documentation.
@param node the XML element that specifies which components to document
@param memberDetailsTree the content tree to which the documentation will be added | [
"Build",
"the",
"field",
"documentation",
"."
] | train | https://github.com/google/error-prone-javac/blob/a53d069bbdb2c60232ed3811c19b65e41c3e60e0/src/jdk.javadoc/share/classes/com/sun/tools/doclets/internal/toolkit/builders/FieldBuilder.java#L153-L173 |
primefaces-extensions/core | src/main/java/org/primefaces/extensions/component/sheet/Sheet.java | Sheet.setSubmittedValue | public void setSubmittedValue(final FacesContext context, final String rowKey, final int col, final String value) {
"""
Updates a submitted value.
@param row
@param col
@param value
"""
submittedValues.put(new SheetRowColIndex(rowKey, col), value);
} | java | public void setSubmittedValue(final FacesContext context, final String rowKey, final int col, final String value) {
submittedValues.put(new SheetRowColIndex(rowKey, col), value);
} | [
"public",
"void",
"setSubmittedValue",
"(",
"final",
"FacesContext",
"context",
",",
"final",
"String",
"rowKey",
",",
"final",
"int",
"col",
",",
"final",
"String",
"value",
")",
"{",
"submittedValues",
".",
"put",
"(",
"new",
"SheetRowColIndex",
"(",
"rowKey... | Updates a submitted value.
@param row
@param col
@param value | [
"Updates",
"a",
"submitted",
"value",
"."
] | train | https://github.com/primefaces-extensions/core/blob/afdbca591f60f47898e3517e1e939bc2f63d5355/src/main/java/org/primefaces/extensions/component/sheet/Sheet.java#L269-L271 |
ModeShape/modeshape | web/modeshape-web-explorer/src/main/java/org/modeshape/web/client/Console.java | Console.changeRepositoryInURL | public void changeRepositoryInURL(String name, boolean changeHistory) {
"""
Changes repository name in URL displayed by browser.
@param name the name of the repository.
@param changeHistory if true store URL changes in history.
"""
jcrURL.setRepository(name);
if (changeHistory) {
... | java | public void changeRepositoryInURL(String name, boolean changeHistory) {
jcrURL.setRepository(name);
if (changeHistory) {
htmlHistory.newItem(jcrURL.toString(), false);
}
} | [
"public",
"void",
"changeRepositoryInURL",
"(",
"String",
"name",
",",
"boolean",
"changeHistory",
")",
"{",
"jcrURL",
".",
"setRepository",
"(",
"name",
")",
";",
"if",
"(",
"changeHistory",
")",
"{",
"htmlHistory",
".",
"newItem",
"(",
"jcrURL",
".",
"toSt... | Changes repository name in URL displayed by browser.
@param name the name of the repository.
@param changeHistory if true store URL changes in history. | [
"Changes",
"repository",
"name",
"in",
"URL",
"displayed",
"by",
"browser",
"."
] | train | https://github.com/ModeShape/modeshape/blob/794cfdabb67a90f24629c4fff0424a6125f8f95b/web/modeshape-web-explorer/src/main/java/org/modeshape/web/client/Console.java#L250-L255 |
OpenLiberty/open-liberty | dev/com.ibm.ws.jsf.2.2/src/org/apache/myfaces/application/NavigationHandlerImpl.java | NavigationHandlerImpl.getNavigationCase | public NavigationCase getNavigationCase(FacesContext facesContext, String fromAction, String outcome) {
"""
Returns the navigation case that applies for the given action and outcome
"""
NavigationContext navigationContext = new NavigationContext();
try
{
return getNavigation... | java | public NavigationCase getNavigationCase(FacesContext facesContext, String fromAction, String outcome)
{
NavigationContext navigationContext = new NavigationContext();
try
{
return getNavigationCommand(facesContext, navigationContext, fromAction, outcome, null);
}
... | [
"public",
"NavigationCase",
"getNavigationCase",
"(",
"FacesContext",
"facesContext",
",",
"String",
"fromAction",
",",
"String",
"outcome",
")",
"{",
"NavigationContext",
"navigationContext",
"=",
"new",
"NavigationContext",
"(",
")",
";",
"try",
"{",
"return",
"ge... | Returns the navigation case that applies for the given action and outcome | [
"Returns",
"the",
"navigation",
"case",
"that",
"applies",
"for",
"the",
"given",
"action",
"and",
"outcome"
] | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.jsf.2.2/src/org/apache/myfaces/application/NavigationHandlerImpl.java#L389-L400 |
elki-project/elki | elki-core-util/src/main/java/de/lmu/ifi/dbs/elki/utilities/io/FileUtil.java | FileUtil.slurp | public static String slurp(InputStream is) throws IOException {
"""
Load an input stream (e.g., a Java resource) into a String buffer. The
stream is closed afterwards.
@param is Input stream
@return String with file/resource contents.
@throws IOException on IO errors
"""
StringBuilder buf = new Strin... | java | public static String slurp(InputStream is) throws IOException {
StringBuilder buf = new StringBuilder();
final byte[] b = new byte[4096];
for(int n; (n = is.read(b)) != -1;) {
buf.append(new String(b, 0, n));
}
is.close();
return buf.toString();
} | [
"public",
"static",
"String",
"slurp",
"(",
"InputStream",
"is",
")",
"throws",
"IOException",
"{",
"StringBuilder",
"buf",
"=",
"new",
"StringBuilder",
"(",
")",
";",
"final",
"byte",
"[",
"]",
"b",
"=",
"new",
"byte",
"[",
"4096",
"]",
";",
"for",
"(... | Load an input stream (e.g., a Java resource) into a String buffer. The
stream is closed afterwards.
@param is Input stream
@return String with file/resource contents.
@throws IOException on IO errors | [
"Load",
"an",
"input",
"stream",
"(",
"e",
".",
"g",
".",
"a",
"Java",
"resource",
")",
"into",
"a",
"String",
"buffer",
".",
"The",
"stream",
"is",
"closed",
"afterwards",
"."
] | train | https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-core-util/src/main/java/de/lmu/ifi/dbs/elki/utilities/io/FileUtil.java#L195-L203 |
TheHortonMachine/hortonmachine | gears/src/main/java/org/hortonmachine/gears/libs/modules/GridNode.java | GridNode.goDownstreamSP | public GridNode goDownstreamSP() {
"""
Get next downstream {@link GridNode node} following the steepest path.
@return the next downstream node or <code>null</code> if it is an outlet.
"""
Direction[] orderedDirs = Direction.getOrderedDirs();
double maxSlope = Double.NEGATIVE_INFINITY;
... | java | public GridNode goDownstreamSP() {
Direction[] orderedDirs = Direction.getOrderedDirs();
double maxSlope = Double.NEGATIVE_INFINITY;
GridNode nextNode = null;
for( Direction direction : orderedDirs ) {
int newCol = col + direction.col;
int newRow = row + direction... | [
"public",
"GridNode",
"goDownstreamSP",
"(",
")",
"{",
"Direction",
"[",
"]",
"orderedDirs",
"=",
"Direction",
".",
"getOrderedDirs",
"(",
")",
";",
"double",
"maxSlope",
"=",
"Double",
".",
"NEGATIVE_INFINITY",
";",
"GridNode",
"nextNode",
"=",
"null",
";",
... | Get next downstream {@link GridNode node} following the steepest path.
@return the next downstream node or <code>null</code> if it is an outlet. | [
"Get",
"next",
"downstream",
"{",
"@link",
"GridNode",
"node",
"}",
"following",
"the",
"steepest",
"path",
"."
] | train | https://github.com/TheHortonMachine/hortonmachine/blob/d2b436bbdf951dc1fda56096a42dbc0eae4d35a5/gears/src/main/java/org/hortonmachine/gears/libs/modules/GridNode.java#L334-L356 |
infinispan/infinispan | core/src/main/java/org/infinispan/interceptors/BaseAsyncInterceptor.java | BaseAsyncInterceptor.delayedValue | public static Object delayedValue(CompletionStage<Void> stage, Object syncValue, Throwable throwable) {
"""
This method should be used instead of {@link #delayedValue(CompletionStage, Object)} when a
{@link InvocationFinallyFunction} is used to properly handle the exception if any is present.
@param stage
@para... | java | public static Object delayedValue(CompletionStage<Void> stage, Object syncValue, Throwable throwable) {
if (throwable == null) {
return delayedValue(stage, syncValue);
}
if (stage != null) {
CompletableFuture<?> future = stage.toCompletableFuture();
if (!future.isDone() || f... | [
"public",
"static",
"Object",
"delayedValue",
"(",
"CompletionStage",
"<",
"Void",
">",
"stage",
",",
"Object",
"syncValue",
",",
"Throwable",
"throwable",
")",
"{",
"if",
"(",
"throwable",
"==",
"null",
")",
"{",
"return",
"delayedValue",
"(",
"stage",
",",... | This method should be used instead of {@link #delayedValue(CompletionStage, Object)} when a
{@link InvocationFinallyFunction} is used to properly handle the exception if any is present.
@param stage
@param syncValue
@param throwable
@return | [
"This",
"method",
"should",
"be",
"used",
"instead",
"of",
"{"
] | train | https://github.com/infinispan/infinispan/blob/7c62b94886c3febb4774ae8376acf2baa0265ab5/core/src/main/java/org/infinispan/interceptors/BaseAsyncInterceptor.java#L320-L338 |
VoltDB/voltdb | src/hsqldb19b3/org/hsqldb_voltpatches/lib/RefCapablePropertyResourceBundle.java | RefCapablePropertyResourceBundle.posSubst | public String posSubst(String s, String[] subs, int behavior) {
"""
Replaces positional substitution patterns of the form %{\d} with
corresponding element of the given subs array.
Note that %{\d} numbers are 1-based, so we lok for subs[x-1].
"""
Matcher matcher = posPattern.matcher(s);
int pr... | java | public String posSubst(String s, String[] subs, int behavior) {
Matcher matcher = posPattern.matcher(s);
int previousEnd = 0;
StringBuffer sb = new StringBuffer();
String varValue;
int varIndex;
String condlVal; // Conditional : value
while (matcher.find()) {
... | [
"public",
"String",
"posSubst",
"(",
"String",
"s",
",",
"String",
"[",
"]",
"subs",
",",
"int",
"behavior",
")",
"{",
"Matcher",
"matcher",
"=",
"posPattern",
".",
"matcher",
"(",
"s",
")",
";",
"int",
"previousEnd",
"=",
"0",
";",
"StringBuffer",
"sb... | Replaces positional substitution patterns of the form %{\d} with
corresponding element of the given subs array.
Note that %{\d} numbers are 1-based, so we lok for subs[x-1]. | [
"Replaces",
"positional",
"substitution",
"patterns",
"of",
"the",
"form",
"%",
"{",
"\\",
"d",
"}",
"with",
"corresponding",
"element",
"of",
"the",
"given",
"subs",
"array",
".",
"Note",
"that",
"%",
"{",
"\\",
"d",
"}",
"numbers",
"are",
"1",
"-",
"... | train | https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/src/hsqldb19b3/org/hsqldb_voltpatches/lib/RefCapablePropertyResourceBundle.java#L241-L282 |
google/j2objc | jre_emul/android/platform/libcore/ojluni/src/main/java/java/util/TreeMap.java | TreeMap.colorOf | private static <K,V> boolean colorOf(TreeMapEntry<K,V> p) {
"""
Balancing operations.
Implementations of rebalancings during insertion and deletion are
slightly different than the CLR version. Rather than using dummy
nilnodes, we use a set of accessors that deal properly with null. They
are used to avoid m... | java | private static <K,V> boolean colorOf(TreeMapEntry<K,V> p) {
return (p == null ? BLACK : p.color);
} | [
"private",
"static",
"<",
"K",
",",
"V",
">",
"boolean",
"colorOf",
"(",
"TreeMapEntry",
"<",
"K",
",",
"V",
">",
"p",
")",
"{",
"return",
"(",
"p",
"==",
"null",
"?",
"BLACK",
":",
"p",
".",
"color",
")",
";",
"}"
] | Balancing operations.
Implementations of rebalancings during insertion and deletion are
slightly different than the CLR version. Rather than using dummy
nilnodes, we use a set of accessors that deal properly with null. They
are used to avoid messiness surrounding nullness checks in the main
algorithms. | [
"Balancing",
"operations",
"."
] | train | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/libcore/ojluni/src/main/java/java/util/TreeMap.java#L2282-L2284 |
zaproxy/zaproxy | src/org/parosproxy/paros/network/HttpSender.java | HttpSender.sendAndReceive | public void sendAndReceive(HttpMessage msg, boolean isFollowRedirect) throws IOException {
"""
Send and receive a HttpMessage.
@param msg
@param isFollowRedirect
@throws HttpException
@throws IOException
@see #sendAndReceive(HttpMessage, HttpRequestConfig)
"""
log.debug("sendAndReceive " + msg.getR... | java | public void sendAndReceive(HttpMessage msg, boolean isFollowRedirect) throws IOException {
log.debug("sendAndReceive " + msg.getRequestHeader().getMethod() + " "
+ msg.getRequestHeader().getURI() + " start");
msg.setTimeSentMillis(System.currentTimeMillis());
try {
notifyRequestListeners(msg);
... | [
"public",
"void",
"sendAndReceive",
"(",
"HttpMessage",
"msg",
",",
"boolean",
"isFollowRedirect",
")",
"throws",
"IOException",
"{",
"log",
".",
"debug",
"(",
"\"sendAndReceive \"",
"+",
"msg",
".",
"getRequestHeader",
"(",
")",
".",
"getMethod",
"(",
")",
"+... | Send and receive a HttpMessage.
@param msg
@param isFollowRedirect
@throws HttpException
@throws IOException
@see #sendAndReceive(HttpMessage, HttpRequestConfig) | [
"Send",
"and",
"receive",
"a",
"HttpMessage",
"."
] | train | https://github.com/zaproxy/zaproxy/blob/0cbe5121f2ae1ecca222513d182759210c569bec/src/org/parosproxy/paros/network/HttpSender.java#L402-L450 |
jeremybrooks/jinx | src/main/java/net/jeremybrooks/jinx/Jinx.java | Jinx.flickrPost | public <T> T flickrPost(Map<String, String> params, Class<T> tClass, boolean sign) throws JinxException {
"""
Call Flickr, returning the specified class deserialized from the Flickr response.
<br>
This will make a call to Flickr using http POST. The caller can specify if the request should be signed.
<p>
Do no... | java | public <T> T flickrPost(Map<String, String> params, Class<T> tClass, boolean sign) throws JinxException {
return callFlickr(params, Method.POST, tClass, sign);
} | [
"public",
"<",
"T",
">",
"T",
"flickrPost",
"(",
"Map",
"<",
"String",
",",
"String",
">",
"params",
",",
"Class",
"<",
"T",
">",
"tClass",
",",
"boolean",
"sign",
")",
"throws",
"JinxException",
"{",
"return",
"callFlickr",
"(",
"params",
",",
"Method... | Call Flickr, returning the specified class deserialized from the Flickr response.
<br>
This will make a call to Flickr using http POST. The caller can specify if the request should be signed.
<p>
Do not call this method directly. The classes in the net.jeremybrooks.jinx.api package will call this.
@param params reques... | [
"Call",
"Flickr",
"returning",
"the",
"specified",
"class",
"deserialized",
"from",
"the",
"Flickr",
"response",
".",
"<br",
">",
"This",
"will",
"make",
"a",
"call",
"to",
"Flickr",
"using",
"http",
"POST",
".",
"The",
"caller",
"can",
"specify",
"if",
"t... | train | https://github.com/jeremybrooks/jinx/blob/ab7a4b7462d08bcbfd9b98bd3f5029771c20f6c6/src/main/java/net/jeremybrooks/jinx/Jinx.java#L508-L510 |
grpc/grpc-java | core/src/main/java/io/grpc/internal/Http2Ping.java | Http2Ping.addCallback | public void addCallback(final ClientTransport.PingCallback callback, Executor executor) {
"""
Registers a callback that is invoked when the ping operation completes. If this ping operation
is already completed, the callback is invoked immediately.
@param callback the callback to invoke
@param executor the exe... | java | public void addCallback(final ClientTransport.PingCallback callback, Executor executor) {
Runnable runnable;
synchronized (this) {
if (!completed) {
callbacks.put(callback, executor);
return;
}
// otherwise, invoke callback immediately (but not while holding lock)
runnabl... | [
"public",
"void",
"addCallback",
"(",
"final",
"ClientTransport",
".",
"PingCallback",
"callback",
",",
"Executor",
"executor",
")",
"{",
"Runnable",
"runnable",
";",
"synchronized",
"(",
"this",
")",
"{",
"if",
"(",
"!",
"completed",
")",
"{",
"callbacks",
... | Registers a callback that is invoked when the ping operation completes. If this ping operation
is already completed, the callback is invoked immediately.
@param callback the callback to invoke
@param executor the executor to use | [
"Registers",
"a",
"callback",
"that",
"is",
"invoked",
"when",
"the",
"ping",
"operation",
"completes",
".",
"If",
"this",
"ping",
"operation",
"is",
"already",
"completed",
"the",
"callback",
"is",
"invoked",
"immediately",
"."
] | train | https://github.com/grpc/grpc-java/blob/973885457f9609de232d2553b82c67f6c3ff57bf/core/src/main/java/io/grpc/internal/Http2Ping.java#L93-L105 |
exoplatform/jcr | exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/value/ValueFactoryImpl.java | ValueFactoryImpl.createValue | public Value createValue(JCRName value) throws RepositoryException {
"""
Create Value from JCRName.
@param value
JCRName
@return Value
@throws RepositoryException
if error
"""
if (value == null)
return null;
try
{
return new NameValue(value.getInternalName(), location... | java | public Value createValue(JCRName value) throws RepositoryException
{
if (value == null)
return null;
try
{
return new NameValue(value.getInternalName(), locationFactory);
}
catch (IOException e)
{
throw new RepositoryException("Cannot create NAME Value f... | [
"public",
"Value",
"createValue",
"(",
"JCRName",
"value",
")",
"throws",
"RepositoryException",
"{",
"if",
"(",
"value",
"==",
"null",
")",
"return",
"null",
";",
"try",
"{",
"return",
"new",
"NameValue",
"(",
"value",
".",
"getInternalName",
"(",
")",
",... | Create Value from JCRName.
@param value
JCRName
@return Value
@throws RepositoryException
if error | [
"Create",
"Value",
"from",
"JCRName",
"."
] | train | https://github.com/exoplatform/jcr/blob/3e7f9ee1b5683640d73a4316fb4b0ad5eac5b8a2/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/value/ValueFactoryImpl.java#L304-L316 |
OpenLiberty/open-liberty | dev/com.ibm.ws.jaxws.clientcontainer/src/com/ibm/ws/jaxws/metadata/Utils.java | Utils.compareInstance | public static <T> boolean compareInstance(T t1, T t2) {
"""
Compare tow instance. If both are null, still equal
@param t1
@param t2
@return
"""
if (t1 == t2) {
return true;
}
if (t1 != null && t2 != null && t1.equals(t2)) {
return true;
}
re... | java | public static <T> boolean compareInstance(T t1, T t2) {
if (t1 == t2) {
return true;
}
if (t1 != null && t2 != null && t1.equals(t2)) {
return true;
}
return false;
} | [
"public",
"static",
"<",
"T",
">",
"boolean",
"compareInstance",
"(",
"T",
"t1",
",",
"T",
"t2",
")",
"{",
"if",
"(",
"t1",
"==",
"t2",
")",
"{",
"return",
"true",
";",
"}",
"if",
"(",
"t1",
"!=",
"null",
"&&",
"t2",
"!=",
"null",
"&&",
"t1",
... | Compare tow instance. If both are null, still equal
@param t1
@param t2
@return | [
"Compare",
"tow",
"instance",
".",
"If",
"both",
"are",
"null",
"still",
"equal"
] | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.jaxws.clientcontainer/src/com/ibm/ws/jaxws/metadata/Utils.java#L28-L37 |
milaboratory/milib | src/main/java/com/milaboratory/core/io/util/IOUtil.java | IOUtil.readRawVarint32 | public static int readRawVarint32(final InputStream is, int eofVaule) throws IOException {
"""
Read a raw Varint from the stream.
<p>Based on com.google.protobuf.CodedInputStream class from Google's protobuf library.</p>
"""
int result = 0;
int shift = 0;
for (; shift < 32; shift += ... | java | public static int readRawVarint32(final InputStream is, int eofVaule) throws IOException {
int result = 0;
int shift = 0;
for (; shift < 32; shift += 7) {
final int b = is.read();
if (b == -1)
if (shift == 0)
return eofVaule;
... | [
"public",
"static",
"int",
"readRawVarint32",
"(",
"final",
"InputStream",
"is",
",",
"int",
"eofVaule",
")",
"throws",
"IOException",
"{",
"int",
"result",
"=",
"0",
";",
"int",
"shift",
"=",
"0",
";",
"for",
"(",
";",
"shift",
"<",
"32",
";",
"shift"... | Read a raw Varint from the stream.
<p>Based on com.google.protobuf.CodedInputStream class from Google's protobuf library.</p> | [
"Read",
"a",
"raw",
"Varint",
"from",
"the",
"stream",
"."
] | train | https://github.com/milaboratory/milib/blob/2349b3dccdd3c7948643760e570238d6e30d5a34/src/main/java/com/milaboratory/core/io/util/IOUtil.java#L34-L51 |
sstrickx/yahoofinance-api | src/main/java/yahoofinance/Utils.java | Utils.parseDateTime | public static Calendar parseDateTime(String date, String time, TimeZone timeZone) {
"""
Used to parse the last trade date / time. Returns null if the date / time
cannot be parsed.
@param date String received that represents the date
@param time String received that represents the time
@param timeZone time zo... | java | public static Calendar parseDateTime(String date, String time, TimeZone timeZone) {
String datetime = date + " " + time;
SimpleDateFormat format = new SimpleDateFormat("M/d/yyyy h:mma", Locale.US);
format.setTimeZone(timeZone);
try {
if (Utils.isParseable(date) && Ut... | [
"public",
"static",
"Calendar",
"parseDateTime",
"(",
"String",
"date",
",",
"String",
"time",
",",
"TimeZone",
"timeZone",
")",
"{",
"String",
"datetime",
"=",
"date",
"+",
"\" \"",
"+",
"time",
";",
"SimpleDateFormat",
"format",
"=",
"new",
"SimpleDateFormat... | Used to parse the last trade date / time. Returns null if the date / time
cannot be parsed.
@param date String received that represents the date
@param time String received that represents the time
@param timeZone time zone to use for parsing the date time
@return Calendar object with the parsed datetime | [
"Used",
"to",
"parse",
"the",
"last",
"trade",
"date",
"/",
"time",
".",
"Returns",
"null",
"if",
"the",
"date",
"/",
"time",
"cannot",
"be",
"parsed",
"."
] | train | https://github.com/sstrickx/yahoofinance-api/blob/2766ba52fc5cccf9b4da5c06423d68059cf0a6e6/src/main/java/yahoofinance/Utils.java#L235-L251 |
reinert/requestor | requestor/core/requestor-api/src/main/java/io/reinert/requestor/header/Header.java | Header.fromRawHeader | public static Header fromRawHeader(com.google.gwt.http.client.Header rawHeader) {
"""
Factory method useful to create headers from original GWT {@link com.google.gwt.http.client.Response}.
<p/>
It should be used by {@link io.reinert.requestor.RequestDispatcher} impls when receiving responses.
@param rawHeader... | java | public static Header fromRawHeader(com.google.gwt.http.client.Header rawHeader) {
final String name = rawHeader.getName().toUpperCase();
final String value = rawHeader.getValue();
if ("CONTENT-TYPE".equals(name))
return new ContentTypeHeader(value);
if ("LINK".equals(name))... | [
"public",
"static",
"Header",
"fromRawHeader",
"(",
"com",
".",
"google",
".",
"gwt",
".",
"http",
".",
"client",
".",
"Header",
"rawHeader",
")",
"{",
"final",
"String",
"name",
"=",
"rawHeader",
".",
"getName",
"(",
")",
".",
"toUpperCase",
"(",
")",
... | Factory method useful to create headers from original GWT {@link com.google.gwt.http.client.Response}.
<p/>
It should be used by {@link io.reinert.requestor.RequestDispatcher} impls when receiving responses.
@param rawHeader The original GWT header
@return The parsed header | [
"Factory",
"method",
"useful",
"to",
"create",
"headers",
"from",
"original",
"GWT",
"{",
"@link",
"com",
".",
"google",
".",
"gwt",
".",
"http",
".",
"client",
".",
"Response",
"}",
".",
"<p",
"/",
">",
"It",
"should",
"be",
"used",
"by",
"{",
"@lin... | train | https://github.com/reinert/requestor/blob/40163a75cd17815d5089935d0dd97b8d652ad6d4/requestor/core/requestor-api/src/main/java/io/reinert/requestor/header/Header.java#L35-L46 |
j-a-w-r/jawr-main-repo | jawr/jawr-core/src/main/java/net/jawr/web/resource/handler/bundle/AbstractResourceBundleHandler.java | AbstractResourceBundleHandler.initTempDirectory | private void initTempDirectory(String tempDirRoot, boolean createTempSubDir) {
"""
Initialize the temporary directories
@param tempDirRoot
the temporary directory root
@param createTempSubDir
the flag indicating if we should create the temporary
directory.
"""
tempDirPath = tempDirRoot;
// In wind... | java | private void initTempDirectory(String tempDirRoot, boolean createTempSubDir) {
tempDirPath = tempDirRoot;
// In windows, pathnames with spaces are returned as %20
if (tempDirPath.contains("%20"))
tempDirPath = tempDirPath.replaceAll("%20", " ");
this.textDirPath = tempDirPath + File.separator + TEMP_TEXT_... | [
"private",
"void",
"initTempDirectory",
"(",
"String",
"tempDirRoot",
",",
"boolean",
"createTempSubDir",
")",
"{",
"tempDirPath",
"=",
"tempDirRoot",
";",
"// In windows, pathnames with spaces are returned as %20",
"if",
"(",
"tempDirPath",
".",
"contains",
"(",
"\"%20\"... | Initialize the temporary directories
@param tempDirRoot
the temporary directory root
@param createTempSubDir
the flag indicating if we should create the temporary
directory. | [
"Initialize",
"the",
"temporary",
"directories"
] | train | https://github.com/j-a-w-r/jawr-main-repo/blob/5381f6acf461cd2502593c67a77bd6ef9eab848d/jawr/jawr-core/src/main/java/net/jawr/web/resource/handler/bundle/AbstractResourceBundleHandler.java#L204-L226 |
google/j2objc | xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/serializer/ToUnknownStream.java | ToUnknownStream.processingInstruction | public void processingInstruction(String target, String data)
throws SAXException {
"""
Pass the call on to the underlying handler
@see org.xml.sax.ContentHandler#processingInstruction(String, String)
"""
if (m_firstTagNotEmitted)
{
flush();
}
m_handler.pro... | java | public void processingInstruction(String target, String data)
throws SAXException
{
if (m_firstTagNotEmitted)
{
flush();
}
m_handler.processingInstruction(target, data);
} | [
"public",
"void",
"processingInstruction",
"(",
"String",
"target",
",",
"String",
"data",
")",
"throws",
"SAXException",
"{",
"if",
"(",
"m_firstTagNotEmitted",
")",
"{",
"flush",
"(",
")",
";",
"}",
"m_handler",
".",
"processingInstruction",
"(",
"target",
"... | Pass the call on to the underlying handler
@see org.xml.sax.ContentHandler#processingInstruction(String, String) | [
"Pass",
"the",
"call",
"on",
"to",
"the",
"underlying",
"handler"
] | train | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/serializer/ToUnknownStream.java#L853-L862 |
katharsis-project/katharsis-framework | katharsis-core/src/main/java/io/katharsis/legacy/registry/ResourceRegistryBuilder.java | ResourceRegistryBuilder.build | public ResourceRegistry build(String packageName, ModuleRegistry moduleRegistry, ServiceUrlProvider serviceUrlProvider) {
"""
Uses a {@link DefaultResourceLookup} to get all classes in provided
package and finds all resources and repositories associated with found
resource.
@param packageName
Package contain... | java | public ResourceRegistry build(String packageName, ModuleRegistry moduleRegistry, ServiceUrlProvider serviceUrlProvider) {
return build(new DefaultResourceLookup(packageName), moduleRegistry, serviceUrlProvider);
} | [
"public",
"ResourceRegistry",
"build",
"(",
"String",
"packageName",
",",
"ModuleRegistry",
"moduleRegistry",
",",
"ServiceUrlProvider",
"serviceUrlProvider",
")",
"{",
"return",
"build",
"(",
"new",
"DefaultResourceLookup",
"(",
"packageName",
")",
",",
"moduleRegistry... | Uses a {@link DefaultResourceLookup} to get all classes in provided
package and finds all resources and repositories associated with found
resource.
@param packageName
Package containing resources (models) and repositories.
@param serviceUrlProvider
Compute the resource to this service
@return an instance of ResourceR... | [
"Uses",
"a",
"{",
"@link",
"DefaultResourceLookup",
"}",
"to",
"get",
"all",
"classes",
"in",
"provided",
"package",
"and",
"finds",
"all",
"resources",
"and",
"repositories",
"associated",
"with",
"found",
"resource",
"."
] | train | https://github.com/katharsis-project/katharsis-framework/blob/73d1a8763c49c5cf4643d43e2dbfedb647630c46/katharsis-core/src/main/java/io/katharsis/legacy/registry/ResourceRegistryBuilder.java#L55-L57 |
apigee/usergrid-java-sdk | src/main/java/org/usergrid/java/client/Client.java | Client.authorizeAppClient | public ApiResponse authorizeAppClient(String clientId, String clientSecret) {
"""
Log the app in with it's client id and client secret key. Not recommended
for production apps.
@param email
@param pin
@return non-null ApiResponse if request succeeds, check getError() for
"invalid_grant" to see if access is ... | java | public ApiResponse authorizeAppClient(String clientId, String clientSecret) {
validateNonEmptyParam(clientId, "client identifier");
validateNonEmptyParam(clientSecret, "client secret");
assertValidApplicationId();
loggedInUser = null;
accessToken = null;
currentOrganizati... | [
"public",
"ApiResponse",
"authorizeAppClient",
"(",
"String",
"clientId",
",",
"String",
"clientSecret",
")",
"{",
"validateNonEmptyParam",
"(",
"clientId",
",",
"\"client identifier\"",
")",
";",
"validateNonEmptyParam",
"(",
"clientSecret",
",",
"\"client secret\"",
"... | Log the app in with it's client id and client secret key. Not recommended
for production apps.
@param email
@param pin
@return non-null ApiResponse if request succeeds, check getError() for
"invalid_grant" to see if access is denied. | [
"Log",
"the",
"app",
"in",
"with",
"it",
"s",
"client",
"id",
"and",
"client",
"secret",
"key",
".",
"Not",
"recommended",
"for",
"production",
"apps",
"."
] | train | https://github.com/apigee/usergrid-java-sdk/blob/6202745f184754defff13962dfc3d830bc7d8c63/src/main/java/org/usergrid/java/client/Client.java#L502-L528 |
alkacon/opencms-core | src-gwt/org/opencms/gwt/client/ui/input/colorpicker/CmsSliderBar.java | CmsSliderBar.setLayerColor | public void setLayerColor(String color, int layer) {
"""
Sets the color of a particular layer.<p>
@param color Hexadecimal notation of RGB to change the layer's color
@param layer Which layer to affect
"""
switch (layer) {
case COLORBAR_A:
m_colorA.getElement().getSty... | java | public void setLayerColor(String color, int layer) {
switch (layer) {
case COLORBAR_A:
m_colorA.getElement().getStyle().setBackgroundColor(color);
break;
case COLORBAR_B:
m_colorB.getElement().getStyle().setBackgroundColor(color);
... | [
"public",
"void",
"setLayerColor",
"(",
"String",
"color",
",",
"int",
"layer",
")",
"{",
"switch",
"(",
"layer",
")",
"{",
"case",
"COLORBAR_A",
":",
"m_colorA",
".",
"getElement",
"(",
")",
".",
"getStyle",
"(",
")",
".",
"setBackgroundColor",
"(",
"co... | Sets the color of a particular layer.<p>
@param color Hexadecimal notation of RGB to change the layer's color
@param layer Which layer to affect | [
"Sets",
"the",
"color",
"of",
"a",
"particular",
"layer",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src-gwt/org/opencms/gwt/client/ui/input/colorpicker/CmsSliderBar.java#L260-L278 |
ThreeTen/threetenbp | src/main/java/org/threeten/bp/chrono/HijrahDate.java | HijrahDate.getDayOfYear | private static int getDayOfYear(int cycleNumber, int dayOfCycle, int yearInCycle) {
"""
Returns day-of-year.
@param cycleNumber a cycle number
@param dayOfCycle day of cycle
@param yearInCycle year in cycle
@return day-of-year
"""
Integer[] cycles = getAdjustedCycle(cycleNumber);
if (... | java | private static int getDayOfYear(int cycleNumber, int dayOfCycle, int yearInCycle) {
Integer[] cycles = getAdjustedCycle(cycleNumber);
if (dayOfCycle > 0) {
return dayOfCycle - cycles[yearInCycle].intValue();
} else {
return cycles[yearInCycle].intValue() + dayOfCycle;
... | [
"private",
"static",
"int",
"getDayOfYear",
"(",
"int",
"cycleNumber",
",",
"int",
"dayOfCycle",
",",
"int",
"yearInCycle",
")",
"{",
"Integer",
"[",
"]",
"cycles",
"=",
"getAdjustedCycle",
"(",
"cycleNumber",
")",
";",
"if",
"(",
"dayOfCycle",
">",
"0",
"... | Returns day-of-year.
@param cycleNumber a cycle number
@param dayOfCycle day of cycle
@param yearInCycle year in cycle
@return day-of-year | [
"Returns",
"day",
"-",
"of",
"-",
"year",
"."
] | train | https://github.com/ThreeTen/threetenbp/blob/5f05b649f89f205aabd96b2f83c36796ec616fe6/src/main/java/org/threeten/bp/chrono/HijrahDate.java#L1038-L1046 |
Netflix/servo | servo-core/src/main/java/com/netflix/servo/tag/BasicTagList.java | BasicTagList.copy | public BasicTagList copy(String key, String value) {
"""
Returns a new tag list with an additional tag. If {@code key} is
already present in this tag list the value will be overwritten with
{@code value}.
"""
return concat(this, Tags.newTag(key, value));
} | java | public BasicTagList copy(String key, String value) {
return concat(this, Tags.newTag(key, value));
} | [
"public",
"BasicTagList",
"copy",
"(",
"String",
"key",
",",
"String",
"value",
")",
"{",
"return",
"concat",
"(",
"this",
",",
"Tags",
".",
"newTag",
"(",
"key",
",",
"value",
")",
")",
";",
"}"
] | Returns a new tag list with an additional tag. If {@code key} is
already present in this tag list the value will be overwritten with
{@code value}. | [
"Returns",
"a",
"new",
"tag",
"list",
"with",
"an",
"additional",
"tag",
".",
"If",
"{"
] | train | https://github.com/Netflix/servo/blob/d67b5afce8c50bd9e9e31c288dbf4b78fb2ac815/servo-core/src/main/java/com/netflix/servo/tag/BasicTagList.java#L132-L134 |
Erudika/para | para-server/src/main/java/com/erudika/para/persistence/AWSDynamoUtils.java | AWSDynamoUtils.fromRow | protected static <P extends ParaObject> P fromRow(Map<String, AttributeValue> row) {
"""
Converts a DynamoDB row to a {@link ParaObject}.
@param <P> type of object
@param row a DynamoDB row
@return a populated Para object.
"""
if (row == null || row.isEmpty()) {
return null;
}
Map<String, Object> p... | java | protected static <P extends ParaObject> P fromRow(Map<String, AttributeValue> row) {
if (row == null || row.isEmpty()) {
return null;
}
Map<String, Object> props = new HashMap<>();
for (Map.Entry<String, AttributeValue> col : row.entrySet()) {
props.put(col.getKey(), col.getValue().getS());
}
props.pu... | [
"protected",
"static",
"<",
"P",
"extends",
"ParaObject",
">",
"P",
"fromRow",
"(",
"Map",
"<",
"String",
",",
"AttributeValue",
">",
"row",
")",
"{",
"if",
"(",
"row",
"==",
"null",
"||",
"row",
".",
"isEmpty",
"(",
")",
")",
"{",
"return",
"null",
... | Converts a DynamoDB row to a {@link ParaObject}.
@param <P> type of object
@param row a DynamoDB row
@return a populated Para object. | [
"Converts",
"a",
"DynamoDB",
"row",
"to",
"a",
"{"
] | train | https://github.com/Erudika/para/blob/5ba096c477042ea7b18e9a0e8b5b1ee0f5bd6ce9/para-server/src/main/java/com/erudika/para/persistence/AWSDynamoUtils.java#L399-L409 |
google/error-prone | core/src/main/java/com/google/errorprone/bugpatterns/threadsafety/ImmutableAnalysis.java | ImmutableAnalysis.getImmutableAnnotation | AnnotationInfo getImmutableAnnotation(Symbol sym, VisitorState state) {
"""
Gets the {@link Symbol}'s {@code @Immutable} annotation info, either from an annotation on the
symbol or from the list of well-known immutable types.
"""
String nameStr = sym.flatName().toString();
AnnotationInfo known = wellK... | java | AnnotationInfo getImmutableAnnotation(Symbol sym, VisitorState state) {
String nameStr = sym.flatName().toString();
AnnotationInfo known = wellKnownMutability.getKnownImmutableClasses().get(nameStr);
if (known != null) {
return known;
}
return threadSafety.getInheritedAnnotation(sym, state);
... | [
"AnnotationInfo",
"getImmutableAnnotation",
"(",
"Symbol",
"sym",
",",
"VisitorState",
"state",
")",
"{",
"String",
"nameStr",
"=",
"sym",
".",
"flatName",
"(",
")",
".",
"toString",
"(",
")",
";",
"AnnotationInfo",
"known",
"=",
"wellKnownMutability",
".",
"g... | Gets the {@link Symbol}'s {@code @Immutable} annotation info, either from an annotation on the
symbol or from the list of well-known immutable types. | [
"Gets",
"the",
"{"
] | train | https://github.com/google/error-prone/blob/fe2e3cc2cf1958cb7c487bfe89852bb4c225ba9d/core/src/main/java/com/google/errorprone/bugpatterns/threadsafety/ImmutableAnalysis.java#L317-L324 |
jbundle/jbundle | main/msg/src/main/java/org/jbundle/main/msg/db/MessageProcessInfoField.java | MessageProcessInfoField.setupDefaultView | public ScreenComponent setupDefaultView(ScreenLoc itsLocation, ComponentParent targetScreen, Convert converter, int iDisplayFieldDesc, Map<String, Object> properties) {
"""
Set up the default screen control for this field.
@param itsLocation Location of this component on screen (ie., GridBagConstraint).
@param t... | java | public ScreenComponent setupDefaultView(ScreenLoc itsLocation, ComponentParent targetScreen, Convert converter, int iDisplayFieldDesc, Map<String, Object> properties)
{
return this.setupTableLookup(itsLocation, targetScreen, iDisplayFieldDesc, this.makeReferenceRecord(), null, MessageProcessInfo.DESCRIPTION... | [
"public",
"ScreenComponent",
"setupDefaultView",
"(",
"ScreenLoc",
"itsLocation",
",",
"ComponentParent",
"targetScreen",
",",
"Convert",
"converter",
",",
"int",
"iDisplayFieldDesc",
",",
"Map",
"<",
"String",
",",
"Object",
">",
"properties",
")",
"{",
"return",
... | Set up the default screen control for this field.
@param itsLocation Location of this component on screen (ie., GridBagConstraint).
@param targetScreen Where to place this component (ie., Parent screen or GridBagLayout).
@param converter The converter to set the screenfield to.
@param iDisplayFieldDesc Display the labe... | [
"Set",
"up",
"the",
"default",
"screen",
"control",
"for",
"this",
"field",
"."
] | train | https://github.com/jbundle/jbundle/blob/4037fcfa85f60c7d0096c453c1a3cd573c2b0abc/main/msg/src/main/java/org/jbundle/main/msg/db/MessageProcessInfoField.java#L79-L82 |
eclipse/hawkbit | hawkbit-security-core/src/main/java/org/eclipse/hawkbit/util/IpUtil.java | IpUtil.createAmqpUri | public static URI createAmqpUri(final String host, final String exchange) {
"""
Create a {@link URI} with amqp scheme and host.
@param host
the host
@param exchange
the exchange will store in the path
@return the {@link URI}
@throws IllegalArgumentException
If the given string not parse able
"""
... | java | public static URI createAmqpUri(final String host, final String exchange) {
return createUri(AMQP_SCHEME, host).resolve("/" + exchange);
} | [
"public",
"static",
"URI",
"createAmqpUri",
"(",
"final",
"String",
"host",
",",
"final",
"String",
"exchange",
")",
"{",
"return",
"createUri",
"(",
"AMQP_SCHEME",
",",
"host",
")",
".",
"resolve",
"(",
"\"/\"",
"+",
"exchange",
")",
";",
"}"
] | Create a {@link URI} with amqp scheme and host.
@param host
the host
@param exchange
the exchange will store in the path
@return the {@link URI}
@throws IllegalArgumentException
If the given string not parse able | [
"Create",
"a",
"{",
"@link",
"URI",
"}",
"with",
"amqp",
"scheme",
"and",
"host",
"."
] | train | https://github.com/eclipse/hawkbit/blob/9884452ad42f3b4827461606d8a9215c8625a7fe/hawkbit-security-core/src/main/java/org/eclipse/hawkbit/util/IpUtil.java#L146-L148 |
cdk/cdk | base/standard/src/main/java/org/openscience/cdk/graph/invariant/CanonicalLabeler.java | CanonicalLabeler.primeProduct | private void primeProduct(List<InvPair> v, IAtomContainer atomContainer) {
"""
Calculates the product of the neighbouring primes.
@param v the invariance pair vector
"""
Iterator<InvPair> it = v.iterator();
Iterator<IAtom> n;
InvPair inv;
IAtom a;
long summ;
w... | java | private void primeProduct(List<InvPair> v, IAtomContainer atomContainer) {
Iterator<InvPair> it = v.iterator();
Iterator<IAtom> n;
InvPair inv;
IAtom a;
long summ;
while (it.hasNext()) {
inv = (InvPair) it.next();
List<IAtom> neighbour = atomContai... | [
"private",
"void",
"primeProduct",
"(",
"List",
"<",
"InvPair",
">",
"v",
",",
"IAtomContainer",
"atomContainer",
")",
"{",
"Iterator",
"<",
"InvPair",
">",
"it",
"=",
"v",
".",
"iterator",
"(",
")",
";",
"Iterator",
"<",
"IAtom",
">",
"n",
";",
"InvPa... | Calculates the product of the neighbouring primes.
@param v the invariance pair vector | [
"Calculates",
"the",
"product",
"of",
"the",
"neighbouring",
"primes",
"."
] | train | https://github.com/cdk/cdk/blob/c3d0f16502bf08df50365fee392e11d7c9856657/base/standard/src/main/java/org/openscience/cdk/graph/invariant/CanonicalLabeler.java#L146-L165 |
dashorst/wicket-stuff-markup-validator | jing/src/main/java/com/thaiopensource/validate/nvdl/ValidatorImpl.java | Section.addValidator | public void addValidator(Schema schema, ModeUsage modeUsage) {
"""
Adds a validator.
@param schema The schema to validate against.
@param modeUsage The mode usage for this validate action.
"""
// adds the schema to this section schemas
schemas.addElement(schema);
// creates the validator
... | java | public void addValidator(Schema schema, ModeUsage modeUsage) {
// adds the schema to this section schemas
schemas.addElement(schema);
// creates the validator
Validator validator = createValidator(schema);
// adds the validator to this section validators
validators.addElement(validat... | [
"public",
"void",
"addValidator",
"(",
"Schema",
"schema",
",",
"ModeUsage",
"modeUsage",
")",
"{",
"// adds the schema to this section schemas",
"schemas",
".",
"addElement",
"(",
"schema",
")",
";",
"// creates the validator",
"Validator",
"validator",
"=",
"createVal... | Adds a validator.
@param schema The schema to validate against.
@param modeUsage The mode usage for this validate action. | [
"Adds",
"a",
"validator",
"."
] | train | https://github.com/dashorst/wicket-stuff-markup-validator/blob/9e529a4dc8bfdbbe4c794f3132ef400a006560a1/jing/src/main/java/com/thaiopensource/validate/nvdl/ValidatorImpl.java#L246-L264 |
wanglinsong/thx-webservice | src/main/java/com/tascape/qa/th/ws/comm/WebServiceCommunication.java | WebServiceCommunication.headUri | public static String headUri(String uri, String name) throws IOException {
"""
Gets the response header value of specified uri.
@param uri http/https uri
@param name header name
@return response header value
@throws IOException in case of any IO related issue
"""
return Stream.of(headUri(uri... | java | public static String headUri(String uri, String name) throws IOException {
return Stream.of(headUri(uri)).filter(h -> h.getName().equals(name)).findFirst().get().getValue();
} | [
"public",
"static",
"String",
"headUri",
"(",
"String",
"uri",
",",
"String",
"name",
")",
"throws",
"IOException",
"{",
"return",
"Stream",
".",
"of",
"(",
"headUri",
"(",
"uri",
")",
")",
".",
"filter",
"(",
"h",
"->",
"h",
".",
"getName",
"(",
")"... | Gets the response header value of specified uri.
@param uri http/https uri
@param name header name
@return response header value
@throws IOException in case of any IO related issue | [
"Gets",
"the",
"response",
"header",
"value",
"of",
"specified",
"uri",
"."
] | train | https://github.com/wanglinsong/thx-webservice/blob/29bc084b09ad35b012eb7c6b5c9ee55337ddee28/src/main/java/com/tascape/qa/th/ws/comm/WebServiceCommunication.java#L230-L232 |
apereo/cas | support/cas-server-support-ldap-core/src/main/java/org/apereo/cas/util/LdapUtils.java | LdapUtils.newLdaptiveSearchExecutor | public static SearchExecutor newLdaptiveSearchExecutor(final String baseDn, final String filterQuery) {
"""
New search executor search executor.
@param baseDn the base dn
@param filterQuery the filter query
@return the search executor
"""
return newLdaptiveSearchExecutor(baseDn, filterQuery, ... | java | public static SearchExecutor newLdaptiveSearchExecutor(final String baseDn, final String filterQuery) {
return newLdaptiveSearchExecutor(baseDn, filterQuery, new ArrayList<>(0));
} | [
"public",
"static",
"SearchExecutor",
"newLdaptiveSearchExecutor",
"(",
"final",
"String",
"baseDn",
",",
"final",
"String",
"filterQuery",
")",
"{",
"return",
"newLdaptiveSearchExecutor",
"(",
"baseDn",
",",
"filterQuery",
",",
"new",
"ArrayList",
"<>",
"(",
"0",
... | New search executor search executor.
@param baseDn the base dn
@param filterQuery the filter query
@return the search executor | [
"New",
"search",
"executor",
"search",
"executor",
"."
] | train | https://github.com/apereo/cas/blob/b4b306433a8782cef803a39bea5b1f96740e0e9b/support/cas-server-support-ldap-core/src/main/java/org/apereo/cas/util/LdapUtils.java#L622-L624 |
sarl/sarl | main/coreplugins/io.sarl.eclipse/src/io/sarl/eclipse/wizards/sarlapp/FixedFatJarExportPage.java | FixedFatJarExportPage.getPathLabel | protected static String getPathLabel(IPath path, boolean isOSPath) {
"""
Returns the label of a path.
@param path the path
@param isOSPath if <code>true</code>, the path represents an OS path, if <code>false</code> it is a workspace path.
@return the label of the path to be used in the UI.
"""
String la... | java | protected static String getPathLabel(IPath path, boolean isOSPath) {
String label;
if (isOSPath) {
label= path.toOSString();
} else {
label= path.makeRelative().toString();
}
return label;
} | [
"protected",
"static",
"String",
"getPathLabel",
"(",
"IPath",
"path",
",",
"boolean",
"isOSPath",
")",
"{",
"String",
"label",
";",
"if",
"(",
"isOSPath",
")",
"{",
"label",
"=",
"path",
".",
"toOSString",
"(",
")",
";",
"}",
"else",
"{",
"label",
"="... | Returns the label of a path.
@param path the path
@param isOSPath if <code>true</code>, the path represents an OS path, if <code>false</code> it is a workspace path.
@return the label of the path to be used in the UI. | [
"Returns",
"the",
"label",
"of",
"a",
"path",
"."
] | train | https://github.com/sarl/sarl/blob/ca00ff994598c730339972def4e19a60e0b8cace/main/coreplugins/io.sarl.eclipse/src/io/sarl/eclipse/wizards/sarlapp/FixedFatJarExportPage.java#L711-L719 |
apache/incubator-gobblin | gobblin-compaction/src/main/java/org/apache/gobblin/compaction/dataset/SimpleDatasetsFinder.java | SimpleDatasetsFinder.findDistinctDatasets | @Override
public Set<Dataset> findDistinctDatasets() throws IOException {
"""
Create a dataset using {@link #inputDir} and {@link #destDir}.
Set dataset input path to be {@link #destDir} if {@link #recompactDatasets} is true.
"""
Set<Dataset> datasets = Sets.newHashSet();
Path inputPath = new Path(t... | java | @Override
public Set<Dataset> findDistinctDatasets() throws IOException {
Set<Dataset> datasets = Sets.newHashSet();
Path inputPath = new Path(this.inputDir);
Path inputLatePath = new Path(inputPath, MRCompactor.COMPACTION_LATE_DIR_SUFFIX);
Path outputPath = new Path(this.destDir);
Path outputLate... | [
"@",
"Override",
"public",
"Set",
"<",
"Dataset",
">",
"findDistinctDatasets",
"(",
")",
"throws",
"IOException",
"{",
"Set",
"<",
"Dataset",
">",
"datasets",
"=",
"Sets",
".",
"newHashSet",
"(",
")",
";",
"Path",
"inputPath",
"=",
"new",
"Path",
"(",
"t... | Create a dataset using {@link #inputDir} and {@link #destDir}.
Set dataset input path to be {@link #destDir} if {@link #recompactDatasets} is true. | [
"Create",
"a",
"dataset",
"using",
"{"
] | train | https://github.com/apache/incubator-gobblin/blob/f029b4c0fea0fe4aa62f36dda2512344ff708bae/gobblin-compaction/src/main/java/org/apache/gobblin/compaction/dataset/SimpleDatasetsFinder.java#L45-L59 |
hellosign/hellosign-java-sdk | src/main/java/com/hellosign/sdk/HelloSignClient.java | HelloSignClient.updateTemplateFiles | public String updateTemplateFiles(String existingTemplateId, TemplateDraft newTemplate, String clientId)
throws HelloSignException {
"""
Replaces the backing documents for the given template with the given
files.
Note that certain rules apply to this endpoint:
https://app.hellosign.com/api/referen... | java | public String updateTemplateFiles(String existingTemplateId, TemplateDraft newTemplate, String clientId)
throws HelloSignException {
String url = BASE_URI + TEMPLATE_UPDATE_FILES_URI + "/" + existingTemplateId;
HttpClient client = httpClient.withAuth(auth).withPostFields(newTemplate.getPostF... | [
"public",
"String",
"updateTemplateFiles",
"(",
"String",
"existingTemplateId",
",",
"TemplateDraft",
"newTemplate",
",",
"String",
"clientId",
")",
"throws",
"HelloSignException",
"{",
"String",
"url",
"=",
"BASE_URI",
"+",
"TEMPLATE_UPDATE_FILES_URI",
"+",
"\"/\"",
... | Replaces the backing documents for the given template with the given
files.
Note that certain rules apply to this endpoint:
https://app.hellosign.com/api/reference#update_template_files
@param existingTemplateId String ID of the template from which the
overlay data (signatures, text fields, etc.) will be retrieved.
@... | [
"Replaces",
"the",
"backing",
"documents",
"for",
"the",
"given",
"template",
"with",
"the",
"given",
"files",
"."
] | train | https://github.com/hellosign/hellosign-java-sdk/blob/08fa7aeb3b0c68ddb6c7ea797d114d55d36d36b1/src/main/java/com/hellosign/sdk/HelloSignClient.java#L660-L669 |
facebookarchive/hadoop-20 | src/core/org/apache/hadoop/io/file/tfile/Utils.java | Utils.writeString | public static void writeString(DataOutput out, String s) throws IOException {
"""
Write a String as a VInt n, followed by n Bytes as in Text format.
@param out
@param s
@throws IOException
"""
if (s != null) {
Text text = new Text(s);
byte[] buffer = text.getBytes();
int len = text.g... | java | public static void writeString(DataOutput out, String s) throws IOException {
if (s != null) {
Text text = new Text(s);
byte[] buffer = text.getBytes();
int len = text.getLength();
writeVInt(out, len);
out.write(buffer, 0, len);
} else {
writeVInt(out, -1);
}
} | [
"public",
"static",
"void",
"writeString",
"(",
"DataOutput",
"out",
",",
"String",
"s",
")",
"throws",
"IOException",
"{",
"if",
"(",
"s",
"!=",
"null",
")",
"{",
"Text",
"text",
"=",
"new",
"Text",
"(",
"s",
")",
";",
"byte",
"[",
"]",
"buffer",
... | Write a String as a VInt n, followed by n Bytes as in Text format.
@param out
@param s
@throws IOException | [
"Write",
"a",
"String",
"as",
"a",
"VInt",
"n",
"followed",
"by",
"n",
"Bytes",
"as",
"in",
"Text",
"format",
"."
] | train | https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/core/org/apache/hadoop/io/file/tfile/Utils.java#L246-L256 |
Azure/azure-sdk-for-java | mediaservices/resource-manager/v2018_03_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_03_30_preview/implementation/LiveOutputsInner.java | LiveOutputsInner.beginCreateAsync | public Observable<LiveOutputInner> beginCreateAsync(String resourceGroupName, String accountName, String liveEventName, String liveOutputName, LiveOutputInner parameters) {
"""
Create Live Output.
Creates a Live Output.
@param resourceGroupName The name of the resource group within the Azure subscription.
@pa... | java | public Observable<LiveOutputInner> beginCreateAsync(String resourceGroupName, String accountName, String liveEventName, String liveOutputName, LiveOutputInner parameters) {
return beginCreateWithServiceResponseAsync(resourceGroupName, accountName, liveEventName, liveOutputName, parameters).map(new Func1<Service... | [
"public",
"Observable",
"<",
"LiveOutputInner",
">",
"beginCreateAsync",
"(",
"String",
"resourceGroupName",
",",
"String",
"accountName",
",",
"String",
"liveEventName",
",",
"String",
"liveOutputName",
",",
"LiveOutputInner",
"parameters",
")",
"{",
"return",
"begin... | Create Live Output.
Creates a Live Output.
@param resourceGroupName The name of the resource group within the Azure subscription.
@param accountName The Media Services account name.
@param liveEventName The name of the Live Event.
@param liveOutputName The name of the Live Output.
@param parameters Live Output propert... | [
"Create",
"Live",
"Output",
".",
"Creates",
"a",
"Live",
"Output",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/mediaservices/resource-manager/v2018_03_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_03_30_preview/implementation/LiveOutputsInner.java#L477-L484 |
windup/windup | java-ast/addon/src/main/java/org/jboss/windup/ast/java/ReferenceResolvingVisitor.java | ReferenceResolvingVisitor.addAnnotationValues | private void addAnnotationValues(ClassReference annotatedReference, AnnotationClassReference typeRef, Annotation node) {
"""
Adds parameters contained in the annotation into the annotation type reference
@param typeRef
@param node
"""
Map<String, AnnotationValue> annotationValueMap = new HashMap<>(... | java | private void addAnnotationValues(ClassReference annotatedReference, AnnotationClassReference typeRef, Annotation node)
{
Map<String, AnnotationValue> annotationValueMap = new HashMap<>();
if (node instanceof SingleMemberAnnotation)
{
SingleMemberAnnotation singleMemberAnnotation ... | [
"private",
"void",
"addAnnotationValues",
"(",
"ClassReference",
"annotatedReference",
",",
"AnnotationClassReference",
"typeRef",
",",
"Annotation",
"node",
")",
"{",
"Map",
"<",
"String",
",",
"AnnotationValue",
">",
"annotationValueMap",
"=",
"new",
"HashMap",
"<>"... | Adds parameters contained in the annotation into the annotation type reference
@param typeRef
@param node | [
"Adds",
"parameters",
"contained",
"in",
"the",
"annotation",
"into",
"the",
"annotation",
"type",
"reference"
] | train | https://github.com/windup/windup/blob/6668f09e7f012d24a0b4212ada8809417225b2ad/java-ast/addon/src/main/java/org/jboss/windup/ast/java/ReferenceResolvingVisitor.java#L668-L690 |
aws/aws-sdk-java | aws-java-sdk-ssm/src/main/java/com/amazonaws/services/simplesystemsmanagement/model/AutomationExecutionMetadata.java | AutomationExecutionMetadata.setTargetMaps | public void setTargetMaps(java.util.Collection<java.util.Map<String, java.util.List<String>>> targetMaps) {
"""
<p>
The specified key-value mapping of document parameters to target resources.
</p>
@param targetMaps
The specified key-value mapping of document parameters to target resources.
"""
if... | java | public void setTargetMaps(java.util.Collection<java.util.Map<String, java.util.List<String>>> targetMaps) {
if (targetMaps == null) {
this.targetMaps = null;
return;
}
this.targetMaps = new com.amazonaws.internal.SdkInternalList<java.util.Map<String, java.util.List<Strin... | [
"public",
"void",
"setTargetMaps",
"(",
"java",
".",
"util",
".",
"Collection",
"<",
"java",
".",
"util",
".",
"Map",
"<",
"String",
",",
"java",
".",
"util",
".",
"List",
"<",
"String",
">",
">",
">",
"targetMaps",
")",
"{",
"if",
"(",
"targetMaps",... | <p>
The specified key-value mapping of document parameters to target resources.
</p>
@param targetMaps
The specified key-value mapping of document parameters to target resources. | [
"<p",
">",
"The",
"specified",
"key",
"-",
"value",
"mapping",
"of",
"document",
"parameters",
"to",
"target",
"resources",
".",
"<",
"/",
"p",
">"
] | train | https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-ssm/src/main/java/com/amazonaws/services/simplesystemsmanagement/model/AutomationExecutionMetadata.java#L951-L958 |
aws/aws-sdk-java | aws-java-sdk-elasticsearch/src/main/java/com/amazonaws/services/elasticsearch/model/CreateElasticsearchDomainRequest.java | CreateElasticsearchDomainRequest.withAdvancedOptions | public CreateElasticsearchDomainRequest withAdvancedOptions(java.util.Map<String, String> advancedOptions) {
"""
<p>
Option to allow references to indices in an HTTP request body. Must be <code>false</code> when configuring access
to individual sub-resources. By default, the value is <code>true</code>. See <a hr... | java | public CreateElasticsearchDomainRequest withAdvancedOptions(java.util.Map<String, String> advancedOptions) {
setAdvancedOptions(advancedOptions);
return this;
} | [
"public",
"CreateElasticsearchDomainRequest",
"withAdvancedOptions",
"(",
"java",
".",
"util",
".",
"Map",
"<",
"String",
",",
"String",
">",
"advancedOptions",
")",
"{",
"setAdvancedOptions",
"(",
"advancedOptions",
")",
";",
"return",
"this",
";",
"}"
] | <p>
Option to allow references to indices in an HTTP request body. Must be <code>false</code> when configuring access
to individual sub-resources. By default, the value is <code>true</code>. See <a href=
"http://docs.aws.amazon.com/elasticsearch-service/latest/developerguide/es-createupdatedomains.html#es-createdomain-... | [
"<p",
">",
"Option",
"to",
"allow",
"references",
"to",
"indices",
"in",
"an",
"HTTP",
"request",
"body",
".",
"Must",
"be",
"<code",
">",
"false<",
"/",
"code",
">",
"when",
"configuring",
"access",
"to",
"individual",
"sub",
"-",
"resources",
".",
"By"... | train | https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-elasticsearch/src/main/java/com/amazonaws/services/elasticsearch/model/CreateElasticsearchDomainRequest.java#L626-L629 |
elki-project/elki | addons/batikvis/src/main/java/de/lmu/ifi/dbs/elki/visualization/svg/SVGArrow.java | SVGArrow.makeArrow | public static Element makeArrow(SVGPlot svgp, Direction dir, double x, double y, double size) {
"""
Draw an arrow at the given position.
Note: the arrow is an unstyled svg path. You need to apply style
afterwards.
@param svgp Plot to draw to
@param dir Direction to draw
@param x Center x coordinate
@para... | java | public static Element makeArrow(SVGPlot svgp, Direction dir, double x, double y, double size) {
final double hs = size / 2.;
switch(dir){
case LEFT:
return new SVGPath().drawTo(x + hs, y + hs).drawTo(x - hs, y).drawTo(x + hs, y - hs).drawTo(x + hs, y + hs).close().makeElement(svgp);
case DOWN:
... | [
"public",
"static",
"Element",
"makeArrow",
"(",
"SVGPlot",
"svgp",
",",
"Direction",
"dir",
",",
"double",
"x",
",",
"double",
"y",
",",
"double",
"size",
")",
"{",
"final",
"double",
"hs",
"=",
"size",
"/",
"2.",
";",
"switch",
"(",
"dir",
")",
"{"... | Draw an arrow at the given position.
Note: the arrow is an unstyled svg path. You need to apply style
afterwards.
@param svgp Plot to draw to
@param dir Direction to draw
@param x Center x coordinate
@param y Center y coordinate
@param size Arrow size
@return SVG Element | [
"Draw",
"an",
"arrow",
"at",
"the",
"given",
"position",
"."
] | train | https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/addons/batikvis/src/main/java/de/lmu/ifi/dbs/elki/visualization/svg/SVGArrow.java#L66-L81 |
google/error-prone-javac | src/jdk.javadoc/share/classes/com/sun/tools/doclets/internal/toolkit/builders/FieldBuilder.java | FieldBuilder.buildSignature | public void buildSignature(XMLNode node, Content fieldDocTree) {
"""
Build the signature.
@param node the XML element that specifies which components to document
@param fieldDocTree the content tree to which the documentation will be added
"""
fieldDocTree.addContent(
writer.getSign... | java | public void buildSignature(XMLNode node, Content fieldDocTree) {
fieldDocTree.addContent(
writer.getSignature((FieldDoc) fields.get(currentFieldIndex)));
} | [
"public",
"void",
"buildSignature",
"(",
"XMLNode",
"node",
",",
"Content",
"fieldDocTree",
")",
"{",
"fieldDocTree",
".",
"addContent",
"(",
"writer",
".",
"getSignature",
"(",
"(",
"FieldDoc",
")",
"fields",
".",
"get",
"(",
"currentFieldIndex",
")",
")",
... | Build the signature.
@param node the XML element that specifies which components to document
@param fieldDocTree the content tree to which the documentation will be added | [
"Build",
"the",
"signature",
"."
] | train | https://github.com/google/error-prone-javac/blob/a53d069bbdb2c60232ed3811c19b65e41c3e60e0/src/jdk.javadoc/share/classes/com/sun/tools/doclets/internal/toolkit/builders/FieldBuilder.java#L181-L184 |
fuinorg/utils4j | src/main/java/org/fuin/utils4j/Utils4J.java | Utils4J.getCanonicalPath | public static String getCanonicalPath(final File file) {
"""
Returns the canonical path for the file without throwing a checked exception. A potential {@link IOException} is converted into a
{@link RuntimeException}
@param file
File to return the canonical path for or <code>null</code>.
@return Canonical p... | java | public static String getCanonicalPath(final File file) {
if (file == null) {
return null;
}
try {
return file.getCanonicalPath();
} catch (final IOException ex) {
throw new RuntimeException("Couldn't get canonical path for: " + file, ex);
... | [
"public",
"static",
"String",
"getCanonicalPath",
"(",
"final",
"File",
"file",
")",
"{",
"if",
"(",
"file",
"==",
"null",
")",
"{",
"return",
"null",
";",
"}",
"try",
"{",
"return",
"file",
".",
"getCanonicalPath",
"(",
")",
";",
"}",
"catch",
"(",
... | Returns the canonical path for the file without throwing a checked exception. A potential {@link IOException} is converted into a
{@link RuntimeException}
@param file
File to return the canonical path for or <code>null</code>.
@return Canonical path for the given argument or <code>null</code> if the input was <code>n... | [
"Returns",
"the",
"canonical",
"path",
"for",
"the",
"file",
"without",
"throwing",
"a",
"checked",
"exception",
".",
"A",
"potential",
"{",
"@link",
"IOException",
"}",
"is",
"converted",
"into",
"a",
"{",
"@link",
"RuntimeException",
"}"
] | train | https://github.com/fuinorg/utils4j/blob/71cf88e0a8d8ed67bbac513bf3cab165cd7e3280/src/main/java/org/fuin/utils4j/Utils4J.java#L551-L560 |
opsbears/owc-dic | src/main/java/com/opsbears/webcomponents/dic/InjectorConfiguration.java | InjectorConfiguration.withFactory | public <T> InjectorConfiguration withFactory(
Class<T> classDefinition,
Provider<T> factory
) {
"""
Specify that the given class should be created using the factory instance specified.
@param classDefinition the class that should be produced using a factory.
@param factory the factory class... | java | public <T> InjectorConfiguration withFactory(
Class<T> classDefinition,
Provider<T> factory
) {
if (classDefinition.equals(Injector.class)) {
throw new DependencyInjectionFailedException("Cowardly refusing to define a global factory for Injector since that would lead to a Service... | [
"public",
"<",
"T",
">",
"InjectorConfiguration",
"withFactory",
"(",
"Class",
"<",
"T",
">",
"classDefinition",
",",
"Provider",
"<",
"T",
">",
"factory",
")",
"{",
"if",
"(",
"classDefinition",
".",
"equals",
"(",
"Injector",
".",
"class",
")",
")",
"{... | Specify that the given class should be created using the factory instance specified.
@param classDefinition the class that should be produced using a factory.
@param factory the factory class that creates the class definition
@param <T> type of the class
@return a modified copy of this injection configuration. | [
"Specify",
"that",
"the",
"given",
"class",
"should",
"be",
"created",
"using",
"the",
"factory",
"instance",
"specified",
"."
] | train | https://github.com/opsbears/owc-dic/blob/eb254ca993b26c299292a01598b358a31f323566/src/main/java/com/opsbears/webcomponents/dic/InjectorConfiguration.java#L270-L288 |
guardtime/ksi-java-sdk | ksi-api/src/main/java/com/guardtime/ksi/unisignature/verifier/policies/ContextAwarePolicyAdapter.java | ContextAwarePolicyAdapter.createPublicationsFilePolicy | public static ContextAwarePolicy createPublicationsFilePolicy(PublicationsHandler handler, Extender extender) {
"""
Creates context aware policy using {@link PublicationsFileBasedVerificationPolicy} for verification. If
extender is provided, then extending is allowed while verifying signature.
@param handler
... | java | public static ContextAwarePolicy createPublicationsFilePolicy(PublicationsHandler handler, Extender extender) {
Util.notNull(handler, "Publications handler");
PolicyContext context = new PolicyContext(handler, extender != null ? extender.getExtendingService() : null);
return new ContextAwarePoli... | [
"public",
"static",
"ContextAwarePolicy",
"createPublicationsFilePolicy",
"(",
"PublicationsHandler",
"handler",
",",
"Extender",
"extender",
")",
"{",
"Util",
".",
"notNull",
"(",
"handler",
",",
"\"Publications handler\"",
")",
";",
"PolicyContext",
"context",
"=",
... | Creates context aware policy using {@link PublicationsFileBasedVerificationPolicy} for verification. If
extender is provided, then extending is allowed while verifying signature.
@param handler
Publications handler.
@param extender
Extender.
@return Publications file based verification policy with suitable context. | [
"Creates",
"context",
"aware",
"policy",
"using",
"{",
"@link",
"PublicationsFileBasedVerificationPolicy",
"}",
"for",
"verification",
".",
"If",
"extender",
"is",
"provided",
"then",
"extending",
"is",
"allowed",
"while",
"verifying",
"signature",
"."
] | train | https://github.com/guardtime/ksi-java-sdk/blob/b2cd877050f0f392657c724452318d10a1002171/ksi-api/src/main/java/com/guardtime/ksi/unisignature/verifier/policies/ContextAwarePolicyAdapter.java#L86-L90 |
kiegroup/drools | drools-model/drools-model-compiler/src/main/java/org/drools/modelcompiler/builder/generator/ModelGenerator.java | ModelGenerator.ruleAttributes | private static List<MethodCallExpr> ruleAttributes(RuleContext context, RuleDescr ruleDescr) {
"""
Build a list of method calls, representing each needed {@link org.drools.model.impl.RuleBuilder#attribute(org.drools.model.Rule.Attribute, Object)}
starting from a drools-compiler {@link RuleDescr}.
The tuple repre... | java | private static List<MethodCallExpr> ruleAttributes(RuleContext context, RuleDescr ruleDescr) {
final List<MethodCallExpr> ruleAttributes = new ArrayList<>();
final Set<Entry<String, AttributeDescr>> excludingDialect =
ruleDescr.getAttributes().entrySet()
.stream()... | [
"private",
"static",
"List",
"<",
"MethodCallExpr",
">",
"ruleAttributes",
"(",
"RuleContext",
"context",
",",
"RuleDescr",
"ruleDescr",
")",
"{",
"final",
"List",
"<",
"MethodCallExpr",
">",
"ruleAttributes",
"=",
"new",
"ArrayList",
"<>",
"(",
")",
";",
"fin... | Build a list of method calls, representing each needed {@link org.drools.model.impl.RuleBuilder#attribute(org.drools.model.Rule.Attribute, Object)}
starting from a drools-compiler {@link RuleDescr}.
The tuple represent the Rule Attribute expressed in JavParser form, and the attribute value expressed in JavaParser form. | [
"Build",
"a",
"list",
"of",
"method",
"calls",
"representing",
"each",
"needed",
"{"
] | train | https://github.com/kiegroup/drools/blob/22b0275d6dbe93070b8090948502cf46eda543c4/drools-model/drools-model-compiler/src/main/java/org/drools/modelcompiler/builder/generator/ModelGenerator.java#L234-L289 |
lessthanoptimal/BoofCV | main/boofcv-recognition/src/main/java/boofcv/alg/fiducial/calib/squares/SquareGridTools.java | SquareGridTools.boundingPolygonCCW | public void boundingPolygonCCW(SquareGrid grid, Polygon2D_F64 bounding) {
"""
Get outside corner polygon around the grid. The grid is assumed to be in CCW orientation.
"""
int w = grid.columns;
int h = grid.rows;
if( w == 1 && h == 1 ) {
SquareNode n = grid.get(0,0);
bounding.get(0).set(n.square.... | java | public void boundingPolygonCCW(SquareGrid grid, Polygon2D_F64 bounding) {
int w = grid.columns;
int h = grid.rows;
if( w == 1 && h == 1 ) {
SquareNode n = grid.get(0,0);
bounding.get(0).set(n.square.get(0));
bounding.get(1).set(n.square.get(1));
bounding.get(2).set(n.square.get(2));
bounding.get(3... | [
"public",
"void",
"boundingPolygonCCW",
"(",
"SquareGrid",
"grid",
",",
"Polygon2D_F64",
"bounding",
")",
"{",
"int",
"w",
"=",
"grid",
".",
"columns",
";",
"int",
"h",
"=",
"grid",
".",
"rows",
";",
"if",
"(",
"w",
"==",
"1",
"&&",
"h",
"==",
"1",
... | Get outside corner polygon around the grid. The grid is assumed to be in CCW orientation. | [
"Get",
"outside",
"corner",
"polygon",
"around",
"the",
"grid",
".",
"The",
"grid",
"is",
"assumed",
"to",
"be",
"in",
"CCW",
"orientation",
"."
] | train | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-recognition/src/main/java/boofcv/alg/fiducial/calib/squares/SquareGridTools.java#L183-L217 |
Baidu-AIP/java-sdk | src/main/java/com/baidu/aip/nlp/AipNlp.java | AipNlp.commentTag | public JSONObject commentTag(String text, ESimnetType type, HashMap<String, Object> options) {
"""
评论观点抽取接口
评论观点抽取接口用来提取一条评论句子的关注点和评论观点,并输出评论观点标签及评论观点极性。
@param text - 评论内容(GBK编码),最大10240字节
@param type - ESimnetType枚举类型,选择识别的垂类
@param options - 可选参数对象,key: value都为string类型
options - options列表:
type 评论行业类型,默... | java | public JSONObject commentTag(String text, ESimnetType type, HashMap<String, Object> options) {
AipRequest request = new AipRequest();
preOperation(request);
request.addBody("text", text);
request.addBody("type", type.ordinal());
if (options != null) {
request... | [
"public",
"JSONObject",
"commentTag",
"(",
"String",
"text",
",",
"ESimnetType",
"type",
",",
"HashMap",
"<",
"String",
",",
"Object",
">",
"options",
")",
"{",
"AipRequest",
"request",
"=",
"new",
"AipRequest",
"(",
")",
";",
"preOperation",
"(",
"request",... | 评论观点抽取接口
评论观点抽取接口用来提取一条评论句子的关注点和评论观点,并输出评论观点标签及评论观点极性。
@param text - 评论内容(GBK编码),最大10240字节
@param type - ESimnetType枚举类型,选择识别的垂类
@param options - 可选参数对象,key: value都为string类型
options - options列表:
type 评论行业类型,默认为4(餐饮美食)
@return JSONObject | [
"评论观点抽取接口",
"评论观点抽取接口用来提取一条评论句子的关注点和评论观点,并输出评论观点标签及评论观点极性。"
] | train | https://github.com/Baidu-AIP/java-sdk/blob/16bb8b7bb8f9bbcb7c8af62d0a67a1e79eecad90/src/main/java/com/baidu/aip/nlp/AipNlp.java#L234-L249 |
Harium/keel | src/main/java/com/harium/keel/catalano/math/distance/Distance.java | Distance.Chebyshev | public static double Chebyshev(IntPoint p, IntPoint q) {
"""
Gets the Chebyshev distance between two points.
@param p IntPoint with X and Y axis coordinates.
@param q IntPoint with X and Y axis coordinates.
@return The Chebyshev distance between x and y.
"""
return Chebyshev(p.x, p.y, q.x, q.y);
... | java | public static double Chebyshev(IntPoint p, IntPoint q) {
return Chebyshev(p.x, p.y, q.x, q.y);
} | [
"public",
"static",
"double",
"Chebyshev",
"(",
"IntPoint",
"p",
",",
"IntPoint",
"q",
")",
"{",
"return",
"Chebyshev",
"(",
"p",
".",
"x",
",",
"p",
".",
"y",
",",
"q",
".",
"x",
",",
"q",
".",
"y",
")",
";",
"}"
] | Gets the Chebyshev distance between two points.
@param p IntPoint with X and Y axis coordinates.
@param q IntPoint with X and Y axis coordinates.
@return The Chebyshev distance between x and y. | [
"Gets",
"the",
"Chebyshev",
"distance",
"between",
"two",
"points",
"."
] | train | https://github.com/Harium/keel/blob/0369ae674f9e664bccc5f9e161ae7e7a3b949a1e/src/main/java/com/harium/keel/catalano/math/distance/Distance.java#L210-L212 |
apache/incubator-shardingsphere | sharding-core/sharding-core-parse/sharding-core-parse-common/src/main/java/org/apache/shardingsphere/core/parse/old/parser/clause/TableReferencesClauseParser.java | TableReferencesClauseParser.parseSingleTableWithoutAlias | public final void parseSingleTableWithoutAlias(final SQLStatement sqlStatement) {
"""
Parse single table without alias.
@param sqlStatement SQL statement
"""
int beginPosition = lexerEngine.getCurrentToken().getEndPosition() - lexerEngine.getCurrentToken().getLiterals().length();
String lite... | java | public final void parseSingleTableWithoutAlias(final SQLStatement sqlStatement) {
int beginPosition = lexerEngine.getCurrentToken().getEndPosition() - lexerEngine.getCurrentToken().getLiterals().length();
String literals = lexerEngine.getCurrentToken().getLiterals();
int skippedSchemaNameLength ... | [
"public",
"final",
"void",
"parseSingleTableWithoutAlias",
"(",
"final",
"SQLStatement",
"sqlStatement",
")",
"{",
"int",
"beginPosition",
"=",
"lexerEngine",
".",
"getCurrentToken",
"(",
")",
".",
"getEndPosition",
"(",
")",
"-",
"lexerEngine",
".",
"getCurrentToke... | Parse single table without alias.
@param sqlStatement SQL statement | [
"Parse",
"single",
"table",
"without",
"alias",
"."
] | train | https://github.com/apache/incubator-shardingsphere/blob/f88fd29fc345dfb31fdce12e9e96cbfa0fd2402d/sharding-core/sharding-core-parse/sharding-core-parse-common/src/main/java/org/apache/shardingsphere/core/parse/old/parser/clause/TableReferencesClauseParser.java#L192-L204 |
libgdx/gdx-ai | gdx-ai/src/com/badlogic/gdx/ai/pfa/PathSmoother.java | PathSmoother.smoothPath | public int smoothPath (SmoothableGraphPath<N, V> path) {
"""
Smoothes the given path in place.
@param path the path to smooth
@return the number of nodes removed from the path.
"""
int inputPathLength = path.getCount();
// If the path is two nodes long or less, then we can't smooth it
if (inputPathLen... | java | public int smoothPath (SmoothableGraphPath<N, V> path) {
int inputPathLength = path.getCount();
// If the path is two nodes long or less, then we can't smooth it
if (inputPathLength <= 2) return 0;
// Make sure the ray is instantiated
if (this.ray == null) {
V vec = path.getNodePosition(0);
this.ray =... | [
"public",
"int",
"smoothPath",
"(",
"SmoothableGraphPath",
"<",
"N",
",",
"V",
">",
"path",
")",
"{",
"int",
"inputPathLength",
"=",
"path",
".",
"getCount",
"(",
")",
";",
"// If the path is two nodes long or less, then we can't smooth it",
"if",
"(",
"inputPathLen... | Smoothes the given path in place.
@param path the path to smooth
@return the number of nodes removed from the path. | [
"Smoothes",
"the",
"given",
"path",
"in",
"place",
"."
] | train | https://github.com/libgdx/gdx-ai/blob/2d1523a97193a45e18e11a4837c6800d08f177c5/gdx-ai/src/com/badlogic/gdx/ai/pfa/PathSmoother.java#L59-L105 |
google/j2objc | jre_emul/Classes/com/google/j2objc/util/ReflectionUtil.java | ReflectionUtil.matchClassNamePrefix | public static boolean matchClassNamePrefix(String actual, String expected) {
"""
When reflection is stripped, the transpiled code uses NSStringFromClass to return the name of a
class. For example, instead of getting something like java.lang.Throwable, we get
JavaLangThrowable.
<p>This method assumes that {@co... | java | public static boolean matchClassNamePrefix(String actual, String expected) {
return actual.equals(expected) || actual.equals(getCamelCase(expected));
} | [
"public",
"static",
"boolean",
"matchClassNamePrefix",
"(",
"String",
"actual",
",",
"String",
"expected",
")",
"{",
"return",
"actual",
".",
"equals",
"(",
"expected",
")",
"||",
"actual",
".",
"equals",
"(",
"getCamelCase",
"(",
"expected",
")",
")",
";",
... | When reflection is stripped, the transpiled code uses NSStringFromClass to return the name of a
class. For example, instead of getting something like java.lang.Throwable, we get
JavaLangThrowable.
<p>This method assumes that {@code actual} and {@code expected} contain a class name as prefix.
Firts, it compares directl... | [
"When",
"reflection",
"is",
"stripped",
"the",
"transpiled",
"code",
"uses",
"NSStringFromClass",
"to",
"return",
"the",
"name",
"of",
"a",
"class",
".",
"For",
"example",
"instead",
"of",
"getting",
"something",
"like",
"java",
".",
"lang",
".",
"Throwable",
... | train | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/Classes/com/google/j2objc/util/ReflectionUtil.java#L36-L38 |
michael-rapp/AndroidUtil | library/src/main/java/de/mrapp/android/util/ElevationUtil.java | ElevationUtil.getShadowWidth | private static float getShadowWidth(@NonNull final Context context, final int elevation,
@NonNull final Orientation orientation,
final boolean parallelLight) {
"""
Returns the width of a shadow, which is located besides an edge of an e... | java | private static float getShadowWidth(@NonNull final Context context, final int elevation,
@NonNull final Orientation orientation,
final boolean parallelLight) {
float referenceElevationWidth =
(float) elevation / (flo... | [
"private",
"static",
"float",
"getShadowWidth",
"(",
"@",
"NonNull",
"final",
"Context",
"context",
",",
"final",
"int",
"elevation",
",",
"@",
"NonNull",
"final",
"Orientation",
"orientation",
",",
"final",
"boolean",
"parallelLight",
")",
"{",
"float",
"refere... | Returns the width of a shadow, which is located besides an edge of an elevated view.
@param context
The context, which should be used, as an instance of the class {@link Context}. The
context may not be null
@param elevation
The elevation, which should be emulated, in dp as an {@link Integer} value. The
elevation must... | [
"Returns",
"the",
"width",
"of",
"a",
"shadow",
"which",
"is",
"located",
"besides",
"an",
"edge",
"of",
"an",
"elevated",
"view",
"."
] | train | https://github.com/michael-rapp/AndroidUtil/blob/67ec0e5732344eeb4d946dd1f96d782939e449f4/library/src/main/java/de/mrapp/android/util/ElevationUtil.java#L489-L518 |
xhsun/gw2wrapper | src/main/java/me/xhsun/guildwars2wrapper/AsynchronousRequest.java | AsynchronousRequest.getContinentSectorInfo | public void getContinentSectorInfo(int continentID, int floorID, int regionID, int mapID, int[] ids, Callback<List<ContinentMap.Sector>> callback) throws GuildWars2Exception, NullPointerException {
"""
For more info on continents API go <a href="https://wiki.guildwars2.com/wiki/API:2/continents">here</a><br/>
Giv... | java | public void getContinentSectorInfo(int continentID, int floorID, int regionID, int mapID, int[] ids, Callback<List<ContinentMap.Sector>> callback) throws GuildWars2Exception, NullPointerException {
isParamValid(new ParamChecker(ids));
gw2API.getContinentSectorInfo(Integer.toString(continentID), Integer.toString(flo... | [
"public",
"void",
"getContinentSectorInfo",
"(",
"int",
"continentID",
",",
"int",
"floorID",
",",
"int",
"regionID",
",",
"int",
"mapID",
",",
"int",
"[",
"]",
"ids",
",",
"Callback",
"<",
"List",
"<",
"ContinentMap",
".",
"Sector",
">",
">",
"callback",
... | For more info on continents API go <a href="https://wiki.guildwars2.com/wiki/API:2/continents">here</a><br/>
Give user the access to {@link Callback#onResponse(Call, Response)} and {@link Callback#onFailure(Call, Throwable)} methods for custom interactions
@param continentID {@link Continent#id}
@param floorID {@l... | [
"For",
"more",
"info",
"on",
"continents",
"API",
"go",
"<a",
"href",
"=",
"https",
":",
"//",
"wiki",
".",
"guildwars2",
".",
"com",
"/",
"wiki",
"/",
"API",
":",
"2",
"/",
"continents",
">",
"here<",
"/",
"a",
">",
"<br",
"/",
">",
"Give",
"use... | train | https://github.com/xhsun/gw2wrapper/blob/c8a43b51f363b032074fb152ee6efe657e33e525/src/main/java/me/xhsun/guildwars2wrapper/AsynchronousRequest.java#L1160-L1163 |
SimplicityApks/ReminderDatePicker | lib/src/main/java/com/simplicityapks/reminderdatepicker/lib/DateSpinner.java | DateSpinner.setMinDate | public void setMinDate(@Nullable Calendar minDate) {
"""
Sets the minimum allowed date.
Spinner items and dates in the date picker before the given date will get disabled.
@param minDate The minimum date, or null to clear the previous min date.
"""
this.minDate = minDate;
// update the date p... | java | public void setMinDate(@Nullable Calendar minDate) {
this.minDate = minDate;
// update the date picker (even if it is not used right now)
if(minDate == null)
datePickerDialog.setMinDate(MINIMUM_POSSIBLE_DATE);
else if(maxDate != null && compareCalendarDates(minDate, maxDate) ... | [
"public",
"void",
"setMinDate",
"(",
"@",
"Nullable",
"Calendar",
"minDate",
")",
"{",
"this",
".",
"minDate",
"=",
"minDate",
";",
"// update the date picker (even if it is not used right now)",
"if",
"(",
"minDate",
"==",
"null",
")",
"datePickerDialog",
".",
"set... | Sets the minimum allowed date.
Spinner items and dates in the date picker before the given date will get disabled.
@param minDate The minimum date, or null to clear the previous min date. | [
"Sets",
"the",
"minimum",
"allowed",
"date",
".",
"Spinner",
"items",
"and",
"dates",
"in",
"the",
"date",
"picker",
"before",
"the",
"given",
"date",
"will",
"get",
"disabled",
"."
] | train | https://github.com/SimplicityApks/ReminderDatePicker/blob/7596fbac77a5d26f687fec11758935a2b7db156f/lib/src/main/java/com/simplicityapks/reminderdatepicker/lib/DateSpinner.java#L359-L369 |
biojava/biojava | biojava-genome/src/main/java/org/biojava/nbio/genome/util/ChromosomeMappingTools.java | ChromosomeMappingTools.getChromosomePosForCDScoordinate | public static ChromPos getChromosomePosForCDScoordinate(int cdsNucleotidePosition, GeneChromosomePosition chromPos) {
"""
Maps the position of a CDS nucleotide back to the genome
@param cdsNucleotidePosition
@return a ChromPos object
"""
logger.debug(" ? Checking chromosome position for CDS position " +... | java | public static ChromPos getChromosomePosForCDScoordinate(int cdsNucleotidePosition, GeneChromosomePosition chromPos) {
logger.debug(" ? Checking chromosome position for CDS position " + cdsNucleotidePosition);
List<Integer> exonStarts = chromPos.getExonStarts();
List<Integer> exonEnds = chromPos.getExonEnds();
... | [
"public",
"static",
"ChromPos",
"getChromosomePosForCDScoordinate",
"(",
"int",
"cdsNucleotidePosition",
",",
"GeneChromosomePosition",
"chromPos",
")",
"{",
"logger",
".",
"debug",
"(",
"\" ? Checking chromosome position for CDS position \"",
"+",
"cdsNucleotidePosition",
")",... | Maps the position of a CDS nucleotide back to the genome
@param cdsNucleotidePosition
@return a ChromPos object | [
"Maps",
"the",
"position",
"of",
"a",
"CDS",
"nucleotide",
"back",
"to",
"the",
"genome"
] | train | https://github.com/biojava/biojava/blob/a1c71a8e3d40cc32104b1d387a3d3b560b43356e/biojava-genome/src/main/java/org/biojava/nbio/genome/util/ChromosomeMappingTools.java#L232-L256 |
spotify/scio | scio-examples/src/main/java/org/apache/beam/examples/subprocess/kernel/SubProcessIOFiles.java | SubProcessIOFiles.copyOutPutFilesToBucket | public void copyOutPutFilesToBucket(SubProcessConfiguration configuration, String params) {
"""
Will copy the output files to the GCS path setup via the configuration.
@param configuration
@param params
"""
if (Files.exists(outFile) || Files.exists(errFile)) {
try {
outFileLocation = FileUt... | java | public void copyOutPutFilesToBucket(SubProcessConfiguration configuration, String params) {
if (Files.exists(outFile) || Files.exists(errFile)) {
try {
outFileLocation = FileUtils.copyFileFromWorkerToGCS(configuration, outFile);
} catch (Exception ex) {
LOG.error("Error uploading log fil... | [
"public",
"void",
"copyOutPutFilesToBucket",
"(",
"SubProcessConfiguration",
"configuration",
",",
"String",
"params",
")",
"{",
"if",
"(",
"Files",
".",
"exists",
"(",
"outFile",
")",
"||",
"Files",
".",
"exists",
"(",
"errFile",
")",
")",
"{",
"try",
"{",
... | Will copy the output files to the GCS path setup via the configuration.
@param configuration
@param params | [
"Will",
"copy",
"the",
"output",
"files",
"to",
"the",
"GCS",
"path",
"setup",
"via",
"the",
"configuration",
"."
] | train | https://github.com/spotify/scio/blob/ed9a44428251b0c6834aad231b463d8eda418471/scio-examples/src/main/java/org/apache/beam/examples/subprocess/kernel/SubProcessIOFiles.java#L111-L130 |
hazelcast/hazelcast | hazelcast/src/main/java/com/hazelcast/cp/internal/raft/impl/state/RaftState.java | RaftState.toCandidate | public VoteRequest toCandidate() {
"""
Switches this node to candidate role. Clears pre-candidate and leader states.
Initializes candidate state for current majority and grants vote for local endpoint as a candidate.
@return vote request to sent to other members during leader election
"""
role = Ra... | java | public VoteRequest toCandidate() {
role = RaftRole.CANDIDATE;
preCandidateState = null;
leaderState = null;
candidateState = new CandidateState(majority());
candidateState.grantVote(localEndpoint);
persistVote(incrementTerm(), localEndpoint);
return new VoteReque... | [
"public",
"VoteRequest",
"toCandidate",
"(",
")",
"{",
"role",
"=",
"RaftRole",
".",
"CANDIDATE",
";",
"preCandidateState",
"=",
"null",
";",
"leaderState",
"=",
"null",
";",
"candidateState",
"=",
"new",
"CandidateState",
"(",
"majority",
"(",
")",
")",
";"... | Switches this node to candidate role. Clears pre-candidate and leader states.
Initializes candidate state for current majority and grants vote for local endpoint as a candidate.
@return vote request to sent to other members during leader election | [
"Switches",
"this",
"node",
"to",
"candidate",
"role",
".",
"Clears",
"pre",
"-",
"candidate",
"and",
"leader",
"states",
".",
"Initializes",
"candidate",
"state",
"for",
"current",
"majority",
"and",
"grants",
"vote",
"for",
"local",
"endpoint",
"as",
"a",
... | train | https://github.com/hazelcast/hazelcast/blob/8c4bc10515dbbfb41a33e0302c0caedf3cda1baf/hazelcast/src/main/java/com/hazelcast/cp/internal/raft/impl/state/RaftState.java#L328-L337 |
benmccann/xero-java-client | xjc-plugin/src/main/java/com/connectifier/xeroclient/jaxb/PluginImpl.java | PluginImpl.updateArrayOfGetters | private void updateArrayOfGetters(ClassOutline co, JCodeModel model) {
"""
Update getters to use Java List. For example:
ArrayOfInvoices getInvoices() -> List<Invoice> getInvoices()
"""
JDefinedClass implClass = co.implClass;
List<JMethod> removedMethods = new ArrayList<>();
Iterator<JMethod> ite... | java | private void updateArrayOfGetters(ClassOutline co, JCodeModel model) {
JDefinedClass implClass = co.implClass;
List<JMethod> removedMethods = new ArrayList<>();
Iterator<JMethod> iter = implClass.methods().iterator();
while (iter.hasNext()) {
JMethod method = iter.next();
if (method.type().... | [
"private",
"void",
"updateArrayOfGetters",
"(",
"ClassOutline",
"co",
",",
"JCodeModel",
"model",
")",
"{",
"JDefinedClass",
"implClass",
"=",
"co",
".",
"implClass",
";",
"List",
"<",
"JMethod",
">",
"removedMethods",
"=",
"new",
"ArrayList",
"<>",
"(",
")",
... | Update getters to use Java List. For example:
ArrayOfInvoices getInvoices() -> List<Invoice> getInvoices() | [
"Update",
"getters",
"to",
"use",
"Java",
"List",
".",
"For",
"example",
":",
"ArrayOfInvoices",
"getInvoices",
"()",
"-",
">",
"List<Invoice",
">",
"getInvoices",
"()"
] | train | https://github.com/benmccann/xero-java-client/blob/1c84acf36929ea2a4a3ac5f2527a4e9252229f18/xjc-plugin/src/main/java/com/connectifier/xeroclient/jaxb/PluginImpl.java#L54-L86 |
UrielCh/ovh-java-sdk | ovh-java-sdk-cdndedicated/src/main/java/net/minidev/ovh/api/ApiOvhCdndedicated.java | ApiOvhCdndedicated.serviceName_domains_domain_cacheRules_POST | public OvhCacheRule serviceName_domains_domain_cacheRules_POST(String serviceName, String domain, OvhCacheRuleCacheTypeEnum cacheType, String fileMatch, OvhCacheRuleFileTypeEnum fileType, Long ttl) throws IOException {
"""
Add a cache rule to a domain
REST: POST /cdn/dedicated/{serviceName}/domains/{domain}/cac... | java | public OvhCacheRule serviceName_domains_domain_cacheRules_POST(String serviceName, String domain, OvhCacheRuleCacheTypeEnum cacheType, String fileMatch, OvhCacheRuleFileTypeEnum fileType, Long ttl) throws IOException {
String qPath = "/cdn/dedicated/{serviceName}/domains/{domain}/cacheRules";
StringBuilder sb = pat... | [
"public",
"OvhCacheRule",
"serviceName_domains_domain_cacheRules_POST",
"(",
"String",
"serviceName",
",",
"String",
"domain",
",",
"OvhCacheRuleCacheTypeEnum",
"cacheType",
",",
"String",
"fileMatch",
",",
"OvhCacheRuleFileTypeEnum",
"fileType",
",",
"Long",
"ttl",
")",
... | Add a cache rule to a domain
REST: POST /cdn/dedicated/{serviceName}/domains/{domain}/cacheRules
@param cacheType [required] Type of cache rule to add to the domain
@param ttl [required] ttl for cache rule to add to the domain
@param fileMatch [required] File match for cache rule to add to the domain
@param fileType [... | [
"Add",
"a",
"cache",
"rule",
"to",
"a",
"domain"
] | train | https://github.com/UrielCh/ovh-java-sdk/blob/6d531a40e56e09701943e334c25f90f640c55701/ovh-java-sdk-cdndedicated/src/main/java/net/minidev/ovh/api/ApiOvhCdndedicated.java#L223-L233 |
line/armeria | saml/src/main/java/com/linecorp/armeria/server/saml/SamlDecorator.java | SamlDecorator.createAuthRequest | private AuthnRequest createAuthRequest(SamlIdentityProviderConfig idp, String defaultHostname) {
"""
Returns an {@link AuthnRequest} which is mapped to the specified identity provider.
"""
requireNonNull(idp, "idp");
final AuthnRequest authnRequest = build(AuthnRequest.DEFAULT_ELEMENT_NAME);
... | java | private AuthnRequest createAuthRequest(SamlIdentityProviderConfig idp, String defaultHostname) {
requireNonNull(idp, "idp");
final AuthnRequest authnRequest = build(AuthnRequest.DEFAULT_ELEMENT_NAME);
final Issuer issuer = build(Issuer.DEFAULT_ELEMENT_NAME);
issuer.setValue(myEntityId)... | [
"private",
"AuthnRequest",
"createAuthRequest",
"(",
"SamlIdentityProviderConfig",
"idp",
",",
"String",
"defaultHostname",
")",
"{",
"requireNonNull",
"(",
"idp",
",",
"\"idp\"",
")",
";",
"final",
"AuthnRequest",
"authnRequest",
"=",
"build",
"(",
"AuthnRequest",
... | Returns an {@link AuthnRequest} which is mapped to the specified identity provider. | [
"Returns",
"an",
"{"
] | train | https://github.com/line/armeria/blob/67d29e019fd35a35f89c45cc8f9119ff9b12b44d/saml/src/main/java/com/linecorp/armeria/server/saml/SamlDecorator.java#L184-L223 |
yanzhenjie/AndServer | api/src/main/java/com/yanzhenjie/andserver/util/DigestUtils.java | DigestUtils.getDigest | private static MessageDigest getDigest(String algorithm) {
"""
Create a new {@link MessageDigest} with the given algorithm. Necessary because {@code MessageDigest} is not
thread-safe.
"""
try {
return MessageDigest.getInstance(algorithm);
} catch (NoSuchAlgorithmException ex) {
... | java | private static MessageDigest getDigest(String algorithm) {
try {
return MessageDigest.getInstance(algorithm);
} catch (NoSuchAlgorithmException ex) {
throw new IllegalStateException("Could not find MessageDigest with algorithm \"" + algorithm + "\"", ex);
}
} | [
"private",
"static",
"MessageDigest",
"getDigest",
"(",
"String",
"algorithm",
")",
"{",
"try",
"{",
"return",
"MessageDigest",
".",
"getInstance",
"(",
"algorithm",
")",
";",
"}",
"catch",
"(",
"NoSuchAlgorithmException",
"ex",
")",
"{",
"throw",
"new",
"Ille... | Create a new {@link MessageDigest} with the given algorithm. Necessary because {@code MessageDigest} is not
thread-safe. | [
"Create",
"a",
"new",
"{"
] | train | https://github.com/yanzhenjie/AndServer/blob/f95f316cdfa5755d6a3fec3c6a1b5df783b81517/api/src/main/java/com/yanzhenjie/andserver/util/DigestUtils.java#L131-L137 |
joniles/mpxj | src/main/java/net/sf/mpxj/mpp/RTFEmbeddedObject.java | RTFEmbeddedObject.readObjectData | private static int readObjectData(int offset, String text, List<RTFEmbeddedObject> objects) {
"""
This method extracts byte arrays from the embedded object data
and converts them into RTFEmbeddedObject instances, which
it then adds to the supplied list.
@param offset offset into the RTF document
@param text ... | java | private static int readObjectData(int offset, String text, List<RTFEmbeddedObject> objects)
{
LinkedList<byte[]> blocks = new LinkedList<byte[]>();
offset += (OBJDATA.length());
offset = skipEndOfLine(text, offset);
int length;
int lastOffset = offset;
while (offset != -1)
... | [
"private",
"static",
"int",
"readObjectData",
"(",
"int",
"offset",
",",
"String",
"text",
",",
"List",
"<",
"RTFEmbeddedObject",
">",
"objects",
")",
"{",
"LinkedList",
"<",
"byte",
"[",
"]",
">",
"blocks",
"=",
"new",
"LinkedList",
"<",
"byte",
"[",
"]... | This method extracts byte arrays from the embedded object data
and converts them into RTFEmbeddedObject instances, which
it then adds to the supplied list.
@param offset offset into the RTF document
@param text RTF document
@param objects destination for RTFEmbeddedObject instances
@return new offset into the RTF docu... | [
"This",
"method",
"extracts",
"byte",
"arrays",
"from",
"the",
"embedded",
"object",
"data",
"and",
"converts",
"them",
"into",
"RTFEmbeddedObject",
"instances",
"which",
"it",
"then",
"adds",
"to",
"the",
"supplied",
"list",
"."
] | train | https://github.com/joniles/mpxj/blob/143ea0e195da59cd108f13b3b06328e9542337e8/src/main/java/net/sf/mpxj/mpp/RTFEmbeddedObject.java#L243-L275 |
line/armeria | core/src/main/java/com/linecorp/armeria/internal/annotation/AnnotatedElementNameUtil.java | AnnotatedElementNameUtil.findName | static String findName(Param param, Object nameRetrievalTarget) {
"""
Returns the value of the {@link Param} annotation which is specified on the {@code element} if
the value is not blank. If the value is blank, it returns the name of the specified
{@code nameRetrievalTarget} object which is an instance of {@lin... | java | static String findName(Param param, Object nameRetrievalTarget) {
requireNonNull(nameRetrievalTarget, "nameRetrievalTarget");
final String value = param.value();
if (DefaultValues.isSpecified(value)) {
checkArgument(!value.isEmpty(), "value is empty");
return value;
... | [
"static",
"String",
"findName",
"(",
"Param",
"param",
",",
"Object",
"nameRetrievalTarget",
")",
"{",
"requireNonNull",
"(",
"nameRetrievalTarget",
",",
"\"nameRetrievalTarget\"",
")",
";",
"final",
"String",
"value",
"=",
"param",
".",
"value",
"(",
")",
";",
... | Returns the value of the {@link Param} annotation which is specified on the {@code element} if
the value is not blank. If the value is blank, it returns the name of the specified
{@code nameRetrievalTarget} object which is an instance of {@link Parameter} or {@link Field}. | [
"Returns",
"the",
"value",
"of",
"the",
"{"
] | train | https://github.com/line/armeria/blob/67d29e019fd35a35f89c45cc8f9119ff9b12b44d/core/src/main/java/com/linecorp/armeria/internal/annotation/AnnotatedElementNameUtil.java#L39-L48 |
hellosign/hellosign-java-sdk | src/main/java/com/hellosign/sdk/resource/SignatureRequest.java | SignatureRequest.getSignatureBySigner | public Signature getSignatureBySigner(String email, String name) {
"""
Utility method that allows you to search for a Signature object on this
request by email and name. It requires both because neither alone is
enough to guarantee uniqueness (some requests can have multiple signers
using the same email address... | java | public Signature getSignatureBySigner(String email, String name) {
if (email == null || name == null) {
return null;
}
for (Signature s : getSignatures()) {
if (name.equalsIgnoreCase(s.getName()) && email.equalsIgnoreCase(s.getEmail())) {
return s;
... | [
"public",
"Signature",
"getSignatureBySigner",
"(",
"String",
"email",
",",
"String",
"name",
")",
"{",
"if",
"(",
"email",
"==",
"null",
"||",
"name",
"==",
"null",
")",
"{",
"return",
"null",
";",
"}",
"for",
"(",
"Signature",
"s",
":",
"getSignatures"... | Utility method that allows you to search for a Signature object on this
request by email and name. It requires both because neither alone is
enough to guarantee uniqueness (some requests can have multiple signers
using the same email address or name).
@param email String
@param name String
@return Signature, if found ... | [
"Utility",
"method",
"that",
"allows",
"you",
"to",
"search",
"for",
"a",
"Signature",
"object",
"on",
"this",
"request",
"by",
"email",
"and",
"name",
".",
"It",
"requires",
"both",
"because",
"neither",
"alone",
"is",
"enough",
"to",
"guarantee",
"uniquene... | train | https://github.com/hellosign/hellosign-java-sdk/blob/08fa7aeb3b0c68ddb6c7ea797d114d55d36d36b1/src/main/java/com/hellosign/sdk/resource/SignatureRequest.java#L252-L262 |
elki-project/elki | elki-core-dbids/src/main/java/de/lmu/ifi/dbs/elki/database/ids/DBIDUtil.java | DBIDUtil.randomSample | public static ModifiableDBIDs randomSample(DBIDs source, int k, Long seed) {
"""
Produce a random sample of the given DBIDs.
@param source Original DBIDs, no duplicates allowed
@param k k Parameter
@param seed Random generator seed
@return new DBIDs
"""
return randomSample(source, k, seed != null ? n... | java | public static ModifiableDBIDs randomSample(DBIDs source, int k, Long seed) {
return randomSample(source, k, seed != null ? new Random(seed.longValue()) : new Random());
} | [
"public",
"static",
"ModifiableDBIDs",
"randomSample",
"(",
"DBIDs",
"source",
",",
"int",
"k",
",",
"Long",
"seed",
")",
"{",
"return",
"randomSample",
"(",
"source",
",",
"k",
",",
"seed",
"!=",
"null",
"?",
"new",
"Random",
"(",
"seed",
".",
"longValu... | Produce a random sample of the given DBIDs.
@param source Original DBIDs, no duplicates allowed
@param k k Parameter
@param seed Random generator seed
@return new DBIDs | [
"Produce",
"a",
"random",
"sample",
"of",
"the",
"given",
"DBIDs",
"."
] | train | https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-core-dbids/src/main/java/de/lmu/ifi/dbs/elki/database/ids/DBIDUtil.java#L561-L563 |
spotbugs/spotbugs | spotbugs/src/main/java/edu/umd/cs/findbugs/ba/AssertionMethods.java | AssertionMethods.isAssertionInstruction | public boolean isAssertionInstruction(Instruction ins, ConstantPoolGen cpg) {
"""
Does the given instruction refer to a likely assertion method?
@param ins
the instruction
@return true if the instruction likely refers to an assertion, false if
not
"""
if (ins instanceof InvokeInstruction) {
... | java | public boolean isAssertionInstruction(Instruction ins, ConstantPoolGen cpg) {
if (ins instanceof InvokeInstruction) {
return isAssertionCall((InvokeInstruction) ins);
}
if (ins instanceof GETSTATIC) {
GETSTATIC getStatic = (GETSTATIC) ins;
String className = ... | [
"public",
"boolean",
"isAssertionInstruction",
"(",
"Instruction",
"ins",
",",
"ConstantPoolGen",
"cpg",
")",
"{",
"if",
"(",
"ins",
"instanceof",
"InvokeInstruction",
")",
"{",
"return",
"isAssertionCall",
"(",
"(",
"InvokeInstruction",
")",
"ins",
")",
";",
"}... | Does the given instruction refer to a likely assertion method?
@param ins
the instruction
@return true if the instruction likely refers to an assertion, false if
not | [
"Does",
"the",
"given",
"instruction",
"refer",
"to",
"a",
"likely",
"assertion",
"method?"
] | train | https://github.com/spotbugs/spotbugs/blob/f6365c6eea6515035bded38efa4a7c8b46ccf28c/spotbugs/src/main/java/edu/umd/cs/findbugs/ba/AssertionMethods.java#L209-L225 |
UrielCh/ovh-java-sdk | ovh-java-sdk-domain/src/main/java/net/minidev/ovh/api/ApiOvhDomain.java | ApiOvhDomain.zone_zoneName_redirection_id_PUT | public void zone_zoneName_redirection_id_PUT(String zoneName, Long id, OvhRedirection body) throws IOException {
"""
Alter this object properties
REST: PUT /domain/zone/{zoneName}/redirection/{id}
@param body [required] New object properties
@param zoneName [required] The internal name of your zone
@param id... | java | public void zone_zoneName_redirection_id_PUT(String zoneName, Long id, OvhRedirection body) throws IOException {
String qPath = "/domain/zone/{zoneName}/redirection/{id}";
StringBuilder sb = path(qPath, zoneName, id);
exec(qPath, "PUT", sb.toString(), body);
} | [
"public",
"void",
"zone_zoneName_redirection_id_PUT",
"(",
"String",
"zoneName",
",",
"Long",
"id",
",",
"OvhRedirection",
"body",
")",
"throws",
"IOException",
"{",
"String",
"qPath",
"=",
"\"/domain/zone/{zoneName}/redirection/{id}\"",
";",
"StringBuilder",
"sb",
"=",... | Alter this object properties
REST: PUT /domain/zone/{zoneName}/redirection/{id}
@param body [required] New object properties
@param zoneName [required] The internal name of your zone
@param id [required] Id of the object | [
"Alter",
"this",
"object",
"properties"
] | train | https://github.com/UrielCh/ovh-java-sdk/blob/6d531a40e56e09701943e334c25f90f640c55701/ovh-java-sdk-domain/src/main/java/net/minidev/ovh/api/ApiOvhDomain.java#L862-L866 |
saxsys/SynchronizeFX | synchronizefx-core/src/main/java/de/saxsys/synchronizefx/core/metamodel/ModelWalkingSynchronizer.java | ModelWalkingSynchronizer.doWhenModelWalkerFinished | public void doWhenModelWalkerFinished(final ActionType type, final Runnable action) {
"""
Lets the current thread sleep until a currently running model walking thread has finished.
<p>
If no model walking is currently in progress, nothing happens.
</p>
@param type
The type of the action that waits for mod... | java | public void doWhenModelWalkerFinished(final ActionType type, final Runnable action) {
memberLock.lock();
if (!modelWalkingInProgess) {
memberLock.unlock();
action.run();
return;
}
CountDownLatch latch = new CountDownLatch(1);
Set<CountDownLatch... | [
"public",
"void",
"doWhenModelWalkerFinished",
"(",
"final",
"ActionType",
"type",
",",
"final",
"Runnable",
"action",
")",
"{",
"memberLock",
".",
"lock",
"(",
")",
";",
"if",
"(",
"!",
"modelWalkingInProgess",
")",
"{",
"memberLock",
".",
"unlock",
"(",
")... | Lets the current thread sleep until a currently running model walking thread has finished.
<p>
If no model walking is currently in progress, nothing happens.
</p>
@param type
The type of the action that waits for model walking to finish.
@param action
The action that should be performed. | [
"Lets",
"the",
"current",
"thread",
"sleep",
"until",
"a",
"currently",
"running",
"model",
"walking",
"thread",
"has",
"finished",
"."
] | train | https://github.com/saxsys/SynchronizeFX/blob/f3683020e4749110b38514eb5bc73a247998b579/synchronizefx-core/src/main/java/de/saxsys/synchronizefx/core/metamodel/ModelWalkingSynchronizer.java#L133-L153 |
Alluxio/alluxio | shell/src/main/java/alluxio/cli/fs/command/ChmodCommand.java | ChmodCommand.chmod | private void chmod(AlluxioURI path, String modeStr, boolean recursive) throws
AlluxioException, IOException {
"""
Changes the permissions of directory or file with the path specified in args.
@param path The {@link AlluxioURI} path as the input of the command
@param modeStr The new permission to be updat... | java | private void chmod(AlluxioURI path, String modeStr, boolean recursive) throws
AlluxioException, IOException {
Mode mode = ModeParser.parse(modeStr);
SetAttributePOptions options =
SetAttributePOptions.newBuilder().setMode(mode.toProto()).setRecursive(recursive).build();
mFileSystem.setAttribut... | [
"private",
"void",
"chmod",
"(",
"AlluxioURI",
"path",
",",
"String",
"modeStr",
",",
"boolean",
"recursive",
")",
"throws",
"AlluxioException",
",",
"IOException",
"{",
"Mode",
"mode",
"=",
"ModeParser",
".",
"parse",
"(",
"modeStr",
")",
";",
"SetAttributePO... | Changes the permissions of directory or file with the path specified in args.
@param path The {@link AlluxioURI} path as the input of the command
@param modeStr The new permission to be updated to the file or directory
@param recursive Whether change the permission recursively | [
"Changes",
"the",
"permissions",
"of",
"directory",
"or",
"file",
"with",
"the",
"path",
"specified",
"in",
"args",
"."
] | train | https://github.com/Alluxio/alluxio/blob/af38cf3ab44613355b18217a3a4d961f8fec3a10/shell/src/main/java/alluxio/cli/fs/command/ChmodCommand.java#L82-L90 |
enasequence/sequencetools | src/main/java/uk/ac/ebi/embl/flatfile/FlatFileUtils.java | FlatFileUtils.trimRight | public static String
trimRight( String string, int pos ) {
"""
Removes all whitespace characters from the end of the string
starting from the given position.
"""
int i = string.length();
for( ; i > pos; --i )
{
char charAt = string.charAt( i - 1 );
if( charAt != ' '
... | java | public static String
trimRight( String string, int pos )
{
int i = string.length();
for( ; i > pos; --i )
{
char charAt = string.charAt( i - 1 );
if( charAt != ' '
&& charAt != '\t'
&& charAt != '\n'
&& charAt != '\r' )
{
break;
}
... | [
"public",
"static",
"String",
"trimRight",
"(",
"String",
"string",
",",
"int",
"pos",
")",
"{",
"int",
"i",
"=",
"string",
".",
"length",
"(",
")",
";",
"for",
"(",
";",
"i",
">",
"pos",
";",
"--",
"i",
")",
"{",
"char",
"charAt",
"=",
"string",... | Removes all whitespace characters from the end of the string
starting from the given position. | [
"Removes",
"all",
"whitespace",
"characters",
"from",
"the",
"end",
"of",
"the",
"string",
"starting",
"from",
"the",
"given",
"position",
"."
] | train | https://github.com/enasequence/sequencetools/blob/4127f5e1a17540239f5810136153fbd6737fa262/src/main/java/uk/ac/ebi/embl/flatfile/FlatFileUtils.java#L95-L118 |
ManfredTremmel/gwt-commons-lang3 | src/main/java/org/apache/commons/lang3/text/StrSubstitutor.java | StrSubstitutor.replaceIn | public boolean replaceIn(final StrBuilder source) {
"""
Replaces all the occurrences of variables within the given source
builder with their matching values from the resolver.
@param source the builder to replace in, updated, null returns zero
@return true if altered
"""
if (source == null) {
... | java | public boolean replaceIn(final StrBuilder source) {
if (source == null) {
return false;
}
return substitute(source, 0, source.length());
} | [
"public",
"boolean",
"replaceIn",
"(",
"final",
"StrBuilder",
"source",
")",
"{",
"if",
"(",
"source",
"==",
"null",
")",
"{",
"return",
"false",
";",
"}",
"return",
"substitute",
"(",
"source",
",",
"0",
",",
"source",
".",
"length",
"(",
")",
")",
... | Replaces all the occurrences of variables within the given source
builder with their matching values from the resolver.
@param source the builder to replace in, updated, null returns zero
@return true if altered | [
"Replaces",
"all",
"the",
"occurrences",
"of",
"variables",
"within",
"the",
"given",
"source",
"builder",
"with",
"their",
"matching",
"values",
"from",
"the",
"resolver",
"."
] | train | https://github.com/ManfredTremmel/gwt-commons-lang3/blob/9e2dfbbda3668cfa5d935fe76479d1426c294504/src/main/java/org/apache/commons/lang3/text/StrSubstitutor.java#L704-L709 |
intuit/QuickBooks-V3-Java-SDK | ipp-v3-java-devkit/src/main/java/com/intuit/ipp/services/DataService.java | DataService.deleteAsync | public <T extends IEntity> void deleteAsync(T entity, CallbackHandler callbackHandler) throws FMSException {
"""
Method to delete record for the given entity in asynchronous fashion
@param entity
the entity
@param callbackHandler
the callback handler
@throws FMSException
"""
IntuitMessage intui... | java | public <T extends IEntity> void deleteAsync(T entity, CallbackHandler callbackHandler) throws FMSException {
IntuitMessage intuitMessage = prepareDelete(entity);
//set callback handler
intuitMessage.getRequestElements().setCallbackHandler(callbackHandler);
//execute async interceptors... | [
"public",
"<",
"T",
"extends",
"IEntity",
">",
"void",
"deleteAsync",
"(",
"T",
"entity",
",",
"CallbackHandler",
"callbackHandler",
")",
"throws",
"FMSException",
"{",
"IntuitMessage",
"intuitMessage",
"=",
"prepareDelete",
"(",
"entity",
")",
";",
"//set callbac... | Method to delete record for the given entity in asynchronous fashion
@param entity
the entity
@param callbackHandler
the callback handler
@throws FMSException | [
"Method",
"to",
"delete",
"record",
"for",
"the",
"given",
"entity",
"in",
"asynchronous",
"fashion"
] | train | https://github.com/intuit/QuickBooks-V3-Java-SDK/blob/59f988d0776d46620d0b34711c411b2b5b1da06b/ipp-v3-java-devkit/src/main/java/com/intuit/ipp/services/DataService.java#L779-L788 |
kaazing/gateway | service/http.directory/src/main/java/org/kaazing/gateway/service/http/directory/HttpDirectoryService.java | HttpDirectoryService.buildPatternsList | private List<PatternCacheControl> buildPatternsList(ServiceProperties properties) {
"""
Creates the list of PatternCacheControl objects
@param properties - list of ServiceProperties from the configuration file
@return a list of PatternCacheControl objects
"""
Map<String, PatternCacheControl> patterns... | java | private List<PatternCacheControl> buildPatternsList(ServiceProperties properties) {
Map<String, PatternCacheControl> patterns = new LinkedHashMap<>();
List<ServiceProperties> locationsList = properties.getNested("location");
if (locationsList != null && locationsList.size() != 0) {
f... | [
"private",
"List",
"<",
"PatternCacheControl",
">",
"buildPatternsList",
"(",
"ServiceProperties",
"properties",
")",
"{",
"Map",
"<",
"String",
",",
"PatternCacheControl",
">",
"patterns",
"=",
"new",
"LinkedHashMap",
"<>",
"(",
")",
";",
"List",
"<",
"ServiceP... | Creates the list of PatternCacheControl objects
@param properties - list of ServiceProperties from the configuration file
@return a list of PatternCacheControl objects | [
"Creates",
"the",
"list",
"of",
"PatternCacheControl",
"objects"
] | train | https://github.com/kaazing/gateway/blob/06017b19273109b3b992e528e702586446168d57/service/http.directory/src/main/java/org/kaazing/gateway/service/http/directory/HttpDirectoryService.java#L134-L149 |
MenoData/Time4J | base/src/main/java/net/time4j/tz/model/GregorianTimezoneRule.java | GregorianTimezoneRule.ofFixedDay | public static GregorianTimezoneRule ofFixedDay(
Month month,
int dayOfMonth,
PlainTime timeOfDay,
OffsetIndicator indicator,
int savings
) {
"""
/*[deutsch]
<p>Konstruiert ein Muster für einen festen Tag im angegebenen
Monat. </p>
@param month calendar ... | java | public static GregorianTimezoneRule ofFixedDay(
Month month,
int dayOfMonth,
PlainTime timeOfDay,
OffsetIndicator indicator,
int savings
) {
return ofFixedDay(month, dayOfMonth, timeOfDay.getInt(PlainTime.SECOND_OF_DAY), indicator, savings);
} | [
"public",
"static",
"GregorianTimezoneRule",
"ofFixedDay",
"(",
"Month",
"month",
",",
"int",
"dayOfMonth",
",",
"PlainTime",
"timeOfDay",
",",
"OffsetIndicator",
"indicator",
",",
"int",
"savings",
")",
"{",
"return",
"ofFixedDay",
"(",
"month",
",",
"dayOfMonth"... | /*[deutsch]
<p>Konstruiert ein Muster für einen festen Tag im angegebenen
Monat. </p>
@param month calendar month
@param dayOfMonth day of month (1 - 31)
@param timeOfDay clock time when time switch happens
@param indicator offset indicator
@param savings fixed DST-offset in seconds
@retu... | [
"/",
"*",
"[",
"deutsch",
"]",
"<p",
">",
"Konstruiert",
"ein",
"Muster",
"fü",
";",
"r",
"einen",
"festen",
"Tag",
"im",
"angegebenen",
"Monat",
".",
"<",
"/",
"p",
">"
] | train | https://github.com/MenoData/Time4J/blob/08b2eda6b2dbb140b92011cf7071bb087edd46a5/base/src/main/java/net/time4j/tz/model/GregorianTimezoneRule.java#L127-L137 |
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/LongTermRetentionBackupsInner.java | LongTermRetentionBackupsInner.getAsync | public Observable<LongTermRetentionBackupInner> getAsync(String locationName, String longTermRetentionServerName, String longTermRetentionDatabaseName, String backupName) {
"""
Gets a long term retention backup.
@param locationName The location of the database.
@param longTermRetentionServerName the String val... | java | public Observable<LongTermRetentionBackupInner> getAsync(String locationName, String longTermRetentionServerName, String longTermRetentionDatabaseName, String backupName) {
return getWithServiceResponseAsync(locationName, longTermRetentionServerName, longTermRetentionDatabaseName, backupName).map(new Func1<Serv... | [
"public",
"Observable",
"<",
"LongTermRetentionBackupInner",
">",
"getAsync",
"(",
"String",
"locationName",
",",
"String",
"longTermRetentionServerName",
",",
"String",
"longTermRetentionDatabaseName",
",",
"String",
"backupName",
")",
"{",
"return",
"getWithServiceRespons... | Gets a long term retention backup.
@param locationName The location of the database.
@param longTermRetentionServerName the String value
@param longTermRetentionDatabaseName the String value
@param backupName The backup name.
@throws IllegalArgumentException thrown if parameters fail the validation
@return the observa... | [
"Gets",
"a",
"long",
"term",
"retention",
"backup",
"."
] | 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/LongTermRetentionBackupsInner.java#L141-L148 |
rapidpro/expressions | java/src/main/java/io/rapidpro/expressions/functions/FunctionManager.java | FunctionManager.buildListing | public List<FunctionDescriptor> buildListing() {
"""
Builds a listing of all functions sorted A-Z. Unlike the Python port, this only returns function names as Java
doesn't so easily support reading of docstrings and Java 7 doesn't provide access to parameter names.
@return the function listing
"""
Li... | java | public List<FunctionDescriptor> buildListing() {
List<FunctionDescriptor> listing = new ArrayList<>();
for (Map.Entry<String, Method> entry : m_functions.entrySet()) {
FunctionDescriptor descriptor = new FunctionDescriptor(entry.getKey().toUpperCase());
listing.add(descriptor);
... | [
"public",
"List",
"<",
"FunctionDescriptor",
">",
"buildListing",
"(",
")",
"{",
"List",
"<",
"FunctionDescriptor",
">",
"listing",
"=",
"new",
"ArrayList",
"<>",
"(",
")",
";",
"for",
"(",
"Map",
".",
"Entry",
"<",
"String",
",",
"Method",
">",
"entry",... | Builds a listing of all functions sorted A-Z. Unlike the Python port, this only returns function names as Java
doesn't so easily support reading of docstrings and Java 7 doesn't provide access to parameter names.
@return the function listing | [
"Builds",
"a",
"listing",
"of",
"all",
"functions",
"sorted",
"A",
"-",
"Z",
".",
"Unlike",
"the",
"Python",
"port",
"this",
"only",
"returns",
"function",
"names",
"as",
"Java",
"doesn",
"t",
"so",
"easily",
"support",
"reading",
"of",
"docstrings",
"and"... | train | https://github.com/rapidpro/expressions/blob/b03d91ec58fc328960bce90ecb5fa49dcf467627/java/src/main/java/io/rapidpro/expressions/functions/FunctionManager.java#L131-L147 |
OpenLiberty/open-liberty | dev/com.ibm.ws.transport.http/src/com/ibm/ws/http/channel/internal/HttpFactoryConfig.java | HttpFactoryConfig.parseMsgSize | private void parseMsgSize(Map<Object, Object> props) {
"""
Parse the standard limit on an incoming message size.
@param props
"""
String value = (String) props.get(HttpConfigConstants.PROPNAME_MSG_SIZE_LIMIT);
if (null != value) {
try {
this.msgSizeLimit = Long.pa... | java | private void parseMsgSize(Map<Object, Object> props) {
String value = (String) props.get(HttpConfigConstants.PROPNAME_MSG_SIZE_LIMIT);
if (null != value) {
try {
this.msgSizeLimit = Long.parseLong(value);
if (HttpConfigConstants.UNLIMITED > getMessageSize()) {... | [
"private",
"void",
"parseMsgSize",
"(",
"Map",
"<",
"Object",
",",
"Object",
">",
"props",
")",
"{",
"String",
"value",
"=",
"(",
"String",
")",
"props",
".",
"get",
"(",
"HttpConfigConstants",
".",
"PROPNAME_MSG_SIZE_LIMIT",
")",
";",
"if",
"(",
"null",
... | Parse the standard limit on an incoming message size.
@param props | [
"Parse",
"the",
"standard",
"limit",
"on",
"an",
"incoming",
"message",
"size",
"."
] | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.transport.http/src/com/ibm/ws/http/channel/internal/HttpFactoryConfig.java#L52-L70 |
alkacon/opencms-core | src/org/opencms/ui/actions/CmsUserInfoDialogAction.java | CmsUserInfoDialogAction.handleUpload | void handleUpload(List<String> uploadedFiles, I_CmsDialogContext context) {
"""
Handles the user image file upload.<p>
@param uploadedFiles the uploaded file names
@param context the dialog context
"""
CmsObject cms = context.getCms();
boolean success = OpenCms.getWorkplaceAppManager().get... | java | void handleUpload(List<String> uploadedFiles, I_CmsDialogContext context) {
CmsObject cms = context.getCms();
boolean success = OpenCms.getWorkplaceAppManager().getUserIconHelper().handleImageUpload(cms, uploadedFiles);
if (success) {
context.reload();
}
} | [
"void",
"handleUpload",
"(",
"List",
"<",
"String",
">",
"uploadedFiles",
",",
"I_CmsDialogContext",
"context",
")",
"{",
"CmsObject",
"cms",
"=",
"context",
".",
"getCms",
"(",
")",
";",
"boolean",
"success",
"=",
"OpenCms",
".",
"getWorkplaceAppManager",
"("... | Handles the user image file upload.<p>
@param uploadedFiles the uploaded file names
@param context the dialog context | [
"Handles",
"the",
"user",
"image",
"file",
"upload",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/ui/actions/CmsUserInfoDialogAction.java#L149-L156 |
thymeleaf/thymeleaf | src/main/java/org/thymeleaf/standard/expression/FragmentExpression.java | FragmentExpression.createExecutedFragmentExpression | @Deprecated
public static ExecutedFragmentExpression createExecutedFragmentExpression(
final IExpressionContext context,
final FragmentExpression expression, final StandardExpressionExecutionContext expContext) {
"""
<p>
Create the executed fragment expression.
</p>
@param context ... | java | @Deprecated
public static ExecutedFragmentExpression createExecutedFragmentExpression(
final IExpressionContext context,
final FragmentExpression expression, final StandardExpressionExecutionContext expContext) {
return doCreateExecutedFragmentExpression(context, expression, expConte... | [
"@",
"Deprecated",
"public",
"static",
"ExecutedFragmentExpression",
"createExecutedFragmentExpression",
"(",
"final",
"IExpressionContext",
"context",
",",
"final",
"FragmentExpression",
"expression",
",",
"final",
"StandardExpressionExecutionContext",
"expContext",
")",
"{",
... | <p>
Create the executed fragment expression.
</p>
@param context the context
@param expression the expresson
@param expContext the expression context
@return the executed fragment expression
@deprecated Deprecated in 3.0.9. Use the version without "expContext" itself, as all FragmentExpressions should
be executed in ... | [
"<p",
">",
"Create",
"the",
"executed",
"fragment",
"expression",
".",
"<",
"/",
"p",
">"
] | train | https://github.com/thymeleaf/thymeleaf/blob/2b0e6d6d7571fbe638904b5fd222fc9e77188879/src/main/java/org/thymeleaf/standard/expression/FragmentExpression.java#L415-L420 |
facebook/fresco | imagepipeline/src/main/java/com/facebook/imagepipeline/memory/BucketMap.java | BucketMap.release | public synchronized void release(int key, T value) {
"""
Associates the object with the specified key and puts it into the {@link BucketMap}.
Does not overwrite the previous object, if any.
@param key
"""
LinkedEntry<T> bucket = mMap.get(key);
if (bucket == null) {
bucket = new LinkedEntry<T>(n... | java | public synchronized void release(int key, T value) {
LinkedEntry<T> bucket = mMap.get(key);
if (bucket == null) {
bucket = new LinkedEntry<T>(null, key, new LinkedList<T>(), null);
mMap.put(key, bucket);
}
bucket.value.addLast(value);
moveToFront(bucket);
} | [
"public",
"synchronized",
"void",
"release",
"(",
"int",
"key",
",",
"T",
"value",
")",
"{",
"LinkedEntry",
"<",
"T",
">",
"bucket",
"=",
"mMap",
".",
"get",
"(",
"key",
")",
";",
"if",
"(",
"bucket",
"==",
"null",
")",
"{",
"bucket",
"=",
"new",
... | Associates the object with the specified key and puts it into the {@link BucketMap}.
Does not overwrite the previous object, if any.
@param key | [
"Associates",
"the",
"object",
"with",
"the",
"specified",
"key",
"and",
"puts",
"it",
"into",
"the",
"{"
] | train | https://github.com/facebook/fresco/blob/0b85879d51c5036d5e46e627a6651afefc0b971a/imagepipeline/src/main/java/com/facebook/imagepipeline/memory/BucketMap.java#L68-L78 |
landawn/AbacusUtil | src/com/landawn/abacus/util/N.java | N.callUninterruptibly | public static <T> T callUninterruptibly(final long timeout, final TimeUnit unit, final Try.BiFunction<Long, TimeUnit, T, InterruptedException> cmd) {
"""
Note: Copied from Google Guava under Apache License v2.0
<br />
<br />
If a thread is interrupted during such a call, the call continues to block until the ... | java | public static <T> T callUninterruptibly(final long timeout, final TimeUnit unit, final Try.BiFunction<Long, TimeUnit, T, InterruptedException> cmd) {
N.checkArgNotNull(unit, "unit");
N.checkArgNotNull(cmd);
boolean interrupted = false;
try {
long remainingNanos = uni... | [
"public",
"static",
"<",
"T",
">",
"T",
"callUninterruptibly",
"(",
"final",
"long",
"timeout",
",",
"final",
"TimeUnit",
"unit",
",",
"final",
"Try",
".",
"BiFunction",
"<",
"Long",
",",
"TimeUnit",
",",
"T",
",",
"InterruptedException",
">",
"cmd",
")",
... | Note: Copied from Google Guava under Apache License v2.0
<br />
<br />
If a thread is interrupted during such a call, the call continues to block until the result is available or the
timeout elapses, and only then re-interrupts the thread.
@param timeout
@param unit
@param cmd
@return | [
"Note",
":",
"Copied",
"from",
"Google",
"Guava",
"under",
"Apache",
"License",
"v2",
".",
"0",
"<br",
"/",
">",
"<br",
"/",
">"
] | train | https://github.com/landawn/AbacusUtil/blob/544b7720175d15e9329f83dd22a8cc5fa4515e12/src/com/landawn/abacus/util/N.java#L28107-L28131 |
deeplearning4j/deeplearning4j | nd4j/nd4j-backends/nd4j-api-parent/nd4j-api/src/main/java/org/nd4j/evaluation/classification/ConfusionMatrix.java | ConfusionMatrix.getCount | public synchronized int getCount(T actual, T predicted) {
"""
Gives the count of the number of times the "predicted" class was predicted for the "actual"
class.
"""
if (!matrix.containsKey(actual)) {
return 0;
} else {
return matrix.get(actual).count(predicted);
... | java | public synchronized int getCount(T actual, T predicted) {
if (!matrix.containsKey(actual)) {
return 0;
} else {
return matrix.get(actual).count(predicted);
}
} | [
"public",
"synchronized",
"int",
"getCount",
"(",
"T",
"actual",
",",
"T",
"predicted",
")",
"{",
"if",
"(",
"!",
"matrix",
".",
"containsKey",
"(",
"actual",
")",
")",
"{",
"return",
"0",
";",
"}",
"else",
"{",
"return",
"matrix",
".",
"get",
"(",
... | Gives the count of the number of times the "predicted" class was predicted for the "actual"
class. | [
"Gives",
"the",
"count",
"of",
"the",
"number",
"of",
"times",
"the",
"predicted",
"class",
"was",
"predicted",
"for",
"the",
"actual",
"class",
"."
] | train | https://github.com/deeplearning4j/deeplearning4j/blob/effce52f2afd7eeb53c5bcca699fcd90bd06822f/nd4j/nd4j-backends/nd4j-api-parent/nd4j-api/src/main/java/org/nd4j/evaluation/classification/ConfusionMatrix.java#L100-L106 |
EdwardRaff/JSAT | JSAT/src/jsat/linear/RowColumnOps.java | RowColumnOps.multRow | public static void multRow(Matrix A, int i, double[] c) {
"""
Updates the values of row <tt>i</tt> in the given matrix to be A[i,:] = A[i,:] .* c[i]
@param A the matrix to perform he update on
@param i the row to update
@param c the array of values to multiple the elements of <tt>A</tt> by
"""
if(... | java | public static void multRow(Matrix A, int i, double[] c)
{
if(A.cols() != c.length)
throw new ArithmeticException("Can not perform row update, length miss match " + A.cols() + " and " + c.length);
multRow(A, i, 0, c.length, c);
} | [
"public",
"static",
"void",
"multRow",
"(",
"Matrix",
"A",
",",
"int",
"i",
",",
"double",
"[",
"]",
"c",
")",
"{",
"if",
"(",
"A",
".",
"cols",
"(",
")",
"!=",
"c",
".",
"length",
")",
"throw",
"new",
"ArithmeticException",
"(",
"\"Can not perform r... | Updates the values of row <tt>i</tt> in the given matrix to be A[i,:] = A[i,:] .* c[i]
@param A the matrix to perform he update on
@param i the row to update
@param c the array of values to multiple the elements of <tt>A</tt> by | [
"Updates",
"the",
"values",
"of",
"row",
"<tt",
">",
"i<",
"/",
"tt",
">",
"in",
"the",
"given",
"matrix",
"to",
"be",
"A",
"[",
"i",
":",
"]",
"=",
"A",
"[",
"i",
":",
"]",
".",
"*",
"c",
"[",
"i",
"]"
] | train | https://github.com/EdwardRaff/JSAT/blob/0ff53b7b39684b2379cc1da522f5b3a954b15cfb/JSAT/src/jsat/linear/RowColumnOps.java#L134-L139 |
sarl/sarl | contribs/io.sarl.pythongenerator/io.sarl.pythongenerator.generator/src/io/sarl/pythongenerator/generator/generator/PyGenerator.java | PyGenerator._generate | protected void _generate(SarlBehavior behavior, IExtraLanguageGeneratorContext context) {
"""
Generate the given object.
@param behavior the behavior.
@param context the context.
"""
final JvmDeclaredType jvmType = getJvmModelAssociations().getInferredType(behavior);
final PyAppendable appendable = cre... | java | protected void _generate(SarlBehavior behavior, IExtraLanguageGeneratorContext context) {
final JvmDeclaredType jvmType = getJvmModelAssociations().getInferredType(behavior);
final PyAppendable appendable = createAppendable(jvmType, context);
final List<JvmTypeReference> superTypes;
if (behavior.getExtends() !=... | [
"protected",
"void",
"_generate",
"(",
"SarlBehavior",
"behavior",
",",
"IExtraLanguageGeneratorContext",
"context",
")",
"{",
"final",
"JvmDeclaredType",
"jvmType",
"=",
"getJvmModelAssociations",
"(",
")",
".",
"getInferredType",
"(",
"behavior",
")",
";",
"final",
... | Generate the given object.
@param behavior the behavior.
@param context the context. | [
"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/PyGenerator.java#L797-L818 |
QSFT/Doradus | doradus-common/src/main/java/com/dell/doradus/common/UNode.java | UNode.createMapNode | public static UNode createMapNode(String name) {
"""
Create a MAP UNode with the given node name.
@param name Name for new MAP node.
@return New MAP UNode.
"""
return new UNode(name, NodeType.MAP, null, false, "");
} | java | public static UNode createMapNode(String name) {
return new UNode(name, NodeType.MAP, null, false, "");
} | [
"public",
"static",
"UNode",
"createMapNode",
"(",
"String",
"name",
")",
"{",
"return",
"new",
"UNode",
"(",
"name",
",",
"NodeType",
".",
"MAP",
",",
"null",
",",
"false",
",",
"\"\"",
")",
";",
"}"
] | Create a MAP UNode with the given node name.
@param name Name for new MAP node.
@return New MAP UNode. | [
"Create",
"a",
"MAP",
"UNode",
"with",
"the",
"given",
"node",
"name",
"."
] | train | https://github.com/QSFT/Doradus/blob/ad64d3c37922eefda68ec8869ef089c1ca604b70/doradus-common/src/main/java/com/dell/doradus/common/UNode.java#L167-L169 |
thinkaurelius/titan | titan-core/src/main/java/com/thinkaurelius/titan/graphdb/util/PriorityQueue.java | PriorityQueue.insertWithOverflow | public T insertWithOverflow(T element) {
"""
Adds an Object to a PriorityQueue in log(size) time.
It returns the object (if any) that was
dropped off the heap because it was full. This can be
the given parameter (in case it is smaller than the
full heap's minimum, and couldn't be added), or another
object tha... | java | public T insertWithOverflow(T element) {
if (size < maxSize) {
add(element);
return null;
} else if (size > 0 && !lessThan(element, heap[1])) {
T ret = heap[1];
heap[1] = element;
updateTop();
return ret;
} else {
return element;
}
} | [
"public",
"T",
"insertWithOverflow",
"(",
"T",
"element",
")",
"{",
"if",
"(",
"size",
"<",
"maxSize",
")",
"{",
"add",
"(",
"element",
")",
";",
"return",
"null",
";",
"}",
"else",
"if",
"(",
"size",
">",
"0",
"&&",
"!",
"lessThan",
"(",
"element"... | Adds an Object to a PriorityQueue in log(size) time.
It returns the object (if any) that was
dropped off the heap because it was full. This can be
the given parameter (in case it is smaller than the
full heap's minimum, and couldn't be added), or another
object that was previously the smallest value in the
heap and now... | [
"Adds",
"an",
"Object",
"to",
"a",
"PriorityQueue",
"in",
"log",
"(",
"size",
")",
"time",
".",
"It",
"returns",
"the",
"object",
"(",
"if",
"any",
")",
"that",
"was",
"dropped",
"off",
"the",
"heap",
"because",
"it",
"was",
"full",
".",
"This",
"can... | train | https://github.com/thinkaurelius/titan/blob/ee226e52415b8bf43b700afac75fa5b9767993a5/titan-core/src/main/java/com/thinkaurelius/titan/graphdb/util/PriorityQueue.java#L154-L166 |
OpenLiberty/open-liberty | dev/com.ibm.ws.repository/src/com/ibm/ws/repository/transport/client/AbstractFileClient.java | AbstractFileClient.getInputStreamToLicenseInsideZip | protected InputStream getInputStreamToLicenseInsideZip(final ZipInputStream zis, final String assetId, final String attachmentId) throws IOException {
"""
Given a ZipInputStream to an asset within the repo get an input stream to the license attachment within the
asset.
@param zis ZipInputStream to the containe... | java | protected InputStream getInputStreamToLicenseInsideZip(final ZipInputStream zis, final String assetId, final String attachmentId) throws IOException {
InputStream is = null;
try {
ZipEntry ze = zis.getNextEntry();
while (ze != null) {
if (ze.isDirectory()) {
... | [
"protected",
"InputStream",
"getInputStreamToLicenseInsideZip",
"(",
"final",
"ZipInputStream",
"zis",
",",
"final",
"String",
"assetId",
",",
"final",
"String",
"attachmentId",
")",
"throws",
"IOException",
"{",
"InputStream",
"is",
"=",
"null",
";",
"try",
"{",
... | Given a ZipInputStream to an asset within the repo get an input stream to the license attachment within the
asset.
@param zis ZipInputStream to the container for the asset (i.e. ZipInputStream to an ESA file inside a repo).
@param assetId The id of the asset
@param attachmentId The id of the license to get an input st... | [
"Given",
"a",
"ZipInputStream",
"to",
"an",
"asset",
"within",
"the",
"repo",
"get",
"an",
"input",
"stream",
"to",
"the",
"license",
"attachment",
"within",
"the",
"asset",
"."
] | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.repository/src/com/ibm/ws/repository/transport/client/AbstractFileClient.java#L232-L270 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.