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 |
|---|---|---|---|---|---|---|---|---|---|---|
moparisthebest/beehive | beehive-jdbc-control/src/main/java/org/apache/beehive/controls/system/jdbc/parser/ParameterChecker.java | ParameterChecker.checkReflectionParameters | public static void checkReflectionParameters(SqlFragmentContainer statement, MethodDeclaration methodDecl) {
"""
Verify that all reflection parameters in the statement element can be mapped to method parameters.
@param statement The parsed statement element.
@param methodDecl The method declaration which was a... | java | public static void checkReflectionParameters(SqlFragmentContainer statement, MethodDeclaration methodDecl) {
ArrayList<ParameterDeclaration> params =
new ArrayList<ParameterDeclaration>(methodDecl.getParameters());
HashMap<String, ParameterDeclaration> paramMap = new HashMap<String, Par... | [
"public",
"static",
"void",
"checkReflectionParameters",
"(",
"SqlFragmentContainer",
"statement",
",",
"MethodDeclaration",
"methodDecl",
")",
"{",
"ArrayList",
"<",
"ParameterDeclaration",
">",
"params",
"=",
"new",
"ArrayList",
"<",
"ParameterDeclaration",
">",
"(",
... | Verify that all reflection parameters in the statement element can be mapped to method parameters.
@param statement The parsed statement element.
@param methodDecl The method declaration which was annotated. | [
"Verify",
"that",
"all",
"reflection",
"parameters",
"in",
"the",
"statement",
"element",
"can",
"be",
"mapped",
"to",
"method",
"parameters",
"."
] | train | https://github.com/moparisthebest/beehive/blob/4246a0cc40ce3c05f1a02c2da2653ac622703d77/beehive-jdbc-control/src/main/java/org/apache/beehive/controls/system/jdbc/parser/ParameterChecker.java#L50-L66 |
spotify/scio | scio-bigquery/src/main/java/org/apache/beam/sdk/io/gcp/bigquery/PatchedBigQueryTableRowIterator.java | PatchedBigQueryTableRowIterator.fromTable | public static PatchedBigQueryTableRowIterator fromTable(TableReference ref, Bigquery client) {
"""
Constructs a {@code PatchedBigQueryTableRowIterator} that reads from the specified table.
"""
checkNotNull(ref, "ref");
checkNotNull(client, "client");
return new PatchedBigQueryTableRowIterator(ref, ... | java | public static PatchedBigQueryTableRowIterator fromTable(TableReference ref, Bigquery client) {
checkNotNull(ref, "ref");
checkNotNull(client, "client");
return new PatchedBigQueryTableRowIterator(ref, /* queryConfig */null, ref.getProjectId(), client);
} | [
"public",
"static",
"PatchedBigQueryTableRowIterator",
"fromTable",
"(",
"TableReference",
"ref",
",",
"Bigquery",
"client",
")",
"{",
"checkNotNull",
"(",
"ref",
",",
"\"ref\"",
")",
";",
"checkNotNull",
"(",
"client",
",",
"\"client\"",
")",
";",
"return",
"ne... | Constructs a {@code PatchedBigQueryTableRowIterator} that reads from the specified table. | [
"Constructs",
"a",
"{"
] | train | https://github.com/spotify/scio/blob/ed9a44428251b0c6834aad231b463d8eda418471/scio-bigquery/src/main/java/org/apache/beam/sdk/io/gcp/bigquery/PatchedBigQueryTableRowIterator.java#L116-L120 |
gallandarakhneorg/afc | advanced/mathfx/src/main/java/org/arakhne/afc/math/geometry/d3/ifx/Segment3ifx.java | Segment3ifx.x2Property | @Pure
public IntegerProperty x2Property() {
"""
Replies the property that is the x coordinate of the second segment point.
@return the x2 property.
"""
if (this.p2.x == null) {
this.p2.x = new SimpleIntegerProperty(this, MathFXAttributeNames.X2);
}
return this.p2.x;
} | java | @Pure
public IntegerProperty x2Property() {
if (this.p2.x == null) {
this.p2.x = new SimpleIntegerProperty(this, MathFXAttributeNames.X2);
}
return this.p2.x;
} | [
"@",
"Pure",
"public",
"IntegerProperty",
"x2Property",
"(",
")",
"{",
"if",
"(",
"this",
".",
"p2",
".",
"x",
"==",
"null",
")",
"{",
"this",
".",
"p2",
".",
"x",
"=",
"new",
"SimpleIntegerProperty",
"(",
"this",
",",
"MathFXAttributeNames",
".",
"X2"... | Replies the property that is the x coordinate of the second segment point.
@return the x2 property. | [
"Replies",
"the",
"property",
"that",
"is",
"the",
"x",
"coordinate",
"of",
"the",
"second",
"segment",
"point",
"."
] | train | https://github.com/gallandarakhneorg/afc/blob/0c7d2e1ddefd4167ef788416d970a6c1ef6f8bbb/advanced/mathfx/src/main/java/org/arakhne/afc/math/geometry/d3/ifx/Segment3ifx.java#L258-L264 |
stephanenicolas/afterburner | afterburner-library/src/main/java/com/github/stephanenicolas/afterburner/AfterBurner.java | AfterBurner.extractExistingMethod | public CtMethod extractExistingMethod(final CtClass classToTransform,
String methodName) {
"""
Returns the method named {@code methodName} in {@code classToTransform}. Null if not found.
Due to limitations of javassist, in case of multiple overloads, one of them only is returned.
(https://github.com/... | java | public CtMethod extractExistingMethod(final CtClass classToTransform,
String methodName) {
try {
return classToTransform.getDeclaredMethod(methodName);
} catch (Exception e) {
return null;
}
} | [
"public",
"CtMethod",
"extractExistingMethod",
"(",
"final",
"CtClass",
"classToTransform",
",",
"String",
"methodName",
")",
"{",
"try",
"{",
"return",
"classToTransform",
".",
"getDeclaredMethod",
"(",
"methodName",
")",
";",
"}",
"catch",
"(",
"Exception",
"e",... | Returns the method named {@code methodName} in {@code classToTransform}. Null if not found.
Due to limitations of javassist, in case of multiple overloads, one of them only is returned.
(https://github.com/jboss-javassist/javassist/issues/9)
@param classToTransform the class that should contain a method methodName.
@pa... | [
"Returns",
"the",
"method",
"named",
"{"
] | train | https://github.com/stephanenicolas/afterburner/blob/b126d70e063895b036b6ac47e39e582439f58d12/afterburner-library/src/main/java/com/github/stephanenicolas/afterburner/AfterBurner.java#L119-L126 |
intuit/QuickBooks-V3-Java-SDK | oauth2-platform-api/src/main/java/com/intuit/oauth2/config/OAuth2Config.java | OAuth2Config.prepareUrl | public String prepareUrl(List<Scope> scopes, String redirectUri, String csrfToken) throws InvalidRequestException {
"""
Prepares URL to call the OAuth2 authorization endpoint using Scope, CSRF and redirectURL that is supplied
@param scope
@param redirectUri
@param csrfToken
@return
@throws InvalidRequestExc... | java | public String prepareUrl(List<Scope> scopes, String redirectUri, String csrfToken) throws InvalidRequestException {
logger.debug("Enter OAuth2config::prepareUrl");
if(scopes == null || scopes.isEmpty() || redirectUri.isEmpty() || csrfToken.isEmpty()) {
logger.error("Invalid request for prepareUrl ");
thro... | [
"public",
"String",
"prepareUrl",
"(",
"List",
"<",
"Scope",
">",
"scopes",
",",
"String",
"redirectUri",
",",
"String",
"csrfToken",
")",
"throws",
"InvalidRequestException",
"{",
"logger",
".",
"debug",
"(",
"\"Enter OAuth2config::prepareUrl\"",
")",
";",
"if",
... | Prepares URL to call the OAuth2 authorization endpoint using Scope, CSRF and redirectURL that is supplied
@param scope
@param redirectUri
@param csrfToken
@return
@throws InvalidRequestException | [
"Prepares",
"URL",
"to",
"call",
"the",
"OAuth2",
"authorization",
"endpoint",
"using",
"Scope",
"CSRF",
"and",
"redirectURL",
"that",
"is",
"supplied"
] | train | https://github.com/intuit/QuickBooks-V3-Java-SDK/blob/59f988d0776d46620d0b34711c411b2b5b1da06b/oauth2-platform-api/src/main/java/com/intuit/oauth2/config/OAuth2Config.java#L188-L206 |
esigate/esigate | esigate-core/src/main/java/org/esigate/util/UriUtils.java | UriUtils.rewriteURI | public static String rewriteURI(String uri, HttpHost targetHost) {
"""
Replaces the scheme, host and port in a URI.
@param uri
the URI
@param targetHost
the target host
@return the rewritten URI
"""
try {
return URIUtils.rewriteURI(createURI(uri), targetHost).toString();
} ca... | java | public static String rewriteURI(String uri, HttpHost targetHost) {
try {
return URIUtils.rewriteURI(createURI(uri), targetHost).toString();
} catch (URISyntaxException e) {
throw new InvalidUriException(e);
}
} | [
"public",
"static",
"String",
"rewriteURI",
"(",
"String",
"uri",
",",
"HttpHost",
"targetHost",
")",
"{",
"try",
"{",
"return",
"URIUtils",
".",
"rewriteURI",
"(",
"createURI",
"(",
"uri",
")",
",",
"targetHost",
")",
".",
"toString",
"(",
")",
";",
"}"... | Replaces the scheme, host and port in a URI.
@param uri
the URI
@param targetHost
the target host
@return the rewritten URI | [
"Replaces",
"the",
"scheme",
"host",
"and",
"port",
"in",
"a",
"URI",
"."
] | train | https://github.com/esigate/esigate/blob/50421fb224f16e1ec42715425109a72b3b55527b/esigate-core/src/main/java/org/esigate/util/UriUtils.java#L226-L232 |
joniles/mpxj | src/main/java/net/sf/mpxj/mpp/Var2Data.java | Var2Data.getDouble | public double getDouble(Integer id, Integer type) {
"""
This method retrieves a double of the specified type,
belonging to the item with the specified unique ID.
@param id unique ID of entity to which this data belongs
@param type data type identifier
@return required double data
"""
double result ... | java | public double getDouble(Integer id, Integer type)
{
double result = Double.longBitsToDouble(getLong(id, type));
if (Double.isNaN(result))
{
result = 0;
}
return result;
} | [
"public",
"double",
"getDouble",
"(",
"Integer",
"id",
",",
"Integer",
"type",
")",
"{",
"double",
"result",
"=",
"Double",
".",
"longBitsToDouble",
"(",
"getLong",
"(",
"id",
",",
"type",
")",
")",
";",
"if",
"(",
"Double",
".",
"isNaN",
"(",
"result"... | This method retrieves a double of the specified type,
belonging to the item with the specified unique ID.
@param id unique ID of entity to which this data belongs
@param type data type identifier
@return required double data | [
"This",
"method",
"retrieves",
"a",
"double",
"of",
"the",
"specified",
"type",
"belonging",
"to",
"the",
"item",
"with",
"the",
"specified",
"unique",
"ID",
"."
] | train | https://github.com/joniles/mpxj/blob/143ea0e195da59cd108f13b3b06328e9542337e8/src/main/java/net/sf/mpxj/mpp/Var2Data.java#L390-L398 |
aws/aws-sdk-java | aws-java-sdk-lightsail/src/main/java/com/amazonaws/services/lightsail/model/CreateInstancesFromSnapshotRequest.java | CreateInstancesFromSnapshotRequest.setAttachedDiskMapping | public void setAttachedDiskMapping(java.util.Map<String, java.util.List<DiskMap>> attachedDiskMapping) {
"""
<p>
An object containing information about one or more disk mappings.
</p>
@param attachedDiskMapping
An object containing information about one or more disk mappings.
"""
this.attachedDis... | java | public void setAttachedDiskMapping(java.util.Map<String, java.util.List<DiskMap>> attachedDiskMapping) {
this.attachedDiskMapping = attachedDiskMapping;
} | [
"public",
"void",
"setAttachedDiskMapping",
"(",
"java",
".",
"util",
".",
"Map",
"<",
"String",
",",
"java",
".",
"util",
".",
"List",
"<",
"DiskMap",
">",
">",
"attachedDiskMapping",
")",
"{",
"this",
".",
"attachedDiskMapping",
"=",
"attachedDiskMapping",
... | <p>
An object containing information about one or more disk mappings.
</p>
@param attachedDiskMapping
An object containing information about one or more disk mappings. | [
"<p",
">",
"An",
"object",
"containing",
"information",
"about",
"one",
"or",
"more",
"disk",
"mappings",
".",
"<",
"/",
"p",
">"
] | train | https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-lightsail/src/main/java/com/amazonaws/services/lightsail/model/CreateInstancesFromSnapshotRequest.java#L186-L188 |
citrusframework/citrus | modules/citrus-mail/src/main/java/com/consol/citrus/mail/message/MailMessageConverter.java | MailMessageConverter.handlePart | protected BodyPart handlePart(MimePart part) throws IOException, MessagingException {
"""
Process message part. Can be a text, binary or multipart instance.
@param part
@return
@throws java.io.IOException
"""
String contentType = parseContentType(part.getContentType());
if (part.isMimeType(... | java | protected BodyPart handlePart(MimePart part) throws IOException, MessagingException {
String contentType = parseContentType(part.getContentType());
if (part.isMimeType("multipart/*")) {
return handleMultiPart((Multipart) part.getContent());
} else if (part.isMimeType("text/*")) {
... | [
"protected",
"BodyPart",
"handlePart",
"(",
"MimePart",
"part",
")",
"throws",
"IOException",
",",
"MessagingException",
"{",
"String",
"contentType",
"=",
"parseContentType",
"(",
"part",
".",
"getContentType",
"(",
")",
")",
";",
"if",
"(",
"part",
".",
"isM... | Process message part. Can be a text, binary or multipart instance.
@param part
@return
@throws java.io.IOException | [
"Process",
"message",
"part",
".",
"Can",
"be",
"a",
"text",
"binary",
"or",
"multipart",
"instance",
"."
] | train | https://github.com/citrusframework/citrus/blob/55c58ef74c01d511615e43646ca25c1b2301c56d/modules/citrus-mail/src/main/java/com/consol/citrus/mail/message/MailMessageConverter.java#L163-L177 |
googlegenomics/gatk-tools-java | src/main/java/com/google/cloud/genomics/gatk/picard/runner/GA4GHPicardRunner.java | GA4GHPicardRunner.buildPicardCommand | private void buildPicardCommand()
throws IOException, GeneralSecurityException, URISyntaxException {
"""
Adds relevant parts to the cmd line for Picard tool, finds and extracts
"INPUT=" arguments and processes them by creating appropriate data pumps.
"""
File picardJarPath = new File(picardPath, "p... | java | private void buildPicardCommand()
throws IOException, GeneralSecurityException, URISyntaxException {
File picardJarPath = new File(picardPath, "picard.jar");
if (!picardJarPath.exists()) {
throw new IOException("Picard tool not found at " +
picardJarPath.getAbsolutePath());
}
... | [
"private",
"void",
"buildPicardCommand",
"(",
")",
"throws",
"IOException",
",",
"GeneralSecurityException",
",",
"URISyntaxException",
"{",
"File",
"picardJarPath",
"=",
"new",
"File",
"(",
"picardPath",
",",
"\"picard.jar\"",
")",
";",
"if",
"(",
"!",
"picardJar... | Adds relevant parts to the cmd line for Picard tool, finds and extracts
"INPUT=" arguments and processes them by creating appropriate data pumps. | [
"Adds",
"relevant",
"parts",
"to",
"the",
"cmd",
"line",
"for",
"Picard",
"tool",
"finds",
"and",
"extracts",
"INPUT",
"=",
"arguments",
"and",
"processes",
"them",
"by",
"creating",
"appropriate",
"data",
"pumps",
"."
] | train | https://github.com/googlegenomics/gatk-tools-java/blob/5521664e8d6274b113962659f2737c27cc361065/src/main/java/com/google/cloud/genomics/gatk/picard/runner/GA4GHPicardRunner.java#L176-L201 |
phax/ph-commons | ph-commons/src/main/java/com/helger/commons/text/codepoint/CodepointHelper.java | CodepointHelper.verify | public static void verify (final AbstractCodepointIterator aIter, final IntPredicate aFilter) {
"""
Verifies a sequence of codepoints using the specified filter
@param aIter
Codepointer iterator
@param aFilter
filter
"""
final CodepointIteratorRestricted rci = aIter.restrict (aFilter, false);
whi... | java | public static void verify (final AbstractCodepointIterator aIter, final IntPredicate aFilter)
{
final CodepointIteratorRestricted rci = aIter.restrict (aFilter, false);
while (rci.hasNext ())
rci.next ();
} | [
"public",
"static",
"void",
"verify",
"(",
"final",
"AbstractCodepointIterator",
"aIter",
",",
"final",
"IntPredicate",
"aFilter",
")",
"{",
"final",
"CodepointIteratorRestricted",
"rci",
"=",
"aIter",
".",
"restrict",
"(",
"aFilter",
",",
"false",
")",
";",
"wh... | Verifies a sequence of codepoints using the specified filter
@param aIter
Codepointer iterator
@param aFilter
filter | [
"Verifies",
"a",
"sequence",
"of",
"codepoints",
"using",
"the",
"specified",
"filter"
] | train | https://github.com/phax/ph-commons/blob/d28c03565f44a0b804d96028d0969f9bb38c4313/ph-commons/src/main/java/com/helger/commons/text/codepoint/CodepointHelper.java#L747-L752 |
infinispan/infinispan | tools/src/main/java/org/infinispan/tools/config/v6/Parser60.java | Parser60.parseCommonStoreAttributes | public static void parseCommonStoreAttributes(XMLExtendedStreamReader reader, StoreConfigurationBuilder builder, String attributeName, String value, int i) throws XMLStreamException {
"""
This method is public static so that it can be reused by custom cache store/loader configuration parsers
"""
switch (... | java | public static void parseCommonStoreAttributes(XMLExtendedStreamReader reader, StoreConfigurationBuilder builder, String attributeName, String value, int i) throws XMLStreamException {
switch (Attribute.forName(attributeName)) {
case FETCH_PERSISTENT_STATE:
builder.fetchPersistentState(Boolean... | [
"public",
"static",
"void",
"parseCommonStoreAttributes",
"(",
"XMLExtendedStreamReader",
"reader",
",",
"StoreConfigurationBuilder",
"builder",
",",
"String",
"attributeName",
",",
"String",
"value",
",",
"int",
"i",
")",
"throws",
"XMLStreamException",
"{",
"switch",
... | This method is public static so that it can be reused by custom cache store/loader configuration parsers | [
"This",
"method",
"is",
"public",
"static",
"so",
"that",
"it",
"can",
"be",
"reused",
"by",
"custom",
"cache",
"store",
"/",
"loader",
"configuration",
"parsers"
] | train | https://github.com/infinispan/infinispan/blob/7c62b94886c3febb4774ae8376acf2baa0265ab5/tools/src/main/java/org/infinispan/tools/config/v6/Parser60.java#L651-L671 |
roboconf/roboconf-platform | core/roboconf-messaging-rabbitmq/src/main/java/net/roboconf/messaging/rabbitmq/internal/utils/RabbitMqUtils.java | RabbitMqUtils.declareApplicationExchanges | public static void declareApplicationExchanges( String domain, String applicationName, Channel channel )
throws IOException {
"""
Declares the required exchanges for an application (only for agents).
@param domain the domain name
@param applicationName the application name
@param channel the RabbitMQ channel
... | java | public static void declareApplicationExchanges( String domain, String applicationName, Channel channel )
throws IOException {
// "topic" is a keyword for RabbitMQ.
if( applicationName != null ) {
String exch = buildExchangeNameForAgent( domain, applicationName );
channel.exchangeDeclare( exch, "topic" );
... | [
"public",
"static",
"void",
"declareApplicationExchanges",
"(",
"String",
"domain",
",",
"String",
"applicationName",
",",
"Channel",
"channel",
")",
"throws",
"IOException",
"{",
"// \"topic\" is a keyword for RabbitMQ.",
"if",
"(",
"applicationName",
"!=",
"null",
")"... | Declares the required exchanges for an application (only for agents).
@param domain the domain name
@param applicationName the application name
@param channel the RabbitMQ channel
@throws IOException if an error occurs | [
"Declares",
"the",
"required",
"exchanges",
"for",
"an",
"application",
"(",
"only",
"for",
"agents",
")",
"."
] | train | https://github.com/roboconf/roboconf-platform/blob/add54eead479effb138d0ff53a2d637902b82702/core/roboconf-messaging-rabbitmq/src/main/java/net/roboconf/messaging/rabbitmq/internal/utils/RabbitMqUtils.java#L181-L189 |
adamfisk/littleshoot-commons-id | src/main/java/org/apache/commons/id/uuid/state/StateHelper.java | StateHelper.decodeMACAddress | public static byte[] decodeMACAddress(String address) {
"""
<p>Utility method decodes a valid MAC address in the form of
XX-XX-XX-XX-XX-XX where each XX represents a hexidecimal value.</p>
<p> Returns null if the address can not be decoded. </p>
@param address the String hexidecimal dash separated MAC addre... | java | public static byte[] decodeMACAddress(String address) {
StringBuffer buf = new StringBuffer(MAC_ADDRESS_TOKEN_COUNT * 2);
StringTokenizer tokens = new StringTokenizer(address, "-");
if (tokens.countTokens() != MAC_ADDRESS_TOKEN_COUNT) {
return null;
} else {
for (... | [
"public",
"static",
"byte",
"[",
"]",
"decodeMACAddress",
"(",
"String",
"address",
")",
"{",
"StringBuffer",
"buf",
"=",
"new",
"StringBuffer",
"(",
"MAC_ADDRESS_TOKEN_COUNT",
"*",
"2",
")",
";",
"StringTokenizer",
"tokens",
"=",
"new",
"StringTokenizer",
"(",
... | <p>Utility method decodes a valid MAC address in the form of
XX-XX-XX-XX-XX-XX where each XX represents a hexidecimal value.</p>
<p> Returns null if the address can not be decoded. </p>
@param address the String hexidecimal dash separated MAC address.
@return a byte array representing the the address. Null if not a v... | [
"<p",
">",
"Utility",
"method",
"decodes",
"a",
"valid",
"MAC",
"address",
"in",
"the",
"form",
"of",
"XX",
"-",
"XX",
"-",
"XX",
"-",
"XX",
"-",
"XX",
"-",
"XX",
"where",
"each",
"XX",
"represents",
"a",
"hexidecimal",
"value",
".",
"<",
"/",
"p",... | train | https://github.com/adamfisk/littleshoot-commons-id/blob/49a8f5f2b10831c509876ca463bf1a87e1e49ae9/src/main/java/org/apache/commons/id/uuid/state/StateHelper.java#L215-L232 |
Azure/azure-sdk-for-java | recoveryservices.backup/resource-manager/v2017_07_01/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2017_07_01/implementation/BackupResourceStorageConfigsInner.java | BackupResourceStorageConfigsInner.getAsync | public Observable<BackupResourceConfigResourceInner> getAsync(String vaultName, String resourceGroupName) {
"""
Fetches resource storage config.
@param vaultName The name of the recovery services vault.
@param resourceGroupName The name of the resource group where the recovery services vault is present.
@thro... | java | public Observable<BackupResourceConfigResourceInner> getAsync(String vaultName, String resourceGroupName) {
return getWithServiceResponseAsync(vaultName, resourceGroupName).map(new Func1<ServiceResponse<BackupResourceConfigResourceInner>, BackupResourceConfigResourceInner>() {
@Override
... | [
"public",
"Observable",
"<",
"BackupResourceConfigResourceInner",
">",
"getAsync",
"(",
"String",
"vaultName",
",",
"String",
"resourceGroupName",
")",
"{",
"return",
"getWithServiceResponseAsync",
"(",
"vaultName",
",",
"resourceGroupName",
")",
".",
"map",
"(",
"new... | Fetches resource storage config.
@param vaultName The name of the recovery services vault.
@param resourceGroupName The name of the resource group where the recovery services vault is present.
@throws IllegalArgumentException thrown if parameters fail the validation
@return the observable to the BackupResourceConfigRe... | [
"Fetches",
"resource",
"storage",
"config",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/recoveryservices.backup/resource-manager/v2017_07_01/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2017_07_01/implementation/BackupResourceStorageConfigsInner.java#L102-L109 |
synchronoss/cpo-api | cpo-cassandra/src/main/java/org/synchronoss/cpo/cassandra/CassandraCpoAdapter.java | CassandraCpoAdapter.persistObject | @Override
public <T> long persistObject(T obj) throws CpoException {
"""
Persists the Object into the datasource. The CpoAdapter will check to see if this object exists in the datasource.
If it exists, the object is updated in the datasource If the object does not exist, then it is created in the
datasource. T... | java | @Override
public <T> long persistObject(T obj) throws CpoException {
return processUpdateGroup(obj, CpoAdapter.PERSIST_GROUP, null, null, null, null);
} | [
"@",
"Override",
"public",
"<",
"T",
">",
"long",
"persistObject",
"(",
"T",
"obj",
")",
"throws",
"CpoException",
"{",
"return",
"processUpdateGroup",
"(",
"obj",
",",
"CpoAdapter",
".",
"PERSIST_GROUP",
",",
"null",
",",
"null",
",",
"null",
",",
"null",... | Persists the Object into the datasource. The CpoAdapter will check to see if this object exists in the datasource.
If it exists, the object is updated in the datasource If the object does not exist, then it is created in the
datasource. This method stores the object in the datasource. This method uses the default EXIST... | [
"Persists",
"the",
"Object",
"into",
"the",
"datasource",
".",
"The",
"CpoAdapter",
"will",
"check",
"to",
"see",
"if",
"this",
"object",
"exists",
"in",
"the",
"datasource",
".",
"If",
"it",
"exists",
"the",
"object",
"is",
"updated",
"in",
"the",
"dataso... | train | https://github.com/synchronoss/cpo-api/blob/dc745aca3b3206abf80b85d9689b0132f5baa694/cpo-cassandra/src/main/java/org/synchronoss/cpo/cassandra/CassandraCpoAdapter.java#L1179-L1182 |
Azure/azure-sdk-for-java | batch/data-plane/src/main/java/com/microsoft/azure/batch/ComputeNodeOperations.java | ComputeNodeOperations.disableComputeNodeScheduling | public void disableComputeNodeScheduling(String poolId, String nodeId) throws BatchErrorException, IOException {
"""
Disables task scheduling on the specified compute node.
@param poolId The ID of the pool.
@param nodeId the ID of the compute node.
@throws BatchErrorException Exception thrown when an error re... | java | public void disableComputeNodeScheduling(String poolId, String nodeId) throws BatchErrorException, IOException {
disableComputeNodeScheduling(poolId, nodeId, null, null);
} | [
"public",
"void",
"disableComputeNodeScheduling",
"(",
"String",
"poolId",
",",
"String",
"nodeId",
")",
"throws",
"BatchErrorException",
",",
"IOException",
"{",
"disableComputeNodeScheduling",
"(",
"poolId",
",",
"nodeId",
",",
"null",
",",
"null",
")",
";",
"}"... | Disables task scheduling on the specified compute node.
@param poolId The ID of the pool.
@param nodeId the ID of the compute node.
@throws BatchErrorException Exception thrown when an error response is received from the Batch service.
@throws IOException Exception thrown when there is an error in serialization/deseri... | [
"Disables",
"task",
"scheduling",
"on",
"the",
"specified",
"compute",
"node",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/batch/data-plane/src/main/java/com/microsoft/azure/batch/ComputeNodeOperations.java#L368-L370 |
Cornutum/tcases | tcases-lib/src/main/java/org/cornutum/tcases/conditions/Cnf.java | Cnf.satisfiesSome | public static boolean satisfiesSome( IConjunct condition, PropertySet properties) {
"""
Returns true if the given properties partially satisfy the given condition.
"""
boolean satisfies;
Iterator<IDisjunct> disjuncts;
for( disjuncts = condition.getDisjuncts(),
satisfies = !disjuncts.hasN... | java | public static boolean satisfiesSome( IConjunct condition, PropertySet properties)
{
boolean satisfies;
Iterator<IDisjunct> disjuncts;
for( disjuncts = condition.getDisjuncts(),
satisfies = !disjuncts.hasNext();
!satisfies
&& disjuncts.hasNext();
satisfi... | [
"public",
"static",
"boolean",
"satisfiesSome",
"(",
"IConjunct",
"condition",
",",
"PropertySet",
"properties",
")",
"{",
"boolean",
"satisfies",
";",
"Iterator",
"<",
"IDisjunct",
">",
"disjuncts",
";",
"for",
"(",
"disjuncts",
"=",
"condition",
".",
"getDisju... | Returns true if the given properties partially satisfy the given condition. | [
"Returns",
"true",
"if",
"the",
"given",
"properties",
"partially",
"satisfy",
"the",
"given",
"condition",
"."
] | train | https://github.com/Cornutum/tcases/blob/21e15cf107fa149620c40f4bda1829c1224fcfb1/tcases-lib/src/main/java/org/cornutum/tcases/conditions/Cnf.java#L328-L341 |
JOML-CI/JOML | src/org/joml/Matrix4x3d.java | Matrix4x3d.orthoSymmetric | public Matrix4x3d orthoSymmetric(double width, double height, double zNear, double zFar, boolean zZeroToOne) {
"""
Apply a symmetric orthographic projection transformation for a right-handed coordinate system
using the given NDC z range to this matrix.
<p>
This method is equivalent to calling {@link #ortho(doub... | java | public Matrix4x3d orthoSymmetric(double width, double height, double zNear, double zFar, boolean zZeroToOne) {
return orthoSymmetric(width, height, zNear, zFar, zZeroToOne, this);
} | [
"public",
"Matrix4x3d",
"orthoSymmetric",
"(",
"double",
"width",
",",
"double",
"height",
",",
"double",
"zNear",
",",
"double",
"zFar",
",",
"boolean",
"zZeroToOne",
")",
"{",
"return",
"orthoSymmetric",
"(",
"width",
",",
"height",
",",
"zNear",
",",
"zFa... | Apply a symmetric orthographic projection transformation for a right-handed coordinate system
using the given NDC z range to this matrix.
<p>
This method is equivalent to calling {@link #ortho(double, double, double, double, double, double, boolean) ortho()} with
<code>left=-width/2</code>, <code>right=+width/2</code>,... | [
"Apply",
"a",
"symmetric",
"orthographic",
"projection",
"transformation",
"for",
"a",
"right",
"-",
"handed",
"coordinate",
"system",
"using",
"the",
"given",
"NDC",
"z",
"range",
"to",
"this",
"matrix",
".",
"<p",
">",
"This",
"method",
"is",
"equivalent",
... | train | https://github.com/JOML-CI/JOML/blob/ce2652fc236b42bda3875c591f8e6645048a678f/src/org/joml/Matrix4x3d.java#L7163-L7165 |
b3dgs/lionengine | lionengine-game/src/main/java/com/b3dgs/lionengine/game/feature/tile/map/transition/MapTileTransitionModel.java | MapTileTransitionModel.getTransitionHorizontalVertical | private static TransitionType getTransitionHorizontalVertical(TransitionType a, TransitionType b, int ox, int oy) {
"""
Get the new transition type from two transitions on horizontal and vertical axis.
@param a The inner transition.
@param b The outer transition.
@param ox The horizontal offset to update.
@p... | java | private static TransitionType getTransitionHorizontalVertical(TransitionType a, TransitionType b, int ox, int oy)
{
final TransitionType type;
if (ox == -1 && oy == 0)
{
type = TransitionType.from(!b.getDownRight(), a.getDownLeft(), !b.getUpRight(), a.getUpLeft());
... | [
"private",
"static",
"TransitionType",
"getTransitionHorizontalVertical",
"(",
"TransitionType",
"a",
",",
"TransitionType",
"b",
",",
"int",
"ox",
",",
"int",
"oy",
")",
"{",
"final",
"TransitionType",
"type",
";",
"if",
"(",
"ox",
"==",
"-",
"1",
"&&",
"oy... | Get the new transition type from two transitions on horizontal and vertical axis.
@param a The inner transition.
@param b The outer transition.
@param ox The horizontal offset to update.
@param oy The vertical offset to update.
@return The new transition type, <code>null</code> if none. | [
"Get",
"the",
"new",
"transition",
"type",
"from",
"two",
"transitions",
"on",
"horizontal",
"and",
"vertical",
"axis",
"."
] | train | https://github.com/b3dgs/lionengine/blob/cac3d5578532cf11724a737b9f09e71bf9995ab2/lionengine-game/src/main/java/com/b3dgs/lionengine/game/feature/tile/map/transition/MapTileTransitionModel.java#L70-L94 |
samskivert/samskivert | src/main/java/com/samskivert/servlet/util/ParameterUtil.java | ParameterUtil.requireDateParameter | public static Date requireDateParameter (
HttpServletRequest req, String name, String invalidDataMessage)
throws DataValidationException {
"""
Fetches the supplied parameter from the request and converts it to a date. The value of the
parameter should be a date formatted like so: 2001-12-25. If th... | java | public static Date requireDateParameter (
HttpServletRequest req, String name, String invalidDataMessage)
throws DataValidationException
{
return parseDateParameter(getParameter(req, name, false), invalidDataMessage);
} | [
"public",
"static",
"Date",
"requireDateParameter",
"(",
"HttpServletRequest",
"req",
",",
"String",
"name",
",",
"String",
"invalidDataMessage",
")",
"throws",
"DataValidationException",
"{",
"return",
"parseDateParameter",
"(",
"getParameter",
"(",
"req",
",",
"name... | Fetches the supplied parameter from the request and converts it to a date. The value of the
parameter should be a date formatted like so: 2001-12-25. If the parameter does not exist or
is not a well-formed date, a data validation exception is thrown with the supplied message. | [
"Fetches",
"the",
"supplied",
"parameter",
"from",
"the",
"request",
"and",
"converts",
"it",
"to",
"a",
"date",
".",
"The",
"value",
"of",
"the",
"parameter",
"should",
"be",
"a",
"date",
"formatted",
"like",
"so",
":",
"2001",
"-",
"12",
"-",
"25",
"... | train | https://github.com/samskivert/samskivert/blob/a64d9ef42b69819bdb2c66bddac6a64caef928b6/src/main/java/com/samskivert/servlet/util/ParameterUtil.java#L237-L242 |
couchbase/couchbase-jvm-core | src/main/java/com/couchbase/client/core/endpoint/AbstractEndpoint.java | AbstractEndpoint.logIdent | protected static RedactableArgument logIdent(final Channel chan, final Endpoint endpoint) {
"""
Simple log helper to give logs a common prefix.
@param chan the address.
@param endpoint the endpoint.
@return a prefix string for logs.
"""
String addr = chan != null ? chan.remoteAddress().toString() ... | java | protected static RedactableArgument logIdent(final Channel chan, final Endpoint endpoint) {
String addr = chan != null ? chan.remoteAddress().toString() : endpoint.remoteAddress();
return system("[" + addr + "][" + endpoint.getClass().getSimpleName() + "]: ");
} | [
"protected",
"static",
"RedactableArgument",
"logIdent",
"(",
"final",
"Channel",
"chan",
",",
"final",
"Endpoint",
"endpoint",
")",
"{",
"String",
"addr",
"=",
"chan",
"!=",
"null",
"?",
"chan",
".",
"remoteAddress",
"(",
")",
".",
"toString",
"(",
")",
"... | Simple log helper to give logs a common prefix.
@param chan the address.
@param endpoint the endpoint.
@return a prefix string for logs. | [
"Simple",
"log",
"helper",
"to",
"give",
"logs",
"a",
"common",
"prefix",
"."
] | train | https://github.com/couchbase/couchbase-jvm-core/blob/97f0427112c2168fee1d6499904f5fa0e24c6797/src/main/java/com/couchbase/client/core/endpoint/AbstractEndpoint.java#L761-L764 |
fhoeben/hsac-fitnesse-fixtures | src/main/java/nl/hsac/fitnesse/fixture/util/FileUtil.java | FileUtil.saveToFile | public static String saveToFile(String baseName, String extension, byte[] content) {
"""
Saves byte[] to new file.
@param baseName name for file created (without extension),
if a file already exists with the supplied name an
'_index' will be added.
@param extension extension for file.
@param content data... | java | public static String saveToFile(String baseName, String extension, byte[] content) {
String result;
File output = determineFilename(baseName, extension);
FileOutputStream target = null;
try {
target = new FileOutputStream(output);
target.write(content);
... | [
"public",
"static",
"String",
"saveToFile",
"(",
"String",
"baseName",
",",
"String",
"extension",
",",
"byte",
"[",
"]",
"content",
")",
"{",
"String",
"result",
";",
"File",
"output",
"=",
"determineFilename",
"(",
"baseName",
",",
"extension",
")",
";",
... | Saves byte[] to new file.
@param baseName name for file created (without extension),
if a file already exists with the supplied name an
'_index' will be added.
@param extension extension for file.
@param content data to store in file.
@return absolute path of created file. | [
"Saves",
"byte",
"[]",
"to",
"new",
"file",
"."
] | train | https://github.com/fhoeben/hsac-fitnesse-fixtures/blob/4e9018d7386a9aa65bfcbf07eb28ae064edd1732/src/main/java/nl/hsac/fitnesse/fixture/util/FileUtil.java#L223-L243 |
TheHortonMachine/hortonmachine | gears/src/main/java/org/hortonmachine/gears/utils/style/SymbolizerWrapper.java | SymbolizerWrapper.setFillExternalGraphicFillPath | public void setFillExternalGraphicFillPath( String externalGraphicPath, double size ) throws MalformedURLException {
"""
Set the fill's {@link ExternalGraphic} path.
<p>Currently one {@link ExternalGraphic} per {@link Symbolizer} is supported.
<p>This is used for polygons.
@param externalGraphicPath the p... | java | public void setFillExternalGraphicFillPath( String externalGraphicPath, double size ) throws MalformedURLException {
Graphic graphic = null;
PolygonSymbolizerWrapper polygonSymbolizerWrapper = adapt(PolygonSymbolizerWrapper.class);
if (polygonSymbolizerWrapper != null) {
graphic = po... | [
"public",
"void",
"setFillExternalGraphicFillPath",
"(",
"String",
"externalGraphicPath",
",",
"double",
"size",
")",
"throws",
"MalformedURLException",
"{",
"Graphic",
"graphic",
"=",
"null",
";",
"PolygonSymbolizerWrapper",
"polygonSymbolizerWrapper",
"=",
"adapt",
"(",... | Set the fill's {@link ExternalGraphic} path.
<p>Currently one {@link ExternalGraphic} per {@link Symbolizer} is supported.
<p>This is used for polygons.
@param externalGraphicPath the path to set.
@throws MalformedURLException | [
"Set",
"the",
"fill",
"s",
"{",
"@link",
"ExternalGraphic",
"}",
"path",
"."
] | train | https://github.com/TheHortonMachine/hortonmachine/blob/d2b436bbdf951dc1fda56096a42dbc0eae4d35a5/gears/src/main/java/org/hortonmachine/gears/utils/style/SymbolizerWrapper.java#L289-L315 |
lucee/Lucee | core/src/main/java/lucee/transformer/bytecode/util/ASMUtil.java | ASMUtil.toType | public static Type toType(Class type, boolean axistype) throws PageException {
"""
translate a string cfml type definition to a Type Object
@param cfType
@param axistype
@return
@throws PageException
"""
if (axistype) type = ((ConfigImpl) ThreadLocalPageContext.getConfig()).getWSHandler().toWSTypeClass(... | java | public static Type toType(Class type, boolean axistype) throws PageException {
if (axistype) type = ((ConfigImpl) ThreadLocalPageContext.getConfig()).getWSHandler().toWSTypeClass(type);
return Type.getType(type);
} | [
"public",
"static",
"Type",
"toType",
"(",
"Class",
"type",
",",
"boolean",
"axistype",
")",
"throws",
"PageException",
"{",
"if",
"(",
"axistype",
")",
"type",
"=",
"(",
"(",
"ConfigImpl",
")",
"ThreadLocalPageContext",
".",
"getConfig",
"(",
")",
")",
".... | translate a string cfml type definition to a Type Object
@param cfType
@param axistype
@return
@throws PageException | [
"translate",
"a",
"string",
"cfml",
"type",
"definition",
"to",
"a",
"Type",
"Object"
] | train | https://github.com/lucee/Lucee/blob/29b153fc4e126e5edb97da937f2ee2e231b87593/core/src/main/java/lucee/transformer/bytecode/util/ASMUtil.java#L658-L661 |
lessthanoptimal/BoofCV | main/boofcv-geo/src/main/java/boofcv/alg/geo/trifocal/TrifocalExtractGeometries.java | TrifocalExtractGeometries.extractCamera | public void extractCamera( DMatrixRMaj P2 , DMatrixRMaj P3 ) {
"""
<p>
Extract the camera matrices up to a common projective transform.
</p>
<p>P2 = [[T1.T2.T3]e3|e2] and P3=[(e3*e2<sup>T</sup>-I)[T1',T2',T3'|e2|e3]</p>
<p>
NOTE: The camera matrix for the first view is assumed to be P1 = [I|0].
</p>
@... | java | public void extractCamera( DMatrixRMaj P2 , DMatrixRMaj P3 ) {
// temp1 = [e3*e3^T -I]
for( int i = 0; i < 3; i++ ) {
for( int j = 0; j < 3; j++ ) {
temp1.set(i,j,e3.getIdx(i)*e3.getIdx(j));
}
temp1.set(i,i , temp1.get(i,i) - 1);
}
// compute the camera matrices one column at a time
for( int i =... | [
"public",
"void",
"extractCamera",
"(",
"DMatrixRMaj",
"P2",
",",
"DMatrixRMaj",
"P3",
")",
"{",
"// temp1 = [e3*e3^T -I]",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
"<",
"3",
";",
"i",
"++",
")",
"{",
"for",
"(",
"int",
"j",
"=",
"0",
";",
"j",
... | <p>
Extract the camera matrices up to a common projective transform.
</p>
<p>P2 = [[T1.T2.T3]e3|e2] and P3=[(e3*e2<sup>T</sup>-I)[T1',T2',T3'|e2|e3]</p>
<p>
NOTE: The camera matrix for the first view is assumed to be P1 = [I|0].
</p>
@param P2 Output: 3x4 camera matrix for views 2. Modified.
@param P3 Output: 3x4 ca... | [
"<p",
">",
"Extract",
"the",
"camera",
"matrices",
"up",
"to",
"a",
"common",
"projective",
"transform",
".",
"<",
"/",
"p",
">"
] | train | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-geo/src/main/java/boofcv/alg/geo/trifocal/TrifocalExtractGeometries.java#L163-L190 |
looly/hutool | hutool-core/src/main/java/cn/hutool/core/date/format/FastDateFormat.java | FastDateFormat.getDateInstance | public static FastDateFormat getDateInstance(final int style, final TimeZone timeZone) {
"""
获得 {@link FastDateFormat} 实例<br>
支持缓存
@param style date style: FULL, LONG, MEDIUM, or SHORT
@param timeZone 时区{@link TimeZone}
@return 本地化 {@link FastDateFormat}
"""
return cache.getDateInstance(style, timeZone... | java | public static FastDateFormat getDateInstance(final int style, final TimeZone timeZone) {
return cache.getDateInstance(style, timeZone, null);
} | [
"public",
"static",
"FastDateFormat",
"getDateInstance",
"(",
"final",
"int",
"style",
",",
"final",
"TimeZone",
"timeZone",
")",
"{",
"return",
"cache",
".",
"getDateInstance",
"(",
"style",
",",
"timeZone",
",",
"null",
")",
";",
"}"
] | 获得 {@link FastDateFormat} 实例<br>
支持缓存
@param style date style: FULL, LONG, MEDIUM, or SHORT
@param timeZone 时区{@link TimeZone}
@return 本地化 {@link FastDateFormat} | [
"获得",
"{",
"@link",
"FastDateFormat",
"}",
"实例<br",
">",
"支持缓存"
] | train | https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-core/src/main/java/cn/hutool/core/date/format/FastDateFormat.java#L145-L147 |
tvesalainen/bcc | src/main/java/org/vesalainen/bcc/MethodCompiler.java | MethodCompiler.addExceptionHandler | public void addExceptionHandler(Block block, String handler, Class<? extends Throwable>... catchTypes) {
"""
Adds an exception handler. If one of catchTypes is thrown inside block the
execution continues at handler address. Thrown object is pushed in stack.
@param block
@param handler
@param catchTypes Throw... | java | public void addExceptionHandler(Block block, String handler, Class<? extends Throwable>... catchTypes)
{
Label label = getLabel(handler);
if (catchTypes.length > 0)
{
for (Class<? extends Throwable> catchType : catchTypes)
{
exceptionTableList.a... | [
"public",
"void",
"addExceptionHandler",
"(",
"Block",
"block",
",",
"String",
"handler",
",",
"Class",
"<",
"?",
"extends",
"Throwable",
">",
"...",
"catchTypes",
")",
"{",
"Label",
"label",
"=",
"getLabel",
"(",
"handler",
")",
";",
"if",
"(",
"catchType... | Adds an exception handler. If one of catchTypes is thrown inside block the
execution continues at handler address. Thrown object is pushed in stack.
@param block
@param handler
@param catchTypes Throwable objects which are caught. If none is present then
all throwables are caught. Note! This is not the same as finally... | [
"Adds",
"an",
"exception",
"handler",
".",
"If",
"one",
"of",
"catchTypes",
"is",
"thrown",
"inside",
"block",
"the",
"execution",
"continues",
"at",
"handler",
"address",
".",
"Thrown",
"object",
"is",
"pushed",
"in",
"stack",
"."
] | train | https://github.com/tvesalainen/bcc/blob/4e84e313018d487f1a8cca3952d71bc21e77d16b/src/main/java/org/vesalainen/bcc/MethodCompiler.java#L1644-L1658 |
apache/incubator-atlas | webapp/src/main/java/org/apache/atlas/web/resources/EntityResource.java | EntityResource.updateEntityByGuid | @POST
@Path(" {
"""
Updates entity identified by its GUID
Support Partial update of an entity - Adds/updates any new values specified
Does not support removal of attribute values
@param guid
@param request The updated entity json
@return
"""guid}")
@Consumes({Servlets.JSON_MEDIA_TYPE, MediaType.... | java | @POST
@Path("{guid}")
@Consumes({Servlets.JSON_MEDIA_TYPE, MediaType.APPLICATION_JSON})
@Produces(Servlets.JSON_MEDIA_TYPE)
public Response updateEntityByGuid(@PathParam("guid") String guid, @QueryParam("property") String attribute,
@Context HttpServletRequest requ... | [
"@",
"POST",
"@",
"Path",
"(",
"\"{guid}\"",
")",
"@",
"Consumes",
"(",
"{",
"Servlets",
".",
"JSON_MEDIA_TYPE",
",",
"MediaType",
".",
"APPLICATION_JSON",
"}",
")",
"@",
"Produces",
"(",
"Servlets",
".",
"JSON_MEDIA_TYPE",
")",
"public",
"Response",
"update... | Updates entity identified by its GUID
Support Partial update of an entity - Adds/updates any new values specified
Does not support removal of attribute values
@param guid
@param request The updated entity json
@return | [
"Updates",
"entity",
"identified",
"by",
"its",
"GUID",
"Support",
"Partial",
"update",
"of",
"an",
"entity",
"-",
"Adds",
"/",
"updates",
"any",
"new",
"values",
"specified",
"Does",
"not",
"support",
"removal",
"of",
"attribute",
"values"
] | train | https://github.com/apache/incubator-atlas/blob/e0d2cdc27c32742ebecd24db4cca62dc04dcdf4b/webapp/src/main/java/org/apache/atlas/web/resources/EntityResource.java#L437-L465 |
powermock/powermock | powermock-api/powermock-api-easymock/src/main/java/org/powermock/api/easymock/PowerMock.java | PowerMock.createStrictPartialMock | public static <T> T createStrictPartialMock(Class<T> type, String methodName, Class<?>[] methodParameterTypes,
Object[] constructorArguments, Class<?>[] constructorParameterTypes) {
"""
A utility method that may be used to strictly mock several methods in an
easy wa... | java | public static <T> T createStrictPartialMock(Class<T> type, String methodName, Class<?>[] methodParameterTypes,
Object[] constructorArguments, Class<?>[] constructorParameterTypes) {
ConstructorArgs constructorArgs = new ConstructorArgs(Whitebox.getConstructor(type... | [
"public",
"static",
"<",
"T",
">",
"T",
"createStrictPartialMock",
"(",
"Class",
"<",
"T",
">",
"type",
",",
"String",
"methodName",
",",
"Class",
"<",
"?",
">",
"[",
"]",
"methodParameterTypes",
",",
"Object",
"[",
"]",
"constructorArguments",
",",
"Class... | A utility method that may be used to strictly mock several methods in an
easy way (by just passing in the method names of the method you wish to
mock). Use this to handle overloaded methods <i>and</i> overloaded
constructors. The mock object created will support mocking of final and
native methods and invokes a specifi... | [
"A",
"utility",
"method",
"that",
"may",
"be",
"used",
"to",
"strictly",
"mock",
"several",
"methods",
"in",
"an",
"easy",
"way",
"(",
"by",
"just",
"passing",
"in",
"the",
"method",
"names",
"of",
"the",
"method",
"you",
"wish",
"to",
"mock",
")",
"."... | train | https://github.com/powermock/powermock/blob/e8cd68026c284c6a7efe66959809eeebd8d1f9ad/powermock-api/powermock-api-easymock/src/main/java/org/powermock/api/easymock/PowerMock.java#L1096-L1102 |
jronrun/benayn | benayn-ustyle/src/main/java/com/benayn/ustyle/thirdparty/UriEscaper.java | UriEscaper.escapeFragment | public static String escapeFragment(final String fragment, final boolean strict) {
"""
Escapes a string as a URI query
@param fragment the path to escape
@param strict whether or not to do strict escaping
@return the escaped string
"""
return (strict ? STRICT_ESCAPER : ESCAPER).escapeFragment(frag... | java | public static String escapeFragment(final String fragment, final boolean strict) {
return (strict ? STRICT_ESCAPER : ESCAPER).escapeFragment(fragment);
} | [
"public",
"static",
"String",
"escapeFragment",
"(",
"final",
"String",
"fragment",
",",
"final",
"boolean",
"strict",
")",
"{",
"return",
"(",
"strict",
"?",
"STRICT_ESCAPER",
":",
"ESCAPER",
")",
".",
"escapeFragment",
"(",
"fragment",
")",
";",
"}"
] | Escapes a string as a URI query
@param fragment the path to escape
@param strict whether or not to do strict escaping
@return the escaped string | [
"Escapes",
"a",
"string",
"as",
"a",
"URI",
"query"
] | train | https://github.com/jronrun/benayn/blob/7585152e10e4cac07b4274c65f1c72ad7061ae69/benayn-ustyle/src/main/java/com/benayn/ustyle/thirdparty/UriEscaper.java#L271-L273 |
FINRAOS/DataGenerator | dg-core/src/main/java/org/finra/datagenerator/engine/scxml/tags/boundary/BoundaryDate.java | BoundaryDate.getRandomHoliday | public String getRandomHoliday(String earliest, String latest) {
"""
Grab random holiday from the equivalence class that falls between the two dates
@param earliest the earliest date parameter as defined in the model
@param latest the latest date parameter as defined in the model
@return a holiday that fall... | java | public String getRandomHoliday(String earliest, String latest) {
String dateString = "";
DateTimeFormatter parser = ISODateTimeFormat.date();
DateTime earlyDate = parser.parseDateTime(earliest);
DateTime lateDate = parser.parseDateTime(latest);
List<Holiday> holidays = new Linked... | [
"public",
"String",
"getRandomHoliday",
"(",
"String",
"earliest",
",",
"String",
"latest",
")",
"{",
"String",
"dateString",
"=",
"\"\"",
";",
"DateTimeFormatter",
"parser",
"=",
"ISODateTimeFormat",
".",
"date",
"(",
")",
";",
"DateTime",
"earlyDate",
"=",
"... | Grab random holiday from the equivalence class that falls between the two dates
@param earliest the earliest date parameter as defined in the model
@param latest the latest date parameter as defined in the model
@return a holiday that falls between the dates | [
"Grab",
"random",
"holiday",
"from",
"the",
"equivalence",
"class",
"that",
"falls",
"between",
"the",
"two",
"dates"
] | train | https://github.com/FINRAOS/DataGenerator/blob/1f69f949401cbed4db4f553c3eb8350832c4d45a/dg-core/src/main/java/org/finra/datagenerator/engine/scxml/tags/boundary/BoundaryDate.java#L230-L254 |
phax/ph-commons | ph-commons/src/main/java/com/helger/commons/datetime/PDTFormatter.java | PDTFormatter.getForPattern | @Nonnull
public static DateTimeFormatter getForPattern (@Nonnull final String sPattern, @Nullable final Locale aDisplayLocale) {
"""
Get the STRICT {@link DateTimeFormatter} for the given pattern and locale,
using our default chronology.
@param sPattern
The pattern to be parsed
@param aDisplayLocale
The l... | java | @Nonnull
public static DateTimeFormatter getForPattern (@Nonnull final String sPattern, @Nullable final Locale aDisplayLocale)
{
final DateTimeFormatter aDTF = DateTimeFormatterCache.getDateTimeFormatterStrict (sPattern);
return getWithLocale (aDTF, aDisplayLocale);
} | [
"@",
"Nonnull",
"public",
"static",
"DateTimeFormatter",
"getForPattern",
"(",
"@",
"Nonnull",
"final",
"String",
"sPattern",
",",
"@",
"Nullable",
"final",
"Locale",
"aDisplayLocale",
")",
"{",
"final",
"DateTimeFormatter",
"aDTF",
"=",
"DateTimeFormatterCache",
".... | Get the STRICT {@link DateTimeFormatter} for the given pattern and locale,
using our default chronology.
@param sPattern
The pattern to be parsed
@param aDisplayLocale
The locale to be used. May be <code>null</code>.
@return The formatter object.
@throws IllegalArgumentException
If the pattern is illegal | [
"Get",
"the",
"STRICT",
"{",
"@link",
"DateTimeFormatter",
"}",
"for",
"the",
"given",
"pattern",
"and",
"locale",
"using",
"our",
"default",
"chronology",
"."
] | train | https://github.com/phax/ph-commons/blob/d28c03565f44a0b804d96028d0969f9bb38c4313/ph-commons/src/main/java/com/helger/commons/datetime/PDTFormatter.java#L333-L338 |
biojava/biojava | biojava-structure/src/main/java/org/biojava/nbio/structure/io/PDBFileParser.java | PDBFileParser.formBonds | private void formBonds() {
"""
Handles creation of all bonds. Looks at LINK records, SSBOND (Disulfide
bonds), peptide bonds, and intra-residue bonds.
<p>
Note: the current implementation only looks at the first model of each
structure. This may need to be fixed in the future.
"""
BondMaker maker = new ... | java | private void formBonds() {
BondMaker maker = new BondMaker(structure, params);
// LINK records should be preserved, they are the way that
// inter-residue bonds are created for ligands such as trisaccharides, unusual polymers.
// The analogy in mmCIF is the _struct_conn record.
for (LinkRecord linkRecord : ... | [
"private",
"void",
"formBonds",
"(",
")",
"{",
"BondMaker",
"maker",
"=",
"new",
"BondMaker",
"(",
"structure",
",",
"params",
")",
";",
"// LINK records should be preserved, they are the way that",
"// inter-residue bonds are created for ligands such as trisaccharides, unusual p... | Handles creation of all bonds. Looks at LINK records, SSBOND (Disulfide
bonds), peptide bonds, and intra-residue bonds.
<p>
Note: the current implementation only looks at the first model of each
structure. This may need to be fixed in the future. | [
"Handles",
"creation",
"of",
"all",
"bonds",
".",
"Looks",
"at",
"LINK",
"records",
"SSBOND",
"(",
"Disulfide",
"bonds",
")",
"peptide",
"bonds",
"and",
"intra",
"-",
"residue",
"bonds",
".",
"<p",
">",
"Note",
":",
"the",
"current",
"implementation",
"onl... | train | https://github.com/biojava/biojava/blob/a1c71a8e3d40cc32104b1d387a3d3b560b43356e/biojava-structure/src/main/java/org/biojava/nbio/structure/io/PDBFileParser.java#L2767-L2781 |
opentable/otj-jaxrs | client/src/main/java/com/opentable/jaxrs/JaxRsClientFactory.java | JaxRsClientFactory.addFeatureMap | public synchronized JaxRsClientFactory addFeatureMap(Map<JaxRsFeatureGroup, Set<Feature>> map) {
"""
Register many features at once. Mostly a convenience for DI environments.
"""
map.forEach((g, fs) -> fs.forEach(f -> addFeatureToGroup(g, f)));
return this;
} | java | public synchronized JaxRsClientFactory addFeatureMap(Map<JaxRsFeatureGroup, Set<Feature>> map) {
map.forEach((g, fs) -> fs.forEach(f -> addFeatureToGroup(g, f)));
return this;
} | [
"public",
"synchronized",
"JaxRsClientFactory",
"addFeatureMap",
"(",
"Map",
"<",
"JaxRsFeatureGroup",
",",
"Set",
"<",
"Feature",
">",
">",
"map",
")",
"{",
"map",
".",
"forEach",
"(",
"(",
"g",
",",
"fs",
")",
"->",
"fs",
".",
"forEach",
"(",
"f",
"-... | Register many features at once. Mostly a convenience for DI environments. | [
"Register",
"many",
"features",
"at",
"once",
".",
"Mostly",
"a",
"convenience",
"for",
"DI",
"environments",
"."
] | train | https://github.com/opentable/otj-jaxrs/blob/384e7094fe5a56d41b2a9970bfd783fa85cbbcb8/client/src/main/java/com/opentable/jaxrs/JaxRsClientFactory.java#L115-L118 |
ArcBees/gwtquery | gwtquery-core/src/main/java/com/google/gwt/query/client/plugins/effects/Transform.java | Transform.setFromString | public void setFromString(String prop, String ...val) {
"""
Set a transform multi-value giving either a set of strings or
just an string of values separated by comma.
"""
if (val.length == 1) {
String[] vals = val[0].split("[\\s,]+");
set(prop, vals);
} else {
set(prop, val);
}
... | java | public void setFromString(String prop, String ...val) {
if (val.length == 1) {
String[] vals = val[0].split("[\\s,]+");
set(prop, vals);
} else {
set(prop, val);
}
} | [
"public",
"void",
"setFromString",
"(",
"String",
"prop",
",",
"String",
"...",
"val",
")",
"{",
"if",
"(",
"val",
".",
"length",
"==",
"1",
")",
"{",
"String",
"[",
"]",
"vals",
"=",
"val",
"[",
"0",
"]",
".",
"split",
"(",
"\"[\\\\s,]+\"",
")",
... | Set a transform multi-value giving either a set of strings or
just an string of values separated by comma. | [
"Set",
"a",
"transform",
"multi",
"-",
"value",
"giving",
"either",
"a",
"set",
"of",
"strings",
"or",
"just",
"an",
"string",
"of",
"values",
"separated",
"by",
"comma",
"."
] | train | https://github.com/ArcBees/gwtquery/blob/93e02bc8eb030081061c56134ebee1f585981107/gwtquery-core/src/main/java/com/google/gwt/query/client/plugins/effects/Transform.java#L182-L189 |
UrielCh/ovh-java-sdk | ovh-java-sdk-telephony/src/main/java/net/minidev/ovh/api/ApiOvhTelephony.java | ApiOvhTelephony.billingAccount_screen_serviceName_screenLists_POST | public void billingAccount_screen_serviceName_screenLists_POST(String billingAccount, String serviceName, String callNumber, OvhScreenListNatureEnum nature, OvhScreenListTypeEnum type) throws IOException {
"""
Create a new screen list rule
REST: POST /telephony/{billingAccount}/screen/{serviceName}/screenLists
... | java | public void billingAccount_screen_serviceName_screenLists_POST(String billingAccount, String serviceName, String callNumber, OvhScreenListNatureEnum nature, OvhScreenListTypeEnum type) throws IOException {
String qPath = "/telephony/{billingAccount}/screen/{serviceName}/screenLists";
StringBuilder sb = path(qPath, ... | [
"public",
"void",
"billingAccount_screen_serviceName_screenLists_POST",
"(",
"String",
"billingAccount",
",",
"String",
"serviceName",
",",
"String",
"callNumber",
",",
"OvhScreenListNatureEnum",
"nature",
",",
"OvhScreenListTypeEnum",
"type",
")",
"throws",
"IOException",
... | Create a new screen list rule
REST: POST /telephony/{billingAccount}/screen/{serviceName}/screenLists
@param type [required] The type of the generic screen list
@param nature [required] The nature of the generic screen list
@param callNumber [required] The callNumber of the generic screen list
@param billingAccount [r... | [
"Create",
"a",
"new",
"screen",
"list",
"rule"
] | train | https://github.com/UrielCh/ovh-java-sdk/blob/6d531a40e56e09701943e334c25f90f640c55701/ovh-java-sdk-telephony/src/main/java/net/minidev/ovh/api/ApiOvhTelephony.java#L5431-L5439 |
livetribe/livetribe-slp | core/src/main/java/org/livetribe/slp/da/StandardDirectoryAgentServer.java | StandardDirectoryAgentServer.uncacheService | protected ServiceInfoCache.Result<ServiceInfo> uncacheService(ServiceInfo service, boolean update) {
"""
Removes or updates a previously cached service (if any) with the given service.
@param service the new service
@param update whether the given service removes or updates a previously cached service
@retur... | java | protected ServiceInfoCache.Result<ServiceInfo> uncacheService(ServiceInfo service, boolean update)
{
// RFC 2608, 7.0
if (!scopes.match(service.getScopes()))
{
if (logger.isLoggable(Level.FINE))
logger.fine("Could not deregister service " + service + ", DirectoryA... | [
"protected",
"ServiceInfoCache",
".",
"Result",
"<",
"ServiceInfo",
">",
"uncacheService",
"(",
"ServiceInfo",
"service",
",",
"boolean",
"update",
")",
"{",
"// RFC 2608, 7.0",
"if",
"(",
"!",
"scopes",
".",
"match",
"(",
"service",
".",
"getScopes",
"(",
")"... | Removes or updates a previously cached service (if any) with the given service.
@param service the new service
@param update whether the given service removes or updates a previously cached service
@return a structure containing the previous service and the current service (if any) | [
"Removes",
"or",
"updates",
"a",
"previously",
"cached",
"service",
"(",
"if",
"any",
")",
"with",
"the",
"given",
"service",
"."
] | train | https://github.com/livetribe/livetribe-slp/blob/6cc13dbe81feab133fe3dd291ca081cbc6e1f591/core/src/main/java/org/livetribe/slp/da/StandardDirectoryAgentServer.java#L799-L823 |
camunda/camunda-bpm-platform | engine/src/main/java/org/camunda/bpm/engine/impl/bpmn/diagram/ProcessDiagramLayoutFactory.java | ProcessDiagramLayoutFactory.getBpmnProcessDiagramLayout | public DiagramLayout getBpmnProcessDiagramLayout(Document bpmnModel, InputStream imageStream) {
"""
Provides positions and dimensions of elements in a BPMN process diagram as
provided by {@link RepositoryService#getProcessDiagram(String)}.
@param bpmnModel
BPMN 2.0 XML document
@param imageStream
BPMN 2.0 d... | java | public DiagramLayout getBpmnProcessDiagramLayout(Document bpmnModel, InputStream imageStream) {
if (imageStream == null) {
return null;
}
DiagramNode diagramBoundsXml = getDiagramBoundsFromBpmnDi(bpmnModel);
DiagramNode diagramBoundsImage;
if (isExportedFromAdonis50(bpmnModel)) {
int off... | [
"public",
"DiagramLayout",
"getBpmnProcessDiagramLayout",
"(",
"Document",
"bpmnModel",
",",
"InputStream",
"imageStream",
")",
"{",
"if",
"(",
"imageStream",
"==",
"null",
")",
"{",
"return",
"null",
";",
"}",
"DiagramNode",
"diagramBoundsXml",
"=",
"getDiagramBoun... | Provides positions and dimensions of elements in a BPMN process diagram as
provided by {@link RepositoryService#getProcessDiagram(String)}.
@param bpmnModel
BPMN 2.0 XML document
@param imageStream
BPMN 2.0 diagram in PNG format (JPEG and other formats supported
by {@link ImageIO} may also work)
@return Layout of the ... | [
"Provides",
"positions",
"and",
"dimensions",
"of",
"elements",
"in",
"a",
"BPMN",
"process",
"diagram",
"as",
"provided",
"by",
"{",
"@link",
"RepositoryService#getProcessDiagram",
"(",
"String",
")",
"}",
"."
] | train | https://github.com/camunda/camunda-bpm-platform/blob/1a464fc887ef3760e53d6f91b9e5b871a0d77cc0/engine/src/main/java/org/camunda/bpm/engine/impl/bpmn/diagram/ProcessDiagramLayoutFactory.java#L95-L116 |
cdk/cdk | display/renderbasic/src/main/java/org/openscience/cdk/renderer/generators/BasicAtomGenerator.java | BasicAtomGenerator.generateElement | public AtomSymbolElement generateElement(IAtom atom, int alignment, RendererModel model) {
"""
Generate an atom symbol element.
@param atom the atom to use
@param alignment the alignment of the atom's label
@param model the renderer model
@return an atom symbol element
"""
String text;
if... | java | public AtomSymbolElement generateElement(IAtom atom, int alignment, RendererModel model) {
String text;
if (atom instanceof IPseudoAtom) {
text = ((IPseudoAtom) atom).getLabel();
} else {
text = atom.getSymbol();
}
return new AtomSymbolElement(atom.getPoin... | [
"public",
"AtomSymbolElement",
"generateElement",
"(",
"IAtom",
"atom",
",",
"int",
"alignment",
",",
"RendererModel",
"model",
")",
"{",
"String",
"text",
";",
"if",
"(",
"atom",
"instanceof",
"IPseudoAtom",
")",
"{",
"text",
"=",
"(",
"(",
"IPseudoAtom",
"... | Generate an atom symbol element.
@param atom the atom to use
@param alignment the alignment of the atom's label
@param model the renderer model
@return an atom symbol element | [
"Generate",
"an",
"atom",
"symbol",
"element",
"."
] | train | https://github.com/cdk/cdk/blob/c3d0f16502bf08df50365fee392e11d7c9856657/display/renderbasic/src/main/java/org/openscience/cdk/renderer/generators/BasicAtomGenerator.java#L361-L370 |
OpenLiberty/open-liberty | dev/com.ibm.ws.messaging.comms.client/src/com/ibm/ws/sib/comms/common/CommsLightTrace.java | CommsLightTrace.traceException | public static void traceException(TraceComponent callersTrace, Throwable ex) {
"""
Trace an exception.
@param callersTrace The trace component of the caller
@param ex The exception
"""
if (light_tc.isDebugEnabled() || callersTrace.isDebugEnabled()) {
// Find XA completion code if one exists, as ... | java | public static void traceException(TraceComponent callersTrace, Throwable ex)
{
if (light_tc.isDebugEnabled() || callersTrace.isDebugEnabled()) {
// Find XA completion code if one exists, as this isn't in a normal dump
String xaErrStr = null;
if (ex instanceof XAException) {
XAExce... | [
"public",
"static",
"void",
"traceException",
"(",
"TraceComponent",
"callersTrace",
",",
"Throwable",
"ex",
")",
"{",
"if",
"(",
"light_tc",
".",
"isDebugEnabled",
"(",
")",
"||",
"callersTrace",
".",
"isDebugEnabled",
"(",
")",
")",
"{",
"// Find XA completion... | Trace an exception.
@param callersTrace The trace component of the caller
@param ex The exception | [
"Trace",
"an",
"exception",
"."
] | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.messaging.comms.client/src/com/ibm/ws/sib/comms/common/CommsLightTrace.java#L157-L178 |
jferard/fastods | fastods/src/main/java/com/github/jferard/fastods/util/Container.java | Container.add | public boolean add(final K key, final V value) {
"""
If mode is update, then the key must exist. If the mode is create, then the key must not exist.
Otherwise, the key may exist. If the container is frozen, no new key-value pair is accepted.
@param key the key
@param value the value
@return true if the value... | java | public boolean add(final K key, final V value) {
final V curValue = this.valueByKey.get(key);
if (curValue == null) { // key does not exist
if (this.mode == Mode.UPDATE)
return false;
} else { // key exists
if (this.mode == Mode.CREATE)
return false;
}
if (this.closed && !this.valueByKey.conta... | [
"public",
"boolean",
"add",
"(",
"final",
"K",
"key",
",",
"final",
"V",
"value",
")",
"{",
"final",
"V",
"curValue",
"=",
"this",
".",
"valueByKey",
".",
"get",
"(",
"key",
")",
";",
"if",
"(",
"curValue",
"==",
"null",
")",
"{",
"// key does not ex... | If mode is update, then the key must exist. If the mode is create, then the key must not exist.
Otherwise, the key may exist. If the container is frozen, no new key-value pair is accepted.
@param key the key
@param value the value
@return true if the value was updated | [
"If",
"mode",
"is",
"update",
"then",
"the",
"key",
"must",
"exist",
".",
"If",
"the",
"mode",
"is",
"create",
"then",
"the",
"key",
"must",
"not",
"exist",
".",
"Otherwise",
"the",
"key",
"may",
"exist",
".",
"If",
"the",
"container",
"is",
"frozen",
... | train | https://github.com/jferard/fastods/blob/a034d173083ffa602dc525699b97f753082eaef9/fastods/src/main/java/com/github/jferard/fastods/util/Container.java#L71-L92 |
UrielCh/ovh-java-sdk | ovh-java-sdk-me/src/main/java/net/minidev/ovh/api/ApiOvhMe.java | ApiOvhMe.debtAccount_debt_debtId_pay_POST | public OvhOrder debtAccount_debt_debtId_pay_POST(Long debtId) throws IOException {
"""
Create an order in order to pay this order's debt
REST: POST /me/debtAccount/debt/{debtId}/pay
@param debtId [required]
"""
String qPath = "/me/debtAccount/debt/{debtId}/pay";
StringBuilder sb = path(qPath, debtId);
... | java | public OvhOrder debtAccount_debt_debtId_pay_POST(Long debtId) throws IOException {
String qPath = "/me/debtAccount/debt/{debtId}/pay";
StringBuilder sb = path(qPath, debtId);
String resp = exec(qPath, "POST", sb.toString(), null);
return convertTo(resp, OvhOrder.class);
} | [
"public",
"OvhOrder",
"debtAccount_debt_debtId_pay_POST",
"(",
"Long",
"debtId",
")",
"throws",
"IOException",
"{",
"String",
"qPath",
"=",
"\"/me/debtAccount/debt/{debtId}/pay\"",
";",
"StringBuilder",
"sb",
"=",
"path",
"(",
"qPath",
",",
"debtId",
")",
";",
"Stri... | Create an order in order to pay this order's debt
REST: POST /me/debtAccount/debt/{debtId}/pay
@param debtId [required] | [
"Create",
"an",
"order",
"in",
"order",
"to",
"pay",
"this",
"order",
"s",
"debt"
] | train | https://github.com/UrielCh/ovh-java-sdk/blob/6d531a40e56e09701943e334c25f90f640c55701/ovh-java-sdk-me/src/main/java/net/minidev/ovh/api/ApiOvhMe.java#L2689-L2694 |
graknlabs/grakn | server/src/server/kb/structure/AbstractElement.java | AbstractElement.propertyUnique | public void propertyUnique(P key, String value) {
"""
Sets the value of a property with the added restriction that no other vertex can have that property.
@param key The key of the unique property to mutate
@param value The new value of the unique property
"""
GraphTraversal<Vertex, Vertex> trave... | java | public void propertyUnique(P key, String value) {
GraphTraversal<Vertex, Vertex> traversal = tx().getTinkerTraversal().V().has(key.name(), value);
if (traversal.hasNext()) {
Vertex vertex = traversal.next();
if (!vertex.equals(element()) || traversal.hasNext()) {
... | [
"public",
"void",
"propertyUnique",
"(",
"P",
"key",
",",
"String",
"value",
")",
"{",
"GraphTraversal",
"<",
"Vertex",
",",
"Vertex",
">",
"traversal",
"=",
"tx",
"(",
")",
".",
"getTinkerTraversal",
"(",
")",
".",
"V",
"(",
")",
".",
"has",
"(",
"k... | Sets the value of a property with the added restriction that no other vertex can have that property.
@param key The key of the unique property to mutate
@param value The new value of the unique property | [
"Sets",
"the",
"value",
"of",
"a",
"property",
"with",
"the",
"added",
"restriction",
"that",
"no",
"other",
"vertex",
"can",
"have",
"that",
"property",
"."
] | train | https://github.com/graknlabs/grakn/blob/6aaee75ea846202474d591f8809d62028262fac5/server/src/server/kb/structure/AbstractElement.java#L131-L143 |
salesforce/Argus | ArgusCore/src/main/java/com/salesforce/dva/argus/service/jpa/DefaultJPAService.java | DefaultJPAService.findEntity | protected <E extends Identifiable> E findEntity(EntityManager em, BigInteger id, Class<E> type) {
"""
Locates an entity based on it's primary key value.
@param <E> The type of the entity.
@param em The entity manager to use. Cannot be null.
@param id The primary key of the entity. Cannot be null... | java | protected <E extends Identifiable> E findEntity(EntityManager em, BigInteger id, Class<E> type) {
requireArgument(em != null, "The entity manager cannot be null.");
requireArgument(id != null && id.compareTo(ZERO) > 0, "ID must be positive and non-zero");
requireArgument(type != null, "The entity cannot be null."... | [
"protected",
"<",
"E",
"extends",
"Identifiable",
">",
"E",
"findEntity",
"(",
"EntityManager",
"em",
",",
"BigInteger",
"id",
",",
"Class",
"<",
"E",
">",
"type",
")",
"{",
"requireArgument",
"(",
"em",
"!=",
"null",
",",
"\"The entity manager cannot be null.... | Locates an entity based on it's primary key value.
@param <E> The type of the entity.
@param em The entity manager to use. Cannot be null.
@param id The primary key of the entity. Cannot be null and must be a positive non-zero number.
@param type The runtime type of the entity. Cannot be null.
@retur... | [
"Locates",
"an",
"entity",
"based",
"on",
"it",
"s",
"primary",
"key",
"value",
"."
] | train | https://github.com/salesforce/Argus/blob/121b59a268da264316cded6a3e9271366a23cd86/ArgusCore/src/main/java/com/salesforce/dva/argus/service/jpa/DefaultJPAService.java#L137-L143 |
FasterXML/woodstox | src/main/java/com/ctc/wstx/util/TextBuffer.java | TextBuffer.initBinaryChunks | public void initBinaryChunks(Base64Variant v, CharArrayBase64Decoder dec, boolean firstChunk) {
"""
Method that needs to be called to configure given base64 decoder
with textual contents collected by this buffer.
@param dec Decoder that will need data
@param firstChunk Whether this is the first segment fed or... | java | public void initBinaryChunks(Base64Variant v, CharArrayBase64Decoder dec, boolean firstChunk)
{
if (mInputStart < 0) { // non-shared
dec.init(v, firstChunk, mCurrentSegment, 0, mCurrentSize, mSegments);
} else { // shared
dec.init(v, firstChunk, mInputBuffer, mInputStart, mIn... | [
"public",
"void",
"initBinaryChunks",
"(",
"Base64Variant",
"v",
",",
"CharArrayBase64Decoder",
"dec",
",",
"boolean",
"firstChunk",
")",
"{",
"if",
"(",
"mInputStart",
"<",
"0",
")",
"{",
"// non-shared",
"dec",
".",
"init",
"(",
"v",
",",
"firstChunk",
","... | Method that needs to be called to configure given base64 decoder
with textual contents collected by this buffer.
@param dec Decoder that will need data
@param firstChunk Whether this is the first segment fed or not;
if it is, state needs to be fullt reset; if not, only partially. | [
"Method",
"that",
"needs",
"to",
"be",
"called",
"to",
"configure",
"given",
"base64",
"decoder",
"with",
"textual",
"contents",
"collected",
"by",
"this",
"buffer",
"."
] | train | https://github.com/FasterXML/woodstox/blob/ffcaabdc06672d9564c48c25d601d029b7fd6548/src/main/java/com/ctc/wstx/util/TextBuffer.java#L533-L540 |
seedstack/shed | src/main/java/org/seedstack/shed/misc/PriorityUtils.java | PriorityUtils.sortByPriority | public static <T> void sortByPriority(List<T> someClasses, ToIntFunction<T> priorityExtractor) {
"""
Sort classes by <strong>descending</strong> order of their priority, meaning the class with
the higher priority will
be the first element of the sorted list. The priority is determined according to the
provided ... | java | public static <T> void sortByPriority(List<T> someClasses, ToIntFunction<T> priorityExtractor) {
someClasses.sort(Collections.reverseOrder(Comparator.comparingInt(priorityExtractor)));
} | [
"public",
"static",
"<",
"T",
">",
"void",
"sortByPriority",
"(",
"List",
"<",
"T",
">",
"someClasses",
",",
"ToIntFunction",
"<",
"T",
">",
"priorityExtractor",
")",
"{",
"someClasses",
".",
"sort",
"(",
"Collections",
".",
"reverseOrder",
"(",
"Comparator"... | Sort classes by <strong>descending</strong> order of their priority, meaning the class with
the higher priority will
be the first element of the sorted list. The priority is determined according to the
provided priority extractor.
@param someClasses the list of classes to sort.
@param priorityExtractor a functio... | [
"Sort",
"classes",
"by",
"<strong",
">",
"descending<",
"/",
"strong",
">",
"order",
"of",
"their",
"priority",
"meaning",
"the",
"class",
"with",
"the",
"higher",
"priority",
"will",
"be",
"the",
"first",
"element",
"of",
"the",
"sorted",
"list",
".",
"Th... | train | https://github.com/seedstack/shed/blob/49ecb25aa3777539ab0f29f89abaae5ee93b572e/src/main/java/org/seedstack/shed/misc/PriorityUtils.java#L39-L41 |
acromusashi/acromusashi-stream-ml | src/main/java/acromusashi/stream/ml/anomaly/lof/LofCalculator.java | LofCalculator.addPointToDataSet | public static String addPointToDataSet(int max, LofPoint addedPoint, LofDataSet dataSet) {
"""
学習データセットに対象点を追加し、学習データセットの構造を更新する。<br>
データ保持数が最大値に達していた場合は学習データセットが保持しているもっとも古い点の削除を行い、削除したデータのIdを返す。
@param max データ保持数最大値
@param addedPoint 対象点
@param dataSet 学習データセット
@return 削除したデータのId。削除しなかった場合はnull
"""
... | java | public static String addPointToDataSet(int max, LofPoint addedPoint, LofDataSet dataSet)
{
// データ数が最大に達している場合には古い方からデータの削除を行う
boolean dateDelete = false;
if (max <= dataSet.getDataIdList().size())
{
dateDelete = true;
}
// 削除フラグがONの場合は古いデータから削除を行う。
... | [
"public",
"static",
"String",
"addPointToDataSet",
"(",
"int",
"max",
",",
"LofPoint",
"addedPoint",
",",
"LofDataSet",
"dataSet",
")",
"{",
"// データ数が最大に達している場合には古い方からデータの削除を行う",
"boolean",
"dateDelete",
"=",
"false",
";",
"if",
"(",
"max",
"<=",
"dataSet",
".",
... | 学習データセットに対象点を追加し、学習データセットの構造を更新する。<br>
データ保持数が最大値に達していた場合は学習データセットが保持しているもっとも古い点の削除を行い、削除したデータのIdを返す。
@param max データ保持数最大値
@param addedPoint 対象点
@param dataSet 学習データセット
@return 削除したデータのId。削除しなかった場合はnull | [
"学習データセットに対象点を追加し、学習データセットの構造を更新する。<br",
">",
"データ保持数が最大値に達していた場合は学習データセットが保持しているもっとも古い点の削除を行い、削除したデータのIdを返す。"
] | train | https://github.com/acromusashi/acromusashi-stream-ml/blob/26d6799a917cacda68e21d506c75cfeb17d832a6/src/main/java/acromusashi/stream/ml/anomaly/lof/LofCalculator.java#L85-L105 |
Devskiller/jfairy | src/main/java/com/devskiller/jfairy/producer/BaseProducer.java | BaseProducer.numerify | public String numerify(String numberString, int from, int to) {
"""
Replaces all {@code '#'} characters with random numbers from [{@code from} - {@code to}] range
@param numberString text to process
@param from start of the range
@param to end of the range
@return text with replaced '#' cha... | java | public String numerify(String numberString, int from, int to) {
return replaceSymbolWithCharsFromTo(numberString, '#', Character.forDigit(from, 10), Character.forDigit(to, 10));
} | [
"public",
"String",
"numerify",
"(",
"String",
"numberString",
",",
"int",
"from",
",",
"int",
"to",
")",
"{",
"return",
"replaceSymbolWithCharsFromTo",
"(",
"numberString",
",",
"'",
"'",
",",
"Character",
".",
"forDigit",
"(",
"from",
",",
"10",
")",
","... | Replaces all {@code '#'} characters with random numbers from [{@code from} - {@code to}] range
@param numberString text to process
@param from start of the range
@param to end of the range
@return text with replaced '#' characters | [
"Replaces",
"all",
"{",
"@code",
"#",
"}",
"characters",
"with",
"random",
"numbers",
"from",
"[",
"{",
"@code",
"from",
"}",
"-",
"{",
"@code",
"to",
"}",
"]",
"range"
] | train | https://github.com/Devskiller/jfairy/blob/126d1c8b1545f725afd10f969b9d27005ac520b7/src/main/java/com/devskiller/jfairy/producer/BaseProducer.java#L177-L179 |
vakinge/jeesuite-libs | jeesuite-common2/src/main/java/com/jeesuite/common2/excel/convert/XLSX2CSV.java | XLSX2CSV.processSheet | public void processSheet(StylesTable styles, ReadOnlySharedStringsTable strings, SheetContentsHandler sheetHandler,
InputStream sheetInputStream) throws IOException, ParserConfigurationException, SAXException {
"""
Parses and shows the content of one sheet using the specified styles and
shared-strings tables.
... | java | public void processSheet(StylesTable styles, ReadOnlySharedStringsTable strings, SheetContentsHandler sheetHandler,
InputStream sheetInputStream) throws IOException, ParserConfigurationException, SAXException {
DataFormatter formatter = new DataFormatter();
InputSource sheetSource = new InputSource(sheetInputStr... | [
"public",
"void",
"processSheet",
"(",
"StylesTable",
"styles",
",",
"ReadOnlySharedStringsTable",
"strings",
",",
"SheetContentsHandler",
"sheetHandler",
",",
"InputStream",
"sheetInputStream",
")",
"throws",
"IOException",
",",
"ParserConfigurationException",
",",
"SAXExc... | Parses and shows the content of one sheet using the specified styles and
shared-strings tables.
@param styles
@param strings
@param sheetInputStream | [
"Parses",
"and",
"shows",
"the",
"content",
"of",
"one",
"sheet",
"using",
"the",
"specified",
"styles",
"and",
"shared",
"-",
"strings",
"tables",
"."
] | train | https://github.com/vakinge/jeesuite-libs/blob/c48fe2c7fbd294892cf4030dbec96e744dd3e386/jeesuite-common2/src/main/java/com/jeesuite/common2/excel/convert/XLSX2CSV.java#L164-L176 |
lessthanoptimal/BoofCV | main/boofcv-feature/src/main/java/boofcv/alg/feature/dense/DescribeDenseHogFastAlg.java | DescribeDenseHogFastAlg.computeDescriptor | void computeDescriptor(int row, int col) {
"""
Compute the descriptor from the specified cells. (row,col) to (row+w,col+w)
@param row Lower extent of cell rows
@param col Lower extent of cell columns
"""
// set location to top-left pixel
locations.grow().set(col* pixelsPerCell,row* pixelsPerCell);
Tu... | java | void computeDescriptor(int row, int col) {
// set location to top-left pixel
locations.grow().set(col* pixelsPerCell,row* pixelsPerCell);
TupleDesc_F64 d = descriptions.grow();
int indexDesc = 0;
for (int i = 0; i < cellsPerBlockY; i++) {
for (int j = 0; j < cellsPerBlockX; j++) {
Cell c = cells[(row... | [
"void",
"computeDescriptor",
"(",
"int",
"row",
",",
"int",
"col",
")",
"{",
"// set location to top-left pixel",
"locations",
".",
"grow",
"(",
")",
".",
"set",
"(",
"col",
"*",
"pixelsPerCell",
",",
"row",
"*",
"pixelsPerCell",
")",
";",
"TupleDesc_F64",
"... | Compute the descriptor from the specified cells. (row,col) to (row+w,col+w)
@param row Lower extent of cell rows
@param col Lower extent of cell columns | [
"Compute",
"the",
"descriptor",
"from",
"the",
"specified",
"cells",
".",
"(",
"row",
"col",
")",
"to",
"(",
"row",
"+",
"w",
"col",
"+",
"w",
")"
] | train | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-feature/src/main/java/boofcv/alg/feature/dense/DescribeDenseHogFastAlg.java#L150-L169 |
jenkinsci/jenkins | core/src/main/java/hudson/model/AbstractProject.java | AbstractProject.findNearest | public static @CheckForNull AbstractProject findNearest(String name, ItemGroup context) {
"""
Finds a {@link AbstractProject} whose name (when referenced from the specified context) is closest to the given name.
@since 1.419
@see Items#findNearest
"""
return Items.findNearest(AbstractProject.class,... | java | public static @CheckForNull AbstractProject findNearest(String name, ItemGroup context) {
return Items.findNearest(AbstractProject.class, name, context);
} | [
"public",
"static",
"@",
"CheckForNull",
"AbstractProject",
"findNearest",
"(",
"String",
"name",
",",
"ItemGroup",
"context",
")",
"{",
"return",
"Items",
".",
"findNearest",
"(",
"AbstractProject",
".",
"class",
",",
"name",
",",
"context",
")",
";",
"}"
] | Finds a {@link AbstractProject} whose name (when referenced from the specified context) is closest to the given name.
@since 1.419
@see Items#findNearest | [
"Finds",
"a",
"{",
"@link",
"AbstractProject",
"}",
"whose",
"name",
"(",
"when",
"referenced",
"from",
"the",
"specified",
"context",
")",
"is",
"closest",
"to",
"the",
"given",
"name",
"."
] | train | https://github.com/jenkinsci/jenkins/blob/44c4d3989232082c254d27ae360aa810669f44b7/core/src/main/java/hudson/model/AbstractProject.java#L2065-L2067 |
UrielCh/ovh-java-sdk | ovh-java-sdk-emaildomain/src/main/java/net/minidev/ovh/api/ApiOvhEmaildomain.java | ApiOvhEmaildomain.domain_redirection_id_GET | public OvhRedirectionGlobal domain_redirection_id_GET(String domain, String id) throws IOException {
"""
Get this object properties
REST: GET /email/domain/{domain}/redirection/{id}
@param domain [required] Name of your domain name
@param id [required]
"""
String qPath = "/email/domain/{domain}/redirect... | java | public OvhRedirectionGlobal domain_redirection_id_GET(String domain, String id) throws IOException {
String qPath = "/email/domain/{domain}/redirection/{id}";
StringBuilder sb = path(qPath, domain, id);
String resp = exec(qPath, "GET", sb.toString(), null);
return convertTo(resp, OvhRedirectionGlobal.class);
} | [
"public",
"OvhRedirectionGlobal",
"domain_redirection_id_GET",
"(",
"String",
"domain",
",",
"String",
"id",
")",
"throws",
"IOException",
"{",
"String",
"qPath",
"=",
"\"/email/domain/{domain}/redirection/{id}\"",
";",
"StringBuilder",
"sb",
"=",
"path",
"(",
"qPath",
... | Get this object properties
REST: GET /email/domain/{domain}/redirection/{id}
@param domain [required] Name of your domain name
@param id [required] | [
"Get",
"this",
"object",
"properties"
] | train | https://github.com/UrielCh/ovh-java-sdk/blob/6d531a40e56e09701943e334c25f90f640c55701/ovh-java-sdk-emaildomain/src/main/java/net/minidev/ovh/api/ApiOvhEmaildomain.java#L1024-L1029 |
k3po/k3po | junit/src/main/java/org/kaazing/k3po/junit/rules/K3poRule.java | K3poRule.addScriptRoot | public K3poRule addScriptRoot(String shortName, String packagePath) {
"""
Adds a named ClassPath root of where to look for scripts when resolving them.
Specifications should reference the short name using {@code "${shortName}/..." } in script names.
@param shortName the short name used to refer to the package... | java | public K3poRule addScriptRoot(String shortName, String packagePath) {
packagePathsByName.put(shortName, packagePath);
return this;
} | [
"public",
"K3poRule",
"addScriptRoot",
"(",
"String",
"shortName",
",",
"String",
"packagePath",
")",
"{",
"packagePathsByName",
".",
"put",
"(",
"shortName",
",",
"packagePath",
")",
";",
"return",
"this",
";",
"}"
] | Adds a named ClassPath root of where to look for scripts when resolving them.
Specifications should reference the short name using {@code "${shortName}/..." } in script names.
@param shortName the short name used to refer to the package path
@param packagePath a package path used resolve relative script names
@retur... | [
"Adds",
"a",
"named",
"ClassPath",
"root",
"of",
"where",
"to",
"look",
"for",
"scripts",
"when",
"resolving",
"them",
".",
"Specifications",
"should",
"reference",
"the",
"short",
"name",
"using",
"{",
"@code",
"$",
"{",
"shortName",
"}",
"/",
"...",
"}",... | train | https://github.com/k3po/k3po/blob/3ca4fd31ab4a397893aa640c62ada0e485c8bbd4/junit/src/main/java/org/kaazing/k3po/junit/rules/K3poRule.java#L114-L117 |
VoltDB/voltdb | third_party/java/src/com/google_voltpatches/common/math/IntMath.java | IntMath.checkedAdd | public static int checkedAdd(int a, int b) {
"""
Returns the sum of {@code a} and {@code b}, provided it does not overflow.
@throws ArithmeticException if {@code a + b} overflows in signed {@code int} arithmetic
"""
long result = (long) a + b;
checkNoOverflow(result == (int) result);
return (int... | java | public static int checkedAdd(int a, int b) {
long result = (long) a + b;
checkNoOverflow(result == (int) result);
return (int) result;
} | [
"public",
"static",
"int",
"checkedAdd",
"(",
"int",
"a",
",",
"int",
"b",
")",
"{",
"long",
"result",
"=",
"(",
"long",
")",
"a",
"+",
"b",
";",
"checkNoOverflow",
"(",
"result",
"==",
"(",
"int",
")",
"result",
")",
";",
"return",
"(",
"int",
"... | Returns the sum of {@code a} and {@code b}, provided it does not overflow.
@throws ArithmeticException if {@code a + b} overflows in signed {@code int} arithmetic | [
"Returns",
"the",
"sum",
"of",
"{",
"@code",
"a",
"}",
"and",
"{",
"@code",
"b",
"}",
"provided",
"it",
"does",
"not",
"overflow",
"."
] | train | https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/third_party/java/src/com/google_voltpatches/common/math/IntMath.java#L453-L457 |
nguillaumin/slick2d-maven | slick2d-core/src/main/java/org/newdawn/slick/svg/inkscape/Util.java | Util.getStyle | static String getStyle(Element element, String styleName) {
"""
Get the style attribute setting for a given style information element (i.e. fill, stroke)
@param element The element to be processed
@param styleName The name of the attribute to retrieve
@return The style value
"""
String value = element.... | java | static String getStyle(Element element, String styleName) {
String value = element.getAttribute(styleName);
if ((value != null) && (value.length() > 0)) {
return value;
}
String style = element.getAttribute("style");
return extractStyle(style, styleName);
} | [
"static",
"String",
"getStyle",
"(",
"Element",
"element",
",",
"String",
"styleName",
")",
"{",
"String",
"value",
"=",
"element",
".",
"getAttribute",
"(",
"styleName",
")",
";",
"if",
"(",
"(",
"value",
"!=",
"null",
")",
"&&",
"(",
"value",
".",
"l... | Get the style attribute setting for a given style information element (i.e. fill, stroke)
@param element The element to be processed
@param styleName The name of the attribute to retrieve
@return The style value | [
"Get",
"the",
"style",
"attribute",
"setting",
"for",
"a",
"given",
"style",
"information",
"element",
"(",
"i",
".",
"e",
".",
"fill",
"stroke",
")"
] | train | https://github.com/nguillaumin/slick2d-maven/blob/8251f88a0ed6a70e726d2468842455cd1f80893f/slick2d-core/src/main/java/org/newdawn/slick/svg/inkscape/Util.java#L69-L78 |
xwiki/xwiki-rendering | xwiki-rendering-wikimodel/src/main/java/org/xwiki/rendering/wikimodel/xwiki/xwiki20/XWikiSerializer2.java | XWikiSerializer2.clearName | public final static String clearName(String name) {
"""
Clears the name of files; used while uploading attachments within XWiki
RECOMMENDED FOR NAMES OF UPLOADED FILES. (boolean stripDots = false;
boolean ascii = true;)
"""
boolean stripDots = false;
boolean ascii = true;
return cle... | java | public final static String clearName(String name)
{
boolean stripDots = false;
boolean ascii = true;
return clearName(name, stripDots, ascii);
} | [
"public",
"final",
"static",
"String",
"clearName",
"(",
"String",
"name",
")",
"{",
"boolean",
"stripDots",
"=",
"false",
";",
"boolean",
"ascii",
"=",
"true",
";",
"return",
"clearName",
"(",
"name",
",",
"stripDots",
",",
"ascii",
")",
";",
"}"
] | Clears the name of files; used while uploading attachments within XWiki
RECOMMENDED FOR NAMES OF UPLOADED FILES. (boolean stripDots = false;
boolean ascii = true;) | [
"Clears",
"the",
"name",
"of",
"files",
";",
"used",
"while",
"uploading",
"attachments",
"within",
"XWiki"
] | train | https://github.com/xwiki/xwiki-rendering/blob/a21cdfcb64ef5b76872e3eedf78c530f26d7beb0/xwiki-rendering-wikimodel/src/main/java/org/xwiki/rendering/wikimodel/xwiki/xwiki20/XWikiSerializer2.java#L570-L575 |
google/j2objc | jre_emul/android/platform/external/icu/android_icu4j/src/main/java/android/icu/text/SimpleFormatter.java | SimpleFormatter.compileMinMaxArguments | public static SimpleFormatter compileMinMaxArguments(CharSequence pattern, int min, int max) {
"""
Creates a formatter from the pattern string.
The number of arguments checked against the given limits is the
highest argument number plus one, not the number of occurrences of arguments.
@param pattern The patte... | java | public static SimpleFormatter compileMinMaxArguments(CharSequence pattern, int min, int max) {
StringBuilder sb = new StringBuilder();
String compiledPattern = SimpleFormatterImpl.compileToStringMinMaxArguments(pattern, sb, min, max);
return new SimpleFormatter(compiledPattern);
} | [
"public",
"static",
"SimpleFormatter",
"compileMinMaxArguments",
"(",
"CharSequence",
"pattern",
",",
"int",
"min",
",",
"int",
"max",
")",
"{",
"StringBuilder",
"sb",
"=",
"new",
"StringBuilder",
"(",
")",
";",
"String",
"compiledPattern",
"=",
"SimpleFormatterIm... | Creates a formatter from the pattern string.
The number of arguments checked against the given limits is the
highest argument number plus one, not the number of occurrences of arguments.
@param pattern The pattern string.
@param min The pattern must have at least this many arguments.
@param max The pattern must have a... | [
"Creates",
"a",
"formatter",
"from",
"the",
"pattern",
"string",
".",
"The",
"number",
"of",
"arguments",
"checked",
"against",
"the",
"given",
"limits",
"is",
"the",
"highest",
"argument",
"number",
"plus",
"one",
"not",
"the",
"number",
"of",
"occurrences",
... | train | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/external/icu/android_icu4j/src/main/java/android/icu/text/SimpleFormatter.java#L79-L83 |
Stratio/stratio-connector-commons | connector-commons/src/main/java/com/stratio/connector/commons/engine/CommonsMetadataEngine.java | CommonsMetadataEngine.dropCatalog | @Override
public final void dropCatalog(ClusterName targetCluster, CatalogName name) throws UnsupportedException,
ExecutionException {
"""
This method drop a catalog.
@param targetCluster the target cluster where the catalog will be dropped.
@param name the catalog name.
@throws Unsu... | java | @Override
public final void dropCatalog(ClusterName targetCluster, CatalogName name) throws UnsupportedException,
ExecutionException {
try {
connectionHandler.startJob(targetCluster.getName());
if (logger.isDebugEnabled()) {
logger.debug("Dropping catal... | [
"@",
"Override",
"public",
"final",
"void",
"dropCatalog",
"(",
"ClusterName",
"targetCluster",
",",
"CatalogName",
"name",
")",
"throws",
"UnsupportedException",
",",
"ExecutionException",
"{",
"try",
"{",
"connectionHandler",
".",
"startJob",
"(",
"targetCluster",
... | This method drop a catalog.
@param targetCluster the target cluster where the catalog will be dropped.
@param name the catalog name.
@throws UnsupportedException if an operation is not supported.
@throws ExecutionException if an error happens. | [
"This",
"method",
"drop",
"a",
"catalog",
"."
] | train | https://github.com/Stratio/stratio-connector-commons/blob/d7cc66cb9591344a13055962e87a91f01c3707d1/connector-commons/src/main/java/com/stratio/connector/commons/engine/CommonsMetadataEngine.java#L142-L164 |
Waikato/moa | moa/src/main/java/moa/classifiers/lazy/neighboursearch/NearestNeighbourSearch.java | NearestNeighbourSearch.combSort11 | public static void combSort11(double arrayToSort[], int linkedArray[]) {
"""
sorts the two given arrays.
@param arrayToSort The array sorting should be based on.
@param linkedArray The array that should have the same ordering as
arrayToSort.
"""
int switches, j, top, gap;
double hold1; int hold2... | java | public static void combSort11(double arrayToSort[], int linkedArray[]) {
int switches, j, top, gap;
double hold1; int hold2;
gap = arrayToSort.length;
do {
gap=(int)(gap/1.3);
switch(gap) {
case 0:
gap = 1;
break;
case 9:
case 10:
gap=11;... | [
"public",
"static",
"void",
"combSort11",
"(",
"double",
"arrayToSort",
"[",
"]",
",",
"int",
"linkedArray",
"[",
"]",
")",
"{",
"int",
"switches",
",",
"j",
",",
"top",
",",
"gap",
";",
"double",
"hold1",
";",
"int",
"hold2",
";",
"gap",
"=",
"array... | sorts the two given arrays.
@param arrayToSort The array sorting should be based on.
@param linkedArray The array that should have the same ordering as
arrayToSort. | [
"sorts",
"the",
"two",
"given",
"arrays",
"."
] | train | https://github.com/Waikato/moa/blob/395982e5100bfe75a3a4d26115462ce2cc74cbb0/moa/src/main/java/moa/classifiers/lazy/neighboursearch/NearestNeighbourSearch.java#L653-L685 |
iwgang/SimplifySpan | library/src/main/java/cn/iwgang/simplifyspan/SimplifySpanBuild.java | SimplifySpanBuild.appendMultiClickableToFirst | public SimplifySpanBuild appendMultiClickableToFirst(SpecialClickableUnit specialClickableUnit, Object... specialUnitOrStrings) {
"""
append multi clickable SpecialUnit or String to first (Behind the existing BeforeContent)
@param specialClickableUnit SpecialClickableUnit
@param specialUnitOrStrings Unit Or St... | java | public SimplifySpanBuild appendMultiClickableToFirst(SpecialClickableUnit specialClickableUnit, Object... specialUnitOrStrings) {
processMultiClickableSpecialUnit(true, specialClickableUnit, specialUnitOrStrings);
return this;
} | [
"public",
"SimplifySpanBuild",
"appendMultiClickableToFirst",
"(",
"SpecialClickableUnit",
"specialClickableUnit",
",",
"Object",
"...",
"specialUnitOrStrings",
")",
"{",
"processMultiClickableSpecialUnit",
"(",
"true",
",",
"specialClickableUnit",
",",
"specialUnitOrStrings",
... | append multi clickable SpecialUnit or String to first (Behind the existing BeforeContent)
@param specialClickableUnit SpecialClickableUnit
@param specialUnitOrStrings Unit Or String
@return | [
"append",
"multi",
"clickable",
"SpecialUnit",
"or",
"String",
"to",
"first",
"(",
"Behind",
"the",
"existing",
"BeforeContent",
")"
] | train | https://github.com/iwgang/SimplifySpan/blob/34e917cd5497215c8abc07b3d8df187949967283/library/src/main/java/cn/iwgang/simplifyspan/SimplifySpanBuild.java#L252-L255 |
aws/aws-sdk-java | aws-java-sdk-core/src/main/java/com/amazonaws/auth/AbstractAWSSigner.java | AbstractAWSSigner.getCanonicalizedQueryString | protected String getCanonicalizedQueryString(Map<String, List<String>> parameters) {
"""
Examines the specified query string parameters and returns a
canonicalized form.
<p>
The canonicalized query string is formed by first sorting all the query
string parameters, then URI encoding both the key and value and t... | java | protected String getCanonicalizedQueryString(Map<String, List<String>> parameters) {
final SortedMap<String, List<String>> sorted = new TreeMap<String, List<String>>();
/**
* Signing protocol expects the param values also to be sorted after url
* encoding in addition to sorted parame... | [
"protected",
"String",
"getCanonicalizedQueryString",
"(",
"Map",
"<",
"String",
",",
"List",
"<",
"String",
">",
">",
"parameters",
")",
"{",
"final",
"SortedMap",
"<",
"String",
",",
"List",
"<",
"String",
">",
">",
"sorted",
"=",
"new",
"TreeMap",
"<",
... | Examines the specified query string parameters and returns a
canonicalized form.
<p>
The canonicalized query string is formed by first sorting all the query
string parameters, then URI encoding both the key and value and then
joining them, in order, separating key value pairs with an '&'.
@param parameters
The query s... | [
"Examines",
"the",
"specified",
"query",
"string",
"parameters",
"and",
"returns",
"a",
"canonicalized",
"form",
".",
"<p",
">",
"The",
"canonicalized",
"query",
"string",
"is",
"formed",
"by",
"first",
"sorting",
"all",
"the",
"query",
"string",
"parameters",
... | train | https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-core/src/main/java/com/amazonaws/auth/AbstractAWSSigner.java#L216-L251 |
kiswanij/jk-util | src/main/java/com/jk/util/JKDateTimeUtil.java | JKDateTimeUtil.getMillisDifference | public static long getMillisDifference(Date startDate, Date endDate) {
"""
Gets the millis difference.
@param startDate the start date
@param endDate the end date
@return the millis difference
"""
long startTime = startDate.getTime();
long endTime = endDate.getTime();
long diffTime = endTime - ... | java | public static long getMillisDifference(Date startDate, Date endDate) {
long startTime = startDate.getTime();
long endTime = endDate.getTime();
long diffTime = endTime - startTime;
return diffTime;
} | [
"public",
"static",
"long",
"getMillisDifference",
"(",
"Date",
"startDate",
",",
"Date",
"endDate",
")",
"{",
"long",
"startTime",
"=",
"startDate",
".",
"getTime",
"(",
")",
";",
"long",
"endTime",
"=",
"endDate",
".",
"getTime",
"(",
")",
";",
"long",
... | Gets the millis difference.
@param startDate the start date
@param endDate the end date
@return the millis difference | [
"Gets",
"the",
"millis",
"difference",
"."
] | train | https://github.com/kiswanij/jk-util/blob/8e0c85818423406f769444c76194a748e0a0fc0a/src/main/java/com/jk/util/JKDateTimeUtil.java#L472-L477 |
alkacon/opencms-core | src/org/opencms/workplace/CmsWorkplace.java | CmsWorkplace.generatePageStartExtended | public static String generatePageStartExtended(CmsObject cms, String encoding) {
"""
Generates the header for the extended report view.<p>
@param cms the current users context
@param encoding the encoding string
@return html code
"""
StringBuffer result = new StringBuffer(128);
result.a... | java | public static String generatePageStartExtended(CmsObject cms, String encoding) {
StringBuffer result = new StringBuffer(128);
result.append("<html>\n<head>\n");
result.append("<meta HTTP-EQUIV='Content-Type' CONTENT='text/html; charset=");
result.append(encoding);
result.append(... | [
"public",
"static",
"String",
"generatePageStartExtended",
"(",
"CmsObject",
"cms",
",",
"String",
"encoding",
")",
"{",
"StringBuffer",
"result",
"=",
"new",
"StringBuffer",
"(",
"128",
")",
";",
"result",
".",
"append",
"(",
"\"<html>\\n<head>\\n\"",
")",
";",... | Generates the header for the extended report view.<p>
@param cms the current users context
@param encoding the encoding string
@return html code | [
"Generates",
"the",
"header",
"for",
"the",
"extended",
"report",
"view",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/workplace/CmsWorkplace.java#L505-L517 |
elki-project/elki | elki-core-math/src/main/java/de/lmu/ifi/dbs/elki/math/geometry/SweepHullDelaunay2D.java | SweepHullDelaunay2D.flipTriangles | int flipTriangles(long[] flippedA, long[] flippedB) {
"""
Flip triangles as necessary
@param flippedA Bit set for triangles to test
@param flippedB Bit set to mark triangles as done
"""
int numflips = 0;
BitsUtil.zeroI(flippedB);
for(int i = BitsUtil.nextSetBit(flippedA, 0); i > -1; i = BitsUti... | java | int flipTriangles(long[] flippedA, long[] flippedB) {
int numflips = 0;
BitsUtil.zeroI(flippedB);
for(int i = BitsUtil.nextSetBit(flippedA, 0); i > -1; i = BitsUtil.nextSetBit(flippedA, i + 1)) {
if(!BitsUtil.get(flippedB, i) && flipTriangle(i, flippedB) >= 0) {
numflips += 2;
}
}
... | [
"int",
"flipTriangles",
"(",
"long",
"[",
"]",
"flippedA",
",",
"long",
"[",
"]",
"flippedB",
")",
"{",
"int",
"numflips",
"=",
"0",
";",
"BitsUtil",
".",
"zeroI",
"(",
"flippedB",
")",
";",
"for",
"(",
"int",
"i",
"=",
"BitsUtil",
".",
"nextSetBit",... | Flip triangles as necessary
@param flippedA Bit set for triangles to test
@param flippedB Bit set to mark triangles as done | [
"Flip",
"triangles",
"as",
"necessary"
] | train | https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-core-math/src/main/java/de/lmu/ifi/dbs/elki/math/geometry/SweepHullDelaunay2D.java#L480-L492 |
Azure/azure-sdk-for-java | locks/resource-manager/v2016_09_01/src/main/java/com/microsoft/azure/management/locks/v2016_09_01/implementation/ManagementLocksInner.java | ManagementLocksInner.getAtResourceLevel | public ManagementLockObjectInner getAtResourceLevel(String resourceGroupName, String resourceProviderNamespace, String parentResourcePath, String resourceType, String resourceName, String lockName) {
"""
Get the management lock of a resource or any level below resource.
@param resourceGroupName The name of the ... | java | public ManagementLockObjectInner getAtResourceLevel(String resourceGroupName, String resourceProviderNamespace, String parentResourcePath, String resourceType, String resourceName, String lockName) {
return getAtResourceLevelWithServiceResponseAsync(resourceGroupName, resourceProviderNamespace, parentResourcePa... | [
"public",
"ManagementLockObjectInner",
"getAtResourceLevel",
"(",
"String",
"resourceGroupName",
",",
"String",
"resourceProviderNamespace",
",",
"String",
"parentResourcePath",
",",
"String",
"resourceType",
",",
"String",
"resourceName",
",",
"String",
"lockName",
")",
... | Get the management lock of a resource or any level below resource.
@param resourceGroupName The name of the resource group.
@param resourceProviderNamespace The namespace of the resource provider.
@param parentResourcePath An extra path parameter needed in some services, like SQL Databases.
@param resourceType The typ... | [
"Get",
"the",
"management",
"lock",
"of",
"a",
"resource",
"or",
"any",
"level",
"below",
"resource",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/locks/resource-manager/v2016_09_01/src/main/java/com/microsoft/azure/management/locks/v2016_09_01/implementation/ManagementLocksInner.java#L932-L934 |
jayantk/jklol | src/com/jayantkrish/jklol/util/IoUtils.java | IoUtils.getNumberOfColumnsInFile | public static int getNumberOfColumnsInFile(String filename, String delimiter) {
"""
Counts the number of columns in a file delimited by {@code delimiter}.
Assumes that the first line of the file is representative of the file as a
whole.
@param filename
@param delimiter
@return
"""
try {
Buffer... | java | public static int getNumberOfColumnsInFile(String filename, String delimiter) {
try {
BufferedReader in = new BufferedReader(new FileReader(filename));
String line;
while ((line = in.readLine()) != null) {
String[] parts = line.split(delimiter);
in.close();
return parts.len... | [
"public",
"static",
"int",
"getNumberOfColumnsInFile",
"(",
"String",
"filename",
",",
"String",
"delimiter",
")",
"{",
"try",
"{",
"BufferedReader",
"in",
"=",
"new",
"BufferedReader",
"(",
"new",
"FileReader",
"(",
"filename",
")",
")",
";",
"String",
"line"... | Counts the number of columns in a file delimited by {@code delimiter}.
Assumes that the first line of the file is representative of the file as a
whole.
@param filename
@param delimiter
@return | [
"Counts",
"the",
"number",
"of",
"columns",
"in",
"a",
"file",
"delimited",
"by",
"{",
"@code",
"delimiter",
"}",
".",
"Assumes",
"that",
"the",
"first",
"line",
"of",
"the",
"file",
"is",
"representative",
"of",
"the",
"file",
"as",
"a",
"whole",
"."
] | train | https://github.com/jayantk/jklol/blob/d27532ca83e212d51066cf28f52621acc3fd44cc/src/com/jayantkrish/jklol/util/IoUtils.java#L68-L83 |
wmdietl/jsr308-langtools | src/share/classes/com/sun/tools/sjavac/JavacState.java | JavacState.performTranslation | public void performTranslation(File gensrcDir, Map<String,Transformer> suffixRules) {
"""
Run all the translators that translate into java source code.
I.e. all translators that are not copy nor compile_java_source.
"""
Map<String,Transformer> sr = new HashMap<String,Transformer>();
for (Map.E... | java | public void performTranslation(File gensrcDir, Map<String,Transformer> suffixRules) {
Map<String,Transformer> sr = new HashMap<String,Transformer>();
for (Map.Entry<String,Transformer> e : suffixRules.entrySet()) {
if (e.getValue() != copyFiles &&
e.getValue() != compileJavaP... | [
"public",
"void",
"performTranslation",
"(",
"File",
"gensrcDir",
",",
"Map",
"<",
"String",
",",
"Transformer",
">",
"suffixRules",
")",
"{",
"Map",
"<",
"String",
",",
"Transformer",
">",
"sr",
"=",
"new",
"HashMap",
"<",
"String",
",",
"Transformer",
">... | Run all the translators that translate into java source code.
I.e. all translators that are not copy nor compile_java_source. | [
"Run",
"all",
"the",
"translators",
"that",
"translate",
"into",
"java",
"source",
"code",
".",
"I",
".",
"e",
".",
"all",
"translators",
"that",
"are",
"not",
"copy",
"nor",
"compile_java_source",
"."
] | train | https://github.com/wmdietl/jsr308-langtools/blob/8812d28c20f4de070a0dd6de1b45602431379834/src/share/classes/com/sun/tools/sjavac/JavacState.java#L643-L652 |
UrielCh/ovh-java-sdk | ovh-java-sdk-cloud/src/main/java/net/minidev/ovh/api/ApiOvhCloud.java | ApiOvhCloud.project_serviceName_flavor_GET | public ArrayList<OvhFlavor> project_serviceName_flavor_GET(String serviceName, String region) throws IOException {
"""
Get flavors
REST: GET /cloud/project/{serviceName}/flavor
@param region [required] Flavor region
@param serviceName [required] Service name
"""
String qPath = "/cloud/project/{serviceNa... | java | public ArrayList<OvhFlavor> project_serviceName_flavor_GET(String serviceName, String region) throws IOException {
String qPath = "/cloud/project/{serviceName}/flavor";
StringBuilder sb = path(qPath, serviceName);
query(sb, "region", region);
String resp = exec(qPath, "GET", sb.toString(), null);
return conve... | [
"public",
"ArrayList",
"<",
"OvhFlavor",
">",
"project_serviceName_flavor_GET",
"(",
"String",
"serviceName",
",",
"String",
"region",
")",
"throws",
"IOException",
"{",
"String",
"qPath",
"=",
"\"/cloud/project/{serviceName}/flavor\"",
";",
"StringBuilder",
"sb",
"=",
... | Get flavors
REST: GET /cloud/project/{serviceName}/flavor
@param region [required] Flavor region
@param serviceName [required] Service name | [
"Get",
"flavors"
] | train | https://github.com/UrielCh/ovh-java-sdk/blob/6d531a40e56e09701943e334c25f90f640c55701/ovh-java-sdk-cloud/src/main/java/net/minidev/ovh/api/ApiOvhCloud.java#L2296-L2302 |
Coveros/selenified | src/main/java/com/coveros/selenified/utilities/Reporter.java | Reporter.getRequestPayloadOutput | public static String getRequestPayloadOutput(Request params, File file) {
"""
Formats the request parameters to be 'prettily' printed out in HTML
@param params - the parameters to be formatted. Either a JSON object, or a
hashmap
@return String: a 'prettily' formatted string that is HTML safe to output
"""... | java | public static String getRequestPayloadOutput(Request params, File file) {
StringBuilder payload = new StringBuilder();
String uuid = getUUID();
payload.append(ONCLICK_TOGGLE).append(uuid).append("\")'>Toggle Payload</a> ");
payload.append(SPAN_ID).append(uuid).append(DISPLAY_NONE);
... | [
"public",
"static",
"String",
"getRequestPayloadOutput",
"(",
"Request",
"params",
",",
"File",
"file",
")",
"{",
"StringBuilder",
"payload",
"=",
"new",
"StringBuilder",
"(",
")",
";",
"String",
"uuid",
"=",
"getUUID",
"(",
")",
";",
"payload",
".",
"append... | Formats the request parameters to be 'prettily' printed out in HTML
@param params - the parameters to be formatted. Either a JSON object, or a
hashmap
@return String: a 'prettily' formatted string that is HTML safe to output | [
"Formats",
"the",
"request",
"parameters",
"to",
"be",
"prettily",
"printed",
"out",
"in",
"HTML"
] | train | https://github.com/Coveros/selenified/blob/396cc1f010dd69eed33cc5061c41253de246a4cd/src/main/java/com/coveros/selenified/utilities/Reporter.java#L897-L926 |
zxing/zxing | core/src/main/java/com/google/zxing/qrcode/detector/FinderPattern.java | FinderPattern.combineEstimate | FinderPattern combineEstimate(float i, float j, float newModuleSize) {
"""
Combines this object's current estimate of a finder pattern position and module size
with a new estimate. It returns a new {@code FinderPattern} containing a weighted average
based on count.
"""
int combinedCount = count + 1;
... | java | FinderPattern combineEstimate(float i, float j, float newModuleSize) {
int combinedCount = count + 1;
float combinedX = (count * getX() + j) / combinedCount;
float combinedY = (count * getY() + i) / combinedCount;
float combinedModuleSize = (count * estimatedModuleSize + newModuleSize) / combinedCount;
... | [
"FinderPattern",
"combineEstimate",
"(",
"float",
"i",
",",
"float",
"j",
",",
"float",
"newModuleSize",
")",
"{",
"int",
"combinedCount",
"=",
"count",
"+",
"1",
";",
"float",
"combinedX",
"=",
"(",
"count",
"*",
"getX",
"(",
")",
"+",
"j",
")",
"/",
... | Combines this object's current estimate of a finder pattern position and module size
with a new estimate. It returns a new {@code FinderPattern} containing a weighted average
based on count. | [
"Combines",
"this",
"object",
"s",
"current",
"estimate",
"of",
"a",
"finder",
"pattern",
"position",
"and",
"module",
"size",
"with",
"a",
"new",
"estimate",
".",
"It",
"returns",
"a",
"new",
"{"
] | train | https://github.com/zxing/zxing/blob/653ac2a3beb11481eff82e7d5f2bab8a745f7fac/core/src/main/java/com/google/zxing/qrcode/detector/FinderPattern.java#L74-L80 |
dbracewell/mango | src/main/java/com/davidbracewell/string/StringUtils.java | StringUtils.randomString | public static String randomString(int length, int min, int max) {
"""
Generates a random string of a given length
@param length The length of the string
@param min The min character in the string
@param max The max character in the string
@return A string of random characters
"""
return rando... | java | public static String randomString(int length, int min, int max) {
return randomString(length, min, max, CharMatcher.ANY);
} | [
"public",
"static",
"String",
"randomString",
"(",
"int",
"length",
",",
"int",
"min",
",",
"int",
"max",
")",
"{",
"return",
"randomString",
"(",
"length",
",",
"min",
",",
"max",
",",
"CharMatcher",
".",
"ANY",
")",
";",
"}"
] | Generates a random string of a given length
@param length The length of the string
@param min The min character in the string
@param max The max character in the string
@return A string of random characters | [
"Generates",
"a",
"random",
"string",
"of",
"a",
"given",
"length"
] | train | https://github.com/dbracewell/mango/blob/2cec08826f1fccd658694dd03abce10fc97618ec/src/main/java/com/davidbracewell/string/StringUtils.java#L377-L379 |
eclipse/hawkbit | hawkbit-http-security/src/main/java/org/eclipse/hawkbit/security/AbstractHttpControllerAuthenticationFilter.java | AbstractHttpControllerAuthenticationFilter.createTenantSecruityTokenVariables | protected DmfTenantSecurityToken createTenantSecruityTokenVariables(final HttpServletRequest request) {
"""
Extracts tenant and controllerId from the request URI as path variables.
@param request
the Http request to extract the path variables.
@return the extracted {@link PathVariables} or {@code null} if the... | java | protected DmfTenantSecurityToken createTenantSecruityTokenVariables(final HttpServletRequest request) {
final String requestURI = request.getRequestURI();
if (pathExtractor.match(request.getContextPath() + CONTROLLER_REQUEST_ANT_PATTERN, requestURI)) {
LOG.debug("retrieving principal from U... | [
"protected",
"DmfTenantSecurityToken",
"createTenantSecruityTokenVariables",
"(",
"final",
"HttpServletRequest",
"request",
")",
"{",
"final",
"String",
"requestURI",
"=",
"request",
".",
"getRequestURI",
"(",
")",
";",
"if",
"(",
"pathExtractor",
".",
"match",
"(",
... | Extracts tenant and controllerId from the request URI as path variables.
@param request
the Http request to extract the path variables.
@return the extracted {@link PathVariables} or {@code null} if the
request does not match the pattern and no variables could be
extracted | [
"Extracts",
"tenant",
"and",
"controllerId",
"from",
"the",
"request",
"URI",
"as",
"path",
"variables",
"."
] | train | https://github.com/eclipse/hawkbit/blob/9884452ad42f3b4827461606d8a9215c8625a7fe/hawkbit-http-security/src/main/java/org/eclipse/hawkbit/security/AbstractHttpControllerAuthenticationFilter.java#L134-L164 |
orbisgis/h2gis | h2gis-functions/src/main/java/org/h2gis/functions/io/gpx/model/GPXCoordinate.java | GPXCoordinate.createCoordinate | public static Coordinate createCoordinate(Attributes attributes) throws NumberFormatException {
"""
General method to create a coordinate from a gpx point.
@param attributes Attributes of the point. Here it is latitude and
longitude
@throws NumberFormatException
@return a coordinate
"""
// Associ... | java | public static Coordinate createCoordinate(Attributes attributes) throws NumberFormatException {
// Associate a latitude and a longitude to the point
double lat;
double lon;
try {
lat = Double.parseDouble(attributes.getValue(GPXTags.LAT));
} catch (NumberFormatExceptio... | [
"public",
"static",
"Coordinate",
"createCoordinate",
"(",
"Attributes",
"attributes",
")",
"throws",
"NumberFormatException",
"{",
"// Associate a latitude and a longitude to the point",
"double",
"lat",
";",
"double",
"lon",
";",
"try",
"{",
"lat",
"=",
"Double",
".",... | General method to create a coordinate from a gpx point.
@param attributes Attributes of the point. Here it is latitude and
longitude
@throws NumberFormatException
@return a coordinate | [
"General",
"method",
"to",
"create",
"a",
"coordinate",
"from",
"a",
"gpx",
"point",
"."
] | train | https://github.com/orbisgis/h2gis/blob/9cd70b447e6469cecbc2fc64b16774b59491df3b/h2gis-functions/src/main/java/org/h2gis/functions/io/gpx/model/GPXCoordinate.java#L40-L65 |
alkacon/opencms-core | src-gwt/org/opencms/gwt/client/ui/CmsNotification.java | CmsNotification.sendSticky | public CmsNotificationMessage sendSticky(Type type, String message) {
"""
Sends a new sticky notification that can not be removed by the user.<p>
@param type the notification type
@param message the message
@return the message, use to hide the message
"""
CmsNotificationMessage notificationMess... | java | public CmsNotificationMessage sendSticky(Type type, String message) {
CmsNotificationMessage notificationMessage = new CmsNotificationMessage(Mode.STICKY, type, message);
m_messages.add(notificationMessage);
if (hasWidget()) {
m_widget.addMessage(notificationMessage);
}
... | [
"public",
"CmsNotificationMessage",
"sendSticky",
"(",
"Type",
"type",
",",
"String",
"message",
")",
"{",
"CmsNotificationMessage",
"notificationMessage",
"=",
"new",
"CmsNotificationMessage",
"(",
"Mode",
".",
"STICKY",
",",
"type",
",",
"message",
")",
";",
"m_... | Sends a new sticky notification that can not be removed by the user.<p>
@param type the notification type
@param message the message
@return the message, use to hide the message | [
"Sends",
"a",
"new",
"sticky",
"notification",
"that",
"can",
"not",
"be",
"removed",
"by",
"the",
"user",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src-gwt/org/opencms/gwt/client/ui/CmsNotification.java#L230-L238 |
alkacon/opencms-core | src/org/opencms/loader/CmsImageScaler.java | CmsImageScaler.getDownScaler | public CmsImageScaler getDownScaler(CmsImageScaler downScaler) {
"""
Returns a new image scaler that is a down scale from the size of <code>this</code> scaler
to the given scaler size.<p>
If no down scale from this to the given scaler is required according to
{@link #isDownScaleRequired(CmsImageScaler)}, then... | java | public CmsImageScaler getDownScaler(CmsImageScaler downScaler) {
if (!isDownScaleRequired(downScaler)) {
// no down scaling is required
return null;
}
int downHeight = downScaler.getHeight();
int downWidth = downScaler.getWidth();
int height = getHeight... | [
"public",
"CmsImageScaler",
"getDownScaler",
"(",
"CmsImageScaler",
"downScaler",
")",
"{",
"if",
"(",
"!",
"isDownScaleRequired",
"(",
"downScaler",
")",
")",
"{",
"// no down scaling is required",
"return",
"null",
";",
"}",
"int",
"downHeight",
"=",
"downScaler",... | Returns a new image scaler that is a down scale from the size of <code>this</code> scaler
to the given scaler size.<p>
If no down scale from this to the given scaler is required according to
{@link #isDownScaleRequired(CmsImageScaler)}, then <code>null</code> is returned.<p>
@param downScaler the image scaler that ho... | [
"Returns",
"a",
"new",
"image",
"scaler",
"that",
"is",
"a",
"down",
"scale",
"from",
"the",
"size",
"of",
"<code",
">",
"this<",
"/",
"code",
">",
"scaler",
"to",
"the",
"given",
"scaler",
"size",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/loader/CmsImageScaler.java#L487-L521 |
youngmonkeys/ezyfox-sfs2x | src/main/java/com/tvd12/ezyfox/sfs2x/serverhandler/UserZoneEventHandler.java | UserZoneEventHandler.checkHandler | protected boolean checkHandler(ZoneHandlerClass handler, ApiZone apiZone) {
"""
Check zone name
@param handler
structure of handle class
@param apiZone
api zone reference
@return true of false
"""
return apiZone.getName().startsWith(handler.getZoneName());
} | java | protected boolean checkHandler(ZoneHandlerClass handler, ApiZone apiZone) {
return apiZone.getName().startsWith(handler.getZoneName());
} | [
"protected",
"boolean",
"checkHandler",
"(",
"ZoneHandlerClass",
"handler",
",",
"ApiZone",
"apiZone",
")",
"{",
"return",
"apiZone",
".",
"getName",
"(",
")",
".",
"startsWith",
"(",
"handler",
".",
"getZoneName",
"(",
")",
")",
";",
"}"
] | Check zone name
@param handler
structure of handle class
@param apiZone
api zone reference
@return true of false | [
"Check",
"zone",
"name"
] | train | https://github.com/youngmonkeys/ezyfox-sfs2x/blob/7e004033a3b551c3ae970a0c8f45db7b1ec144de/src/main/java/com/tvd12/ezyfox/sfs2x/serverhandler/UserZoneEventHandler.java#L120-L122 |
alamkanak/Android-Week-View | library/src/main/java/com/alamkanak/weekview/WeekView.java | WeekView.getTimeFromPoint | private Calendar getTimeFromPoint(float x, float y) {
"""
Get the time and date where the user clicked on.
@param x The x position of the touch event.
@param y The y position of the touch event.
@return The time and date at the clicked position.
"""
int leftDaysWithGaps = (int) -(Math.ceil(mCurrentO... | java | private Calendar getTimeFromPoint(float x, float y){
int leftDaysWithGaps = (int) -(Math.ceil(mCurrentOrigin.x / (mWidthPerDay + mColumnGap)));
float startPixel = mCurrentOrigin.x + (mWidthPerDay + mColumnGap) * leftDaysWithGaps +
mHeaderColumnWidth;
for (int dayNumber = leftDays... | [
"private",
"Calendar",
"getTimeFromPoint",
"(",
"float",
"x",
",",
"float",
"y",
")",
"{",
"int",
"leftDaysWithGaps",
"=",
"(",
"int",
")",
"-",
"(",
"Math",
".",
"ceil",
"(",
"mCurrentOrigin",
".",
"x",
"/",
"(",
"mWidthPerDay",
"+",
"mColumnGap",
")",
... | Get the time and date where the user clicked on.
@param x The x position of the touch event.
@param y The y position of the touch event.
@return The time and date at the clicked position. | [
"Get",
"the",
"time",
"and",
"date",
"where",
"the",
"user",
"clicked",
"on",
"."
] | train | https://github.com/alamkanak/Android-Week-View/blob/dc3f97d65d44785d1a761b52b58527c86c4eee1b/library/src/main/java/com/alamkanak/weekview/WeekView.java#L750-L772 |
apache/incubator-gobblin | gobblin-modules/gobblin-compliance/src/main/java/org/apache/gobblin/compliance/purger/HivePurgerQueryTemplate.java | HivePurgerQueryTemplate.getCreateTableQuery | public static String getCreateTableQuery(String completeNewTableName, String likeTableDbName, String likeTableName,
String location) {
"""
If staging table doesn't exist, it will create a staging table.
"""
return getCreateTableQuery(completeNewTableName, likeTableDbName, likeTableName) + " LOCATION ... | java | public static String getCreateTableQuery(String completeNewTableName, String likeTableDbName, String likeTableName,
String location) {
return getCreateTableQuery(completeNewTableName, likeTableDbName, likeTableName) + " LOCATION " + PartitionUtils
.getQuotedString(location);
} | [
"public",
"static",
"String",
"getCreateTableQuery",
"(",
"String",
"completeNewTableName",
",",
"String",
"likeTableDbName",
",",
"String",
"likeTableName",
",",
"String",
"location",
")",
"{",
"return",
"getCreateTableQuery",
"(",
"completeNewTableName",
",",
"likeTab... | If staging table doesn't exist, it will create a staging table. | [
"If",
"staging",
"table",
"doesn",
"t",
"exist",
"it",
"will",
"create",
"a",
"staging",
"table",
"."
] | train | https://github.com/apache/incubator-gobblin/blob/f029b4c0fea0fe4aa62f36dda2512344ff708bae/gobblin-modules/gobblin-compliance/src/main/java/org/apache/gobblin/compliance/purger/HivePurgerQueryTemplate.java#L67-L71 |
gallandarakhneorg/afc | core/maths/mathgeom/tobeincluded/src/d3/continuous/AbstractTriangle3F.java | AbstractTriangle3F.getTriangleSegmentIntersectionFactorWithBadouelAlgorithm | @Pure
public static double getTriangleSegmentIntersectionFactorWithBadouelAlgorithm(
double tx1, double ty1, double tz1,
double tx2, double ty2, double tz2,
double tx3, double ty3, double tz3,
double sx1, double sy1, double sz1,
double sx2, double sy2, double sz2) {
"""
Replies the intersection fac... | java | @Pure
public static double getTriangleSegmentIntersectionFactorWithBadouelAlgorithm(
double tx1, double ty1, double tz1,
double tx2, double ty2, double tz2,
double tx3, double ty3, double tz3,
double sx1, double sy1, double sz1,
double sx2, double sy2, double sz2) {
// Compute the vectors of the trian... | [
"@",
"Pure",
"public",
"static",
"double",
"getTriangleSegmentIntersectionFactorWithBadouelAlgorithm",
"(",
"double",
"tx1",
",",
"double",
"ty1",
",",
"double",
"tz1",
",",
"double",
"tx2",
",",
"double",
"ty2",
",",
"double",
"tz2",
",",
"double",
"tx3",
",",
... | Replies the intersection factor of the given segment
when it is intersecting the triangle.
<p>
If the segment and the triangle are not intersecting, this
function replies {@link Double#NaN}.
If the segment and the triangle are intersecting,
this function replies the factor of the line's equation that
permits to retreiv... | [
"Replies",
"the",
"intersection",
"factor",
"of",
"the",
"given",
"segment",
"when",
"it",
"is",
"intersecting",
"the",
"triangle",
".",
"<p",
">",
"If",
"the",
"segment",
"and",
"the",
"triangle",
"are",
"not",
"intersecting",
"this",
"function",
"replies",
... | train | https://github.com/gallandarakhneorg/afc/blob/0c7d2e1ddefd4167ef788416d970a6c1ef6f8bbb/core/maths/mathgeom/tobeincluded/src/d3/continuous/AbstractTriangle3F.java#L1163-L1221 |
ben-manes/caffeine | simulator/src/main/java/com/github/benmanes/caffeine/cache/simulator/policy/sketch/WindowTinyLfuPolicy.java | WindowTinyLfuPolicy.policies | public static Set<Policy> policies(Config config) {
"""
Returns all variations of this policy based on the configuration parameters.
"""
WindowTinyLfuSettings settings = new WindowTinyLfuSettings(config);
return settings.percentMain().stream()
.map(percentMain -> new WindowTinyLfuPolicy(percent... | java | public static Set<Policy> policies(Config config) {
WindowTinyLfuSettings settings = new WindowTinyLfuSettings(config);
return settings.percentMain().stream()
.map(percentMain -> new WindowTinyLfuPolicy(percentMain, settings))
.collect(toSet());
} | [
"public",
"static",
"Set",
"<",
"Policy",
">",
"policies",
"(",
"Config",
"config",
")",
"{",
"WindowTinyLfuSettings",
"settings",
"=",
"new",
"WindowTinyLfuSettings",
"(",
"config",
")",
";",
"return",
"settings",
".",
"percentMain",
"(",
")",
".",
"stream",
... | Returns all variations of this policy based on the configuration parameters. | [
"Returns",
"all",
"variations",
"of",
"this",
"policy",
"based",
"on",
"the",
"configuration",
"parameters",
"."
] | train | https://github.com/ben-manes/caffeine/blob/4cf6d6e6a18ea2e8088f166261e5949343b0f2eb/simulator/src/main/java/com/github/benmanes/caffeine/cache/simulator/policy/sketch/WindowTinyLfuPolicy.java#L84-L89 |
ivanceras/orm | src/main/java/com/ivanceras/db/server/core/DB_PostgreSQL.java | DB_PostgreSQL.correctDataTypes | @Override
public void correctDataTypes(DAO[] daoList, ModelDef model) {
"""
Most of postgresql database datatype already mapped to the correct data type by the JDBC
"""
for(DAO dao : daoList){
correctDataTypes(dao, model);
}
} | java | @Override
public void correctDataTypes(DAO[] daoList, ModelDef model) {
for(DAO dao : daoList){
correctDataTypes(dao, model);
}
} | [
"@",
"Override",
"public",
"void",
"correctDataTypes",
"(",
"DAO",
"[",
"]",
"daoList",
",",
"ModelDef",
"model",
")",
"{",
"for",
"(",
"DAO",
"dao",
":",
"daoList",
")",
"{",
"correctDataTypes",
"(",
"dao",
",",
"model",
")",
";",
"}",
"}"
] | Most of postgresql database datatype already mapped to the correct data type by the JDBC | [
"Most",
"of",
"postgresql",
"database",
"datatype",
"already",
"mapped",
"to",
"the",
"correct",
"data",
"type",
"by",
"the",
"JDBC"
] | train | https://github.com/ivanceras/orm/blob/e63213cb8abefd11df0e2d34b1c95477788e600e/src/main/java/com/ivanceras/db/server/core/DB_PostgreSQL.java#L856-L861 |
eduarddrenth/ReportjFreeChartSupport | src/main/java/com/vectorprint/report/itext/style/stylers/Chart.java | Chart.createImage | @Override
protected Image createImage(PdfContentByte canvas, Dataset data, float opacity) throws VectorPrintException, BadElementException {
"""
calls {@link ChartBuilder#ChartBuilder(com.vectorprint.report.jfree.ChartBuilder.CHARTTYPE, org.jfree.data.general.Dataset, java.lang.String, java.lang.String, java.la... | java | @Override
protected Image createImage(PdfContentByte canvas, Dataset data, float opacity) throws VectorPrintException, BadElementException {
ChartBuilder cb = new ChartBuilder(getType(),
data, getTitle(), getTitle(), getValLabel(), isVertical(), isLegend(), getValue(THEMEBUILDER, ChartThemeBuilder.cl... | [
"@",
"Override",
"protected",
"Image",
"createImage",
"(",
"PdfContentByte",
"canvas",
",",
"Dataset",
"data",
",",
"float",
"opacity",
")",
"throws",
"VectorPrintException",
",",
"BadElementException",
"{",
"ChartBuilder",
"cb",
"=",
"new",
"ChartBuilder",
"(",
"... | calls {@link ChartBuilder#ChartBuilder(com.vectorprint.report.jfree.ChartBuilder.CHARTTYPE, org.jfree.data.general.Dataset, java.lang.String, java.lang.String, java.lang.String, com.vectorprint.report.jfree.ChartThemeBuilder, com.vectorprint.configuration.EnhancedMap)}, {@link ChartBuilder#getChart()
} and {@link Itext... | [
"calls",
"{",
"@link",
"ChartBuilder#ChartBuilder",
"(",
"com",
".",
"vectorprint",
".",
"report",
".",
"jfree",
".",
"ChartBuilder",
".",
"CHARTTYPE",
"org",
".",
"jfree",
".",
"data",
".",
"general",
".",
"Dataset",
"java",
".",
"lang",
".",
"String",
"j... | train | https://github.com/eduarddrenth/ReportjFreeChartSupport/blob/bd9790190a0149706d31066bbd9c09f8e015c9a5/src/main/java/com/vectorprint/report/itext/style/stylers/Chart.java#L110-L117 |
twilliamson/mogwee-logging | src/main/java/com/mogwee/logging/Logger.java | Logger.debugf | public final void debugf(String message, Object... args) {
"""
Logs a formatted message if DEBUG logging is enabled.
@param message a <a href="http://download.oracle.com/javase/6/docs/api/java/util/Formatter.html#syntax">format string</a>
@param args arguments referenced by the format specifiers in the form... | java | public final void debugf(String message, Object... args)
{
logf(Level.DEBUG, null, message, args);
} | [
"public",
"final",
"void",
"debugf",
"(",
"String",
"message",
",",
"Object",
"...",
"args",
")",
"{",
"logf",
"(",
"Level",
".",
"DEBUG",
",",
"null",
",",
"message",
",",
"args",
")",
";",
"}"
] | Logs a formatted message if DEBUG logging is enabled.
@param message a <a href="http://download.oracle.com/javase/6/docs/api/java/util/Formatter.html#syntax">format string</a>
@param args arguments referenced by the format specifiers in the format string | [
"Logs",
"a",
"formatted",
"message",
"if",
"DEBUG",
"logging",
"is",
"enabled",
"."
] | train | https://github.com/twilliamson/mogwee-logging/blob/30b99c2649de455432d956a8f6a74316de4cd62c/src/main/java/com/mogwee/logging/Logger.java#L83-L86 |
code4everything/util | src/main/java/com/zhazhapan/util/Utils.java | Utils.loadJsonToBean | public static <T> T loadJsonToBean(String jsonPath, String encoding, Class<T> clazz) throws IOException {
"""
加载JSON配置文件
@param jsonPath JSON文件路径
@param encoding 编码格式,为null时使用系统默认编码
@param clazz 类
@param <T> 类型值
@return Bean
@throws IOException 异常
@since 1.0.8
"""
JSONObject jsonObject = J... | java | public static <T> T loadJsonToBean(String jsonPath, String encoding, Class<T> clazz) throws IOException {
JSONObject jsonObject = JSONObject.parseObject(FileExecutor.readFileToString(new File(jsonPath), encoding));
return JSONObject.toJavaObject(jsonObject, clazz);
} | [
"public",
"static",
"<",
"T",
">",
"T",
"loadJsonToBean",
"(",
"String",
"jsonPath",
",",
"String",
"encoding",
",",
"Class",
"<",
"T",
">",
"clazz",
")",
"throws",
"IOException",
"{",
"JSONObject",
"jsonObject",
"=",
"JSONObject",
".",
"parseObject",
"(",
... | 加载JSON配置文件
@param jsonPath JSON文件路径
@param encoding 编码格式,为null时使用系统默认编码
@param clazz 类
@param <T> 类型值
@return Bean
@throws IOException 异常
@since 1.0.8 | [
"加载JSON配置文件"
] | train | https://github.com/code4everything/util/blob/1fc9f0ead1108f4d7208ba7c000df4244f708418/src/main/java/com/zhazhapan/util/Utils.java#L125-L128 |
guardtime/ksi-java-sdk | ksi-api/src/main/java/com/guardtime/ksi/unisignature/inmemory/InMemoryKsiSignature.java | InMemoryKsiSignature.sortAggregationHashChains | private List<AggregationHashChain> sortAggregationHashChains(List<AggregationHashChain> chains) throws InvalidSignatureException {
"""
Orders aggregation chains.
@param chains
aggregation chains to be ordered.
@return ordered list of aggregation chains
"""
Collections.sort(chains, new Comparator<A... | java | private List<AggregationHashChain> sortAggregationHashChains(List<AggregationHashChain> chains) throws InvalidSignatureException {
Collections.sort(chains, new Comparator<AggregationHashChain>() {
public int compare(AggregationHashChain chain1, AggregationHashChain chain2) {
return c... | [
"private",
"List",
"<",
"AggregationHashChain",
">",
"sortAggregationHashChains",
"(",
"List",
"<",
"AggregationHashChain",
">",
"chains",
")",
"throws",
"InvalidSignatureException",
"{",
"Collections",
".",
"sort",
"(",
"chains",
",",
"new",
"Comparator",
"<",
"Agg... | Orders aggregation chains.
@param chains
aggregation chains to be ordered.
@return ordered list of aggregation chains | [
"Orders",
"aggregation",
"chains",
"."
] | train | https://github.com/guardtime/ksi-java-sdk/blob/b2cd877050f0f392657c724452318d10a1002171/ksi-api/src/main/java/com/guardtime/ksi/unisignature/inmemory/InMemoryKsiSignature.java#L230-L237 |
cdk/cdk | base/data/src/main/java/org/openscience/cdk/AtomContainerSet.java | AtomContainerSet.replaceAtomContainer | @Override
public void replaceAtomContainer(int position, IAtomContainer container) {
"""
Replace the AtomContainer at a specific position (array has to be large enough).
@param position position in array for AtomContainer
@param container the replacement AtomContainer
"""
IAtomContainer old ... | java | @Override
public void replaceAtomContainer(int position, IAtomContainer container) {
IAtomContainer old = atomContainers[position];
old.removeListener(this);
atomContainers[position] = container;
container.addListener(this);
notifyChanged();
} | [
"@",
"Override",
"public",
"void",
"replaceAtomContainer",
"(",
"int",
"position",
",",
"IAtomContainer",
"container",
")",
"{",
"IAtomContainer",
"old",
"=",
"atomContainers",
"[",
"position",
"]",
";",
"old",
".",
"removeListener",
"(",
"this",
")",
";",
"at... | Replace the AtomContainer at a specific position (array has to be large enough).
@param position position in array for AtomContainer
@param container the replacement AtomContainer | [
"Replace",
"the",
"AtomContainer",
"at",
"a",
"specific",
"position",
"(",
"array",
"has",
"to",
"be",
"large",
"enough",
")",
"."
] | train | https://github.com/cdk/cdk/blob/c3d0f16502bf08df50365fee392e11d7c9856657/base/data/src/main/java/org/openscience/cdk/AtomContainerSet.java#L140-L147 |
app55/app55-java | src/support/java/com/googlecode/openbeans/beancontext/BeanContextServicesSupport.java | BeanContextServicesSupport.releaseServicesForChild | private void releaseServicesForChild(BCSSChild bcssChild, boolean delegatedServices) {
"""
Release all services requested by the given child.
@param bcssChild
a child
@param delegatedServices
only release services that are delegated to parent context
"""
if (bcssChild.serviceRecords == null || bcssChil... | java | private void releaseServicesForChild(BCSSChild bcssChild, boolean delegatedServices)
{
if (bcssChild.serviceRecords == null || bcssChild.serviceRecords.isEmpty())
{
return;
}
synchronized (bcssChild.child)
{
Object records[] = bcssChild.serviceRecords.toArray();
for (int i = 0; i < records.length; i... | [
"private",
"void",
"releaseServicesForChild",
"(",
"BCSSChild",
"bcssChild",
",",
"boolean",
"delegatedServices",
")",
"{",
"if",
"(",
"bcssChild",
".",
"serviceRecords",
"==",
"null",
"||",
"bcssChild",
".",
"serviceRecords",
".",
"isEmpty",
"(",
")",
")",
"{",... | Release all services requested by the given child.
@param bcssChild
a child
@param delegatedServices
only release services that are delegated to parent context | [
"Release",
"all",
"services",
"requested",
"by",
"the",
"given",
"child",
"."
] | train | https://github.com/app55/app55-java/blob/73e51d0f3141a859dfbd37ca9becef98477e553e/src/support/java/com/googlecode/openbeans/beancontext/BeanContextServicesSupport.java#L469-L494 |
Ordinastie/MalisisCore | src/main/java/net/malisis/core/asm/AsmUtils.java | AsmUtils.changeMethodAccess | public static Method changeMethodAccess(Class<?> clazz, String methodName, String srgName, String params) {
"""
Changes the access level for the specified method for a class.
@param clazz the clazz
@param methodName the method name
@param srgName the srg name
@param params the params
@return the method
... | java | public static Method changeMethodAccess(Class<?> clazz, String methodName, String srgName, String params)
{
return changeMethodAccess(clazz, methodName, srgName, false, new MethodDescriptor(params).getParams());
} | [
"public",
"static",
"Method",
"changeMethodAccess",
"(",
"Class",
"<",
"?",
">",
"clazz",
",",
"String",
"methodName",
",",
"String",
"srgName",
",",
"String",
"params",
")",
"{",
"return",
"changeMethodAccess",
"(",
"clazz",
",",
"methodName",
",",
"srgName",... | Changes the access level for the specified method for a class.
@param clazz the clazz
@param methodName the method name
@param srgName the srg name
@param params the params
@return the method | [
"Changes",
"the",
"access",
"level",
"for",
"the",
"specified",
"method",
"for",
"a",
"class",
"."
] | train | https://github.com/Ordinastie/MalisisCore/blob/4f8e1fa462d5c372fc23414482ba9f429881cc54/src/main/java/net/malisis/core/asm/AsmUtils.java#L383-L386 |
netarchivesuite/heritrix3-wrapper | src/main/java/org/netarchivesuite/heritrix3wrapper/Heritrix3Wrapper.java | Heritrix3Wrapper.createNewJob | public EngineResult createNewJob(String jobname) {
"""
Creates a new job and initialises it with the default cxml file which must be modified before launch.
@param jobname name of the new job
@return engine state and a list of registered jobs
"""
HttpPost postRequest = new HttpPost(baseUrl);
... | java | public EngineResult createNewJob(String jobname) {
HttpPost postRequest = new HttpPost(baseUrl);
List<NameValuePair> nvp = new LinkedList<NameValuePair>();
nvp.add(new BasicNameValuePair("action", "create"));
nvp.add(new BasicNameValuePair("createpath", jobname));
StringEntity po... | [
"public",
"EngineResult",
"createNewJob",
"(",
"String",
"jobname",
")",
"{",
"HttpPost",
"postRequest",
"=",
"new",
"HttpPost",
"(",
"baseUrl",
")",
";",
"List",
"<",
"NameValuePair",
">",
"nvp",
"=",
"new",
"LinkedList",
"<",
"NameValuePair",
">",
"(",
")"... | Creates a new job and initialises it with the default cxml file which must be modified before launch.
@param jobname name of the new job
@return engine state and a list of registered jobs | [
"Creates",
"a",
"new",
"job",
"and",
"initialises",
"it",
"with",
"the",
"default",
"cxml",
"file",
"which",
"must",
"be",
"modified",
"before",
"launch",
"."
] | train | https://github.com/netarchivesuite/heritrix3-wrapper/blob/e53ec5736cbac0bdd3925b5331737dc905871629/src/main/java/org/netarchivesuite/heritrix3wrapper/Heritrix3Wrapper.java#L275-L290 |
alkacon/opencms-core | src/org/opencms/module/CmsModuleManager.java | CmsModuleManager.updateModule | public synchronized void updateModule(CmsObject cms, CmsModule module)
throws CmsRoleViolationException, CmsConfigurationException {
"""
Updates a already configured module with new values.<p>
@param cms must be initialized with "Admin" permissions
@param module the module to update
@throws CmsRoleViola... | java | public synchronized void updateModule(CmsObject cms, CmsModule module)
throws CmsRoleViolationException, CmsConfigurationException {
// check for module manager role permissions
OpenCms.getRoleManager().checkRole(cms, CmsRole.DATABASE_MANAGER);
CmsModule oldModule = m_modules.get(module.ge... | [
"public",
"synchronized",
"void",
"updateModule",
"(",
"CmsObject",
"cms",
",",
"CmsModule",
"module",
")",
"throws",
"CmsRoleViolationException",
",",
"CmsConfigurationException",
"{",
"// check for module manager role permissions",
"OpenCms",
".",
"getRoleManager",
"(",
"... | Updates a already configured module with new values.<p>
@param cms must be initialized with "Admin" permissions
@param module the module to update
@throws CmsRoleViolationException if the required module manager role permissions are not available
@throws CmsConfigurationException if a module with this name is not ava... | [
"Updates",
"a",
"already",
"configured",
"module",
"with",
"new",
"values",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/module/CmsModuleManager.java#L985-L1034 |
looly/hutool | hutool-core/src/main/java/cn/hutool/core/util/ReUtil.java | ReUtil.extractMultiAndDelPre | public static String extractMultiAndDelPre(String regex, Holder<CharSequence> contentHolder, String template) {
"""
从content中匹配出多个值并根据template生成新的字符串<br>
例如:<br>
content 2013年5月 pattern (.*?)年(.*?)月 template: $1-$2 return 2013-5
@param regex 匹配正则字符串
@param contentHolder 被匹配的内容的Holder,value为内容正文,经过这个方法的原文将被去掉... | java | public static String extractMultiAndDelPre(String regex, Holder<CharSequence> contentHolder, String template) {
if (null == contentHolder || null == regex || null == template) {
return null;
}
// Pattern pattern = Pattern.compile(regex, Pattern.DOTALL);
final Pattern pattern = PatternPool.get(regex, P... | [
"public",
"static",
"String",
"extractMultiAndDelPre",
"(",
"String",
"regex",
",",
"Holder",
"<",
"CharSequence",
">",
"contentHolder",
",",
"String",
"template",
")",
"{",
"if",
"(",
"null",
"==",
"contentHolder",
"||",
"null",
"==",
"regex",
"||",
"null",
... | 从content中匹配出多个值并根据template生成新的字符串<br>
例如:<br>
content 2013年5月 pattern (.*?)年(.*?)月 template: $1-$2 return 2013-5
@param regex 匹配正则字符串
@param contentHolder 被匹配的内容的Holder,value为内容正文,经过这个方法的原文将被去掉匹配之前的内容
@param template 生成内容模板,变量 $1 表示group1的内容,以此类推
@return 按照template拼接后的字符串 | [
"从content中匹配出多个值并根据template生成新的字符串<br",
">",
"例如:<br",
">",
"content",
"2013年5月",
"pattern",
"(",
".",
"*",
"?",
")",
"年",
"(",
".",
"*",
"?",
")",
"月",
"template:",
"$1",
"-",
"$2",
"return",
"2013",
"-",
"5"
] | train | https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-core/src/main/java/cn/hutool/core/util/ReUtil.java#L260-L268 |
liferay/com-liferay-commerce | commerce-product-service/src/main/java/com/liferay/commerce/product/service/persistence/impl/CPDefinitionOptionRelPersistenceImpl.java | CPDefinitionOptionRelPersistenceImpl.findByGroupId | @Override
public List<CPDefinitionOptionRel> findByGroupId(long groupId, int start,
int end) {
"""
Returns a range of all the cp definition option rels where groupId = ?.
<p>
Useful when paginating results. Returns a maximum of <code>end - start</code> instances. <code>start</code> and <code>end</code> ... | java | @Override
public List<CPDefinitionOptionRel> findByGroupId(long groupId, int start,
int end) {
return findByGroupId(groupId, start, end, null);
} | [
"@",
"Override",
"public",
"List",
"<",
"CPDefinitionOptionRel",
">",
"findByGroupId",
"(",
"long",
"groupId",
",",
"int",
"start",
",",
"int",
"end",
")",
"{",
"return",
"findByGroupId",
"(",
"groupId",
",",
"start",
",",
"end",
",",
"null",
")",
";",
"... | Returns a range of all the cp definition option rels where groupId = ?.
<p>
Useful when paginating results. Returns a maximum of <code>end - start</code> instances. <code>start</code> and <code>end</code> are not primary keys, they are indexes in the result set. Thus, <code>0</code> refers to the first result in t... | [
"Returns",
"a",
"range",
"of",
"all",
"the",
"cp",
"definition",
"option",
"rels",
"where",
"groupId",
"=",
"?",
";",
"."
] | train | https://github.com/liferay/com-liferay-commerce/blob/9e54362d7f59531fc684016ba49ee7cdc3a2f22b/commerce-product-service/src/main/java/com/liferay/commerce/product/service/persistence/impl/CPDefinitionOptionRelPersistenceImpl.java#L1541-L1545 |
google/closure-compiler | src/com/google/javascript/rhino/jstype/JSTypeRegistry.java | JSTypeRegistry.getLookupScope | private static StaticScope getLookupScope(StaticScope scope, String name) {
"""
@return Which scope in the provided scope chain the provided name is declared in, or else null.
This assumed that the Scope construction is
complete. It can not be used during scope construction to determine if a name is already
... | java | private static StaticScope getLookupScope(StaticScope scope, String name) {
if (scope != null && scope.getParentScope() != null) {
StaticSlot slot = scope.getSlot(getRootElementOfName(name));
return slot != null ? slot.getScope() : null;
}
return scope;
} | [
"private",
"static",
"StaticScope",
"getLookupScope",
"(",
"StaticScope",
"scope",
",",
"String",
"name",
")",
"{",
"if",
"(",
"scope",
"!=",
"null",
"&&",
"scope",
".",
"getParentScope",
"(",
")",
"!=",
"null",
")",
"{",
"StaticSlot",
"slot",
"=",
"scope"... | @return Which scope in the provided scope chain the provided name is declared in, or else null.
This assumed that the Scope construction is
complete. It can not be used during scope construction to determine if a name is already
defined as a shadowed name from a parent scope would be returned. | [
"@return",
"Which",
"scope",
"in",
"the",
"provided",
"scope",
"chain",
"the",
"provided",
"name",
"is",
"declared",
"in",
"or",
"else",
"null",
"."
] | train | https://github.com/google/closure-compiler/blob/d81e36740f6a9e8ac31a825ee8758182e1dc5aae/src/com/google/javascript/rhino/jstype/JSTypeRegistry.java#L784-L790 |
vznet/mongo-jackson-mapper | src/main/java/net/vz/mongodb/jackson/DBUpdate.java | DBUpdate.pushAll | public static Builder pushAll(String field, Object... values) {
"""
Add all of the given values to the array value at the specified field atomically
@param field The field to add the values to
@param values The values to add
@return this object
"""
return new Builder().pushAll(field, values);
... | java | public static Builder pushAll(String field, Object... values) {
return new Builder().pushAll(field, values);
} | [
"public",
"static",
"Builder",
"pushAll",
"(",
"String",
"field",
",",
"Object",
"...",
"values",
")",
"{",
"return",
"new",
"Builder",
"(",
")",
".",
"pushAll",
"(",
"field",
",",
"values",
")",
";",
"}"
] | Add all of the given values to the array value at the specified field atomically
@param field The field to add the values to
@param values The values to add
@return this object | [
"Add",
"all",
"of",
"the",
"given",
"values",
"to",
"the",
"array",
"value",
"at",
"the",
"specified",
"field",
"atomically"
] | train | https://github.com/vznet/mongo-jackson-mapper/blob/ecd189aefa89636cddf70fb383f5d676be347976/src/main/java/net/vz/mongodb/jackson/DBUpdate.java#L101-L103 |
alkacon/opencms-core | src/org/opencms/main/CmsSessionManager.java | CmsSessionManager.updateSessionInfo | public void updateSessionInfo(CmsObject cms, HttpServletRequest req) {
"""
Updates the the OpenCms session data used for quick authentication of users.<p>
This is required if the user data (current group or project) was changed in
the requested document.<p>
The user data is only updated if the user was auth... | java | public void updateSessionInfo(CmsObject cms, HttpServletRequest req) {
if (!cms.getRequestContext().isUpdateSessionEnabled()) {
// this request must not update the user session info
// this is true for long running "thread" requests, e.g. during project publish
return;
... | [
"public",
"void",
"updateSessionInfo",
"(",
"CmsObject",
"cms",
",",
"HttpServletRequest",
"req",
")",
"{",
"if",
"(",
"!",
"cms",
".",
"getRequestContext",
"(",
")",
".",
"isUpdateSessionEnabled",
"(",
")",
")",
"{",
"// this request must not update the user sessio... | Updates the the OpenCms session data used for quick authentication of users.<p>
This is required if the user data (current group or project) was changed in
the requested document.<p>
The user data is only updated if the user was authenticated to the system.
@param cms the current OpenCms user context
@param req the ... | [
"Updates",
"the",
"the",
"OpenCms",
"session",
"data",
"used",
"for",
"quick",
"authentication",
"of",
"users",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/main/CmsSessionManager.java#L567-L606 |
matthewhorridge/owlapi-gwt | owlapi-gwt-serialization/src/main/java/uk/ac/manchester/cs/owl/owlapi/OWLHasKeyAxiomImpl_CustomFieldSerializer.java | OWLHasKeyAxiomImpl_CustomFieldSerializer.deserializeInstance | @Override
public void deserializeInstance(SerializationStreamReader streamReader, OWLHasKeyAxiomImpl instance) throws SerializationException {
"""
Deserializes the content of the object from the
{@link com.google.gwt.user.client.rpc.SerializationStreamReader}.
@param streamReader the {@link com.google.gwt.... | java | @Override
public void deserializeInstance(SerializationStreamReader streamReader, OWLHasKeyAxiomImpl instance) throws SerializationException {
deserialize(streamReader, instance);
} | [
"@",
"Override",
"public",
"void",
"deserializeInstance",
"(",
"SerializationStreamReader",
"streamReader",
",",
"OWLHasKeyAxiomImpl",
"instance",
")",
"throws",
"SerializationException",
"{",
"deserialize",
"(",
"streamReader",
",",
"instance",
")",
";",
"}"
] | Deserializes the content of the object from the
{@link com.google.gwt.user.client.rpc.SerializationStreamReader}.
@param streamReader the {@link com.google.gwt.user.client.rpc.SerializationStreamReader} to read the
object's content from
@param instance the object instance to deserialize
@throws com.google.gwt.user... | [
"Deserializes",
"the",
"content",
"of",
"the",
"object",
"from",
"the",
"{",
"@link",
"com",
".",
"google",
".",
"gwt",
".",
"user",
".",
"client",
".",
"rpc",
".",
"SerializationStreamReader",
"}",
"."
] | train | https://github.com/matthewhorridge/owlapi-gwt/blob/7ab975fb6cef3c8947099983551672a3b5d4e2fd/owlapi-gwt-serialization/src/main/java/uk/ac/manchester/cs/owl/owlapi/OWLHasKeyAxiomImpl_CustomFieldSerializer.java#L98-L101 |
forge/core | addons/impl/src/main/java/org/jboss/forge/addon/addons/project/AddonProjectConfiguratorImpl.java | AddonProjectConfiguratorImpl.dependsOnAddon | @Override
public boolean dependsOnAddon(final Project project, AddonId addonId) {
"""
Checks if the {@link Project} depends on the provided {@link AddonId}
"""
DependencyInstaller dependencyInstaller = getDependencyInstaller();
Dependency dependency = toDependency(addonId);
return dependen... | java | @Override
public boolean dependsOnAddon(final Project project, AddonId addonId)
{
DependencyInstaller dependencyInstaller = getDependencyInstaller();
Dependency dependency = toDependency(addonId);
return dependencyInstaller.isInstalled(project, dependency);
} | [
"@",
"Override",
"public",
"boolean",
"dependsOnAddon",
"(",
"final",
"Project",
"project",
",",
"AddonId",
"addonId",
")",
"{",
"DependencyInstaller",
"dependencyInstaller",
"=",
"getDependencyInstaller",
"(",
")",
";",
"Dependency",
"dependency",
"=",
"toDependency"... | Checks if the {@link Project} depends on the provided {@link AddonId} | [
"Checks",
"if",
"the",
"{"
] | train | https://github.com/forge/core/blob/e140eb03bbe2b3409478ad70c86c3edbef6d9a0c/addons/impl/src/main/java/org/jboss/forge/addon/addons/project/AddonProjectConfiguratorImpl.java#L214-L220 |
wigforss/Ka-Commons-Reflection | src/main/java/org/kasource/commons/reflection/util/ConstructorUtils.java | ConstructorUtils.getInstance | @SuppressWarnings("unchecked")
public static <T> T getInstance(String className, Class<T> ofType, Class<?>[] constructorParams, Object[] constructorArgs) {
"""
Returns a new object of <i>className</i>. The objected is casted to the <i>ofType</i>, which is either super class or interface of the className class.... | java | @SuppressWarnings("unchecked")
public static <T> T getInstance(String className, Class<T> ofType, Class<?>[] constructorParams, Object[] constructorArgs) {
Constructor<?> constructor = null;
try {
Class<?> clazz = Class.forName(className);
constructor = clazz.getConstructor(c... | [
"@",
"SuppressWarnings",
"(",
"\"unchecked\"",
")",
"public",
"static",
"<",
"T",
">",
"T",
"getInstance",
"(",
"String",
"className",
",",
"Class",
"<",
"T",
">",
"ofType",
",",
"Class",
"<",
"?",
">",
"[",
"]",
"constructorParams",
",",
"Object",
"[",
... | Returns a new object of <i>className</i>. The objected is casted to the <i>ofType</i>, which is either super class or interface of the className class.
@param className Name of the class to instanciate an object of
@param ofType An super class or interface of the className class.
@param constructorA... | [
"Returns",
"a",
"new",
"object",
"of",
"<i",
">",
"className<",
"/",
"i",
">",
".",
"The",
"objected",
"is",
"casted",
"to",
"the",
"<i",
">",
"ofType<",
"/",
"i",
">",
"which",
"is",
"either",
"super",
"class",
"or",
"interface",
"of",
"the",
"class... | train | https://github.com/wigforss/Ka-Commons-Reflection/blob/a80f7a164cd800089e4f4dd948ca6f0e7badcf33/src/main/java/org/kasource/commons/reflection/util/ConstructorUtils.java#L131-L149 |
alkacon/opencms-core | src/org/opencms/db/CmsDriverManager.java | CmsDriverManager.setParentGroup | public void setParentGroup(CmsDbContext dbc, String groupName, String parentGroupName)
throws CmsException, CmsDataAccessException {
"""
Sets a new parent group for an already existing group.<p>
@param dbc the current database context
@param groupName the name of the group that should be written
@param pa... | java | public void setParentGroup(CmsDbContext dbc, String groupName, String parentGroupName)
throws CmsException, CmsDataAccessException {
CmsGroup group = readGroup(dbc, groupName);
CmsUUID parentGroupId = CmsUUID.getNullUUID();
// if the group exists, use its id, else set to unknown.
i... | [
"public",
"void",
"setParentGroup",
"(",
"CmsDbContext",
"dbc",
",",
"String",
"groupName",
",",
"String",
"parentGroupName",
")",
"throws",
"CmsException",
",",
"CmsDataAccessException",
"{",
"CmsGroup",
"group",
"=",
"readGroup",
"(",
"dbc",
",",
"groupName",
")... | Sets a new parent group for an already existing group.<p>
@param dbc the current database context
@param groupName the name of the group that should be written
@param parentGroupName the name of the parent group to set,
or <code>null</code> if the parent
group should be deleted.
@throws CmsException if operation was ... | [
"Sets",
"a",
"new",
"parent",
"group",
"for",
"an",
"already",
"existing",
"group",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/db/CmsDriverManager.java#L8961-L8976 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.