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 |
|---|---|---|---|---|---|---|---|---|---|---|
aws/aws-sdk-java | aws-java-sdk-sqs/src/main/java/com/amazonaws/services/sqs/buffered/AmazonSQSBufferedAsyncClient.java | AmazonSQSBufferedAsyncClient.getQBuffer | private synchronized QueueBuffer getQBuffer(String qUrl) {
"""
Returns (creating it if necessary) a queue buffer for a particular queue Since we are only
storing a limited number of queue buffers, it is possible that as a result of calling this
method the least recently used queue buffer will be removed from our... | java | private synchronized QueueBuffer getQBuffer(String qUrl) {
QueueBuffer toReturn = buffers.get(qUrl);
if (null == toReturn) {
QueueBufferConfig config = new QueueBufferConfig(bufferConfigExemplar);
toReturn = new QueueBuffer(config, qUrl, realSQS);
buffers.put(qUrl, to... | [
"private",
"synchronized",
"QueueBuffer",
"getQBuffer",
"(",
"String",
"qUrl",
")",
"{",
"QueueBuffer",
"toReturn",
"=",
"buffers",
".",
"get",
"(",
"qUrl",
")",
";",
"if",
"(",
"null",
"==",
"toReturn",
")",
"{",
"QueueBufferConfig",
"config",
"=",
"new",
... | Returns (creating it if necessary) a queue buffer for a particular queue Since we are only
storing a limited number of queue buffers, it is possible that as a result of calling this
method the least recently used queue buffer will be removed from our queue buffer cache
@return a queue buffer associated with the provid... | [
"Returns",
"(",
"creating",
"it",
"if",
"necessary",
")",
"a",
"queue",
"buffer",
"for",
"a",
"particular",
"queue",
"Since",
"we",
"are",
"only",
"storing",
"a",
"limited",
"number",
"of",
"queue",
"buffers",
"it",
"is",
"possible",
"that",
"as",
"a",
"... | train | https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-sqs/src/main/java/com/amazonaws/services/sqs/buffered/AmazonSQSBufferedAsyncClient.java#L378-L386 |
wildfly/wildfly-core | controller/src/main/java/org/jboss/as/controller/ServiceRemoveStepHandler.java | ServiceRemoveStepHandler.recoverServices | @Override
protected void recoverServices(OperationContext context, ModelNode operation, ModelNode model) throws OperationFailedException {
"""
If the {@link OperationContext#isResourceServiceRestartAllowed() context allows resource removal},
attempts to restore services by invoking the {@code performRuntime} ... | java | @Override
protected void recoverServices(OperationContext context, ModelNode operation, ModelNode model) throws OperationFailedException {
if (context.isResourceServiceRestartAllowed()) {
addOperation.performRuntime(context, operation, model);
} else {
context.revertReloadReq... | [
"@",
"Override",
"protected",
"void",
"recoverServices",
"(",
"OperationContext",
"context",
",",
"ModelNode",
"operation",
",",
"ModelNode",
"model",
")",
"throws",
"OperationFailedException",
"{",
"if",
"(",
"context",
".",
"isResourceServiceRestartAllowed",
"(",
")... | If the {@link OperationContext#isResourceServiceRestartAllowed() context allows resource removal},
attempts to restore services by invoking the {@code performRuntime} method on the @{code addOperation}
handler passed to the constructor; otherwise puts the process in reload-required state.
{@inheritDoc} | [
"If",
"the",
"{",
"@link",
"OperationContext#isResourceServiceRestartAllowed",
"()",
"context",
"allows",
"resource",
"removal",
"}",
"attempts",
"to",
"restore",
"services",
"by",
"invoking",
"the",
"{",
"@code",
"performRuntime",
"}",
"method",
"on",
"the",
"@",
... | train | https://github.com/wildfly/wildfly-core/blob/cfaf0479dcbb2d320a44c5374b93b944ec39fade/controller/src/main/java/org/jboss/as/controller/ServiceRemoveStepHandler.java#L163-L170 |
jenkinsci/artifactory-plugin | src/main/java/org/jfrog/hudson/release/scm/svn/SubversionManager.java | SubversionManager.createTag | public void createTag(final String tagUrl, final String commitMessage)
throws IOException, InterruptedException {
"""
Creates a tag directly from the working copy.
@param tagUrl The URL of the tag to create.
@param commitMessage Commit message
@return The commit info upon successful operati... | java | public void createTag(final String tagUrl, final String commitMessage)
throws IOException, InterruptedException {
build.getWorkspace()
.act(new SVNCreateTagCallable(tagUrl, commitMessage, getLocation(), getSvnAuthenticationProvider(build),
buildListener));
... | [
"public",
"void",
"createTag",
"(",
"final",
"String",
"tagUrl",
",",
"final",
"String",
"commitMessage",
")",
"throws",
"IOException",
",",
"InterruptedException",
"{",
"build",
".",
"getWorkspace",
"(",
")",
".",
"act",
"(",
"new",
"SVNCreateTagCallable",
"(",... | Creates a tag directly from the working copy.
@param tagUrl The URL of the tag to create.
@param commitMessage Commit message
@return The commit info upon successful operation.
@throws IOException On IO of SVN failure | [
"Creates",
"a",
"tag",
"directly",
"from",
"the",
"working",
"copy",
"."
] | train | https://github.com/jenkinsci/artifactory-plugin/blob/f5fcfff6a5a50be5374813e49d1fe3aaf6422333/src/main/java/org/jfrog/hudson/release/scm/svn/SubversionManager.java#L71-L76 |
ironjacamar/ironjacamar | web/src/main/java/org/ironjacamar/web/SecurityActions.java | SecurityActions.createWARClassLoader | static WARClassLoader createWARClassLoader(final Kernel kernel, final ClassLoader parent) {
"""
Create a WARClassLoader
@param kernel The kernel
@param parent The parent class loader
@return The class loader
"""
return AccessController.doPrivileged(new PrivilegedAction<WARClassLoader>()
{
... | java | static WARClassLoader createWARClassLoader(final Kernel kernel, final ClassLoader parent)
{
return AccessController.doPrivileged(new PrivilegedAction<WARClassLoader>()
{
public WARClassLoader run()
{
return new WARClassLoader(kernel, parent);
}
});
} | [
"static",
"WARClassLoader",
"createWARClassLoader",
"(",
"final",
"Kernel",
"kernel",
",",
"final",
"ClassLoader",
"parent",
")",
"{",
"return",
"AccessController",
".",
"doPrivileged",
"(",
"new",
"PrivilegedAction",
"<",
"WARClassLoader",
">",
"(",
")",
"{",
"pu... | Create a WARClassLoader
@param kernel The kernel
@param parent The parent class loader
@return The class loader | [
"Create",
"a",
"WARClassLoader"
] | train | https://github.com/ironjacamar/ironjacamar/blob/f0389ee7e62aa8b40ba09b251edad76d220ea796/web/src/main/java/org/ironjacamar/web/SecurityActions.java#L135-L144 |
box/box-java-sdk | src/main/java/com/box/sdk/BoxDeveloperEditionAPIConnection.java | BoxDeveloperEditionAPIConnection.getAppUserConnection | public static BoxDeveloperEditionAPIConnection getAppUserConnection(String userId, BoxConfig boxConfig) {
"""
Creates a new Box Developer Edition connection with App User token levaraging BoxConfig.
@param userId the user ID to use for an App User.
@param boxConfig box configuration se... | java | public static BoxDeveloperEditionAPIConnection getAppUserConnection(String userId, BoxConfig boxConfig) {
return getAppUserConnection(userId, boxConfig.getClientId(), boxConfig.getClientSecret(),
boxConfig.getJWTEncryptionPreferences());
} | [
"public",
"static",
"BoxDeveloperEditionAPIConnection",
"getAppUserConnection",
"(",
"String",
"userId",
",",
"BoxConfig",
"boxConfig",
")",
"{",
"return",
"getAppUserConnection",
"(",
"userId",
",",
"boxConfig",
".",
"getClientId",
"(",
")",
",",
"boxConfig",
".",
... | Creates a new Box Developer Edition connection with App User token levaraging BoxConfig.
@param userId the user ID to use for an App User.
@param boxConfig box configuration settings object
@return a new instance of BoxAPIConnection. | [
"Creates",
"a",
"new",
"Box",
"Developer",
"Edition",
"connection",
"with",
"App",
"User",
"token",
"levaraging",
"BoxConfig",
"."
] | train | https://github.com/box/box-java-sdk/blob/35b4ba69417f9d6a002c19dfaab57527750ef349/src/main/java/com/box/sdk/BoxDeveloperEditionAPIConnection.java#L282-L285 |
lightblueseas/net-extensions | src/main/java/de/alpharogroup/net/IPResolver.java | IPResolver.getLocalIPFromServerSocket | public static InetAddress getLocalIPFromServerSocket(final int port, final int backlog)
throws UnknownHostException, IOException {
"""
Gets the InetAddress object from the local host from a ServerSocket object.
@param port
the local TCP port
@param backlog
the listen backlog
@return Returns the InetAddre... | java | public static InetAddress getLocalIPFromServerSocket(final int port, final int backlog)
throws UnknownHostException, IOException
{
InetAddress inetAddress = null;
ServerSocket socket = null;
try
{
socket = new ServerSocket(port, backlog, InetAddress.getLocalHost());
inetAddress = socket.getInet... | [
"public",
"static",
"InetAddress",
"getLocalIPFromServerSocket",
"(",
"final",
"int",
"port",
",",
"final",
"int",
"backlog",
")",
"throws",
"UnknownHostException",
",",
"IOException",
"{",
"InetAddress",
"inetAddress",
"=",
"null",
";",
"ServerSocket",
"socket",
"=... | Gets the InetAddress object from the local host from a ServerSocket object.
@param port
the local TCP port
@param backlog
the listen backlog
@return Returns the InetAddress object from the local host from a ServerSocket object.
@throws IOException
Signals that an I/O exception has occurred.
@throws UnknownHostExceptio... | [
"Gets",
"the",
"InetAddress",
"object",
"from",
"the",
"local",
"host",
"from",
"a",
"ServerSocket",
"object",
"."
] | train | https://github.com/lightblueseas/net-extensions/blob/771757a93fa9ad13ce0fe061c158e5cba43344cb/src/main/java/de/alpharogroup/net/IPResolver.java#L118-L134 |
Appendium/objectlabkit | utils-excel/src/main/java/net/objectlab/kit/util/excel/ExcelCell.java | ExcelCell.newCell | public ExcelCell newCell(String url, String label) {
"""
Add a hyperlink
@param url URL
@param label Label for the cell
@return the cell
"""
return row.newCell().link(url, label);
} | java | public ExcelCell newCell(String url, String label) {
return row.newCell().link(url, label);
} | [
"public",
"ExcelCell",
"newCell",
"(",
"String",
"url",
",",
"String",
"label",
")",
"{",
"return",
"row",
".",
"newCell",
"(",
")",
".",
"link",
"(",
"url",
",",
"label",
")",
";",
"}"
] | Add a hyperlink
@param url URL
@param label Label for the cell
@return the cell | [
"Add",
"a",
"hyperlink"
] | train | https://github.com/Appendium/objectlabkit/blob/cd649bce7a32e4e926520e62cb765f3b1d451594/utils-excel/src/main/java/net/objectlab/kit/util/excel/ExcelCell.java#L71-L73 |
operasoftware/operaprestodriver | src/com/opera/core/systems/scope/stp/services/ScopeEcmascriptDebugger.java | ScopeEcmascriptDebugger.parseEvalReply | protected Object parseEvalReply(EvalResult result) {
"""
Parses a reply and returns the following types String presentation of number, boolean or
string.
"""
String status = result.getStatus();
if (!status.equals("completed")) {
if (status.equals("unhandled-exception")) {
// Would be gr... | java | protected Object parseEvalReply(EvalResult result) {
String status = result.getStatus();
if (!status.equals("completed")) {
if (status.equals("unhandled-exception")) {
// Would be great give the JS error here, but it appears that by the
// time we callFunctionOnObject the error object has... | [
"protected",
"Object",
"parseEvalReply",
"(",
"EvalResult",
"result",
")",
"{",
"String",
"status",
"=",
"result",
".",
"getStatus",
"(",
")",
";",
"if",
"(",
"!",
"status",
".",
"equals",
"(",
"\"completed\"",
")",
")",
"{",
"if",
"(",
"status",
".",
... | Parses a reply and returns the following types String presentation of number, boolean or
string. | [
"Parses",
"a",
"reply",
"and",
"returns",
"the",
"following",
"types",
"String",
"presentation",
"of",
"number",
"boolean",
"or",
"string",
"."
] | train | https://github.com/operasoftware/operaprestodriver/blob/1ccceda80f1c1a0489171d17dcaa6e7b18fb4c01/src/com/opera/core/systems/scope/stp/services/ScopeEcmascriptDebugger.java#L330-L350 |
goshippo/shippo-java-client | src/main/java/com/shippo/model/Batch.java | Batch.addShipments | public static Batch addShipments(String id, String[] shipmentIds)
throws AuthenticationException, InvalidRequestException, APIConnectionException, APIException {
"""
Add shipments to an existing batch provided by id. This takes shipment
IDs which means shipments should have been already been created using
{@l... | java | public static Batch addShipments(String id, String[] shipmentIds)
throws AuthenticationException, InvalidRequestException, APIConnectionException, APIException {
BatchShipmentId[] array = new BatchShipmentId[shipmentIds.length];
for (int i = 0; i < array.length; i++) {
array[i] = new BatchShipmentId(shipmentI... | [
"public",
"static",
"Batch",
"addShipments",
"(",
"String",
"id",
",",
"String",
"[",
"]",
"shipmentIds",
")",
"throws",
"AuthenticationException",
",",
"InvalidRequestException",
",",
"APIConnectionException",
",",
"APIException",
"{",
"BatchShipmentId",
"[",
"]",
... | Add shipments to an existing batch provided by id. This takes shipment
IDs which means shipments should have been already been created using
{@link Shipment#create}. This method corresponds to
https://api.goshippo.com/batches/<i>BATCH OBJECT ID</i>/add_shipments endpoint
defined in https://goshippo.com/docs/reference#b... | [
"Add",
"shipments",
"to",
"an",
"existing",
"batch",
"provided",
"by",
"id",
".",
"This",
"takes",
"shipment",
"IDs",
"which",
"means",
"shipments",
"should",
"have",
"been",
"already",
"been",
"created",
"using",
"{",
"@link",
"Shipment#create",
"}",
".",
"... | train | https://github.com/goshippo/shippo-java-client/blob/eecf801c7e07a627c3677a331c0cfcf36cb1678b/src/main/java/com/shippo/model/Batch.java#L272-L281 |
salesforce/Argus | ArgusCore/src/main/java/com/salesforce/dva/argus/entity/SubsystemSuspensionLevels.java | SubsystemSuspensionLevels.findBySubsystem | public static SubsystemSuspensionLevels findBySubsystem(EntityManager em, SubSystem subSystem) {
"""
Retrieves the SubsystemSuspensionLevels object for the given subsystem.
@param em The EntityManager to use.
@param subSystem The subsystem for which to retrieve suspension level.
@return The Su... | java | public static SubsystemSuspensionLevels findBySubsystem(EntityManager em, SubSystem subSystem) {
SystemAssert.requireArgument(em != null, "Entity manager can not be null.");
SystemAssert.requireArgument(subSystem != null, "Subsystem cannot be null.");
TypedQuery<SubsystemSuspensionLevels> query... | [
"public",
"static",
"SubsystemSuspensionLevels",
"findBySubsystem",
"(",
"EntityManager",
"em",
",",
"SubSystem",
"subSystem",
")",
"{",
"SystemAssert",
".",
"requireArgument",
"(",
"em",
"!=",
"null",
",",
"\"Entity manager can not be null.\"",
")",
";",
"SystemAssert"... | Retrieves the SubsystemSuspensionLevels object for the given subsystem.
@param em The EntityManager to use.
@param subSystem The subsystem for which to retrieve suspension level.
@return The SubsystemSuspensionLevels object for the given subsystem. Throws a runtime exception if no such record exists. Th... | [
"Retrieves",
"the",
"SubsystemSuspensionLevels",
"object",
"for",
"the",
"given",
"subsystem",
"."
] | train | https://github.com/salesforce/Argus/blob/121b59a268da264316cded6a3e9271366a23cd86/ArgusCore/src/main/java/com/salesforce/dva/argus/entity/SubsystemSuspensionLevels.java#L123-L146 |
molgenis/molgenis | molgenis-data-postgresql/src/main/java/org/molgenis/data/postgresql/PostgreSqlRepositoryCollection.java | PostgreSqlRepositoryCollection.updateEnumOptions | private void updateEnumOptions(EntityType entityType, Attribute attr, Attribute updatedAttr) {
"""
Updates check constraint based on enum value changes.
@param entityType entity meta data
@param attr current attribute
@param updatedAttr updated attribute
"""
if (attr.getDataType() == ENUM) {
if ... | java | private void updateEnumOptions(EntityType entityType, Attribute attr, Attribute updatedAttr) {
if (attr.getDataType() == ENUM) {
if (updatedAttr.getDataType() == ENUM) {
// update check constraint
dropCheckConstraint(entityType, attr);
createCheckConstraint(entityType, updatedAttr);
... | [
"private",
"void",
"updateEnumOptions",
"(",
"EntityType",
"entityType",
",",
"Attribute",
"attr",
",",
"Attribute",
"updatedAttr",
")",
"{",
"if",
"(",
"attr",
".",
"getDataType",
"(",
")",
"==",
"ENUM",
")",
"{",
"if",
"(",
"updatedAttr",
".",
"getDataType... | Updates check constraint based on enum value changes.
@param entityType entity meta data
@param attr current attribute
@param updatedAttr updated attribute | [
"Updates",
"check",
"constraint",
"based",
"on",
"enum",
"value",
"changes",
"."
] | train | https://github.com/molgenis/molgenis/blob/b4d0d6b27e6f6c8d7505a3863dc03b589601f987/molgenis-data-postgresql/src/main/java/org/molgenis/data/postgresql/PostgreSqlRepositoryCollection.java#L434-L449 |
OpenLiberty/open-liberty | dev/com.ibm.ws.microprofile.openapi/src/com/ibm/ws/microprofile/openapi/impl/core/util/ReflectionUtils.java | ReflectionUtils.getRepeatableAnnotations | public static <A extends Annotation> List<A> getRepeatableAnnotations(Method method, Class<A> annotationClass) {
"""
Returns a List of repeatable annotations by type from a method.
@param method is the method to find
@param annotationClass is the type of annotation
@param <A> is the type of annotation
@retur... | java | public static <A extends Annotation> List<A> getRepeatableAnnotations(Method method, Class<A> annotationClass) {
A[] annotations = method.getAnnotationsByType(annotationClass);
if (annotations == null || annotations.length == 0) {
for (Annotation metaAnnotation : method.getAnnotations()) {
... | [
"public",
"static",
"<",
"A",
"extends",
"Annotation",
">",
"List",
"<",
"A",
">",
"getRepeatableAnnotations",
"(",
"Method",
"method",
",",
"Class",
"<",
"A",
">",
"annotationClass",
")",
"{",
"A",
"[",
"]",
"annotations",
"=",
"method",
".",
"getAnnotati... | Returns a List of repeatable annotations by type from a method.
@param method is the method to find
@param annotationClass is the type of annotation
@param <A> is the type of annotation
@return List of repeatable annotations if it is found | [
"Returns",
"a",
"List",
"of",
"repeatable",
"annotations",
"by",
"type",
"from",
"a",
"method",
"."
] | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.microprofile.openapi/src/com/ibm/ws/microprofile/openapi/impl/core/util/ReflectionUtils.java#L271-L289 |
google/error-prone-javac | src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/Contents.java | Contents.getContent | public Content getContent(String key, Object o0, Object o1) {
"""
Gets a {@code Content} object, containing the string for
a given key in the doclet's resources, formatted with
given arguments.
@param key the key for the desired string
@param o0 string or content argument to be formatted into the result
@p... | java | public Content getContent(String key, Object o0, Object o1) {
return getContent(key, o0, o1, null);
} | [
"public",
"Content",
"getContent",
"(",
"String",
"key",
",",
"Object",
"o0",
",",
"Object",
"o1",
")",
"{",
"return",
"getContent",
"(",
"key",
",",
"o0",
",",
"o1",
",",
"null",
")",
";",
"}"
] | Gets a {@code Content} object, containing the string for
a given key in the doclet's resources, formatted with
given arguments.
@param key the key for the desired string
@param o0 string or content argument to be formatted into the result
@param o1 string or content argument to be formatted into the result
@return a... | [
"Gets",
"a",
"{",
"@code",
"Content",
"}",
"object",
"containing",
"the",
"string",
"for",
"a",
"given",
"key",
"in",
"the",
"doclet",
"s",
"resources",
"formatted",
"with",
"given",
"arguments",
"."
] | train | https://github.com/google/error-prone-javac/blob/a53d069bbdb2c60232ed3811c19b65e41c3e60e0/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/Contents.java#L308-L310 |
gresrun/jesque | src/main/java/net/greghaines/jesque/utils/PoolUtils.java | PoolUtils.createJedisPool | public static Pool<Jedis> createJedisPool(final Config jesqueConfig, final GenericObjectPoolConfig poolConfig) {
"""
A simple helper method that creates a pool of connections to Redis using
the supplied configurations.
@param jesqueConfig the config used to create the pooled Jedis connections
@param poolConfi... | java | public static Pool<Jedis> createJedisPool(final Config jesqueConfig, final GenericObjectPoolConfig poolConfig) {
if (jesqueConfig == null) {
throw new IllegalArgumentException("jesqueConfig must not be null");
}
if (poolConfig == null) {
throw new IllegalArgumentException... | [
"public",
"static",
"Pool",
"<",
"Jedis",
">",
"createJedisPool",
"(",
"final",
"Config",
"jesqueConfig",
",",
"final",
"GenericObjectPoolConfig",
"poolConfig",
")",
"{",
"if",
"(",
"jesqueConfig",
"==",
"null",
")",
"{",
"throw",
"new",
"IllegalArgumentException"... | A simple helper method that creates a pool of connections to Redis using
the supplied configurations.
@param jesqueConfig the config used to create the pooled Jedis connections
@param poolConfig the config used to create the pool
@return a configured Pool of Jedis connections | [
"A",
"simple",
"helper",
"method",
"that",
"creates",
"a",
"pool",
"of",
"connections",
"to",
"Redis",
"using",
"the",
"supplied",
"configurations",
"."
] | train | https://github.com/gresrun/jesque/blob/44749183dccc40962a94c2af547ea7d0d880b5d1/src/main/java/net/greghaines/jesque/utils/PoolUtils.java#L114-L129 |
alkacon/opencms-core | src/org/opencms/importexport/CmsImportVersion7.java | CmsImportVersion7.addProjectRules | protected void addProjectRules(Digester digester, String xpath) {
"""
Adds the XML digester rules for projects.<p>
@param digester the digester to add the rules to
@param xpath the base xpath for the rules
"""
digester.addCallMethod(xpath + N_NAME, "setProjectName", 0);
digester.addCallMet... | java | protected void addProjectRules(Digester digester, String xpath) {
digester.addCallMethod(xpath + N_NAME, "setProjectName", 0);
digester.addCallMethod(xpath + N_DESCRIPTION, "setProjectDescription", 0);
digester.addCallMethod(xpath + N_MANAGERSGROUP, "setProjectManagers", 0);
digester.ad... | [
"protected",
"void",
"addProjectRules",
"(",
"Digester",
"digester",
",",
"String",
"xpath",
")",
"{",
"digester",
".",
"addCallMethod",
"(",
"xpath",
"+",
"N_NAME",
",",
"\"setProjectName\"",
",",
"0",
")",
";",
"digester",
".",
"addCallMethod",
"(",
"xpath",... | Adds the XML digester rules for projects.<p>
@param digester the digester to add the rules to
@param xpath the base xpath for the rules | [
"Adds",
"the",
"XML",
"digester",
"rules",
"for",
"projects",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/importexport/CmsImportVersion7.java#L3036-L3044 |
ManfredTremmel/gwt-commons-lang3 | src/main/resources/org/apache/commons/jre/java/util/BitSet.java | BitSet.setInternal | private static void setInternal(int[] array, int fromIndex, int toIndex) {
"""
Sets all bits to true within the given range.
@param fromIndex The lower bit index.
@param toIndex The upper bit index.
"""
int first = wordIndex(fromIndex);
int last = wordIndex(toIndex);
maybeGrowArrayToIndex(arra... | java | private static void setInternal(int[] array, int fromIndex, int toIndex) {
int first = wordIndex(fromIndex);
int last = wordIndex(toIndex);
maybeGrowArrayToIndex(array, last);
int startBit = bitOffset(fromIndex);
int endBit = bitOffset(toIndex);
if (first == last) {
// Set the bits in b... | [
"private",
"static",
"void",
"setInternal",
"(",
"int",
"[",
"]",
"array",
",",
"int",
"fromIndex",
",",
"int",
"toIndex",
")",
"{",
"int",
"first",
"=",
"wordIndex",
"(",
"fromIndex",
")",
";",
"int",
"last",
"=",
"wordIndex",
"(",
"toIndex",
")",
";"... | Sets all bits to true within the given range.
@param fromIndex The lower bit index.
@param toIndex The upper bit index. | [
"Sets",
"all",
"bits",
"to",
"true",
"within",
"the",
"given",
"range",
"."
] | train | https://github.com/ManfredTremmel/gwt-commons-lang3/blob/9e2dfbbda3668cfa5d935fe76479d1426c294504/src/main/resources/org/apache/commons/jre/java/util/BitSet.java#L99-L123 |
wellner/jcarafe | jcarafe-core/src/main/java/cern/colt/list/DoubleArrayList.java | DoubleArrayList.replaceFromToWithFrom | public void replaceFromToWithFrom(int from, int to, AbstractDoubleList other, int otherFrom) {
"""
Replaces a number of elements in the receiver with the same number of elements of another list.
Replaces elements in the receiver, between <code>from</code> (inclusive) and <code>to</code> (inclusive),
with element... | java | public void replaceFromToWithFrom(int from, int to, AbstractDoubleList other, int otherFrom) {
// overridden for performance only.
if (! (other instanceof DoubleArrayList)) {
// slower
super.replaceFromToWithFrom(from,to,other,otherFrom);
return;
}
int length=to-from+1;
if (length>0) {
checkRangeF... | [
"public",
"void",
"replaceFromToWithFrom",
"(",
"int",
"from",
",",
"int",
"to",
",",
"AbstractDoubleList",
"other",
",",
"int",
"otherFrom",
")",
"{",
"// overridden for performance only.\r",
"if",
"(",
"!",
"(",
"other",
"instanceof",
"DoubleArrayList",
")",
")"... | Replaces a number of elements in the receiver with the same number of elements of another list.
Replaces elements in the receiver, between <code>from</code> (inclusive) and <code>to</code> (inclusive),
with elements of <code>other</code>, starting from <code>otherFrom</code> (inclusive).
@param from the position of th... | [
"Replaces",
"a",
"number",
"of",
"elements",
"in",
"the",
"receiver",
"with",
"the",
"same",
"number",
"of",
"elements",
"of",
"another",
"list",
".",
"Replaces",
"elements",
"in",
"the",
"receiver",
"between",
"<code",
">",
"from<",
"/",
"code",
">",
"(",... | train | https://github.com/wellner/jcarafe/blob/ab8b0a83dbf600fe80c27711815c90bd3055b217/jcarafe-core/src/main/java/cern/colt/list/DoubleArrayList.java#L347-L360 |
jtablesaw/tablesaw | core/src/main/java/tech/tablesaw/joining/DataFrameJoiner.java | DataFrameJoiner.inner | public Table inner(Table table2, String[] col2Names) {
"""
Joins the joiner to the table2, using the given columns for the second table and returns the resulting table
@param table2 The table to join with
@param col2Names The columns to join on. If a name refers to a double column, the join is performed aft... | java | public Table inner(Table table2, String[] col2Names) {
return inner(table2, false, col2Names);
} | [
"public",
"Table",
"inner",
"(",
"Table",
"table2",
",",
"String",
"[",
"]",
"col2Names",
")",
"{",
"return",
"inner",
"(",
"table2",
",",
"false",
",",
"col2Names",
")",
";",
"}"
] | Joins the joiner to the table2, using the given columns for the second table and returns the resulting table
@param table2 The table to join with
@param col2Names The columns to join on. If a name refers to a double column, the join is performed after
rounding to integers.
@return The resulting table | [
"Joins",
"the",
"joiner",
"to",
"the",
"table2",
"using",
"the",
"given",
"columns",
"for",
"the",
"second",
"table",
"and",
"returns",
"the",
"resulting",
"table"
] | train | https://github.com/jtablesaw/tablesaw/blob/68a75b4098ac677e9486df5572cf13ec39f9f701/core/src/main/java/tech/tablesaw/joining/DataFrameJoiner.java#L115-L117 |
ist-dresden/composum | sling/core/commons/src/main/java/com/composum/sling/core/util/JsonUtil.java | JsonUtil.exportJson | public static void exportJson(JsonWriter writer, Resource resource)
throws RepositoryException, IOException {
"""
Writes a resources JSON view to a writer using the default application rules for filtering.
@param writer the writer for the JSON transformation
@param resource the resource to transf... | java | public static void exportJson(JsonWriter writer, Resource resource)
throws RepositoryException, IOException {
exportJson(writer, resource, MappingRules.getDefaultMappingRules());
} | [
"public",
"static",
"void",
"exportJson",
"(",
"JsonWriter",
"writer",
",",
"Resource",
"resource",
")",
"throws",
"RepositoryException",
",",
"IOException",
"{",
"exportJson",
"(",
"writer",
",",
"resource",
",",
"MappingRules",
".",
"getDefaultMappingRules",
"(",
... | Writes a resources JSON view to a writer using the default application rules for filtering.
@param writer the writer for the JSON transformation
@param resource the resource to transform
@throws RepositoryException
@throws IOException | [
"Writes",
"a",
"resources",
"JSON",
"view",
"to",
"a",
"writer",
"using",
"the",
"default",
"application",
"rules",
"for",
"filtering",
"."
] | train | https://github.com/ist-dresden/composum/blob/ebc79f559f6022c935240c19102539bdfb1bd1e2/sling/core/commons/src/main/java/com/composum/sling/core/util/JsonUtil.java#L198-L201 |
Azure/azure-sdk-for-java | policy/resource-manager/v2016_12_01/src/main/java/com/microsoft/azure/management/policy/v2016_12_01/implementation/PolicyDefinitionsInner.java | PolicyDefinitionsInner.createOrUpdateAtManagementGroup | public PolicyDefinitionInner createOrUpdateAtManagementGroup(String policyDefinitionName, String managementGroupId, PolicyDefinitionInner parameters) {
"""
Creates or updates a policy definition at management group level.
@param policyDefinitionName The name of the policy definition to create.
@param managemen... | java | public PolicyDefinitionInner createOrUpdateAtManagementGroup(String policyDefinitionName, String managementGroupId, PolicyDefinitionInner parameters) {
return createOrUpdateAtManagementGroupWithServiceResponseAsync(policyDefinitionName, managementGroupId, parameters).toBlocking().single().body();
} | [
"public",
"PolicyDefinitionInner",
"createOrUpdateAtManagementGroup",
"(",
"String",
"policyDefinitionName",
",",
"String",
"managementGroupId",
",",
"PolicyDefinitionInner",
"parameters",
")",
"{",
"return",
"createOrUpdateAtManagementGroupWithServiceResponseAsync",
"(",
"policyDe... | Creates or updates a policy definition at management group level.
@param policyDefinitionName The name of the policy definition to create.
@param managementGroupId The ID of the management group.
@param parameters The policy definition properties.
@throws IllegalArgumentException thrown if parameters fail the validati... | [
"Creates",
"or",
"updates",
"a",
"policy",
"definition",
"at",
"management",
"group",
"level",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/policy/resource-manager/v2016_12_01/src/main/java/com/microsoft/azure/management/policy/v2016_12_01/implementation/PolicyDefinitionsInner.java#L450-L452 |
puniverse/capsule | capsule-util/src/main/java/co/paralleluniverse/common/ProcessUtil.java | ProcessUtil.getMBeanServerConnection | public static MBeanServerConnection getMBeanServerConnection(Process p, boolean startAgent) {
"""
Connects to a child JVM process
@param p the process to which to connect
@param startAgent whether to installed the JMX agent in the target process if not already in place
@return an {@link MBeanServerCo... | java | public static MBeanServerConnection getMBeanServerConnection(Process p, boolean startAgent) {
try {
final JMXServiceURL serviceURL = getLocalConnectorAddress(p, startAgent);
final JMXConnector connector = JMXConnectorFactory.connect(serviceURL);
final MBeanServerConnection mb... | [
"public",
"static",
"MBeanServerConnection",
"getMBeanServerConnection",
"(",
"Process",
"p",
",",
"boolean",
"startAgent",
")",
"{",
"try",
"{",
"final",
"JMXServiceURL",
"serviceURL",
"=",
"getLocalConnectorAddress",
"(",
"p",
",",
"startAgent",
")",
";",
"final",... | Connects to a child JVM process
@param p the process to which to connect
@param startAgent whether to installed the JMX agent in the target process if not already in place
@return an {@link MBeanServerConnection} to the process's MBean server | [
"Connects",
"to",
"a",
"child",
"JVM",
"process"
] | train | https://github.com/puniverse/capsule/blob/291a54e501a32aaf0284707b8c1fbff6a566822b/capsule-util/src/main/java/co/paralleluniverse/common/ProcessUtil.java#L67-L76 |
lucastheisen/jsch-extension | src/main/java/com/pastdev/jsch/DefaultSessionFactory.java | DefaultSessionFactory.setIdentityFromPrivateKey | public void setIdentityFromPrivateKey( String privateKey, String passPhrase ) throws JSchException {
"""
Configures this factory to use a single identity authenticated by the
supplied private key and pass phrase. The private key should be the path
to a private key file in OpenSSH format. Clears out the current
... | java | public void setIdentityFromPrivateKey( String privateKey, String passPhrase ) throws JSchException {
clearIdentityRepository();
jsch.addIdentity( privateKey, passPhrase );
} | [
"public",
"void",
"setIdentityFromPrivateKey",
"(",
"String",
"privateKey",
",",
"String",
"passPhrase",
")",
"throws",
"JSchException",
"{",
"clearIdentityRepository",
"(",
")",
";",
"jsch",
".",
"addIdentity",
"(",
"privateKey",
",",
"passPhrase",
")",
";",
"}"
... | Configures this factory to use a single identity authenticated by the
supplied private key and pass phrase. The private key should be the path
to a private key file in OpenSSH format. Clears out the current
{@link IdentityRepository} before adding this key.
@param privateKey
Path to a private key file
@param passPhras... | [
"Configures",
"this",
"factory",
"to",
"use",
"a",
"single",
"identity",
"authenticated",
"by",
"the",
"supplied",
"private",
"key",
"and",
"pass",
"phrase",
".",
"The",
"private",
"key",
"should",
"be",
"the",
"path",
"to",
"a",
"private",
"key",
"file",
... | train | https://github.com/lucastheisen/jsch-extension/blob/3c5bfae84d63e8632828a10721f2e605b68d749a/src/main/java/com/pastdev/jsch/DefaultSessionFactory.java#L347-L350 |
netscaler/sdx_nitro | src/main/java/com/citrix/sdx/nitro/resource/config/ns/admin_ns_config.java | admin_ns_config.get_nitro_bulk_response | protected base_resource[] get_nitro_bulk_response(nitro_service service, String response) throws Exception {
"""
<pre>
Converts API response of bulk operation into object and returns the object array in case of get request.
</pre>
"""
admin_ns_config_responses result = (admin_ns_config_responses) service.... | java | protected base_resource[] get_nitro_bulk_response(nitro_service service, String response) throws Exception
{
admin_ns_config_responses result = (admin_ns_config_responses) service.get_payload_formatter().string_to_resource(admin_ns_config_responses.class, response);
if(result.errorcode != 0)
{
if (result... | [
"protected",
"base_resource",
"[",
"]",
"get_nitro_bulk_response",
"(",
"nitro_service",
"service",
",",
"String",
"response",
")",
"throws",
"Exception",
"{",
"admin_ns_config_responses",
"result",
"=",
"(",
"admin_ns_config_responses",
")",
"service",
".",
"get_payloa... | <pre>
Converts API response of bulk operation into object and returns the object array in case of get request.
</pre> | [
"<pre",
">",
"Converts",
"API",
"response",
"of",
"bulk",
"operation",
"into",
"object",
"and",
"returns",
"the",
"object",
"array",
"in",
"case",
"of",
"get",
"request",
".",
"<",
"/",
"pre",
">"
] | train | https://github.com/netscaler/sdx_nitro/blob/c840919f1a8f7c0a5634c0f23d34fa14d1765ff1/src/main/java/com/citrix/sdx/nitro/resource/config/ns/admin_ns_config.java#L142-L159 |
infinispan/infinispan | core/src/main/java/org/infinispan/interceptors/BaseAsyncInterceptor.java | BaseAsyncInterceptor.asyncInvokeNext | public final Object asyncInvokeNext(InvocationContext ctx, VisitableCommand command,
Collection<? extends CompletionStage<?>> delays) {
"""
Suspend invocation until all {@code delays} complete, then if successful invoke the next interceptor.
If the list is empty or null, inv... | java | public final Object asyncInvokeNext(InvocationContext ctx, VisitableCommand command,
Collection<? extends CompletionStage<?>> delays) {
if (delays == null || delays.isEmpty()) {
return invokeNext(ctx, command);
} else if (delays.size() == 1) {
return ... | [
"public",
"final",
"Object",
"asyncInvokeNext",
"(",
"InvocationContext",
"ctx",
",",
"VisitableCommand",
"command",
",",
"Collection",
"<",
"?",
"extends",
"CompletionStage",
"<",
"?",
">",
">",
"delays",
")",
"{",
"if",
"(",
"delays",
"==",
"null",
"||",
"... | Suspend invocation until all {@code delays} complete, then if successful invoke the next interceptor.
If the list is empty or null, invoke the next interceptor immediately.
<p>If any of {@code delays} completes exceptionally, skip the next interceptor and continue with the exception.</p>
<p>You need to wrap the resul... | [
"Suspend",
"invocation",
"until",
"all",
"{",
"@code",
"delays",
"}",
"complete",
"then",
"if",
"successful",
"invoke",
"the",
"next",
"interceptor",
".",
"If",
"the",
"list",
"is",
"empty",
"or",
"null",
"invoke",
"the",
"next",
"interceptor",
"immediately",
... | train | https://github.com/infinispan/infinispan/blob/7c62b94886c3febb4774ae8376acf2baa0265ab5/core/src/main/java/org/infinispan/interceptors/BaseAsyncInterceptor.java#L254-L266 |
alkacon/opencms-core | src/org/opencms/search/solr/CmsSolrQuery.java | CmsSolrQuery.setDateRanges | public void setDateRanges(Map<String, CmsPair<Date, Date>> dateRanges) {
"""
Sets date ranges.<p>
This call will overwrite all existing date ranges for the given keys (name of the date facet field).<p>
The parameter Map uses as:<p>
<ul>
<li><code>keys: </code>Solr field name {@link org.opencms.search.field... | java | public void setDateRanges(Map<String, CmsPair<Date, Date>> dateRanges) {
if ((dateRanges != null) && !dateRanges.isEmpty()) {
// remove the date ranges
for (Map.Entry<String, CmsPair<Date, Date>> entry : dateRanges.entrySet()) {
removeFacetField(entry.getKey());
... | [
"public",
"void",
"setDateRanges",
"(",
"Map",
"<",
"String",
",",
"CmsPair",
"<",
"Date",
",",
"Date",
">",
">",
"dateRanges",
")",
"{",
"if",
"(",
"(",
"dateRanges",
"!=",
"null",
")",
"&&",
"!",
"dateRanges",
".",
"isEmpty",
"(",
")",
")",
"{",
... | Sets date ranges.<p>
This call will overwrite all existing date ranges for the given keys (name of the date facet field).<p>
The parameter Map uses as:<p>
<ul>
<li><code>keys: </code>Solr field name {@link org.opencms.search.fields.CmsSearchField} and
<li><code>values: </code> pairs with min date as first and max dat... | [
"Sets",
"date",
"ranges",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/search/solr/CmsSolrQuery.java#L328-L344 |
khuxtable/seaglass | src/main/java/com/seaglasslookandfeel/ui/SeaGlassSpinnerUI.java | SeaGlassSpinnerUI.replaceEditor | @Override
protected void replaceEditor(JComponent oldEditor, JComponent newEditor) {
"""
Called by the <code>PropertyChangeListener</code> when the
<code>JSpinner</code> editor property changes. It's the responsibility
of this method to remove the old editor and add the new one. By
default this operation... | java | @Override
protected void replaceEditor(JComponent oldEditor, JComponent newEditor) {
spinner.remove(oldEditor);
spinner.add(newEditor, "Editor");
if (oldEditor instanceof JSpinner.DefaultEditor) {
JTextField tf = ((JSpinner.DefaultEditor)oldEditor).getTextField();
... | [
"@",
"Override",
"protected",
"void",
"replaceEditor",
"(",
"JComponent",
"oldEditor",
",",
"JComponent",
"newEditor",
")",
"{",
"spinner",
".",
"remove",
"(",
"oldEditor",
")",
";",
"spinner",
".",
"add",
"(",
"newEditor",
",",
"\"Editor\"",
")",
";",
"if",... | Called by the <code>PropertyChangeListener</code> when the
<code>JSpinner</code> editor property changes. It's the responsibility
of this method to remove the old editor and add the new one. By
default this operation is just:
<pre>
spinner.remove(oldEditor);
spinner.add(newEditor, "Editor");
</pre>
The implementation... | [
"Called",
"by",
"the",
"<code",
">",
"PropertyChangeListener<",
"/",
"code",
">",
"when",
"the",
"<code",
">",
"JSpinner<",
"/",
"code",
">",
"editor",
"property",
"changes",
".",
"It",
"s",
"the",
"responsibility",
"of",
"this",
"method",
"to",
"remove",
... | train | https://github.com/khuxtable/seaglass/blob/f25ecba622923d7b29b64cb7d6068dd8005989b3/src/main/java/com/seaglasslookandfeel/ui/SeaGlassSpinnerUI.java#L242-L258 |
eclipse/xtext-lib | org.eclipse.xtext.xbase.lib/src/org/eclipse/xtext/xbase/lib/IterableExtensions.java | IterableExtensions.forEach | public static <T> void forEach(Iterable<T> iterable, Procedure1<? super T> procedure) {
"""
Applies {@code procedure} for each element of the given iterable.
@param iterable
the iterable. May not be <code>null</code>.
@param procedure
the procedure. May not be <code>null</code>.
"""
IteratorExtensions.... | java | public static <T> void forEach(Iterable<T> iterable, Procedure1<? super T> procedure) {
IteratorExtensions.forEach(iterable.iterator(), procedure);
} | [
"public",
"static",
"<",
"T",
">",
"void",
"forEach",
"(",
"Iterable",
"<",
"T",
">",
"iterable",
",",
"Procedure1",
"<",
"?",
"super",
"T",
">",
"procedure",
")",
"{",
"IteratorExtensions",
".",
"forEach",
"(",
"iterable",
".",
"iterator",
"(",
")",
"... | Applies {@code procedure} for each element of the given iterable.
@param iterable
the iterable. May not be <code>null</code>.
@param procedure
the procedure. May not be <code>null</code>. | [
"Applies",
"{",
"@code",
"procedure",
"}",
"for",
"each",
"element",
"of",
"the",
"given",
"iterable",
"."
] | train | https://github.com/eclipse/xtext-lib/blob/7063572e1f1bd713a3aa53bdf3a8dc60e25c169a/org.eclipse.xtext.xbase.lib/src/org/eclipse/xtext/xbase/lib/IterableExtensions.java#L397-L399 |
pravega/pravega | client/src/main/java/io/pravega/client/stream/impl/StreamSegments.java | StreamSegments.removeDuplicates | private void removeDuplicates(NavigableMap<Double, SegmentWithRange> result) {
"""
This combines consecutive entries in the map that refer to the same segment.
This happens following a merge because the preceeding segments are replaced one at a time.
"""
Segment last = null;
for (Iterator<Segm... | java | private void removeDuplicates(NavigableMap<Double, SegmentWithRange> result) {
Segment last = null;
for (Iterator<SegmentWithRange> iterator = result.descendingMap().values().iterator(); iterator.hasNext();) {
SegmentWithRange current = iterator.next();
if (current.getSegment().e... | [
"private",
"void",
"removeDuplicates",
"(",
"NavigableMap",
"<",
"Double",
",",
"SegmentWithRange",
">",
"result",
")",
"{",
"Segment",
"last",
"=",
"null",
";",
"for",
"(",
"Iterator",
"<",
"SegmentWithRange",
">",
"iterator",
"=",
"result",
".",
"descendingM... | This combines consecutive entries in the map that refer to the same segment.
This happens following a merge because the preceeding segments are replaced one at a time. | [
"This",
"combines",
"consecutive",
"entries",
"in",
"the",
"map",
"that",
"refer",
"to",
"the",
"same",
"segment",
".",
"This",
"happens",
"following",
"a",
"merge",
"because",
"the",
"preceeding",
"segments",
"are",
"replaced",
"one",
"at",
"a",
"time",
"."... | train | https://github.com/pravega/pravega/blob/6e24df7470669b3956a07018f52b2c6b3c2a3503/client/src/main/java/io/pravega/client/stream/impl/StreamSegments.java#L121-L130 |
elki-project/elki | elki/src/main/java/de/lmu/ifi/dbs/elki/algorithm/clustering/correlation/CASH.java | CASH.buildDerivatorDB | private Database buildDerivatorDB(Relation<ParameterizationFunction> relation, CASHInterval interval) {
"""
Builds a database for the derivator consisting of the ids in the specified
interval.
@param relation the database storing the parameterization functions
@param interval the interval to build the databas... | java | private Database buildDerivatorDB(Relation<ParameterizationFunction> relation, CASHInterval interval) {
DBIDs ids = interval.getIDs();
ProxyDatabase proxy = new ProxyDatabase(ids);
int dim = dimensionality(relation);
SimpleTypeInformation<DoubleVector> type = new VectorFieldTypeInformation<>(DoubleVecto... | [
"private",
"Database",
"buildDerivatorDB",
"(",
"Relation",
"<",
"ParameterizationFunction",
">",
"relation",
",",
"CASHInterval",
"interval",
")",
"{",
"DBIDs",
"ids",
"=",
"interval",
".",
"getIDs",
"(",
")",
";",
"ProxyDatabase",
"proxy",
"=",
"new",
"ProxyDa... | Builds a database for the derivator consisting of the ids in the specified
interval.
@param relation the database storing the parameterization functions
@param interval the interval to build the database from
@return a database for the derivator consisting of the ids in the specified
interval | [
"Builds",
"a",
"database",
"for",
"the",
"derivator",
"consisting",
"of",
"the",
"ids",
"in",
"the",
"specified",
"interval",
"."
] | train | https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki/src/main/java/de/lmu/ifi/dbs/elki/algorithm/clustering/correlation/CASH.java#L661-L680 |
astrapi69/jaulp-wicket | jaulp-wicket-components/src/main/java/de/alpharogroup/wicket/components/swap/SwapFragmentPanel.java | SwapFragmentPanel.onSwapToEdit | public void onSwapToEdit(final AjaxRequestTarget target, final Form<?> form) {
"""
Swaps from the view fragment to the edit fragment.
@param target
the target
@param form
the form
"""
swapFragments();
if (target != null)
{
Animate.slideUpAndDown(view, target);
}
else
{
LOGGER.error(
... | java | public void onSwapToEdit(final AjaxRequestTarget target, final Form<?> form)
{
swapFragments();
if (target != null)
{
Animate.slideUpAndDown(view, target);
}
else
{
LOGGER.error(
"AjaxRequestTarget is null on method SwapFragmentPanel#onSwapToEdit(AjaxRequestTarget, Form)");
}
modeContext = Mo... | [
"public",
"void",
"onSwapToEdit",
"(",
"final",
"AjaxRequestTarget",
"target",
",",
"final",
"Form",
"<",
"?",
">",
"form",
")",
"{",
"swapFragments",
"(",
")",
";",
"if",
"(",
"target",
"!=",
"null",
")",
"{",
"Animate",
".",
"slideUpAndDown",
"(",
"vie... | Swaps from the view fragment to the edit fragment.
@param target
the target
@param form
the form | [
"Swaps",
"from",
"the",
"view",
"fragment",
"to",
"the",
"edit",
"fragment",
"."
] | train | https://github.com/astrapi69/jaulp-wicket/blob/85d74368d00abd9bb97659b5794e38c0f8a013d4/jaulp-wicket-components/src/main/java/de/alpharogroup/wicket/components/swap/SwapFragmentPanel.java#L125-L138 |
transloadit/java-sdk | src/main/java/com/transloadit/sdk/Transloadit.java | Transloadit.listTemplates | public ListResponse listTemplates(Map<String, Object> options)
throws RequestException, LocalOperationException {
"""
Returns a list of all templates under the user account
@param options {@link Map} extra options to send along with the request.
@return {@link ListResponse}
@throws RequestExcept... | java | public ListResponse listTemplates(Map<String, Object> options)
throws RequestException, LocalOperationException {
Request request = new Request(this);
return new ListResponse(request.get("/templates", options));
} | [
"public",
"ListResponse",
"listTemplates",
"(",
"Map",
"<",
"String",
",",
"Object",
">",
"options",
")",
"throws",
"RequestException",
",",
"LocalOperationException",
"{",
"Request",
"request",
"=",
"new",
"Request",
"(",
"this",
")",
";",
"return",
"new",
"L... | Returns a list of all templates under the user account
@param options {@link Map} extra options to send along with the request.
@return {@link ListResponse}
@throws RequestException if request to transloadit server fails.
@throws LocalOperationException if something goes wrong while running non-http operations. | [
"Returns",
"a",
"list",
"of",
"all",
"templates",
"under",
"the",
"user",
"account"
] | train | https://github.com/transloadit/java-sdk/blob/9326c540a66f77b3d907d0b2c05bff1145ca14f7/src/main/java/com/transloadit/sdk/Transloadit.java#L240-L244 |
aspectran/aspectran | core/src/main/java/com/aspectran/core/util/ResourceUtils.java | ResourceUtils.getReader | public static Reader getReader(final File file, String encoding) throws IOException {
"""
Returns a Reader for reading the specified file.
@param file the file
@param encoding the encoding
@return the reader instance
@throws IOException if an error occurred when reading resources using any I/O operations
... | java | public static Reader getReader(final File file, String encoding) throws IOException {
InputStream stream;
try {
stream = AccessController.doPrivileged(
new PrivilegedExceptionAction<InputStream>() {
@Override
public InputStr... | [
"public",
"static",
"Reader",
"getReader",
"(",
"final",
"File",
"file",
",",
"String",
"encoding",
")",
"throws",
"IOException",
"{",
"InputStream",
"stream",
";",
"try",
"{",
"stream",
"=",
"AccessController",
".",
"doPrivileged",
"(",
"new",
"PrivilegedExcept... | Returns a Reader for reading the specified file.
@param file the file
@param encoding the encoding
@return the reader instance
@throws IOException if an error occurred when reading resources using any I/O operations | [
"Returns",
"a",
"Reader",
"for",
"reading",
"the",
"specified",
"file",
"."
] | train | https://github.com/aspectran/aspectran/blob/2d758a2a28b71ee85b42823c12dc44674d7f2c70/core/src/main/java/com/aspectran/core/util/ResourceUtils.java#L294-L316 |
msteiger/jxmapviewer2 | jxmapviewer2/src/main/java/org/jxmapviewer/viewer/TileFactory.java | TileFactory.pixelToGeo | public GeoPosition pixelToGeo(Point2D pixelCoordinate, int zoom) {
"""
Convert a pixel in the world bitmap at the specified zoom level into a GeoPosition
@param pixelCoordinate a Point2D representing a pixel in the world bitmap
@param zoom the zoom level of the world bitmap
@return the converted GeoPosition
... | java | public GeoPosition pixelToGeo(Point2D pixelCoordinate, int zoom)
{
return GeoUtil.getPosition(pixelCoordinate, zoom, getInfo());
} | [
"public",
"GeoPosition",
"pixelToGeo",
"(",
"Point2D",
"pixelCoordinate",
",",
"int",
"zoom",
")",
"{",
"return",
"GeoUtil",
".",
"getPosition",
"(",
"pixelCoordinate",
",",
"zoom",
",",
"getInfo",
"(",
")",
")",
";",
"}"
] | Convert a pixel in the world bitmap at the specified zoom level into a GeoPosition
@param pixelCoordinate a Point2D representing a pixel in the world bitmap
@param zoom the zoom level of the world bitmap
@return the converted GeoPosition | [
"Convert",
"a",
"pixel",
"in",
"the",
"world",
"bitmap",
"at",
"the",
"specified",
"zoom",
"level",
"into",
"a",
"GeoPosition"
] | train | https://github.com/msteiger/jxmapviewer2/blob/82639273b0aac983b6026fb90aa925c0cf596410/jxmapviewer2/src/main/java/org/jxmapviewer/viewer/TileFactory.java#L79-L82 |
validator/validator | src/nu/validator/xml/PrudentHttpEntityResolver.java | PrudentHttpEntityResolver.setParams | public static void setParams(int connectionTimeout, int socketTimeout,
int maxRequests) {
"""
Sets the timeouts of the HTTP client.
@param connectionTimeout
timeout until connection established in milliseconds. Zero
means no timeout.
@param socketTimeout
timeout for waiting for data in milliseco... | java | public static void setParams(int connectionTimeout, int socketTimeout,
int maxRequests) {
PrudentHttpEntityResolver.maxRequests = maxRequests;
PoolingHttpClientConnectionManager phcConnMgr;
Registry<ConnectionSocketFactory> registry = //
RegistryBuilder.<ConnectionSocketFacto... | [
"public",
"static",
"void",
"setParams",
"(",
"int",
"connectionTimeout",
",",
"int",
"socketTimeout",
",",
"int",
"maxRequests",
")",
"{",
"PrudentHttpEntityResolver",
".",
"maxRequests",
"=",
"maxRequests",
";",
"PoolingHttpClientConnectionManager",
"phcConnMgr",
";",... | Sets the timeouts of the HTTP client.
@param connectionTimeout
timeout until connection established in milliseconds. Zero
means no timeout.
@param socketTimeout
timeout for waiting for data in milliseconds. Zero means no
timeout.
@param maxRequests
maximum number of connections to a particular host | [
"Sets",
"the",
"timeouts",
"of",
"the",
"HTTP",
"client",
"."
] | train | https://github.com/validator/validator/blob/c7b7f85b3a364df7d9944753fb5b2cd0ce642889/src/nu/validator/xml/PrudentHttpEntityResolver.java#L128-L181 |
fuinorg/utils4j | src/main/java/org/fuin/utils4j/PropertiesUtils.java | PropertiesUtils.loadProperties | public static Properties loadProperties(final ClassLoader loader, final String resource) {
"""
Loads a resource from the classpath as properties.
@param loader
Class loader to use.
@param resource
Resource to load.
@return Properties.
"""
checkNotNull("loader", loader);
checkNotNull("r... | java | public static Properties loadProperties(final ClassLoader loader, final String resource) {
checkNotNull("loader", loader);
checkNotNull("resource", resource);
final Properties props = new Properties();
try (final InputStream inStream = loader.getResourceAsStream(resource)) {
... | [
"public",
"static",
"Properties",
"loadProperties",
"(",
"final",
"ClassLoader",
"loader",
",",
"final",
"String",
"resource",
")",
"{",
"checkNotNull",
"(",
"\"loader\"",
",",
"loader",
")",
";",
"checkNotNull",
"(",
"\"resource\"",
",",
"resource",
")",
";",
... | Loads a resource from the classpath as properties.
@param loader
Class loader to use.
@param resource
Resource to load.
@return Properties. | [
"Loads",
"a",
"resource",
"from",
"the",
"classpath",
"as",
"properties",
"."
] | train | https://github.com/fuinorg/utils4j/blob/71cf88e0a8d8ed67bbac513bf3cab165cd7e3280/src/main/java/org/fuin/utils4j/PropertiesUtils.java#L77-L91 |
medallia/Word2VecJava | src/main/java/com/medallia/word2vec/util/Common.java | Common.readToList | public static List<String> readToList(File f) throws IOException {
"""
Read the file line for line and return the result in a list
@throws IOException upon failure in reading, note that we wrap the underlying IOException with the file name
"""
try (final Reader reader = asReaderUTF8Lenient(new FileInputStre... | java | public static List<String> readToList(File f) throws IOException {
try (final Reader reader = asReaderUTF8Lenient(new FileInputStream(f))) {
return readToList(reader);
} catch (IOException ioe) {
throw new IllegalStateException(String.format("Failed to read %s: %s", f.getAbsolutePath(), ioe), ioe);
}
} | [
"public",
"static",
"List",
"<",
"String",
">",
"readToList",
"(",
"File",
"f",
")",
"throws",
"IOException",
"{",
"try",
"(",
"final",
"Reader",
"reader",
"=",
"asReaderUTF8Lenient",
"(",
"new",
"FileInputStream",
"(",
"f",
")",
")",
")",
"{",
"return",
... | Read the file line for line and return the result in a list
@throws IOException upon failure in reading, note that we wrap the underlying IOException with the file name | [
"Read",
"the",
"file",
"line",
"for",
"line",
"and",
"return",
"the",
"result",
"in",
"a",
"list"
] | train | https://github.com/medallia/Word2VecJava/blob/eb31fbb99ac6bbab82d7f807b3e2240edca50eb7/src/main/java/com/medallia/word2vec/util/Common.java#L59-L65 |
apache/incubator-zipkin | zipkin-storage/elasticsearch/src/main/java/zipkin2/elasticsearch/EnsureIndexTemplate.java | EnsureIndexTemplate.apply | static void apply(HttpCall.Factory callFactory, String name, String indexTemplate)
throws IOException {
"""
This is a blocking call, used inside a lazy. That's because no writes should occur until the
template is available.
"""
HttpUrl templateUrl = callFactory.baseUrl.newBuilder("_template").addPat... | java | static void apply(HttpCall.Factory callFactory, String name, String indexTemplate)
throws IOException {
HttpUrl templateUrl = callFactory.baseUrl.newBuilder("_template").addPathSegment(name).build();
Request getTemplate = new Request.Builder().url(templateUrl).tag("get-template").build();
try {
... | [
"static",
"void",
"apply",
"(",
"HttpCall",
".",
"Factory",
"callFactory",
",",
"String",
"name",
",",
"String",
"indexTemplate",
")",
"throws",
"IOException",
"{",
"HttpUrl",
"templateUrl",
"=",
"callFactory",
".",
"baseUrl",
".",
"newBuilder",
"(",
"\"_templat... | This is a blocking call, used inside a lazy. That's because no writes should occur until the
template is available. | [
"This",
"is",
"a",
"blocking",
"call",
"used",
"inside",
"a",
"lazy",
".",
"That",
"s",
"because",
"no",
"writes",
"should",
"occur",
"until",
"the",
"template",
"is",
"available",
"."
] | train | https://github.com/apache/incubator-zipkin/blob/89b2fab983fc626b3be32ce9d7cf64b3f01f1a87/zipkin-storage/elasticsearch/src/main/java/zipkin2/elasticsearch/EnsureIndexTemplate.java#L32-L47 |
RobotiumTech/robotium | robotium-solo/src/main/java/com/robotium/solo/Setter.java | Setter.setSlidingDrawer | public void setSlidingDrawer(final SlidingDrawer slidingDrawer, final int status) {
"""
Sets the status of a given SlidingDrawer. Examples are Solo.CLOSED and Solo.OPENED.
@param slidingDrawer the {@link SlidingDrawer}
@param status the status that the {@link SlidingDrawer} should be set to
"""
if(slidin... | java | public void setSlidingDrawer(final SlidingDrawer slidingDrawer, final int status){
if(slidingDrawer != null){
Activity activity = activityUtils.getCurrentActivity(false);
if(activity != null){
activity.runOnUiThread(new Runnable()
{
public void run()
{
try{
switch (status) {
... | [
"public",
"void",
"setSlidingDrawer",
"(",
"final",
"SlidingDrawer",
"slidingDrawer",
",",
"final",
"int",
"status",
")",
"{",
"if",
"(",
"slidingDrawer",
"!=",
"null",
")",
"{",
"Activity",
"activity",
"=",
"activityUtils",
".",
"getCurrentActivity",
"(",
"fals... | Sets the status of a given SlidingDrawer. Examples are Solo.CLOSED and Solo.OPENED.
@param slidingDrawer the {@link SlidingDrawer}
@param status the status that the {@link SlidingDrawer} should be set to | [
"Sets",
"the",
"status",
"of",
"a",
"given",
"SlidingDrawer",
".",
"Examples",
"are",
"Solo",
".",
"CLOSED",
"and",
"Solo",
".",
"OPENED",
"."
] | train | https://github.com/RobotiumTech/robotium/blob/75e567c38f26a6a87dc8bef90b3886a20e28d291/robotium-solo/src/main/java/com/robotium/solo/Setter.java#L130-L152 |
spotify/helios | helios-services/src/main/java/com/spotify/helios/master/ZooKeeperMasterModel.java | ZooKeeperMasterModel.removeDeploymentGroup | @Override
public void removeDeploymentGroup(final String name) throws DeploymentGroupDoesNotExistException {
"""
Remove a deployment group.
<p>If successful, all ZK nodes associated with the DG will be deleted. Specifically these
nodes are guaranteed to be non-existent after a successful remove (not all of t... | java | @Override
public void removeDeploymentGroup(final String name) throws DeploymentGroupDoesNotExistException {
log.info("removing deployment-group: name={}", name);
final ZooKeeperClient client = provider.get("removeDeploymentGroup");
try {
client.ensurePath(Paths.configDeploymentGroups());
clie... | [
"@",
"Override",
"public",
"void",
"removeDeploymentGroup",
"(",
"final",
"String",
"name",
")",
"throws",
"DeploymentGroupDoesNotExistException",
"{",
"log",
".",
"info",
"(",
"\"removing deployment-group: name={}\"",
",",
"name",
")",
";",
"final",
"ZooKeeperClient",
... | Remove a deployment group.
<p>If successful, all ZK nodes associated with the DG will be deleted. Specifically these
nodes are guaranteed to be non-existent after a successful remove (not all of them might exist
before, though):
<ul>
<li>/config/deployment-groups/[group-name]</li>
<li>/status/deployment-groups/[group-... | [
"Remove",
"a",
"deployment",
"group",
"."
] | train | https://github.com/spotify/helios/blob/c9000bc1d6908651570be8b057d4981bba4df5b4/helios-services/src/main/java/com/spotify/helios/master/ZooKeeperMasterModel.java#L419-L465 |
OpenLiberty/open-liberty | dev/com.ibm.ws.ejbcontainer.core/src/com/ibm/ejs/csi/TransactionControlImpl.java | TransactionControlImpl.completeTxTimeout | final public void completeTxTimeout() throws //LIDB1673.2.1.5
CSITransactionRolledbackException //LIDB1673.2.1.5 {
"""
Complete processing of passive transaction timeout.
The timer pops on a timeout thread; the transaction is
rolled back on the application thread when the container
has control. d171654
@... | java | final public void completeTxTimeout() throws //LIDB1673.2.1.5
CSITransactionRolledbackException //LIDB1673.2.1.5
{ //LIDB1673.2.1.5
final boolean isTraceOn = TraceComponent.isAnyTracingEnabled();
try
{ //LIDB1673.2.1.5
if (isTraceOn && tc.isEntryEnabled()) { // d173022.3
... | [
"final",
"public",
"void",
"completeTxTimeout",
"(",
")",
"throws",
"//LIDB1673.2.1.5",
"CSITransactionRolledbackException",
"//LIDB1673.2.1.5",
"{",
"//LIDB1673.2.1.5",
"final",
"boolean",
"isTraceOn",
"=",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
";",
"tr... | Complete processing of passive transaction timeout.
The timer pops on a timeout thread; the transaction is
rolled back on the application thread when the container
has control. d171654
@exception CSITransactionRolledbackException is thrown in the event of timeout. | [
"Complete",
"processing",
"of",
"passive",
"transaction",
"timeout",
".",
"The",
"timer",
"pops",
"on",
"a",
"timeout",
"thread",
";",
"the",
"transaction",
"is",
"rolled",
"back",
"on",
"the",
"application",
"thread",
"when",
"the",
"container",
"has",
"contr... | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.ejbcontainer.core/src/com/ibm/ejs/csi/TransactionControlImpl.java#L1190-L1214 |
TheHortonMachine/hortonmachine | gears/src/main/java/org/hortonmachine/gears/modules/r/labeler/OmsLabeler.java | OmsLabeler.getNeighbours | private int getNeighbours( int[] src1d, int i, int ox, int oy, int d_w, int d_h ) {
"""
getNeighbours will get the pixel value of i's neighbour that's ox and oy
away from i, if the point is outside the image, then 0 is returned.
This version gets from source image.
@param d_w
@param d_h
"""
int x, ... | java | private int getNeighbours( int[] src1d, int i, int ox, int oy, int d_w, int d_h ) {
int x, y, result;
x = (i % d_w) + ox; // d_w and d_h are assumed to be set to the
y = (i / d_w) + oy; // width and height of scr1d
if ((x < 0) || (x >= d_w) || (y < 0) || (y >= d_h)) {
resul... | [
"private",
"int",
"getNeighbours",
"(",
"int",
"[",
"]",
"src1d",
",",
"int",
"i",
",",
"int",
"ox",
",",
"int",
"oy",
",",
"int",
"d_w",
",",
"int",
"d_h",
")",
"{",
"int",
"x",
",",
"y",
",",
"result",
";",
"x",
"=",
"(",
"i",
"%",
"d_w",
... | getNeighbours will get the pixel value of i's neighbour that's ox and oy
away from i, if the point is outside the image, then 0 is returned.
This version gets from source image.
@param d_w
@param d_h | [
"getNeighbours",
"will",
"get",
"the",
"pixel",
"value",
"of",
"i",
"s",
"neighbour",
"that",
"s",
"ox",
"and",
"oy",
"away",
"from",
"i",
"if",
"the",
"point",
"is",
"outside",
"the",
"image",
"then",
"0",
"is",
"returned",
".",
"This",
"version",
"ge... | train | https://github.com/TheHortonMachine/hortonmachine/blob/d2b436bbdf951dc1fda56096a42dbc0eae4d35a5/gears/src/main/java/org/hortonmachine/gears/modules/r/labeler/OmsLabeler.java#L248-L260 |
javagl/CommonUI | src/main/java/de/javagl/common/ui/JTables.java | JTables.scrollToRow | public static void scrollToRow(JTable table, int row) {
"""
Scroll the given table so that the specified row is visible.
@param table The table
@param row The row
"""
Rectangle visibleRect = table.getVisibleRect();
Rectangle cellRect = table.getCellRect(row, 0, true);
Rectangle r... | java | public static void scrollToRow(JTable table, int row)
{
Rectangle visibleRect = table.getVisibleRect();
Rectangle cellRect = table.getCellRect(row, 0, true);
Rectangle r = new Rectangle(
visibleRect.x, cellRect.y,
visibleRect.width, cellRect.height);
t... | [
"public",
"static",
"void",
"scrollToRow",
"(",
"JTable",
"table",
",",
"int",
"row",
")",
"{",
"Rectangle",
"visibleRect",
"=",
"table",
".",
"getVisibleRect",
"(",
")",
";",
"Rectangle",
"cellRect",
"=",
"table",
".",
"getCellRect",
"(",
"row",
",",
"0",... | Scroll the given table so that the specified row is visible.
@param table The table
@param row The row | [
"Scroll",
"the",
"given",
"table",
"so",
"that",
"the",
"specified",
"row",
"is",
"visible",
"."
] | train | https://github.com/javagl/CommonUI/blob/b2c7a7637d4e288271392ba148dc17e4c9780255/src/main/java/de/javagl/common/ui/JTables.java#L89-L97 |
google/error-prone-javac | src/jdk.compiler/share/classes/com/sun/source/util/SimpleDocTreeVisitor.java | SimpleDocTreeVisitor.visitLink | @Override
public R visitLink(LinkTree node, P p) {
"""
{@inheritDoc} This implementation calls {@code defaultAction}.
@param node {@inheritDoc}
@param p {@inheritDoc}
@return the result of {@code defaultAction}
"""
return defaultAction(node, p);
} | java | @Override
public R visitLink(LinkTree node, P p) {
return defaultAction(node, p);
} | [
"@",
"Override",
"public",
"R",
"visitLink",
"(",
"LinkTree",
"node",
",",
"P",
"p",
")",
"{",
"return",
"defaultAction",
"(",
"node",
",",
"p",
")",
";",
"}"
] | {@inheritDoc} This implementation calls {@code defaultAction}.
@param node {@inheritDoc}
@param p {@inheritDoc}
@return the result of {@code defaultAction} | [
"{",
"@inheritDoc",
"}",
"This",
"implementation",
"calls",
"{",
"@code",
"defaultAction",
"}",
"."
] | train | https://github.com/google/error-prone-javac/blob/a53d069bbdb2c60232ed3811c19b65e41c3e60e0/src/jdk.compiler/share/classes/com/sun/source/util/SimpleDocTreeVisitor.java#L261-L264 |
couchbase/couchbase-lite-java-core | src/main/java/com/couchbase/lite/util/Utils.java | Utils.isEqual | public static boolean isEqual(Object obj1, Object obj2) {
"""
Like equals, but works even if either/both are null
@param obj1 object1 being compared
@param obj2 object2 being compared
@return true if both are non-null and obj1.equals(obj2), or true if both are null.
otherwise return false.
"""
if... | java | public static boolean isEqual(Object obj1, Object obj2) {
if (obj1 != null) {
return (obj2 != null) && obj1.equals(obj2);
} else {
return obj2 == null;
}
} | [
"public",
"static",
"boolean",
"isEqual",
"(",
"Object",
"obj1",
",",
"Object",
"obj2",
")",
"{",
"if",
"(",
"obj1",
"!=",
"null",
")",
"{",
"return",
"(",
"obj2",
"!=",
"null",
")",
"&&",
"obj1",
".",
"equals",
"(",
"obj2",
")",
";",
"}",
"else",
... | Like equals, but works even if either/both are null
@param obj1 object1 being compared
@param obj2 object2 being compared
@return true if both are non-null and obj1.equals(obj2), or true if both are null.
otherwise return false. | [
"Like",
"equals",
"but",
"works",
"even",
"if",
"either",
"/",
"both",
"are",
"null"
] | train | https://github.com/couchbase/couchbase-lite-java-core/blob/3b275642e2d2f231fd155ad9def9c5e9eff3118e/src/main/java/com/couchbase/lite/util/Utils.java#L50-L56 |
UrielCh/ovh-java-sdk | ovh-java-sdk-telephony/src/main/java/net/minidev/ovh/api/ApiOvhTelephony.java | ApiOvhTelephony.billingAccount_ovhPabx_serviceName_dialplan_dialplanId_extension_extensionId_conditionTime_POST | public OvhOvhPabxDialplanExtensionConditionTime billingAccount_ovhPabx_serviceName_dialplan_dialplanId_extension_extensionId_conditionTime_POST(String billingAccount, String serviceName, Long dialplanId, Long extensionId, Date timeFrom, Date timeTo, OvhOvhPabxDialplanExtensionConditionTimeWeekDayEnum weekDay) throws IO... | java | public OvhOvhPabxDialplanExtensionConditionTime billingAccount_ovhPabx_serviceName_dialplan_dialplanId_extension_extensionId_conditionTime_POST(String billingAccount, String serviceName, Long dialplanId, Long extensionId, Date timeFrom, Date timeTo, OvhOvhPabxDialplanExtensionConditionTimeWeekDayEnum weekDay) throws IO... | [
"public",
"OvhOvhPabxDialplanExtensionConditionTime",
"billingAccount_ovhPabx_serviceName_dialplan_dialplanId_extension_extensionId_conditionTime_POST",
"(",
"String",
"billingAccount",
",",
"String",
"serviceName",
",",
"Long",
"dialplanId",
",",
"Long",
"extensionId",
",",
"Date",
... | Create a new time condition for an extension
REST: POST /telephony/{billingAccount}/ovhPabx/{serviceName}/dialplan/{dialplanId}/extension/{extensionId}/conditionTime
@param timeTo [required] The time of the day when the extension will stop to be executed
@param timeFrom [required] The time of the day when the extensio... | [
"Create",
"a",
"new",
"time",
"condition",
"for",
"an",
"extension"
] | train | https://github.com/UrielCh/ovh-java-sdk/blob/6d531a40e56e09701943e334c25f90f640c55701/ovh-java-sdk-telephony/src/main/java/net/minidev/ovh/api/ApiOvhTelephony.java#L7100-L7109 |
albfernandez/itext2 | src/main/java/com/lowagie/text/Table.java | Table.addCell | public void addCell(Phrase content, Point location) throws BadElementException {
"""
Adds a <CODE>Cell</CODE> to the <CODE>Table</CODE>.
<P>
This is a shortcut for <CODE>addCell(Cell cell, Point location)</CODE>.
The <CODE>Phrase</CODE> will be converted to a <CODE>Cell</CODE>.
@param content a... | java | public void addCell(Phrase content, Point location) throws BadElementException {
Cell cell = new Cell(content);
cell.setBorder(defaultCell.getBorder());
cell.setBorderWidth(defaultCell.getBorderWidth());
cell.setBorderColor(defaultCell.getBorderColor());
cell.setBackgroundColor(d... | [
"public",
"void",
"addCell",
"(",
"Phrase",
"content",
",",
"Point",
"location",
")",
"throws",
"BadElementException",
"{",
"Cell",
"cell",
"=",
"new",
"Cell",
"(",
"content",
")",
";",
"cell",
".",
"setBorder",
"(",
"defaultCell",
".",
"getBorder",
"(",
"... | Adds a <CODE>Cell</CODE> to the <CODE>Table</CODE>.
<P>
This is a shortcut for <CODE>addCell(Cell cell, Point location)</CODE>.
The <CODE>Phrase</CODE> will be converted to a <CODE>Cell</CODE>.
@param content a <CODE>Phrase</CODE>
@param location a <CODE>Point</CODE>
@throws BadElementE... | [
"Adds",
"a",
"<CODE",
">",
"Cell<",
"/",
"CODE",
">",
"to",
"the",
"<CODE",
">",
"Table<",
"/",
"CODE",
">",
".",
"<P",
">",
"This",
"is",
"a",
"shortcut",
"for",
"<CODE",
">",
"addCell",
"(",
"Cell",
"cell",
"Point",
"location",
")",
"<",
"/",
"... | train | https://github.com/albfernandez/itext2/blob/438fc1899367fd13dfdfa8dfdca9a3c1a7783b84/src/main/java/com/lowagie/text/Table.java#L748-L759 |
Azure/azure-sdk-for-java | locks/resource-manager/v2016_09_01/src/main/java/com/microsoft/azure/management/locks/v2016_09_01/implementation/ManagementLocksInner.java | ManagementLocksInner.createOrUpdateAtResourceLevel | public ManagementLockObjectInner createOrUpdateAtResourceLevel(String resourceGroupName, String resourceProviderNamespace, String parentResourcePath, String resourceType, String resourceName, String lockName, ManagementLockObjectInner parameters) {
"""
Creates or updates a management lock at the resource level or ... | java | public ManagementLockObjectInner createOrUpdateAtResourceLevel(String resourceGroupName, String resourceProviderNamespace, String parentResourcePath, String resourceType, String resourceName, String lockName, ManagementLockObjectInner parameters) {
return createOrUpdateAtResourceLevelWithServiceResponseAsync(re... | [
"public",
"ManagementLockObjectInner",
"createOrUpdateAtResourceLevel",
"(",
"String",
"resourceGroupName",
",",
"String",
"resourceProviderNamespace",
",",
"String",
"parentResourcePath",
",",
"String",
"resourceType",
",",
"String",
"resourceName",
",",
"String",
"lockName"... | Creates or updates a management lock at the resource level or any level below the resource.
When you apply a lock at a parent scope, all child resources inherit the same lock. To create management locks, you must have access to Microsoft.Authorization/* or Microsoft.Authorization/locks/* actions. Of the built-in roles,... | [
"Creates",
"or",
"updates",
"a",
"management",
"lock",
"at",
"the",
"resource",
"level",
"or",
"any",
"level",
"below",
"the",
"resource",
".",
"When",
"you",
"apply",
"a",
"lock",
"at",
"a",
"parent",
"scope",
"all",
"child",
"resources",
"inherit",
"the"... | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/locks/resource-manager/v2016_09_01/src/main/java/com/microsoft/azure/management/locks/v2016_09_01/implementation/ManagementLocksInner.java#L689-L691 |
webmetrics/browsermob-proxy | src/main/java/org/browsermob/proxy/jetty/http/HttpMessage.java | HttpMessage.setCharacterEncoding | public void setCharacterEncoding(String encoding,boolean setField) {
"""
Set Character Encoding.
@param encoding An encoding that can override the encoding set
from the ContentType field.
"""
if (isCommitted())
return;
if (encoding==null)
{
// Clear an... | java | public void setCharacterEncoding(String encoding,boolean setField)
{
if (isCommitted())
return;
if (encoding==null)
{
// Clear any encoding.
if (_characterEncoding!=null)
{
_characterEncoding=null;
if (s... | [
"public",
"void",
"setCharacterEncoding",
"(",
"String",
"encoding",
",",
"boolean",
"setField",
")",
"{",
"if",
"(",
"isCommitted",
"(",
")",
")",
"return",
";",
"if",
"(",
"encoding",
"==",
"null",
")",
"{",
"// Clear any encoding.",
"if",
"(",
"_character... | Set Character Encoding.
@param encoding An encoding that can override the encoding set
from the ContentType field. | [
"Set",
"Character",
"Encoding",
"."
] | train | https://github.com/webmetrics/browsermob-proxy/blob/a9252e62246ac33d55d51b993ba1159404e7d389/src/main/java/org/browsermob/proxy/jetty/http/HttpMessage.java#L506-L532 |
UrielCh/ovh-java-sdk | ovh-java-sdk-vps/src/main/java/net/minidev/ovh/api/ApiOvhVps.java | ApiOvhVps.serviceName_monitoring_GET | public OvhUnitAndValues<OvhVpsTimestampValue> serviceName_monitoring_GET(String serviceName, OvhVpsMonitoringPeriodEnum period, OvhVpsStatisticTypeEnum type) throws IOException {
"""
Return many statistics about the virtual machine for a given period
REST: GET /vps/{serviceName}/monitoring
@param type [require... | java | public OvhUnitAndValues<OvhVpsTimestampValue> serviceName_monitoring_GET(String serviceName, OvhVpsMonitoringPeriodEnum period, OvhVpsStatisticTypeEnum type) throws IOException {
String qPath = "/vps/{serviceName}/monitoring";
StringBuilder sb = path(qPath, serviceName);
query(sb, "period", period);
query(sb, "... | [
"public",
"OvhUnitAndValues",
"<",
"OvhVpsTimestampValue",
">",
"serviceName_monitoring_GET",
"(",
"String",
"serviceName",
",",
"OvhVpsMonitoringPeriodEnum",
"period",
",",
"OvhVpsStatisticTypeEnum",
"type",
")",
"throws",
"IOException",
"{",
"String",
"qPath",
"=",
"\"/... | Return many statistics about the virtual machine for a given period
REST: GET /vps/{serviceName}/monitoring
@param type [required] The type of statistic to be fetched
@param period [required] The period the statistics are fetched for
@param serviceName [required] The internal name of your VPS offer | [
"Return",
"many",
"statistics",
"about",
"the",
"virtual",
"machine",
"for",
"a",
"given",
"period"
] | train | https://github.com/UrielCh/ovh-java-sdk/blob/6d531a40e56e09701943e334c25f90f640c55701/ovh-java-sdk-vps/src/main/java/net/minidev/ovh/api/ApiOvhVps.java#L733-L740 |
alexvasilkov/GestureViews | library/src/main/java/com/alexvasilkov/gestures/GestureControllerForPager.java | GestureControllerForPager.performViewPagerScroll | private int performViewPagerScroll(@NonNull MotionEvent event, float pagerDx) {
"""
/*
Manually scrolls ViewPager and returns actual distance at which pager was scrolled.
"""
int scrollBegin = viewPager.getScrollX();
lastViewPagerEventX += pagerDx;
passEventToViewPager(event);
... | java | private int performViewPagerScroll(@NonNull MotionEvent event, float pagerDx) {
int scrollBegin = viewPager.getScrollX();
lastViewPagerEventX += pagerDx;
passEventToViewPager(event);
return scrollBegin - viewPager.getScrollX();
} | [
"private",
"int",
"performViewPagerScroll",
"(",
"@",
"NonNull",
"MotionEvent",
"event",
",",
"float",
"pagerDx",
")",
"{",
"int",
"scrollBegin",
"=",
"viewPager",
".",
"getScrollX",
"(",
")",
";",
"lastViewPagerEventX",
"+=",
"pagerDx",
";",
"passEventToViewPager... | /*
Manually scrolls ViewPager and returns actual distance at which pager was scrolled. | [
"/",
"*",
"Manually",
"scrolls",
"ViewPager",
"and",
"returns",
"actual",
"distance",
"at",
"which",
"pager",
"was",
"scrolled",
"."
] | train | https://github.com/alexvasilkov/GestureViews/blob/f0a4c266e31dcad23bd0d9013531bc1c501b9c9f/library/src/main/java/com/alexvasilkov/gestures/GestureControllerForPager.java#L347-L352 |
lessthanoptimal/BoofCV | main/boofcv-geo/src/main/java/boofcv/alg/geo/LowLevelMultiViewOps.java | LowLevelMultiViewOps.computeNormalization | public static void computeNormalization(List<Point2D_F64> points, NormalizationPoint2D normalize ) {
"""
<p>Computes a transform which will normalize the points such that they have zero mean and a standard
deviation of one
</p>
<p>
Y. Ma, S. Soatto, J. Kosecka, and S. S. Sastry, "An Invitation to 3-D Vision"... | java | public static void computeNormalization(List<Point2D_F64> points, NormalizationPoint2D normalize )
{
double meanX = 0;
double meanY = 0;
for( Point2D_F64 p : points ) {
meanX += p.x;
meanY += p.y;
}
meanX /= points.size();
meanY /= points.size();
double stdX = 0;
double stdY = 0;
for( Point... | [
"public",
"static",
"void",
"computeNormalization",
"(",
"List",
"<",
"Point2D_F64",
">",
"points",
",",
"NormalizationPoint2D",
"normalize",
")",
"{",
"double",
"meanX",
"=",
"0",
";",
"double",
"meanY",
"=",
"0",
";",
"for",
"(",
"Point2D_F64",
"p",
":",
... | <p>Computes a transform which will normalize the points such that they have zero mean and a standard
deviation of one
</p>
<p>
Y. Ma, S. Soatto, J. Kosecka, and S. S. Sastry, "An Invitation to 3-D Vision" Springer-Verlad, 2004
</p>
@param points Input: List of observed points. Not modified.
@param normalize Output: 3... | [
"<p",
">",
"Computes",
"a",
"transform",
"which",
"will",
"normalize",
"the",
"points",
"such",
"that",
"they",
"have",
"zero",
"mean",
"and",
"a",
"standard",
"deviation",
"of",
"one",
"<",
"/",
"p",
">"
] | train | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-geo/src/main/java/boofcv/alg/geo/LowLevelMultiViewOps.java#L47-L75 |
kochedykov/jlibmodbus | src/com/intelligt/modbus/jlibmodbus/msg/ModbusRequestBuilder.java | ModbusRequestBuilder.buildReturnQueryData | public ModbusRequest buildReturnQueryData(int serverAddress, int queryData) throws ModbusNumberException {
"""
The data passed in the request data field is to be returned (looped back) in the response. The
entire response message should be identical to the request.
@param serverAddress a slave address
@param ... | java | public ModbusRequest buildReturnQueryData(int serverAddress, int queryData) throws ModbusNumberException {
return buildDiagnostics(DiagnosticsSubFunctionCode.RETURN_QUERY_DATA, serverAddress, queryData);
} | [
"public",
"ModbusRequest",
"buildReturnQueryData",
"(",
"int",
"serverAddress",
",",
"int",
"queryData",
")",
"throws",
"ModbusNumberException",
"{",
"return",
"buildDiagnostics",
"(",
"DiagnosticsSubFunctionCode",
".",
"RETURN_QUERY_DATA",
",",
"serverAddress",
",",
"que... | The data passed in the request data field is to be returned (looped back) in the response. The
entire response message should be identical to the request.
@param serverAddress a slave address
@param queryData request data field
@return DiagnosticsRequest instance
@throws ModbusNumberException if server address is ... | [
"The",
"data",
"passed",
"in",
"the",
"request",
"data",
"field",
"is",
"to",
"be",
"returned",
"(",
"looped",
"back",
")",
"in",
"the",
"response",
".",
"The",
"entire",
"response",
"message",
"should",
"be",
"identical",
"to",
"the",
"request",
"."
] | train | https://github.com/kochedykov/jlibmodbus/blob/197cb39e2649e61a6fe3cb7dc91a701d847e14be/src/com/intelligt/modbus/jlibmodbus/msg/ModbusRequestBuilder.java#L202-L204 |
buschmais/jqa-maven3-plugin | src/main/java/com/buschmais/jqassistant/plugin/maven3/impl/scanner/MavenModelScannerPlugin.java | MavenModelScannerPlugin.addProperties | private void addProperties(BaseProfileDescriptor pomDescriptor, Properties properties, Store store) {
"""
Adds information about defined properties.
@param pomDescriptor
The descriptor for the current POM.
@param properties
The properties information.
@param store
The database.
"""
Set<Entry<Ob... | java | private void addProperties(BaseProfileDescriptor pomDescriptor, Properties properties, Store store) {
Set<Entry<Object, Object>> entrySet = properties.entrySet();
for (Entry<Object, Object> entry : entrySet) {
PropertyDescriptor propertyDescriptor = store.create(PropertyDescriptor.class);
... | [
"private",
"void",
"addProperties",
"(",
"BaseProfileDescriptor",
"pomDescriptor",
",",
"Properties",
"properties",
",",
"Store",
"store",
")",
"{",
"Set",
"<",
"Entry",
"<",
"Object",
",",
"Object",
">",
">",
"entrySet",
"=",
"properties",
".",
"entrySet",
"(... | Adds information about defined properties.
@param pomDescriptor
The descriptor for the current POM.
@param properties
The properties information.
@param store
The database. | [
"Adds",
"information",
"about",
"defined",
"properties",
"."
] | train | https://github.com/buschmais/jqa-maven3-plugin/blob/6c6e2dca56de6d5b8ceeb2f28982fb6d7c98778f/src/main/java/com/buschmais/jqassistant/plugin/maven3/impl/scanner/MavenModelScannerPlugin.java#L614-L623 |
defei/codelogger-utils | src/main/java/org/codelogger/utils/RangeUtils.java | RangeUtils.getLongRanges | public static List<Range<Long>> getLongRanges(final Long from, final Long to, final int step)
throws InvalidRangeException {
"""
Returns Range<Long> list between given from and to by step.The
minimum step is 1.<br/>
e.g:<br/>
[from:0,to:3,step:1] => [[0-0],[1-1],[2-2],[3-3]]<... | java | public static List<Range<Long>> getLongRanges(final Long from, final Long to, final int step)
throws InvalidRangeException {
if (from > to) {
throw buildInvalidRangeException(from, to);
}
ArrayList<Range<Long>> list = newArrayList();
if (step >= to - from) {
list.add(Range.getInstance... | [
"public",
"static",
"List",
"<",
"Range",
"<",
"Long",
">",
">",
"getLongRanges",
"(",
"final",
"Long",
"from",
",",
"final",
"Long",
"to",
",",
"final",
"int",
"step",
")",
"throws",
"InvalidRangeException",
"{",
"if",
"(",
"from",
">",
"to",
")",
"{"... | Returns Range<Long> list between given from and to by step.The
minimum step is 1.<br/>
e.g:<br/>
[from:0,to:3,step:1] => [[0-0],[1-1],[2-2],[3-3]]<br/>
[from:0,to:7,step:2] => [[0-1],[2-3],[4-5],[6-7]]<br/>
[from:0,to:7,step:3] => [[0-2],[3-5... | [
"Returns",
"Range<",
";",
"Long>",
";",
"list",
"between",
"given",
"from",
"and",
"to",
"by",
"step",
".",
"The",
"minimum",
"step",
"is",
"1",
".",
"<br",
"/",
">",
"e",
".",
"g",
":",
"<br",
"/",
">",
" ",
";",
" ",
";",
" ",
"... | train | https://github.com/defei/codelogger-utils/blob/d906f5d217b783c7ae3e53442cd6fb87b20ecc0a/src/main/java/org/codelogger/utils/RangeUtils.java#L122-L141 |
Azure/azure-sdk-for-java | cognitiveservices/data-plane/language/luis/authoring/src/main/java/com/microsoft/azure/cognitiveservices/language/luis/authoring/implementation/TrainsImpl.java | TrainsImpl.getStatus | public List<ModelTrainingInfo> getStatus(UUID appId, String versionId) {
"""
Gets the training status of all models (intents and entities) for the specified LUIS app. You must call the train API to train the LUIS app before you call this API to get training status. "appID" specifies the LUIS app ID. "versionId" sp... | java | public List<ModelTrainingInfo> getStatus(UUID appId, String versionId) {
return getStatusWithServiceResponseAsync(appId, versionId).toBlocking().single().body();
} | [
"public",
"List",
"<",
"ModelTrainingInfo",
">",
"getStatus",
"(",
"UUID",
"appId",
",",
"String",
"versionId",
")",
"{",
"return",
"getStatusWithServiceResponseAsync",
"(",
"appId",
",",
"versionId",
")",
".",
"toBlocking",
"(",
")",
".",
"single",
"(",
")",
... | Gets the training status of all models (intents and entities) for the specified LUIS app. You must call the train API to train the LUIS app before you call this API to get training status. "appID" specifies the LUIS app ID. "versionId" specifies the version number of the LUIS app. For example, "0.1".
@param appId The ... | [
"Gets",
"the",
"training",
"status",
"of",
"all",
"models",
"(",
"intents",
"and",
"entities",
")",
"for",
"the",
"specified",
"LUIS",
"app",
".",
"You",
"must",
"call",
"the",
"train",
"API",
"to",
"train",
"the",
"LUIS",
"app",
"before",
"you",
"call",... | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/cognitiveservices/data-plane/language/luis/authoring/src/main/java/com/microsoft/azure/cognitiveservices/language/luis/authoring/implementation/TrainsImpl.java#L164-L166 |
Netflix/dyno | dyno-core/src/main/java/com/netflix/dyno/connectionpool/impl/HostStatusTracker.java | HostStatusTracker.computeNewHostStatus | public HostStatusTracker computeNewHostStatus(Collection<Host> hostsUp, Collection<Host> hostsDown) {
"""
Helper method that actually changes the state of the class to reflect the new set of hosts up and down
Note that the new HostStatusTracker is returned that holds onto the new state. Calling classes must updat... | java | public HostStatusTracker computeNewHostStatus(Collection<Host> hostsUp, Collection<Host> hostsDown) {
verifyMutuallyExclusive(hostsUp, hostsDown);
Set<Host> nextActiveHosts = new HashSet<Host>(hostsUp);
// Get the hosts that are currently down
Set<Host> nextInactiveHosts = new HashSet<Host>(hostsDown);... | [
"public",
"HostStatusTracker",
"computeNewHostStatus",
"(",
"Collection",
"<",
"Host",
">",
"hostsUp",
",",
"Collection",
"<",
"Host",
">",
"hostsDown",
")",
"{",
"verifyMutuallyExclusive",
"(",
"hostsUp",
",",
"hostsDown",
")",
";",
"Set",
"<",
"Host",
">",
"... | Helper method that actually changes the state of the class to reflect the new set of hosts up and down
Note that the new HostStatusTracker is returned that holds onto the new state. Calling classes must update their
references to use the new HostStatusTracker
@param hostsUp
@param hostsDown
@return | [
"Helper",
"method",
"that",
"actually",
"changes",
"the",
"state",
"of",
"the",
"class",
"to",
"reflect",
"the",
"new",
"set",
"of",
"hosts",
"up",
"and",
"down",
"Note",
"that",
"the",
"new",
"HostStatusTracker",
"is",
"returned",
"that",
"holds",
"onto",
... | train | https://github.com/Netflix/dyno/blob/158f807083ea8e9b09c8089cb07f98e954ad5b23/dyno-core/src/main/java/com/netflix/dyno/connectionpool/impl/HostStatusTracker.java#L154-L195 |
Azure/azure-sdk-for-java | locks/resource-manager/v2016_09_01/src/main/java/com/microsoft/azure/management/locks/v2016_09_01/implementation/ManagementLocksInner.java | ManagementLocksInner.getAtResourceLevelAsync | public Observable<ManagementLockObjectInner> getAtResourceLevelAsync(String resourceGroupName, String resourceProviderNamespace, String parentResourcePath, String resourceType, String resourceName, String lockName) {
"""
Get the management lock of a resource or any level below resource.
@param resourceGroupName... | java | public Observable<ManagementLockObjectInner> getAtResourceLevelAsync(String resourceGroupName, String resourceProviderNamespace, String parentResourcePath, String resourceType, String resourceName, String lockName) {
return getAtResourceLevelWithServiceResponseAsync(resourceGroupName, resourceProviderNamespace,... | [
"public",
"Observable",
"<",
"ManagementLockObjectInner",
">",
"getAtResourceLevelAsync",
"(",
"String",
"resourceGroupName",
",",
"String",
"resourceProviderNamespace",
",",
"String",
"parentResourcePath",
",",
"String",
"resourceType",
",",
"String",
"resourceName",
",",
... | Get the management lock of a resource or any level below resource.
@param resourceGroupName The name of the resource group.
@param resourceProviderNamespace The namespace of the resource provider.
@param parentResourcePath An extra path parameter needed in some services, like SQL Databases.
@param resourceType The typ... | [
"Get",
"the",
"management",
"lock",
"of",
"a",
"resource",
"or",
"any",
"level",
"below",
"resource",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/locks/resource-manager/v2016_09_01/src/main/java/com/microsoft/azure/management/locks/v2016_09_01/implementation/ManagementLocksInner.java#L965-L972 |
twitter/finagle | finagle-serversets/src/main/java/com/twitter/finagle/common/util/BackoffHelper.java | BackoffHelper.doUntilSuccess | public <E extends Exception> void doUntilSuccess(final ExceptionalSupplier<Boolean, E> task)
throws InterruptedException, BackoffStoppedException, E {
"""
Executes the given task using the configured backoff strategy until the task succeeds as
indicated by returning {@code true}.
@param task the retryabl... | java | public <E extends Exception> void doUntilSuccess(final ExceptionalSupplier<Boolean, E> task)
throws InterruptedException, BackoffStoppedException, E {
doUntilResult(new ExceptionalSupplier<Boolean, E>() {
@Override public Boolean get() throws E {
Boolean result = task.get();
return Boole... | [
"public",
"<",
"E",
"extends",
"Exception",
">",
"void",
"doUntilSuccess",
"(",
"final",
"ExceptionalSupplier",
"<",
"Boolean",
",",
"E",
">",
"task",
")",
"throws",
"InterruptedException",
",",
"BackoffStoppedException",
",",
"E",
"{",
"doUntilResult",
"(",
"ne... | Executes the given task using the configured backoff strategy until the task succeeds as
indicated by returning {@code true}.
@param task the retryable task to execute until success
@throws InterruptedException if interrupted while waiting for the task to execute successfully
@throws BackoffStoppedException if the bac... | [
"Executes",
"the",
"given",
"task",
"using",
"the",
"configured",
"backoff",
"strategy",
"until",
"the",
"task",
"succeeds",
"as",
"indicated",
"by",
"returning",
"{",
"@code",
"true",
"}",
"."
] | train | https://github.com/twitter/finagle/blob/872be5f2b147fa50351bdbf08b003a26745e1df8/finagle-serversets/src/main/java/com/twitter/finagle/common/util/BackoffHelper.java#L98-L106 |
google/j2objc | jre_emul/android/platform/external/icu/android_icu4j/src/main/java/android/icu/text/CompactDecimalFormat.java | CompactDecimalFormat.format | @Override
@Deprecated
public StringBuffer format(CurrencyAmount currAmt, StringBuffer toAppendTo, FieldPosition pos) {
"""
{@inheritDoc}
@deprecated This API might change or be removed in a future release.
@hide draft / provisional / internal are hidden on Android
"""
return format(currAmt.ge... | java | @Override
@Deprecated
public StringBuffer format(CurrencyAmount currAmt, StringBuffer toAppendTo, FieldPosition pos) {
return format(currAmt.getNumber().doubleValue(), currAmt.getCurrency(), toAppendTo, pos);
} | [
"@",
"Override",
"@",
"Deprecated",
"public",
"StringBuffer",
"format",
"(",
"CurrencyAmount",
"currAmt",
",",
"StringBuffer",
"toAppendTo",
",",
"FieldPosition",
"pos",
")",
"{",
"return",
"format",
"(",
"currAmt",
".",
"getNumber",
"(",
")",
".",
"doubleValue"... | {@inheritDoc}
@deprecated This API might change or be removed in a future release.
@hide draft / provisional / internal are hidden on Android | [
"{"
] | train | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/external/icu/android_icu4j/src/main/java/android/icu/text/CompactDecimalFormat.java#L299-L303 |
agmip/agmip-common-functions | src/main/java/org/agmip/translators/soil/SAReducerDecorator.java | SAReducerDecorator.computeInitialConditions | public Float computeInitialConditions(String key, Map<String, String> fullCurrentSoil, Map<String, String> previousSoil) {
"""
Perform initial condition convertion, for icnh4 and icno3 it's important to take into account the deep of the layer
for computing the aggregated value.
@param key
@param fullCurrentSoil... | java | public Float computeInitialConditions(String key, Map<String, String> fullCurrentSoil, Map<String, String> previousSoil) {
Float newValue = (parseFloat(fullCurrentSoil.get(key)) * parseFloat(fullCurrentSoil.get(SLLB)) + parseFloat(previousSoil.get(key)) * parseFloat(previousSoil.get(SLLB)));
newValue = newValue / (... | [
"public",
"Float",
"computeInitialConditions",
"(",
"String",
"key",
",",
"Map",
"<",
"String",
",",
"String",
">",
"fullCurrentSoil",
",",
"Map",
"<",
"String",
",",
"String",
">",
"previousSoil",
")",
"{",
"Float",
"newValue",
"=",
"(",
"parseFloat",
"(",
... | Perform initial condition convertion, for icnh4 and icno3 it's important to take into account the deep of the layer
for computing the aggregated value.
@param key
@param fullCurrentSoil
@param previousSoil
@return | [
"Perform",
"initial",
"condition",
"convertion",
"for",
"icnh4",
"and",
"icno3",
"it",
"s",
"important",
"to",
"take",
"into",
"account",
"the",
"deep",
"of",
"the",
"layer",
"for",
"computing",
"the",
"aggregated",
"value",
"."
] | train | https://github.com/agmip/agmip-common-functions/blob/4efa3042178841b026ca6fba9c96da02fbfb9a8e/src/main/java/org/agmip/translators/soil/SAReducerDecorator.java#L45-L49 |
box/box-android-sdk | box-content-sdk/src/main/java/com/box/androidsdk/content/requests/BoxRequest.java | BoxRequest.send | public final T send() throws BoxException {
"""
Synchronously make the request to Box and handle the response appropriately.
@return the expected BoxObject if the request is successful.
@throws BoxException thrown if there was a problem with handling the request.
"""
Exception ex = null;
T ... | java | public final T send() throws BoxException {
Exception ex = null;
T result = null;
try {
result = onSend();
} catch (Exception e){
ex = e;
}
// We catch the exception so that onSendCompleted can be called in case additional actions need to be taken... | [
"public",
"final",
"T",
"send",
"(",
")",
"throws",
"BoxException",
"{",
"Exception",
"ex",
"=",
"null",
";",
"T",
"result",
"=",
"null",
";",
"try",
"{",
"result",
"=",
"onSend",
"(",
")",
";",
"}",
"catch",
"(",
"Exception",
"e",
")",
"{",
"ex",
... | Synchronously make the request to Box and handle the response appropriately.
@return the expected BoxObject if the request is successful.
@throws BoxException thrown if there was a problem with handling the request. | [
"Synchronously",
"make",
"the",
"request",
"to",
"Box",
"and",
"handle",
"the",
"response",
"appropriately",
"."
] | train | https://github.com/box/box-android-sdk/blob/a621ad5ddebf23067fec27529130d72718fc0e88/box-content-sdk/src/main/java/com/box/androidsdk/content/requests/BoxRequest.java#L189-L208 |
esigate/esigate | esigate-core/src/main/java/org/esigate/aggregator/ElementAttributesFactory.java | ElementAttributesFactory.createElementAttributes | static ElementAttributes createElementAttributes(String tag) {
"""
Parse the tag and return the ElementAttributes
@param tag
the tag to parse
@return ElementAttributes
"""
// Parsing strings
// <!--$includetemplate$aggregated2$templatewithparams.jsp$-->
// or
// <!--$includ... | java | static ElementAttributes createElementAttributes(String tag) {
// Parsing strings
// <!--$includetemplate$aggregated2$templatewithparams.jsp$-->
// or
// <!--$includeblock$aggregated2$$(block)$myblock$-->
// in order to retrieve driver, page and name attributes
Pattern pa... | [
"static",
"ElementAttributes",
"createElementAttributes",
"(",
"String",
"tag",
")",
"{",
"// Parsing strings",
"// <!--$includetemplate$aggregated2$templatewithparams.jsp$-->",
"// or",
"// <!--$includeblock$aggregated2$$(block)$myblock$-->",
"// in order to retrieve driver, page and name a... | Parse the tag and return the ElementAttributes
@param tag
the tag to parse
@return ElementAttributes | [
"Parse",
"the",
"tag",
"and",
"return",
"the",
"ElementAttributes"
] | train | https://github.com/esigate/esigate/blob/50421fb224f16e1ec42715425109a72b3b55527b/esigate-core/src/main/java/org/esigate/aggregator/ElementAttributesFactory.java#L28-L62 |
m-m-m/util | contenttype/src/main/java/net/sf/mmm/util/contenttype/base/format/SegmentConstant.java | SegmentConstant.initBytes | protected void initBytes(StringBuilder source) {
"""
This method initializes the internal byte array.
@param source describes the source.
"""
if (this.bytes == null) {
if (this.string != null) {
String encodingValue = getEncoding();
try {
this.bytes = this.string.g... | java | protected void initBytes(StringBuilder source) {
if (this.bytes == null) {
if (this.string != null) {
String encodingValue = getEncoding();
try {
this.bytes = this.string.getBytes(encodingValue);
} catch (UnsupportedEncodingException e) {
source.append(".en... | [
"protected",
"void",
"initBytes",
"(",
"StringBuilder",
"source",
")",
"{",
"if",
"(",
"this",
".",
"bytes",
"==",
"null",
")",
"{",
"if",
"(",
"this",
".",
"string",
"!=",
"null",
")",
"{",
"String",
"encodingValue",
"=",
"getEncoding",
"(",
")",
";",... | This method initializes the internal byte array.
@param source describes the source. | [
"This",
"method",
"initializes",
"the",
"internal",
"byte",
"array",
"."
] | train | https://github.com/m-m-m/util/blob/f0e4e084448f8dfc83ca682a9e1618034a094ce6/contenttype/src/main/java/net/sf/mmm/util/contenttype/base/format/SegmentConstant.java#L116-L134 |
calimero-project/calimero-core | src/tuwien/auto/calimero/knxnetip/servicetype/TunnelingFeature.java | TunnelingFeature.newSet | public static TunnelingFeature newSet(final int channelId, final int seq, final InterfaceFeature featureId,
final byte... featureValue) {
"""
Creates a new tunneling feature-set service.
@param channelId tunneling connection channel identifier
@param seq tunneling connection send sequence number
@param feat... | java | public static TunnelingFeature newSet(final int channelId, final int seq, final InterfaceFeature featureId,
final byte... featureValue) {
return new TunnelingFeature(KNXnetIPHeader.TunnelingFeatureSet, channelId, seq, featureId, Success, featureValue);
} | [
"public",
"static",
"TunnelingFeature",
"newSet",
"(",
"final",
"int",
"channelId",
",",
"final",
"int",
"seq",
",",
"final",
"InterfaceFeature",
"featureId",
",",
"final",
"byte",
"...",
"featureValue",
")",
"{",
"return",
"new",
"TunnelingFeature",
"(",
"KNXne... | Creates a new tunneling feature-set service.
@param channelId tunneling connection channel identifier
@param seq tunneling connection send sequence number
@param featureId interface feature which value should be set
@param featureValue feature value to set
@return new tunneling feature-set service | [
"Creates",
"a",
"new",
"tunneling",
"feature",
"-",
"set",
"service",
"."
] | train | https://github.com/calimero-project/calimero-core/blob/7e6f547c6bd75fa985bfeb5b47ba671df2ea01e8/src/tuwien/auto/calimero/knxnetip/servicetype/TunnelingFeature.java#L110-L113 |
b3dgs/lionengine | lionengine-core/src/main/java/com/b3dgs/lionengine/Check.java | Check.superiorOrEqual | public static void superiorOrEqual(double a, double b) {
"""
Check if <code>a</code> is superior to <code>b</code>.
@param a The parameter to test.
@param b The parameter to compare to.
@throws LionEngineException If check failed.
"""
if (a < b)
{
throw new LionEngineExcepti... | java | public static void superiorOrEqual(double a, double b)
{
if (a < b)
{
throw new LionEngineException(ERROR_ARGUMENT + String.valueOf(a) + ERROR_SUPERIOR + String.valueOf(b));
}
} | [
"public",
"static",
"void",
"superiorOrEqual",
"(",
"double",
"a",
",",
"double",
"b",
")",
"{",
"if",
"(",
"a",
"<",
"b",
")",
"{",
"throw",
"new",
"LionEngineException",
"(",
"ERROR_ARGUMENT",
"+",
"String",
".",
"valueOf",
"(",
"a",
")",
"+",
"ERROR... | Check if <code>a</code> is superior to <code>b</code>.
@param a The parameter to test.
@param b The parameter to compare to.
@throws LionEngineException If check failed. | [
"Check",
"if",
"<code",
">",
"a<",
"/",
"code",
">",
"is",
"superior",
"to",
"<code",
">",
"b<",
"/",
"code",
">",
"."
] | train | https://github.com/b3dgs/lionengine/blob/cac3d5578532cf11724a737b9f09e71bf9995ab2/lionengine-core/src/main/java/com/b3dgs/lionengine/Check.java#L67-L73 |
apache/groovy | subprojects/groovy-nio/src/main/java/org/codehaus/groovy/runtime/NioGroovyMethods.java | NioGroovyMethods.withOutputStream | public static Object withOutputStream(Path self, @ClosureParams(value = SimpleType.class, options = "java.io.OutputStream") Closure closure) throws IOException {
"""
Creates a new OutputStream for this file and passes it into the closure.
This method ensures the stream is closed after the closure returns.
@par... | java | public static Object withOutputStream(Path self, @ClosureParams(value = SimpleType.class, options = "java.io.OutputStream") Closure closure) throws IOException {
return IOGroovyMethods.withStream(newOutputStream(self), closure);
} | [
"public",
"static",
"Object",
"withOutputStream",
"(",
"Path",
"self",
",",
"@",
"ClosureParams",
"(",
"value",
"=",
"SimpleType",
".",
"class",
",",
"options",
"=",
"\"java.io.OutputStream\"",
")",
"Closure",
"closure",
")",
"throws",
"IOException",
"{",
"retur... | Creates a new OutputStream for this file and passes it into the closure.
This method ensures the stream is closed after the closure returns.
@param self a Path
@param closure a closure
@return the value returned by the closure
@throws java.io.IOException if an IOException occurs.
@see org.codehaus.groovy.runtime.IO... | [
"Creates",
"a",
"new",
"OutputStream",
"for",
"this",
"file",
"and",
"passes",
"it",
"into",
"the",
"closure",
".",
"This",
"method",
"ensures",
"the",
"stream",
"is",
"closed",
"after",
"the",
"closure",
"returns",
"."
] | train | https://github.com/apache/groovy/blob/71cf20addb611bb8d097a59e395fd20bc7f31772/subprojects/groovy-nio/src/main/java/org/codehaus/groovy/runtime/NioGroovyMethods.java#L1485-L1487 |
elastic/elasticsearch-hadoop | mr/src/main/java/org/elasticsearch/hadoop/rest/commonshttp/CommonsHttpTransport.java | CommonsHttpTransport.afterExecute | private void afterExecute(HttpMethod method) throws IOException {
"""
Close any authentication resources that we may still have open and perform any after-response duties that we need to perform.
@param method The method that has been executed
@throws IOException If any issues arise during post processing
""... | java | private void afterExecute(HttpMethod method) throws IOException {
AuthState hostAuthState = method.getHostAuthState();
if (hostAuthState.isPreemptive() || hostAuthState.isAuthAttempted()) {
AuthScheme authScheme = hostAuthState.getAuthScheme();
if (authScheme instanceof SpnegoAu... | [
"private",
"void",
"afterExecute",
"(",
"HttpMethod",
"method",
")",
"throws",
"IOException",
"{",
"AuthState",
"hostAuthState",
"=",
"method",
".",
"getHostAuthState",
"(",
")",
";",
"if",
"(",
"hostAuthState",
".",
"isPreemptive",
"(",
")",
"||",
"hostAuthStat... | Close any authentication resources that we may still have open and perform any after-response duties that we need to perform.
@param method The method that has been executed
@throws IOException If any issues arise during post processing | [
"Close",
"any",
"authentication",
"resources",
"that",
"we",
"may",
"still",
"have",
"open",
"and",
"perform",
"any",
"after",
"-",
"response",
"duties",
"that",
"we",
"need",
"to",
"perform",
"."
] | train | https://github.com/elastic/elasticsearch-hadoop/blob/f3acaba268ff96efae8eb946088c748c777c22cc/mr/src/main/java/org/elasticsearch/hadoop/rest/commonshttp/CommonsHttpTransport.java#L698-L715 |
cdk/cdk | base/core/src/main/java/org/openscience/cdk/graph/InitialCycles.java | InitialCycles.singletonIntersect | static boolean singletonIntersect(final int[] p, final int[] q) {
"""
Given two paths from a common start vertex <i>r</i> check whether there
are any intersects. If the paths are different length the shorter of the
two should be given as <i>p</i>.
@param p a path from <i>r</i>
@param q a path from <i>r</i>
... | java | static boolean singletonIntersect(final int[] p, final int[] q) {
int n = p.length;
for (int i = 1; i < n; i++)
if (p[i] == q[i]) return false;
return true;
} | [
"static",
"boolean",
"singletonIntersect",
"(",
"final",
"int",
"[",
"]",
"p",
",",
"final",
"int",
"[",
"]",
"q",
")",
"{",
"int",
"n",
"=",
"p",
".",
"length",
";",
"for",
"(",
"int",
"i",
"=",
"1",
";",
"i",
"<",
"n",
";",
"i",
"++",
")",
... | Given two paths from a common start vertex <i>r</i> check whether there
are any intersects. If the paths are different length the shorter of the
two should be given as <i>p</i>.
@param p a path from <i>r</i>
@param q a path from <i>r</i>
@return whether the only intersect is <i>r</i> | [
"Given",
"two",
"paths",
"from",
"a",
"common",
"start",
"vertex",
"<i",
">",
"r<",
"/",
"i",
">",
"check",
"whether",
"there",
"are",
"any",
"intersects",
".",
"If",
"the",
"paths",
"are",
"different",
"length",
"the",
"shorter",
"of",
"the",
"two",
"... | train | https://github.com/cdk/cdk/blob/c3d0f16502bf08df50365fee392e11d7c9856657/base/core/src/main/java/org/openscience/cdk/graph/InitialCycles.java#L408-L413 |
Squarespace/cldr | compiler/src/main/java/com/squarespace/cldr/codegen/CalendarCodeGenerator.java | CalendarCodeGenerator.variantsFieldInit | private void variantsFieldInit(MethodSpec.Builder method, String fieldName, Variants v) {
"""
Appends a statement that initializes a FieldVariants field in the superclass.
"""
Stmt b = new Stmt();
b.append("$L = new $T(", fieldName, FIELD_VARIANTS);
b.append("\n ").append(v.abbreviated).comma();
... | java | private void variantsFieldInit(MethodSpec.Builder method, String fieldName, Variants v) {
Stmt b = new Stmt();
b.append("$L = new $T(", fieldName, FIELD_VARIANTS);
b.append("\n ").append(v.abbreviated).comma();
b.append("\n ").append(v.narrow).comma();
b.append("\n ").append(v.short_).comma();
... | [
"private",
"void",
"variantsFieldInit",
"(",
"MethodSpec",
".",
"Builder",
"method",
",",
"String",
"fieldName",
",",
"Variants",
"v",
")",
"{",
"Stmt",
"b",
"=",
"new",
"Stmt",
"(",
")",
";",
"b",
".",
"append",
"(",
"\"$L = new $T(\"",
",",
"fieldName",
... | Appends a statement that initializes a FieldVariants field in the superclass. | [
"Appends",
"a",
"statement",
"that",
"initializes",
"a",
"FieldVariants",
"field",
"in",
"the",
"superclass",
"."
] | train | https://github.com/Squarespace/cldr/blob/54b752d4ec2457df56e98461618f9c0eec41e1e1/compiler/src/main/java/com/squarespace/cldr/codegen/CalendarCodeGenerator.java#L567-L576 |
Netflix/eureka | eureka-core/src/main/java/com/netflix/eureka/registry/PeerAwareInstanceRegistryImpl.java | PeerAwareInstanceRegistryImpl.statusUpdate | @Override
public void statusUpdate(final String asgName, final ASGStatus newStatus, final boolean isReplication) {
"""
Replicate the <em>ASG status</em> updates to peer eureka nodes. If this
event is a replication from other nodes, then it is not replicated to
other nodes.
@param asgName the asg name for ... | java | @Override
public void statusUpdate(final String asgName, final ASGStatus newStatus, final boolean isReplication) {
// If this is replicated from an other node, do not try to replicate again.
if (isReplication) {
return;
}
for (final PeerEurekaNode node : peerEurekaNodes.g... | [
"@",
"Override",
"public",
"void",
"statusUpdate",
"(",
"final",
"String",
"asgName",
",",
"final",
"ASGStatus",
"newStatus",
",",
"final",
"boolean",
"isReplication",
")",
"{",
"// If this is replicated from an other node, do not try to replicate again.",
"if",
"(",
"isR... | Replicate the <em>ASG status</em> updates to peer eureka nodes. If this
event is a replication from other nodes, then it is not replicated to
other nodes.
@param asgName the asg name for which the status needs to be replicated.
@param newStatus the {@link ASGStatus} information that needs to be replicated.
@param isRe... | [
"Replicate",
"the",
"<em",
">",
"ASG",
"status<",
"/",
"em",
">",
"updates",
"to",
"peer",
"eureka",
"nodes",
".",
"If",
"this",
"event",
"is",
"a",
"replication",
"from",
"other",
"nodes",
"then",
"it",
"is",
"not",
"replicated",
"to",
"other",
"nodes",... | train | https://github.com/Netflix/eureka/blob/48446d956be09df6650a3c00b7ebd7e2d1e1544f/eureka-core/src/main/java/com/netflix/eureka/registry/PeerAwareInstanceRegistryImpl.java#L465-L475 |
samskivert/samskivert | src/main/java/com/samskivert/jdbc/BaseLiaison.java | BaseLiaison.appendColumns | protected void appendColumns (Iterable<String> columns, StringBuilder buf) {
"""
Escapes {@code columns} with {@link #columnSQL}, appends (comma-sepped) to {@code buf}.
"""
int ii = 0;
for (String column : columns) {
if (ii++ > 0) {
buf.append(", ");
}
... | java | protected void appendColumns (Iterable<String> columns, StringBuilder buf) {
int ii = 0;
for (String column : columns) {
if (ii++ > 0) {
buf.append(", ");
}
buf.append(columnSQL(column));
}
} | [
"protected",
"void",
"appendColumns",
"(",
"Iterable",
"<",
"String",
">",
"columns",
",",
"StringBuilder",
"buf",
")",
"{",
"int",
"ii",
"=",
"0",
";",
"for",
"(",
"String",
"column",
":",
"columns",
")",
"{",
"if",
"(",
"ii",
"++",
">",
"0",
")",
... | Escapes {@code columns} with {@link #columnSQL}, appends (comma-sepped) to {@code buf}. | [
"Escapes",
"{"
] | train | https://github.com/samskivert/samskivert/blob/a64d9ef42b69819bdb2c66bddac6a64caef928b6/src/main/java/com/samskivert/jdbc/BaseLiaison.java#L346-L354 |
docusign/docusign-java-client | src/main/java/com/docusign/esign/api/UsersApi.java | UsersApi.updateSignature | public UserSignature updateSignature(String accountId, String userId, String signatureId, UserSignatureDefinition userSignatureDefinition) throws ApiException {
"""
Updates the user signature for a specified user.
Creates, or updates, the signature font and initials for the specified user. When creating a signatu... | java | public UserSignature updateSignature(String accountId, String userId, String signatureId, UserSignatureDefinition userSignatureDefinition) throws ApiException {
return updateSignature(accountId, userId, signatureId, userSignatureDefinition, null);
} | [
"public",
"UserSignature",
"updateSignature",
"(",
"String",
"accountId",
",",
"String",
"userId",
",",
"String",
"signatureId",
",",
"UserSignatureDefinition",
"userSignatureDefinition",
")",
"throws",
"ApiException",
"{",
"return",
"updateSignature",
"(",
"accountId",
... | Updates the user signature for a specified user.
Creates, or updates, the signature font and initials for the specified user. When creating a signature, you use this resource to create the signature name and then add the signature and initials images into the signature. ###### Note: This will also create a default sig... | [
"Updates",
"the",
"user",
"signature",
"for",
"a",
"specified",
"user",
".",
"Creates",
"or",
"updates",
"the",
"signature",
"font",
"and",
"initials",
"for",
"the",
"specified",
"user",
".",
"When",
"creating",
"a",
"signature",
"you",
"use",
"this",
"resou... | train | https://github.com/docusign/docusign-java-client/blob/17ae82ace0f023e98edf813be832950568212e34/src/main/java/com/docusign/esign/api/UsersApi.java#L1638-L1640 |
epam/parso | src/main/java/com/epam/parso/DataWriterUtil.java | DataWriterUtil.getPercentFormatProcessor | private static Format getPercentFormatProcessor(ColumnFormat columnFormat, Locale locale) {
"""
The function to get a formatter to convert percentage elements into a string.
@param columnFormat the (@link ColumnFormat) class variable that stores the precision of rounding
the converted value.
@param locale ... | java | private static Format getPercentFormatProcessor(ColumnFormat columnFormat, Locale locale) {
DecimalFormatSymbols dfs = new DecimalFormatSymbols(locale);
if (columnFormat.getPrecision() == 0) {
return new DecimalFormat("0%", dfs);
}
String pattern = "0%." + new String(new char... | [
"private",
"static",
"Format",
"getPercentFormatProcessor",
"(",
"ColumnFormat",
"columnFormat",
",",
"Locale",
"locale",
")",
"{",
"DecimalFormatSymbols",
"dfs",
"=",
"new",
"DecimalFormatSymbols",
"(",
"locale",
")",
";",
"if",
"(",
"columnFormat",
".",
"getPrecis... | The function to get a formatter to convert percentage elements into a string.
@param columnFormat the (@link ColumnFormat) class variable that stores the precision of rounding
the converted value.
@param locale locale for parsing date elements.
@return a formatter to convert percentage elements into a string. | [
"The",
"function",
"to",
"get",
"a",
"formatter",
"to",
"convert",
"percentage",
"elements",
"into",
"a",
"string",
"."
] | train | https://github.com/epam/parso/blob/fb132cf943ba099a35b2f5a1490c0a59641e09dc/src/main/java/com/epam/parso/DataWriterUtil.java#L393-L400 |
jblas-project/jblas | src/main/java/org/jblas/Singular.java | Singular.SVDValues | public static DoubleMatrix SVDValues(DoubleMatrix A) {
"""
Compute the singular values of a matrix.
@param A DoubleMatrix of dimension m * n
@return A min(m, n) vector of singular values.
"""
int m = A.rows;
int n = A.columns;
DoubleMatrix S = new DoubleMatrix(min(m, n));
i... | java | public static DoubleMatrix SVDValues(DoubleMatrix A) {
int m = A.rows;
int n = A.columns;
DoubleMatrix S = new DoubleMatrix(min(m, n));
int info = NativeBlas.dgesvd('N', 'N', m, n, A.dup().data, 0, m, S.data, 0, null, 0, 1, null, 0, 1);
if (info > 0) {
throw new Lapac... | [
"public",
"static",
"DoubleMatrix",
"SVDValues",
"(",
"DoubleMatrix",
"A",
")",
"{",
"int",
"m",
"=",
"A",
".",
"rows",
";",
"int",
"n",
"=",
"A",
".",
"columns",
";",
"DoubleMatrix",
"S",
"=",
"new",
"DoubleMatrix",
"(",
"min",
"(",
"m",
",",
"n",
... | Compute the singular values of a matrix.
@param A DoubleMatrix of dimension m * n
@return A min(m, n) vector of singular values. | [
"Compute",
"the",
"singular",
"values",
"of",
"a",
"matrix",
"."
] | train | https://github.com/jblas-project/jblas/blob/2818f231228e655cda80dfd8e0b87709fdfd8a70/src/main/java/org/jblas/Singular.java#L120-L132 |
lestard/advanced-bindings | src/main/java/eu/lestard/advanced_bindings/api/StringBindings.java | StringBindings.toUpperCase | public static StringBinding toUpperCase(ObservableValue<String> text, ObservableValue<Locale> locale) {
"""
Creates a string binding that contains the value of the given observable string converted to uppercase with the
given locale. See {@link String#toUpperCase(Locale)}.
If the given observable string has a ... | java | public static StringBinding toUpperCase(ObservableValue<String> text, ObservableValue<Locale> locale) {
return Bindings.createStringBinding(() -> {
final Locale localeValue = locale.getValue() == null ? Locale.getDefault() : locale.getValue();
return text.getValue() == null ? "" : text.getValue().toUpperCas... | [
"public",
"static",
"StringBinding",
"toUpperCase",
"(",
"ObservableValue",
"<",
"String",
">",
"text",
",",
"ObservableValue",
"<",
"Locale",
">",
"locale",
")",
"{",
"return",
"Bindings",
".",
"createStringBinding",
"(",
"(",
")",
"->",
"{",
"final",
"Locale... | Creates a string binding that contains the value of the given observable string converted to uppercase with the
given locale. See {@link String#toUpperCase(Locale)}.
If the given observable string has a value of `null` the created binding will contain an empty string.
If the given observable locale has a value of `nu... | [
"Creates",
"a",
"string",
"binding",
"that",
"contains",
"the",
"value",
"of",
"the",
"given",
"observable",
"string",
"converted",
"to",
"uppercase",
"with",
"the",
"given",
"locale",
".",
"See",
"{",
"@link",
"String#toUpperCase",
"(",
"Locale",
")",
"}",
... | train | https://github.com/lestard/advanced-bindings/blob/054a5dde261c29f862b971765fa3da3704a13ab4/src/main/java/eu/lestard/advanced_bindings/api/StringBindings.java#L198-L204 |
denisneuling/apitrary.jar | apitrary-api-client/src/main/java/com/apitrary/api/client/util/ClassUtil.java | ClassUtil.getDeclaredFieldSilent | public static Field getDeclaredFieldSilent(Class<?> target, String fieldName) {
"""
<p>
getDeclaredFieldSilent.
</p>
@param target
a {@link java.lang.Class} object.
@param fieldName
a {@link java.lang.String} object.
@return a {@link java.lang.reflect.Field} object.
"""
try {
return target.getDec... | java | public static Field getDeclaredFieldSilent(Class<?> target, String fieldName) {
try {
return target.getDeclaredField(fieldName);
} catch (Exception e) {
return null;
}
} | [
"public",
"static",
"Field",
"getDeclaredFieldSilent",
"(",
"Class",
"<",
"?",
">",
"target",
",",
"String",
"fieldName",
")",
"{",
"try",
"{",
"return",
"target",
".",
"getDeclaredField",
"(",
"fieldName",
")",
";",
"}",
"catch",
"(",
"Exception",
"e",
")... | <p>
getDeclaredFieldSilent.
</p>
@param target
a {@link java.lang.Class} object.
@param fieldName
a {@link java.lang.String} object.
@return a {@link java.lang.reflect.Field} object. | [
"<p",
">",
"getDeclaredFieldSilent",
".",
"<",
"/",
"p",
">"
] | train | https://github.com/denisneuling/apitrary.jar/blob/b7f639a1e735c60ba2b1b62851926757f5de8628/apitrary-api-client/src/main/java/com/apitrary/api/client/util/ClassUtil.java#L369-L375 |
kaazing/gateway | mina.core/core/src/main/java/org/apache/mina/proxy/handlers/http/AbstractAuthLogicHandler.java | AbstractAuthLogicHandler.addKeepAliveHeaders | public static void addKeepAliveHeaders(Map<String, List<String>> headers) {
"""
Try to force proxy connection to be kept alive.
@param headers the request headers
"""
StringUtilities.addValueToHeader(headers, "Keep-Alive",
HttpProxyConstants.DEFAULT_KEEP_ALIVE_TIME, true);
St... | java | public static void addKeepAliveHeaders(Map<String, List<String>> headers) {
StringUtilities.addValueToHeader(headers, "Keep-Alive",
HttpProxyConstants.DEFAULT_KEEP_ALIVE_TIME, true);
StringUtilities.addValueToHeader(headers, "Proxy-Connection",
"keep-Alive", true);
} | [
"public",
"static",
"void",
"addKeepAliveHeaders",
"(",
"Map",
"<",
"String",
",",
"List",
"<",
"String",
">",
">",
"headers",
")",
"{",
"StringUtilities",
".",
"addValueToHeader",
"(",
"headers",
",",
"\"Keep-Alive\"",
",",
"HttpProxyConstants",
".",
"DEFAULT_K... | Try to force proxy connection to be kept alive.
@param headers the request headers | [
"Try",
"to",
"force",
"proxy",
"connection",
"to",
"be",
"kept",
"alive",
"."
] | train | https://github.com/kaazing/gateway/blob/06017b19273109b3b992e528e702586446168d57/mina.core/core/src/main/java/org/apache/mina/proxy/handlers/http/AbstractAuthLogicHandler.java#L110-L115 |
wildfly/wildfly-core | patching/src/main/java/org/jboss/as/patching/runner/IdentityPatchContext.java | IdentityPatchContext.getTargetFile | static File getTargetFile(final File root, final MiscContentItem item) {
"""
Get a misc file.
@param root the root
@param item the misc content item
@return the misc file
"""
return PatchContentLoader.getMiscPath(root, item);
} | java | static File getTargetFile(final File root, final MiscContentItem item) {
return PatchContentLoader.getMiscPath(root, item);
} | [
"static",
"File",
"getTargetFile",
"(",
"final",
"File",
"root",
",",
"final",
"MiscContentItem",
"item",
")",
"{",
"return",
"PatchContentLoader",
".",
"getMiscPath",
"(",
"root",
",",
"item",
")",
";",
"}"
] | Get a misc file.
@param root the root
@param item the misc content item
@return the misc file | [
"Get",
"a",
"misc",
"file",
"."
] | train | https://github.com/wildfly/wildfly-core/blob/cfaf0479dcbb2d320a44c5374b93b944ec39fade/patching/src/main/java/org/jboss/as/patching/runner/IdentityPatchContext.java#L643-L645 |
Samsung/GearVRf | GVRf/Framework/framework/src/main/java/org/gearvrf/GVRPicker.java | GVRPicker.processPick | public void processPick(boolean touched, MotionEvent event) {
"""
Scans the scene graph to collect picked items
and generates appropriate pick and touch events.
This function is called by the cursor controller
internally but can also be used to funnel a
stream of Android motion events into the picker.
@see #p... | java | public void processPick(boolean touched, MotionEvent event)
{
mPickEventLock.lock();
mTouched = touched;
mMotionEvent = event;
doPick();
mPickEventLock.unlock();
} | [
"public",
"void",
"processPick",
"(",
"boolean",
"touched",
",",
"MotionEvent",
"event",
")",
"{",
"mPickEventLock",
".",
"lock",
"(",
")",
";",
"mTouched",
"=",
"touched",
";",
"mMotionEvent",
"=",
"event",
";",
"doPick",
"(",
")",
";",
"mPickEventLock",
... | Scans the scene graph to collect picked items
and generates appropriate pick and touch events.
This function is called by the cursor controller
internally but can also be used to funnel a
stream of Android motion events into the picker.
@see #pickObjects(GVRScene, float, float, float, float, float, float)
@param touche... | [
"Scans",
"the",
"scene",
"graph",
"to",
"collect",
"picked",
"items",
"and",
"generates",
"appropriate",
"pick",
"and",
"touch",
"events",
".",
"This",
"function",
"is",
"called",
"by",
"the",
"cursor",
"controller",
"internally",
"but",
"can",
"also",
"be",
... | train | https://github.com/Samsung/GearVRf/blob/05034d465a7b0a494fabb9e9f2971ac19392f32d/GVRf/Framework/framework/src/main/java/org/gearvrf/GVRPicker.java#L555-L562 |
before/uadetector | modules/uadetector-core/src/main/java/net/sf/uadetector/datastore/CachingXmlDataStore.java | CachingXmlDataStore.findOrCreateCacheFile | @Nonnull
public static File findOrCreateCacheFile() {
"""
Gets the cache file for <em>UAS data</em> in the default temporary-file directory. If no cache file exists, a new
empty file in the default temporary-file directory will be created, using the default prefix and suffix to
generate its name.
@return fil... | java | @Nonnull
public static File findOrCreateCacheFile() {
final File file = new File(CACHE_DIR, PREFIX + SUFFIX);
if (!file.exists()) {
try {
file.createNewFile();
} catch (final IOException e) {
throw new IllegalStateOfArgumentException("Can not create a cache file.", e);
}
}
return file;
} | [
"@",
"Nonnull",
"public",
"static",
"File",
"findOrCreateCacheFile",
"(",
")",
"{",
"final",
"File",
"file",
"=",
"new",
"File",
"(",
"CACHE_DIR",
",",
"PREFIX",
"+",
"SUFFIX",
")",
";",
"if",
"(",
"!",
"file",
".",
"exists",
"(",
")",
")",
"{",
"try... | Gets the cache file for <em>UAS data</em> in the default temporary-file directory. If no cache file exists, a new
empty file in the default temporary-file directory will be created, using the default prefix and suffix to
generate its name.
@return file to cache read in <em>UAS data</em>
@throws net.sf.qualitycheck.exc... | [
"Gets",
"the",
"cache",
"file",
"for",
"<em",
">",
"UAS",
"data<",
"/",
"em",
">",
"in",
"the",
"default",
"temporary",
"-",
"file",
"directory",
".",
"If",
"no",
"cache",
"file",
"exists",
"a",
"new",
"empty",
"file",
"in",
"the",
"default",
"temporar... | train | https://github.com/before/uadetector/blob/215fb652723c52866572cff885f52a3fe67b9db5/modules/uadetector-core/src/main/java/net/sf/uadetector/datastore/CachingXmlDataStore.java#L240-L251 |
fabric8io/kubernetes-client | kubernetes-client/src/main/java/io/fabric8/kubernetes/client/utils/Utils.java | Utils.waitUntilReady | public static boolean waitUntilReady(BlockingQueue<Object> queue, long amount, TimeUnit timeUnit) {
"""
Wait until an other thread signals the completion of a task.
If an exception is passed, it will be propagated to the caller.
@param queue The communication channel.
@param amount The amount of time to ... | java | public static boolean waitUntilReady(BlockingQueue<Object> queue, long amount, TimeUnit timeUnit) {
try {
Object obj = queue.poll(amount, timeUnit);
if (obj instanceof Boolean) {
return (Boolean) obj;
} else if (obj instanceof Throwable) {
throw (Throwable) obj;
}
retur... | [
"public",
"static",
"boolean",
"waitUntilReady",
"(",
"BlockingQueue",
"<",
"Object",
">",
"queue",
",",
"long",
"amount",
",",
"TimeUnit",
"timeUnit",
")",
"{",
"try",
"{",
"Object",
"obj",
"=",
"queue",
".",
"poll",
"(",
"amount",
",",
"timeUnit",
")",
... | Wait until an other thread signals the completion of a task.
If an exception is passed, it will be propagated to the caller.
@param queue The communication channel.
@param amount The amount of time to wait.
@param timeUnit The time unit.
@return a boolean value indicating resource is ready or not. | [
"Wait",
"until",
"an",
"other",
"thread",
"signals",
"the",
"completion",
"of",
"a",
"task",
".",
"If",
"an",
"exception",
"is",
"passed",
"it",
"will",
"be",
"propagated",
"to",
"the",
"caller",
".",
"@param",
"queue",
"The",
"communication",
"channel",
"... | train | https://github.com/fabric8io/kubernetes-client/blob/141668a882ed8e902c045a5cd0a80f14bd17d132/kubernetes-client/src/main/java/io/fabric8/kubernetes/client/utils/Utils.java#L127-L139 |
dkmfbk/knowledgestore | ks-core/src/main/java/eu/fbk/knowledgestore/data/Representation.java | Representation.getReader | public Reader getReader() {
"""
Returns a {@code Reader} over the character data of this representation object. Conversion
from byte to character data, if required, is performed according to the charset specified
by the MIME type metadata property ({@link NIE#MIME_TYPE}).
@return a {@code Reader} providing ac... | java | public Reader getReader() {
if (this.data instanceof Reader) {
return (Reader) this.data;
} else {
final InputStream stream = (InputStream) this.data;
return new InputStreamReader(stream, getCharset());
}
} | [
"public",
"Reader",
"getReader",
"(",
")",
"{",
"if",
"(",
"this",
".",
"data",
"instanceof",
"Reader",
")",
"{",
"return",
"(",
"Reader",
")",
"this",
".",
"data",
";",
"}",
"else",
"{",
"final",
"InputStream",
"stream",
"=",
"(",
"InputStream",
")",
... | Returns a {@code Reader} over the character data of this representation object. Conversion
from byte to character data, if required, is performed according to the charset specified
by the MIME type metadata property ({@link NIE#MIME_TYPE}).
@return a {@code Reader} providing access to the character data of the represe... | [
"Returns",
"a",
"{",
"@code",
"Reader",
"}",
"over",
"the",
"character",
"data",
"of",
"this",
"representation",
"object",
".",
"Conversion",
"from",
"byte",
"to",
"character",
"data",
"if",
"required",
"is",
"performed",
"according",
"to",
"the",
"charset",
... | train | https://github.com/dkmfbk/knowledgestore/blob/a548101b1dd67fcf72a1ec6f838ea7539bdbbe7a/ks-core/src/main/java/eu/fbk/knowledgestore/data/Representation.java#L365-L372 |
moparisthebest/beehive | beehive-netui-core/src/main/java/org/apache/beehive/netui/util/xml/DomUtils.java | DomUtils.getChildElementsByName | public static List getChildElementsByName(Element parent, String name) {
"""
<p>Returns a list of child elements with the given
name. Returns an empty list if there are no such child
elements.</p>
@param parent parent element
@param name name of the child element
@return child elements
"""
List ... | java | public static List getChildElementsByName(Element parent, String name)
{
List elements = new ArrayList();
NodeList children = parent.getChildNodes();
for(int i = 0; i < children.getLength(); i++) {
Node node = children.item(i);
if(node.getNodeType() == Node.ELEMENT_... | [
"public",
"static",
"List",
"getChildElementsByName",
"(",
"Element",
"parent",
",",
"String",
"name",
")",
"{",
"List",
"elements",
"=",
"new",
"ArrayList",
"(",
")",
";",
"NodeList",
"children",
"=",
"parent",
".",
"getChildNodes",
"(",
")",
";",
"for",
... | <p>Returns a list of child elements with the given
name. Returns an empty list if there are no such child
elements.</p>
@param parent parent element
@param name name of the child element
@return child elements | [
"<p",
">",
"Returns",
"a",
"list",
"of",
"child",
"elements",
"with",
"the",
"given",
"name",
".",
"Returns",
"an",
"empty",
"list",
"if",
"there",
"are",
"no",
"such",
"child",
"elements",
".",
"<",
"/",
"p",
">"
] | train | https://github.com/moparisthebest/beehive/blob/4246a0cc40ce3c05f1a02c2da2653ac622703d77/beehive-netui-core/src/main/java/org/apache/beehive/netui/util/xml/DomUtils.java#L72-L89 |
infinispan/infinispan | core/src/main/java/org/infinispan/partitionhandling/impl/PreferAvailabilityStrategy.java | PreferAvailabilityStrategy.computePreferredTopology | public CacheTopology computePreferredTopology(Map<Address, CacheStatusResponse> statusResponseMap) {
"""
Ignore the AvailabilityStrategyContext and only compute the preferred topology for testing.
@return The preferred topology, or {@code null} if there is no preferred topology.
"""
List<Partition> pa... | java | public CacheTopology computePreferredTopology(Map<Address, CacheStatusResponse> statusResponseMap) {
List<Partition> partitions = computePartitions(statusResponseMap, "");
return partitions.size() != 0 ? selectPreferredPartition(partitions).topology : null;
} | [
"public",
"CacheTopology",
"computePreferredTopology",
"(",
"Map",
"<",
"Address",
",",
"CacheStatusResponse",
">",
"statusResponseMap",
")",
"{",
"List",
"<",
"Partition",
">",
"partitions",
"=",
"computePartitions",
"(",
"statusResponseMap",
",",
"\"\"",
")",
";",... | Ignore the AvailabilityStrategyContext and only compute the preferred topology for testing.
@return The preferred topology, or {@code null} if there is no preferred topology. | [
"Ignore",
"the",
"AvailabilityStrategyContext",
"and",
"only",
"compute",
"the",
"preferred",
"topology",
"for",
"testing",
"."
] | train | https://github.com/infinispan/infinispan/blob/7c62b94886c3febb4774ae8376acf2baa0265ab5/core/src/main/java/org/infinispan/partitionhandling/impl/PreferAvailabilityStrategy.java#L246-L250 |
goldmansachs/gs-collections | collections/src/main/java/com/gs/collections/impl/utility/Iterate.java | Iterate.addAllIterable | public static <T> boolean addAllIterable(Iterable<? extends T> iterable, Collection<T> targetCollection) {
"""
Add all elements from the source Iterable to the target collection, returns true if any element was added.
"""
if (iterable == null)
{
throw new NullPointerException();
... | java | public static <T> boolean addAllIterable(Iterable<? extends T> iterable, Collection<T> targetCollection)
{
if (iterable == null)
{
throw new NullPointerException();
}
if (iterable instanceof Collection<?>)
{
return targetCollection.addAll((Collection<T... | [
"public",
"static",
"<",
"T",
">",
"boolean",
"addAllIterable",
"(",
"Iterable",
"<",
"?",
"extends",
"T",
">",
"iterable",
",",
"Collection",
"<",
"T",
">",
"targetCollection",
")",
"{",
"if",
"(",
"iterable",
"==",
"null",
")",
"{",
"throw",
"new",
"... | Add all elements from the source Iterable to the target collection, returns true if any element was added. | [
"Add",
"all",
"elements",
"from",
"the",
"source",
"Iterable",
"to",
"the",
"target",
"collection",
"returns",
"true",
"if",
"any",
"element",
"was",
"added",
"."
] | train | https://github.com/goldmansachs/gs-collections/blob/fa8bf3e103689efa18bca2ab70203e71cde34b52/collections/src/main/java/com/gs/collections/impl/utility/Iterate.java#L1124-L1137 |
geomajas/geomajas-project-client-gwt2 | impl/src/main/java/org/geomajas/gwt2/client/service/JsonService.java | JsonService.getCharValue | public static Character getCharValue(JSONObject jsonObject, String key) throws JSONException {
"""
Get a character value from a {@link JSONObject}.
@param jsonObject The object to get the key value from.
@param key The name of the key to search the value for.
@return Returns the value for the key in the objec... | java | public static Character getCharValue(JSONObject jsonObject, String key) throws JSONException {
String stringValue = getStringValue(jsonObject, key);
if (stringValue != null) {
return stringValue.charAt(0);
}
return null;
} | [
"public",
"static",
"Character",
"getCharValue",
"(",
"JSONObject",
"jsonObject",
",",
"String",
"key",
")",
"throws",
"JSONException",
"{",
"String",
"stringValue",
"=",
"getStringValue",
"(",
"jsonObject",
",",
"key",
")",
";",
"if",
"(",
"stringValue",
"!=",
... | Get a character value from a {@link JSONObject}.
@param jsonObject The object to get the key value from.
@param key The name of the key to search the value for.
@return Returns the value for the key in the object or null.
@throws JSONException Thrown in case the key could not be found in the JSON object. | [
"Get",
"a",
"character",
"value",
"from",
"a",
"{",
"@link",
"JSONObject",
"}",
"."
] | train | https://github.com/geomajas/geomajas-project-client-gwt2/blob/bd8d7904e861fa80522eed7b83c4ea99844180c7/impl/src/main/java/org/geomajas/gwt2/client/service/JsonService.java#L165-L171 |
aspectran/aspectran | core/src/main/java/com/aspectran/core/support/i18n/message/ResourceBundleMessageSource.java | ResourceBundleMessageSource.resolveCode | @Override
protected MessageFormat resolveCode(String code, Locale locale) {
"""
Resolves the given message code as key in the registered resource bundles,
using a cached MessageFormat instance per message code.
"""
MessageFormat messageFormat = null;
for (int i = 0; messageFormat == null &... | java | @Override
protected MessageFormat resolveCode(String code, Locale locale) {
MessageFormat messageFormat = null;
for (int i = 0; messageFormat == null && i < this.basenames.length; i++) {
ResourceBundle bundle = getResourceBundle(this.basenames[i], locale);
if (bundle != null)... | [
"@",
"Override",
"protected",
"MessageFormat",
"resolveCode",
"(",
"String",
"code",
",",
"Locale",
"locale",
")",
"{",
"MessageFormat",
"messageFormat",
"=",
"null",
";",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"messageFormat",
"==",
"null",
"&&",
"i",
"<"... | Resolves the given message code as key in the registered resource bundles,
using a cached MessageFormat instance per message code. | [
"Resolves",
"the",
"given",
"message",
"code",
"as",
"key",
"in",
"the",
"registered",
"resource",
"bundles",
"using",
"a",
"cached",
"MessageFormat",
"instance",
"per",
"message",
"code",
"."
] | train | https://github.com/aspectran/aspectran/blob/2d758a2a28b71ee85b42823c12dc44674d7f2c70/core/src/main/java/com/aspectran/core/support/i18n/message/ResourceBundleMessageSource.java#L228-L238 |
before/quality-check | modules/quality-check/src/main/java/net/sf/qualitycheck/Check.java | Check.notEmpty | @ArgumentsChecked
@Throws( {
"""
Ensures that an object reference passed as a parameter to the calling method is not empty. The passed boolean
value is the result of checking whether the reference is empty or not.
<p>
The following example describes how to use it.
<pre>
@ArgumentsChecked
public set... | java | @ArgumentsChecked
@Throws({ IllegalNullArgumentException.class, IllegalEmptyArgumentException.class })
public static <T> T notEmpty(@Nonnull final T reference, final boolean expression, @Nullable final String name) {
notNull(reference, name);
if (expression) {
throw new IllegalEmptyArgumentException(name);
}... | [
"@",
"ArgumentsChecked",
"@",
"Throws",
"(",
"{",
"IllegalNullArgumentException",
".",
"class",
",",
"IllegalEmptyArgumentException",
".",
"class",
"}",
")",
"public",
"static",
"<",
"T",
">",
"T",
"notEmpty",
"(",
"@",
"Nonnull",
"final",
"T",
"reference",
",... | Ensures that an object reference passed as a parameter to the calling method is not empty. The passed boolean
value is the result of checking whether the reference is empty or not.
<p>
The following example describes how to use it.
<pre>
@ArgumentsChecked
public setText(String text) {
Check.notEmpty(text, text.i... | [
"Ensures",
"that",
"an",
"object",
"reference",
"passed",
"as",
"a",
"parameter",
"to",
"the",
"calling",
"method",
"is",
"not",
"empty",
".",
"The",
"passed",
"boolean",
"value",
"is",
"the",
"result",
"of",
"checking",
"whether",
"the",
"reference",
"is",
... | train | https://github.com/before/quality-check/blob/a75c32c39434ddb1f89bece57acae0536724c15a/modules/quality-check/src/main/java/net/sf/qualitycheck/Check.java#L2058-L2066 |
lievendoclo/Valkyrie-RCP | valkyrie-rcp-core/src/main/java/org/valkyriercp/application/support/ApplicationLauncher.java | ApplicationLauncher.displaySplashScreen | private void displaySplashScreen(BeanFactory beanFactory) {
"""
Searches the given bean factory for a {@link SplashScreen} and displays it.
@param beanFactory The bean factory that is expected to contain the
splash screen bean definition. Must not be null.
@throws NullPointerException if {@code beanFactory}... | java | private void displaySplashScreen(BeanFactory beanFactory) {
this.splashScreen = beanFactory.getBean(SplashScreen.class);
logger.debug("Displaying application splash screen...");
try
{
SwingUtilities.invokeAndWait(new Runnable() {
public... | [
"private",
"void",
"displaySplashScreen",
"(",
"BeanFactory",
"beanFactory",
")",
"{",
"this",
".",
"splashScreen",
"=",
"beanFactory",
".",
"getBean",
"(",
"SplashScreen",
".",
"class",
")",
";",
"logger",
".",
"debug",
"(",
"\"Displaying application splash screen.... | Searches the given bean factory for a {@link SplashScreen} and displays it.
@param beanFactory The bean factory that is expected to contain the
splash screen bean definition. Must not be null.
@throws NullPointerException if {@code beanFactory} is null.
@throws org.springframework.beans.factory.BeanNotOfRequiredTypeE... | [
"Searches",
"the",
"given",
"bean",
"factory",
"for",
"a",
"{",
"@link",
"SplashScreen",
"}",
"and",
"displays",
"it",
"."
] | train | https://github.com/lievendoclo/Valkyrie-RCP/blob/6aad6e640b348cda8f3b0841f6e42025233f1eb8/valkyrie-rcp-core/src/main/java/org/valkyriercp/application/support/ApplicationLauncher.java#L345-L360 |
nats-io/java-nats-streaming | src/main/java/io/nats/streaming/StreamingConnectionFactory.java | StreamingConnectionFactory.setConnectTimeout | public void setConnectTimeout(long connectTimeout, TimeUnit unit) {
"""
Sets the connect timeout in the specified time unit.
@param connectTimeout the connectWait to set
@param unit the time unit to set
"""
this.connectTimeout = Duration.ofMillis(unit.toMillis(connectTimeout));
} | java | public void setConnectTimeout(long connectTimeout, TimeUnit unit) {
this.connectTimeout = Duration.ofMillis(unit.toMillis(connectTimeout));
} | [
"public",
"void",
"setConnectTimeout",
"(",
"long",
"connectTimeout",
",",
"TimeUnit",
"unit",
")",
"{",
"this",
".",
"connectTimeout",
"=",
"Duration",
".",
"ofMillis",
"(",
"unit",
".",
"toMillis",
"(",
"connectTimeout",
")",
")",
";",
"}"
] | Sets the connect timeout in the specified time unit.
@param connectTimeout the connectWait to set
@param unit the time unit to set | [
"Sets",
"the",
"connect",
"timeout",
"in",
"the",
"specified",
"time",
"unit",
"."
] | train | https://github.com/nats-io/java-nats-streaming/blob/72f964e9093622875d7f1c85ce60820e028863e7/src/main/java/io/nats/streaming/StreamingConnectionFactory.java#L125-L127 |
alkacon/opencms-core | src/org/opencms/workplace/galleries/CmsAjaxLinkGallery.java | CmsAjaxLinkGallery.buildJsonItemSpecificPart | @Override
protected void buildJsonItemSpecificPart(JSONObject jsonObj, CmsResource res, String sitePath) {
"""
Fills the JSON object with the specific information used for pointer file resource type.<p>
<ul>
<li><code>pointer</code>: the content of the pointer resource. This could be an external or interna... | java | @Override
protected void buildJsonItemSpecificPart(JSONObject jsonObj, CmsResource res, String sitePath) {
// file target
String pointer;
try {
pointer = new String(getCms().readFile(res).getContents());
if (CmsStringUtil.isEmptyOrWhitespaceOnly(pointer)) {
... | [
"@",
"Override",
"protected",
"void",
"buildJsonItemSpecificPart",
"(",
"JSONObject",
"jsonObj",
",",
"CmsResource",
"res",
",",
"String",
"sitePath",
")",
"{",
"// file target",
"String",
"pointer",
";",
"try",
"{",
"pointer",
"=",
"new",
"String",
"(",
"getCms... | Fills the JSON object with the specific information used for pointer file resource type.<p>
<ul>
<li><code>pointer</code>: the content of the pointer resource. This could be an external or internal link.</li>
</ul>
@see org.opencms.workplace.galleries.A_CmsAjaxGallery#buildJsonItemSpecificPart(JSONObject jsonObj, Cms... | [
"Fills",
"the",
"JSON",
"object",
"with",
"the",
"specific",
"information",
"used",
"for",
"pointer",
"file",
"resource",
"type",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/workplace/galleries/CmsAjaxLinkGallery.java#L158-L178 |
zackpollard/JavaTelegramBot-API | core/src/main/java/pro/zackpollard/telegrambot/api/utils/Utils.java | Utils.processInputFileField | public static void processInputFileField(MultipartBody request, String fieldName, InputFile inputFile) {
"""
Adds an input file to a request, with the given field name.
@param request The request to be added to.
@param fieldName The name of the field.
@param inputFile The input file.
"""
String fi... | java | public static void processInputFileField(MultipartBody request, String fieldName, InputFile inputFile) {
String fileId = inputFile.getFileID();
if (fileId != null) {
request.field(fieldName, fileId, false);
} else if (inputFile.getInputStream() != null) {
request.field(fi... | [
"public",
"static",
"void",
"processInputFileField",
"(",
"MultipartBody",
"request",
",",
"String",
"fieldName",
",",
"InputFile",
"inputFile",
")",
"{",
"String",
"fileId",
"=",
"inputFile",
".",
"getFileID",
"(",
")",
";",
"if",
"(",
"fileId",
"!=",
"null",... | Adds an input file to a request, with the given field name.
@param request The request to be added to.
@param fieldName The name of the field.
@param inputFile The input file. | [
"Adds",
"an",
"input",
"file",
"to",
"a",
"request",
"with",
"the",
"given",
"field",
"name",
"."
] | train | https://github.com/zackpollard/JavaTelegramBot-API/blob/9d100f351824042ca5fc0ea735d1fa376a13e81d/core/src/main/java/pro/zackpollard/telegrambot/api/utils/Utils.java#L166-L175 |
strator-dev/greenpepper | samples-application/src/main/java/com/greenpepper/samples/application/system/AccountManager.java | AccountManager.associateUserWithGroup | public boolean associateUserWithGroup(String user, String group) {
"""
<p>associateUserWithGroup.</p>
@param user a {@link java.lang.String} object.
@param group a {@link java.lang.String} object.
@return a boolean.
"""
if (!isUserExist(user))
{
throw new SystemException(String.format("User '%s' do... | java | public boolean associateUserWithGroup(String user, String group)
{
if (!isUserExist(user))
{
throw new SystemException(String.format("User '%s' does not exist.", user));
}
if (!isGroupExist(group))
{
throw new SystemException(String.format("Group '%s' does not exist.", group));
}
List<String> use... | [
"public",
"boolean",
"associateUserWithGroup",
"(",
"String",
"user",
",",
"String",
"group",
")",
"{",
"if",
"(",
"!",
"isUserExist",
"(",
"user",
")",
")",
"{",
"throw",
"new",
"SystemException",
"(",
"String",
".",
"format",
"(",
"\"User '%s' does not exist... | <p>associateUserWithGroup.</p>
@param user a {@link java.lang.String} object.
@param group a {@link java.lang.String} object.
@return a boolean. | [
"<p",
">",
"associateUserWithGroup",
".",
"<",
"/",
"p",
">"
] | train | https://github.com/strator-dev/greenpepper/blob/2a61e6c179b74085babcc559d677490b0cad2d30/samples-application/src/main/java/com/greenpepper/samples/application/system/AccountManager.java#L174-L202 |
Azure/azure-sdk-for-java | containerregistry/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2018_02_01_preview/implementation/BuildTasksInner.java | BuildTasksInner.beginDeleteAsync | public Observable<Void> beginDeleteAsync(String resourceGroupName, String registryName, String buildTaskName) {
"""
Deletes a specified build task.
@param resourceGroupName The name of the resource group to which the container registry belongs.
@param registryName The name of the container registry.
@param bu... | java | public Observable<Void> beginDeleteAsync(String resourceGroupName, String registryName, String buildTaskName) {
return beginDeleteWithServiceResponseAsync(resourceGroupName, registryName, buildTaskName).map(new Func1<ServiceResponse<Void>, Void>() {
@Override
public Void call(ServiceResp... | [
"public",
"Observable",
"<",
"Void",
">",
"beginDeleteAsync",
"(",
"String",
"resourceGroupName",
",",
"String",
"registryName",
",",
"String",
"buildTaskName",
")",
"{",
"return",
"beginDeleteWithServiceResponseAsync",
"(",
"resourceGroupName",
",",
"registryName",
","... | Deletes a specified build task.
@param resourceGroupName The name of the resource group to which the container registry belongs.
@param registryName The name of the container registry.
@param buildTaskName The name of the container registry build task.
@throws IllegalArgumentException thrown if parameters fail the val... | [
"Deletes",
"a",
"specified",
"build",
"task",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/containerregistry/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2018_02_01_preview/implementation/BuildTasksInner.java#L739-L746 |
UrielCh/ovh-java-sdk | ovh-java-sdk-packxdsl/src/main/java/net/minidev/ovh/api/ApiOvhPackxdsl.java | ApiOvhPackxdsl.packName_exchangeLite_services_POST | public OvhTask packName_exchangeLite_services_POST(String packName, Boolean antispam, String displayName, String email, String firstName, String initials, String lastName, String password) throws IOException {
"""
Activate a exchange lite service
REST: POST /pack/xdsl/{packName}/exchangeLite/services
@param in... | java | public OvhTask packName_exchangeLite_services_POST(String packName, Boolean antispam, String displayName, String email, String firstName, String initials, String lastName, String password) throws IOException {
String qPath = "/pack/xdsl/{packName}/exchangeLite/services";
StringBuilder sb = path(qPath, packName);
... | [
"public",
"OvhTask",
"packName_exchangeLite_services_POST",
"(",
"String",
"packName",
",",
"Boolean",
"antispam",
",",
"String",
"displayName",
",",
"String",
"email",
",",
"String",
"firstName",
",",
"String",
"initials",
",",
"String",
"lastName",
",",
"String",
... | Activate a exchange lite service
REST: POST /pack/xdsl/{packName}/exchangeLite/services
@param initials [required] Initials
@param antispam [required] [default=true] Antispam protection
@param firstName [required] First name
@param lastName [required] Last name
@param email [required] Email address
@param password [re... | [
"Activate",
"a",
"exchange",
"lite",
"service"
] | train | https://github.com/UrielCh/ovh-java-sdk/blob/6d531a40e56e09701943e334c25f90f640c55701/ovh-java-sdk-packxdsl/src/main/java/net/minidev/ovh/api/ApiOvhPackxdsl.java#L653-L666 |
the-fascinator/plugin-indexer-solr | src/main/java/com/googlecode/fascinator/indexer/SolrIndexer.java | SolrIndexer.initCore | private SolrServer initCore(String coreName) {
"""
Initialize a Solr core object.
@param coreName
: The core to initialize
@return SolrServer : The initialized core
"""
try {
String uri = config.getString(null, "indexer", coreName, "uri");
if (uri == null) {
log.error("No URI provided for core... | java | private SolrServer initCore(String coreName) {
try {
String uri = config.getString(null, "indexer", coreName, "uri");
if (uri == null) {
log.error("No URI provided for core: '{}'", coreName);
return null;
}
URI solrUri = new URI(uri);
CommonsHttpSolrServer thisCore = new CommonsHttpSolrServer(s... | [
"private",
"SolrServer",
"initCore",
"(",
"String",
"coreName",
")",
"{",
"try",
"{",
"String",
"uri",
"=",
"config",
".",
"getString",
"(",
"null",
",",
"\"indexer\"",
",",
"coreName",
",",
"\"uri\"",
")",
";",
"if",
"(",
"uri",
"==",
"null",
")",
"{"... | Initialize a Solr core object.
@param coreName
: The core to initialize
@return SolrServer : The initialized core | [
"Initialize",
"a",
"Solr",
"core",
"object",
"."
] | train | https://github.com/the-fascinator/plugin-indexer-solr/blob/001159b18b78a87daa5d8b2a17ced28694bae156/src/main/java/com/googlecode/fascinator/indexer/SolrIndexer.java#L395-L421 |
GCRC/nunaliit | nunaliit2-couch-client/src/main/java/ca/carleton/gcrc/couch/fsentry/FSEntryBuffer.java | FSEntryBuffer.getPositionedBuffer | static public FSEntry getPositionedBuffer(String path, byte[] content) throws Exception {
"""
Create a virtual tree hierarchy with a buffer supporting the leaf.
@param path Position of the buffer in the hierarchy, including its name
@param content The actual buffer backing the end leaf
@return The FSEntry root ... | java | static public FSEntry getPositionedBuffer(String path, byte[] content) throws Exception {
List<String> pathFrags = FSEntrySupport.interpretPath(path);
// Start at leaf and work our way back
int index = pathFrags.size() - 1;
FSEntry root = new FSEntryBuffer(pathFrags.get(index), content);
--index;
whil... | [
"static",
"public",
"FSEntry",
"getPositionedBuffer",
"(",
"String",
"path",
",",
"byte",
"[",
"]",
"content",
")",
"throws",
"Exception",
"{",
"List",
"<",
"String",
">",
"pathFrags",
"=",
"FSEntrySupport",
".",
"interpretPath",
"(",
"path",
")",
";",
"// S... | Create a virtual tree hierarchy with a buffer supporting the leaf.
@param path Position of the buffer in the hierarchy, including its name
@param content The actual buffer backing the end leaf
@return The FSEntry root for this hierarchy
@throws Exception Invalid parameter | [
"Create",
"a",
"virtual",
"tree",
"hierarchy",
"with",
"a",
"buffer",
"supporting",
"the",
"leaf",
"."
] | train | https://github.com/GCRC/nunaliit/blob/0b4abfc64eef2eb8b94f852ce697de2e851d8e67/nunaliit2-couch-client/src/main/java/ca/carleton/gcrc/couch/fsentry/FSEntryBuffer.java#L24-L40 |
mojohaus/jaxb2-maven-plugin | src/main/java/org/codehaus/mojo/jaxb2/shared/FileSystemUtilities.java | FileSystemUtilities.getExistingFile | public static File getExistingFile(final String path, final File baseDir) {
"""
<p>Retrieves the canonical File matching the supplied path in the following order or priority:</p>
<ol>
<li><strong>Absolute path:</strong> The path is used by itself (i.e. {@code new File(path);}). If an
existing file or directory ... | java | public static File getExistingFile(final String path, final File baseDir) {
// Check sanity
Validate.notEmpty(path, "path");
final File theFile = new File(path);
File toReturn = null;
// Is 'path' absolute?
if (theFile.isAbsolute() && (EXISTING_FILE.accept(theFile) || E... | [
"public",
"static",
"File",
"getExistingFile",
"(",
"final",
"String",
"path",
",",
"final",
"File",
"baseDir",
")",
"{",
"// Check sanity",
"Validate",
".",
"notEmpty",
"(",
"path",
",",
"\"path\"",
")",
";",
"final",
"File",
"theFile",
"=",
"new",
"File",
... | <p>Retrieves the canonical File matching the supplied path in the following order or priority:</p>
<ol>
<li><strong>Absolute path:</strong> The path is used by itself (i.e. {@code new File(path);}). If an
existing file or directory matches the provided path argument, its canonical path will be returned.</li>
<li><stron... | [
"<p",
">",
"Retrieves",
"the",
"canonical",
"File",
"matching",
"the",
"supplied",
"path",
"in",
"the",
"following",
"order",
"or",
"priority",
":",
"<",
"/",
"p",
">",
"<ol",
">",
"<li",
">",
"<strong",
">",
"Absolute",
"path",
":",
"<",
"/",
"strong"... | train | https://github.com/mojohaus/jaxb2-maven-plugin/blob/e3c4e47943b15282e5a6e850bbfb1588d8452a0a/src/main/java/org/codehaus/mojo/jaxb2/shared/FileSystemUtilities.java#L137-L163 |
Azure/azure-sdk-for-java | automation/resource-manager/v2015_10_31/src/main/java/com/microsoft/azure/management/automation/v2015_10_31/implementation/LinkedWorkspacesInner.java | LinkedWorkspacesInner.getAsync | public Observable<LinkedWorkspaceInner> getAsync(String resourceGroupName, String automationAccountName) {
"""
Retrieve the linked workspace for the account id.
@param resourceGroupName Name of an Azure Resource group.
@param automationAccountName The name of the automation account.
@throws IllegalArgumentExc... | java | public Observable<LinkedWorkspaceInner> getAsync(String resourceGroupName, String automationAccountName) {
return getWithServiceResponseAsync(resourceGroupName, automationAccountName).map(new Func1<ServiceResponse<LinkedWorkspaceInner>, LinkedWorkspaceInner>() {
@Override
public LinkedWo... | [
"public",
"Observable",
"<",
"LinkedWorkspaceInner",
">",
"getAsync",
"(",
"String",
"resourceGroupName",
",",
"String",
"automationAccountName",
")",
"{",
"return",
"getWithServiceResponseAsync",
"(",
"resourceGroupName",
",",
"automationAccountName",
")",
".",
"map",
... | Retrieve the linked workspace for the account id.
@param resourceGroupName Name of an Azure Resource group.
@param automationAccountName The name of the automation account.
@throws IllegalArgumentException thrown if parameters fail the validation
@return the observable to the LinkedWorkspaceInner object | [
"Retrieve",
"the",
"linked",
"workspace",
"for",
"the",
"account",
"id",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/automation/resource-manager/v2015_10_31/src/main/java/com/microsoft/azure/management/automation/v2015_10_31/implementation/LinkedWorkspacesInner.java#L95-L102 |
haraldk/TwelveMonkeys | sandbox/sandbox-common/src/main/java/com/twelvemonkeys/util/DebugUtil.java | DebugUtil.printClassDetails | public static void printClassDetails(final Object pObject, final String pObjectName, final PrintStream pPrintStream) {
"""
Prints javadoc-like, the top wrapped class fields and methods of a {@code java.lang.Object} to a {@code java.io.PrintStream}.
<p>
@param pObject the {@code java.lang.Object} to be analysed.
... | java | public static void printClassDetails(final Object pObject, final String pObjectName, final PrintStream pPrintStream) {
if (pPrintStream == null) {
System.err.println(PRINTSTREAM_IS_NULL_ERROR_MESSAGE);
return;
}
pPrintStream.println(getClassDetails(pObject, pObjectName));
} | [
"public",
"static",
"void",
"printClassDetails",
"(",
"final",
"Object",
"pObject",
",",
"final",
"String",
"pObjectName",
",",
"final",
"PrintStream",
"pPrintStream",
")",
"{",
"if",
"(",
"pPrintStream",
"==",
"null",
")",
"{",
"System",
".",
"err",
".",
"p... | Prints javadoc-like, the top wrapped class fields and methods of a {@code java.lang.Object} to a {@code java.io.PrintStream}.
<p>
@param pObject the {@code java.lang.Object} to be analysed.
@param pObjectName the name of the object instance, for identification purposes.
@param pPrintStream the {@code java.io.PrintStrea... | [
"Prints",
"javadoc",
"-",
"like",
"the",
"top",
"wrapped",
"class",
"fields",
"and",
"methods",
"of",
"a",
"{"
] | train | https://github.com/haraldk/TwelveMonkeys/blob/7fad4d5cd8cb3a6728c7fd3f28a7b84d8ce0101d/sandbox/sandbox-common/src/main/java/com/twelvemonkeys/util/DebugUtil.java#L1314-L1321 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.