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 |
|---|---|---|---|---|---|---|---|---|---|---|
eclipse/xtext-extras | org.eclipse.xtext.xbase/src/org/eclipse/xtext/xbase/typesystem/computation/CollectionLiteralsTypeComputer.java | CollectionLiteralsTypeComputer.normalizeElementType | protected LightweightTypeReference normalizeElementType(LightweightTypeReference collectionElementType, LightweightTypeReference expectedCollectionType, ITypeReferenceOwner owner) {
"""
The expected collection type may drive the type of the elements in the collection if the type is used as an
invariant type. In o... | java | protected LightweightTypeReference normalizeElementType(LightweightTypeReference collectionElementType, LightweightTypeReference expectedCollectionType, ITypeReferenceOwner owner) {
if (isIterableExpectation(expectedCollectionType)) {
LightweightTypeReference expectedElementType = getElementOrComponentType(expecte... | [
"protected",
"LightweightTypeReference",
"normalizeElementType",
"(",
"LightweightTypeReference",
"collectionElementType",
",",
"LightweightTypeReference",
"expectedCollectionType",
",",
"ITypeReferenceOwner",
"owner",
")",
"{",
"if",
"(",
"isIterableExpectation",
"(",
"expectedC... | The expected collection type may drive the type of the elements in the collection if the type is used as an
invariant type. In other word, an expectation of the form
{@code Collection<CharSequence>} may yield a type {@code List<CharSequence>} for the literal
{@code ['a']} even though it would be {@code List<? extends S... | [
"The",
"expected",
"collection",
"type",
"may",
"drive",
"the",
"type",
"of",
"the",
"elements",
"in",
"the",
"collection",
"if",
"the",
"type",
"is",
"used",
"as",
"an",
"invariant",
"type",
".",
"In",
"other",
"word",
"an",
"expectation",
"of",
"the",
... | train | https://github.com/eclipse/xtext-extras/blob/451359541295323a29f5855e633f770cec02069a/org.eclipse.xtext.xbase/src/org/eclipse/xtext/xbase/typesystem/computation/CollectionLiteralsTypeComputer.java#L314-L320 |
OpenLiberty/open-liberty | dev/com.ibm.ws.session/src/com/ibm/ws/session/SessionContext.java | SessionContext.addHttpSessionListener | public void addHttpSessionListener(ArrayList al, String j2eeName) {
"""
/*
Adds a list of Session Listeners
For shared session context or global sesions, we call
this method to add each app's listeners.
"""
if (com.ibm.ejs.ras.TraceComponent.isAnyTracingEnabled() && LoggingUtil.SESSION_LOGGER_CORE.i... | java | public void addHttpSessionListener(ArrayList al, String j2eeName) {
if (com.ibm.ejs.ras.TraceComponent.isAnyTracingEnabled() && LoggingUtil.SESSION_LOGGER_CORE.isLoggable(Level.FINE)) {
LoggingUtil.SESSION_LOGGER_CORE.entering(methodClassName, methodNames[ADD_HTTP_SESSION_LISTENER], "addHttpSessionL... | [
"public",
"void",
"addHttpSessionListener",
"(",
"ArrayList",
"al",
",",
"String",
"j2eeName",
")",
"{",
"if",
"(",
"com",
".",
"ibm",
".",
"ejs",
".",
"ras",
".",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
"&&",
"LoggingUtil",
".",
"SESSION_LOG... | /*
Adds a list of Session Listeners
For shared session context or global sesions, we call
this method to add each app's listeners. | [
"/",
"*",
"Adds",
"a",
"list",
"of",
"Session",
"Listeners",
"For",
"shared",
"session",
"context",
"or",
"global",
"sesions",
"we",
"call",
"this",
"method",
"to",
"add",
"each",
"app",
"s",
"listeners",
"."
] | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.session/src/com/ibm/ws/session/SessionContext.java#L825-L847 |
fabric8io/docker-maven-plugin | src/main/java/io/fabric8/maven/docker/service/RunService.java | RunService.createPortMapping | public PortMapping createPortMapping(RunImageConfiguration runConfig, Properties properties) {
"""
Create port mapping for a specific configuration as it can be used when creating containers
@param runConfig the cun configuration
@param properties properties to lookup variables
@return the portmapping
"""... | java | public PortMapping createPortMapping(RunImageConfiguration runConfig, Properties properties) {
try {
return new PortMapping(runConfig.getPorts(), properties);
} catch (IllegalArgumentException exp) {
throw new IllegalArgumentException("Cannot parse port mapping", exp);
}
... | [
"public",
"PortMapping",
"createPortMapping",
"(",
"RunImageConfiguration",
"runConfig",
",",
"Properties",
"properties",
")",
"{",
"try",
"{",
"return",
"new",
"PortMapping",
"(",
"runConfig",
".",
"getPorts",
"(",
")",
",",
"properties",
")",
";",
"}",
"catch"... | Create port mapping for a specific configuration as it can be used when creating containers
@param runConfig the cun configuration
@param properties properties to lookup variables
@return the portmapping | [
"Create",
"port",
"mapping",
"for",
"a",
"specific",
"configuration",
"as",
"it",
"can",
"be",
"used",
"when",
"creating",
"containers"
] | train | https://github.com/fabric8io/docker-maven-plugin/blob/70ce4f56125d8efb8ddcf2ad4dbb5d6e2c7642b3/src/main/java/io/fabric8/maven/docker/service/RunService.java#L250-L256 |
Impetus/Kundera | src/data-as-object/src/main/java/com/impetus/core/DefaultKunderaEntity.java | DefaultKunderaEntity.setSchemaAndPU | private static void setSchemaAndPU(Class<?> clazz, EntityMetadata metadata) {
"""
Sets the schema and pu.
@param clazz
the clazz
@param metadata
the metadata
"""
Table table = clazz.getAnnotation(Table.class);
if (table != null)
{
metadata.setTableName(!StringUtils.isB... | java | private static void setSchemaAndPU(Class<?> clazz, EntityMetadata metadata)
{
Table table = clazz.getAnnotation(Table.class);
if (table != null)
{
metadata.setTableName(!StringUtils.isBlank(table.name()) ? table.name() : clazz.getSimpleName());
String schemaStr = tabl... | [
"private",
"static",
"void",
"setSchemaAndPU",
"(",
"Class",
"<",
"?",
">",
"clazz",
",",
"EntityMetadata",
"metadata",
")",
"{",
"Table",
"table",
"=",
"clazz",
".",
"getAnnotation",
"(",
"Table",
".",
"class",
")",
";",
"if",
"(",
"table",
"!=",
"null"... | Sets the schema and pu.
@param clazz
the clazz
@param metadata
the metadata | [
"Sets",
"the",
"schema",
"and",
"pu",
"."
] | train | https://github.com/Impetus/Kundera/blob/268958ab1ec09d14ec4d9184f0c8ded7a9158908/src/data-as-object/src/main/java/com/impetus/core/DefaultKunderaEntity.java#L120-L141 |
UrielCh/ovh-java-sdk | ovh-java-sdk-dedicatednas/src/main/java/net/minidev/ovh/api/ApiOvhDedicatednas.java | ApiOvhDedicatednas.serviceName_partition_partitionName_PUT | public void serviceName_partition_partitionName_PUT(String serviceName, String partitionName, OvhPartition body) throws IOException {
"""
Alter this object properties
REST: PUT /dedicated/nas/{serviceName}/partition/{partitionName}
@param body [required] New object properties
@param serviceName [required] The... | java | public void serviceName_partition_partitionName_PUT(String serviceName, String partitionName, OvhPartition body) throws IOException {
String qPath = "/dedicated/nas/{serviceName}/partition/{partitionName}";
StringBuilder sb = path(qPath, serviceName, partitionName);
exec(qPath, "PUT", sb.toString(), body);
} | [
"public",
"void",
"serviceName_partition_partitionName_PUT",
"(",
"String",
"serviceName",
",",
"String",
"partitionName",
",",
"OvhPartition",
"body",
")",
"throws",
"IOException",
"{",
"String",
"qPath",
"=",
"\"/dedicated/nas/{serviceName}/partition/{partitionName}\"",
";"... | Alter this object properties
REST: PUT /dedicated/nas/{serviceName}/partition/{partitionName}
@param body [required] New object properties
@param serviceName [required] The internal name of your storage
@param partitionName [required] the given name of partition | [
"Alter",
"this",
"object",
"properties"
] | train | https://github.com/UrielCh/ovh-java-sdk/blob/6d531a40e56e09701943e334c25f90f640c55701/ovh-java-sdk-dedicatednas/src/main/java/net/minidev/ovh/api/ApiOvhDedicatednas.java#L209-L213 |
alkacon/opencms-core | src/org/opencms/util/CmsStringUtil.java | CmsStringUtil.collectionAsString | public static String collectionAsString(Collection<?> collection, String separator) {
"""
Returns a string representation for the given collection using the given separator.<p>
@param collection the collection to print
@param separator the item separator
@return the string representation for the given colle... | java | public static String collectionAsString(Collection<?> collection, String separator) {
StringBuffer string = new StringBuffer(128);
Iterator<?> it = collection.iterator();
while (it.hasNext()) {
string.append(it.next());
if (it.hasNext()) {
string.append(s... | [
"public",
"static",
"String",
"collectionAsString",
"(",
"Collection",
"<",
"?",
">",
"collection",
",",
"String",
"separator",
")",
"{",
"StringBuffer",
"string",
"=",
"new",
"StringBuffer",
"(",
"128",
")",
";",
"Iterator",
"<",
"?",
">",
"it",
"=",
"col... | Returns a string representation for the given collection using the given separator.<p>
@param collection the collection to print
@param separator the item separator
@return the string representation for the given collection | [
"Returns",
"a",
"string",
"representation",
"for",
"the",
"given",
"collection",
"using",
"the",
"given",
"separator",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/util/CmsStringUtil.java#L303-L314 |
RobotiumTech/robotium | robotium-solo/src/main/java/com/robotium/solo/Solo.java | Solo.waitForCondition | public boolean waitForCondition(Condition condition, final int timeout) {
"""
Waits for a condition to be satisfied.
@param condition the condition to wait for
@param timeout the amount of time in milliseconds to wait
@return {@code true} if condition is satisfied and {@code false} if it is not satisfied befo... | java | public boolean waitForCondition(Condition condition, final int timeout){
if(config.commandLogging){
Log.d(config.commandLoggingTag, "waitForCondition("+condition+","+timeout+")");
}
return waiter.waitForCondition(condition, timeout);
} | [
"public",
"boolean",
"waitForCondition",
"(",
"Condition",
"condition",
",",
"final",
"int",
"timeout",
")",
"{",
"if",
"(",
"config",
".",
"commandLogging",
")",
"{",
"Log",
".",
"d",
"(",
"config",
".",
"commandLoggingTag",
",",
"\"waitForCondition(\"",
"+",... | Waits for a condition to be satisfied.
@param condition the condition to wait for
@param timeout the amount of time in milliseconds to wait
@return {@code true} if condition is satisfied and {@code false} if it is not satisfied before the timeout | [
"Waits",
"for",
"a",
"condition",
"to",
"be",
"satisfied",
"."
] | train | https://github.com/RobotiumTech/robotium/blob/75e567c38f26a6a87dc8bef90b3886a20e28d291/robotium-solo/src/main/java/com/robotium/solo/Solo.java#L716-L722 |
Azure/azure-sdk-for-java | applicationinsights/data-plane/src/main/java/com/microsoft/azure/applicationinsights/query/implementation/QuerysImpl.java | QuerysImpl.executeAsync | public Observable<QueryResults> executeAsync(String appId, QueryBody body) {
"""
Execute an Analytics query.
Executes an Analytics query for data. [Here](https://dev.applicationinsights.io/documentation/Using-the-API/Query) is an example for using POST with an Analytics query.
@param appId ID of the applicatio... | java | public Observable<QueryResults> executeAsync(String appId, QueryBody body) {
return executeWithServiceResponseAsync(appId, body).map(new Func1<ServiceResponse<QueryResults>, QueryResults>() {
@Override
public QueryResults call(ServiceResponse<QueryResults> response) {
ret... | [
"public",
"Observable",
"<",
"QueryResults",
">",
"executeAsync",
"(",
"String",
"appId",
",",
"QueryBody",
"body",
")",
"{",
"return",
"executeWithServiceResponseAsync",
"(",
"appId",
",",
"body",
")",
".",
"map",
"(",
"new",
"Func1",
"<",
"ServiceResponse",
... | Execute an Analytics query.
Executes an Analytics query for data. [Here](https://dev.applicationinsights.io/documentation/Using-the-API/Query) is an example for using POST with an Analytics query.
@param appId ID of the application. This is Application ID from the API Access settings blade in the Azure portal.
@param ... | [
"Execute",
"an",
"Analytics",
"query",
".",
"Executes",
"an",
"Analytics",
"query",
"for",
"data",
".",
"[",
"Here",
"]",
"(",
"https",
":",
"//",
"dev",
".",
"applicationinsights",
".",
"io",
"/",
"documentation",
"/",
"Using",
"-",
"the",
"-",
"API",
... | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/applicationinsights/data-plane/src/main/java/com/microsoft/azure/applicationinsights/query/implementation/QuerysImpl.java#L102-L109 |
nguillaumin/slick2d-maven | slick2d-core/src/main/java/org/newdawn/slick/Input.java | Input.fireControlPress | private void fireControlPress(int index, int controllerIndex) {
"""
Fire an event indicating that a control has been pressed
@param index The index of the control pressed
@param controllerIndex The index of the controller on which the control was pressed
"""
consumed = false;
for (int i=0;i<controlle... | java | private void fireControlPress(int index, int controllerIndex) {
consumed = false;
for (int i=0;i<controllerListeners.size();i++) {
ControllerListener listener = (ControllerListener) controllerListeners.get(i);
if (listener.isAcceptingInput()) {
switch (index) {
case LEFT:
listener.controll... | [
"private",
"void",
"fireControlPress",
"(",
"int",
"index",
",",
"int",
"controllerIndex",
")",
"{",
"consumed",
"=",
"false",
";",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
"<",
"controllerListeners",
".",
"size",
"(",
")",
";",
"i",
"++",
")",
"{... | Fire an event indicating that a control has been pressed
@param index The index of the control pressed
@param controllerIndex The index of the controller on which the control was pressed | [
"Fire",
"an",
"event",
"indicating",
"that",
"a",
"control",
"has",
"been",
"pressed"
] | train | https://github.com/nguillaumin/slick2d-maven/blob/8251f88a0ed6a70e726d2468842455cd1f80893f/slick2d-core/src/main/java/org/newdawn/slick/Input.java#L1403-L1431 |
spring-projects/spring-retry | src/main/java/org/springframework/retry/support/RetryTemplateBuilder.java | RetryTemplateBuilder.uniformRandomBackoff | public RetryTemplateBuilder uniformRandomBackoff(long minInterval, long maxInterval) {
"""
Use {@link UniformRandomBackOffPolicy}, see it's doc for details.
@param minInterval in milliseconds
@param maxInterval in milliseconds
@return this
@see UniformRandomBackOffPolicy
"""
Assert.isNull(this.backOffPol... | java | public RetryTemplateBuilder uniformRandomBackoff(long minInterval, long maxInterval) {
Assert.isNull(this.backOffPolicy, "You have already selected backoff policy");
Assert.isTrue(minInterval >= 1, "Min interval should be >= 1");
Assert.isTrue(maxInterval >= 1, "Max interval should be >= 1");
Assert.isTrue(maxI... | [
"public",
"RetryTemplateBuilder",
"uniformRandomBackoff",
"(",
"long",
"minInterval",
",",
"long",
"maxInterval",
")",
"{",
"Assert",
".",
"isNull",
"(",
"this",
".",
"backOffPolicy",
",",
"\"You have already selected backoff policy\"",
")",
";",
"Assert",
".",
"isTru... | Use {@link UniformRandomBackOffPolicy}, see it's doc for details.
@param minInterval in milliseconds
@param maxInterval in milliseconds
@return this
@see UniformRandomBackOffPolicy | [
"Use",
"{"
] | train | https://github.com/spring-projects/spring-retry/blob/e2b0555f96594c2321990d0deeac45fc44d4f123/src/main/java/org/springframework/retry/support/RetryTemplateBuilder.java#L240-L251 |
RestComm/media-core | control/mgcp/src/main/java/org/restcomm/media/core/control/mgcp/call/MgcpCall.java | MgcpCall.addConnection | public boolean addConnection(String endpointId, int connectionId) {
"""
Registers a connection in the call.
@param endpointId The identifier of the endpoint that owns the connection.
@param connectionId The connection identifier.
@return Returns <code>true</code> if connection was successfully registered. Ret... | java | public boolean addConnection(String endpointId, int connectionId) {
boolean added = this.entries.put(endpointId, connectionId);
if (added && log.isDebugEnabled()) {
int left = this.entries.get(endpointId).size();
log.debug("Call " + getCallIdHex() + " registered connection " + In... | [
"public",
"boolean",
"addConnection",
"(",
"String",
"endpointId",
",",
"int",
"connectionId",
")",
"{",
"boolean",
"added",
"=",
"this",
".",
"entries",
".",
"put",
"(",
"endpointId",
",",
"connectionId",
")",
";",
"if",
"(",
"added",
"&&",
"log",
".",
... | Registers a connection in the call.
@param endpointId The identifier of the endpoint that owns the connection.
@param connectionId The connection identifier.
@return Returns <code>true</code> if connection was successfully registered. Returns <code>false</code> otherwise. | [
"Registers",
"a",
"connection",
"in",
"the",
"call",
"."
] | train | https://github.com/RestComm/media-core/blob/07b8703343708599f60af66bae62aded77ee81b5/control/mgcp/src/main/java/org/restcomm/media/core/control/mgcp/call/MgcpCall.java#L106-L113 |
prestodb/presto | presto-parquet/src/main/java/com/facebook/presto/parquet/reader/ListColumnReader.java | ListColumnReader.calculateCollectionOffsets | public static void calculateCollectionOffsets(Field field, IntList offsets, BooleanList collectionIsNull, int[] definitionLevels, int[] repetitionLevels) {
"""
Each collection (Array or Map) has four variants of presence:
1) Collection is not defined, because one of it's optional parent fields is null
2) Collect... | java | public static void calculateCollectionOffsets(Field field, IntList offsets, BooleanList collectionIsNull, int[] definitionLevels, int[] repetitionLevels)
{
int maxDefinitionLevel = field.getDefinitionLevel();
int maxElementRepetitionLevel = field.getRepetitionLevel() + 1;
boolean required = ... | [
"public",
"static",
"void",
"calculateCollectionOffsets",
"(",
"Field",
"field",
",",
"IntList",
"offsets",
",",
"BooleanList",
"collectionIsNull",
",",
"int",
"[",
"]",
"definitionLevels",
",",
"int",
"[",
"]",
"repetitionLevels",
")",
"{",
"int",
"maxDefinitionL... | Each collection (Array or Map) has four variants of presence:
1) Collection is not defined, because one of it's optional parent fields is null
2) Collection is null
3) Collection is defined but empty
4) Collection is defined and not empty. In this case offset value is increased by the number of elements in that collect... | [
"Each",
"collection",
"(",
"Array",
"or",
"Map",
")",
"has",
"four",
"variants",
"of",
"presence",
":",
"1",
")",
"Collection",
"is",
"not",
"defined",
"because",
"one",
"of",
"it",
"s",
"optional",
"parent",
"fields",
"is",
"null",
"2",
")",
"Collection... | train | https://github.com/prestodb/presto/blob/89de5e379d8f85e139d292b0add8c537a2a01a88/presto-parquet/src/main/java/com/facebook/presto/parquet/reader/ListColumnReader.java#L34-L59 |
SvenEwald/xmlbeam | src/main/java/org/xmlbeam/DefaultXPathBinder.java | DefaultXPathBinder.asDate | @Override
public CloseableValue<Date> asDate() {
"""
Evaluates the XPath as a Date value. This method is just a shortcut for as(Date.class); You
probably want to specify ' using ' followed by some formatting pattern consecutive to the
XPAth.
@return Date value of evaluation result.
"""
final C... | java | @Override
public CloseableValue<Date> asDate() {
final Class<?> callerClass = ReflectionHelper.getDirectCallerClass();
return bindSingeValue(Date.class, callerClass);
} | [
"@",
"Override",
"public",
"CloseableValue",
"<",
"Date",
">",
"asDate",
"(",
")",
"{",
"final",
"Class",
"<",
"?",
">",
"callerClass",
"=",
"ReflectionHelper",
".",
"getDirectCallerClass",
"(",
")",
";",
"return",
"bindSingeValue",
"(",
"Date",
".",
"class"... | Evaluates the XPath as a Date value. This method is just a shortcut for as(Date.class); You
probably want to specify ' using ' followed by some formatting pattern consecutive to the
XPAth.
@return Date value of evaluation result. | [
"Evaluates",
"the",
"XPath",
"as",
"a",
"Date",
"value",
".",
"This",
"method",
"is",
"just",
"a",
"shortcut",
"for",
"as",
"(",
"Date",
".",
"class",
")",
";",
"You",
"probably",
"want",
"to",
"specify",
"using",
"followed",
"by",
"some",
"formatting",
... | train | https://github.com/SvenEwald/xmlbeam/blob/acaac1b8fa28d246f17187f5e3c6696458a0b447/src/main/java/org/xmlbeam/DefaultXPathBinder.java#L111-L115 |
hazelcast/hazelcast | hazelcast/src/main/java/com/hazelcast/mapreduce/aggregation/Aggregations.java | Aggregations.bigIntegerAvg | public static <Key, Value> Aggregation<Key, BigInteger, BigInteger> bigIntegerAvg() {
"""
Returns an aggregation to calculate the {@link java.math.BigInteger} average
of all supplied values.<br/>
This aggregation is similar to: <pre>SELECT AVG(value) FROM x</pre>
@param <Key> the input key type
@param <Val... | java | public static <Key, Value> Aggregation<Key, BigInteger, BigInteger> bigIntegerAvg() {
return new AggregationAdapter(new BigIntegerAvgAggregation<Key, Value>());
} | [
"public",
"static",
"<",
"Key",
",",
"Value",
">",
"Aggregation",
"<",
"Key",
",",
"BigInteger",
",",
"BigInteger",
">",
"bigIntegerAvg",
"(",
")",
"{",
"return",
"new",
"AggregationAdapter",
"(",
"new",
"BigIntegerAvgAggregation",
"<",
"Key",
",",
"Value",
... | Returns an aggregation to calculate the {@link java.math.BigInteger} average
of all supplied values.<br/>
This aggregation is similar to: <pre>SELECT AVG(value) FROM x</pre>
@param <Key> the input key type
@param <Value> the supplied value type
@return the average over all supplied values | [
"Returns",
"an",
"aggregation",
"to",
"calculate",
"the",
"{",
"@link",
"java",
".",
"math",
".",
"BigInteger",
"}",
"average",
"of",
"all",
"supplied",
"values",
".",
"<br",
"/",
">",
"This",
"aggregation",
"is",
"similar",
"to",
":",
"<pre",
">",
"SELE... | train | https://github.com/hazelcast/hazelcast/blob/8c4bc10515dbbfb41a33e0302c0caedf3cda1baf/hazelcast/src/main/java/com/hazelcast/mapreduce/aggregation/Aggregations.java#L299-L301 |
sakserv/hadoop-mini-clusters | hadoop-mini-clusters-yarn/src/main/java/com/github/sakserv/minicluster/yarn/InJvmContainerExecutor.java | InJvmContainerExecutor.doLaunchContainer | private void doLaunchContainer(Class<?> containerClass, Method mainMethod, String[] arguments) throws Exception {
"""
Will invoke Container's main method blocking if necessary. This method
contains a hack that I am not proud of it, but given the fact that some
containers rely on System.exit to manage its life-cy... | java | private void doLaunchContainer(Class<?> containerClass, Method mainMethod, String[] arguments) throws Exception {
if (logger.isInfoEnabled()) {
logger.info("Launching container for " + containerClass.getName()
+ " with arguments: " + Arrays.asList(arguments));
}
... | [
"private",
"void",
"doLaunchContainer",
"(",
"Class",
"<",
"?",
">",
"containerClass",
",",
"Method",
"mainMethod",
",",
"String",
"[",
"]",
"arguments",
")",
"throws",
"Exception",
"{",
"if",
"(",
"logger",
".",
"isInfoEnabled",
"(",
")",
")",
"{",
"logge... | Will invoke Container's main method blocking if necessary. This method
contains a hack that I am not proud of it, but given the fact that some
containers rely on System.exit to manage its life-cycle instead of proper
exit this will ensure that together with the
SystemExitDisallowingSecurityManager (see constructor of t... | [
"Will",
"invoke",
"Container",
"s",
"main",
"method",
"blocking",
"if",
"necessary",
".",
"This",
"method",
"contains",
"a",
"hack",
"that",
"I",
"am",
"not",
"proud",
"of",
"it",
"but",
"given",
"the",
"fact",
"that",
"some",
"containers",
"rely",
"on",
... | train | https://github.com/sakserv/hadoop-mini-clusters/blob/c3915274714b457cf7e1af62f2f289274510dc0b/hadoop-mini-clusters-yarn/src/main/java/com/github/sakserv/minicluster/yarn/InJvmContainerExecutor.java#L257-L274 |
Azure/azure-sdk-for-java | appservice/resource-manager/v2018_02_01/src/main/java/com/microsoft/azure/management/appservice/v2018_02_01/implementation/RecommendationsInner.java | RecommendationsInner.disableRecommendationForSite | public void disableRecommendationForSite(String resourceGroupName, String siteName, String name) {
"""
Disables the specific rule for a web site permanently.
Disables the specific rule for a web site permanently.
@param resourceGroupName Name of the resource group to which the resource belongs.
@param siteNam... | java | public void disableRecommendationForSite(String resourceGroupName, String siteName, String name) {
disableRecommendationForSiteWithServiceResponseAsync(resourceGroupName, siteName, name).toBlocking().single().body();
} | [
"public",
"void",
"disableRecommendationForSite",
"(",
"String",
"resourceGroupName",
",",
"String",
"siteName",
",",
"String",
"name",
")",
"{",
"disableRecommendationForSiteWithServiceResponseAsync",
"(",
"resourceGroupName",
",",
"siteName",
",",
"name",
")",
".",
"t... | Disables the specific rule for a web site permanently.
Disables the specific rule for a web site permanently.
@param resourceGroupName Name of the resource group to which the resource belongs.
@param siteName Site name
@param name Rule name
@throws IllegalArgumentException thrown if parameters fail the validation
@thr... | [
"Disables",
"the",
"specific",
"rule",
"for",
"a",
"web",
"site",
"permanently",
".",
"Disables",
"the",
"specific",
"rule",
"for",
"a",
"web",
"site",
"permanently",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/appservice/resource-manager/v2018_02_01/src/main/java/com/microsoft/azure/management/appservice/v2018_02_01/implementation/RecommendationsInner.java#L1406-L1408 |
elki-project/elki | addons/batikvis/src/main/java/de/lmu/ifi/dbs/elki/visualization/svg/SVGUtil.java | SVGUtil.svgText | public static Element svgText(Document document, double x, double y, String text) {
"""
Create a SVG text element.
@param document document to create in (factory)
@param x first point x
@param y first point y
@param text Content of text element.
@return New text element.
"""
Element elem = SVGUtil.s... | java | public static Element svgText(Document document, double x, double y, String text) {
Element elem = SVGUtil.svgElement(document, SVGConstants.SVG_TEXT_TAG);
SVGUtil.setAtt(elem, SVGConstants.SVG_X_ATTRIBUTE, x);
SVGUtil.setAtt(elem, SVGConstants.SVG_Y_ATTRIBUTE, y);
elem.setTextContent(text);
return ... | [
"public",
"static",
"Element",
"svgText",
"(",
"Document",
"document",
",",
"double",
"x",
",",
"double",
"y",
",",
"String",
"text",
")",
"{",
"Element",
"elem",
"=",
"SVGUtil",
".",
"svgElement",
"(",
"document",
",",
"SVGConstants",
".",
"SVG_TEXT_TAG",
... | Create a SVG text element.
@param document document to create in (factory)
@param x first point x
@param y first point y
@param text Content of text element.
@return New text element. | [
"Create",
"a",
"SVG",
"text",
"element",
"."
] | train | https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/addons/batikvis/src/main/java/de/lmu/ifi/dbs/elki/visualization/svg/SVGUtil.java#L482-L488 |
asterisk-java/asterisk-java | src/main/java/org/asteriskjava/fastagi/ScriptEngineMappingStrategy.java | ScriptEngineMappingStrategy.isInside | protected final boolean isInside(File file, File dir) throws IOException {
"""
Checks whether a file is contained within a given directory (or a sub
directory) or not.
@param file the file to check.
@param dir the directory to check.
@return <code>true</code> if file is below directory, <code>false</code>
o... | java | protected final boolean isInside(File file, File dir) throws IOException
{
return file.getCanonicalPath().startsWith(dir.getCanonicalPath());
} | [
"protected",
"final",
"boolean",
"isInside",
"(",
"File",
"file",
",",
"File",
"dir",
")",
"throws",
"IOException",
"{",
"return",
"file",
".",
"getCanonicalPath",
"(",
")",
".",
"startsWith",
"(",
"dir",
".",
"getCanonicalPath",
"(",
")",
")",
";",
"}"
] | Checks whether a file is contained within a given directory (or a sub
directory) or not.
@param file the file to check.
@param dir the directory to check.
@return <code>true</code> if file is below directory, <code>false</code>
otherwise.
@throws IOException if the canonical path of file or dir cannot be
determined. | [
"Checks",
"whether",
"a",
"file",
"is",
"contained",
"within",
"a",
"given",
"directory",
"(",
"or",
"a",
"sub",
"directory",
")",
"or",
"not",
"."
] | train | https://github.com/asterisk-java/asterisk-java/blob/cdc9849270d97ef75afa447a02c5194ed29121eb/src/main/java/org/asteriskjava/fastagi/ScriptEngineMappingStrategy.java#L306-L309 |
EdwardRaff/JSAT | JSAT/src/jsat/classifiers/bayesian/graphicalmodel/DirectedGraph.java | DirectedGraph.addEdge | public void addEdge(N a, N b) {
"""
Adds a directed edge into the network from <tt>a</tt> to <tt>b</tt>.
If <tt>a</tt> and <tt>b</tt> are not nodes in the graph, nothing occurs.
@param a the parent node
@param b the child node
"""
if( !containsBoth(a, b) )
return;//Cant add nodes to thin... | java | public void addEdge(N a, N b)
{
if( !containsBoth(a, b) )
return;//Cant add nodes to things that doing exist
nodes.get(a).getOutgoing().add(b);
nodes.get(b).getIncoming().add(a);
} | [
"public",
"void",
"addEdge",
"(",
"N",
"a",
",",
"N",
"b",
")",
"{",
"if",
"(",
"!",
"containsBoth",
"(",
"a",
",",
"b",
")",
")",
"return",
";",
"//Cant add nodes to things that doing exist",
"nodes",
".",
"get",
"(",
"a",
")",
".",
"getOutgoing",
"("... | Adds a directed edge into the network from <tt>a</tt> to <tt>b</tt>.
If <tt>a</tt> and <tt>b</tt> are not nodes in the graph, nothing occurs.
@param a the parent node
@param b the child node | [
"Adds",
"a",
"directed",
"edge",
"into",
"the",
"network",
"from",
"<tt",
">",
"a<",
"/",
"tt",
">",
"to",
"<tt",
">",
"b<",
"/",
"tt",
">",
".",
"If",
"<tt",
">",
"a<",
"/",
"tt",
">",
"and",
"<tt",
">",
"b<",
"/",
"tt",
">",
"are",
"not",
... | train | https://github.com/EdwardRaff/JSAT/blob/0ff53b7b39684b2379cc1da522f5b3a954b15cfb/JSAT/src/jsat/classifiers/bayesian/graphicalmodel/DirectedGraph.java#L176-L182 |
vznet/mongo-jackson-mapper | src/main/java/net/vz/mongodb/jackson/JacksonDBCollection.java | JacksonDBCollection.findOne | public T findOne(DBObject query, DBObject fields, ReadPreference readPref) {
"""
Returns a single object from this collection matching the query.
@param query the query object
@param fields fields to return
@param readPref The read preference
@return the object found, or <code>null</code> if no such obj... | java | public T findOne(DBObject query, DBObject fields, ReadPreference readPref) {
DBCursor<T> cursor = find(query, fields).setReadPreference(readPref);
if (cursor.hasNext()) {
return cursor.next();
} else {
return null;
}
} | [
"public",
"T",
"findOne",
"(",
"DBObject",
"query",
",",
"DBObject",
"fields",
",",
"ReadPreference",
"readPref",
")",
"{",
"DBCursor",
"<",
"T",
">",
"cursor",
"=",
"find",
"(",
"query",
",",
"fields",
")",
".",
"setReadPreference",
"(",
"readPref",
")",
... | Returns a single object from this collection matching the query.
@param query the query object
@param fields fields to return
@param readPref The read preference
@return the object found, or <code>null</code> if no such object exists | [
"Returns",
"a",
"single",
"object",
"from",
"this",
"collection",
"matching",
"the",
"query",
"."
] | train | https://github.com/vznet/mongo-jackson-mapper/blob/ecd189aefa89636cddf70fb383f5d676be347976/src/main/java/net/vz/mongodb/jackson/JacksonDBCollection.java#L925-L932 |
linkedin/dexmaker | dexmaker/src/main/java/com/android/dx/Code.java | Code.loadConstant | public <T> void loadConstant(Local<T> target, T value) {
"""
Copies the constant value {@code value} to {@code target}. The constant
must be a primitive, String, Class, TypeId, or null.
"""
Rop rop = value == null
? Rops.CONST_OBJECT_NOTHROW
: Rops.opConst(target.type.r... | java | public <T> void loadConstant(Local<T> target, T value) {
Rop rop = value == null
? Rops.CONST_OBJECT_NOTHROW
: Rops.opConst(target.type.ropType);
if (rop.getBranchingness() == BRANCH_NONE) {
addInstruction(new PlainCstInsn(rop, sourcePosition, target.spec(),
... | [
"public",
"<",
"T",
">",
"void",
"loadConstant",
"(",
"Local",
"<",
"T",
">",
"target",
",",
"T",
"value",
")",
"{",
"Rop",
"rop",
"=",
"value",
"==",
"null",
"?",
"Rops",
".",
"CONST_OBJECT_NOTHROW",
":",
"Rops",
".",
"opConst",
"(",
"target",
".",
... | Copies the constant value {@code value} to {@code target}. The constant
must be a primitive, String, Class, TypeId, or null. | [
"Copies",
"the",
"constant",
"value",
"{"
] | train | https://github.com/linkedin/dexmaker/blob/c58ffebcbb2564c7d1fa6fb58b48f351c330296d/dexmaker/src/main/java/com/android/dx/Code.java#L478-L490 |
actorapp/actor-platform | actor-sdk/sdk-core/runtime/runtime-shared/src/main/java/im/actor/runtime/markdown/MarkdownParser.java | MarkdownParser.addText | private void addText(TextCursor cursor, int limit, ArrayList<MDText> elements) {
"""
Adding raw simple text
@param cursor text cursor
@param limit text end
@param elements current elements
"""
if (cursor.currentOffset < limit) {
elements.add(new MDRawText(cursor.text.substring(cur... | java | private void addText(TextCursor cursor, int limit, ArrayList<MDText> elements) {
if (cursor.currentOffset < limit) {
elements.add(new MDRawText(cursor.text.substring(cursor.currentOffset, limit)));
cursor.currentOffset = limit;
}
} | [
"private",
"void",
"addText",
"(",
"TextCursor",
"cursor",
",",
"int",
"limit",
",",
"ArrayList",
"<",
"MDText",
">",
"elements",
")",
"{",
"if",
"(",
"cursor",
".",
"currentOffset",
"<",
"limit",
")",
"{",
"elements",
".",
"add",
"(",
"new",
"MDRawText"... | Adding raw simple text
@param cursor text cursor
@param limit text end
@param elements current elements | [
"Adding",
"raw",
"simple",
"text"
] | train | https://github.com/actorapp/actor-platform/blob/5123c1584757c6eeea0ed2a0e7e043629871a0c6/actor-sdk/sdk-core/runtime/runtime-shared/src/main/java/im/actor/runtime/markdown/MarkdownParser.java#L220-L225 |
RobotiumTech/robotium | robotium-solo/src/main/java/com/robotium/solo/Clicker.java | Clicker.clickOnScreen | public void clickOnScreen(float x, float y, View view) {
"""
Clicks on a given coordinate on the screen.
@param x the x coordinate
@param y the y coordinate
"""
boolean successfull = false;
int retry = 0;
SecurityException ex = null;
while(!successfull && retry < 20) {
long downTime = SystemClo... | java | public void clickOnScreen(float x, float y, View view) {
boolean successfull = false;
int retry = 0;
SecurityException ex = null;
while(!successfull && retry < 20) {
long downTime = SystemClock.uptimeMillis();
long eventTime = SystemClock.uptimeMillis();
MotionEvent event = MotionEvent.obtain(downTime... | [
"public",
"void",
"clickOnScreen",
"(",
"float",
"x",
",",
"float",
"y",
",",
"View",
"view",
")",
"{",
"boolean",
"successfull",
"=",
"false",
";",
"int",
"retry",
"=",
"0",
";",
"SecurityException",
"ex",
"=",
"null",
";",
"while",
"(",
"!",
"success... | Clicks on a given coordinate on the screen.
@param x the x coordinate
@param y the y coordinate | [
"Clicks",
"on",
"a",
"given",
"coordinate",
"on",
"the",
"screen",
"."
] | train | https://github.com/RobotiumTech/robotium/blob/75e567c38f26a6a87dc8bef90b3886a20e28d291/robotium-solo/src/main/java/com/robotium/solo/Clicker.java#L79-L111 |
google/flatbuffers | java/com/google/flatbuffers/Table.java | Table.__vector_as_bytebuffer | protected ByteBuffer __vector_as_bytebuffer(int vector_offset, int elem_size) {
"""
Get a whole vector as a ByteBuffer.
This is efficient, since it only allocates a new {@link ByteBuffer} object,
but does not actually copy the data, it still refers to the same bytes
as the original ByteBuffer. Also useful wit... | java | protected ByteBuffer __vector_as_bytebuffer(int vector_offset, int elem_size) {
int o = __offset(vector_offset);
if (o == 0) return null;
ByteBuffer bb = this.bb.duplicate().order(ByteOrder.LITTLE_ENDIAN);
int vectorstart = __vector(o);
bb.position(vectorstart);
bb.limit(vectorstart + __vector_l... | [
"protected",
"ByteBuffer",
"__vector_as_bytebuffer",
"(",
"int",
"vector_offset",
",",
"int",
"elem_size",
")",
"{",
"int",
"o",
"=",
"__offset",
"(",
"vector_offset",
")",
";",
"if",
"(",
"o",
"==",
"0",
")",
"return",
"null",
";",
"ByteBuffer",
"bb",
"="... | Get a whole vector as a ByteBuffer.
This is efficient, since it only allocates a new {@link ByteBuffer} object,
but does not actually copy the data, it still refers to the same bytes
as the original ByteBuffer. Also useful with nested FlatBuffers, etc.
@param vector_offset The position of the vector in the byte buffe... | [
"Get",
"a",
"whole",
"vector",
"as",
"a",
"ByteBuffer",
"."
] | train | https://github.com/google/flatbuffers/blob/6cc30b3272d79c85db7d4871ac0aa69541dc89de/java/com/google/flatbuffers/Table.java#L133-L141 |
datumbox/datumbox-framework | datumbox-framework-core/src/main/java/com/datumbox/framework/core/statistics/sampling/SimpleRandomSampling.java | SimpleRandomSampling.xbarStd | public static double xbarStd(double std, int sampleN, int populationN) {
"""
Calculates Standard Deviation for Xbar for finite population size
@param std
@param sampleN
@param populationN
@return
"""
return Math.sqrt(xbarVariance(std*std, sampleN, populationN));
} | java | public static double xbarStd(double std, int sampleN, int populationN) {
return Math.sqrt(xbarVariance(std*std, sampleN, populationN));
} | [
"public",
"static",
"double",
"xbarStd",
"(",
"double",
"std",
",",
"int",
"sampleN",
",",
"int",
"populationN",
")",
"{",
"return",
"Math",
".",
"sqrt",
"(",
"xbarVariance",
"(",
"std",
"*",
"std",
",",
"sampleN",
",",
"populationN",
")",
")",
";",
"}... | Calculates Standard Deviation for Xbar for finite population size
@param std
@param sampleN
@param populationN
@return | [
"Calculates",
"Standard",
"Deviation",
"for",
"Xbar",
"for",
"finite",
"population",
"size"
] | train | https://github.com/datumbox/datumbox-framework/blob/909dff0476e80834f05ecdde0624dd2390e9b0ca/datumbox-framework-core/src/main/java/com/datumbox/framework/core/statistics/sampling/SimpleRandomSampling.java#L190-L192 |
shekhargulati/strman-java | src/main/java/strman/Strman.java | Strman.containsAny | public static boolean containsAny(final String value, final String[] needles, final boolean caseSensitive) {
"""
Verifies that one or more of needles are contained in value.
@param value input
@param needles needles to search
@param caseSensitive true or false
@return boolean true if any needle... | java | public static boolean containsAny(final String value, final String[] needles, final boolean caseSensitive) {
validate(value, NULL_STRING_PREDICATE, NULL_STRING_MSG_SUPPLIER);
return Arrays.stream(needles).anyMatch(needle -> contains(value, needle, caseSensitive));
} | [
"public",
"static",
"boolean",
"containsAny",
"(",
"final",
"String",
"value",
",",
"final",
"String",
"[",
"]",
"needles",
",",
"final",
"boolean",
"caseSensitive",
")",
"{",
"validate",
"(",
"value",
",",
"NULL_STRING_PREDICATE",
",",
"NULL_STRING_MSG_SUPPLIER",... | Verifies that one or more of needles are contained in value.
@param value input
@param needles needles to search
@param caseSensitive true or false
@return boolean true if any needle is found else false | [
"Verifies",
"that",
"one",
"or",
"more",
"of",
"needles",
"are",
"contained",
"in",
"value",
"."
] | train | https://github.com/shekhargulati/strman-java/blob/d0c2a10a6273fd6082f084e95156653ca55ce1be/src/main/java/strman/Strman.java#L217-L220 |
neo4j/neo4j-java-driver | driver/src/main/java/org/neo4j/driver/internal/DriverFactory.java | DriverFactory.createRetryLogic | protected RetryLogic createRetryLogic( RetrySettings settings, EventExecutorGroup eventExecutorGroup,
Logging logging ) {
"""
Creates new {@link RetryLogic}.
<p>
<b>This method is protected only for testing</b>
"""
return new ExponentialBackoffRetryLogic( settings, eventExecutorGroup, cre... | java | protected RetryLogic createRetryLogic( RetrySettings settings, EventExecutorGroup eventExecutorGroup,
Logging logging )
{
return new ExponentialBackoffRetryLogic( settings, eventExecutorGroup, createClock(), logging );
} | [
"protected",
"RetryLogic",
"createRetryLogic",
"(",
"RetrySettings",
"settings",
",",
"EventExecutorGroup",
"eventExecutorGroup",
",",
"Logging",
"logging",
")",
"{",
"return",
"new",
"ExponentialBackoffRetryLogic",
"(",
"settings",
",",
"eventExecutorGroup",
",",
"create... | Creates new {@link RetryLogic}.
<p>
<b>This method is protected only for testing</b> | [
"Creates",
"new",
"{"
] | train | https://github.com/neo4j/neo4j-java-driver/blob/8dad6c48251fa1ab7017e72d9998a24fa2337a22/driver/src/main/java/org/neo4j/driver/internal/DriverFactory.java#L258-L262 |
google/j2objc | xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xpath/compiler/Compiler.java | Compiler.compileOperation | private Expression compileOperation(Operation operation, int opPos)
throws TransformerException {
"""
Bottle-neck compilation of an operation with left and right operands.
@param operation non-null reference to parent operation.
@param opPos The op map position of the parent operation.
@return ref... | java | private Expression compileOperation(Operation operation, int opPos)
throws TransformerException
{
int leftPos = getFirstChildPos(opPos);
int rightPos = getNextOpPos(leftPos);
operation.setLeftRight(compile(leftPos), compile(rightPos));
return operation;
} | [
"private",
"Expression",
"compileOperation",
"(",
"Operation",
"operation",
",",
"int",
"opPos",
")",
"throws",
"TransformerException",
"{",
"int",
"leftPos",
"=",
"getFirstChildPos",
"(",
"opPos",
")",
";",
"int",
"rightPos",
"=",
"getNextOpPos",
"(",
"leftPos",
... | Bottle-neck compilation of an operation with left and right operands.
@param operation non-null reference to parent operation.
@param opPos The op map position of the parent operation.
@return reference to {@link org.apache.xpath.operations.Operation} instance.
@throws TransformerException if there is a syntax or ot... | [
"Bottle",
"-",
"neck",
"compilation",
"of",
"an",
"operation",
"with",
"left",
"and",
"right",
"operands",
"."
] | train | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xpath/compiler/Compiler.java#L209-L219 |
agapsys/web-security-framework | src/main/java/com/agapsys/security/web/SessionCsrfSecurityManager.java | SessionCsrfSecurityManager.getRandomString | private static String getRandomString(int length, char[] chars) throws IllegalArgumentException {
"""
Generates a random String
@param length length of returned string
@param chars set of chars which will be using during random string generation
@return a random string with given length.
@throws IllegalArgumen... | java | private static String getRandomString(int length, char[] chars) throws IllegalArgumentException {
if (length < 1)
throw new IllegalArgumentException("Invalid length: " + length);
if (chars == null || chars.length == 0)
throw new IllegalArgumentException("Null/Empty chars");
StringBuilder sb = new Stri... | [
"private",
"static",
"String",
"getRandomString",
"(",
"int",
"length",
",",
"char",
"[",
"]",
"chars",
")",
"throws",
"IllegalArgumentException",
"{",
"if",
"(",
"length",
"<",
"1",
")",
"throw",
"new",
"IllegalArgumentException",
"(",
"\"Invalid length: \"",
"... | Generates a random String
@param length length of returned string
@param chars set of chars which will be using during random string generation
@return a random string with given length.
@throws IllegalArgumentException if (length < 1 || chars == null || chars.length == 0) | [
"Generates",
"a",
"random",
"String"
] | train | https://github.com/agapsys/web-security-framework/blob/a709f7ee59705a3b8b8097f3de97d5a00595493d/src/main/java/com/agapsys/security/web/SessionCsrfSecurityManager.java#L55-L69 |
aws/aws-sdk-java | aws-java-sdk-dynamodb/src/main/java/com/amazonaws/services/dynamodbv2/model/ItemCollectionMetrics.java | ItemCollectionMetrics.withItemCollectionKey | public ItemCollectionMetrics withItemCollectionKey(java.util.Map<String, AttributeValue> itemCollectionKey) {
"""
<p>
The partition key value of the item collection. This value is the same as the partition key value of the item.
</p>
@param itemCollectionKey
The partition key value of the item collection. Th... | java | public ItemCollectionMetrics withItemCollectionKey(java.util.Map<String, AttributeValue> itemCollectionKey) {
setItemCollectionKey(itemCollectionKey);
return this;
} | [
"public",
"ItemCollectionMetrics",
"withItemCollectionKey",
"(",
"java",
".",
"util",
".",
"Map",
"<",
"String",
",",
"AttributeValue",
">",
"itemCollectionKey",
")",
"{",
"setItemCollectionKey",
"(",
"itemCollectionKey",
")",
";",
"return",
"this",
";",
"}"
] | <p>
The partition key value of the item collection. This value is the same as the partition key value of the item.
</p>
@param itemCollectionKey
The partition key value of the item collection. This value is the same as the partition key value of the
item.
@return Returns a reference to this object so that method calls... | [
"<p",
">",
"The",
"partition",
"key",
"value",
"of",
"the",
"item",
"collection",
".",
"This",
"value",
"is",
"the",
"same",
"as",
"the",
"partition",
"key",
"value",
"of",
"the",
"item",
".",
"<",
"/",
"p",
">"
] | train | https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-dynamodb/src/main/java/com/amazonaws/services/dynamodbv2/model/ItemCollectionMetrics.java#L90-L93 |
pressgang-ccms/PressGangCCMSContentSpec | src/main/java/org/jboss/pressgang/ccms/contentspec/ContentSpec.java | ContentSpec.setFiles | public void setFiles(final List<File> files) {
"""
Sets the list of additional files needed by the book.
@param files The list of additional Files.
"""
if (files == null && this.files == null) {
return;
} else if (files == null) {
removeChild(this.files);
... | java | public void setFiles(final List<File> files) {
if (files == null && this.files == null) {
return;
} else if (files == null) {
removeChild(this.files);
this.files = null;
} else if (this.files == null) {
this.files = new FileList(CommonConstants.CS_... | [
"public",
"void",
"setFiles",
"(",
"final",
"List",
"<",
"File",
">",
"files",
")",
"{",
"if",
"(",
"files",
"==",
"null",
"&&",
"this",
".",
"files",
"==",
"null",
")",
"{",
"return",
";",
"}",
"else",
"if",
"(",
"files",
"==",
"null",
")",
"{",... | Sets the list of additional files needed by the book.
@param files The list of additional Files. | [
"Sets",
"the",
"list",
"of",
"additional",
"files",
"needed",
"by",
"the",
"book",
"."
] | train | https://github.com/pressgang-ccms/PressGangCCMSContentSpec/blob/2bc02e2971e4522b47a130fb7ae5a0f5ad377df1/src/main/java/org/jboss/pressgang/ccms/contentspec/ContentSpec.java#L2118-L2130 |
mapbox/mapbox-java | services-geojson/src/main/java/com/mapbox/geojson/Polygon.java | Polygon.fromLngLats | public static Polygon fromLngLats(@NonNull List<List<Point>> coordinates) {
"""
Create a new instance of this class by defining a list of {@link Point}s which follow the
correct specifications described in the Point documentation. Note that the first and last point
in the list should be the same enclosing the li... | java | public static Polygon fromLngLats(@NonNull List<List<Point>> coordinates) {
return new Polygon(TYPE, null, coordinates);
} | [
"public",
"static",
"Polygon",
"fromLngLats",
"(",
"@",
"NonNull",
"List",
"<",
"List",
"<",
"Point",
">",
">",
"coordinates",
")",
"{",
"return",
"new",
"Polygon",
"(",
"TYPE",
",",
"null",
",",
"coordinates",
")",
";",
"}"
] | Create a new instance of this class by defining a list of {@link Point}s which follow the
correct specifications described in the Point documentation. Note that the first and last point
in the list should be the same enclosing the linear ring.
@param coordinates a list of a list of points which represent the polygon g... | [
"Create",
"a",
"new",
"instance",
"of",
"this",
"class",
"by",
"defining",
"a",
"list",
"of",
"{",
"@link",
"Point",
"}",
"s",
"which",
"follow",
"the",
"correct",
"specifications",
"described",
"in",
"the",
"Point",
"documentation",
".",
"Note",
"that",
"... | train | https://github.com/mapbox/mapbox-java/blob/c0be138f462f91441388584c668f3760ba0e18e2/services-geojson/src/main/java/com/mapbox/geojson/Polygon.java#L98-L100 |
js-lib-com/commons | src/main/java/js/util/Params.java | Params.GTE | public static void GTE(long parameter, long value, String name) throws IllegalArgumentException {
"""
Test if numeric parameter is greater than or equal to given threshold value.
@param parameter invocation numeric parameter,
@param value threshold value,
@param name the name of invocation parameter.
@throws... | java | public static void GTE(long parameter, long value, String name) throws IllegalArgumentException {
if (parameter < value) {
throw new IllegalArgumentException(String.format("%s is not greater than or equal %d.", name, value));
}
} | [
"public",
"static",
"void",
"GTE",
"(",
"long",
"parameter",
",",
"long",
"value",
",",
"String",
"name",
")",
"throws",
"IllegalArgumentException",
"{",
"if",
"(",
"parameter",
"<",
"value",
")",
"{",
"throw",
"new",
"IllegalArgumentException",
"(",
"String",... | Test if numeric parameter is greater than or equal to given threshold value.
@param parameter invocation numeric parameter,
@param value threshold value,
@param name the name of invocation parameter.
@throws IllegalArgumentException if <code>parameter</code> is not greater than or equal to threshold value. | [
"Test",
"if",
"numeric",
"parameter",
"is",
"greater",
"than",
"or",
"equal",
"to",
"given",
"threshold",
"value",
"."
] | train | https://github.com/js-lib-com/commons/blob/f8c64482142b163487745da74feb106f0765c16b/src/main/java/js/util/Params.java#L387-L391 |
raphw/byte-buddy | byte-buddy-dep/src/main/java/net/bytebuddy/asm/ModifierAdjustment.java | ModifierAdjustment.withConstructorModifiers | public ModifierAdjustment withConstructorModifiers(ElementMatcher<? super MethodDescription> matcher,
ModifierContributor.ForMethod... modifierContributor) {
"""
Adjusts a constructor's modifiers if it fulfills the supplied matcher.
@param matcher ... | java | public ModifierAdjustment withConstructorModifiers(ElementMatcher<? super MethodDescription> matcher,
ModifierContributor.ForMethod... modifierContributor) {
return withConstructorModifiers(matcher, Arrays.asList(modifierContributor));
} | [
"public",
"ModifierAdjustment",
"withConstructorModifiers",
"(",
"ElementMatcher",
"<",
"?",
"super",
"MethodDescription",
">",
"matcher",
",",
"ModifierContributor",
".",
"ForMethod",
"...",
"modifierContributor",
")",
"{",
"return",
"withConstructorModifiers",
"(",
"mat... | Adjusts a constructor's modifiers if it fulfills the supplied matcher.
@param matcher The matcher that determines if a constructor's modifiers should be adjusted.
@param modifierContributor The modifier contributors to enforce.
@return A new modifier adjustment that enforces the given modifier contributors... | [
"Adjusts",
"a",
"constructor",
"s",
"modifiers",
"if",
"it",
"fulfills",
"the",
"supplied",
"matcher",
"."
] | train | https://github.com/raphw/byte-buddy/blob/4d2dac80efb6bed89367567260f6811c2f712d12/byte-buddy-dep/src/main/java/net/bytebuddy/asm/ModifierAdjustment.java#L253-L256 |
ttddyy/datasource-proxy | src/main/java/net/ttddyy/dsproxy/listener/logging/DefaultQueryLogEntryCreator.java | DefaultQueryLogEntryCreator.writeParamsForSinglePreparedEntry | protected void writeParamsForSinglePreparedEntry(StringBuilder sb, SortedMap<String, String> paramMap, ExecutionInfo execInfo, List<QueryInfo> queryInfoList) {
"""
Write query parameters for PreparedStatement.
<p>default: Params:[(foo,100),(bar,101)],
@param sb StringBuilder to write
@param param... | java | protected void writeParamsForSinglePreparedEntry(StringBuilder sb, SortedMap<String, String> paramMap, ExecutionInfo execInfo, List<QueryInfo> queryInfoList) {
sb.append("(");
for (Map.Entry<String, String> paramEntry : paramMap.entrySet()) {
sb.append(paramEntry.getValue());
sb.... | [
"protected",
"void",
"writeParamsForSinglePreparedEntry",
"(",
"StringBuilder",
"sb",
",",
"SortedMap",
"<",
"String",
",",
"String",
">",
"paramMap",
",",
"ExecutionInfo",
"execInfo",
",",
"List",
"<",
"QueryInfo",
">",
"queryInfoList",
")",
"{",
"sb",
".",
"ap... | Write query parameters for PreparedStatement.
<p>default: Params:[(foo,100),(bar,101)],
@param sb StringBuilder to write
@param paramMap sorted parameters map
@param execInfo execution info
@param queryInfoList query info list
@since 1.4 | [
"Write",
"query",
"parameters",
"for",
"PreparedStatement",
"."
] | train | https://github.com/ttddyy/datasource-proxy/blob/62163ccf9a569a99aa3ad9f9151a32567447a62e/src/main/java/net/ttddyy/dsproxy/listener/logging/DefaultQueryLogEntryCreator.java#L295-L303 |
google/closure-compiler | src/com/google/javascript/jscomp/parsing/parser/Parser.java | Parser.reportError | @FormatMethod
private void reportError(ParseTree parseTree, @FormatString String message, Object... arguments) {
"""
Reports an error message at a given parse tree's location.
@param parseTree The location to report the message at.
@param message The message to report in String.format style.
@param argument... | java | @FormatMethod
private void reportError(ParseTree parseTree, @FormatString String message, Object... arguments) {
if (parseTree == null) {
reportError(message, arguments);
} else {
errorReporter.reportError(parseTree.location.start, message, arguments);
}
} | [
"@",
"FormatMethod",
"private",
"void",
"reportError",
"(",
"ParseTree",
"parseTree",
",",
"@",
"FormatString",
"String",
"message",
",",
"Object",
"...",
"arguments",
")",
"{",
"if",
"(",
"parseTree",
"==",
"null",
")",
"{",
"reportError",
"(",
"message",
"... | Reports an error message at a given parse tree's location.
@param parseTree The location to report the message at.
@param message The message to report in String.format style.
@param arguments The arguments to fill in the message format. | [
"Reports",
"an",
"error",
"message",
"at",
"a",
"given",
"parse",
"tree",
"s",
"location",
"."
] | train | https://github.com/google/closure-compiler/blob/d81e36740f6a9e8ac31a825ee8758182e1dc5aae/src/com/google/javascript/jscomp/parsing/parser/Parser.java#L4243-L4250 |
tvesalainen/util | util/src/main/java/org/vesalainen/util/navi/RateOfTurn.java | RateOfTurn.getMotionAfter | public Motion getMotionAfter(Motion motion, TimeSpan span) {
"""
Return's motion after timespan
@param motion Motion at the beginning
@param span TimeSpan of turning
@return
"""
return new Motion(motion.getSpeed(), getBearingAfter(motion.getAngle(), span));
} | java | public Motion getMotionAfter(Motion motion, TimeSpan span)
{
return new Motion(motion.getSpeed(), getBearingAfter(motion.getAngle(), span));
} | [
"public",
"Motion",
"getMotionAfter",
"(",
"Motion",
"motion",
",",
"TimeSpan",
"span",
")",
"{",
"return",
"new",
"Motion",
"(",
"motion",
".",
"getSpeed",
"(",
")",
",",
"getBearingAfter",
"(",
"motion",
".",
"getAngle",
"(",
")",
",",
"span",
")",
")"... | Return's motion after timespan
@param motion Motion at the beginning
@param span TimeSpan of turning
@return | [
"Return",
"s",
"motion",
"after",
"timespan"
] | train | https://github.com/tvesalainen/util/blob/bba7a44689f638ffabc8be40a75bdc9a33676433/util/src/main/java/org/vesalainen/util/navi/RateOfTurn.java#L104-L107 |
leancloud/java-sdk-all | realtime/src/main/java/cn/leancloud/im/v2/AVIMConversationEventHandler.java | AVIMConversationEventHandler.onMuted | public void onMuted(AVIMClient client, AVIMConversation conversation, String operator) {
"""
当前用户被禁言通知处理函数
@param client 聊天客户端
@param conversation 对话
@param operator 操作者 id
"""
LOGGER.d("Notification --- " + " you are muted by " + operator );
} | java | public void onMuted(AVIMClient client, AVIMConversation conversation, String operator) {
LOGGER.d("Notification --- " + " you are muted by " + operator );
} | [
"public",
"void",
"onMuted",
"(",
"AVIMClient",
"client",
",",
"AVIMConversation",
"conversation",
",",
"String",
"operator",
")",
"{",
"LOGGER",
".",
"d",
"(",
"\"Notification --- \"",
"+",
"\" you are muted by \"",
"+",
"operator",
")",
";",
"}"
] | 当前用户被禁言通知处理函数
@param client 聊天客户端
@param conversation 对话
@param operator 操作者 id | [
"当前用户被禁言通知处理函数"
] | train | https://github.com/leancloud/java-sdk-all/blob/323f8e7ee38051b1350790e5192304768c5c9f5f/realtime/src/main/java/cn/leancloud/im/v2/AVIMConversationEventHandler.java#L72-L74 |
atomix/atomix | cluster/src/main/java/io/atomix/cluster/impl/PhiAccrualFailureDetector.java | PhiAccrualFailureDetector.computePhi | private double computePhi(DescriptiveStatistics samples, long lastHeartbeat, long currentTime) {
"""
Computes the phi value from the given samples.
<p>
The original phi value in Hayashibara's paper is calculated based on a normal distribution.
Here, we calculate it based on an exponential distribution.
@para... | java | private double computePhi(DescriptiveStatistics samples, long lastHeartbeat, long currentTime) {
long size = samples.getN();
long t = currentTime - lastHeartbeat;
return (size > 0)
? phiFactor * t / samples.getMean()
: 100;
} | [
"private",
"double",
"computePhi",
"(",
"DescriptiveStatistics",
"samples",
",",
"long",
"lastHeartbeat",
",",
"long",
"currentTime",
")",
"{",
"long",
"size",
"=",
"samples",
".",
"getN",
"(",
")",
";",
"long",
"t",
"=",
"currentTime",
"-",
"lastHeartbeat",
... | Computes the phi value from the given samples.
<p>
The original phi value in Hayashibara's paper is calculated based on a normal distribution.
Here, we calculate it based on an exponential distribution.
@param samples the samples from which to compute phi
@param lastHeartbeat the last heartbeat
@param currentTim... | [
"Computes",
"the",
"phi",
"value",
"from",
"the",
"given",
"samples",
".",
"<p",
">",
"The",
"original",
"phi",
"value",
"in",
"Hayashibara",
"s",
"paper",
"is",
"calculated",
"based",
"on",
"a",
"normal",
"distribution",
".",
"Here",
"we",
"calculate",
"i... | train | https://github.com/atomix/atomix/blob/3a94b7c80576d762dd0d396d4645df07a0b37c31/cluster/src/main/java/io/atomix/cluster/impl/PhiAccrualFailureDetector.java#L121-L127 |
liferay/com-liferay-commerce | commerce-product-service/src/main/java/com/liferay/commerce/product/service/persistence/impl/CPInstancePersistenceImpl.java | CPInstancePersistenceImpl.removeByC_S | @Override
public CPInstance removeByC_S(long CPDefinitionId, String sku)
throws NoSuchCPInstanceException {
"""
Removes the cp instance where CPDefinitionId = ? and sku = ? from the database.
@param CPDefinitionId the cp definition ID
@param sku the sku
@return the cp instance that was removed
... | java | @Override
public CPInstance removeByC_S(long CPDefinitionId, String sku)
throws NoSuchCPInstanceException {
CPInstance cpInstance = findByC_S(CPDefinitionId, sku);
return remove(cpInstance);
} | [
"@",
"Override",
"public",
"CPInstance",
"removeByC_S",
"(",
"long",
"CPDefinitionId",
",",
"String",
"sku",
")",
"throws",
"NoSuchCPInstanceException",
"{",
"CPInstance",
"cpInstance",
"=",
"findByC_S",
"(",
"CPDefinitionId",
",",
"sku",
")",
";",
"return",
"remo... | Removes the cp instance where CPDefinitionId = ? and sku = ? from the database.
@param CPDefinitionId the cp definition ID
@param sku the sku
@return the cp instance that was removed | [
"Removes",
"the",
"cp",
"instance",
"where",
"CPDefinitionId",
"=",
"?",
";",
"and",
"sku",
"=",
"?",
";",
"from",
"the",
"database",
"."
] | train | https://github.com/liferay/com-liferay-commerce/blob/9e54362d7f59531fc684016ba49ee7cdc3a2f22b/commerce-product-service/src/main/java/com/liferay/commerce/product/service/persistence/impl/CPInstancePersistenceImpl.java#L4480-L4486 |
google/closure-templates | java/src/com/google/template/soy/jssrc/dsl/ConditionalBuilder.java | ConditionalBuilder.addElseIf | public ConditionalBuilder addElseIf(Expression predicate, Statement consequent) {
"""
Adds an {@code else if} clause with the given predicate and consequent to this conditional.
"""
conditions.add(new IfThenPair<>(predicate, consequent));
return this;
} | java | public ConditionalBuilder addElseIf(Expression predicate, Statement consequent) {
conditions.add(new IfThenPair<>(predicate, consequent));
return this;
} | [
"public",
"ConditionalBuilder",
"addElseIf",
"(",
"Expression",
"predicate",
",",
"Statement",
"consequent",
")",
"{",
"conditions",
".",
"add",
"(",
"new",
"IfThenPair",
"<>",
"(",
"predicate",
",",
"consequent",
")",
")",
";",
"return",
"this",
";",
"}"
] | Adds an {@code else if} clause with the given predicate and consequent to this conditional. | [
"Adds",
"an",
"{"
] | train | https://github.com/google/closure-templates/blob/cc61e1dff70ae97f24f417a57410081bc498bd56/java/src/com/google/template/soy/jssrc/dsl/ConditionalBuilder.java#L36-L39 |
facebookarchive/hadoop-20 | src/core/org/apache/hadoop/io/retry/RetryPolicies.java | RetryPolicies.retryUpToMaximumCountWithProportionalSleep | public static final RetryPolicy retryUpToMaximumCountWithProportionalSleep(int maxRetries, long sleepTime, TimeUnit timeUnit) {
"""
<p>
Keep trying a limited number of times, waiting a growing amount of time between attempts,
and then fail by re-throwing the exception.
The time between attempts is <code>sleepTi... | java | public static final RetryPolicy retryUpToMaximumCountWithProportionalSleep(int maxRetries, long sleepTime, TimeUnit timeUnit) {
return new RetryUpToMaximumCountWithProportionalSleep(maxRetries, sleepTime, timeUnit);
} | [
"public",
"static",
"final",
"RetryPolicy",
"retryUpToMaximumCountWithProportionalSleep",
"(",
"int",
"maxRetries",
",",
"long",
"sleepTime",
",",
"TimeUnit",
"timeUnit",
")",
"{",
"return",
"new",
"RetryUpToMaximumCountWithProportionalSleep",
"(",
"maxRetries",
",",
"sle... | <p>
Keep trying a limited number of times, waiting a growing amount of time between attempts,
and then fail by re-throwing the exception.
The time between attempts is <code>sleepTime</code> mutliplied by the number of tries so far.
</p> | [
"<p",
">",
"Keep",
"trying",
"a",
"limited",
"number",
"of",
"times",
"waiting",
"a",
"growing",
"amount",
"of",
"time",
"between",
"attempts",
"and",
"then",
"fail",
"by",
"re",
"-",
"throwing",
"the",
"exception",
".",
"The",
"time",
"between",
"attempts... | train | https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/core/org/apache/hadoop/io/retry/RetryPolicies.java#L86-L88 |
threerings/gwt-utils | src/main/java/com/threerings/gwt/ui/Popups.java | Popups.centerOn | public static <T extends PopupPanel> T centerOn (T popup, Widget centerOn) {
"""
Centers the supplied vertically on the supplied trigger widget. The popup's showing state
will be preserved.
"""
return centerOn(popup, centerOn.getAbsoluteTop() + centerOn.getOffsetHeight()/2);
} | java | public static <T extends PopupPanel> T centerOn (T popup, Widget centerOn)
{
return centerOn(popup, centerOn.getAbsoluteTop() + centerOn.getOffsetHeight()/2);
} | [
"public",
"static",
"<",
"T",
"extends",
"PopupPanel",
">",
"T",
"centerOn",
"(",
"T",
"popup",
",",
"Widget",
"centerOn",
")",
"{",
"return",
"centerOn",
"(",
"popup",
",",
"centerOn",
".",
"getAbsoluteTop",
"(",
")",
"+",
"centerOn",
".",
"getOffsetHeigh... | Centers the supplied vertically on the supplied trigger widget. The popup's showing state
will be preserved. | [
"Centers",
"the",
"supplied",
"vertically",
"on",
"the",
"supplied",
"trigger",
"widget",
".",
"The",
"popup",
"s",
"showing",
"state",
"will",
"be",
"preserved",
"."
] | train | https://github.com/threerings/gwt-utils/blob/31b31a23b667f2a9c683160d77646db259f2aae5/src/main/java/com/threerings/gwt/ui/Popups.java#L229-L232 |
gmessner/gitlab4j-api | src/main/java/org/gitlab4j/api/GitLabApiForm.java | GitLabApiForm.withParam | public GitLabApiForm withParam(String name, AccessLevel level) throws IllegalArgumentException {
"""
Fluent method for adding AccessLevel query and form parameters to a get() or post() call.
@param name the name of the field/attribute to add
@param level the value of the field/attribute to add
@return this Gi... | java | public GitLabApiForm withParam(String name, AccessLevel level) throws IllegalArgumentException {
return (withParam(name, level, false));
} | [
"public",
"GitLabApiForm",
"withParam",
"(",
"String",
"name",
",",
"AccessLevel",
"level",
")",
"throws",
"IllegalArgumentException",
"{",
"return",
"(",
"withParam",
"(",
"name",
",",
"level",
",",
"false",
")",
")",
";",
"}"
] | Fluent method for adding AccessLevel query and form parameters to a get() or post() call.
@param name the name of the field/attribute to add
@param level the value of the field/attribute to add
@return this GitLabAPiForm instance | [
"Fluent",
"method",
"for",
"adding",
"AccessLevel",
"query",
"and",
"form",
"parameters",
"to",
"a",
"get",
"()",
"or",
"post",
"()",
"call",
"."
] | train | https://github.com/gmessner/gitlab4j-api/blob/ab045070abac0a8f4ccbf17b5ed9bfdef5723eed/src/main/java/org/gitlab4j/api/GitLabApiForm.java#L81-L83 |
Azure/azure-sdk-for-java | keyvault/resource-manager/v2016_10_01/src/main/java/com/microsoft/azure/management/keyvault/v2016_10_01/implementation/VaultsInner.java | VaultsInner.beginPurgeDeleted | public void beginPurgeDeleted(String vaultName, String location) {
"""
Permanently deletes the specified vault. aka Purges the deleted Azure key vault.
@param vaultName The name of the soft-deleted vault.
@param location The location of the soft-deleted vault.
@throws IllegalArgumentException thrown if parame... | java | public void beginPurgeDeleted(String vaultName, String location) {
beginPurgeDeletedWithServiceResponseAsync(vaultName, location).toBlocking().single().body();
} | [
"public",
"void",
"beginPurgeDeleted",
"(",
"String",
"vaultName",
",",
"String",
"location",
")",
"{",
"beginPurgeDeletedWithServiceResponseAsync",
"(",
"vaultName",
",",
"location",
")",
".",
"toBlocking",
"(",
")",
".",
"single",
"(",
")",
".",
"body",
"(",
... | Permanently deletes the specified vault. aka Purges the deleted Azure key vault.
@param vaultName The name of the soft-deleted vault.
@param location The location of the soft-deleted vault.
@throws IllegalArgumentException thrown if parameters fail the validation
@throws CloudException thrown if the request is rejecte... | [
"Permanently",
"deletes",
"the",
"specified",
"vault",
".",
"aka",
"Purges",
"the",
"deleted",
"Azure",
"key",
"vault",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/keyvault/resource-manager/v2016_10_01/src/main/java/com/microsoft/azure/management/keyvault/v2016_10_01/implementation/VaultsInner.java#L1321-L1323 |
googleapis/google-cloud-java | google-cloud-clients/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/LoadJobConfiguration.java | LoadJobConfiguration.newBuilder | public static Builder newBuilder(
TableId destinationTable, String sourceUri, FormatOptions format) {
"""
Creates a builder for a BigQuery Load Job configuration given the destination table, format and
source URI.
"""
return newBuilder(destinationTable, ImmutableList.of(sourceUri), format);
} | java | public static Builder newBuilder(
TableId destinationTable, String sourceUri, FormatOptions format) {
return newBuilder(destinationTable, ImmutableList.of(sourceUri), format);
} | [
"public",
"static",
"Builder",
"newBuilder",
"(",
"TableId",
"destinationTable",
",",
"String",
"sourceUri",
",",
"FormatOptions",
"format",
")",
"{",
"return",
"newBuilder",
"(",
"destinationTable",
",",
"ImmutableList",
".",
"of",
"(",
"sourceUri",
")",
",",
"... | Creates a builder for a BigQuery Load Job configuration given the destination table, format and
source URI. | [
"Creates",
"a",
"builder",
"for",
"a",
"BigQuery",
"Load",
"Job",
"configuration",
"given",
"the",
"destination",
"table",
"format",
"and",
"source",
"URI",
"."
] | train | https://github.com/googleapis/google-cloud-java/blob/d2f0bc64a53049040fe9c9d338b12fab3dd1ad6a/google-cloud-clients/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/LoadJobConfiguration.java#L526-L529 |
legsem/legstar-core2 | legstar-base-generator/src/main/java/com/legstar/base/generator/AbstractCob2JavaGeneratorMain.java | AbstractCob2JavaGeneratorMain.collectOptions | protected boolean collectOptions(final Options options, final String[] args) {
"""
Take arguments received on the command line and setup corresponding
options.
<p/>
No arguments is valid. It means use the defaults.
@param options the expected options
@param args the actual arguments received on the command ... | java | protected boolean collectOptions(final Options options, final String[] args) {
try {
if (args != null && args.length > 0) {
CommandLineParser parser = new PosixParser();
CommandLine line = parser.parse(options, args);
return processLine(line, options);... | [
"protected",
"boolean",
"collectOptions",
"(",
"final",
"Options",
"options",
",",
"final",
"String",
"[",
"]",
"args",
")",
"{",
"try",
"{",
"if",
"(",
"args",
"!=",
"null",
"&&",
"args",
".",
"length",
">",
"0",
")",
"{",
"CommandLineParser",
"parser",... | Take arguments received on the command line and setup corresponding
options.
<p/>
No arguments is valid. It means use the defaults.
@param options the expected options
@param args the actual arguments received on the command line
@return true if arguments were valid | [
"Take",
"arguments",
"received",
"on",
"the",
"command",
"line",
"and",
"setup",
"corresponding",
"options",
".",
"<p",
"/",
">",
"No",
"arguments",
"is",
"valid",
".",
"It",
"means",
"use",
"the",
"defaults",
"."
] | train | https://github.com/legsem/legstar-core2/blob/f74d25d5b2b21a2ebaaaf2162b3fb7138dca40c6/legstar-base-generator/src/main/java/com/legstar/base/generator/AbstractCob2JavaGeneratorMain.java#L177-L192 |
Omertron/api-themoviedb | src/main/java/com/omertron/themoviedbapi/TheMovieDbApi.java | TheMovieDbApi.getMovieInfo | public MovieInfo getMovieInfo(int movieId, String language, String... appendToResponse) throws MovieDbException {
"""
This method is used to retrieve all of the basic movie information.
It will return the single highest rated poster and backdrop.
ApiExceptionType.MOVIE_ID_NOT_FOUND will be thrown if there ar... | java | public MovieInfo getMovieInfo(int movieId, String language, String... appendToResponse) throws MovieDbException {
return tmdbMovies.getMovieInfo(movieId, language, appendToResponse);
} | [
"public",
"MovieInfo",
"getMovieInfo",
"(",
"int",
"movieId",
",",
"String",
"language",
",",
"String",
"...",
"appendToResponse",
")",
"throws",
"MovieDbException",
"{",
"return",
"tmdbMovies",
".",
"getMovieInfo",
"(",
"movieId",
",",
"language",
",",
"appendToR... | This method is used to retrieve all of the basic movie information.
It will return the single highest rated poster and backdrop.
ApiExceptionType.MOVIE_ID_NOT_FOUND will be thrown if there are no movies
found.
@param movieId movieId
@param language language
@param appendToResponse appendToResponse
@return
@throws Mo... | [
"This",
"method",
"is",
"used",
"to",
"retrieve",
"all",
"of",
"the",
"basic",
"movie",
"information",
"."
] | train | https://github.com/Omertron/api-themoviedb/blob/bf132d7c7271734e13b58ba3bc92bba46f220118/src/main/java/com/omertron/themoviedbapi/TheMovieDbApi.java#L850-L852 |
iig-uni-freiburg/SEWOL | src/de/uni/freiburg/iig/telematik/sewol/log/DULogEntry.java | DULogEntry.setDataUsage | public boolean setDataUsage(Map<DataAttribute, Set<DataUsage>> dataUsage) throws ParameterException, LockingException {
"""
Sets the given data usage as data usage for this entry.
@param dataUsage The data usage to adopt.
@return <code>true</code> if the current data usage was modified;<br>
<code>false</code>... | java | public boolean setDataUsage(Map<DataAttribute, Set<DataUsage>> dataUsage) throws ParameterException, LockingException {
Validate.notNull(dataUsage);
Validate.notEmpty(dataUsage.keySet());
Validate.noNullElements(dataUsage.keySet());
Validate.noNullElements... | [
"public",
"boolean",
"setDataUsage",
"(",
"Map",
"<",
"DataAttribute",
",",
"Set",
"<",
"DataUsage",
">",
">",
"dataUsage",
")",
"throws",
"ParameterException",
",",
"LockingException",
"{",
"Validate",
".",
"notNull",
"(",
"dataUsage",
")",
";",
"Validate",
"... | Sets the given data usage as data usage for this entry.
@param dataUsage The data usage to adopt.
@return <code>true</code> if the current data usage was modified;<br>
<code>false</code> otherwise.
@throws ParameterException if the given data usage is invalid
(<code>null</code> or empty).
@throws LockingException if t... | [
"Sets",
"the",
"given",
"data",
"usage",
"as",
"data",
"usage",
"for",
"this",
"entry",
"."
] | train | https://github.com/iig-uni-freiburg/SEWOL/blob/e791cb07a6e62ecf837d760d58a25f32fbf6bbca/src/de/uni/freiburg/iig/telematik/sewol/log/DULogEntry.java#L93-L108 |
lessthanoptimal/BoofCV | main/boofcv-feature/src/main/java/boofcv/alg/shapes/ShapeFittingOps.java | ShapeFittingOps.convert_I32_F64 | public static List<Point2D_F64> convert_I32_F64(List<Point2D_I32> points) {
"""
Converts a list of I32 points into F64
@param points Original points
@return Converted points
"""
return convert_I32_F64(points,null).toList();
} | java | public static List<Point2D_F64> convert_I32_F64(List<Point2D_I32> points) {
return convert_I32_F64(points,null).toList();
} | [
"public",
"static",
"List",
"<",
"Point2D_F64",
">",
"convert_I32_F64",
"(",
"List",
"<",
"Point2D_I32",
">",
"points",
")",
"{",
"return",
"convert_I32_F64",
"(",
"points",
",",
"null",
")",
".",
"toList",
"(",
")",
";",
"}"
] | Converts a list of I32 points into F64
@param points Original points
@return Converted points | [
"Converts",
"a",
"list",
"of",
"I32",
"points",
"into",
"F64"
] | train | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-feature/src/main/java/boofcv/alg/shapes/ShapeFittingOps.java#L174-L176 |
JetBrains/xodus | openAPI/src/main/java/jetbrains/exodus/env/EnvironmentConfig.java | EnvironmentConfig.setGcFilesDeletionDelay | public EnvironmentConfig setGcFilesDeletionDelay(final int delay) throws InvalidSettingException {
"""
Sets the number of milliseconds which deletion of any successfully cleaned {@code Log} file (.xd file)
is postponed for. Default value is {@code 5000}.
<p>Mutable at runtime: yes
@param delay number of milli... | java | public EnvironmentConfig setGcFilesDeletionDelay(final int delay) throws InvalidSettingException {
if (delay < 0) {
throw new InvalidSettingException("Invalid GC files deletion delay: " + delay);
}
return setSetting(GC_FILES_DELETION_DELAY, delay);
} | [
"public",
"EnvironmentConfig",
"setGcFilesDeletionDelay",
"(",
"final",
"int",
"delay",
")",
"throws",
"InvalidSettingException",
"{",
"if",
"(",
"delay",
"<",
"0",
")",
"{",
"throw",
"new",
"InvalidSettingException",
"(",
"\"Invalid GC files deletion delay: \"",
"+",
... | Sets the number of milliseconds which deletion of any successfully cleaned {@code Log} file (.xd file)
is postponed for. Default value is {@code 5000}.
<p>Mutable at runtime: yes
@param delay number of milliseconds which deletion of any successfully cleaned .xd file is postponed for
@return this {@code EnvironmentConf... | [
"Sets",
"the",
"number",
"of",
"milliseconds",
"which",
"deletion",
"of",
"any",
"successfully",
"cleaned",
"{",
"@code",
"Log",
"}",
"file",
"(",
".",
"xd",
"file",
")",
"is",
"postponed",
"for",
".",
"Default",
"value",
"is",
"{",
"@code",
"5000",
"}",... | train | https://github.com/JetBrains/xodus/blob/7b3476c4e81db66f9c7529148c761605cc8eea6d/openAPI/src/main/java/jetbrains/exodus/env/EnvironmentConfig.java#L2165-L2170 |
fuinorg/utils4swing | src/main/java/org/fuin/utils4swing/common/Utils4Swing.java | Utils4Swing.initLookAndFeelIntern | private static void initLookAndFeelIntern(final String className) {
"""
Initializes the look and feel and wraps exceptions into a runtime
exception. It's executed in the calling thread.
@param className
Full qualified name of the look and feel class.
"""
try {
UIManager.setLookAndFee... | java | private static void initLookAndFeelIntern(final String className) {
try {
UIManager.setLookAndFeel(className);
} catch (final Exception e) {
throw new RuntimeException("Error initializing the Look And Feel!", e);
}
} | [
"private",
"static",
"void",
"initLookAndFeelIntern",
"(",
"final",
"String",
"className",
")",
"{",
"try",
"{",
"UIManager",
".",
"setLookAndFeel",
"(",
"className",
")",
";",
"}",
"catch",
"(",
"final",
"Exception",
"e",
")",
"{",
"throw",
"new",
"RuntimeE... | Initializes the look and feel and wraps exceptions into a runtime
exception. It's executed in the calling thread.
@param className
Full qualified name of the look and feel class. | [
"Initializes",
"the",
"look",
"and",
"feel",
"and",
"wraps",
"exceptions",
"into",
"a",
"runtime",
"exception",
".",
"It",
"s",
"executed",
"in",
"the",
"calling",
"thread",
"."
] | train | https://github.com/fuinorg/utils4swing/blob/560fb69eac182e3473de9679c3c15433e524ef6b/src/main/java/org/fuin/utils4swing/common/Utils4Swing.java#L136-L142 |
Netflix/conductor | client/src/main/java/com/netflix/conductor/client/http/TaskClient.java | TaskClient.requeuePendingTasksByTaskType | public String requeuePendingTasksByTaskType(String taskType) {
"""
Requeue pending tasks of a specific task type
@return returns the number of tasks that have been requeued
"""
Preconditions.checkArgument(StringUtils.isNotBlank(taskType), "Task type cannot be blank");
return postForEntity("t... | java | public String requeuePendingTasksByTaskType(String taskType) {
Preconditions.checkArgument(StringUtils.isNotBlank(taskType), "Task type cannot be blank");
return postForEntity("tasks/queue/requeue/{taskType}", null, null, String.class, taskType);
} | [
"public",
"String",
"requeuePendingTasksByTaskType",
"(",
"String",
"taskType",
")",
"{",
"Preconditions",
".",
"checkArgument",
"(",
"StringUtils",
".",
"isNotBlank",
"(",
"taskType",
")",
",",
"\"Task type cannot be blank\"",
")",
";",
"return",
"postForEntity",
"("... | Requeue pending tasks of a specific task type
@return returns the number of tasks that have been requeued | [
"Requeue",
"pending",
"tasks",
"of",
"a",
"specific",
"task",
"type"
] | train | https://github.com/Netflix/conductor/blob/78fae0ed9ddea22891f9eebb96a2ec0b2783dca0/client/src/main/java/com/netflix/conductor/client/http/TaskClient.java#L373-L376 |
rometools/rome | rome/src/main/java/com/rometools/rome/io/WireFeedOutput.java | WireFeedOutput.outputW3CDom | public org.w3c.dom.Document outputW3CDom(final WireFeed feed) throws IllegalArgumentException, FeedException {
"""
Creates a W3C DOM document for the given WireFeed.
<p>
This method does not use the feed encoding property.
<p>
NOTE: This method delages to the 'Document WireFeedOutput#outputJDom(WireFeed)'.
<p... | java | public org.w3c.dom.Document outputW3CDom(final WireFeed feed) throws IllegalArgumentException, FeedException {
final Document doc = outputJDom(feed);
final DOMOutputter outputter = new DOMOutputter();
try {
return outputter.output(doc);
} catch (final JDOMException jdomEx) {
... | [
"public",
"org",
".",
"w3c",
".",
"dom",
".",
"Document",
"outputW3CDom",
"(",
"final",
"WireFeed",
"feed",
")",
"throws",
"IllegalArgumentException",
",",
"FeedException",
"{",
"final",
"Document",
"doc",
"=",
"outputJDom",
"(",
"feed",
")",
";",
"final",
"... | Creates a W3C DOM document for the given WireFeed.
<p>
This method does not use the feed encoding property.
<p>
NOTE: This method delages to the 'Document WireFeedOutput#outputJDom(WireFeed)'.
<p>
@param feed Abstract feed to create W3C DOM document from. The type of the WireFeed must
match the type given to the FeedO... | [
"Creates",
"a",
"W3C",
"DOM",
"document",
"for",
"the",
"given",
"WireFeed",
".",
"<p",
">",
"This",
"method",
"does",
"not",
"use",
"the",
"feed",
"encoding",
"property",
".",
"<p",
">",
"NOTE",
":",
"This",
"method",
"delages",
"to",
"the",
"Document",... | train | https://github.com/rometools/rome/blob/5fcf0b1a9a6cdedbe253a45ad9468c54a0f97010/rome/src/main/java/com/rometools/rome/io/WireFeedOutput.java#L266-L274 |
Appendium/objectlabkit | datecalc-common/src/main/java/net/objectlab/kit/datecalc/common/AbstractIMMDateCalculator.java | AbstractIMMDateCalculator.getIMMDates | @Override
public List<E> getIMMDates(final E start, final E end) {
"""
Returns a list of IMM dates between 2 dates, it will exclude the start
date if it is an IMM date but would include the end date if it is an IMM
(same as IMMPeriod.QUARTERLY).
@param start
start of the interval, excluded
@param end
... | java | @Override
public List<E> getIMMDates(final E start, final E end) {
return getIMMDates(start, end, IMMPeriod.QUARTERLY);
} | [
"@",
"Override",
"public",
"List",
"<",
"E",
">",
"getIMMDates",
"(",
"final",
"E",
"start",
",",
"final",
"E",
"end",
")",
"{",
"return",
"getIMMDates",
"(",
"start",
",",
"end",
",",
"IMMPeriod",
".",
"QUARTERLY",
")",
";",
"}"
] | Returns a list of IMM dates between 2 dates, it will exclude the start
date if it is an IMM date but would include the end date if it is an IMM
(same as IMMPeriod.QUARTERLY).
@param start
start of the interval, excluded
@param end
end of the interval, may be included.
@return list of IMM dates | [
"Returns",
"a",
"list",
"of",
"IMM",
"dates",
"between",
"2",
"dates",
"it",
"will",
"exclude",
"the",
"start",
"date",
"if",
"it",
"is",
"an",
"IMM",
"date",
"but",
"would",
"include",
"the",
"end",
"date",
"if",
"it",
"is",
"an",
"IMM",
"(",
"same"... | train | https://github.com/Appendium/objectlabkit/blob/cd649bce7a32e4e926520e62cb765f3b1d451594/datecalc-common/src/main/java/net/objectlab/kit/datecalc/common/AbstractIMMDateCalculator.java#L120-L123 |
apereo/cas | support/cas-server-support-saml-idp-metadata/src/main/java/org/apereo/cas/support/saml/services/idp/metadata/cache/SamlRegisteredServiceMetadataExpirationPolicy.java | SamlRegisteredServiceMetadataExpirationPolicy.getCacheDurationForServiceProvider | protected long getCacheDurationForServiceProvider(final SamlRegisteredService service, final MetadataResolver chainingMetadataResolver) {
"""
Gets cache duration for service provider.
@param service the service
@param chainingMetadataResolver the chaining metadata resolver
@return the cache d... | java | protected long getCacheDurationForServiceProvider(final SamlRegisteredService service, final MetadataResolver chainingMetadataResolver) {
try {
val set = new CriteriaSet();
set.add(new EntityIdCriterion(service.getServiceId()));
set.add(new EntityRoleCriterion(SPSSODescriptor... | [
"protected",
"long",
"getCacheDurationForServiceProvider",
"(",
"final",
"SamlRegisteredService",
"service",
",",
"final",
"MetadataResolver",
"chainingMetadataResolver",
")",
"{",
"try",
"{",
"val",
"set",
"=",
"new",
"CriteriaSet",
"(",
")",
";",
"set",
".",
"add"... | Gets cache duration for service provider.
@param service the service
@param chainingMetadataResolver the chaining metadata resolver
@return the cache duration for service provider | [
"Gets",
"cache",
"duration",
"for",
"service",
"provider",
"."
] | train | https://github.com/apereo/cas/blob/b4b306433a8782cef803a39bea5b1f96740e0e9b/support/cas-server-support-saml-idp-metadata/src/main/java/org/apereo/cas/support/saml/services/idp/metadata/cache/SamlRegisteredServiceMetadataExpirationPolicy.java#L75-L97 |
andriusvelykis/reflow-maven-skin | reflow-velocity-tools/src/main/java/lt/velykis/maven/skins/reflow/HtmlTool.java | HtmlTool.replaceAll | public String replaceAll(String content, Map<String, String> replacements) {
"""
Replaces elements in HTML.
@param content
HTML content to modify
@param replacements
Map of CSS selectors to their replacement HTML texts. CSS selectors find elements
to be replaced with the HTML in the mapping. The HTML must p... | java | public String replaceAll(String content, Map<String, String> replacements) {
Element body = parseContent(content);
boolean modified = false;
for (Entry<String, String> replacementEntry : replacements.entrySet()) {
String selector = replacementEntry.getKey();
String replacement = replacementEntry.getValu... | [
"public",
"String",
"replaceAll",
"(",
"String",
"content",
",",
"Map",
"<",
"String",
",",
"String",
">",
"replacements",
")",
"{",
"Element",
"body",
"=",
"parseContent",
"(",
"content",
")",
";",
"boolean",
"modified",
"=",
"false",
";",
"for",
"(",
"... | Replaces elements in HTML.
@param content
HTML content to modify
@param replacements
Map of CSS selectors to their replacement HTML texts. CSS selectors find elements
to be replaced with the HTML in the mapping. The HTML must parse to a single
element.
@return HTML content with replaced elements. If no elements are fo... | [
"Replaces",
"elements",
"in",
"HTML",
"."
] | train | https://github.com/andriusvelykis/reflow-maven-skin/blob/01170ae1426a1adfe7cc9c199e77aaa2ecb37ef2/reflow-velocity-tools/src/main/java/lt/velykis/maven/skins/reflow/HtmlTool.java#L813-L844 |
eclipse/xtext-extras | org.eclipse.xtext.xbase/src/org/eclipse/xtext/xbase/scoping/batch/AbstractSessionBasedScope.java | AbstractSessionBasedScope.processAsPropertyNames | protected void processAsPropertyNames(QualifiedName name, NameAcceptor acceptor) {
"""
Considers the given name to be a property name. If the concrete syntax of the
processed feature matches a feature call or assignment, a prefix is added to the
name and that one is used as a variant that should be processed.
... | java | protected void processAsPropertyNames(QualifiedName name, NameAcceptor acceptor) {
String nameAsPropertyName = tryGetAsPropertyName(name.toString());
if (nameAsPropertyName != null) {
if (featureCall == null || featureCall instanceof XAssignment) {
String aliasedSetter = "set" + nameAsPropertyName;
accep... | [
"protected",
"void",
"processAsPropertyNames",
"(",
"QualifiedName",
"name",
",",
"NameAcceptor",
"acceptor",
")",
"{",
"String",
"nameAsPropertyName",
"=",
"tryGetAsPropertyName",
"(",
"name",
".",
"toString",
"(",
")",
")",
";",
"if",
"(",
"nameAsPropertyName",
... | Considers the given name to be a property name. If the concrete syntax of the
processed feature matches a feature call or assignment, a prefix is added to the
name and that one is used as a variant that should be processed. | [
"Considers",
"the",
"given",
"name",
"to",
"be",
"a",
"property",
"name",
".",
"If",
"the",
"concrete",
"syntax",
"of",
"the",
"processed",
"feature",
"matches",
"a",
"feature",
"call",
"or",
"assignment",
"a",
"prefix",
"is",
"added",
"to",
"the",
"name",... | train | https://github.com/eclipse/xtext-extras/blob/451359541295323a29f5855e633f770cec02069a/org.eclipse.xtext.xbase/src/org/eclipse/xtext/xbase/scoping/batch/AbstractSessionBasedScope.java#L86-L102 |
knowm/Yank | src/main/java/org/knowm/yank/Yank.java | Yank.queryBeanListSQLKey | public static <T> List<T> queryBeanListSQLKey(
String poolName, String sqlKey, Class<T> beanType, Object[] params)
throws SQLStatementNotFoundException, YankSQLException {
"""
Return a List of Beans given a SQL Key using an SQL statement matching the sqlKey String in a
properties file loaded via Yank.... | java | public static <T> List<T> queryBeanListSQLKey(
String poolName, String sqlKey, Class<T> beanType, Object[] params)
throws SQLStatementNotFoundException, YankSQLException {
String sql = YANK_POOL_MANAGER.getMergedSqlProperties().getProperty(sqlKey);
if (sql == null || sql.equalsIgnoreCase("")) {
... | [
"public",
"static",
"<",
"T",
">",
"List",
"<",
"T",
">",
"queryBeanListSQLKey",
"(",
"String",
"poolName",
",",
"String",
"sqlKey",
",",
"Class",
"<",
"T",
">",
"beanType",
",",
"Object",
"[",
"]",
"params",
")",
"throws",
"SQLStatementNotFoundException",
... | Return a List of Beans given a SQL Key using an SQL statement matching the sqlKey String in a
properties file loaded via Yank.addSQLStatements(...).
@param poolName The name of the connection pool to query against
@param sqlKey The SQL Key found in a properties file corresponding to the desired SQL statement
value
@pa... | [
"Return",
"a",
"List",
"of",
"Beans",
"given",
"a",
"SQL",
"Key",
"using",
"an",
"SQL",
"statement",
"matching",
"the",
"sqlKey",
"String",
"in",
"a",
"properties",
"file",
"loaded",
"via",
"Yank",
".",
"addSQLStatements",
"(",
"...",
")",
"."
] | train | https://github.com/knowm/Yank/blob/b2071dcd94da99db6904355f9557456b8b292a6b/src/main/java/org/knowm/yank/Yank.java#L450-L460 |
ziccardi/jnrpe | jnrpe-server/src/main/java/it/jnrpe/server/JNRPEServer.java | JNRPEServer.printHelp | private static void printHelp(final IPluginRepository pr, final String pluginName) {
"""
Prints the help about a plugin.
@param pr
The plugin repository
@param pluginName
The plugin name
"""
try {
PluginProxy pp = (PluginProxy) pr.getPlugin(pluginName);
// CPluginProxy pp... | java | private static void printHelp(final IPluginRepository pr, final String pluginName) {
try {
PluginProxy pp = (PluginProxy) pr.getPlugin(pluginName);
// CPluginProxy pp =
// CPluginFactory.getInstance().getPlugin(sPluginName);
if (pp == null) {
Syst... | [
"private",
"static",
"void",
"printHelp",
"(",
"final",
"IPluginRepository",
"pr",
",",
"final",
"String",
"pluginName",
")",
"{",
"try",
"{",
"PluginProxy",
"pp",
"=",
"(",
"PluginProxy",
")",
"pr",
".",
"getPlugin",
"(",
"pluginName",
")",
";",
"// CPlugin... | Prints the help about a plugin.
@param pr
The plugin repository
@param pluginName
The plugin name | [
"Prints",
"the",
"help",
"about",
"a",
"plugin",
"."
] | train | https://github.com/ziccardi/jnrpe/blob/ac9046355851136994388442b01ba4063305f9c4/jnrpe-server/src/main/java/it/jnrpe/server/JNRPEServer.java#L141-L157 |
OpenTSDB/opentsdb | src/tsd/client/MetricForm.java | MetricForm.parseRateOptions | static final public LocalRateOptions parseRateOptions(boolean rate, String spec) {
"""
Parses the "rate" section of the query string and returns an instance
of the LocalRateOptions class that contains the values found.
<p/>
The format of the rate specification is rate[{counter[,#[,#]]}].
If the spec is invalid... | java | static final public LocalRateOptions parseRateOptions(boolean rate, String spec) {
if (!rate || spec.length() < 6) {
return new LocalRateOptions();
}
String[] parts = spec.split(spec.substring(5, spec.length() - 1), ',');
if (parts.length < 1 || parts.length > 3) {
return new LocalRateOptio... | [
"static",
"final",
"public",
"LocalRateOptions",
"parseRateOptions",
"(",
"boolean",
"rate",
",",
"String",
"spec",
")",
"{",
"if",
"(",
"!",
"rate",
"||",
"spec",
".",
"length",
"(",
")",
"<",
"6",
")",
"{",
"return",
"new",
"LocalRateOptions",
"(",
")"... | Parses the "rate" section of the query string and returns an instance
of the LocalRateOptions class that contains the values found.
<p/>
The format of the rate specification is rate[{counter[,#[,#]]}].
If the spec is invalid or we were unable to parse properly, it returns a
default options object.
@param rate If true, ... | [
"Parses",
"the",
"rate",
"section",
"of",
"the",
"query",
"string",
"and",
"returns",
"an",
"instance",
"of",
"the",
"LocalRateOptions",
"class",
"that",
"contains",
"the",
"values",
"found",
".",
"<p",
"/",
">",
"The",
"format",
"of",
"the",
"rate",
"spec... | train | https://github.com/OpenTSDB/opentsdb/blob/3fc2d491c3c1ad397252c0a80203a69a3f9e3ef3/src/tsd/client/MetricForm.java#L722-L743 |
deeplearning4j/deeplearning4j | nd4j/nd4j-backends/nd4j-api-parent/nd4j-api/src/main/java/org/nd4j/autodiff/samediff/flow/FlowPath.java | FlowPath.activateFrame | public void activateFrame(@NonNull String frameName, boolean reallyActivate) {
"""
This method triggers frame state
@param frameName
@param reallyActivate
"""
frames.get(frameName).setActive(reallyActivate);
} | java | public void activateFrame(@NonNull String frameName, boolean reallyActivate) {
frames.get(frameName).setActive(reallyActivate);
} | [
"public",
"void",
"activateFrame",
"(",
"@",
"NonNull",
"String",
"frameName",
",",
"boolean",
"reallyActivate",
")",
"{",
"frames",
".",
"get",
"(",
"frameName",
")",
".",
"setActive",
"(",
"reallyActivate",
")",
";",
"}"
] | This method triggers frame state
@param frameName
@param reallyActivate | [
"This",
"method",
"triggers",
"frame",
"state"
] | train | https://github.com/deeplearning4j/deeplearning4j/blob/effce52f2afd7eeb53c5bcca699fcd90bd06822f/nd4j/nd4j-backends/nd4j-api-parent/nd4j-api/src/main/java/org/nd4j/autodiff/samediff/flow/FlowPath.java#L221-L223 |
finmath/finmath-lib | src/main/java/net/finmath/montecarlo/process/EulerSchemeFromProcessModel.java | EulerSchemeFromProcessModel.getProcessValue | @Override
public RandomVariable getProcessValue(int timeIndex, int componentIndex) {
"""
This method returns the realization of the process at a certain time index.
@param timeIndex Time index at which the process should be observed
@return A vector of process realizations (on path)
"""
// Thread safe l... | java | @Override
public RandomVariable getProcessValue(int timeIndex, int componentIndex) {
// Thread safe lazy initialization
synchronized(this) {
if (discreteProcess == null || discreteProcess.length == 0) {
doPrecalculateProcess();
}
}
if(discreteProcess[timeIndex][componentIndex] == null) {
throw ne... | [
"@",
"Override",
"public",
"RandomVariable",
"getProcessValue",
"(",
"int",
"timeIndex",
",",
"int",
"componentIndex",
")",
"{",
"// Thread safe lazy initialization",
"synchronized",
"(",
"this",
")",
"{",
"if",
"(",
"discreteProcess",
"==",
"null",
"||",
"discreteP... | This method returns the realization of the process at a certain time index.
@param timeIndex Time index at which the process should be observed
@return A vector of process realizations (on path) | [
"This",
"method",
"returns",
"the",
"realization",
"of",
"the",
"process",
"at",
"a",
"certain",
"time",
"index",
"."
] | train | https://github.com/finmath/finmath-lib/blob/a3c067d52dd33feb97d851df6cab130e4116759f/src/main/java/net/finmath/montecarlo/process/EulerSchemeFromProcessModel.java#L97-L112 |
JodaOrg/joda-time | src/main/java/org/joda/time/YearMonthDay.java | YearMonthDay.withMonthOfYear | public YearMonthDay withMonthOfYear(int monthOfYear) {
"""
Returns a copy of this date with the month of year field updated.
<p>
YearMonthDay is immutable, so there are no set methods.
Instead, this method returns a new instance with the value of
month of year changed.
@param monthOfYear the month of year ... | java | public YearMonthDay withMonthOfYear(int monthOfYear) {
int[] newValues = getValues();
newValues = getChronology().monthOfYear().set(this, MONTH_OF_YEAR, newValues, monthOfYear);
return new YearMonthDay(this, newValues);
} | [
"public",
"YearMonthDay",
"withMonthOfYear",
"(",
"int",
"monthOfYear",
")",
"{",
"int",
"[",
"]",
"newValues",
"=",
"getValues",
"(",
")",
";",
"newValues",
"=",
"getChronology",
"(",
")",
".",
"monthOfYear",
"(",
")",
".",
"set",
"(",
"this",
",",
"MON... | Returns a copy of this date with the month of year field updated.
<p>
YearMonthDay is immutable, so there are no set methods.
Instead, this method returns a new instance with the value of
month of year changed.
@param monthOfYear the month of year to set
@return a copy of this object with the field set
@throws Illega... | [
"Returns",
"a",
"copy",
"of",
"this",
"date",
"with",
"the",
"month",
"of",
"year",
"field",
"updated",
".",
"<p",
">",
"YearMonthDay",
"is",
"immutable",
"so",
"there",
"are",
"no",
"set",
"methods",
".",
"Instead",
"this",
"method",
"returns",
"a",
"ne... | train | https://github.com/JodaOrg/joda-time/blob/bd79f1c4245e79b3c2c56d7b04fde2a6e191fa42/src/main/java/org/joda/time/YearMonthDay.java#L860-L864 |
UrielCh/ovh-java-sdk | ovh-java-sdk-dedicatedCloud/src/main/java/net/minidev/ovh/api/ApiOvhDedicatedCloud.java | ApiOvhDedicatedCloud.serviceName_datacenter_datacenterId_vm_vmId_GET | public OvhVm serviceName_datacenter_datacenterId_vm_vmId_GET(String serviceName, Long datacenterId, Long vmId) throws IOException {
"""
Get this object properties
REST: GET /dedicatedCloud/{serviceName}/datacenter/{datacenterId}/vm/{vmId}
@param serviceName [required] Domain of the service
@param datacenterId... | java | public OvhVm serviceName_datacenter_datacenterId_vm_vmId_GET(String serviceName, Long datacenterId, Long vmId) throws IOException {
String qPath = "/dedicatedCloud/{serviceName}/datacenter/{datacenterId}/vm/{vmId}";
StringBuilder sb = path(qPath, serviceName, datacenterId, vmId);
String resp = exec(qPath, "GET", ... | [
"public",
"OvhVm",
"serviceName_datacenter_datacenterId_vm_vmId_GET",
"(",
"String",
"serviceName",
",",
"Long",
"datacenterId",
",",
"Long",
"vmId",
")",
"throws",
"IOException",
"{",
"String",
"qPath",
"=",
"\"/dedicatedCloud/{serviceName}/datacenter/{datacenterId}/vm/{vmId}\... | Get this object properties
REST: GET /dedicatedCloud/{serviceName}/datacenter/{datacenterId}/vm/{vmId}
@param serviceName [required] Domain of the service
@param datacenterId [required]
@param vmId [required] Id of the virtual machine.
API beta | [
"Get",
"this",
"object",
"properties"
] | train | https://github.com/UrielCh/ovh-java-sdk/blob/6d531a40e56e09701943e334c25f90f640c55701/ovh-java-sdk-dedicatedCloud/src/main/java/net/minidev/ovh/api/ApiOvhDedicatedCloud.java#L2130-L2135 |
liferay/com-liferay-commerce | commerce-service/src/main/java/com/liferay/commerce/service/persistence/impl/CPDefinitionInventoryPersistenceImpl.java | CPDefinitionInventoryPersistenceImpl.removeByUuid_C | @Override
public void removeByUuid_C(String uuid, long companyId) {
"""
Removes all the cp definition inventories where uuid = ? and companyId = ? from the database.
@param uuid the uuid
@param companyId the company ID
"""
for (CPDefinitionInventory cpDefinitionInventory : findByUuid_C(uuid,
... | java | @Override
public void removeByUuid_C(String uuid, long companyId) {
for (CPDefinitionInventory cpDefinitionInventory : findByUuid_C(uuid,
companyId, QueryUtil.ALL_POS, QueryUtil.ALL_POS, null)) {
remove(cpDefinitionInventory);
}
} | [
"@",
"Override",
"public",
"void",
"removeByUuid_C",
"(",
"String",
"uuid",
",",
"long",
"companyId",
")",
"{",
"for",
"(",
"CPDefinitionInventory",
"cpDefinitionInventory",
":",
"findByUuid_C",
"(",
"uuid",
",",
"companyId",
",",
"QueryUtil",
".",
"ALL_POS",
",... | Removes all the cp definition inventories where uuid = ? and companyId = ? from the database.
@param uuid the uuid
@param companyId the company ID | [
"Removes",
"all",
"the",
"cp",
"definition",
"inventories",
"where",
"uuid",
"=",
"?",
";",
"and",
"companyId",
"=",
"?",
";",
"from",
"the",
"database",
"."
] | train | https://github.com/liferay/com-liferay-commerce/blob/9e54362d7f59531fc684016ba49ee7cdc3a2f22b/commerce-service/src/main/java/com/liferay/commerce/service/persistence/impl/CPDefinitionInventoryPersistenceImpl.java#L1411-L1417 |
phax/ph-schedule | ph-mini-quartz/src/main/java/com/helger/quartz/TriggerBuilder.java | TriggerBuilder.forJob | @Nonnull
public TriggerBuilder <T> forJob (final String jobName) {
"""
Set the identity of the Job which should be fired by the produced Trigger -
a <code>JobKey</code> will be produced with the given name and default
group.
@param jobName
the name of the job (in default group) to fire.
@return the update... | java | @Nonnull
public TriggerBuilder <T> forJob (final String jobName)
{
m_aJobKey = new JobKey (jobName, null);
return this;
} | [
"@",
"Nonnull",
"public",
"TriggerBuilder",
"<",
"T",
">",
"forJob",
"(",
"final",
"String",
"jobName",
")",
"{",
"m_aJobKey",
"=",
"new",
"JobKey",
"(",
"jobName",
",",
"null",
")",
";",
"return",
"this",
";",
"}"
] | Set the identity of the Job which should be fired by the produced Trigger -
a <code>JobKey</code> will be produced with the given name and default
group.
@param jobName
the name of the job (in default group) to fire.
@return the updated TriggerBuilder
@see ITrigger#getJobKey() | [
"Set",
"the",
"identity",
"of",
"the",
"Job",
"which",
"should",
"be",
"fired",
"by",
"the",
"produced",
"Trigger",
"-",
"a",
"<code",
">",
"JobKey<",
"/",
"code",
">",
"will",
"be",
"produced",
"with",
"the",
"given",
"name",
"and",
"default",
"group",
... | train | https://github.com/phax/ph-schedule/blob/b000790b46a9f8d23ad44cc20591f753d07c0229/ph-mini-quartz/src/main/java/com/helger/quartz/TriggerBuilder.java#L329-L334 |
teatrove/teatrove | teaapps/src/main/java/org/teatrove/teaapps/contexts/StringContext.java | StringContext.findFirst | public int findFirst(String str, String search) {
"""
Finds the index of the first occurrence of the given search string in
the source string, or -1 if not found.
@param str the source string
@param search the string to search for
@return the start index of the found string or -1 if not found
"""
... | java | public int findFirst(String str, String search) {
return (str == null || search == null) ? -1 :
str.indexOf(search);
} | [
"public",
"int",
"findFirst",
"(",
"String",
"str",
",",
"String",
"search",
")",
"{",
"return",
"(",
"str",
"==",
"null",
"||",
"search",
"==",
"null",
")",
"?",
"-",
"1",
":",
"str",
".",
"indexOf",
"(",
"search",
")",
";",
"}"
] | Finds the index of the first occurrence of the given search string in
the source string, or -1 if not found.
@param str the source string
@param search the string to search for
@return the start index of the found string or -1 if not found | [
"Finds",
"the",
"index",
"of",
"the",
"first",
"occurrence",
"of",
"the",
"given",
"search",
"string",
"in",
"the",
"source",
"string",
"or",
"-",
"1",
"if",
"not",
"found",
"."
] | train | https://github.com/teatrove/teatrove/blob/7039bdd4da6817ff8c737f7e4e07bac7e3ad8bea/teaapps/src/main/java/org/teatrove/teaapps/contexts/StringContext.java#L125-L128 |
powermock/powermock | powermock-api/powermock-api-easymock/src/main/java/org/powermock/api/easymock/PowerMock.java | PowerMock.createStrictMock | public static <T> T createStrictMock(Class<T> type, Object... constructorArguments) {
"""
Creates a strict mock object that supports mocking of final and native
methods and invokes a specific constructor based on the supplied argument
values.
@param <T> the type of the mock object
@param typ... | java | public static <T> T createStrictMock(Class<T> type, Object... constructorArguments) {
Constructor<?> constructor = WhiteboxImpl.findUniqueConstructorOrThrowException(type, constructorArguments);
ConstructorArgs constructorArgs = new ConstructorArgs(constructor, constructorArguments);
return doMo... | [
"public",
"static",
"<",
"T",
">",
"T",
"createStrictMock",
"(",
"Class",
"<",
"T",
">",
"type",
",",
"Object",
"...",
"constructorArguments",
")",
"{",
"Constructor",
"<",
"?",
">",
"constructor",
"=",
"WhiteboxImpl",
".",
"findUniqueConstructorOrThrowException... | Creates a strict mock object that supports mocking of final and native
methods and invokes a specific constructor based on the supplied argument
values.
@param <T> the type of the mock object
@param type the type of the mock object
@param constructorArguments The constructor arguments ... | [
"Creates",
"a",
"strict",
"mock",
"object",
"that",
"supports",
"mocking",
"of",
"final",
"and",
"native",
"methods",
"and",
"invokes",
"a",
"specific",
"constructor",
"based",
"on",
"the",
"supplied",
"argument",
"values",
"."
] | train | https://github.com/powermock/powermock/blob/e8cd68026c284c6a7efe66959809eeebd8d1f9ad/powermock-api/powermock-api-easymock/src/main/java/org/powermock/api/easymock/PowerMock.java#L220-L224 |
phax/ph-commons | ph-commons/src/main/java/com/helger/commons/dimension/SizeDouble.java | SizeDouble.getBestMatchingSize | @Nonnull
@CheckReturnValue
public SizeDouble getBestMatchingSize (@Nonnegative final double dMaxWidth, @Nonnegative final double dMaxHeight) {
"""
Return the scaled width and height relative to a maximum size.
@param dMaxWidth
Maximum width. Must be > 0.
@param dMaxHeight
Maximum height. Must be > ... | java | @Nonnull
@CheckReturnValue
public SizeDouble getBestMatchingSize (@Nonnegative final double dMaxWidth, @Nonnegative final double dMaxHeight)
{
ValueEnforcer.isGT0 (dMaxWidth, "MaxWidth");
ValueEnforcer.isGT0 (dMaxHeight, "MaxHeight");
final double dRelWidth = m_dWidth / dMaxWidth;
final double dR... | [
"@",
"Nonnull",
"@",
"CheckReturnValue",
"public",
"SizeDouble",
"getBestMatchingSize",
"(",
"@",
"Nonnegative",
"final",
"double",
"dMaxWidth",
",",
"@",
"Nonnegative",
"final",
"double",
"dMaxHeight",
")",
"{",
"ValueEnforcer",
".",
"isGT0",
"(",
"dMaxWidth",
",... | Return the scaled width and height relative to a maximum size.
@param dMaxWidth
Maximum width. Must be > 0.
@param dMaxHeight
Maximum height. Must be > 0.
@return An array with 2 elements, where the first element is the width, and
the second is the height. | [
"Return",
"the",
"scaled",
"width",
"and",
"height",
"relative",
"to",
"a",
"maximum",
"size",
"."
] | train | https://github.com/phax/ph-commons/blob/d28c03565f44a0b804d96028d0969f9bb38c4313/ph-commons/src/main/java/com/helger/commons/dimension/SizeDouble.java#L90-L110 |
lamarios/sherdog-parser | src/main/java/com/ftpix/sherdogparser/parsers/EventParser.java | EventParser.getFights | private void getFights(Document doc, Event event) {
"""
Gets the fight of the event
@param doc the jsoup HTML document
@param event The current event
"""
logger.info("Getting fights for event #{}[{}]", event.getSherdogUrl(), event.getName());
SherdogBaseObject sEvent = new SherdogBaseObj... | java | private void getFights(Document doc, Event event) {
logger.info("Getting fights for event #{}[{}]", event.getSherdogUrl(), event.getName());
SherdogBaseObject sEvent = new SherdogBaseObject();
sEvent.setName(event.getName());
sEvent.setSherdogUrl(event.getSherdogUrl());
List<Fi... | [
"private",
"void",
"getFights",
"(",
"Document",
"doc",
",",
"Event",
"event",
")",
"{",
"logger",
".",
"info",
"(",
"\"Getting fights for event #{}[{}]\"",
",",
"event",
".",
"getSherdogUrl",
"(",
")",
",",
"event",
".",
"getName",
"(",
")",
")",
";",
"Sh... | Gets the fight of the event
@param doc the jsoup HTML document
@param event The current event | [
"Gets",
"the",
"fight",
"of",
"the",
"event"
] | train | https://github.com/lamarios/sherdog-parser/blob/7cdb36280317caeaaa54db77c04dc4b4e1db053e/src/main/java/com/ftpix/sherdogparser/parsers/EventParser.java#L87-L141 |
googleapis/google-cloud-java | google-cloud-clients/google-cloud-firestore/src/main/java/com/google/cloud/firestore/DocumentSet.java | DocumentSet.add | DocumentSet add(QueryDocumentSnapshot document) {
"""
Returns a new DocumentSet that contains the given document, replacing any old document with the
same key.
"""
// Remove any prior mapping of the document's key before adding, preventing sortedSet from
// accumulating values that aren't in the index... | java | DocumentSet add(QueryDocumentSnapshot document) {
// Remove any prior mapping of the document's key before adding, preventing sortedSet from
// accumulating values that aren't in the index.
DocumentSet removed = remove(document.getReference().getResourcePath());
ImmutableSortedMap<ResourcePath, QueryDo... | [
"DocumentSet",
"add",
"(",
"QueryDocumentSnapshot",
"document",
")",
"{",
"// Remove any prior mapping of the document's key before adding, preventing sortedSet from",
"// accumulating values that aren't in the index.",
"DocumentSet",
"removed",
"=",
"remove",
"(",
"document",
".",
"... | Returns a new DocumentSet that contains the given document, replacing any old document with the
same key. | [
"Returns",
"a",
"new",
"DocumentSet",
"that",
"contains",
"the",
"given",
"document",
"replacing",
"any",
"old",
"document",
"with",
"the",
"same",
"key",
"."
] | train | https://github.com/googleapis/google-cloud-java/blob/d2f0bc64a53049040fe9c9d338b12fab3dd1ad6a/google-cloud-clients/google-cloud-firestore/src/main/java/com/google/cloud/firestore/DocumentSet.java#L99-L108 |
FXMisc/WellBehavedFX | src/main/java/org/fxmisc/wellbehaved/event/Nodes.java | Nodes.setInputMapUnsafe | private static void setInputMapUnsafe(Node node, InputMap<?> im) {
"""
Expects a {@link #init(Node)} call with the given node before this one is called
"""
getProperties(node).put(P_INPUTMAP, im);
} | java | private static void setInputMapUnsafe(Node node, InputMap<?> im) {
getProperties(node).put(P_INPUTMAP, im);
} | [
"private",
"static",
"void",
"setInputMapUnsafe",
"(",
"Node",
"node",
",",
"InputMap",
"<",
"?",
">",
"im",
")",
"{",
"getProperties",
"(",
"node",
")",
".",
"put",
"(",
"P_INPUTMAP",
",",
"im",
")",
";",
"}"
] | Expects a {@link #init(Node)} call with the given node before this one is called | [
"Expects",
"a",
"{"
] | train | https://github.com/FXMisc/WellBehavedFX/blob/ca889734481f5439655ca8deb6f742964b5654b0/src/main/java/org/fxmisc/wellbehaved/event/Nodes.java#L151-L153 |
moparisthebest/beehive | beehive-netui-tags/src/main/java/org/apache/beehive/netui/tags/databinding/datagrid/SpanCell.java | SpanCell.renderDataCellContents | protected void renderDataCellContents(AbstractRenderAppender appender, String jspFragmentOutput) {
"""
Render the cell's contents. This method implements support for executing the span cell's decorator.
@param appender the {@link AbstractRenderAppender} used to collect the rendered output
@param jspFragmentOutp... | java | protected void renderDataCellContents(AbstractRenderAppender appender, String jspFragmentOutput) {
/* render any JavaScript needed to support framework features */
if (_spanState.id != null) {
HttpServletRequest request = JspUtil.getRequest(getJspContext());
String script = rende... | [
"protected",
"void",
"renderDataCellContents",
"(",
"AbstractRenderAppender",
"appender",
",",
"String",
"jspFragmentOutput",
")",
"{",
"/* render any JavaScript needed to support framework features */",
"if",
"(",
"_spanState",
".",
"id",
"!=",
"null",
")",
"{",
"HttpServl... | Render the cell's contents. This method implements support for executing the span cell's decorator.
@param appender the {@link AbstractRenderAppender} used to collect the rendered output
@param jspFragmentOutput the String result of having evaluated the span cell's {@link javax.servlet.jsp.tagext.JspFragment} | [
"Render",
"the",
"cell",
"s",
"contents",
".",
"This",
"method",
"implements",
"support",
"for",
"executing",
"the",
"span",
"cell",
"s",
"decorator",
"."
] | train | https://github.com/moparisthebest/beehive/blob/4246a0cc40ce3c05f1a02c2da2653ac622703d77/beehive-netui-tags/src/main/java/org/apache/beehive/netui/tags/databinding/datagrid/SpanCell.java#L343-L353 |
apache/reef | lang/java/reef-io/src/main/java/org/apache/reef/io/network/group/impl/task/OperatorTopologyStructImpl.java | OperatorTopologyStructImpl.nodesWithDataTakeUnsafe | private NodeStruct nodesWithDataTakeUnsafe() {
"""
Retrieves and removes the head of {@code nodesWithData}, waiting if necessary until an element becomes available.
(Comment taken from {@link java.util.concurrent.BlockingQueue})
If interrupted while waiting, then throws a RuntimeException.
@return the head of... | java | private NodeStruct nodesWithDataTakeUnsafe() {
LOG.entering("OperatorTopologyStructImpl", "nodesWithDataTakeUnsafe");
try {
final NodeStruct child = nodesWithData.take();
LOG.exiting("OperatorTopologyStructImpl", "nodesWithDataTakeUnsafe", child);
return child;
} catch (final InterruptedE... | [
"private",
"NodeStruct",
"nodesWithDataTakeUnsafe",
"(",
")",
"{",
"LOG",
".",
"entering",
"(",
"\"OperatorTopologyStructImpl\"",
",",
"\"nodesWithDataTakeUnsafe\"",
")",
";",
"try",
"{",
"final",
"NodeStruct",
"child",
"=",
"nodesWithData",
".",
"take",
"(",
")",
... | Retrieves and removes the head of {@code nodesWithData}, waiting if necessary until an element becomes available.
(Comment taken from {@link java.util.concurrent.BlockingQueue})
If interrupted while waiting, then throws a RuntimeException.
@return the head of this queue | [
"Retrieves",
"and",
"removes",
"the",
"head",
"of",
"{",
"@code",
"nodesWithData",
"}",
"waiting",
"if",
"necessary",
"until",
"an",
"element",
"becomes",
"available",
".",
"(",
"Comment",
"taken",
"from",
"{",
"@link",
"java",
".",
"util",
".",
"concurrent"... | train | https://github.com/apache/reef/blob/e2c47121cde21108a602c560cf76565a40d0e916/lang/java/reef-io/src/main/java/org/apache/reef/io/network/group/impl/task/OperatorTopologyStructImpl.java#L280-L290 |
jbossws/jbossws-common | src/main/java/org/jboss/ws/common/injection/InjectionHelper.java | InjectionHelper.setField | private static void setField(final Object instance, final Field field, final Object value) {
"""
Sets field on object with specified value.
@param instance to set field on
@param field to set
@param value to be set
"""
final boolean accessability = field.isAccessible();
try
{
f... | java | private static void setField(final Object instance, final Field field, final Object value)
{
final boolean accessability = field.isAccessible();
try
{
field.setAccessible(true);
field.set(instance, value);
}
catch (Exception e)
{
InjectionException.reth... | [
"private",
"static",
"void",
"setField",
"(",
"final",
"Object",
"instance",
",",
"final",
"Field",
"field",
",",
"final",
"Object",
"value",
")",
"{",
"final",
"boolean",
"accessability",
"=",
"field",
".",
"isAccessible",
"(",
")",
";",
"try",
"{",
"fiel... | Sets field on object with specified value.
@param instance to set field on
@param field to set
@param value to be set | [
"Sets",
"field",
"on",
"object",
"with",
"specified",
"value",
"."
] | train | https://github.com/jbossws/jbossws-common/blob/fcff8a3ef9bfe046d6fa8c855a3fe4f62841add7/src/main/java/org/jboss/ws/common/injection/InjectionHelper.java#L188-L205 |
jbundle/jbundle | base/screen/view/html/src/main/java/org/jbundle/base/screen/view/html/HBasePanel.java | HBasePanel.addHiddenParam | public void addHiddenParam(PrintWriter out, String strParam, String strValue) {
"""
Add this hidden param to the output stream.
@param out The html output stream.
@param strParam The parameter.
@param strValue The param's value.
"""
out.println("<input type=\"hidden\" name=\"" + strParam + "\" value... | java | public void addHiddenParam(PrintWriter out, String strParam, String strValue)
{
out.println("<input type=\"hidden\" name=\"" + strParam + "\" value=\"" + strValue + "\">");
} | [
"public",
"void",
"addHiddenParam",
"(",
"PrintWriter",
"out",
",",
"String",
"strParam",
",",
"String",
"strValue",
")",
"{",
"out",
".",
"println",
"(",
"\"<input type=\\\"hidden\\\" name=\\\"\"",
"+",
"strParam",
"+",
"\"\\\" value=\\\"\"",
"+",
"strValue",
"+",
... | Add this hidden param to the output stream.
@param out The html output stream.
@param strParam The parameter.
@param strValue The param's value. | [
"Add",
"this",
"hidden",
"param",
"to",
"the",
"output",
"stream",
"."
] | train | https://github.com/jbundle/jbundle/blob/4037fcfa85f60c7d0096c453c1a3cd573c2b0abc/base/screen/view/html/src/main/java/org/jbundle/base/screen/view/html/HBasePanel.java#L601-L604 |
ksclarke/freelib-utils | src/main/java/info/freelibrary/util/RegexFileFilter.java | RegexFileFilter.accept | @Override
public boolean accept(final File aDir, final String aFilename) {
"""
Determines whether the supplied {@link File} in the supplied directory should be included.
@param aDir The directory in which the {@link File} of the file name lives
@param aFilename A {@link File} name to compare against the re... | java | @Override
public boolean accept(final File aDir, final String aFilename) {
return new File(aDir, aFilename).isFile() && myPattern.matcher(aFilename).matches();
} | [
"@",
"Override",
"public",
"boolean",
"accept",
"(",
"final",
"File",
"aDir",
",",
"final",
"String",
"aFilename",
")",
"{",
"return",
"new",
"File",
"(",
"aDir",
",",
"aFilename",
")",
".",
"isFile",
"(",
")",
"&&",
"myPattern",
".",
"matcher",
"(",
"... | Determines whether the supplied {@link File} in the supplied directory should be included.
@param aDir The directory in which the {@link File} of the file name lives
@param aFilename A {@link File} name to compare against the regular expression; it must be a file (not a
directory) | [
"Determines",
"whether",
"the",
"supplied",
"{",
"@link",
"File",
"}",
"in",
"the",
"supplied",
"directory",
"should",
"be",
"included",
"."
] | train | https://github.com/ksclarke/freelib-utils/blob/54e822ae4c11b3d74793fd82a1a535ffafffaf45/src/main/java/info/freelibrary/util/RegexFileFilter.java#L45-L48 |
maestrano/maestrano-java | src/main/java/com/maestrano/net/AccountClient.java | AccountClient.retrieve | public T retrieve(String entityId) throws AuthenticationException, ApiException, InvalidRequestException {
"""
Fetch an entity by id
@param entity
class
@param entity
id
@return entity
@throws AuthenticationException
@throws ApiException
@throws InvalidRequestException
"""
return retrieve(entityId,... | java | public T retrieve(String entityId) throws AuthenticationException, ApiException, InvalidRequestException {
return retrieve(entityId, getAuthenticatedClient());
} | [
"public",
"T",
"retrieve",
"(",
"String",
"entityId",
")",
"throws",
"AuthenticationException",
",",
"ApiException",
",",
"InvalidRequestException",
"{",
"return",
"retrieve",
"(",
"entityId",
",",
"getAuthenticatedClient",
"(",
")",
")",
";",
"}"
] | Fetch an entity by id
@param entity
class
@param entity
id
@return entity
@throws AuthenticationException
@throws ApiException
@throws InvalidRequestException | [
"Fetch",
"an",
"entity",
"by",
"id"
] | train | https://github.com/maestrano/maestrano-java/blob/e71c6d3172d7645529d678d1cb3ea9e0a59de314/src/main/java/com/maestrano/net/AccountClient.java#L216-L218 |
davidmoten/rxjava-jdbc | src/main/java/com/github/davidmoten/rx/jdbc/QuerySelectOnSubscribe.java | QuerySelectOnSubscribe.connectAndPrepareStatement | private void connectAndPrepareStatement(Subscriber<? super T> subscriber, State state)
throws SQLException {
"""
Obtains connection, creates prepared statement and assigns parameters to
the prepared statement.
@param subscriber
@param state
@throws SQLException
"""
log.debug("connec... | java | private void connectAndPrepareStatement(Subscriber<? super T> subscriber, State state)
throws SQLException {
log.debug("connectionProvider={}", query.context().connectionProvider());
if (!subscriber.isUnsubscribed()) {
log.debug("getting connection");
state.con = quer... | [
"private",
"void",
"connectAndPrepareStatement",
"(",
"Subscriber",
"<",
"?",
"super",
"T",
">",
"subscriber",
",",
"State",
"state",
")",
"throws",
"SQLException",
"{",
"log",
".",
"debug",
"(",
"\"connectionProvider={}\"",
",",
"query",
".",
"context",
"(",
... | Obtains connection, creates prepared statement and assigns parameters to
the prepared statement.
@param subscriber
@param state
@throws SQLException | [
"Obtains",
"connection",
"creates",
"prepared",
"statement",
"and",
"assigns",
"parameters",
"to",
"the",
"prepared",
"statement",
"."
] | train | https://github.com/davidmoten/rxjava-jdbc/blob/81e157d7071a825086bde81107b8694684cdff14/src/main/java/com/github/davidmoten/rx/jdbc/QuerySelectOnSubscribe.java#L101-L116 |
akarnokd/akarnokd-xml | src/main/java/hu/akarnokd/xml/XNElement.java | XNElement.hasName | public boolean hasName(String name, String namespace) {
"""
Test if this XElement has the given name and namespace.
@param name the name to test against
@param namespace the namespace to test against
@return true if the names and namespaces equal
"""
return hasName(name) && Objects.equals(this.names... | java | public boolean hasName(String name, String namespace) {
return hasName(name) && Objects.equals(this.namespace, namespace);
} | [
"public",
"boolean",
"hasName",
"(",
"String",
"name",
",",
"String",
"namespace",
")",
"{",
"return",
"hasName",
"(",
"name",
")",
"&&",
"Objects",
".",
"equals",
"(",
"this",
".",
"namespace",
",",
"namespace",
")",
";",
"}"
] | Test if this XElement has the given name and namespace.
@param name the name to test against
@param namespace the namespace to test against
@return true if the names and namespaces equal | [
"Test",
"if",
"this",
"XElement",
"has",
"the",
"given",
"name",
"and",
"namespace",
"."
] | train | https://github.com/akarnokd/akarnokd-xml/blob/57466a5a9cb455a13d7121557c165287b31ee870/src/main/java/hu/akarnokd/xml/XNElement.java#L975-L977 |
OpenLiberty/open-liberty | dev/com.ibm.ws.webcontainer/src/com/ibm/ws/webcontainer/osgi/webapp/WebApp.java | WebApp.determineWhetherToAddScis | protected void determineWhetherToAddScis(ServletContainerInitializer sci, List<ServletContainerInitializer> scis) {
"""
Tell if servlet-container-initializer (SCI) annotation processing is to be done on the
class of a specified initializer. Provide the answer as a side effect. If processing
is to be done, add ... | java | protected void determineWhetherToAddScis(ServletContainerInitializer sci, List<ServletContainerInitializer> scis) {
// SCIs from DS are already added
if (acceptAnnotationsFrom(sci.getClass().getName(), DO_ACCEPT_PARTIAL, DO_NOT_ACCEPT_EXCLUDED)) {
scis.add(sci);
}
} | [
"protected",
"void",
"determineWhetherToAddScis",
"(",
"ServletContainerInitializer",
"sci",
",",
"List",
"<",
"ServletContainerInitializer",
">",
"scis",
")",
"{",
"// SCIs from DS are already added ",
"if",
"(",
"acceptAnnotationsFrom",
"(",
"sci",
".",
"getClass",
... | Tell if servlet-container-initializer (SCI) annotation processing is to be done on the
class of a specified initializer. Provide the answer as a side effect. If processing
is to be done, add the initializer to the specified initializer list. If processing is
not to be done, do not add the initializer.
@param sci Th... | [
"Tell",
"if",
"servlet",
"-",
"container",
"-",
"initializer",
"(",
"SCI",
")",
"annotation",
"processing",
"is",
"to",
"be",
"done",
"on",
"the",
"class",
"of",
"a",
"specified",
"initializer",
".",
"Provide",
"the",
"answer",
"as",
"a",
"side",
"effect",... | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.webcontainer/src/com/ibm/ws/webcontainer/osgi/webapp/WebApp.java#L891-L897 |
reinert/requestor | requestor/core/requestor-api/src/main/java/io/reinert/requestor/WebTarget.java | WebTarget.getUri | public Uri getUri() {
"""
Get the URI identifying the resource.
@return the resource URI.
@throws IllegalStateException if the URI could not be built from the current state of the resource target.
"""
if (uri == null) {
try {
uri = uriBuilder.build();
} c... | java | public Uri getUri() {
if (uri == null) {
try {
uri = uriBuilder.build();
} catch (Exception e) {
throw new IllegalStateException("Could not build the URI.", e);
}
}
return uri;
} | [
"public",
"Uri",
"getUri",
"(",
")",
"{",
"if",
"(",
"uri",
"==",
"null",
")",
"{",
"try",
"{",
"uri",
"=",
"uriBuilder",
".",
"build",
"(",
")",
";",
"}",
"catch",
"(",
"Exception",
"e",
")",
"{",
"throw",
"new",
"IllegalStateException",
"(",
"\"C... | Get the URI identifying the resource.
@return the resource URI.
@throws IllegalStateException if the URI could not be built from the current state of the resource target. | [
"Get",
"the",
"URI",
"identifying",
"the",
"resource",
"."
] | train | https://github.com/reinert/requestor/blob/40163a75cd17815d5089935d0dd97b8d652ad6d4/requestor/core/requestor-api/src/main/java/io/reinert/requestor/WebTarget.java#L112-L121 |
spotbugs/spotbugs | spotbugs/src/main/java/edu/umd/cs/findbugs/ba/SignatureConverter.java | SignatureConverter.convertMethodSignature | public static String convertMethodSignature(String className, String methodName, String methodSig, String pkgName) {
"""
Convenience method for generating a method signature in human readable
form.
@param className
name of the class containing the method
@param methodName
the name of the method
@param meth... | java | public static String convertMethodSignature(String className, String methodName, String methodSig, String pkgName) {
StringBuilder args = new StringBuilder();
SignatureConverter converter = new SignatureConverter(methodSig);
converter.skip();
args.append('(');
while (converter.... | [
"public",
"static",
"String",
"convertMethodSignature",
"(",
"String",
"className",
",",
"String",
"methodName",
",",
"String",
"methodSig",
",",
"String",
"pkgName",
")",
"{",
"StringBuilder",
"args",
"=",
"new",
"StringBuilder",
"(",
")",
";",
"SignatureConverte... | Convenience method for generating a method signature in human readable
form.
@param className
name of the class containing the method
@param methodName
the name of the method
@param methodSig
the signature of the method
@param pkgName
the name of the package the method is in (used to shorten
class names) | [
"Convenience",
"method",
"for",
"generating",
"a",
"method",
"signature",
"in",
"human",
"readable",
"form",
"."
] | train | https://github.com/spotbugs/spotbugs/blob/f6365c6eea6515035bded38efa4a7c8b46ccf28c/spotbugs/src/main/java/edu/umd/cs/findbugs/ba/SignatureConverter.java#L231-L256 |
jbake-org/jbake | jbake-core/src/main/java/org/jbake/app/FileUtil.java | FileUtil.isFileInDirectory | public static boolean isFileInDirectory(File file, File directory) throws IOException {
"""
Utility method to determine if a given file is located somewhere in the directory provided.
@param file used to check if it is located in the provided directory.
@param directory to validate whether or not the provided ... | java | public static boolean isFileInDirectory(File file, File directory) throws IOException {
return (file.exists()
&& !file.isHidden()
&& directory.isDirectory()
&& file.getCanonicalPath().startsWith(directory.getCanonicalPath()));
} | [
"public",
"static",
"boolean",
"isFileInDirectory",
"(",
"File",
"file",
",",
"File",
"directory",
")",
"throws",
"IOException",
"{",
"return",
"(",
"file",
".",
"exists",
"(",
")",
"&&",
"!",
"file",
".",
"isHidden",
"(",
")",
"&&",
"directory",
".",
"i... | Utility method to determine if a given file is located somewhere in the directory provided.
@param file used to check if it is located in the provided directory.
@param directory to validate whether or not the provided file resides.
@return true if the file is somewhere in the provided directory, false if it is not.
@... | [
"Utility",
"method",
"to",
"determine",
"if",
"a",
"given",
"file",
"is",
"located",
"somewhere",
"in",
"the",
"directory",
"provided",
"."
] | train | https://github.com/jbake-org/jbake/blob/beb9042a54bf0eb168821d524c88b9ea0bee88dc/jbake-core/src/main/java/org/jbake/app/FileUtil.java#L241-L246 |
GenesysPureEngage/workspace-client-java | src/main/java/com/genesys/internal/workspace/api/UcsApi.java | UcsApi.getContactHistory | public ApiSuccessResponse getContactHistory(String id, ContactHistoryData contactHistoryData) throws ApiException {
"""
Get the history of interactions for a contact
@param id id of the Contact (required)
@param contactHistoryData (required)
@return ApiSuccessResponse
@throws ApiException If fail to call th... | java | public ApiSuccessResponse getContactHistory(String id, ContactHistoryData contactHistoryData) throws ApiException {
ApiResponse<ApiSuccessResponse> resp = getContactHistoryWithHttpInfo(id, contactHistoryData);
return resp.getData();
} | [
"public",
"ApiSuccessResponse",
"getContactHistory",
"(",
"String",
"id",
",",
"ContactHistoryData",
"contactHistoryData",
")",
"throws",
"ApiException",
"{",
"ApiResponse",
"<",
"ApiSuccessResponse",
">",
"resp",
"=",
"getContactHistoryWithHttpInfo",
"(",
"id",
",",
"c... | Get the history of interactions for a contact
@param id id of the Contact (required)
@param contactHistoryData (required)
@return ApiSuccessResponse
@throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body | [
"Get",
"the",
"history",
"of",
"interactions",
"for",
"a",
"contact"
] | train | https://github.com/GenesysPureEngage/workspace-client-java/blob/509fdd9e89b9359d012f9a72be95037a3cef53e6/src/main/java/com/genesys/internal/workspace/api/UcsApi.java#L1033-L1036 |
ButterFaces/ButterFaces | components/src/main/java/org/butterfaces/component/partrenderer/CheckBoxReadonlyPartRenderer.java | CheckBoxReadonlyPartRenderer.getReadonlyDisplayValue | private String getReadonlyDisplayValue(final Object value, final HtmlCheckBox checkBox) {
"""
Should return value string for the readonly view mode. Can be overridden
for custom components.
"""
final StringBuilder sb = new StringBuilder();
if (StringUtils.isNotEmpty(checkBox.getDescription()))... | java | private String getReadonlyDisplayValue(final Object value, final HtmlCheckBox checkBox) {
final StringBuilder sb = new StringBuilder();
if (StringUtils.isNotEmpty(checkBox.getDescription())) {
sb.append(checkBox.getDescription()).append(": ");
}
sb.append((Boolean) value ? "j... | [
"private",
"String",
"getReadonlyDisplayValue",
"(",
"final",
"Object",
"value",
",",
"final",
"HtmlCheckBox",
"checkBox",
")",
"{",
"final",
"StringBuilder",
"sb",
"=",
"new",
"StringBuilder",
"(",
")",
";",
"if",
"(",
"StringUtils",
".",
"isNotEmpty",
"(",
"... | Should return value string for the readonly view mode. Can be overridden
for custom components. | [
"Should",
"return",
"value",
"string",
"for",
"the",
"readonly",
"view",
"mode",
".",
"Can",
"be",
"overridden",
"for",
"custom",
"components",
"."
] | train | https://github.com/ButterFaces/ButterFaces/blob/e8c2bb340c89dcdbac409fcfc7a2a0e07f2462fc/components/src/main/java/org/butterfaces/component/partrenderer/CheckBoxReadonlyPartRenderer.java#L52-L59 |
lessthanoptimal/BoofCV | main/boofcv-recognition/src/main/java/boofcv/alg/fiducial/qrcode/QrCodeCodeWordLocations.java | QrCodeCodeWordLocations.computeBitLocations | private void computeBitLocations() {
"""
Snakes through and specifies the location of each bit for all the code words in the grid.
"""
int N = numRows;
int row = N-1;
int col = N-1;
int direction = -1;
while (col > 0) {
if (col == 6)
col -= 1;
if (!get(row,col)) {
bits.add( new Point2... | java | private void computeBitLocations() {
int N = numRows;
int row = N-1;
int col = N-1;
int direction = -1;
while (col > 0) {
if (col == 6)
col -= 1;
if (!get(row,col)) {
bits.add( new Point2D_I32(col,row));
}
if (!get(row,col-1)) {
bits.add( new Point2D_I32(col-1,row));
}
row += ... | [
"private",
"void",
"computeBitLocations",
"(",
")",
"{",
"int",
"N",
"=",
"numRows",
";",
"int",
"row",
"=",
"N",
"-",
"1",
";",
"int",
"col",
"=",
"N",
"-",
"1",
";",
"int",
"direction",
"=",
"-",
"1",
";",
"while",
"(",
"col",
">",
"0",
")",
... | Snakes through and specifies the location of each bit for all the code words in the grid. | [
"Snakes",
"through",
"and",
"specifies",
"the",
"location",
"of",
"each",
"bit",
"for",
"all",
"the",
"code",
"words",
"in",
"the",
"grid",
"."
] | train | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-recognition/src/main/java/boofcv/alg/fiducial/qrcode/QrCodeCodeWordLocations.java#L107-L132 |
Azure/azure-sdk-for-java | batch/data-plane/src/main/java/com/microsoft/azure/batch/protocol/implementation/ComputeNodesImpl.java | ComputeNodesImpl.deleteUserAsync | public Observable<Void> deleteUserAsync(String poolId, String nodeId, String userName) {
"""
Deletes a user account from the specified compute node.
You can delete a user account to a node only when it is in the idle or running state.
@param poolId The ID of the pool that contains the compute node.
@param nod... | java | public Observable<Void> deleteUserAsync(String poolId, String nodeId, String userName) {
return deleteUserWithServiceResponseAsync(poolId, nodeId, userName).map(new Func1<ServiceResponseWithHeaders<Void, ComputeNodeDeleteUserHeaders>, Void>() {
@Override
public Void call(ServiceResponseW... | [
"public",
"Observable",
"<",
"Void",
">",
"deleteUserAsync",
"(",
"String",
"poolId",
",",
"String",
"nodeId",
",",
"String",
"userName",
")",
"{",
"return",
"deleteUserWithServiceResponseAsync",
"(",
"poolId",
",",
"nodeId",
",",
"userName",
")",
".",
"map",
... | Deletes a user account from the specified compute node.
You can delete a user account to a node only when it is in the idle or running state.
@param poolId The ID of the pool that contains the compute node.
@param nodeId The ID of the machine on which you want to delete a user account.
@param userName The name of the ... | [
"Deletes",
"a",
"user",
"account",
"from",
"the",
"specified",
"compute",
"node",
".",
"You",
"can",
"delete",
"a",
"user",
"account",
"to",
"a",
"node",
"only",
"when",
"it",
"is",
"in",
"the",
"idle",
"or",
"running",
"state",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/batch/data-plane/src/main/java/com/microsoft/azure/batch/protocol/implementation/ComputeNodesImpl.java#L430-L437 |
alkacon/opencms-core | src/org/opencms/file/CmsObject.java | CmsObject.setDateReleased | public void setDateReleased(String resourcename, long dateReleased, boolean recursive) throws CmsException {
"""
Changes the "release" date of a resource.<p>
@param resourcename the name of the resource to change (full current site relative path)
@param dateReleased the new release date of the changed resource... | java | public void setDateReleased(String resourcename, long dateReleased, boolean recursive) throws CmsException {
CmsResource resource = readResource(resourcename, CmsResourceFilter.IGNORE_EXPIRATION);
setDateReleased(resource, dateReleased, recursive);
} | [
"public",
"void",
"setDateReleased",
"(",
"String",
"resourcename",
",",
"long",
"dateReleased",
",",
"boolean",
"recursive",
")",
"throws",
"CmsException",
"{",
"CmsResource",
"resource",
"=",
"readResource",
"(",
"resourcename",
",",
"CmsResourceFilter",
".",
"IGN... | Changes the "release" date of a resource.<p>
@param resourcename the name of the resource to change (full current site relative path)
@param dateReleased the new release date of the changed resource
@param recursive if this operation is to be applied recursively to all resources in a folder
@throws CmsException if so... | [
"Changes",
"the",
"release",
"date",
"of",
"a",
"resource",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/file/CmsObject.java#L3811-L3815 |
rjeschke/txtmark | src/main/java/com/github/rjeschke/txtmark/Utils.java | Utils.appendCode | public final static void appendCode(final StringBuilder out, final String in, final int start, final int end) {
"""
Appends the given string encoding special HTML characters.
@param out
The StringBuilder to write to.
@param in
Input String.
@param start
Input String starting position.
@param end
Input St... | java | public final static void appendCode(final StringBuilder out, final String in, final int start, final int end)
{
for (int i = start; i < end; i++)
{
final char c;
switch (c = in.charAt(i))
{
case '&':
out.append("&");
... | [
"public",
"final",
"static",
"void",
"appendCode",
"(",
"final",
"StringBuilder",
"out",
",",
"final",
"String",
"in",
",",
"final",
"int",
"start",
",",
"final",
"int",
"end",
")",
"{",
"for",
"(",
"int",
"i",
"=",
"start",
";",
"i",
"<",
"end",
";"... | Appends the given string encoding special HTML characters.
@param out
The StringBuilder to write to.
@param in
Input String.
@param start
Input String starting position.
@param end
Input String end position. | [
"Appends",
"the",
"given",
"string",
"encoding",
"special",
"HTML",
"characters",
"."
] | train | https://github.com/rjeschke/txtmark/blob/108cee6b209a362843729c032c2d982625d12d98/src/main/java/com/github/rjeschke/txtmark/Utils.java#L449-L470 |
groovy/groovy-core | src/main/org/codehaus/groovy/runtime/DefaultGroovyMethods.java | DefaultGroovyMethods.findIndexValues | public static List<Number> findIndexValues(Object self, Closure closure) {
"""
Iterates over the elements of an iterable collection of items and returns
the index values of the items that match the condition specified in the closure.
@param self the iteration object over which to iterate
@param closure the... | java | public static List<Number> findIndexValues(Object self, Closure closure) {
return findIndexValues(self, 0, closure);
} | [
"public",
"static",
"List",
"<",
"Number",
">",
"findIndexValues",
"(",
"Object",
"self",
",",
"Closure",
"closure",
")",
"{",
"return",
"findIndexValues",
"(",
"self",
",",
"0",
",",
"closure",
")",
";",
"}"
] | Iterates over the elements of an iterable collection of items and returns
the index values of the items that match the condition specified in the closure.
@param self the iteration object over which to iterate
@param closure the filter to perform a match on the collection
@return a list of numbers corresponding to ... | [
"Iterates",
"over",
"the",
"elements",
"of",
"an",
"iterable",
"collection",
"of",
"items",
"and",
"returns",
"the",
"index",
"values",
"of",
"the",
"items",
"that",
"match",
"the",
"condition",
"specified",
"in",
"the",
"closure",
"."
] | train | https://github.com/groovy/groovy-core/blob/01309f9d4be34ddf93c4a9943b5a97843bff6181/src/main/org/codehaus/groovy/runtime/DefaultGroovyMethods.java#L15439-L15441 |
igniterealtime/Smack | smack-omemo/src/main/java/org/jivesoftware/smackx/omemo/OmemoService.java | OmemoService.isStale | static boolean isStale(OmemoDevice userDevice, OmemoDevice subject, Date lastReceipt, int maxAgeHours) {
"""
Determine, whether another one of *our* devices is stale or not.
@param userDevice our omemoDevice
@param subject another one of our devices
@param lastReceipt date of last received message from that d... | java | static boolean isStale(OmemoDevice userDevice, OmemoDevice subject, Date lastReceipt, int maxAgeHours) {
if (userDevice.equals(subject)) {
return false;
}
if (lastReceipt == null) {
return false;
}
long maxAgeMillis = MILLIS_PER_HOUR * maxAgeHours;
... | [
"static",
"boolean",
"isStale",
"(",
"OmemoDevice",
"userDevice",
",",
"OmemoDevice",
"subject",
",",
"Date",
"lastReceipt",
",",
"int",
"maxAgeHours",
")",
"{",
"if",
"(",
"userDevice",
".",
"equals",
"(",
"subject",
")",
")",
"{",
"return",
"false",
";",
... | Determine, whether another one of *our* devices is stale or not.
@param userDevice our omemoDevice
@param subject another one of our devices
@param lastReceipt date of last received message from that device
@param maxAgeHours threshold
@return staleness | [
"Determine",
"whether",
"another",
"one",
"of",
"*",
"our",
"*",
"devices",
"is",
"stale",
"or",
"not",
"."
] | train | https://github.com/igniterealtime/Smack/blob/870756997faec1e1bfabfac0cd6c2395b04da873/smack-omemo/src/main/java/org/jivesoftware/smackx/omemo/OmemoService.java#L993-L1006 |
Azure/azure-sdk-for-java | batch/data-plane/src/main/java/com/microsoft/azure/batch/PoolOperations.java | PoolOperations.disableAutoScale | public void disableAutoScale(String poolId, Iterable<BatchClientBehavior> additionalBehaviors)
throws BatchErrorException, IOException {
"""
Disables automatic scaling on the specified pool.
@param poolId
The ID of the pool.
@param additionalBehaviors
A collection of {@link BatchClientBehavior} i... | java | public void disableAutoScale(String poolId, Iterable<BatchClientBehavior> additionalBehaviors)
throws BatchErrorException, IOException {
PoolDisableAutoScaleOptions options = new PoolDisableAutoScaleOptions();
BehaviorManager bhMgr = new BehaviorManager(this.customBehaviors(), additionalBeha... | [
"public",
"void",
"disableAutoScale",
"(",
"String",
"poolId",
",",
"Iterable",
"<",
"BatchClientBehavior",
">",
"additionalBehaviors",
")",
"throws",
"BatchErrorException",
",",
"IOException",
"{",
"PoolDisableAutoScaleOptions",
"options",
"=",
"new",
"PoolDisableAutoSca... | Disables automatic scaling on the specified pool.
@param poolId
The ID of the pool.
@param additionalBehaviors
A collection of {@link BatchClientBehavior} instances that are
applied to the Batch service request.
@throws BatchErrorException
Exception thrown when an error response is received from the
Batch service.
@th... | [
"Disables",
"automatic",
"scaling",
"on",
"the",
"specified",
"pool",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/batch/data-plane/src/main/java/com/microsoft/azure/batch/PoolOperations.java#L781-L788 |
facebookarchive/hadoop-20 | src/core/org/apache/hadoop/http/HtmlQuoting.java | HtmlQuoting.needsQuoting | public static boolean needsQuoting(String str) {
"""
Does the given string need to be quoted?
@param str the string to check
@return does the string contain any of the active html characters?
"""
if (str == null) {
return false;
}
byte[] bytes = str.getBytes();
return needsQuoting(bytes... | java | public static boolean needsQuoting(String str) {
if (str == null) {
return false;
}
byte[] bytes = str.getBytes();
return needsQuoting(bytes, 0 , bytes.length);
} | [
"public",
"static",
"boolean",
"needsQuoting",
"(",
"String",
"str",
")",
"{",
"if",
"(",
"str",
"==",
"null",
")",
"{",
"return",
"false",
";",
"}",
"byte",
"[",
"]",
"bytes",
"=",
"str",
".",
"getBytes",
"(",
")",
";",
"return",
"needsQuoting",
"("... | Does the given string need to be quoted?
@param str the string to check
@return does the string contain any of the active html characters? | [
"Does",
"the",
"given",
"string",
"need",
"to",
"be",
"quoted?"
] | train | https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/core/org/apache/hadoop/http/HtmlQuoting.java#L62-L68 |
sniffy/sniffy | sniffy-web/src/main/java/io/sniffy/servlet/SniffyRequestProcessor.java | SniffyRequestProcessor.generateFooterHtml | protected StringBuilder generateFooterHtml(int executedQueries, long serverTime) {
"""
Generates following HTML snippet
<pre>
{@code
<data id="sniffy" data-sql-queries="5"/>
}
</pre>
@param executedQueries number of executed queries
@return StringBuilder with generated HTML
"""
return new String... | java | protected StringBuilder generateFooterHtml(int executedQueries, long serverTime) {
return new StringBuilder().
append("<data id=\"sniffy\" data-sql-queries=\"").
append(executedQueries).
append("\" data-server-time=\"").
append(serverTime)
... | [
"protected",
"StringBuilder",
"generateFooterHtml",
"(",
"int",
"executedQueries",
",",
"long",
"serverTime",
")",
"{",
"return",
"new",
"StringBuilder",
"(",
")",
".",
"append",
"(",
"\"<data id=\\\"sniffy\\\" data-sql-queries=\\\"\"",
")",
".",
"append",
"(",
"execu... | Generates following HTML snippet
<pre>
{@code
<data id="sniffy" data-sql-queries="5"/>
}
</pre>
@param executedQueries number of executed queries
@return StringBuilder with generated HTML | [
"Generates",
"following",
"HTML",
"snippet",
"<pre",
">",
"{"
] | train | https://github.com/sniffy/sniffy/blob/7bdddb9593e6b6e9fe5c7c87519f864acbc3a5c0/sniffy-web/src/main/java/io/sniffy/servlet/SniffyRequestProcessor.java#L392-L399 |
ggrandes/packer | src/main/java/org/javastack/packer/Packer.java | Packer.crc8 | static final int crc8(final byte[] input, final int offset, final int len) {
"""
Calculate CRC-8 of input
<p>
<a href="http://en.wikipedia.org/wiki/Cyclic_redundancy_check">CRC-8</a>
@param input
@param offset
@param len
@return
"""
final int poly = 0x0D5;
int crc = 0;
for (int i = 0; i < len; i+... | java | static final int crc8(final byte[] input, final int offset, final int len) {
final int poly = 0x0D5;
int crc = 0;
for (int i = 0; i < len; i++) {
final byte c = input[offset + i];
crc ^= c;
for (int j = 0; j < 8; j++) {
if ((crc & 0x80) != 0) {
crc = ((crc << 1) ^ poly);
} else {
crc <<... | [
"static",
"final",
"int",
"crc8",
"(",
"final",
"byte",
"[",
"]",
"input",
",",
"final",
"int",
"offset",
",",
"final",
"int",
"len",
")",
"{",
"final",
"int",
"poly",
"=",
"0x0D5",
";",
"int",
"crc",
"=",
"0",
";",
"for",
"(",
"int",
"i",
"=",
... | Calculate CRC-8 of input
<p>
<a href="http://en.wikipedia.org/wiki/Cyclic_redundancy_check">CRC-8</a>
@param input
@param offset
@param len
@return | [
"Calculate",
"CRC",
"-",
"8",
"of",
"input",
"<p",
">",
"<a",
"href",
"=",
"http",
":",
"//",
"en",
".",
"wikipedia",
".",
"org",
"/",
"wiki",
"/",
"Cyclic_redundancy_check",
">",
"CRC",
"-",
"8<",
"/",
"a",
">"
] | train | https://github.com/ggrandes/packer/blob/0b37b286a3d0555050eb2e65419dd74f8d8d3e78/src/main/java/org/javastack/packer/Packer.java#L1415-L1431 |
CenturyLinkCloud/mdw | mdw-services/src/com/centurylink/mdw/services/task/factory/TaskInstanceStrategyFactory.java | TaskInstanceStrategyFactory.getAutoAssignStrategy | public static AutoAssignStrategy getAutoAssignStrategy(String logicalName, Long processInstanceId) throws StrategyException {
"""
Returns an auto-assign strategy instance based on the logical name and bundle spec.
@param logicalName
@return the strategy implementor instance
"""
Package packageVO = pr... | java | public static AutoAssignStrategy getAutoAssignStrategy(String logicalName, Long processInstanceId) throws StrategyException {
Package packageVO = processInstanceId == null ? null : getPackage(processInstanceId);
TaskInstanceStrategyFactory factory = getInstance();
String className = factory.getS... | [
"public",
"static",
"AutoAssignStrategy",
"getAutoAssignStrategy",
"(",
"String",
"logicalName",
",",
"Long",
"processInstanceId",
")",
"throws",
"StrategyException",
"{",
"Package",
"packageVO",
"=",
"processInstanceId",
"==",
"null",
"?",
"null",
":",
"getPackage",
... | Returns an auto-assign strategy instance based on the logical name and bundle spec.
@param logicalName
@return the strategy implementor instance | [
"Returns",
"an",
"auto",
"-",
"assign",
"strategy",
"instance",
"based",
"on",
"the",
"logical",
"name",
"and",
"bundle",
"spec",
"."
] | train | https://github.com/CenturyLinkCloud/mdw/blob/91167fe65a25a5d7022cdcf8b0fae8506f5b87ce/mdw-services/src/com/centurylink/mdw/services/task/factory/TaskInstanceStrategyFactory.java#L149-L154 |
jmeetsma/Iglu-Http | src/main/java/org/ijsberg/iglu/util/http/ServletSupport.java | ServletSupport.setCookieValue | public static void setCookieValue(HttpServletResponse response, String key, String value) {
"""
Stores session id in the root of a cookie
The cookie will expire as soon as the browser closes
@param response
@param key
@param value
"""
setCookieValue(response, key, value, "/", -1);
} | java | public static void setCookieValue(HttpServletResponse response, String key, String value)
{
setCookieValue(response, key, value, "/", -1);
} | [
"public",
"static",
"void",
"setCookieValue",
"(",
"HttpServletResponse",
"response",
",",
"String",
"key",
",",
"String",
"value",
")",
"{",
"setCookieValue",
"(",
"response",
",",
"key",
",",
"value",
",",
"\"/\"",
",",
"-",
"1",
")",
";",
"}"
] | Stores session id in the root of a cookie
The cookie will expire as soon as the browser closes
@param response
@param key
@param value | [
"Stores",
"session",
"id",
"in",
"the",
"root",
"of",
"a",
"cookie",
"The",
"cookie",
"will",
"expire",
"as",
"soon",
"as",
"the",
"browser",
"closes"
] | train | https://github.com/jmeetsma/Iglu-Http/blob/5b5ed3b417285dc79b7aa013bf2340bb5ba1ffbe/src/main/java/org/ijsberg/iglu/util/http/ServletSupport.java#L622-L625 |
jfinal/jfinal | src/main/java/com/jfinal/plugin/activerecord/sql/SqlKit.java | SqlKit.getSqlPara | public SqlPara getSqlPara(String key, Map data) {
"""
示例:
1:sql 定义
#sql("key")
select * from xxx where id = #para(id) and age > #para(age)
#end
2:java 代码
Kv cond = Kv.by("id", 123).set("age", 18);
getSqlPara("key", cond);
"""
Template template = getSqlTemplate(key);
if (template == null) {
r... | java | public SqlPara getSqlPara(String key, Map data) {
Template template = getSqlTemplate(key);
if (template == null) {
return null;
}
SqlPara sqlPara = new SqlPara();
data.put(SQL_PARA_KEY, sqlPara);
sqlPara.setSql(template.renderToString(data));
data.remove(SQL_PARA_KEY); // 避免污染传入的 Map
ret... | [
"public",
"SqlPara",
"getSqlPara",
"(",
"String",
"key",
",",
"Map",
"data",
")",
"{",
"Template",
"template",
"=",
"getSqlTemplate",
"(",
"key",
")",
";",
"if",
"(",
"template",
"==",
"null",
")",
"{",
"return",
"null",
";",
"}",
"SqlPara",
"sqlPara",
... | 示例:
1:sql 定义
#sql("key")
select * from xxx where id = #para(id) and age > #para(age)
#end
2:java 代码
Kv cond = Kv.by("id", 123).set("age", 18);
getSqlPara("key", cond); | [
"示例:",
"1:sql",
"定义",
"#sql",
"(",
"key",
")",
"select",
"*",
"from",
"xxx",
"where",
"id",
"=",
"#para",
"(",
"id",
")",
"and",
"age",
">",
"#para",
"(",
"age",
")",
"#end"
] | train | https://github.com/jfinal/jfinal/blob/fc07f0f5d56e85ccd3cfcdd587b56b8dd9c663e9/src/main/java/com/jfinal/plugin/activerecord/sql/SqlKit.java#L160-L171 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.