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 |
|---|---|---|---|---|---|---|---|---|---|---|
igniterealtime/Smack | smack-extensions/src/main/java/org/jivesoftware/smackx/xhtmlim/XHTMLManager.java | XHTMLManager.isServiceEnabled | public static boolean isServiceEnabled(XMPPConnection connection, Jid userID)
throws NoResponseException, XMPPErrorException, NotConnectedException, InterruptedException {
"""
Returns true if the specified user handles XHTML messages.
@param connection the connection to use to perform the se... | java | public static boolean isServiceEnabled(XMPPConnection connection, Jid userID)
throws NoResponseException, XMPPErrorException, NotConnectedException, InterruptedException {
return ServiceDiscoveryManager.getInstanceFor(connection).supportsFeature(userID, XHTMLExtension.NAMESPACE);
} | [
"public",
"static",
"boolean",
"isServiceEnabled",
"(",
"XMPPConnection",
"connection",
",",
"Jid",
"userID",
")",
"throws",
"NoResponseException",
",",
"XMPPErrorException",
",",
"NotConnectedException",
",",
"InterruptedException",
"{",
"return",
"ServiceDiscoveryManager"... | Returns true if the specified user handles XHTML messages.
@param connection the connection to use to perform the service discovery
@param userID the user to check. A fully qualified xmpp ID, e.g. jdoe@example.com
@return a boolean indicating whether the specified user handles XHTML messages
@throws XMPPErrorException... | [
"Returns",
"true",
"if",
"the",
"specified",
"user",
"handles",
"XHTML",
"messages",
"."
] | train | https://github.com/igniterealtime/Smack/blob/870756997faec1e1bfabfac0cd6c2395b04da873/smack-extensions/src/main/java/org/jivesoftware/smackx/xhtmlim/XHTMLManager.java#L137-L140 |
awin/rabbiteasy | rabbiteasy-core/src/main/java/com/zanox/rabbiteasy/consumer/ConsumerContainer.java | ConsumerContainer.addConsumer | public void addConsumer(Consumer consumer, String queue, int instances) {
"""
<p>Adds a consumer to the container, binds it to the given queue with auto acknowledge disabled.
Does NOT enable the consumer to consume from the message broker until the container is started.</p>
<p>Registers the same consumer N tim... | java | public void addConsumer(Consumer consumer, String queue, int instances) {
addConsumer(consumer, new ConsumerConfiguration(queue), instances);
} | [
"public",
"void",
"addConsumer",
"(",
"Consumer",
"consumer",
",",
"String",
"queue",
",",
"int",
"instances",
")",
"{",
"addConsumer",
"(",
"consumer",
",",
"new",
"ConsumerConfiguration",
"(",
"queue",
")",
",",
"instances",
")",
";",
"}"
] | <p>Adds a consumer to the container, binds it to the given queue with auto acknowledge disabled.
Does NOT enable the consumer to consume from the message broker until the container is started.</p>
<p>Registers the same consumer N times at the queue according to the number of specified instances.
Use this for scaling y... | [
"<p",
">",
"Adds",
"a",
"consumer",
"to",
"the",
"container",
"binds",
"it",
"to",
"the",
"given",
"queue",
"with",
"auto",
"acknowledge",
"disabled",
".",
"Does",
"NOT",
"enable",
"the",
"consumer",
"to",
"consume",
"from",
"the",
"message",
"broker",
"un... | train | https://github.com/awin/rabbiteasy/blob/c161efda6c0f7ef319aedf09dfe40a4a90165510/rabbiteasy-core/src/main/java/com/zanox/rabbiteasy/consumer/ConsumerContainer.java#L104-L106 |
dadoonet/elasticsearch-beyonder | src/main/java/fr/pilato/elasticsearch/tools/index/IndexElasticsearchUpdater.java | IndexElasticsearchUpdater.createIndexWithSettingsInElasticsearch | @Deprecated
private static void createIndexWithSettingsInElasticsearch(Client client, String index, String settings) throws Exception {
"""
Create a new index in Elasticsearch
@param client Elasticsearch client
@param index Index name
@param settings Settings if any, null if no specific settings
@throws Excep... | java | @Deprecated
private static void createIndexWithSettingsInElasticsearch(Client client, String index, String settings) throws Exception {
logger.trace("createIndex([{}])", index);
assert client != null;
assert index != null;
CreateIndexRequestBuilder cirb = client.admin().indices().prepareCreate(index);
// ... | [
"@",
"Deprecated",
"private",
"static",
"void",
"createIndexWithSettingsInElasticsearch",
"(",
"Client",
"client",
",",
"String",
"index",
",",
"String",
"settings",
")",
"throws",
"Exception",
"{",
"logger",
".",
"trace",
"(",
"\"createIndex([{}])\"",
",",
"index",... | Create a new index in Elasticsearch
@param client Elasticsearch client
@param index Index name
@param settings Settings if any, null if no specific settings
@throws Exception if the elasticsearch API call is failing | [
"Create",
"a",
"new",
"index",
"in",
"Elasticsearch"
] | train | https://github.com/dadoonet/elasticsearch-beyonder/blob/275bf63432b97169a90a266e983143cca9ad7629/src/main/java/fr/pilato/elasticsearch/tools/index/IndexElasticsearchUpdater.java#L119-L141 |
killbilling/recurly-java-library | src/main/java/com/ning/billing/recurly/RecurlyClient.java | RecurlyClient.updateAccountAcquisition | public AccountAcquisition updateAccountAcquisition(final String accountCode, final AccountAcquisition acquisition) {
"""
Updates the acquisition details for an account
<p>
https://dev.recurly.com/docs/update-account-acquisition
@param accountCode The account's account code
@param acquisition The AccountAcqui... | java | public AccountAcquisition updateAccountAcquisition(final String accountCode, final AccountAcquisition acquisition) {
final String path = Account.ACCOUNT_RESOURCE + "/" + accountCode + AccountAcquisition.ACCOUNT_ACQUISITION_RESOURCE;
return doPUT(path, acquisition, AccountAcquisition.class);
} | [
"public",
"AccountAcquisition",
"updateAccountAcquisition",
"(",
"final",
"String",
"accountCode",
",",
"final",
"AccountAcquisition",
"acquisition",
")",
"{",
"final",
"String",
"path",
"=",
"Account",
".",
"ACCOUNT_RESOURCE",
"+",
"\"/\"",
"+",
"accountCode",
"+",
... | Updates the acquisition details for an account
<p>
https://dev.recurly.com/docs/update-account-acquisition
@param accountCode The account's account code
@param acquisition The AccountAcquisition data
@return The created AccountAcquisition object | [
"Updates",
"the",
"acquisition",
"details",
"for",
"an",
"account",
"<p",
">",
"https",
":",
"//",
"dev",
".",
"recurly",
".",
"com",
"/",
"docs",
"/",
"update",
"-",
"account",
"-",
"acquisition"
] | train | https://github.com/killbilling/recurly-java-library/blob/5e05eedd91885a51e1aa8293bd41139d082cf7f4/src/main/java/com/ning/billing/recurly/RecurlyClient.java#L1988-L1991 |
codecentric/zucchini | zucchini-web/src/main/java/de/codecentric/zucchini/web/util/WebAssert.java | WebAssert.findElementOrFail | public static WebElement findElementOrFail(WebDriver webDriver, By element) {
"""
Tries to find a specific element and fails if the element could not be found.
@param webDriver The web driver.
@param element The element.
@return The found element.
"""
try {
return webDriver.findElement(element);
... | java | public static WebElement findElementOrFail(WebDriver webDriver, By element) {
try {
return webDriver.findElement(element);
} catch (NoSuchElementException e) {
fail(String.format("Element %s should exist but it does not.", element.toString()), e);
}
/**
* Never reached since {@link de.codecentric.zucch... | [
"public",
"static",
"WebElement",
"findElementOrFail",
"(",
"WebDriver",
"webDriver",
",",
"By",
"element",
")",
"{",
"try",
"{",
"return",
"webDriver",
".",
"findElement",
"(",
"element",
")",
";",
"}",
"catch",
"(",
"NoSuchElementException",
"e",
")",
"{",
... | Tries to find a specific element and fails if the element could not be found.
@param webDriver The web driver.
@param element The element.
@return The found element. | [
"Tries",
"to",
"find",
"a",
"specific",
"element",
"and",
"fails",
"if",
"the",
"element",
"could",
"not",
"be",
"found",
"."
] | train | https://github.com/codecentric/zucchini/blob/61541cd8ce666ef21ad943486a7c0eb53310ed5a/zucchini-web/src/main/java/de/codecentric/zucchini/web/util/WebAssert.java#L37-L48 |
moparisthebest/beehive | beehive-netui-core/src/main/java/org/apache/beehive/netui/util/internal/DiscoveryUtils.java | DiscoveryUtils.loadImplementorClass | public static Class loadImplementorClass( String className, Class interfaceType ) {
"""
Load an implementor class from the context classloader.
@param className the name of the implementor class.
@param interfaceType the interface that the given class should implement.
@return the implementor Class, or <code>... | java | public static Class loadImplementorClass( String className, Class interfaceType )
{
return loadImplementorClass( className, interfaceType, getClassLoader() );
} | [
"public",
"static",
"Class",
"loadImplementorClass",
"(",
"String",
"className",
",",
"Class",
"interfaceType",
")",
"{",
"return",
"loadImplementorClass",
"(",
"className",
",",
"interfaceType",
",",
"getClassLoader",
"(",
")",
")",
";",
"}"
] | Load an implementor class from the context classloader.
@param className the name of the implementor class.
@param interfaceType the interface that the given class should implement.
@return the implementor Class, or <code>null</code> if an error occurred (the error will be logged). | [
"Load",
"an",
"implementor",
"class",
"from",
"the",
"context",
"classloader",
"."
] | train | https://github.com/moparisthebest/beehive/blob/4246a0cc40ce3c05f1a02c2da2653ac622703d77/beehive-netui-core/src/main/java/org/apache/beehive/netui/util/internal/DiscoveryUtils.java#L155-L158 |
versionone/VersionOne.SDK.Java.ObjectModel | src/main/java/com/versionone/om/BuildProject.java | BuildProject.createBuildRun | public BuildRun createBuildRun(String name, DateTime date) {
"""
Create a Build Run with the given name and date in this Build Project.
@param name of creating BuildRun.
@param date of creating BuildRun.
@return A new Build Run in this Build Project.
"""
return getInstance().create().buildRun(this... | java | public BuildRun createBuildRun(String name, DateTime date) {
return getInstance().create().buildRun(this, name, date);
} | [
"public",
"BuildRun",
"createBuildRun",
"(",
"String",
"name",
",",
"DateTime",
"date",
")",
"{",
"return",
"getInstance",
"(",
")",
".",
"create",
"(",
")",
".",
"buildRun",
"(",
"this",
",",
"name",
",",
"date",
")",
";",
"}"
] | Create a Build Run with the given name and date in this Build Project.
@param name of creating BuildRun.
@param date of creating BuildRun.
@return A new Build Run in this Build Project. | [
"Create",
"a",
"Build",
"Run",
"with",
"the",
"given",
"name",
"and",
"date",
"in",
"this",
"Build",
"Project",
"."
] | train | https://github.com/versionone/VersionOne.SDK.Java.ObjectModel/blob/59d35b67c849299631bca45ee94143237eb2ae1a/src/main/java/com/versionone/om/BuildProject.java#L70-L72 |
alkacon/opencms-core | src/org/opencms/ui/dialogs/availability/CmsAvailabilityDialog.java | CmsAvailabilityDialog.getAvailabilityInfo | CmsAvailabilityInfoBean getAvailabilityInfo(CmsObject cms, CmsResource res) throws CmsException {
"""
Returns the availability info.<p>
@param cms the cms context
@param res the resource
@return the info
@throws CmsException if reading the info fails
"""
CmsAvailabilityInfoBean result = new ... | java | CmsAvailabilityInfoBean getAvailabilityInfo(CmsObject cms, CmsResource res) throws CmsException {
CmsAvailabilityInfoBean result = new CmsAvailabilityInfoBean();
I_CmsResourceType type = OpenCms.getResourceManager().getResourceType(res.getTypeId());
result.setResType(type.getTypeName());
... | [
"CmsAvailabilityInfoBean",
"getAvailabilityInfo",
"(",
"CmsObject",
"cms",
",",
"CmsResource",
"res",
")",
"throws",
"CmsException",
"{",
"CmsAvailabilityInfoBean",
"result",
"=",
"new",
"CmsAvailabilityInfoBean",
"(",
")",
";",
"I_CmsResourceType",
"type",
"=",
"OpenCm... | Returns the availability info.<p>
@param cms the cms context
@param res the resource
@return the info
@throws CmsException if reading the info fails | [
"Returns",
"the",
"availability",
"info",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/ui/dialogs/availability/CmsAvailabilityDialog.java#L361-L391 |
derari/cthul | xml/src/main/java/org/cthul/resolve/ResolvingException.java | ResolvingException.againAs | public <T1 extends Throwable, T2 extends Throwable, T3 extends Throwable, T4 extends Throwable>
RuntimeException againAs(Class<T1> t1, Class<T2> t2, Class<T3> t3, Class<T4> t4)
throws T1, T2, T3, T4 {
"""
Throws the {@linkplain #getResolvingCause() cause} if it is one of the
sp... | java | public <T1 extends Throwable, T2 extends Throwable, T3 extends Throwable, T4 extends Throwable>
RuntimeException againAs(Class<T1> t1, Class<T2> t2, Class<T3> t3, Class<T4> t4)
throws T1, T2, T3, T4 {
return throwIf(t1, t2, t3, t4);
} | [
"public",
"<",
"T1",
"extends",
"Throwable",
",",
"T2",
"extends",
"Throwable",
",",
"T3",
"extends",
"Throwable",
",",
"T4",
"extends",
"Throwable",
">",
"RuntimeException",
"againAs",
"(",
"Class",
"<",
"T1",
">",
"t1",
",",
"Class",
"<",
"T2",
">",
"t... | Throws the {@linkplain #getResolvingCause() cause} if it is one of the
specified types, otherwise returns a
{@linkplain #asRuntimeException() runtime exception}.
<p>
Intended to be written as {@code throw e.againAs(IOException.class)}.
@param <T1>
@param <T2>
@param <T3>
@param <T4>
@param t1
@param t2
@param t3
@param... | [
"Throws",
"the",
"{"
] | train | https://github.com/derari/cthul/blob/74a31e3cb6a94f5f25cc5253d1dbd42e19a17ebc/xml/src/main/java/org/cthul/resolve/ResolvingException.java#L212-L216 |
Azure/azure-sdk-for-java | containerservice/resource-manager/v2017_08_31/src/main/java/com/microsoft/azure/management/containerservice/v2017_08_31/implementation/ManagedClustersInner.java | ManagedClustersInner.createOrUpdateAsync | public Observable<ManagedClusterInner> createOrUpdateAsync(String resourceGroupName, String resourceName, ManagedClusterInner parameters) {
"""
Creates or updates a managed cluster.
Creates or updates a managed cluster with the specified configuration for agents and Kubernetes version.
@param resourceGroupName... | java | public Observable<ManagedClusterInner> createOrUpdateAsync(String resourceGroupName, String resourceName, ManagedClusterInner parameters) {
return createOrUpdateWithServiceResponseAsync(resourceGroupName, resourceName, parameters).map(new Func1<ServiceResponse<ManagedClusterInner>, ManagedClusterInner>() {
... | [
"public",
"Observable",
"<",
"ManagedClusterInner",
">",
"createOrUpdateAsync",
"(",
"String",
"resourceGroupName",
",",
"String",
"resourceName",
",",
"ManagedClusterInner",
"parameters",
")",
"{",
"return",
"createOrUpdateWithServiceResponseAsync",
"(",
"resourceGroupName",... | Creates or updates a managed cluster.
Creates or updates a managed cluster with the specified configuration for agents and Kubernetes version.
@param resourceGroupName The name of the resource group.
@param resourceName The name of the managed cluster resource.
@param parameters Parameters supplied to the Create or Up... | [
"Creates",
"or",
"updates",
"a",
"managed",
"cluster",
".",
"Creates",
"or",
"updates",
"a",
"managed",
"cluster",
"with",
"the",
"specified",
"configuration",
"for",
"agents",
"and",
"Kubernetes",
"version",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/containerservice/resource-manager/v2017_08_31/src/main/java/com/microsoft/azure/management/containerservice/v2017_08_31/implementation/ManagedClustersInner.java#L663-L670 |
Axway/Grapes | server/src/main/java/org/axway/grapes/server/webapp/resources/OrganizationResource.java | OrganizationResource.addCorporateGroupIdPrefix | @POST
@Path("/ {
"""
Add a new Corporate GroupId to an organization.
@param credential DbCredential
@param organizationId String Organization name
@param corporateGroupId String
@return Response
"""name}" + ServerAPI.GET_CORPORATE_GROUPIDS)
public Response addCorporateGroupIdPrefix(@Auth final Db... | java | @POST
@Path("/{name}" + ServerAPI.GET_CORPORATE_GROUPIDS)
public Response addCorporateGroupIdPrefix(@Auth final DbCredential credential, @PathParam("name") final String organizationId, final String corporateGroupId){
LOG.info("Got an add a corporate groupId prefix request for organization " + organizati... | [
"@",
"POST",
"@",
"Path",
"(",
"\"/{name}\"",
"+",
"ServerAPI",
".",
"GET_CORPORATE_GROUPIDS",
")",
"public",
"Response",
"addCorporateGroupIdPrefix",
"(",
"@",
"Auth",
"final",
"DbCredential",
"credential",
",",
"@",
"PathParam",
"(",
"\"name\"",
")",
"final",
... | Add a new Corporate GroupId to an organization.
@param credential DbCredential
@param organizationId String Organization name
@param corporateGroupId String
@return Response | [
"Add",
"a",
"new",
"Corporate",
"GroupId",
"to",
"an",
"organization",
"."
] | train | https://github.com/Axway/Grapes/blob/ce9cc73d85f83eaa5fbc991abb593915a8c8374e/server/src/main/java/org/axway/grapes/server/webapp/resources/OrganizationResource.java#L149-L165 |
ahome-it/lienzo-core | src/main/java/com/ait/lienzo/client/core/shape/Shape.java | Shape.setOffset | @Override
public T setOffset(final double x, final double y) {
"""
Sets this shape's offset, at the given x and y coordinates.
@param x
@param y
@return T
"""
getAttributes().setOffset(x, y);
return cast();
} | java | @Override
public T setOffset(final double x, final double y)
{
getAttributes().setOffset(x, y);
return cast();
} | [
"@",
"Override",
"public",
"T",
"setOffset",
"(",
"final",
"double",
"x",
",",
"final",
"double",
"y",
")",
"{",
"getAttributes",
"(",
")",
".",
"setOffset",
"(",
"x",
",",
"y",
")",
";",
"return",
"cast",
"(",
")",
";",
"}"
] | Sets this shape's offset, at the given x and y coordinates.
@param x
@param y
@return T | [
"Sets",
"this",
"shape",
"s",
"offset",
"at",
"the",
"given",
"x",
"and",
"y",
"coordinates",
"."
] | train | https://github.com/ahome-it/lienzo-core/blob/8e03723700dec366f77064d12fb8676d8cd6be99/src/main/java/com/ait/lienzo/client/core/shape/Shape.java#L1297-L1303 |
banq/jdonframework | JdonAccessory/jdon-struts1x/src/main/java/com/jdon/strutsutil/util/EditeViewPageUtil.java | EditeViewPageUtil.getParamKeyValue | public Object getParamKeyValue(HttpServletRequest request, ModelHandler modelHandler) {
"""
获得参数key值 例如: /admin/productAction.do?action=edit&productId=1721
缺省:productId为product的modelmapping.xml中key定义值
对于如下调用: /admin/productAction.do?action=edit&userId=16
userId不是modelmapping.xml中key定义值,则需要override本方法,
@p... | java | public Object getParamKeyValue(HttpServletRequest request, ModelHandler modelHandler) {
Object keyValue = null;
try {
ModelMapping modelMapping = modelHandler.getModelMapping();
String keyName = modelMapping.getKeyName();
Debug.logVerbose("[JdonFramework] the keyName is " + keyName, module);
St... | [
"public",
"Object",
"getParamKeyValue",
"(",
"HttpServletRequest",
"request",
",",
"ModelHandler",
"modelHandler",
")",
"{",
"Object",
"keyValue",
"=",
"null",
";",
"try",
"{",
"ModelMapping",
"modelMapping",
"=",
"modelHandler",
".",
"getModelMapping",
"(",
")",
... | 获得参数key值 例如: /admin/productAction.do?action=edit&productId=1721
缺省:productId为product的modelmapping.xml中key定义值
对于如下调用: /admin/productAction.do?action=edit&userId=16
userId不是modelmapping.xml中key定义值,则需要override本方法,
@param actionMapping
@param request
@return 参数key值
@throws java.lang.Exception | [
"获得参数key值",
"例如:",
"/",
"admin",
"/",
"productAction",
".",
"do?action",
"=",
"edit&productId",
"=",
"1721",
"缺省",
":",
"productId为product的modelmapping",
".",
"xml中key定义值"
] | train | https://github.com/banq/jdonframework/blob/72b451caac04f775e57f52aaed3d8775044ead53/JdonAccessory/jdon-struts1x/src/main/java/com/jdon/strutsutil/util/EditeViewPageUtil.java#L148-L171 |
OpenLiberty/open-liberty | dev/com.ibm.ws.security/src/com/ibm/ws/security/AccessIdUtil.java | AccessIdUtil.getUniqueId | public static String getUniqueId(String accessId, String realm) {
"""
Given an accessId and realm name, extract the uniqueId.
@param accessId
@param realm
@return The uniqueId for the accessId, or {@code null} if the accessId is invalid
"""
if (realm != null) {
Pattern pattern = P... | java | public static String getUniqueId(String accessId, String realm) {
if (realm != null) {
Pattern pattern = Pattern.compile("([^:]+):(" + Pattern.quote(realm) + ")/(.*)");
Matcher m = pattern.matcher(accessId);
if (m.matches()) {
if (m.group(3).length() > 0)... | [
"public",
"static",
"String",
"getUniqueId",
"(",
"String",
"accessId",
",",
"String",
"realm",
")",
"{",
"if",
"(",
"realm",
"!=",
"null",
")",
"{",
"Pattern",
"pattern",
"=",
"Pattern",
".",
"compile",
"(",
"\"([^:]+):(\"",
"+",
"Pattern",
".",
"quote",
... | Given an accessId and realm name, extract the uniqueId.
@param accessId
@param realm
@return The uniqueId for the accessId, or {@code null} if the accessId is invalid | [
"Given",
"an",
"accessId",
"and",
"realm",
"name",
"extract",
"the",
"uniqueId",
"."
] | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.security/src/com/ibm/ws/security/AccessIdUtil.java#L190-L203 |
killbilling/recurly-java-library | src/main/java/com/ning/billing/recurly/RecurlyClient.java | RecurlyClient.updateSubscriptionNotes | public Subscription updateSubscriptionNotes(final String uuid, final SubscriptionNotes subscriptionNotes) {
"""
Update to a particular {@link Subscription}'s notes by it's UUID
<p>
Returns information about a single subscription.
@param uuid UUID of the subscription to preview an update for
@param subscripti... | java | public Subscription updateSubscriptionNotes(final String uuid, final SubscriptionNotes subscriptionNotes) {
return doPUT(SubscriptionNotes.SUBSCRIPTION_RESOURCE + "/" + uuid + "/notes",
subscriptionNotes, Subscription.class);
} | [
"public",
"Subscription",
"updateSubscriptionNotes",
"(",
"final",
"String",
"uuid",
",",
"final",
"SubscriptionNotes",
"subscriptionNotes",
")",
"{",
"return",
"doPUT",
"(",
"SubscriptionNotes",
".",
"SUBSCRIPTION_RESOURCE",
"+",
"\"/\"",
"+",
"uuid",
"+",
"\"/notes\... | Update to a particular {@link Subscription}'s notes by it's UUID
<p>
Returns information about a single subscription.
@param uuid UUID of the subscription to preview an update for
@param subscriptionNotes SubscriptionNotes object
@return Subscription the updated subscription | [
"Update",
"to",
"a",
"particular",
"{",
"@link",
"Subscription",
"}",
"s",
"notes",
"by",
"it",
"s",
"UUID",
"<p",
">",
"Returns",
"information",
"about",
"a",
"single",
"subscription",
"."
] | train | https://github.com/killbilling/recurly-java-library/blob/5e05eedd91885a51e1aa8293bd41139d082cf7f4/src/main/java/com/ning/billing/recurly/RecurlyClient.java#L620-L623 |
samskivert/samskivert | src/main/java/com/samskivert/util/Runnables.java | Runnables.asRunnable | public static Runnable asRunnable (Class<?> clazz, String methodName) {
"""
Creates a runnable that invokes the specified static method via reflection.
<p> NOTE: if you specify a protected or private method this method will call {@link
Method#setAccessible} to make the method accessible. If you're writing secu... | java | public static Runnable asRunnable (Class<?> clazz, String methodName)
{
Method method = findMethod(clazz, methodName);
if (!Modifier.isStatic(method.getModifiers())) {
throw new IllegalArgumentException(
clazz.getName() + "." + methodName + "() must be static");
}... | [
"public",
"static",
"Runnable",
"asRunnable",
"(",
"Class",
"<",
"?",
">",
"clazz",
",",
"String",
"methodName",
")",
"{",
"Method",
"method",
"=",
"findMethod",
"(",
"clazz",
",",
"methodName",
")",
";",
"if",
"(",
"!",
"Modifier",
".",
"isStatic",
"(",... | Creates a runnable that invokes the specified static method via reflection.
<p> NOTE: if you specify a protected or private method this method will call {@link
Method#setAccessible} to make the method accessible. If you're writing secure code or need
to run in a sandbox, don't use this functionality.
@throws IllegalA... | [
"Creates",
"a",
"runnable",
"that",
"invokes",
"the",
"specified",
"static",
"method",
"via",
"reflection",
"."
] | train | https://github.com/samskivert/samskivert/blob/a64d9ef42b69819bdb2c66bddac6a64caef928b6/src/main/java/com/samskivert/util/Runnables.java#L58-L66 |
bitcoinj/bitcoinj | core/src/main/java/org/bitcoinj/core/Base58.java | Base58.divmod | private static byte divmod(byte[] number, int firstDigit, int base, int divisor) {
"""
Divides a number, represented as an array of bytes each containing a single digit
in the specified base, by the given divisor. The given number is modified in-place
to contain the quotient, and the return value is the remainde... | java | private static byte divmod(byte[] number, int firstDigit, int base, int divisor) {
// this is just long division which accounts for the base of the input digits
int remainder = 0;
for (int i = firstDigit; i < number.length; i++) {
int digit = (int) number[i] & 0xFF;
int t... | [
"private",
"static",
"byte",
"divmod",
"(",
"byte",
"[",
"]",
"number",
",",
"int",
"firstDigit",
",",
"int",
"base",
",",
"int",
"divisor",
")",
"{",
"// this is just long division which accounts for the base of the input digits",
"int",
"remainder",
"=",
"0",
";",... | Divides a number, represented as an array of bytes each containing a single digit
in the specified base, by the given divisor. The given number is modified in-place
to contain the quotient, and the return value is the remainder.
@param number the number to divide
@param firstDigit the index within the array of the fir... | [
"Divides",
"a",
"number",
"represented",
"as",
"an",
"array",
"of",
"bytes",
"each",
"containing",
"a",
"single",
"digit",
"in",
"the",
"specified",
"base",
"by",
"the",
"given",
"divisor",
".",
"The",
"given",
"number",
"is",
"modified",
"in",
"-",
"place... | train | https://github.com/bitcoinj/bitcoinj/blob/9cf13d29315014ed59cf4fc5944e5f227e8df9a6/core/src/main/java/org/bitcoinj/core/Base58.java#L194-L204 |
OpenLiberty/open-liberty | dev/com.ibm.websphere.security/src/com/ibm/websphere/security/audit/AuditEvent.java | AuditEvent.setInitiator | public void setInitiator(Map<String, Object> initiator) {
"""
Set the initiator keys/values. The provided Map will completely replace
the existing initiator, i.e. all current initiator keys/values will be
removed and the new initiator keys/values will be added.
@param initiator - Map of all the initiator keys... | java | public void setInitiator(Map<String, Object> initiator) {
removeEntriesStartingWith(INITIATOR);
eventMap.putAll(initiator);
} | [
"public",
"void",
"setInitiator",
"(",
"Map",
"<",
"String",
",",
"Object",
">",
"initiator",
")",
"{",
"removeEntriesStartingWith",
"(",
"INITIATOR",
")",
";",
"eventMap",
".",
"putAll",
"(",
"initiator",
")",
";",
"}"
] | Set the initiator keys/values. The provided Map will completely replace
the existing initiator, i.e. all current initiator keys/values will be
removed and the new initiator keys/values will be added.
@param initiator - Map of all the initiator keys/values | [
"Set",
"the",
"initiator",
"keys",
"/",
"values",
".",
"The",
"provided",
"Map",
"will",
"completely",
"replace",
"the",
"existing",
"initiator",
"i",
".",
"e",
".",
"all",
"current",
"initiator",
"keys",
"/",
"values",
"will",
"be",
"removed",
"and",
"the... | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.websphere.security/src/com/ibm/websphere/security/audit/AuditEvent.java#L287-L290 |
Netflix/eureka | eureka-client/src/main/java/com/netflix/discovery/DiscoveryManager.java | DiscoveryManager.initComponent | public void initComponent(EurekaInstanceConfig config,
EurekaClientConfig eurekaConfig, AbstractDiscoveryClientOptionalArgs args) {
"""
Initializes the <tt>Discovery Client</tt> with the given configuration.
@param config
the instance info configuration that will be used for
regi... | java | public void initComponent(EurekaInstanceConfig config,
EurekaClientConfig eurekaConfig, AbstractDiscoveryClientOptionalArgs args) {
this.eurekaInstanceConfig = config;
this.eurekaClientConfig = eurekaConfig;
if (ApplicationInfoManager.getInstance().getInfo() == null... | [
"public",
"void",
"initComponent",
"(",
"EurekaInstanceConfig",
"config",
",",
"EurekaClientConfig",
"eurekaConfig",
",",
"AbstractDiscoveryClientOptionalArgs",
"args",
")",
"{",
"this",
".",
"eurekaInstanceConfig",
"=",
"config",
";",
"this",
".",
"eurekaClientConfig",
... | Initializes the <tt>Discovery Client</tt> with the given configuration.
@param config
the instance info configuration that will be used for
registration with Eureka.
@param eurekaConfig the eureka client configuration of the instance. | [
"Initializes",
"the",
"<tt",
">",
"Discovery",
"Client<",
"/",
"tt",
">",
"with",
"the",
"given",
"configuration",
"."
] | train | https://github.com/Netflix/eureka/blob/48446d956be09df6650a3c00b7ebd7e2d1e1544f/eureka-client/src/main/java/com/netflix/discovery/DiscoveryManager.java#L77-L87 |
exKAZUu/GameAIArena | src/main/java/net/exkazuu/gameaiarena/api/Point2.java | Point2.getPoints | public static ArrayList<Point2> getPoints(int startX, int startY, int endX, int endY) {
"""
指定された範囲内に存在するすべてのPointのリストを返します。
@param startX x座標の開始位置
@param startY y座標の開始位置
@param endX x座標の終端位置(含まれない)
@param endY y座標の終端位置(含まれない)
@return 指定された範囲内に存在するすべてのPointのリスト
"""
final ArrayList<Point2> result = n... | java | public static ArrayList<Point2> getPoints(int startX, int startY, int endX, int endY) {
final ArrayList<Point2> result = new ArrayList<Point2>();
for (int y = startY; y < endY; y++) {
for (int x = startX; x < endX; x++) {
result.add(new Point2(x, y));
}
}
return result;
} | [
"public",
"static",
"ArrayList",
"<",
"Point2",
">",
"getPoints",
"(",
"int",
"startX",
",",
"int",
"startY",
",",
"int",
"endX",
",",
"int",
"endY",
")",
"{",
"final",
"ArrayList",
"<",
"Point2",
">",
"result",
"=",
"new",
"ArrayList",
"<",
"Point2",
... | 指定された範囲内に存在するすべてのPointのリストを返します。
@param startX x座標の開始位置
@param startY y座標の開始位置
@param endX x座標の終端位置(含まれない)
@param endY y座標の終端位置(含まれない)
@return 指定された範囲内に存在するすべてのPointのリスト | [
"指定された範囲内に存在するすべてのPointのリストを返します。"
] | train | https://github.com/exKAZUu/GameAIArena/blob/66894c251569fb763174654d6c262c5176dfcf48/src/main/java/net/exkazuu/gameaiarena/api/Point2.java#L37-L45 |
sniggle/simple-pgp | simple-pgp-java/src/main/java/me/sniggle/pgp/crypt/internal/BasePGPCommon.java | BasePGPCommon.readPublicKeyRing | protected PGPPublicKeyRing readPublicKeyRing(InputStream publicKey) {
"""
reads the public key ring from the input stream
@param publicKey
the public key stream
@return the public key ring
"""
LOGGER.trace("readPublicKeyRing(InputStream)");
PGPPublicKeyRing result = null;
LOGGER.debug("Wrappin... | java | protected PGPPublicKeyRing readPublicKeyRing(InputStream publicKey) {
LOGGER.trace("readPublicKeyRing(InputStream)");
PGPPublicKeyRing result = null;
LOGGER.debug("Wrapping public key stream in decoder stream");
try( InputStream decoderStream = PGPUtil.getDecoderStream(publicKey) ) {
LOGGER.debug(... | [
"protected",
"PGPPublicKeyRing",
"readPublicKeyRing",
"(",
"InputStream",
"publicKey",
")",
"{",
"LOGGER",
".",
"trace",
"(",
"\"readPublicKeyRing(InputStream)\"",
")",
";",
"PGPPublicKeyRing",
"result",
"=",
"null",
";",
"LOGGER",
".",
"debug",
"(",
"\"Wrapping publi... | reads the public key ring from the input stream
@param publicKey
the public key stream
@return the public key ring | [
"reads",
"the",
"public",
"key",
"ring",
"from",
"the",
"input",
"stream"
] | train | https://github.com/sniggle/simple-pgp/blob/2ab83e4d370b8189f767d8e4e4c7e6020e60fbe3/simple-pgp-java/src/main/java/me/sniggle/pgp/crypt/internal/BasePGPCommon.java#L322-L341 |
landawn/AbacusUtil | src/com/landawn/abacus/spring/SQLExecutor.java | SQLExecutor.beginTransaction | @Deprecated
@Override
public SQLTransaction beginTransaction(IsolationLevel isolationLevel, boolean forUpdateOnly) {
"""
The connection opened in the transaction will be automatically closed after the transaction is committed or rolled back.
DON'T close it again by calling the close method.
@param is... | java | @Deprecated
@Override
public SQLTransaction beginTransaction(IsolationLevel isolationLevel, boolean forUpdateOnly) {
return super.beginTransaction(isolationLevel, forUpdateOnly);
} | [
"@",
"Deprecated",
"@",
"Override",
"public",
"SQLTransaction",
"beginTransaction",
"(",
"IsolationLevel",
"isolationLevel",
",",
"boolean",
"forUpdateOnly",
")",
"{",
"return",
"super",
".",
"beginTransaction",
"(",
"isolationLevel",
",",
"forUpdateOnly",
")",
";",
... | The connection opened in the transaction will be automatically closed after the transaction is committed or rolled back.
DON'T close it again by calling the close method.
@param isolationLevel
@param forUpdateOnly
@return
@deprecated | [
"The",
"connection",
"opened",
"in",
"the",
"transaction",
"will",
"be",
"automatically",
"closed",
"after",
"the",
"transaction",
"is",
"committed",
"or",
"rolled",
"back",
".",
"DON",
"T",
"close",
"it",
"again",
"by",
"calling",
"the",
"close",
"method",
... | train | https://github.com/landawn/AbacusUtil/blob/544b7720175d15e9329f83dd22a8cc5fa4515e12/src/com/landawn/abacus/spring/SQLExecutor.java#L118-L122 |
Javacord/Javacord | javacord-core/src/main/java/org/javacord/core/entity/server/ServerImpl.java | ServerImpl.getOrCreateServerTextChannel | public ServerTextChannel getOrCreateServerTextChannel(JsonNode data) {
"""
Gets or creates a server text channel.
@param data The json data of the channel.
@return The server text channel.
"""
long id = Long.parseLong(data.get("id").asText());
ChannelType type = ChannelType.fromId(data.get(... | java | public ServerTextChannel getOrCreateServerTextChannel(JsonNode data) {
long id = Long.parseLong(data.get("id").asText());
ChannelType type = ChannelType.fromId(data.get("type").asInt());
synchronized (this) {
// TODO Treat news channels differently
if (type == ChannelType... | [
"public",
"ServerTextChannel",
"getOrCreateServerTextChannel",
"(",
"JsonNode",
"data",
")",
"{",
"long",
"id",
"=",
"Long",
".",
"parseLong",
"(",
"data",
".",
"get",
"(",
"\"id\"",
")",
".",
"asText",
"(",
")",
")",
";",
"ChannelType",
"type",
"=",
"Chan... | Gets or creates a server text channel.
@param data The json data of the channel.
@return The server text channel. | [
"Gets",
"or",
"creates",
"a",
"server",
"text",
"channel",
"."
] | train | https://github.com/Javacord/Javacord/blob/915aad084dc5e863284267529d0dccd625fc6886/javacord-core/src/main/java/org/javacord/core/entity/server/ServerImpl.java#L618-L629 |
auth0/Auth0.Android | auth0/src/main/java/com/auth0/android/authentication/AuthenticationAPIClient.java | AuthenticationAPIClient.loginWithOAuthAccessToken | @SuppressWarnings("WeakerAccess")
public AuthenticationRequest loginWithOAuthAccessToken(@NonNull String token, @NonNull String connection) {
"""
Log in a user with a OAuth 'access_token' of a Identity Provider like Facebook or Twitter using <a href="https://auth0.com/docs/api/authentication#social-with-provid... | java | @SuppressWarnings("WeakerAccess")
public AuthenticationRequest loginWithOAuthAccessToken(@NonNull String token, @NonNull String connection) {
HttpUrl url = HttpUrl.parse(auth0.getDomainUrl()).newBuilder()
.addPathSegment(OAUTH_PATH)
.addPathSegment(ACCESS_TOKEN_PATH)
... | [
"@",
"SuppressWarnings",
"(",
"\"WeakerAccess\"",
")",
"public",
"AuthenticationRequest",
"loginWithOAuthAccessToken",
"(",
"@",
"NonNull",
"String",
"token",
",",
"@",
"NonNull",
"String",
"connection",
")",
"{",
"HttpUrl",
"url",
"=",
"HttpUrl",
".",
"parse",
"(... | Log in a user with a OAuth 'access_token' of a Identity Provider like Facebook or Twitter using <a href="https://auth0.com/docs/api/authentication#social-with-provider-s-access-token">'\oauth\access_token' endpoint</a>
The default scope used is 'openid'.
Example usage:
<pre>
{@code
client.loginWithOAuthAccessToken("{to... | [
"Log",
"in",
"a",
"user",
"with",
"a",
"OAuth",
"access_token",
"of",
"a",
"Identity",
"Provider",
"like",
"Facebook",
"or",
"Twitter",
"using",
"<a",
"href",
"=",
"https",
":",
"//",
"auth0",
".",
"com",
"/",
"docs",
"/",
"api",
"/",
"authentication#soc... | train | https://github.com/auth0/Auth0.Android/blob/ee37b7f94d989c1fbab2cb1378c87fdcaf7a8156/auth0/src/main/java/com/auth0/android/authentication/AuthenticationAPIClient.java#L300-L315 |
xmlet/XsdAsmFaster | src/main/java/org/xmlet/xsdasmfaster/classes/XsdAsmInterfaces.java | XsdAsmInterfaces.groupMethod | private InterfaceInfo groupMethod(String groupName, XsdChoice choiceElement, XsdAll allElement, XsdSequence sequenceElement, String className, int interfaceIndex, String apiName) {
"""
Delegates the interface generation to one of the possible {@link XsdGroup} element children.
@param groupName The group name of t... | java | private InterfaceInfo groupMethod(String groupName, XsdChoice choiceElement, XsdAll allElement, XsdSequence sequenceElement, String className, int interfaceIndex, String apiName){
if (allElement != null) {
return iterativeCreation(allElement, className, interfaceIndex + 1, apiName, groupName).get(0)... | [
"private",
"InterfaceInfo",
"groupMethod",
"(",
"String",
"groupName",
",",
"XsdChoice",
"choiceElement",
",",
"XsdAll",
"allElement",
",",
"XsdSequence",
"sequenceElement",
",",
"String",
"className",
",",
"int",
"interfaceIndex",
",",
"String",
"apiName",
")",
"{"... | Delegates the interface generation to one of the possible {@link XsdGroup} element children.
@param groupName The group name of the {@link XsdGroup} element.
@param choiceElement The child {@link XsdChoice}.
@param allElement The child {@link XsdAll}.
@param sequenceElement The child {@link XsdSequence}.
@param classNa... | [
"Delegates",
"the",
"interface",
"generation",
"to",
"one",
"of",
"the",
"possible",
"{"
] | train | https://github.com/xmlet/XsdAsmFaster/blob/ccb78f9dd4b957ad5ac1ca349eaf24338c421e94/src/main/java/org/xmlet/xsdasmfaster/classes/XsdAsmInterfaces.java#L346-L360 |
Red5/red5-server-common | src/main/java/org/red5/server/net/servlet/ServletUtils.java | ServletUtils.copy | public static void copy(HttpServletRequest req, OutputStream output) throws IOException {
"""
Copies information from the http request to the output stream using the specified content length.
@param req
Request
@param output
Output stream
@throws java.io.IOException
on error
"""
InputStream in... | java | public static void copy(HttpServletRequest req, OutputStream output) throws IOException {
InputStream input = req.getInputStream();
int availableBytes = req.getContentLength();
log.debug("copy - available: {}", availableBytes);
if (availableBytes > 0) {
byte[] buf = new ... | [
"public",
"static",
"void",
"copy",
"(",
"HttpServletRequest",
"req",
",",
"OutputStream",
"output",
")",
"throws",
"IOException",
"{",
"InputStream",
"input",
"=",
"req",
".",
"getInputStream",
"(",
")",
";",
"int",
"availableBytes",
"=",
"req",
".",
"getCont... | Copies information from the http request to the output stream using the specified content length.
@param req
Request
@param output
Output stream
@throws java.io.IOException
on error | [
"Copies",
"information",
"from",
"the",
"http",
"request",
"to",
"the",
"output",
"stream",
"using",
"the",
"specified",
"content",
"length",
"."
] | train | https://github.com/Red5/red5-server-common/blob/39ae73710c25bda86d70b13ef37ae707962217b9/src/main/java/org/red5/server/net/servlet/ServletUtils.java#L110-L126 |
BigBadaboom/androidsvg | androidsvg/src/main/java/com/caverock/androidsvg/SVGParser.java | SVGParser.parseLength | static Length parseLength(String val) throws SVGParseException {
"""
/*
Parse an SVG 'Length' value (usually a coordinate).
Spec says: length ::= number ("em" | "ex" | "px" | "in" | "cm" | "mm" | "pt" | "pc" | "%")?
"""
if (val.length() == 0)
throw new SVGParseException("Invalid length valu... | java | static Length parseLength(String val) throws SVGParseException
{
if (val.length() == 0)
throw new SVGParseException("Invalid length value (empty string)");
int end = val.length();
Unit unit = Unit.px;
char lastChar = val.charAt(end-1);
if (lastChar == '%') {
... | [
"static",
"Length",
"parseLength",
"(",
"String",
"val",
")",
"throws",
"SVGParseException",
"{",
"if",
"(",
"val",
".",
"length",
"(",
")",
"==",
"0",
")",
"throw",
"new",
"SVGParseException",
"(",
"\"Invalid length value (empty string)\"",
")",
";",
"int",
"... | /*
Parse an SVG 'Length' value (usually a coordinate).
Spec says: length ::= number ("em" | "ex" | "px" | "in" | "cm" | "mm" | "pt" | "pc" | "%")? | [
"/",
"*",
"Parse",
"an",
"SVG",
"Length",
"value",
"(",
"usually",
"a",
"coordinate",
")",
".",
"Spec",
"says",
":",
"length",
"::",
"=",
"number",
"(",
"em",
"|",
"ex",
"|",
"px",
"|",
"in",
"|",
"cm",
"|",
"mm",
"|",
"pt",
"|",
"pc",
"|",
"... | train | https://github.com/BigBadaboom/androidsvg/blob/0d1614dd1a4da10ea4afe3b0cea1361a4ac6b45a/androidsvg/src/main/java/com/caverock/androidsvg/SVGParser.java#L3421-L3450 |
Azure/azure-sdk-for-java | batch/data-plane/src/main/java/com/microsoft/azure/batch/protocol/implementation/CertificatesImpl.java | CertificatesImpl.deleteAsync | public Observable<Void> deleteAsync(String thumbprintAlgorithm, String thumbprint) {
"""
Deletes a certificate from the specified account.
You cannot delete a certificate if a resource (pool or compute node) is using it. Before you can delete a certificate, you must therefore make sure that the certificate is not... | java | public Observable<Void> deleteAsync(String thumbprintAlgorithm, String thumbprint) {
return deleteWithServiceResponseAsync(thumbprintAlgorithm, thumbprint).map(new Func1<ServiceResponseWithHeaders<Void, CertificateDeleteHeaders>, Void>() {
@Override
public Void call(ServiceResponseWithHe... | [
"public",
"Observable",
"<",
"Void",
">",
"deleteAsync",
"(",
"String",
"thumbprintAlgorithm",
",",
"String",
"thumbprint",
")",
"{",
"return",
"deleteWithServiceResponseAsync",
"(",
"thumbprintAlgorithm",
",",
"thumbprint",
")",
".",
"map",
"(",
"new",
"Func1",
"... | Deletes a certificate from the specified account.
You cannot delete a certificate if a resource (pool or compute node) is using it. Before you can delete a certificate, you must therefore make sure that the certificate is not associated with any existing pools, the certificate is not installed on any compute nodes (eve... | [
"Deletes",
"a",
"certificate",
"from",
"the",
"specified",
"account",
".",
"You",
"cannot",
"delete",
"a",
"certificate",
"if",
"a",
"resource",
"(",
"pool",
"or",
"compute",
"node",
")",
"is",
"using",
"it",
".",
"Before",
"you",
"can",
"delete",
"a",
"... | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/batch/data-plane/src/main/java/com/microsoft/azure/batch/protocol/implementation/CertificatesImpl.java#L816-L823 |
cdapio/tigon | tigon-yarn/src/main/java/co/cask/tigon/conf/Configuration.java | Configuration.getFloat | public float getFloat(String name, float defaultValue) {
"""
Get the value of the <code>name</code> property as a <code>float</code>.
If no such property exists, the provided default value is returned,
or if the specified value is not a valid <code>float</code>,
then an error is thrown.
@param name property ... | java | public float getFloat(String name, float defaultValue) {
String valueString = getTrimmed(name);
if (valueString == null) {
return defaultValue;
}
return Float.parseFloat(valueString);
} | [
"public",
"float",
"getFloat",
"(",
"String",
"name",
",",
"float",
"defaultValue",
")",
"{",
"String",
"valueString",
"=",
"getTrimmed",
"(",
"name",
")",
";",
"if",
"(",
"valueString",
"==",
"null",
")",
"{",
"return",
"defaultValue",
";",
"}",
"return",... | Get the value of the <code>name</code> property as a <code>float</code>.
If no such property exists, the provided default value is returned,
or if the specified value is not a valid <code>float</code>,
then an error is thrown.
@param name property name.
@param defaultValue default value.
@throws NumberFormatException ... | [
"Get",
"the",
"value",
"of",
"the",
"<code",
">",
"name<",
"/",
"code",
">",
"property",
"as",
"a",
"<code",
">",
"float<",
"/",
"code",
">",
".",
"If",
"no",
"such",
"property",
"exists",
"the",
"provided",
"default",
"value",
"is",
"returned",
"or",
... | train | https://github.com/cdapio/tigon/blob/5be6dffd7c79519d1211bb08f75be7dcfbbad392/tigon-yarn/src/main/java/co/cask/tigon/conf/Configuration.java#L805-L811 |
looly/hutool | hutool-poi/src/main/java/cn/hutool/poi/excel/cell/CellUtil.java | CellUtil.getCellValue | public static Object getCellValue(Cell cell, boolean isTrimCellValue) {
"""
获取单元格值
@param cell {@link Cell}单元格
@param isTrimCellValue 如果单元格类型为字符串,是否去掉两边空白符
@return 值,类型可能为:Date、Double、Boolean、String
"""
if (null == cell) {
return null;
}
return getCellValue(cell, cell.getCellTypeEnum(), isTri... | java | public static Object getCellValue(Cell cell, boolean isTrimCellValue) {
if (null == cell) {
return null;
}
return getCellValue(cell, cell.getCellTypeEnum(), isTrimCellValue);
} | [
"public",
"static",
"Object",
"getCellValue",
"(",
"Cell",
"cell",
",",
"boolean",
"isTrimCellValue",
")",
"{",
"if",
"(",
"null",
"==",
"cell",
")",
"{",
"return",
"null",
";",
"}",
"return",
"getCellValue",
"(",
"cell",
",",
"cell",
".",
"getCellTypeEnum... | 获取单元格值
@param cell {@link Cell}单元格
@param isTrimCellValue 如果单元格类型为字符串,是否去掉两边空白符
@return 值,类型可能为:Date、Double、Boolean、String | [
"获取单元格值"
] | train | https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-poi/src/main/java/cn/hutool/poi/excel/cell/CellUtil.java#L36-L41 |
timtiemens/secretshare | src/main/java/com/tiemens/secretshare/engine/SecretShare.java | SecretShare.combineParanoid | public ParanoidOutput combineParanoid(List<ShareInfo> shares,
ParanoidInput paranoidInput) {
"""
This version does the combines, and throws an exception if there is not 100% agreement.
@param shares - all shares available to make unique subsets from
@param paranoidInpu... | java | public ParanoidOutput combineParanoid(List<ShareInfo> shares,
ParanoidInput paranoidInput)
{
ParanoidOutput ret = performParanoidCombines(shares, paranoidInput);
if (paranoidInput != null)
{
if (ret.getReconstructedMap().size() != 1)
... | [
"public",
"ParanoidOutput",
"combineParanoid",
"(",
"List",
"<",
"ShareInfo",
">",
"shares",
",",
"ParanoidInput",
"paranoidInput",
")",
"{",
"ParanoidOutput",
"ret",
"=",
"performParanoidCombines",
"(",
"shares",
",",
"paranoidInput",
")",
";",
"if",
"(",
"parano... | This version does the combines, and throws an exception if there is not 100% agreement.
@param shares - all shares available to make unique subsets from
@param paranoidInput control over the process
@return ParanoidOutput
@throws SecretShareException if there is not 100% agreement on the reconstructed secret | [
"This",
"version",
"does",
"the",
"combines",
"and",
"throws",
"an",
"exception",
"if",
"there",
"is",
"not",
"100%",
"agreement",
"."
] | train | https://github.com/timtiemens/secretshare/blob/f5f88929af99ae0ed0df02dc802e40cdb25fceac/src/main/java/com/tiemens/secretshare/engine/SecretShare.java#L1142-L1156 |
zaproxy/zaproxy | src/org/zaproxy/zap/spider/parser/SpiderParser.java | SpiderParser.notifyListenersResourceFound | protected void notifyListenersResourceFound(HttpMessage message, int depth, String uri) {
"""
Notify the listeners that a resource was found.
@param message the http message containing the response.
@param depth the depth of this resource in the crawling tree
@param uri the uri
"""
for (SpiderParserList... | java | protected void notifyListenersResourceFound(HttpMessage message, int depth, String uri) {
for (SpiderParserListener l : listeners) {
l.resourceURIFound(message, depth, uri);
}
} | [
"protected",
"void",
"notifyListenersResourceFound",
"(",
"HttpMessage",
"message",
",",
"int",
"depth",
",",
"String",
"uri",
")",
"{",
"for",
"(",
"SpiderParserListener",
"l",
":",
"listeners",
")",
"{",
"l",
".",
"resourceURIFound",
"(",
"message",
",",
"de... | Notify the listeners that a resource was found.
@param message the http message containing the response.
@param depth the depth of this resource in the crawling tree
@param uri the uri | [
"Notify",
"the",
"listeners",
"that",
"a",
"resource",
"was",
"found",
"."
] | train | https://github.com/zaproxy/zaproxy/blob/0cbe5121f2ae1ecca222513d182759210c569bec/src/org/zaproxy/zap/spider/parser/SpiderParser.java#L67-L71 |
Azure/azure-sdk-for-java | redis/resource-manager/v2017_10_01/src/main/java/com/microsoft/azure/management/redis/v2017_10_01/implementation/FirewallRulesInner.java | FirewallRulesInner.getAsync | public Observable<RedisFirewallRuleInner> getAsync(String resourceGroupName, String cacheName, String ruleName) {
"""
Gets a single firewall rule in a specified redis cache.
@param resourceGroupName The name of the resource group.
@param cacheName The name of the Redis cache.
@param ruleName The name of the f... | java | public Observable<RedisFirewallRuleInner> getAsync(String resourceGroupName, String cacheName, String ruleName) {
return getWithServiceResponseAsync(resourceGroupName, cacheName, ruleName).map(new Func1<ServiceResponse<RedisFirewallRuleInner>, RedisFirewallRuleInner>() {
@Override
public... | [
"public",
"Observable",
"<",
"RedisFirewallRuleInner",
">",
"getAsync",
"(",
"String",
"resourceGroupName",
",",
"String",
"cacheName",
",",
"String",
"ruleName",
")",
"{",
"return",
"getWithServiceResponseAsync",
"(",
"resourceGroupName",
",",
"cacheName",
",",
"rule... | Gets a single firewall rule in a specified redis cache.
@param resourceGroupName The name of the resource group.
@param cacheName The name of the Redis cache.
@param ruleName The name of the firewall rule.
@throws IllegalArgumentException thrown if parameters fail the validation
@return the observable to the RedisFire... | [
"Gets",
"a",
"single",
"firewall",
"rule",
"in",
"a",
"specified",
"redis",
"cache",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/redis/resource-manager/v2017_10_01/src/main/java/com/microsoft/azure/management/redis/v2017_10_01/implementation/FirewallRulesInner.java#L350-L357 |
census-instrumentation/opencensus-java | exporters/trace/zipkin/src/main/java/io/opencensus/exporter/trace/zipkin/ZipkinTraceExporter.java | ZipkinTraceExporter.createAndRegister | public static void createAndRegister(String v2Url, String serviceName) {
"""
Creates and registers the Zipkin Trace exporter to the OpenCensus library. Only one Zipkin
exporter can be registered at any point.
@param v2Url Ex http://127.0.0.1:9411/api/v2/spans
@param serviceName the {@link Span#localServiceNam... | java | public static void createAndRegister(String v2Url, String serviceName) {
createAndRegister(SpanBytesEncoder.JSON_V2, URLConnectionSender.create(v2Url), serviceName);
} | [
"public",
"static",
"void",
"createAndRegister",
"(",
"String",
"v2Url",
",",
"String",
"serviceName",
")",
"{",
"createAndRegister",
"(",
"SpanBytesEncoder",
".",
"JSON_V2",
",",
"URLConnectionSender",
".",
"create",
"(",
"v2Url",
")",
",",
"serviceName",
")",
... | Creates and registers the Zipkin Trace exporter to the OpenCensus library. Only one Zipkin
exporter can be registered at any point.
@param v2Url Ex http://127.0.0.1:9411/api/v2/spans
@param serviceName the {@link Span#localServiceName() local service name} of the process.
@throws IllegalStateException if a Zipkin expo... | [
"Creates",
"and",
"registers",
"the",
"Zipkin",
"Trace",
"exporter",
"to",
"the",
"OpenCensus",
"library",
".",
"Only",
"one",
"Zipkin",
"exporter",
"can",
"be",
"registered",
"at",
"any",
"point",
"."
] | train | https://github.com/census-instrumentation/opencensus-java/blob/deefac9bed77e40a2297bff1ca5ec5aa48a5f755/exporters/trace/zipkin/src/main/java/io/opencensus/exporter/trace/zipkin/ZipkinTraceExporter.java#L66-L68 |
rhuss/jolokia | agent/core/src/main/java/org/jolokia/converter/json/BeanExtractor.java | BeanExtractor.addAttributes | @SuppressWarnings("PMD.UnnecessaryCaseChange")
private void addAttributes(List<String> pAttrs, Method pMethod) {
"""
Add attributes, which are taken from get methods to the given list
"""
String name = pMethod.getName();
for (String pref : GETTER_PREFIX) {
if (name.startsWith(pr... | java | @SuppressWarnings("PMD.UnnecessaryCaseChange")
private void addAttributes(List<String> pAttrs, Method pMethod) {
String name = pMethod.getName();
for (String pref : GETTER_PREFIX) {
if (name.startsWith(pref) && name.length() > pref.length()
&& pMethod.getParameterType... | [
"@",
"SuppressWarnings",
"(",
"\"PMD.UnnecessaryCaseChange\"",
")",
"private",
"void",
"addAttributes",
"(",
"List",
"<",
"String",
">",
"pAttrs",
",",
"Method",
"pMethod",
")",
"{",
"String",
"name",
"=",
"pMethod",
".",
"getName",
"(",
")",
";",
"for",
"("... | Add attributes, which are taken from get methods to the given list | [
"Add",
"attributes",
"which",
"are",
"taken",
"from",
"get",
"methods",
"to",
"the",
"given",
"list"
] | train | https://github.com/rhuss/jolokia/blob/dc95e7bef859b1829776c5a84c8f7738f5d7d9c3/agent/core/src/main/java/org/jolokia/converter/json/BeanExtractor.java#L228-L245 |
joniles/mpxj | src/main/java/net/sf/mpxj/json/JsonWriter.java | JsonWriter.writePriorityField | private void writePriorityField(String fieldName, Object value) throws IOException {
"""
Write a priority field to the JSON file.
@param fieldName field name
@param value field value
"""
m_writer.writeNameValuePair(fieldName, ((Priority) value).getValue());
} | java | private void writePriorityField(String fieldName, Object value) throws IOException
{
m_writer.writeNameValuePair(fieldName, ((Priority) value).getValue());
} | [
"private",
"void",
"writePriorityField",
"(",
"String",
"fieldName",
",",
"Object",
"value",
")",
"throws",
"IOException",
"{",
"m_writer",
".",
"writeNameValuePair",
"(",
"fieldName",
",",
"(",
"(",
"Priority",
")",
"value",
")",
".",
"getValue",
"(",
")",
... | Write a priority field to the JSON file.
@param fieldName field name
@param value field value | [
"Write",
"a",
"priority",
"field",
"to",
"the",
"JSON",
"file",
"."
] | train | https://github.com/joniles/mpxj/blob/143ea0e195da59cd108f13b3b06328e9542337e8/src/main/java/net/sf/mpxj/json/JsonWriter.java#L473-L476 |
liferay/com-liferay-commerce | commerce-service/src/main/java/com/liferay/commerce/service/persistence/impl/CommerceOrderPersistenceImpl.java | CommerceOrderPersistenceImpl.fetchByC_ERC | @Override
public CommerceOrder fetchByC_ERC(long companyId,
String externalReferenceCode) {
"""
Returns the commerce order where companyId = ? and externalReferenceCode = ? or returns <code>null</code> if it could not be found. Uses the finder cache.
@param companyId the company ID
@param externalRe... | java | @Override
public CommerceOrder fetchByC_ERC(long companyId,
String externalReferenceCode) {
return fetchByC_ERC(companyId, externalReferenceCode, true);
} | [
"@",
"Override",
"public",
"CommerceOrder",
"fetchByC_ERC",
"(",
"long",
"companyId",
",",
"String",
"externalReferenceCode",
")",
"{",
"return",
"fetchByC_ERC",
"(",
"companyId",
",",
"externalReferenceCode",
",",
"true",
")",
";",
"}"
] | Returns the commerce order where companyId = ? and externalReferenceCode = ? or returns <code>null</code> if it could not be found. Uses the finder cache.
@param companyId the company ID
@param externalReferenceCode the external reference code
@return the matching commerce order, or <code>null</code> if a matc... | [
"Returns",
"the",
"commerce",
"order",
"where",
"companyId",
"=",
"?",
";",
"and",
"externalReferenceCode",
"=",
"?",
";",
"or",
"returns",
"<code",
">",
"null<",
"/",
"code",
">",
"if",
"it",
"could",
"not",
"be",
"found",
".",
"Uses",
"the",
"fin... | train | https://github.com/liferay/com-liferay-commerce/blob/9e54362d7f59531fc684016ba49ee7cdc3a2f22b/commerce-service/src/main/java/com/liferay/commerce/service/persistence/impl/CommerceOrderPersistenceImpl.java#L5912-L5916 |
codeprimate-software/cp-elements | src/main/java/org/cp/elements/lang/reflect/ReflectionUtils.java | ReflectionUtils.setField | @SuppressWarnings("all")
public static void setField(Object target, Field field, Object value) {
"""
Sets the field on the given object to the given value. If the "target" object is null, then this method assumes
the field is a static (class) member field; otherwise the field is considered an instance (object) ... | java | @SuppressWarnings("all")
public static void setField(Object target, Field field, Object value) {
try {
Assert.isFalse(Modifier.isFinal(field.getModifiers()), new FieldAccessException(String.format(
"Cannot set the value of a final field (%1$s) on %2$s type (%3$s)!", field.getName(),
Boolea... | [
"@",
"SuppressWarnings",
"(",
"\"all\"",
")",
"public",
"static",
"void",
"setField",
"(",
"Object",
"target",
",",
"Field",
"field",
",",
"Object",
"value",
")",
"{",
"try",
"{",
"Assert",
".",
"isFalse",
"(",
"Modifier",
".",
"isFinal",
"(",
"field",
"... | Sets the field on the given object to the given value. If the "target" object is null, then this method assumes
the field is a static (class) member field; otherwise the field is considered an instance (object) member field.
This method is not null-safe!
@param target the Object on which the field is defined.
@param f... | [
"Sets",
"the",
"field",
"on",
"the",
"given",
"object",
"to",
"the",
"given",
"value",
".",
"If",
"the",
"target",
"object",
"is",
"null",
"then",
"this",
"method",
"assumes",
"the",
"field",
"is",
"a",
"static",
"(",
"class",
")",
"member",
"field",
"... | train | https://github.com/codeprimate-software/cp-elements/blob/f2163c149fbbef05015e688132064ebcac7c49ab/src/main/java/org/cp/elements/lang/reflect/ReflectionUtils.java#L225-L249 |
line/armeria | core/src/main/java/com/linecorp/armeria/common/metric/DropwizardMeterRegistries.java | DropwizardMeterRegistries.newRegistry | public static DropwizardMeterRegistry newRegistry(MetricRegistry registry,
HierarchicalNameMapper nameMapper) {
"""
Returns a newly-created {@link DropwizardMeterRegistry} instance with the specified
{@link MetricRegistry} and {@link HierarchicalNameMapper}.
... | java | public static DropwizardMeterRegistry newRegistry(MetricRegistry registry,
HierarchicalNameMapper nameMapper) {
return newRegistry(registry, nameMapper, Clock.SYSTEM);
} | [
"public",
"static",
"DropwizardMeterRegistry",
"newRegistry",
"(",
"MetricRegistry",
"registry",
",",
"HierarchicalNameMapper",
"nameMapper",
")",
"{",
"return",
"newRegistry",
"(",
"registry",
",",
"nameMapper",
",",
"Clock",
".",
"SYSTEM",
")",
";",
"}"
] | Returns a newly-created {@link DropwizardMeterRegistry} instance with the specified
{@link MetricRegistry} and {@link HierarchicalNameMapper}. | [
"Returns",
"a",
"newly",
"-",
"created",
"{"
] | train | https://github.com/line/armeria/blob/67d29e019fd35a35f89c45cc8f9119ff9b12b44d/core/src/main/java/com/linecorp/armeria/common/metric/DropwizardMeterRegistries.java#L107-L110 |
elki-project/elki | elki-clustering/src/main/java/de/lmu/ifi/dbs/elki/algorithm/clustering/kmeans/quality/BayesianInformationCriterionZhao.java | BayesianInformationCriterionZhao.logLikelihoodZhao | public static <V extends NumberVector> double logLikelihoodZhao(Relation<V> relation, Clustering<? extends MeanModel> clustering, NumberVectorDistanceFunction<? super V> distanceFunction) {
"""
Computes log likelihood of an entire clustering.
<p>
Version as used by Zhao et al.
@param relation Data relation
@... | java | public static <V extends NumberVector> double logLikelihoodZhao(Relation<V> relation, Clustering<? extends MeanModel> clustering, NumberVectorDistanceFunction<? super V> distanceFunction) {
List<? extends Cluster<? extends MeanModel>> clusters = clustering.getAllClusters();
// number of clusters
final int m... | [
"public",
"static",
"<",
"V",
"extends",
"NumberVector",
">",
"double",
"logLikelihoodZhao",
"(",
"Relation",
"<",
"V",
">",
"relation",
",",
"Clustering",
"<",
"?",
"extends",
"MeanModel",
">",
"clustering",
",",
"NumberVectorDistanceFunction",
"<",
"?",
"super... | Computes log likelihood of an entire clustering.
<p>
Version as used by Zhao et al.
@param relation Data relation
@param clustering Clustering
@param distanceFunction Distance function
@param <V> Vector type
@return Log Likelihood. | [
"Computes",
"log",
"likelihood",
"of",
"an",
"entire",
"clustering",
".",
"<p",
">",
"Version",
"as",
"used",
"by",
"Zhao",
"et",
"al",
"."
] | train | https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-clustering/src/main/java/de/lmu/ifi/dbs/elki/algorithm/clustering/kmeans/quality/BayesianInformationCriterionZhao.java#L73-L107 |
james-hu/jabb-core | src/main/java/net/sf/jabb/util/db/dao/AbstractHibernateDao.java | AbstractHibernateDao.getAllBySql | public List< T> getAllBySql(String fullSql, Integer offset, Integer limit) {
"""
Get all by SQL with specific offset and limit
@param fullSql
@param offset the number of first record in the whole query result to be returned, records numbers start from 0
@param limit the maximum number of records to return
@... | java | public List< T> getAllBySql(String fullSql, Integer offset, Integer limit) {
return getAllBySql(fullSql, null, null, offset, limit);
} | [
"public",
"List",
"<",
"T",
">",
"getAllBySql",
"(",
"String",
"fullSql",
",",
"Integer",
"offset",
",",
"Integer",
"limit",
")",
"{",
"return",
"getAllBySql",
"(",
"fullSql",
",",
"null",
",",
"null",
",",
"offset",
",",
"limit",
")",
";",
"}"
] | Get all by SQL with specific offset and limit
@param fullSql
@param offset the number of first record in the whole query result to be returned, records numbers start from 0
@param limit the maximum number of records to return
@return the query result | [
"Get",
"all",
"by",
"SQL",
"with",
"specific",
"offset",
"and",
"limit"
] | train | https://github.com/james-hu/jabb-core/blob/bceed441595c5e5195a7418795f03b69fa7b61e4/src/main/java/net/sf/jabb/util/db/dao/AbstractHibernateDao.java#L232-L234 |
RKumsher/utils | src/main/java/com/github/rkumsher/number/RandomNumberUtils.java | RandomNumberUtils.randomDouble | public static double randomDouble(double startInclusive, double endExclusive) {
"""
Returns a random double within the specified range.
@param startInclusive the earliest double that can be returned
@param endExclusive the upper bound (not included)
@return the random double
@throws IllegalArgumentException ... | java | public static double randomDouble(double startInclusive, double endExclusive) {
checkArgument(startInclusive <= endExclusive, "End must be greater than or equal to start");
if (startInclusive == endExclusive) {
return startInclusive;
}
return RANDOM.doubles(1, startInclusive, endExclusive).sum();
... | [
"public",
"static",
"double",
"randomDouble",
"(",
"double",
"startInclusive",
",",
"double",
"endExclusive",
")",
"{",
"checkArgument",
"(",
"startInclusive",
"<=",
"endExclusive",
",",
"\"End must be greater than or equal to start\"",
")",
";",
"if",
"(",
"startInclus... | Returns a random double within the specified range.
@param startInclusive the earliest double that can be returned
@param endExclusive the upper bound (not included)
@return the random double
@throws IllegalArgumentException if endExclusive is less than startInclusive | [
"Returns",
"a",
"random",
"double",
"within",
"the",
"specified",
"range",
"."
] | train | https://github.com/RKumsher/utils/blob/fcdb190569cd0288249bf4b46fd418f8c01d1caf/src/main/java/com/github/rkumsher/number/RandomNumberUtils.java#L194-L200 |
khuxtable/seaglass | src/main/java/com/seaglasslookandfeel/painter/TitlePaneMenuButtonPainter.java | TitlePaneMenuButtonPainter.paintPressed | private void paintPressed(Graphics2D g, JComponent c, int width, int height) {
"""
Paint the background pressed state.
@param g the Graphics2D context to paint with.
@param c the component.
@param width the width of the component.
@param height the height of the component.
"""
paintMen... | java | private void paintPressed(Graphics2D g, JComponent c, int width, int height) {
paintMenu(g, c, width, height, pressed);
} | [
"private",
"void",
"paintPressed",
"(",
"Graphics2D",
"g",
",",
"JComponent",
"c",
",",
"int",
"width",
",",
"int",
"height",
")",
"{",
"paintMenu",
"(",
"g",
",",
"c",
",",
"width",
",",
"height",
",",
"pressed",
")",
";",
"}"
] | Paint the background pressed state.
@param g the Graphics2D context to paint with.
@param c the component.
@param width the width of the component.
@param height the height of the component. | [
"Paint",
"the",
"background",
"pressed",
"state",
"."
] | train | https://github.com/khuxtable/seaglass/blob/f25ecba622923d7b29b64cb7d6068dd8005989b3/src/main/java/com/seaglasslookandfeel/painter/TitlePaneMenuButtonPainter.java#L134-L136 |
Jasig/uPortal | uPortal-core/src/main/java/org/apereo/portal/security/provider/PersonImpl.java | PersonImpl.setAttributes | @Override
public void setAttributes(final Map<String, List<Object>> attrs) {
"""
Sets the specified attributes. Uses {@link #setAttribute(String, Object)} to set each.
@see IPerson#setAttributes(java.util.Map)
"""
for (final Entry<String, List<Object>> attrEntry : attrs.entrySet()) {
... | java | @Override
public void setAttributes(final Map<String, List<Object>> attrs) {
for (final Entry<String, List<Object>> attrEntry : attrs.entrySet()) {
final String key = attrEntry.getKey();
final List<Object> value = attrEntry.getValue();
setAttribute(key, value);
}
... | [
"@",
"Override",
"public",
"void",
"setAttributes",
"(",
"final",
"Map",
"<",
"String",
",",
"List",
"<",
"Object",
">",
">",
"attrs",
")",
"{",
"for",
"(",
"final",
"Entry",
"<",
"String",
",",
"List",
"<",
"Object",
">",
">",
"attrEntry",
":",
"att... | Sets the specified attributes. Uses {@link #setAttribute(String, Object)} to set each.
@see IPerson#setAttributes(java.util.Map) | [
"Sets",
"the",
"specified",
"attributes",
".",
"Uses",
"{",
"@link",
"#setAttribute",
"(",
"String",
"Object",
")",
"}",
"to",
"set",
"each",
"."
] | train | https://github.com/Jasig/uPortal/blob/c1986542abb9acd214268f2df21c6305ad2f262b/uPortal-core/src/main/java/org/apereo/portal/security/provider/PersonImpl.java#L146-L159 |
alkacon/opencms-core | src/org/opencms/jsp/CmsJspTagEdit.java | CmsJspTagEdit.getNewLink | public static String getNewLink(CmsObject cms, I_CmsResourceType resType, String creationSitemap) {
"""
Creates the String specifying where which type of resource has to be created.<p>
@param cms the CMS context
@param resType the resource type to create
@param creationSitemap the creation sitemap parameter
... | java | public static String getNewLink(CmsObject cms, I_CmsResourceType resType, String creationSitemap) {
String contextPath = getContextRootPath(cms, creationSitemap);
StringBuffer newLink = new StringBuffer(NEW_LINK_IDENTIFIER);
newLink.append('|');
newLink.append(contextPath);
newL... | [
"public",
"static",
"String",
"getNewLink",
"(",
"CmsObject",
"cms",
",",
"I_CmsResourceType",
"resType",
",",
"String",
"creationSitemap",
")",
"{",
"String",
"contextPath",
"=",
"getContextRootPath",
"(",
"cms",
",",
"creationSitemap",
")",
";",
"StringBuffer",
... | Creates the String specifying where which type of resource has to be created.<p>
@param cms the CMS context
@param resType the resource type to create
@param creationSitemap the creation sitemap parameter
@return The String identifying which type of resource has to be created where.<p>
@see #createResource(CmsObject... | [
"Creates",
"the",
"String",
"specifying",
"where",
"which",
"type",
"of",
"resource",
"has",
"to",
"be",
"created",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/jsp/CmsJspTagEdit.java#L159-L169 |
box/box-java-sdk | src/main/java/com/box/sdk/BoxCollaboration.java | BoxCollaboration.getPendingCollaborations | public static Collection<Info> getPendingCollaborations(BoxAPIConnection api) {
"""
Gets all pending collaboration invites for the current user.
@param api the API connection to use.
@return a collection of pending collaboration infos.
"""
URL url = PENDING_COLLABORATIONS_URL.build(api.getBaseURL()... | java | public static Collection<Info> getPendingCollaborations(BoxAPIConnection api) {
URL url = PENDING_COLLABORATIONS_URL.build(api.getBaseURL());
BoxAPIRequest request = new BoxAPIRequest(api, url, "GET");
BoxJSONResponse response = (BoxJSONResponse) request.send();
JsonObject responseJSON ... | [
"public",
"static",
"Collection",
"<",
"Info",
">",
"getPendingCollaborations",
"(",
"BoxAPIConnection",
"api",
")",
"{",
"URL",
"url",
"=",
"PENDING_COLLABORATIONS_URL",
".",
"build",
"(",
"api",
".",
"getBaseURL",
"(",
")",
")",
";",
"BoxAPIRequest",
"request"... | Gets all pending collaboration invites for the current user.
@param api the API connection to use.
@return a collection of pending collaboration infos. | [
"Gets",
"all",
"pending",
"collaboration",
"invites",
"for",
"the",
"current",
"user",
"."
] | train | https://github.com/box/box-java-sdk/blob/35b4ba69417f9d6a002c19dfaab57527750ef349/src/main/java/com/box/sdk/BoxCollaboration.java#L107-L125 |
phax/ph-commons | ph-json/src/main/java/com/helger/json/serialize/JsonReader.java | JsonReader.isValidJson | public static boolean isValidJson (@Nonnull final IHasInputStream aISP, @Nonnull final Charset aFallbackCharset) {
"""
Check if the passed input stream can be resembled to valid Json content.
This is accomplished by fully parsing the Json file each time the method is
called. This consumes <b>less memory</b> than... | java | public static boolean isValidJson (@Nonnull final IHasInputStream aISP, @Nonnull final Charset aFallbackCharset)
{
ValueEnforcer.notNull (aISP, "InputStreamProvider");
ValueEnforcer.notNull (aFallbackCharset, "FallbackCharset");
final InputStream aIS = aISP.getInputStream ();
if (aIS == null)
{
... | [
"public",
"static",
"boolean",
"isValidJson",
"(",
"@",
"Nonnull",
"final",
"IHasInputStream",
"aISP",
",",
"@",
"Nonnull",
"final",
"Charset",
"aFallbackCharset",
")",
"{",
"ValueEnforcer",
".",
"notNull",
"(",
"aISP",
",",
"\"InputStreamProvider\"",
")",
";",
... | Check if the passed input stream can be resembled to valid Json content.
This is accomplished by fully parsing the Json file each time the method is
called. This consumes <b>less memory</b> than calling any of the
<code>read...</code> methods and checking for a non-<code>null</code>
result.
@param aISP
The resource to... | [
"Check",
"if",
"the",
"passed",
"input",
"stream",
"can",
"be",
"resembled",
"to",
"valid",
"Json",
"content",
".",
"This",
"is",
"accomplished",
"by",
"fully",
"parsing",
"the",
"Json",
"file",
"each",
"time",
"the",
"method",
"is",
"called",
".",
"This",... | train | https://github.com/phax/ph-commons/blob/d28c03565f44a0b804d96028d0969f9bb38c4313/ph-json/src/main/java/com/helger/json/serialize/JsonReader.java#L295-L308 |
Azure/azure-sdk-for-java | cognitiveservices/data-plane/vision/faceapi/src/main/java/com/microsoft/azure/cognitiveservices/vision/faceapi/implementation/PersonGroupPersonsImpl.java | PersonGroupPersonsImpl.addPersonFaceFromUrlAsync | public Observable<PersistedFace> addPersonFaceFromUrlAsync(String personGroupId, UUID personId, String url, AddPersonFaceFromUrlOptionalParameter addPersonFaceFromUrlOptionalParameter) {
"""
Add a representative face to a person for identification. The input face is specified as an image with a targetFace rectangl... | java | public Observable<PersistedFace> addPersonFaceFromUrlAsync(String personGroupId, UUID personId, String url, AddPersonFaceFromUrlOptionalParameter addPersonFaceFromUrlOptionalParameter) {
return addPersonFaceFromUrlWithServiceResponseAsync(personGroupId, personId, url, addPersonFaceFromUrlOptionalParameter).map(... | [
"public",
"Observable",
"<",
"PersistedFace",
">",
"addPersonFaceFromUrlAsync",
"(",
"String",
"personGroupId",
",",
"UUID",
"personId",
",",
"String",
"url",
",",
"AddPersonFaceFromUrlOptionalParameter",
"addPersonFaceFromUrlOptionalParameter",
")",
"{",
"return",
"addPers... | Add a representative face to a person for identification. The input face is specified as an image with a targetFace rectangle.
@param personGroupId Id referencing a particular person group.
@param personId Id referencing a particular person.
@param url Publicly reachable URL of an image
@param addPersonFaceFromUrlOpti... | [
"Add",
"a",
"representative",
"face",
"to",
"a",
"person",
"for",
"identification",
".",
"The",
"input",
"face",
"is",
"specified",
"as",
"an",
"image",
"with",
"a",
"targetFace",
"rectangle",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/cognitiveservices/data-plane/vision/faceapi/src/main/java/com/microsoft/azure/cognitiveservices/vision/faceapi/implementation/PersonGroupPersonsImpl.java#L1200-L1207 |
craftercms/search | crafter-search-api/src/main/java/org/craftercms/search/utils/BooleanUtils.java | BooleanUtils.toBoolean | public static final boolean toBoolean(String str, boolean trueIfNull) {
"""
Just as {@link #toBoolean(String)}, except that true will be returned if str = null when {@code trueIfNull} is
true, false otherwise.
"""
if (str == null && trueIfNull) {
return true;
}
return toBo... | java | public static final boolean toBoolean(String str, boolean trueIfNull) {
if (str == null && trueIfNull) {
return true;
}
return toBoolean(str);
} | [
"public",
"static",
"final",
"boolean",
"toBoolean",
"(",
"String",
"str",
",",
"boolean",
"trueIfNull",
")",
"{",
"if",
"(",
"str",
"==",
"null",
"&&",
"trueIfNull",
")",
"{",
"return",
"true",
";",
"}",
"return",
"toBoolean",
"(",
"str",
")",
";",
"}... | Just as {@link #toBoolean(String)}, except that true will be returned if str = null when {@code trueIfNull} is
true, false otherwise. | [
"Just",
"as",
"{"
] | train | https://github.com/craftercms/search/blob/337ba446badbfbc4912cd8ccd7d50fd62d6be2cc/crafter-search-api/src/main/java/org/craftercms/search/utils/BooleanUtils.java#L30-L36 |
LGoodDatePicker/LGoodDatePicker | Project/src/main/java/com/privatejgoodies/forms/layout/FormLayout.java | FormLayout.insertColumn | public void insertColumn(int columnIndex, ColumnSpec columnSpec) {
"""
Inserts the specified column at the specified position. Shifts components that intersect the
new column to the right hand side and readjusts column groups.<p>
The component shift works as follows: components that were located on the right h... | java | public void insertColumn(int columnIndex, ColumnSpec columnSpec) {
if (columnIndex < 1 || columnIndex > getColumnCount()) {
throw new IndexOutOfBoundsException(
"The column index " + columnIndex
+ "must be in the range [1, " + getColumnCount() + "].");
... | [
"public",
"void",
"insertColumn",
"(",
"int",
"columnIndex",
",",
"ColumnSpec",
"columnSpec",
")",
"{",
"if",
"(",
"columnIndex",
"<",
"1",
"||",
"columnIndex",
">",
"getColumnCount",
"(",
")",
")",
"{",
"throw",
"new",
"IndexOutOfBoundsException",
"(",
"\"The... | Inserts the specified column at the specified position. Shifts components that intersect the
new column to the right hand side and readjusts column groups.<p>
The component shift works as follows: components that were located on the right hand side of
the inserted column are shifted one column to the right; component ... | [
"Inserts",
"the",
"specified",
"column",
"at",
"the",
"specified",
"position",
".",
"Shifts",
"components",
"that",
"intersect",
"the",
"new",
"column",
"to",
"the",
"right",
"hand",
"side",
"and",
"readjusts",
"column",
"groups",
".",
"<p",
">"
] | train | https://github.com/LGoodDatePicker/LGoodDatePicker/blob/c7df05a5fe382e1e08a6237e9391d8dc5fd48692/Project/src/main/java/com/privatejgoodies/forms/layout/FormLayout.java#L489-L498 |
deeplearning4j/deeplearning4j | deeplearning4j/deeplearning4j-modelimport/src/main/java/org/deeplearning4j/nn/modelimport/keras/layers/embeddings/KerasEmbedding.java | KerasEmbedding.getInputDimFromConfig | private int getInputDimFromConfig(Map<String, Object> layerConfig) throws InvalidKerasConfigurationException {
"""
Get Keras input dimension from Keras layer configuration.
@param layerConfig dictionary containing Keras layer configuration
@return input dim as int
"""
Map<String, Object> innerConfi... | java | private int getInputDimFromConfig(Map<String, Object> layerConfig) throws InvalidKerasConfigurationException {
Map<String, Object> innerConfig = KerasLayerUtils.getInnerLayerConfigFromConfig(layerConfig, conf);
if (!innerConfig.containsKey(conf.getLAYER_FIELD_INPUT_DIM()))
throw new InvalidK... | [
"private",
"int",
"getInputDimFromConfig",
"(",
"Map",
"<",
"String",
",",
"Object",
">",
"layerConfig",
")",
"throws",
"InvalidKerasConfigurationException",
"{",
"Map",
"<",
"String",
",",
"Object",
">",
"innerConfig",
"=",
"KerasLayerUtils",
".",
"getInnerLayerCon... | Get Keras input dimension from Keras layer configuration.
@param layerConfig dictionary containing Keras layer configuration
@return input dim as int | [
"Get",
"Keras",
"input",
"dimension",
"from",
"Keras",
"layer",
"configuration",
"."
] | train | https://github.com/deeplearning4j/deeplearning4j/blob/effce52f2afd7eeb53c5bcca699fcd90bd06822f/deeplearning4j/deeplearning4j-modelimport/src/main/java/org/deeplearning4j/nn/modelimport/keras/layers/embeddings/KerasEmbedding.java#L229-L235 |
undertow-io/undertow | core/src/main/java/io/undertow/server/protocol/http/HttpRequestParser.java | HttpRequestParser.handleHeaderValue | @SuppressWarnings("unused")
final void handleHeaderValue(ByteBuffer buffer, ParseState state, HttpServerExchange builder) throws BadRequestException {
"""
Parses a header value. This is called from the generated bytecode.
@param buffer The buffer
@param state The current state
@param builder The exchan... | java | @SuppressWarnings("unused")
final void handleHeaderValue(ByteBuffer buffer, ParseState state, HttpServerExchange builder) throws BadRequestException {
HttpString headerName = state.nextHeader;
StringBuilder stringBuilder = state.stringBuilder;
CacheMap<HttpString, String> headerValuesCache =... | [
"@",
"SuppressWarnings",
"(",
"\"unused\"",
")",
"final",
"void",
"handleHeaderValue",
"(",
"ByteBuffer",
"buffer",
",",
"ParseState",
"state",
",",
"HttpServerExchange",
"builder",
")",
"throws",
"BadRequestException",
"{",
"HttpString",
"headerName",
"=",
"state",
... | Parses a header value. This is called from the generated bytecode.
@param buffer The buffer
@param state The current state
@param builder The exchange builder
@return The number of bytes remaining | [
"Parses",
"a",
"header",
"value",
".",
"This",
"is",
"called",
"from",
"the",
"generated",
"bytecode",
"."
] | train | https://github.com/undertow-io/undertow/blob/87de0b856a7a4ba8faf5b659537b9af07b763263/core/src/main/java/io/undertow/server/protocol/http/HttpRequestParser.java#L685-L700 |
deeplearning4j/deeplearning4j | nd4j/nd4j-common/src/main/java/org/nd4j/linalg/util/Bernoulli.java | Bernoulli.doubleSum | private Rational doubleSum(int n) {
"""
/* Generate a new B_n by a standard double sum.
@param n The index of the Bernoulli number.
@return The Bernoulli number at n.
"""
Rational resul = Rational.ZERO;
for (int k = 0; k <= n; k++) {
Rational jsum = Rational.ZERO;
BigI... | java | private Rational doubleSum(int n) {
Rational resul = Rational.ZERO;
for (int k = 0; k <= n; k++) {
Rational jsum = Rational.ZERO;
BigInteger bin = BigInteger.ONE;
for (int j = 0; j <= k; j++) {
BigInteger jpown = BigInteger.valueOf(j).pow(n);
... | [
"private",
"Rational",
"doubleSum",
"(",
"int",
"n",
")",
"{",
"Rational",
"resul",
"=",
"Rational",
".",
"ZERO",
";",
"for",
"(",
"int",
"k",
"=",
"0",
";",
"k",
"<=",
"n",
";",
"k",
"++",
")",
"{",
"Rational",
"jsum",
"=",
"Rational",
".",
"ZER... | /* Generate a new B_n by a standard double sum.
@param n The index of the Bernoulli number.
@return The Bernoulli number at n. | [
"/",
"*",
"Generate",
"a",
"new",
"B_n",
"by",
"a",
"standard",
"double",
"sum",
"."
] | train | https://github.com/deeplearning4j/deeplearning4j/blob/effce52f2afd7eeb53c5bcca699fcd90bd06822f/nd4j/nd4j-common/src/main/java/org/nd4j/linalg/util/Bernoulli.java#L89-L108 |
OpenLiberty/open-liberty | dev/com.ibm.ws.messaging.jms.2.0/src/com/ibm/ws/sib/ra/inbound/impl/SibRaMessagingEngineConnection.java | SibRaMessagingEngineConnection.createConnection | SICoreConnection createConnection(SICoreConnectionFactory factory, String name, String password, Map properties, String busName)
throws SIException, SIErrorException, Exception {
"""
Creates this connection using either the Auth Alias supplied or, if the property is set
the WAS server subject.... | java | SICoreConnection createConnection(SICoreConnectionFactory factory, String name, String password, Map properties, String busName)
throws SIException, SIErrorException, Exception {
final String methodName = "createConnection";
if (TraceComponent.isAnyTracingEnabled() && TRACE.isEntry... | [
"SICoreConnection",
"createConnection",
"(",
"SICoreConnectionFactory",
"factory",
",",
"String",
"name",
",",
"String",
"password",
",",
"Map",
"properties",
",",
"String",
"busName",
")",
"throws",
"SIException",
",",
"SIErrorException",
",",
"Exception",
"{",
"fi... | Creates this connection using either the Auth Alias supplied or, if the property is set
the WAS server subject.
@param factory
The SICoreConnectionFactory used to make the connection.
@param name
The userid to use for secure connections
@param password
The password to use for secure connections
@param properties
The M... | [
"Creates",
"this",
"connection",
"using",
"either",
"the",
"Auth",
"Alias",
"supplied",
"or",
"if",
"the",
"property",
"is",
"set",
"the",
"WAS",
"server",
"subject",
"."
] | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.messaging.jms.2.0/src/com/ibm/ws/sib/ra/inbound/impl/SibRaMessagingEngineConnection.java#L991-L1012 |
jbundle/jbundle | base/message/core/src/main/java/org/jbundle/base/message/core/tree/Registry.java | Registry.getNameValueLeaf | public NameValue getNameValueLeaf(BaseMessageHeader header, boolean bAddIfNotFound) {
"""
Get the value node at the end of this name/value chain.
@param header The message header that contains the name/value tree.
@oaram bAddIfNotFound Add the value if it is not found.
@return The node at the end of the name/va... | java | public NameValue getNameValueLeaf(BaseMessageHeader header, boolean bAddIfNotFound)
{
Object[][] mxString = header.getNameValueTree();
NameValue node = this;
if (mxString != null)
{
for (int i = 0; i < mxString.length; i++)
{
node = node.getNam... | [
"public",
"NameValue",
"getNameValueLeaf",
"(",
"BaseMessageHeader",
"header",
",",
"boolean",
"bAddIfNotFound",
")",
"{",
"Object",
"[",
"]",
"[",
"]",
"mxString",
"=",
"header",
".",
"getNameValueTree",
"(",
")",
";",
"NameValue",
"node",
"=",
"this",
";",
... | Get the value node at the end of this name/value chain.
@param header The message header that contains the name/value tree.
@oaram bAddIfNotFound Add the value if it is not found.
@return The node at the end of the name/value tree. | [
"Get",
"the",
"value",
"node",
"at",
"the",
"end",
"of",
"this",
"name",
"/",
"value",
"chain",
"."
] | train | https://github.com/jbundle/jbundle/blob/4037fcfa85f60c7d0096c453c1a3cd573c2b0abc/base/message/core/src/main/java/org/jbundle/base/message/core/tree/Registry.java#L143-L157 |
thelinmichael/spotify-web-api-java | src/main/java/com/wrapper/spotify/SpotifyApi.java | SpotifyApi.replacePlaylistsTracks | public ReplacePlaylistsTracksRequest.Builder replacePlaylistsTracks(String playlist_id, JsonArray uris) {
"""
Replace tracks in a playlist.
@param playlist_id The playlists ID.
@param uris URIs of the tracks to add. Maximum: 100 track URIs.
@return A {@link ReplacePlaylistsTracksRequest.Builder}.
@see... | java | public ReplacePlaylistsTracksRequest.Builder replacePlaylistsTracks(String playlist_id, JsonArray uris) {
return new ReplacePlaylistsTracksRequest.Builder(accessToken)
.setDefaults(httpManager, scheme, host, port)
.playlist_id(playlist_id)
.uris(uris);
} | [
"public",
"ReplacePlaylistsTracksRequest",
".",
"Builder",
"replacePlaylistsTracks",
"(",
"String",
"playlist_id",
",",
"JsonArray",
"uris",
")",
"{",
"return",
"new",
"ReplacePlaylistsTracksRequest",
".",
"Builder",
"(",
"accessToken",
")",
".",
"setDefaults",
"(",
"... | Replace tracks in a playlist.
@param playlist_id The playlists ID.
@param uris URIs of the tracks to add. Maximum: 100 track URIs.
@return A {@link ReplacePlaylistsTracksRequest.Builder}.
@see <a href="https://developer.spotify.com/web-api/user-guide/#spotify-uris-and-ids">Spotify: URLs & IDs</a> | [
"Replace",
"tracks",
"in",
"a",
"playlist",
"."
] | train | https://github.com/thelinmichael/spotify-web-api-java/blob/c06b8512344c0310d0c1df362fa267879021da2e/src/main/java/com/wrapper/spotify/SpotifyApi.java#L1430-L1435 |
HeidelTime/heideltime | src/jvntextpro/util/StringUtils.java | StringUtils.indexOf | public static int indexOf( String[] array, String s ) {
"""
Returns the index of the first occurrence of the specified <tt>String</tt>
in an array of <tt>String</tt>s.
@param array array of <tt>String</tt>s to search.
@param s the <tt>String</tt> to search for.
@return the index of the first occurren... | java | public static int indexOf( String[] array, String s )
{
for (int index = 0; index < array.length; index++)
{
if( s.equals( array[index] ) )
{
return index;
}
}
return -1;
} | [
"public",
"static",
"int",
"indexOf",
"(",
"String",
"[",
"]",
"array",
",",
"String",
"s",
")",
"{",
"for",
"(",
"int",
"index",
"=",
"0",
";",
"index",
"<",
"array",
".",
"length",
";",
"index",
"++",
")",
"{",
"if",
"(",
"s",
".",
"equals",
... | Returns the index of the first occurrence of the specified <tt>String</tt>
in an array of <tt>String</tt>s.
@param array array of <tt>String</tt>s to search.
@param s the <tt>String</tt> to search for.
@return the index of the first occurrence of the argument in this list,
or -1 if the string is not found. | [
"Returns",
"the",
"index",
"of",
"the",
"first",
"occurrence",
"of",
"the",
"specified",
"<tt",
">",
"String<",
"/",
"tt",
">",
"in",
"an",
"array",
"of",
"<tt",
">",
"String<",
"/",
"tt",
">",
"s",
"."
] | train | https://github.com/HeidelTime/heideltime/blob/4ef5002eb5ecfeb818086ff7e394e792ee360335/src/jvntextpro/util/StringUtils.java#L582-L592 |
alkacon/opencms-core | src/org/opencms/ui/components/CmsToolBar.java | CmsToolBar.createButton | public static Button createButton(Resource icon, String title, boolean alwaysShow) {
"""
Creates a properly styled toolbar button.<p>
@param icon the button icon
@param title the button title, will be used for the tooltip
@param alwaysShow <code>true</code> to prevent the button to be folded into a sub menu f... | java | public static Button createButton(Resource icon, String title, boolean alwaysShow) {
Button button = new Button(icon);
button.setDescription(title);
button.addStyleName(ValoTheme.BUTTON_BORDERLESS);
button.addStyleName(OpenCmsTheme.TOOLBAR_BUTTON);
if (alwaysShow) {
... | [
"public",
"static",
"Button",
"createButton",
"(",
"Resource",
"icon",
",",
"String",
"title",
",",
"boolean",
"alwaysShow",
")",
"{",
"Button",
"button",
"=",
"new",
"Button",
"(",
"icon",
")",
";",
"button",
".",
"setDescription",
"(",
"title",
")",
";",... | Creates a properly styled toolbar button.<p>
@param icon the button icon
@param title the button title, will be used for the tooltip
@param alwaysShow <code>true</code> to prevent the button to be folded into a sub menu for small screens
@return the button | [
"Creates",
"a",
"properly",
"styled",
"toolbar",
"button",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/ui/components/CmsToolBar.java#L231-L241 |
Berico-Technologies/CLAVIN | src/main/java/com/bericotech/clavin/extractor/ApacheExtractor.java | ApacheExtractor.extractLocationNames | public List<LocationOccurrence> extractLocationNames(String plainText) {
"""
Extracts location names from unstructured text using the named
entity recognizer (NER) feature provided by the Apache OpenNLP
Name Finder.
@param plainText Contents of text document
@return List of location names and positions
... | java | public List<LocationOccurrence> extractLocationNames(String plainText) {
if(plainText == null) {
throw new IllegalArgumentException("plaintext input to extractLocationNames should not be null");
}
List<LocationOccurrence> nerResults = new ArrayList<LocationOccurrence>();
//... | [
"public",
"List",
"<",
"LocationOccurrence",
">",
"extractLocationNames",
"(",
"String",
"plainText",
")",
"{",
"if",
"(",
"plainText",
"==",
"null",
")",
"{",
"throw",
"new",
"IllegalArgumentException",
"(",
"\"plaintext input to extractLocationNames should not be null\"... | Extracts location names from unstructured text using the named
entity recognizer (NER) feature provided by the Apache OpenNLP
Name Finder.
@param plainText Contents of text document
@return List of location names and positions | [
"Extracts",
"location",
"names",
"from",
"unstructured",
"text",
"using",
"the",
"named",
"entity",
"recognizer",
"(",
"NER",
")",
"feature",
"provided",
"by",
"the",
"Apache",
"OpenNLP",
"Name",
"Finder",
"."
] | train | https://github.com/Berico-Technologies/CLAVIN/blob/f73c741f33a01b91aa5b06e71860bc354ef3010d/src/main/java/com/bericotech/clavin/extractor/ApacheExtractor.java#L85-L138 |
citrusframework/citrus | modules/citrus-ws/src/main/java/com/consol/citrus/ws/interceptor/LoggingInterceptorSupport.java | LoggingInterceptorSupport.logResponse | protected void logResponse(String logMessage, MessageContext messageContext, boolean incoming) throws TransformerException {
"""
Logs response message from message context if any. SOAP messages get logged with envelope transformation
other messages with serialization.
@param logMessage
@param messageContext
... | java | protected void logResponse(String logMessage, MessageContext messageContext, boolean incoming) throws TransformerException {
if (messageContext.hasResponse()) {
if (messageContext.getResponse() instanceof SoapMessage) {
logSoapMessage(logMessage, (SoapMessage) messageContext.getRespo... | [
"protected",
"void",
"logResponse",
"(",
"String",
"logMessage",
",",
"MessageContext",
"messageContext",
",",
"boolean",
"incoming",
")",
"throws",
"TransformerException",
"{",
"if",
"(",
"messageContext",
".",
"hasResponse",
"(",
")",
")",
"{",
"if",
"(",
"mes... | Logs response message from message context if any. SOAP messages get logged with envelope transformation
other messages with serialization.
@param logMessage
@param messageContext
@param incoming
@throws TransformerException | [
"Logs",
"response",
"message",
"from",
"message",
"context",
"if",
"any",
".",
"SOAP",
"messages",
"get",
"logged",
"with",
"envelope",
"transformation",
"other",
"messages",
"with",
"serialization",
"."
] | train | https://github.com/citrusframework/citrus/blob/55c58ef74c01d511615e43646ca25c1b2301c56d/modules/citrus-ws/src/main/java/com/consol/citrus/ws/interceptor/LoggingInterceptorSupport.java#L79-L87 |
zandero/rest.vertx | src/main/java/com/zandero/rest/AnnotationProcessor.java | AnnotationProcessor.getDefinitions | private static Map<RouteDefinition, Method> getDefinitions(Class clazz) {
"""
Checks class for JAX-RS annotations and returns a list of route definitions to build routes upon
@param clazz to be checked
@return list of definitions or empty list if none present
"""
Assert.notNull(clazz, "Missing class wit... | java | private static Map<RouteDefinition, Method> getDefinitions(Class clazz) {
Assert.notNull(clazz, "Missing class with JAX-RS annotations!");
// base
RouteDefinition root = new RouteDefinition(clazz);
// go over methods ...
Map<RouteDefinition, Method> output = new LinkedHashMap<>();
for (Method method : cl... | [
"private",
"static",
"Map",
"<",
"RouteDefinition",
",",
"Method",
">",
"getDefinitions",
"(",
"Class",
"clazz",
")",
"{",
"Assert",
".",
"notNull",
"(",
"clazz",
",",
"\"Missing class with JAX-RS annotations!\"",
")",
";",
"// base",
"RouteDefinition",
"root",
"=... | Checks class for JAX-RS annotations and returns a list of route definitions to build routes upon
@param clazz to be checked
@return list of definitions or empty list if none present | [
"Checks",
"class",
"for",
"JAX",
"-",
"RS",
"annotations",
"and",
"returns",
"a",
"list",
"of",
"route",
"definitions",
"to",
"build",
"routes",
"upon"
] | train | https://github.com/zandero/rest.vertx/blob/ba458720cf59e076953eab9dac7227eeaf9e58ce/src/main/java/com/zandero/rest/AnnotationProcessor.java#L186-L211 |
alkacon/opencms-core | src/org/opencms/db/CmsDriverManager.java | CmsDriverManager.readHistoryProject | public CmsHistoryProject readHistoryProject(CmsDbContext dbc, CmsUUID projectId) throws CmsException {
"""
Returns the latest historical project entry with the given id.<p>
@param dbc the current database context
@param projectId the project id
@return the requested historical project entry
@throws CmsEx... | java | public CmsHistoryProject readHistoryProject(CmsDbContext dbc, CmsUUID projectId) throws CmsException {
return getHistoryDriver(dbc).readProject(dbc, projectId);
} | [
"public",
"CmsHistoryProject",
"readHistoryProject",
"(",
"CmsDbContext",
"dbc",
",",
"CmsUUID",
"projectId",
")",
"throws",
"CmsException",
"{",
"return",
"getHistoryDriver",
"(",
"dbc",
")",
".",
"readProject",
"(",
"dbc",
",",
"projectId",
")",
";",
"}"
] | Returns the latest historical project entry with the given id.<p>
@param dbc the current database context
@param projectId the project id
@return the requested historical project entry
@throws CmsException if something goes wrong | [
"Returns",
"the",
"latest",
"historical",
"project",
"entry",
"with",
"the",
"given",
"id",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/db/CmsDriverManager.java#L6968-L6971 |
codelibs/fess | src/main/java/org/codelibs/fess/mylasta/action/FessMessages.java | FessMessages.addConstraintsRangeMessage | public FessMessages addConstraintsRangeMessage(String property, String min, String max) {
"""
Add the created action message for the key 'constraints.Range.message' with parameters.
<pre>
message: {item} must be between {min} and {max}.
</pre>
@param property The property name for the message. (NotNull)
@para... | java | public FessMessages addConstraintsRangeMessage(String property, String min, String max) {
assertPropertyNotNull(property);
add(property, new UserMessage(CONSTRAINTS_Range_MESSAGE, min, max));
return this;
} | [
"public",
"FessMessages",
"addConstraintsRangeMessage",
"(",
"String",
"property",
",",
"String",
"min",
",",
"String",
"max",
")",
"{",
"assertPropertyNotNull",
"(",
"property",
")",
";",
"add",
"(",
"property",
",",
"new",
"UserMessage",
"(",
"CONSTRAINTS_Range_... | Add the created action message for the key 'constraints.Range.message' with parameters.
<pre>
message: {item} must be between {min} and {max}.
</pre>
@param property The property name for the message. (NotNull)
@param min The parameter min for message. (NotNull)
@param max The parameter max for message. (NotNull)
@retu... | [
"Add",
"the",
"created",
"action",
"message",
"for",
"the",
"key",
"constraints",
".",
"Range",
".",
"message",
"with",
"parameters",
".",
"<pre",
">",
"message",
":",
"{",
"item",
"}",
"must",
"be",
"between",
"{",
"min",
"}",
"and",
"{",
"max",
"}",
... | train | https://github.com/codelibs/fess/blob/e5e4b722549d32a4958dfd94965b21937bfe64cf/src/main/java/org/codelibs/fess/mylasta/action/FessMessages.java#L964-L968 |
facebookarchive/hadoop-20 | src/hdfs/org/apache/hadoop/hdfs/server/namenode/FSDirectory.java | FSDirectory.unprotectedDelete | INode unprotectedDelete(String src, long modificationTime) {
"""
Delete a path from the name space
Update the count at each ancestor directory with quota
@param src a string representation of a path to an inode
@param modificationTime the time the inode is removed
@return the deleted target inode, null if dele... | java | INode unprotectedDelete(String src, long modificationTime) {
return unprotectedDelete(src, this.getExistingPathINodes(src), null,
BLOCK_DELETION_NO_LIMIT, modificationTime);
} | [
"INode",
"unprotectedDelete",
"(",
"String",
"src",
",",
"long",
"modificationTime",
")",
"{",
"return",
"unprotectedDelete",
"(",
"src",
",",
"this",
".",
"getExistingPathINodes",
"(",
"src",
")",
",",
"null",
",",
"BLOCK_DELETION_NO_LIMIT",
",",
"modificationTim... | Delete a path from the name space
Update the count at each ancestor directory with quota
@param src a string representation of a path to an inode
@param modificationTime the time the inode is removed
@return the deleted target inode, null if deletion failed | [
"Delete",
"a",
"path",
"from",
"the",
"name",
"space",
"Update",
"the",
"count",
"at",
"each",
"ancestor",
"directory",
"with",
"quota"
] | train | https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/hdfs/org/apache/hadoop/hdfs/server/namenode/FSDirectory.java#L1443-L1446 |
albfernandez/itext2 | src/main/java/com/lowagie/text/pdf/MultiColumnText.java | MultiColumnText.addSimpleColumn | public void addSimpleColumn(float left, float right) {
"""
Add a simple rectangular column with specified left
and right x position boundaries.
@param left left boundary
@param right right boundary
"""
ColumnDef newCol = new ColumnDef(left, right);
columnDefs.add(newCol);
} | java | public void addSimpleColumn(float left, float right) {
ColumnDef newCol = new ColumnDef(left, right);
columnDefs.add(newCol);
} | [
"public",
"void",
"addSimpleColumn",
"(",
"float",
"left",
",",
"float",
"right",
")",
"{",
"ColumnDef",
"newCol",
"=",
"new",
"ColumnDef",
"(",
"left",
",",
"right",
")",
";",
"columnDefs",
".",
"add",
"(",
"newCol",
")",
";",
"}"
] | Add a simple rectangular column with specified left
and right x position boundaries.
@param left left boundary
@param right right boundary | [
"Add",
"a",
"simple",
"rectangular",
"column",
"with",
"specified",
"left",
"and",
"right",
"x",
"position",
"boundaries",
"."
] | train | https://github.com/albfernandez/itext2/blob/438fc1899367fd13dfdfa8dfdca9a3c1a7783b84/src/main/java/com/lowagie/text/pdf/MultiColumnText.java#L204-L207 |
jroyalty/jglm | src/main/java/com/hackoeur/jglm/support/Precision.java | Precision.equalsWithRelativeTolerance | public static boolean equalsWithRelativeTolerance(double x, double y, double eps) {
"""
Returns {@code true} if there is no double value strictly between the
arguments or the reltaive difference between them is smaller or equal
to the given tolerance.
@param x First value.
@param y Second value.
@param eps ... | java | public static boolean equalsWithRelativeTolerance(double x, double y, double eps) {
if (equals(x, y, 1)) {
return true;
}
final double absoluteMax = FastMath.max(FastMath.abs(x), FastMath.abs(y));
final double relativeDifference = FastMath.abs((x - y) / absoluteMax);
... | [
"public",
"static",
"boolean",
"equalsWithRelativeTolerance",
"(",
"double",
"x",
",",
"double",
"y",
",",
"double",
"eps",
")",
"{",
"if",
"(",
"equals",
"(",
"x",
",",
"y",
",",
"1",
")",
")",
"{",
"return",
"true",
";",
"}",
"final",
"double",
"ab... | Returns {@code true} if there is no double value strictly between the
arguments or the reltaive difference between them is smaller or equal
to the given tolerance.
@param x First value.
@param y Second value.
@param eps Amount of allowed relative error.
@return {@code true} if the values are two adjacent floating poin... | [
"Returns",
"{",
"@code",
"true",
"}",
"if",
"there",
"is",
"no",
"double",
"value",
"strictly",
"between",
"the",
"arguments",
"or",
"the",
"reltaive",
"difference",
"between",
"them",
"is",
"smaller",
"or",
"equal",
"to",
"the",
"given",
"tolerance",
"."
] | train | https://github.com/jroyalty/jglm/blob/9397c2fcf0d4d62844c64d0b14065ee7bf8cafc6/src/main/java/com/hackoeur/jglm/support/Precision.java#L283-L292 |
apache/groovy | src/main/java/org/codehaus/groovy/runtime/IOGroovyMethods.java | IOGroovyMethods.leftShift | public static Writer leftShift(Writer self, Object value) throws IOException {
"""
Overloads the leftShift operator for Writer to allow an object to be written
using Groovy's default representation for the object.
@param self a Writer
@param value an Object whose default representation will be written to the... | java | public static Writer leftShift(Writer self, Object value) throws IOException {
InvokerHelper.write(self, value);
return self;
} | [
"public",
"static",
"Writer",
"leftShift",
"(",
"Writer",
"self",
",",
"Object",
"value",
")",
"throws",
"IOException",
"{",
"InvokerHelper",
".",
"write",
"(",
"self",
",",
"value",
")",
";",
"return",
"self",
";",
"}"
] | Overloads the leftShift operator for Writer to allow an object to be written
using Groovy's default representation for the object.
@param self a Writer
@param value an Object whose default representation will be written to the Writer
@return the writer on which this operation was invoked
@throws IOException if an I/O... | [
"Overloads",
"the",
"leftShift",
"operator",
"for",
"Writer",
"to",
"allow",
"an",
"object",
"to",
"be",
"written",
"using",
"Groovy",
"s",
"default",
"representation",
"for",
"the",
"object",
"."
] | train | https://github.com/apache/groovy/blob/71cf20addb611bb8d097a59e395fd20bc7f31772/src/main/java/org/codehaus/groovy/runtime/IOGroovyMethods.java#L92-L95 |
dspinellis/UMLGraph | src/main/java/org/umlgraph/doclet/Options.java | Options.optionLength | public static int optionLength(String option) {
"""
Return the number of arguments associated with the specified option.
The return value includes the actual option.
Will return 0 if the option is not supported.
"""
if(matchOption(option, "qualify", true) ||
matchOption(option, "qualifyGen... | java | public static int optionLength(String option) {
if(matchOption(option, "qualify", true) ||
matchOption(option, "qualifyGenerics", true) ||
matchOption(option, "hideGenerics", true) ||
matchOption(option, "horizontal", true) ||
matchOption(option, "all") ||
... | [
"public",
"static",
"int",
"optionLength",
"(",
"String",
"option",
")",
"{",
"if",
"(",
"matchOption",
"(",
"option",
",",
"\"qualify\"",
",",
"true",
")",
"||",
"matchOption",
"(",
"option",
",",
"\"qualifyGenerics\"",
",",
"true",
")",
"||",
"matchOption"... | Return the number of arguments associated with the specified option.
The return value includes the actual option.
Will return 0 if the option is not supported. | [
"Return",
"the",
"number",
"of",
"arguments",
"associated",
"with",
"the",
"specified",
"option",
".",
"The",
"return",
"value",
"includes",
"the",
"actual",
"option",
".",
"Will",
"return",
"0",
"if",
"the",
"option",
"is",
"not",
"supported",
"."
] | train | https://github.com/dspinellis/UMLGraph/blob/09576db5ae0ea63bfe30ef9fce88a513f9a8d843/src/main/java/org/umlgraph/doclet/Options.java#L192-L257 |
hyperledger/fabric-sdk-java | src/main/java/org/hyperledger/fabric/sdk/idemix/RevocationAuthority.java | RevocationAuthority.verifyEpochPK | public static boolean verifyEpochPK(PublicKey pk, Idemix.ECP2 epochPK, byte[] epochPkSig, long epoch, RevocationAlgorithm alg) throws CryptoException {
"""
Verifies that the revocation PK for a certain epoch is valid,
by checking that it was signed with the long term revocation key
@param pk Public Key... | java | public static boolean verifyEpochPK(PublicKey pk, Idemix.ECP2 epochPK, byte[] epochPkSig, long epoch, RevocationAlgorithm alg) throws CryptoException {
Idemix.CredentialRevocationInformation.Builder builder = Idemix.CredentialRevocationInformation.newBuilder();
builder.setRevocationAlg(alg.ordinal());
... | [
"public",
"static",
"boolean",
"verifyEpochPK",
"(",
"PublicKey",
"pk",
",",
"Idemix",
".",
"ECP2",
"epochPK",
",",
"byte",
"[",
"]",
"epochPkSig",
",",
"long",
"epoch",
",",
"RevocationAlgorithm",
"alg",
")",
"throws",
"CryptoException",
"{",
"Idemix",
".",
... | Verifies that the revocation PK for a certain epoch is valid,
by checking that it was signed with the long term revocation key
@param pk Public Key
@param epochPK Epoch PK
@param epochPkSig Epoch PK Signature
@param epoch Epoch
@param alg Revocation algorithm
@return True if valid | [
"Verifies",
"that",
"the",
"revocation",
"PK",
"for",
"a",
"certain",
"epoch",
"is",
"valid",
"by",
"checking",
"that",
"it",
"was",
"signed",
"with",
"the",
"long",
"term",
"revocation",
"key"
] | train | https://github.com/hyperledger/fabric-sdk-java/blob/4a2d7b3408b8b0a1ed812aa36942c438159c37a0/src/main/java/org/hyperledger/fabric/sdk/idemix/RevocationAuthority.java#L136-L152 |
diirt/util | src/main/java/org/epics/util/array/ListMath.java | ListMath.limit | public static ListDouble limit(final ListDouble data, final int start, final int end) {
"""
Returns a sublist of the given data.
@param data a list
@param start start point for the sublist
@param end end point (exclusive) for the sublist
@return the sublist
"""
return new ListDouble() {
... | java | public static ListDouble limit(final ListDouble data, final int start, final int end) {
return new ListDouble() {
@Override
public double getDouble(int index) {
return data.getDouble(index + start);
}
@Override
public int siz... | [
"public",
"static",
"ListDouble",
"limit",
"(",
"final",
"ListDouble",
"data",
",",
"final",
"int",
"start",
",",
"final",
"int",
"end",
")",
"{",
"return",
"new",
"ListDouble",
"(",
")",
"{",
"@",
"Override",
"public",
"double",
"getDouble",
"(",
"int",
... | Returns a sublist of the given data.
@param data a list
@param start start point for the sublist
@param end end point (exclusive) for the sublist
@return the sublist | [
"Returns",
"a",
"sublist",
"of",
"the",
"given",
"data",
"."
] | train | https://github.com/diirt/util/blob/24aca0a173a635aaf0b78d213a3fee8d4f91c077/src/main/java/org/epics/util/array/ListMath.java#L29-L42 |
wildfly/wildfly-core | server/src/main/java/org/jboss/as/server/deployment/DeploymentResourceSupport.java | DeploymentResourceSupport.hasDeploymentSubModel | public boolean hasDeploymentSubModel(final String subsystemName, final PathElement address) {
"""
Checks to see if a resource has already been registered for the specified address on the subsystem.
@param subsystemName the name of the subsystem
@param address the address to check
@return {@code true} ... | java | public boolean hasDeploymentSubModel(final String subsystemName, final PathElement address) {
final Resource root = deploymentUnit.getAttachment(DEPLOYMENT_RESOURCE);
final PathElement subsystem = PathElement.pathElement(SUBSYSTEM, subsystemName);
return root.hasChild(subsystem) && (address == n... | [
"public",
"boolean",
"hasDeploymentSubModel",
"(",
"final",
"String",
"subsystemName",
",",
"final",
"PathElement",
"address",
")",
"{",
"final",
"Resource",
"root",
"=",
"deploymentUnit",
".",
"getAttachment",
"(",
"DEPLOYMENT_RESOURCE",
")",
";",
"final",
"PathEle... | Checks to see if a resource has already been registered for the specified address on the subsystem.
@param subsystemName the name of the subsystem
@param address the address to check
@return {@code true} if the address exists on the subsystem otherwise {@code false} | [
"Checks",
"to",
"see",
"if",
"a",
"resource",
"has",
"already",
"been",
"registered",
"for",
"the",
"specified",
"address",
"on",
"the",
"subsystem",
"."
] | train | https://github.com/wildfly/wildfly-core/blob/cfaf0479dcbb2d320a44c5374b93b944ec39fade/server/src/main/java/org/jboss/as/server/deployment/DeploymentResourceSupport.java#L105-L109 |
Azure/azure-sdk-for-java | appservice/resource-manager/v2016_09_01/src/main/java/com/microsoft/azure/management/appservice/v2016_09_01/implementation/AppServicePlansInner.java | AppServicePlansInner.rebootWorker | public void rebootWorker(String resourceGroupName, String name, String workerName) {
"""
Reboot a worker machine in an App Service plan.
Reboot a worker machine in an App Service plan.
@param resourceGroupName Name of the resource group to which the resource belongs.
@param name Name of the App Service plan.
... | java | public void rebootWorker(String resourceGroupName, String name, String workerName) {
rebootWorkerWithServiceResponseAsync(resourceGroupName, name, workerName).toBlocking().single().body();
} | [
"public",
"void",
"rebootWorker",
"(",
"String",
"resourceGroupName",
",",
"String",
"name",
",",
"String",
"workerName",
")",
"{",
"rebootWorkerWithServiceResponseAsync",
"(",
"resourceGroupName",
",",
"name",
",",
"workerName",
")",
".",
"toBlocking",
"(",
")",
... | Reboot a worker machine in an App Service plan.
Reboot a worker machine in an App Service plan.
@param resourceGroupName Name of the resource group to which the resource belongs.
@param name Name of the App Service plan.
@param workerName Name of worker machine, which typically starts with RD.
@throws IllegalArgumentE... | [
"Reboot",
"a",
"worker",
"machine",
"in",
"an",
"App",
"Service",
"plan",
".",
"Reboot",
"a",
"worker",
"machine",
"in",
"an",
"App",
"Service",
"plan",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/appservice/resource-manager/v2016_09_01/src/main/java/com/microsoft/azure/management/appservice/v2016_09_01/implementation/AppServicePlansInner.java#L3922-L3924 |
di2e/Argo | clui/src/main/java/net/dharwin/common/tools/cli/api/CLIContext.java | CLIContext.loadProperties | private void loadProperties(InputStream stream, String path) {
"""
Loads properties from the given stream.
This will close the stream.
@param stream The stream to load from.
@param path The path represented by the stream.
"""
if (stream == null) {
return;
}
try {
Properties props = new ... | java | private void loadProperties(InputStream stream, String path) {
if (stream == null) {
return;
}
try {
Properties props = new Properties();
props.load(stream);
Iterator<Object> keyIt = props.keySet().iterator();
while (keyIt.hasNext()) {
String key = keyIt.next().toString();
... | [
"private",
"void",
"loadProperties",
"(",
"InputStream",
"stream",
",",
"String",
"path",
")",
"{",
"if",
"(",
"stream",
"==",
"null",
")",
"{",
"return",
";",
"}",
"try",
"{",
"Properties",
"props",
"=",
"new",
"Properties",
"(",
")",
";",
"props",
".... | Loads properties from the given stream.
This will close the stream.
@param stream The stream to load from.
@param path The path represented by the stream. | [
"Loads",
"properties",
"from",
"the",
"given",
"stream",
".",
"This",
"will",
"close",
"the",
"stream",
"."
] | train | https://github.com/di2e/Argo/blob/f537a03d2d25fdfecda7999ec10e1da67dc3b8f3/clui/src/main/java/net/dharwin/common/tools/cli/api/CLIContext.java#L82-L110 |
jbundle/jbundle | base/screen/model/src/main/java/org/jbundle/base/screen/model/ScreenField.java | ScreenField.printScreen | public void printScreen(PrintWriter out, ResourceBundle reg)
throws DBException {
"""
Display the result in html table format.
@param out The http output stream.
@param reg The resource bundle
@exception DBException File exception.
"""
this.getScreenFieldView().printScreen(out, reg);
... | java | public void printScreen(PrintWriter out, ResourceBundle reg)
throws DBException
{
this.getScreenFieldView().printScreen(out, reg);
} | [
"public",
"void",
"printScreen",
"(",
"PrintWriter",
"out",
",",
"ResourceBundle",
"reg",
")",
"throws",
"DBException",
"{",
"this",
".",
"getScreenFieldView",
"(",
")",
".",
"printScreen",
"(",
"out",
",",
"reg",
")",
";",
"}"
] | Display the result in html table format.
@param out The http output stream.
@param reg The resource bundle
@exception DBException File exception. | [
"Display",
"the",
"result",
"in",
"html",
"table",
"format",
"."
] | train | https://github.com/jbundle/jbundle/blob/4037fcfa85f60c7d0096c453c1a3cd573c2b0abc/base/screen/model/src/main/java/org/jbundle/base/screen/model/ScreenField.java#L659-L663 |
igniterealtime/Smack | smack-omemo/src/main/java/org/jivesoftware/smackx/omemo/OmemoManager.java | OmemoManager.getInstanceFor | public static synchronized OmemoManager getInstanceFor(XMPPConnection connection) {
"""
Returns an OmemoManager instance for the given connection. If there was one manager for the connection before,
return it. If there were multiple managers before, return the one with the lowest deviceId.
If there was no manage... | java | public static synchronized OmemoManager getInstanceFor(XMPPConnection connection) {
TreeMap<Integer, OmemoManager> managers = INSTANCES.get(connection);
if (managers == null) {
managers = new TreeMap<>();
INSTANCES.put(connection, managers);
}
OmemoManager manage... | [
"public",
"static",
"synchronized",
"OmemoManager",
"getInstanceFor",
"(",
"XMPPConnection",
"connection",
")",
"{",
"TreeMap",
"<",
"Integer",
",",
"OmemoManager",
">",
"managers",
"=",
"INSTANCES",
".",
"get",
"(",
"connection",
")",
";",
"if",
"(",
"managers"... | Returns an OmemoManager instance for the given connection. If there was one manager for the connection before,
return it. If there were multiple managers before, return the one with the lowest deviceId.
If there was no manager before, return a new one. As soon as the connection gets authenticated, the manager
will look... | [
"Returns",
"an",
"OmemoManager",
"instance",
"for",
"the",
"given",
"connection",
".",
"If",
"there",
"was",
"one",
"manager",
"for",
"the",
"connection",
"before",
"return",
"it",
".",
"If",
"there",
"were",
"multiple",
"managers",
"before",
"return",
"the",
... | train | https://github.com/igniterealtime/Smack/blob/870756997faec1e1bfabfac0cd6c2395b04da873/smack-omemo/src/main/java/org/jivesoftware/smackx/omemo/OmemoManager.java#L185-L203 |
ineunetOS/knife-commons | knife-commons-utils/src/main/java/com/ineunet/knife/util/TextUtils.java | TextUtils.asterisked | public static String asterisked(String str, int keepSize, boolean keepStart) {
"""
将字符串内容替换成星号.<br>
Replace to asterisk.
@param str e.g. 123456
@param keepSize e.g. 4
@param keepStart e.g. false
@return e.g. **3456
"""
if (StringUtils.isBlank(str)) return "";
int length = str.length();
if (length... | java | public static String asterisked(String str, int keepSize, boolean keepStart) {
if (StringUtils.isBlank(str)) return "";
int length = str.length();
if (length < keepSize) return str;
if (keepSize < 1) return getAsterisks(length);
int notKeepSize = length - keepSize;
String keep;
if (keepStart) {
k... | [
"public",
"static",
"String",
"asterisked",
"(",
"String",
"str",
",",
"int",
"keepSize",
",",
"boolean",
"keepStart",
")",
"{",
"if",
"(",
"StringUtils",
".",
"isBlank",
"(",
"str",
")",
")",
"return",
"\"\"",
";",
"int",
"length",
"=",
"str",
".",
"l... | 将字符串内容替换成星号.<br>
Replace to asterisk.
@param str e.g. 123456
@param keepSize e.g. 4
@param keepStart e.g. false
@return e.g. **3456 | [
"将字符串内容替换成星号",
".",
"<br",
">",
"Replace",
"to",
"asterisk",
"."
] | train | https://github.com/ineunetOS/knife-commons/blob/eae9e59afa020a00ae8977c10d43ac8ae46ae236/knife-commons-utils/src/main/java/com/ineunet/knife/util/TextUtils.java#L34-L50 |
alkacon/opencms-core | src/org/opencms/db/CmsSecurityManager.java | CmsSecurityManager.readAliasByPath | public CmsAlias readAliasByPath(CmsRequestContext context, String siteRoot, String path) throws CmsException {
"""
Reads the alias with a given path in a given site.<p>
@param context the current request context
@param siteRoot the site root
@param path the site relative alias path
@return the alias for the ... | java | public CmsAlias readAliasByPath(CmsRequestContext context, String siteRoot, String path) throws CmsException {
CmsDbContext dbc = m_dbContextFactory.getDbContext(context);
try {
CmsAlias alias = m_driverManager.readAliasByPath(dbc, context.getCurrentProject(), siteRoot, path);
r... | [
"public",
"CmsAlias",
"readAliasByPath",
"(",
"CmsRequestContext",
"context",
",",
"String",
"siteRoot",
",",
"String",
"path",
")",
"throws",
"CmsException",
"{",
"CmsDbContext",
"dbc",
"=",
"m_dbContextFactory",
".",
"getDbContext",
"(",
"context",
")",
";",
"tr... | Reads the alias with a given path in a given site.<p>
@param context the current request context
@param siteRoot the site root
@param path the site relative alias path
@return the alias for the path, or null if no such alias exists
@throws CmsException if something goes wrong | [
"Reads",
"the",
"alias",
"with",
"a",
"given",
"path",
"in",
"a",
"given",
"site",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/db/CmsSecurityManager.java#L3878-L3890 |
aNNiMON/Lightweight-Stream-API | stream/src/main/java/com/annimon/stream/Stream.java | Stream.mapToLong | @NotNull
public LongStream mapToLong(@NotNull final ToLongFunction<? super T> mapper) {
"""
Returns {@code LongStream} with elements that obtained by applying the given function.
<p>This is an intermediate operation.
@param mapper the mapper function used to apply to each element
@return the new {@code... | java | @NotNull
public LongStream mapToLong(@NotNull final ToLongFunction<? super T> mapper) {
return new LongStream(params, new ObjMapToLong<T>(iterator, mapper));
} | [
"@",
"NotNull",
"public",
"LongStream",
"mapToLong",
"(",
"@",
"NotNull",
"final",
"ToLongFunction",
"<",
"?",
"super",
"T",
">",
"mapper",
")",
"{",
"return",
"new",
"LongStream",
"(",
"params",
",",
"new",
"ObjMapToLong",
"<",
"T",
">",
"(",
"iterator",
... | Returns {@code LongStream} with elements that obtained by applying the given function.
<p>This is an intermediate operation.
@param mapper the mapper function used to apply to each element
@return the new {@code LongStream}
@since 1.1.4
@see #map(com.annimon.stream.function.Function) | [
"Returns",
"{",
"@code",
"LongStream",
"}",
"with",
"elements",
"that",
"obtained",
"by",
"applying",
"the",
"given",
"function",
"."
] | train | https://github.com/aNNiMON/Lightweight-Stream-API/blob/f29fd57208c20252a4549b084d55ed082c3e58f0/stream/src/main/java/com/annimon/stream/Stream.java#L826-L829 |
beangle/beangle3 | commons/model/src/main/java/org/beangle/commons/transfer/exporter/DefaultPropertyExtractor.java | DefaultPropertyExtractor.getText | protected String getText(String key, String defaultVal) {
"""
<p>
getText.
</p>
@param key a {@link java.lang.String} object.
@param defaultVal a {@link java.lang.String} object.
@return a {@link java.lang.String} object.
"""
return textResource.getText(key, defaultVal);
} | java | protected String getText(String key, String defaultVal) {
return textResource.getText(key, defaultVal);
} | [
"protected",
"String",
"getText",
"(",
"String",
"key",
",",
"String",
"defaultVal",
")",
"{",
"return",
"textResource",
".",
"getText",
"(",
"key",
",",
"defaultVal",
")",
";",
"}"
] | <p>
getText.
</p>
@param key a {@link java.lang.String} object.
@param defaultVal a {@link java.lang.String} object.
@return a {@link java.lang.String} object. | [
"<p",
">",
"getText",
".",
"<",
"/",
"p",
">"
] | train | https://github.com/beangle/beangle3/blob/33df2873a5f38e28ac174a1d3b8144eb2f808e64/commons/model/src/main/java/org/beangle/commons/transfer/exporter/DefaultPropertyExtractor.java#L138-L140 |
aws/aws-sdk-java | aws-java-sdk-code-generator/src/main/java/com/amazonaws/codegen/JmesPathCodeGenVisitor.java | JmesPathCodeGenVisitor.visit | @Override
public String visit(final JmesPathSubExpression subExpression, final Void aVoid)
throws InvalidTypeException {
"""
Generates the code for a new JmesPathSubExpression.
@param subExpression JmesPath subexpression type
@param aVoid void
@return String that represents a call to
... | java | @Override
public String visit(final JmesPathSubExpression subExpression, final Void aVoid)
throws InvalidTypeException {
final String prefix = "new JmesPathSubExpression( ";
return subExpression.getExpressions().stream()
.map(a -> a.accept(this, aVoid))
.c... | [
"@",
"Override",
"public",
"String",
"visit",
"(",
"final",
"JmesPathSubExpression",
"subExpression",
",",
"final",
"Void",
"aVoid",
")",
"throws",
"InvalidTypeException",
"{",
"final",
"String",
"prefix",
"=",
"\"new JmesPathSubExpression( \"",
";",
"return",
"subExp... | Generates the code for a new JmesPathSubExpression.
@param subExpression JmesPath subexpression type
@param aVoid void
@return String that represents a call to
the new subexpression
@throws InvalidTypeException | [
"Generates",
"the",
"code",
"for",
"a",
"new",
"JmesPathSubExpression",
"."
] | train | https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-code-generator/src/main/java/com/amazonaws/codegen/JmesPathCodeGenVisitor.java#L49-L56 |
joniles/mpxj | src/main/java/net/sf/mpxj/fasttrack/FastTrackData.java | FastTrackData.readColumnBlock | private void readColumnBlock(int startIndex, int blockLength) throws Exception {
"""
Read multiple columns from a block.
@param startIndex start of the block
@param blockLength length of the block
"""
int endIndex = startIndex + blockLength;
List<Integer> blocks = new ArrayList<Integer>();
... | java | private void readColumnBlock(int startIndex, int blockLength) throws Exception
{
int endIndex = startIndex + blockLength;
List<Integer> blocks = new ArrayList<Integer>();
for (int index = startIndex; index < endIndex - 11; index++)
{
if (matchChildBlock(index))
{
... | [
"private",
"void",
"readColumnBlock",
"(",
"int",
"startIndex",
",",
"int",
"blockLength",
")",
"throws",
"Exception",
"{",
"int",
"endIndex",
"=",
"startIndex",
"+",
"blockLength",
";",
"List",
"<",
"Integer",
">",
"blocks",
"=",
"new",
"ArrayList",
"<",
"I... | Read multiple columns from a block.
@param startIndex start of the block
@param blockLength length of the block | [
"Read",
"multiple",
"columns",
"from",
"a",
"block",
"."
] | train | https://github.com/joniles/mpxj/blob/143ea0e195da59cd108f13b3b06328e9542337e8/src/main/java/net/sf/mpxj/fasttrack/FastTrackData.java#L193-L224 |
alkacon/opencms-core | src/org/opencms/search/documents/CmsDocumentDependency.java | CmsDocumentDependency.readDependencies | public void readDependencies(CmsObject cms) {
"""
Reads all dependencies that exist for this main resource in the OpenCms VFS.<p>
To be used when incremental updating an index.<p>
@param cms the current users OpenCms context
"""
try {
// read all resources in the parent folder of the... | java | public void readDependencies(CmsObject cms) {
try {
// read all resources in the parent folder of the published resource
List<CmsResource> folderContent = cms.getResourcesInFolder(
CmsResource.getParentFolder(cms.getRequestContext().removeSiteRoot(getResource().getRootPa... | [
"public",
"void",
"readDependencies",
"(",
"CmsObject",
"cms",
")",
"{",
"try",
"{",
"// read all resources in the parent folder of the published resource",
"List",
"<",
"CmsResource",
">",
"folderContent",
"=",
"cms",
".",
"getResourcesInFolder",
"(",
"CmsResource",
".",... | Reads all dependencies that exist for this main resource in the OpenCms VFS.<p>
To be used when incremental updating an index.<p>
@param cms the current users OpenCms context | [
"Reads",
"all",
"dependencies",
"that",
"exist",
"for",
"this",
"main",
"resource",
"in",
"the",
"OpenCms",
"VFS",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/search/documents/CmsDocumentDependency.java#L705-L717 |
aws/aws-sdk-java | aws-java-sdk-pinpoint/src/main/java/com/amazonaws/services/pinpoint/model/EventsBatch.java | EventsBatch.withEvents | public EventsBatch withEvents(java.util.Map<String, Event> events) {
"""
An object that contains a set of events associated with the endpoint.
@param events
An object that contains a set of events associated with the endpoint.
@return Returns a reference to this object so that method calls can be chained toge... | java | public EventsBatch withEvents(java.util.Map<String, Event> events) {
setEvents(events);
return this;
} | [
"public",
"EventsBatch",
"withEvents",
"(",
"java",
".",
"util",
".",
"Map",
"<",
"String",
",",
"Event",
">",
"events",
")",
"{",
"setEvents",
"(",
"events",
")",
";",
"return",
"this",
";",
"}"
] | An object that contains a set of events associated with the endpoint.
@param events
An object that contains a set of events associated with the endpoint.
@return Returns a reference to this object so that method calls can be chained together. | [
"An",
"object",
"that",
"contains",
"a",
"set",
"of",
"events",
"associated",
"with",
"the",
"endpoint",
"."
] | train | https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-pinpoint/src/main/java/com/amazonaws/services/pinpoint/model/EventsBatch.java#L97-L100 |
languagetool-org/languagetool | languagetool-core/src/main/java/org/languagetool/JLanguageTool.java | JLanguageTool.updateOptionalLanguageModelRules | private void updateOptionalLanguageModelRules(@Nullable LanguageModel lm) {
"""
Remove rules that can profit from a language model, recreate them with the given model and add them again
@param lm the language model or null if none is available
"""
ResourceBundle messages = getMessageBundle(language);
... | java | private void updateOptionalLanguageModelRules(@Nullable LanguageModel lm) {
ResourceBundle messages = getMessageBundle(language);
try {
List<Rule> rules = language.getRelevantLanguageModelCapableRules(messages, lm, userConfig, motherTongue, altLanguages);
userRules.removeIf(rule -> optionalLanguageM... | [
"private",
"void",
"updateOptionalLanguageModelRules",
"(",
"@",
"Nullable",
"LanguageModel",
"lm",
")",
"{",
"ResourceBundle",
"messages",
"=",
"getMessageBundle",
"(",
"language",
")",
";",
"try",
"{",
"List",
"<",
"Rule",
">",
"rules",
"=",
"language",
".",
... | Remove rules that can profit from a language model, recreate them with the given model and add them again
@param lm the language model or null if none is available | [
"Remove",
"rules",
"that",
"can",
"profit",
"from",
"a",
"language",
"model",
"recreate",
"them",
"with",
"the",
"given",
"model",
"and",
"add",
"them",
"again"
] | train | https://github.com/languagetool-org/languagetool/blob/b7a3d63883d242fb2525877c6382681c57a0a142/languagetool-core/src/main/java/org/languagetool/JLanguageTool.java#L453-L464 |
apache/flink | flink-streaming-java/src/main/java/org/apache/flink/streaming/api/datastream/DataStream.java | DataStream.timeWindowAll | public AllWindowedStream<T, TimeWindow> timeWindowAll(Time size, Time slide) {
"""
Windows this {@code DataStream} into sliding time windows.
<p>This is a shortcut for either {@code .window(SlidingEventTimeWindows.of(size, slide))} or
{@code .window(SlidingProcessingTimeWindows.of(size, slide))} depending on t... | java | public AllWindowedStream<T, TimeWindow> timeWindowAll(Time size, Time slide) {
if (environment.getStreamTimeCharacteristic() == TimeCharacteristic.ProcessingTime) {
return windowAll(SlidingProcessingTimeWindows.of(size, slide));
} else {
return windowAll(SlidingEventTimeWindows.of(size, slide));
}
} | [
"public",
"AllWindowedStream",
"<",
"T",
",",
"TimeWindow",
">",
"timeWindowAll",
"(",
"Time",
"size",
",",
"Time",
"slide",
")",
"{",
"if",
"(",
"environment",
".",
"getStreamTimeCharacteristic",
"(",
")",
"==",
"TimeCharacteristic",
".",
"ProcessingTime",
")",... | Windows this {@code DataStream} into sliding time windows.
<p>This is a shortcut for either {@code .window(SlidingEventTimeWindows.of(size, slide))} or
{@code .window(SlidingProcessingTimeWindows.of(size, slide))} depending on the time characteristic
set using
{@link org.apache.flink.streaming.api.environment.StreamEx... | [
"Windows",
"this",
"{",
"@code",
"DataStream",
"}",
"into",
"sliding",
"time",
"windows",
"."
] | train | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-streaming-java/src/main/java/org/apache/flink/streaming/api/datastream/DataStream.java#L764-L770 |
kite-sdk/kite | kite-tools-parent/kite-tools/src/main/java/org/kitesdk/cli/commands/InputFormatImportCommand.java | InputFormatImportCommand.runTaskWithClassLoader | private static PipelineResult runTaskWithClassLoader(
final TransformTask task, final ClassLoader loader)
throws IOException, InterruptedException {
"""
Runs a task with the given {@link ClassLoader} as the context loader.
@param task a {@link TransformTask}
@param loader a {@link ClassLoader}
@re... | java | private static PipelineResult runTaskWithClassLoader(
final TransformTask task, final ClassLoader loader)
throws IOException, InterruptedException {
RunnableFuture<PipelineResult> future = new FutureTask<PipelineResult>(
new Callable<PipelineResult>() {
@Override
public Pipel... | [
"private",
"static",
"PipelineResult",
"runTaskWithClassLoader",
"(",
"final",
"TransformTask",
"task",
",",
"final",
"ClassLoader",
"loader",
")",
"throws",
"IOException",
",",
"InterruptedException",
"{",
"RunnableFuture",
"<",
"PipelineResult",
">",
"future",
"=",
... | Runs a task with the given {@link ClassLoader} as the context loader.
@param task a {@link TransformTask}
@param loader a {@link ClassLoader}
@return the result of {@link TransformTask#run}
@throws IOException if the task throws an IOException
@throws InterruptedException if the task execution is interrupted | [
"Runs",
"a",
"task",
"with",
"the",
"given",
"{",
"@link",
"ClassLoader",
"}",
"as",
"the",
"context",
"loader",
"."
] | train | https://github.com/kite-sdk/kite/blob/72bfb4b1a881af85808cd7f14bc3e15160a1e811/kite-tools-parent/kite-tools/src/main/java/org/kitesdk/cli/commands/InputFormatImportCommand.java#L235-L262 |
datumbox/datumbox-framework | datumbox-framework-core/src/main/java/com/datumbox/framework/core/statistics/sampling/SimpleRandomSampling.java | SimpleRandomSampling.minimumSampleSizeForMaximumXbarStd | public static int minimumSampleSizeForMaximumXbarStd(double maximumXbarStd, double populationStd, int populationN) {
"""
Returns the minimum required sample size when we set a specific maximum Xbar STD Error for finite population size.
@param maximumXbarStd
@param populationStd
@param populationN
@return
... | java | public static int minimumSampleSizeForMaximumXbarStd(double maximumXbarStd, double populationStd, int populationN) {
if(populationN<=0) {
throw new IllegalArgumentException("The populationN parameter must be positive.");
}
double minimumSampleN = 1.0/(Math.pow(maximumXbarStd... | [
"public",
"static",
"int",
"minimumSampleSizeForMaximumXbarStd",
"(",
"double",
"maximumXbarStd",
",",
"double",
"populationStd",
",",
"int",
"populationN",
")",
"{",
"if",
"(",
"populationN",
"<=",
"0",
")",
"{",
"throw",
"new",
"IllegalArgumentException",
"(",
"... | Returns the minimum required sample size when we set a specific maximum Xbar STD Error for finite population size.
@param maximumXbarStd
@param populationStd
@param populationN
@return | [
"Returns",
"the",
"minimum",
"required",
"sample",
"size",
"when",
"we",
"set",
"a",
"specific",
"maximum",
"Xbar",
"STD",
"Error",
"for",
"finite",
"population",
"size",
"."
] | train | https://github.com/datumbox/datumbox-framework/blob/909dff0476e80834f05ecdde0624dd2390e9b0ca/datumbox-framework-core/src/main/java/com/datumbox/framework/core/statistics/sampling/SimpleRandomSampling.java#L265-L273 |
TNG/JGiven | jgiven-core/src/main/java/com/tngtech/jgiven/attachment/Attachment.java | Attachment.fromBase64 | public static Attachment fromBase64( String base64encodedContent, MediaType mediaType ) {
"""
Equivalent to {@link com.tngtech.jgiven.attachment.Attachment#Attachment(String, MediaType)}
@throws java.lang.IllegalArgumentException if mediaType is not binary
"""
if( !mediaType.isBinary() ) {
... | java | public static Attachment fromBase64( String base64encodedContent, MediaType mediaType ) {
if( !mediaType.isBinary() ) {
throw new IllegalArgumentException( "MediaType must be binary" );
}
return new Attachment( base64encodedContent, mediaType );
} | [
"public",
"static",
"Attachment",
"fromBase64",
"(",
"String",
"base64encodedContent",
",",
"MediaType",
"mediaType",
")",
"{",
"if",
"(",
"!",
"mediaType",
".",
"isBinary",
"(",
")",
")",
"{",
"throw",
"new",
"IllegalArgumentException",
"(",
"\"MediaType must be ... | Equivalent to {@link com.tngtech.jgiven.attachment.Attachment#Attachment(String, MediaType)}
@throws java.lang.IllegalArgumentException if mediaType is not binary | [
"Equivalent",
"to",
"{"
] | train | https://github.com/TNG/JGiven/blob/1a69248fc6d7eb380cdc4542e3be273842889748/jgiven-core/src/main/java/com/tngtech/jgiven/attachment/Attachment.java#L277-L282 |
netscaler/nitro | src/main/java/com/citrix/netscaler/nitro/resource/stat/system/system_stats.java | system_stats.get_nitro_response | protected base_resource[] get_nitro_response(nitro_service service, String response) throws Exception {
"""
<pre>
converts nitro response into object and returns the object array in case of get request.
</pre>
"""
system_stats[] resources = new system_stats[1];
system_response result = (system_response) ... | java | protected base_resource[] get_nitro_response(nitro_service service, String response) throws Exception {
system_stats[] resources = new system_stats[1];
system_response result = (system_response) service.get_payload_formatter().string_to_resource(system_response.class, response);
if(result.errorcode != 0) {
if ... | [
"protected",
"base_resource",
"[",
"]",
"get_nitro_response",
"(",
"nitro_service",
"service",
",",
"String",
"response",
")",
"throws",
"Exception",
"{",
"system_stats",
"[",
"]",
"resources",
"=",
"new",
"system_stats",
"[",
"1",
"]",
";",
"system_response",
"... | <pre>
converts nitro response into object and returns the object array in case of get request.
</pre> | [
"<pre",
">",
"converts",
"nitro",
"response",
"into",
"object",
"and",
"returns",
"the",
"object",
"array",
"in",
"case",
"of",
"get",
"request",
".",
"<",
"/",
"pre",
">"
] | train | https://github.com/netscaler/nitro/blob/2a98692dcf4e4ec430c7d7baab8382e4ba5a35e4/src/main/java/com/citrix/netscaler/nitro/resource/stat/system/system_stats.java#L695-L714 |
thymeleaf/thymeleaf | src/main/java/org/thymeleaf/TemplateEngine.java | TemplateEngine.setDialectsByPrefix | public void setDialectsByPrefix(final Map<String,IDialect> dialects) {
"""
<p>
Sets a new set of dialects for this template engine, referenced
by the prefixes they will be using.
</p>
<p>
This operation can only be executed before processing templates for the first
time. Once a template is processed, the tem... | java | public void setDialectsByPrefix(final Map<String,IDialect> dialects) {
Validate.notNull(dialects, "Dialect map cannot be null");
checkNotInitialized();
this.dialectConfigurations.clear();
for (final Map.Entry<String,IDialect> dialectEntry : dialects.entrySet()) {
addDialect(d... | [
"public",
"void",
"setDialectsByPrefix",
"(",
"final",
"Map",
"<",
"String",
",",
"IDialect",
">",
"dialects",
")",
"{",
"Validate",
".",
"notNull",
"(",
"dialects",
",",
"\"Dialect map cannot be null\"",
")",
";",
"checkNotInitialized",
"(",
")",
";",
"this",
... | <p>
Sets a new set of dialects for this template engine, referenced
by the prefixes they will be using.
</p>
<p>
This operation can only be executed before processing templates for the first
time. Once a template is processed, the template engine is considered to be
<i>initialized</i>, and from then on any attempt to c... | [
"<p",
">",
"Sets",
"a",
"new",
"set",
"of",
"dialects",
"for",
"this",
"template",
"engine",
"referenced",
"by",
"the",
"prefixes",
"they",
"will",
"be",
"using",
".",
"<",
"/",
"p",
">",
"<p",
">",
"This",
"operation",
"can",
"only",
"be",
"executed",... | train | https://github.com/thymeleaf/thymeleaf/blob/2b0e6d6d7571fbe638904b5fd222fc9e77188879/src/main/java/org/thymeleaf/TemplateEngine.java#L544-L551 |
galenframework/galen | galen-core/src/main/java/com/galenframework/generator/SpecGenerator.java | SpecGenerator.restructurePageItems | private List<PageItemNode> restructurePageItems(List<PageItem> items) {
"""
Orders page items into a tree by their area. Tries to fit one item inside another
@param items
@return A list of pins which are root elements (don't have a parent)
"""
List<PageItemNode> pins = items.stream().map(PageItemNode... | java | private List<PageItemNode> restructurePageItems(List<PageItem> items) {
List<PageItemNode> pins = items.stream().map(PageItemNode::new).collect(toList());
for (PageItemNode pinA : pins) {
for (PageItemNode pinB: pins) {
if (pinA != pinB) {
if (isInside(pin... | [
"private",
"List",
"<",
"PageItemNode",
">",
"restructurePageItems",
"(",
"List",
"<",
"PageItem",
">",
"items",
")",
"{",
"List",
"<",
"PageItemNode",
">",
"pins",
"=",
"items",
".",
"stream",
"(",
")",
".",
"map",
"(",
"PageItemNode",
"::",
"new",
")",... | Orders page items into a tree by their area. Tries to fit one item inside another
@param items
@return A list of pins which are root elements (don't have a parent) | [
"Orders",
"page",
"items",
"into",
"a",
"tree",
"by",
"their",
"area",
".",
"Tries",
"to",
"fit",
"one",
"item",
"inside",
"another"
] | train | https://github.com/galenframework/galen/blob/6c7dc1f11d097e6aa49c45d6a77ee688741657a4/galen-core/src/main/java/com/galenframework/generator/SpecGenerator.java#L145-L161 |
strator-dev/greenpepper | greenpepper/greenpepper-client/src/main/java/com/greenpepper/util/IOUtils.java | IOUtils.uniquePath | public static String uniquePath(String name, String ext) throws IOException {
"""
<p>uniquePath.</p>
@param name a {@link java.lang.String} object.
@param ext a {@link java.lang.String} object.
@return a {@link java.lang.String} object.
@throws java.io.IOException if any.
"""
File file = File.cre... | java | public static String uniquePath(String name, String ext) throws IOException
{
File file = File.createTempFile(name, ext);
String path = file.getAbsolutePath();
file.delete();
return path;
} | [
"public",
"static",
"String",
"uniquePath",
"(",
"String",
"name",
",",
"String",
"ext",
")",
"throws",
"IOException",
"{",
"File",
"file",
"=",
"File",
".",
"createTempFile",
"(",
"name",
",",
"ext",
")",
";",
"String",
"path",
"=",
"file",
".",
"getAbs... | <p>uniquePath.</p>
@param name a {@link java.lang.String} object.
@param ext a {@link java.lang.String} object.
@return a {@link java.lang.String} object.
@throws java.io.IOException if any. | [
"<p",
">",
"uniquePath",
".",
"<",
"/",
"p",
">"
] | train | https://github.com/strator-dev/greenpepper/blob/2a61e6c179b74085babcc559d677490b0cad2d30/greenpepper/greenpepper-client/src/main/java/com/greenpepper/util/IOUtils.java#L53-L60 |
kiegroup/drools | drools-compiler/src/main/java/org/drools/compiler/builder/impl/KnowledgeBuilderImpl.java | KnowledgeBuilderImpl.addPackageFromDrl | public void addPackageFromDrl(final Reader reader) throws DroolsParserException,
IOException {
"""
Load a rule package from DRL source.
@throws DroolsParserException
@throws java.io.IOException
"""
addPackageFromDrl(reader, new ReaderResource(reader, ResourceType.DRL));
} | java | public void addPackageFromDrl(final Reader reader) throws DroolsParserException,
IOException {
addPackageFromDrl(reader, new ReaderResource(reader, ResourceType.DRL));
} | [
"public",
"void",
"addPackageFromDrl",
"(",
"final",
"Reader",
"reader",
")",
"throws",
"DroolsParserException",
",",
"IOException",
"{",
"addPackageFromDrl",
"(",
"reader",
",",
"new",
"ReaderResource",
"(",
"reader",
",",
"ResourceType",
".",
"DRL",
")",
")",
... | Load a rule package from DRL source.
@throws DroolsParserException
@throws java.io.IOException | [
"Load",
"a",
"rule",
"package",
"from",
"DRL",
"source",
"."
] | train | https://github.com/kiegroup/drools/blob/22b0275d6dbe93070b8090948502cf46eda543c4/drools-compiler/src/main/java/org/drools/compiler/builder/impl/KnowledgeBuilderImpl.java#L344-L347 |
RestComm/sip-servlets | sip-servlets-client/src/main/java/org/mobicents/servlet/sip/SipConnector.java | SipConnector.setKeepAliveTimeout | public boolean setKeepAliveTimeout(String ipAddress, int port, long timeout) throws Exception {
"""
Allow to reset the RFC5626 Section 4.4.1 keeplive on a given TCP/TLS/SCTP connection
@since 1.7
@param ipAddress
@param port
@param timeout
@return
@throws Exception
"""
MBeanServer mbeanServer = g... | java | public boolean setKeepAliveTimeout(String ipAddress, int port, long timeout) throws Exception {
MBeanServer mbeanServer = getMBeanServer();
Set<ObjectName> queryNames = mbeanServer.queryNames(new ObjectName("*:type=Service,*"), null);
boolean changed = false;
for(ObjectName objectName : queryNames) { ... | [
"public",
"boolean",
"setKeepAliveTimeout",
"(",
"String",
"ipAddress",
",",
"int",
"port",
",",
"long",
"timeout",
")",
"throws",
"Exception",
"{",
"MBeanServer",
"mbeanServer",
"=",
"getMBeanServer",
"(",
")",
";",
"Set",
"<",
"ObjectName",
">",
"queryNames",
... | Allow to reset the RFC5626 Section 4.4.1 keeplive on a given TCP/TLS/SCTP connection
@since 1.7
@param ipAddress
@param port
@param timeout
@return
@throws Exception | [
"Allow",
"to",
"reset",
"the",
"RFC5626",
"Section",
"4",
".",
"4",
".",
"1",
"keeplive",
"on",
"a",
"given",
"TCP",
"/",
"TLS",
"/",
"SCTP",
"connection",
"@since",
"1",
".",
"7"
] | train | https://github.com/RestComm/sip-servlets/blob/fd7011d2803ab1d205b140768a760c8c69e0c997/sip-servlets-client/src/main/java/org/mobicents/servlet/sip/SipConnector.java#L287-L299 |
exoplatform/jcr | exo.jcr.ext.services/src/main/java/org/exoplatform/services/jcr/ext/organization/MembershipHandlerImpl.java | MembershipHandlerImpl.findMembershipsByUser | private MembershipsByUserWrapper findMembershipsByUser(Session session, String userName) throws Exception {
"""
Use this method to find all the memberships of an user in any group.
"""
Node userNode;
try
{
userNode = utils.getUserNode(session, userName);
}
catch (PathNotF... | java | private MembershipsByUserWrapper findMembershipsByUser(Session session, String userName) throws Exception
{
Node userNode;
try
{
userNode = utils.getUserNode(session, userName);
}
catch (PathNotFoundException e)
{
return new MembershipsByUserWrapper(new ArrayList... | [
"private",
"MembershipsByUserWrapper",
"findMembershipsByUser",
"(",
"Session",
"session",
",",
"String",
"userName",
")",
"throws",
"Exception",
"{",
"Node",
"userNode",
";",
"try",
"{",
"userNode",
"=",
"utils",
".",
"getUserNode",
"(",
"session",
",",
"userName... | Use this method to find all the memberships of an user in any group. | [
"Use",
"this",
"method",
"to",
"find",
"all",
"the",
"memberships",
"of",
"an",
"user",
"in",
"any",
"group",
"."
] | train | https://github.com/exoplatform/jcr/blob/3e7f9ee1b5683640d73a4316fb4b0ad5eac5b8a2/exo.jcr.ext.services/src/main/java/org/exoplatform/services/jcr/ext/organization/MembershipHandlerImpl.java#L380-L406 |
codeprimate-software/cp-elements | src/main/java/org/cp/elements/lang/StringUtils.java | StringUtils.equalsIgnoreCase | @NullSafe
public static boolean equalsIgnoreCase(String stringOne, String stringTwo) {
"""
Determines whether two String values are equal in value ignoring case and guarding against null values.
@param stringOne the first String value in the case-insensitive equality comparison.
@param stringTwo the second S... | java | @NullSafe
public static boolean equalsIgnoreCase(String stringOne, String stringTwo) {
return stringOne != null && stringOne.equalsIgnoreCase(stringTwo);
} | [
"@",
"NullSafe",
"public",
"static",
"boolean",
"equalsIgnoreCase",
"(",
"String",
"stringOne",
",",
"String",
"stringTwo",
")",
"{",
"return",
"stringOne",
"!=",
"null",
"&&",
"stringOne",
".",
"equalsIgnoreCase",
"(",
"stringTwo",
")",
";",
"}"
] | Determines whether two String values are equal in value ignoring case and guarding against null values.
@param stringOne the first String value in the case-insensitive equality comparison.
@param stringTwo the second String value in the case-insensitive equality comparison.
@return a boolean value indicating if the tw... | [
"Determines",
"whether",
"two",
"String",
"values",
"are",
"equal",
"in",
"value",
"ignoring",
"case",
"and",
"guarding",
"against",
"null",
"values",
"."
] | train | https://github.com/codeprimate-software/cp-elements/blob/f2163c149fbbef05015e688132064ebcac7c49ab/src/main/java/org/cp/elements/lang/StringUtils.java#L226-L229 |
OpenLiberty/open-liberty | dev/com.ibm.ws.dynacache/src/com/ibm/websphere/exception/DistributedExceptionInfo.java | DistributedExceptionInfo.setLocalizationInfo | public void setLocalizationInfo(String resourceBundleName, String resourceKey, Object[] formatArguments) {
"""
FOR WEBSPHERE INTERNAL USE ONLY
Set the localization information.
@param resourceBundleName java.lang.String
@param resourceKey java.lang.String
@param arguments java.lang.Object[]
"""
t... | java | public void setLocalizationInfo(String resourceBundleName, String resourceKey, Object[] formatArguments) {
this.resourceBundleName = resourceBundleName;
this.resourceKey = resourceKey;
this.formatArguments = formatArguments;
} | [
"public",
"void",
"setLocalizationInfo",
"(",
"String",
"resourceBundleName",
",",
"String",
"resourceKey",
",",
"Object",
"[",
"]",
"formatArguments",
")",
"{",
"this",
".",
"resourceBundleName",
"=",
"resourceBundleName",
";",
"this",
".",
"resourceKey",
"=",
"r... | FOR WEBSPHERE INTERNAL USE ONLY
Set the localization information.
@param resourceBundleName java.lang.String
@param resourceKey java.lang.String
@param arguments java.lang.Object[] | [
"FOR",
"WEBSPHERE",
"INTERNAL",
"USE",
"ONLY",
"Set",
"the",
"localization",
"information",
"."
] | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.dynacache/src/com/ibm/websphere/exception/DistributedExceptionInfo.java#L689-L693 |
aws/aws-sdk-java | aws-java-sdk-core/src/main/java/com/amazonaws/regions/Region.java | Region.createClient | @Deprecated
public <T extends AmazonWebServiceClient> T createClient(Class<T> serviceClass,
AWSCredentialsProvider credentials,
ClientConfiguration config) {
"""
Creates a new service clien... | java | @Deprecated
public <T extends AmazonWebServiceClient> T createClient(Class<T> serviceClass,
AWSCredentialsProvider credentials,
ClientConfiguration config) {
Constructor<T> constructor;
... | [
"@",
"Deprecated",
"public",
"<",
"T",
"extends",
"AmazonWebServiceClient",
">",
"T",
"createClient",
"(",
"Class",
"<",
"T",
">",
"serviceClass",
",",
"AWSCredentialsProvider",
"credentials",
",",
"ClientConfiguration",
"config",
")",
"{",
"Constructor",
"<",
"T"... | Creates a new service client of the class given and configures it. If
credentials or config are null, defaults will be used.
@param serviceClass The service client class to instantiate, e.g. AmazonS3Client.class
@param credentials The credentials provider to use, or null for the default
credentials provider
@param co... | [
"Creates",
"a",
"new",
"service",
"client",
"of",
"the",
"class",
"given",
"and",
"configures",
"it",
".",
"If",
"credentials",
"or",
"config",
"are",
"null",
"defaults",
"will",
"be",
"used",
"."
] | train | https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-core/src/main/java/com/amazonaws/regions/Region.java#L142-L168 |
khuxtable/seaglass | src/main/java/com/seaglasslookandfeel/ui/SeaGlassTextFieldUI.java | SeaGlassTextFieldUI.getPlaceholderText | private String getPlaceholderText(Graphics g, int availTextWidth) {
"""
Get the placeholder text, clipped if necessary.
@param g fm the font metrics to compute size with.
@param availTextWidth the available space to display the title in.
@return the text, clipped to fit the available space.
... | java | private String getPlaceholderText(Graphics g, int availTextWidth) {
JTextComponent c = getComponent();
FontMetrics fm = SwingUtilities2.getFontMetrics(c, g);
return SwingUtilities2.clipStringIfNecessary(c, fm, placeholderText, availTextWidth);
} | [
"private",
"String",
"getPlaceholderText",
"(",
"Graphics",
"g",
",",
"int",
"availTextWidth",
")",
"{",
"JTextComponent",
"c",
"=",
"getComponent",
"(",
")",
";",
"FontMetrics",
"fm",
"=",
"SwingUtilities2",
".",
"getFontMetrics",
"(",
"c",
",",
"g",
")",
"... | Get the placeholder text, clipped if necessary.
@param g fm the font metrics to compute size with.
@param availTextWidth the available space to display the title in.
@return the text, clipped to fit the available space. | [
"Get",
"the",
"placeholder",
"text",
"clipped",
"if",
"necessary",
"."
] | train | https://github.com/khuxtable/seaglass/blob/f25ecba622923d7b29b64cb7d6068dd8005989b3/src/main/java/com/seaglasslookandfeel/ui/SeaGlassTextFieldUI.java#L513-L518 |
HanSolo/SteelSeries-Swing | src/main/java/eu/hansolo/steelseries/gauges/AbstractRadial.java | AbstractRadial.create_BACKGROUND_Image | protected BufferedImage create_BACKGROUND_Image(final int WIDTH, final String TITLE, final String UNIT_STRING) {
"""
Returns the background image with the currently active backgroundcolor
with the given width, title and unitstring.
@param WIDTH
@param TITLE
@param UNIT_STRING
@return buffered image containing... | java | protected BufferedImage create_BACKGROUND_Image(final int WIDTH, final String TITLE, final String UNIT_STRING) {
return create_BACKGROUND_Image(WIDTH, TITLE, UNIT_STRING, null);
} | [
"protected",
"BufferedImage",
"create_BACKGROUND_Image",
"(",
"final",
"int",
"WIDTH",
",",
"final",
"String",
"TITLE",
",",
"final",
"String",
"UNIT_STRING",
")",
"{",
"return",
"create_BACKGROUND_Image",
"(",
"WIDTH",
",",
"TITLE",
",",
"UNIT_STRING",
",",
"null... | Returns the background image with the currently active backgroundcolor
with the given width, title and unitstring.
@param WIDTH
@param TITLE
@param UNIT_STRING
@return buffered image containing the background with the selected background design | [
"Returns",
"the",
"background",
"image",
"with",
"the",
"currently",
"active",
"backgroundcolor",
"with",
"the",
"given",
"width",
"title",
"and",
"unitstring",
"."
] | train | https://github.com/HanSolo/SteelSeries-Swing/blob/c2f7b45a477757ef21bbb6a1174ddedb2250ae57/src/main/java/eu/hansolo/steelseries/gauges/AbstractRadial.java#L1292-L1294 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.