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 |
|---|---|---|---|---|---|---|---|---|---|---|
xcesco/kripton | kripton/src/main/java/com/abubusoft/kripton/xml/XmlAttributeUtils.java | XmlAttributeUtils.getAttributeAsBoolean | public static boolean getAttributeAsBoolean(XmlPullParser parser, String attributeName, boolean defaultValue) throws Exception {
"""
Gets the attribute as boolean.
@param parser the parser
@param attributeName the attribute name
@param defaultValue the default value
@return get attribute as boolean
@throws ... | java | public static boolean getAttributeAsBoolean(XmlPullParser parser, String attributeName, boolean defaultValue) throws Exception {
// parser.getText()
String value = parser.getAttributeValue(null, attributeName);
if (!StringUtils.hasText(value)) {
return defaultValue;
}
return Boolean.parseBoolean(value);
... | [
"public",
"static",
"boolean",
"getAttributeAsBoolean",
"(",
"XmlPullParser",
"parser",
",",
"String",
"attributeName",
",",
"boolean",
"defaultValue",
")",
"throws",
"Exception",
"{",
"// parser.getText()",
"String",
"value",
"=",
"parser",
".",
"getAttributeValue",
... | Gets the attribute as boolean.
@param parser the parser
@param attributeName the attribute name
@param defaultValue the default value
@return get attribute as boolean
@throws Exception the exception | [
"Gets",
"the",
"attribute",
"as",
"boolean",
"."
] | train | https://github.com/xcesco/kripton/blob/90de2c0523d39b99e81b8d38aa996898762f594a/kripton/src/main/java/com/abubusoft/kripton/xml/XmlAttributeUtils.java#L37-L46 |
jbundle/jbundle | thin/base/db/base/src/main/java/org/jbundle/thin/base/db/mem/base/PTable.java | PTable.saveCurrentKeys | public void saveCurrentKeys(FieldTable table, BaseBuffer bufferToSave, boolean bResetKeys) throws DBException {
"""
Save the current key value's in the user's keyinfo space, so you can retrieve them later.
This is used primarly for updates and move()s.
@param table The table.
@return true if successful.
@excep... | java | public void saveCurrentKeys(FieldTable table, BaseBuffer bufferToSave, boolean bResetKeys) throws DBException
{
if (bufferToSave != null)
bufferToSave.bufferToFields(table.getRecord(), Constants.DONT_DISPLAY, Constants.READ_MOVE);
for (int iKeyArea = Constants.MAIN_KEY_AREA; iKeyArea < t... | [
"public",
"void",
"saveCurrentKeys",
"(",
"FieldTable",
"table",
",",
"BaseBuffer",
"bufferToSave",
",",
"boolean",
"bResetKeys",
")",
"throws",
"DBException",
"{",
"if",
"(",
"bufferToSave",
"!=",
"null",
")",
"bufferToSave",
".",
"bufferToFields",
"(",
"table",
... | Save the current key value's in the user's keyinfo space, so you can retrieve them later.
This is used primarly for updates and move()s.
@param table The table.
@return true if successful.
@exception DBException File exception. | [
"Save",
"the",
"current",
"key",
"value",
"s",
"in",
"the",
"user",
"s",
"keyinfo",
"space",
"so",
"you",
"can",
"retrieve",
"them",
"later",
".",
"This",
"is",
"used",
"primarly",
"for",
"updates",
"and",
"move",
"()",
"s",
"."
] | train | https://github.com/jbundle/jbundle/blob/4037fcfa85f60c7d0096c453c1a3cd573c2b0abc/thin/base/db/base/src/main/java/org/jbundle/thin/base/db/mem/base/PTable.java#L506-L518 |
elki-project/elki | elki-clustering/src/main/java/de/lmu/ifi/dbs/elki/algorithm/clustering/kmeans/AbstractKMeans.java | AbstractKMeans.minusEquals | public static void minusEquals(double[] sum, NumberVector vec) {
"""
Similar to VMath.minusEquals, but accepts a number vector.
@param sum Aggregation array
@param vec Vector to subtract
"""
for(int d = 0; d < sum.length; d++) {
sum[d] -= vec.doubleValue(d);
}
} | java | public static void minusEquals(double[] sum, NumberVector vec) {
for(int d = 0; d < sum.length; d++) {
sum[d] -= vec.doubleValue(d);
}
} | [
"public",
"static",
"void",
"minusEquals",
"(",
"double",
"[",
"]",
"sum",
",",
"NumberVector",
"vec",
")",
"{",
"for",
"(",
"int",
"d",
"=",
"0",
";",
"d",
"<",
"sum",
".",
"length",
";",
"d",
"++",
")",
"{",
"sum",
"[",
"d",
"]",
"-=",
"vec",... | Similar to VMath.minusEquals, but accepts a number vector.
@param sum Aggregation array
@param vec Vector to subtract | [
"Similar",
"to",
"VMath",
".",
"minusEquals",
"but",
"accepts",
"a",
"number",
"vector",
"."
] | train | https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-clustering/src/main/java/de/lmu/ifi/dbs/elki/algorithm/clustering/kmeans/AbstractKMeans.java#L195-L199 |
haraldk/TwelveMonkeys | common/common-lang/src/main/java/com/twelvemonkeys/lang/StringUtil.java | StringUtil.ensureIncludesAt | static String ensureIncludesAt(String pSource, String pSubstring, int pPosition) {
"""
Ensures that a string includes a given substring at a given position.
<p/>
Extends the string with a given string if it is not already there.
E.g an URL "www.vg.no", to "http://www.vg.no".
@param pSource The source stri... | java | static String ensureIncludesAt(String pSource, String pSubstring, int pPosition) {
StringBuilder newString = new StringBuilder(pSource);
try {
String existingSubstring = pSource.substring(pPosition, pPosition + pSubstring.length());
if (!existingSubstring.equalsIgnoreCase... | [
"static",
"String",
"ensureIncludesAt",
"(",
"String",
"pSource",
",",
"String",
"pSubstring",
",",
"int",
"pPosition",
")",
"{",
"StringBuilder",
"newString",
"=",
"new",
"StringBuilder",
"(",
"pSource",
")",
";",
"try",
"{",
"String",
"existingSubstring",
"=",... | Ensures that a string includes a given substring at a given position.
<p/>
Extends the string with a given string if it is not already there.
E.g an URL "www.vg.no", to "http://www.vg.no".
@param pSource The source string.
@param pSubstring The substring to include.
@param pPosition The location of the fill-in, th... | [
"Ensures",
"that",
"a",
"string",
"includes",
"a",
"given",
"substring",
"at",
"a",
"given",
"position",
".",
"<p",
"/",
">",
"Extends",
"the",
"string",
"with",
"a",
"given",
"string",
"if",
"it",
"is",
"not",
"already",
"there",
".",
"E",
".",
"g",
... | train | https://github.com/haraldk/TwelveMonkeys/blob/7fad4d5cd8cb3a6728c7fd3f28a7b84d8ce0101d/common/common-lang/src/main/java/com/twelvemonkeys/lang/StringUtil.java#L1368-L1382 |
eurekaclinical/eurekaclinical-common | src/main/java/org/eurekaclinical/common/comm/clients/EurekaClinicalClient.java | EurekaClinicalClient.doPostCreateMultipart | protected URI doPostCreateMultipart(String path, InputStream inputStream, MultivaluedMap<String, String> headers) throws ClientException {
"""
Creates a resource specified as a multi-part form in an input stream.
@param path the the API to call.
@param inputStream the multi-part form content.
@param headers a... | java | protected URI doPostCreateMultipart(String path, InputStream inputStream, MultivaluedMap<String, String> headers) throws ClientException {
this.readLock.lock();
try {
WebResource.Builder requestBuilder = getResourceWrapper().rewritten(path, HttpMethod.POST).getRequestBuilder();
r... | [
"protected",
"URI",
"doPostCreateMultipart",
"(",
"String",
"path",
",",
"InputStream",
"inputStream",
",",
"MultivaluedMap",
"<",
"String",
",",
"String",
">",
"headers",
")",
"throws",
"ClientException",
"{",
"this",
".",
"readLock",
".",
"lock",
"(",
")",
"... | Creates a resource specified as a multi-part form in an input stream.
@param path the the API to call.
@param inputStream the multi-part form content.
@param headers any headers to send. If no Accepts header is provided,
this method as an Accepts header for text/plain. If no Content Type
header is provided, this metho... | [
"Creates",
"a",
"resource",
"specified",
"as",
"a",
"multi",
"-",
"part",
"form",
"in",
"an",
"input",
"stream",
"."
] | train | https://github.com/eurekaclinical/eurekaclinical-common/blob/1867102ff43fe94e519f76a074d5f5923e9be61c/src/main/java/org/eurekaclinical/common/comm/clients/EurekaClinicalClient.java#L802-L819 |
xhsun/gw2wrapper | src/main/java/me/xhsun/guildwars2wrapper/AsynchronousRequest.java | AsynchronousRequest.getWvWObjectiveInfo | public void getWvWObjectiveInfo(String[] ids, Callback<List<WvWObjective>> callback) throws GuildWars2Exception, NullPointerException {
"""
For more info on WvW abilities API go <a href="https://wiki.guildwars2.com/wiki/API:2/wvw/abilities">here</a><br/>
Give user the access to {@link Callback#onResponse(Call, Re... | java | public void getWvWObjectiveInfo(String[] ids, Callback<List<WvWObjective>> callback) throws GuildWars2Exception, NullPointerException {
isParamValid(new ParamChecker(ids));
gw2API.getWvWObjectiveInfo(processIds(ids), GuildWars2.lang.getValue()).enqueue(callback);
} | [
"public",
"void",
"getWvWObjectiveInfo",
"(",
"String",
"[",
"]",
"ids",
",",
"Callback",
"<",
"List",
"<",
"WvWObjective",
">",
">",
"callback",
")",
"throws",
"GuildWars2Exception",
",",
"NullPointerException",
"{",
"isParamValid",
"(",
"new",
"ParamChecker",
... | For more info on WvW abilities API go <a href="https://wiki.guildwars2.com/wiki/API:2/wvw/abilities">here</a><br/>
Give user the access to {@link Callback#onResponse(Call, Response)} and {@link Callback#onFailure(Call, Throwable)} methods for custom interactions
@param ids list of WvW objective id
@param callback... | [
"For",
"more",
"info",
"on",
"WvW",
"abilities",
"API",
"go",
"<a",
"href",
"=",
"https",
":",
"//",
"wiki",
".",
"guildwars2",
".",
"com",
"/",
"wiki",
"/",
"API",
":",
"2",
"/",
"wvw",
"/",
"abilities",
">",
"here<",
"/",
"a",
">",
"<br",
"/",
... | train | https://github.com/xhsun/gw2wrapper/blob/c8a43b51f363b032074fb152ee6efe657e33e525/src/main/java/me/xhsun/guildwars2wrapper/AsynchronousRequest.java#L2737-L2740 |
CenturyLinkCloud/mdw | mdw-services/src/com/centurylink/mdw/services/event/EventServicesImpl.java | EventServicesImpl.getProcessInstance | public ProcessInstance getProcessInstance(Long procInstId)
throws ProcessException, DataAccessException {
"""
Returns the ProcessInstance identified by the passed in Id
@param procInstId
@return ProcessInstance
"""
TransactionWrapper transaction = null;
EngineDataAccessDB edao = new Eng... | java | public ProcessInstance getProcessInstance(Long procInstId)
throws ProcessException, DataAccessException {
TransactionWrapper transaction = null;
EngineDataAccessDB edao = new EngineDataAccessDB();
try {
transaction = edao.startTransaction();
return edao.getProcessInst... | [
"public",
"ProcessInstance",
"getProcessInstance",
"(",
"Long",
"procInstId",
")",
"throws",
"ProcessException",
",",
"DataAccessException",
"{",
"TransactionWrapper",
"transaction",
"=",
"null",
";",
"EngineDataAccessDB",
"edao",
"=",
"new",
"EngineDataAccessDB",
"(",
... | Returns the ProcessInstance identified by the passed in Id
@param procInstId
@return ProcessInstance | [
"Returns",
"the",
"ProcessInstance",
"identified",
"by",
"the",
"passed",
"in",
"Id"
] | train | https://github.com/CenturyLinkCloud/mdw/blob/91167fe65a25a5d7022cdcf8b0fae8506f5b87ce/mdw-services/src/com/centurylink/mdw/services/event/EventServicesImpl.java#L351-L364 |
baidubce/bce-sdk-java | src/main/java/com/baidubce/services/lss/LssClient.java | LssClient.listDomainStatistics | public ListDomainStatisticsResponse listDomainStatistics(ListDomainStatisticsRequest request) {
"""
list domain's statistics in the live stream service.
@param request The request object containing all options for listing domain's traffic statistics
@return the response
"""
checkNotNull(request, "T... | java | public ListDomainStatisticsResponse listDomainStatistics(ListDomainStatisticsRequest request) {
checkNotNull(request, "The parameter request should NOT be null.");
checkStringNotEmpty(request.getStartTime(), "startTime should NOT be empty");
InternalRequest internalRequest = createRequest(Http... | [
"public",
"ListDomainStatisticsResponse",
"listDomainStatistics",
"(",
"ListDomainStatisticsRequest",
"request",
")",
"{",
"checkNotNull",
"(",
"request",
",",
"\"The parameter request should NOT be null.\"",
")",
";",
"checkStringNotEmpty",
"(",
"request",
".",
"getStartTime",... | list domain's statistics in the live stream service.
@param request The request object containing all options for listing domain's traffic statistics
@return the response | [
"list",
"domain",
"s",
"statistics",
"in",
"the",
"live",
"stream",
"service",
"."
] | train | https://github.com/baidubce/bce-sdk-java/blob/f7140f28dd82121515c88ded7bfe769a37d0ec4a/src/main/java/com/baidubce/services/lss/LssClient.java#L1989-L2010 |
foundation-runtime/service-directory | 2.0/sd-core/src/main/java/com/cisco/oss/foundation/directory/utils/ServiceInstanceUtils.java | ServiceInstanceUtils.isMustFieldValid | public static boolean isMustFieldValid(String field, String reg) {
"""
Validate the required field String against the regex.
@param field
the field value String.
@param reg
the regex.
@return
true if matched.
"""
if (field == null || field.length() == 0) {
return false;
}
... | java | public static boolean isMustFieldValid(String field, String reg) {
if (field == null || field.length() == 0) {
return false;
}
return Pattern.matches(reg, field);
} | [
"public",
"static",
"boolean",
"isMustFieldValid",
"(",
"String",
"field",
",",
"String",
"reg",
")",
"{",
"if",
"(",
"field",
"==",
"null",
"||",
"field",
".",
"length",
"(",
")",
"==",
"0",
")",
"{",
"return",
"false",
";",
"}",
"return",
"Pattern",
... | Validate the required field String against the regex.
@param field
the field value String.
@param reg
the regex.
@return
true if matched. | [
"Validate",
"the",
"required",
"field",
"String",
"against",
"the",
"regex",
"."
] | train | https://github.com/foundation-runtime/service-directory/blob/a7bdefe173dc99e75eff4a24e07e6407e62f2ed4/2.0/sd-core/src/main/java/com/cisco/oss/foundation/directory/utils/ServiceInstanceUtils.java#L75-L80 |
io7m/jcanephora | com.io7m.jcanephora.core/src/main/java/com/io7m/jcanephora/core/JCGLTextureUpdates.java | JCGLTextureUpdates.newUpdateReplacingAllCube | public static JCGLTextureCubeUpdateType newUpdateReplacingAllCube(
final JCGLTextureCubeUsableType t) {
"""
Create a new update that will replace the entirety of one face of {@code
t}.
@param t The texture
@return A new update
"""
NullCheck.notNull(t, "Texture");
return newUpdateReplacingAre... | java | public static JCGLTextureCubeUpdateType newUpdateReplacingAllCube(
final JCGLTextureCubeUsableType t)
{
NullCheck.notNull(t, "Texture");
return newUpdateReplacingAreaCube(t, AreaSizesL.area(t.size()));
} | [
"public",
"static",
"JCGLTextureCubeUpdateType",
"newUpdateReplacingAllCube",
"(",
"final",
"JCGLTextureCubeUsableType",
"t",
")",
"{",
"NullCheck",
".",
"notNull",
"(",
"t",
",",
"\"Texture\"",
")",
";",
"return",
"newUpdateReplacingAreaCube",
"(",
"t",
",",
"AreaSiz... | Create a new update that will replace the entirety of one face of {@code
t}.
@param t The texture
@return A new update | [
"Create",
"a",
"new",
"update",
"that",
"will",
"replace",
"the",
"entirety",
"of",
"one",
"face",
"of",
"{",
"@code",
"t",
"}",
"."
] | train | https://github.com/io7m/jcanephora/blob/0004c1744b7f0969841d04cd4fa693f402b10980/com.io7m.jcanephora.core/src/main/java/com/io7m/jcanephora/core/JCGLTextureUpdates.java#L50-L55 |
xwiki/xwiki-commons | xwiki-commons-core/xwiki-commons-crypto/xwiki-commons-crypto-pkix/src/main/java/org/xwiki/crypto/pkix/internal/BcUtils.java | BcUtils.updateDEREncodedObject | public static Signer updateDEREncodedObject(Signer signer, ASN1Encodable tbsObj)
throws IOException {
"""
DER encode an ASN.1 object into the given signer and return the signer.
@param signer a signer.
@param tbsObj the object to sign.
@return a the signer for chaining.
@throws java.io.IOException on... | java | public static Signer updateDEREncodedObject(Signer signer, ASN1Encodable tbsObj)
throws IOException
{
OutputStream sOut = signer.getOutputStream();
DEROutputStream dOut = new DEROutputStream(sOut);
dOut.writeObject(tbsObj);
sOut.close();
return signer;
} | [
"public",
"static",
"Signer",
"updateDEREncodedObject",
"(",
"Signer",
"signer",
",",
"ASN1Encodable",
"tbsObj",
")",
"throws",
"IOException",
"{",
"OutputStream",
"sOut",
"=",
"signer",
".",
"getOutputStream",
"(",
")",
";",
"DEROutputStream",
"dOut",
"=",
"new",... | DER encode an ASN.1 object into the given signer and return the signer.
@param signer a signer.
@param tbsObj the object to sign.
@return a the signer for chaining.
@throws java.io.IOException on encoding error. | [
"DER",
"encode",
"an",
"ASN",
".",
"1",
"object",
"into",
"the",
"given",
"signer",
"and",
"return",
"the",
"signer",
"."
] | train | https://github.com/xwiki/xwiki-commons/blob/5374d8c6d966588c1eac7392c83da610dfb9f129/xwiki-commons-core/xwiki-commons-crypto/xwiki-commons-crypto-pkix/src/main/java/org/xwiki/crypto/pkix/internal/BcUtils.java#L177-L188 |
paypal/SeLion | client/src/main/java/com/paypal/selion/platform/html/AbstractContainer.java | AbstractContainer.locateElement | public WebElement locateElement(int index, String childLocator) {
"""
Sets the container index and searches for the descendant element using the child locator.
@param index
index of the container element to search on
@param childLocator
locator of the child element within the container
@return child WebElem... | java | public WebElement locateElement(int index, String childLocator) {
if (index < 0) {
throw new IllegalArgumentException("index cannot be a negative value");
}
setIndex(index);
WebElement locatedElement = null;
if (getParent() != null) {
locatedElement = getP... | [
"public",
"WebElement",
"locateElement",
"(",
"int",
"index",
",",
"String",
"childLocator",
")",
"{",
"if",
"(",
"index",
"<",
"0",
")",
"{",
"throw",
"new",
"IllegalArgumentException",
"(",
"\"index cannot be a negative value\"",
")",
";",
"}",
"setIndex",
"("... | Sets the container index and searches for the descendant element using the child locator.
@param index
index of the container element to search on
@param childLocator
locator of the child element within the container
@return child WebElement found using child locator at the indexed container | [
"Sets",
"the",
"container",
"index",
"and",
"searches",
"for",
"the",
"descendant",
"element",
"using",
"the",
"child",
"locator",
"."
] | train | https://github.com/paypal/SeLion/blob/694d12d0df76db48d0360b16192770c6a4fbdfd2/client/src/main/java/com/paypal/selion/platform/html/AbstractContainer.java#L302-L314 |
grails/gorm-hibernate5 | grails-datastore-gorm-hibernate5/src/main/groovy/org/grails/orm/hibernate/cfg/GrailsDomainBinder.java | GrailsDomainBinder.bindRoot | public void bindRoot(HibernatePersistentEntity entity, InFlightMetadataCollector mappings, String sessionFactoryBeanName) {
"""
Binds a root class (one with no super classes) to the runtime meta model
based on the supplied Grails domain class
@param entity The Grails domain class
@param mappings The Hibern... | java | public void bindRoot(HibernatePersistentEntity entity, InFlightMetadataCollector mappings, String sessionFactoryBeanName) {
if (mappings.getEntityBinding(entity.getName()) != null) {
LOG.info("[GrailsDomainBinder] Class [" + entity.getName() + "] is already mapped, skipping.. ");
return;... | [
"public",
"void",
"bindRoot",
"(",
"HibernatePersistentEntity",
"entity",
",",
"InFlightMetadataCollector",
"mappings",
",",
"String",
"sessionFactoryBeanName",
")",
"{",
"if",
"(",
"mappings",
".",
"getEntityBinding",
"(",
"entity",
".",
"getName",
"(",
")",
")",
... | Binds a root class (one with no super classes) to the runtime meta model
based on the supplied Grails domain class
@param entity The Grails domain class
@param mappings The Hibernate Mappings object
@param sessionFactoryBeanName the session factory bean name | [
"Binds",
"a",
"root",
"class",
"(",
"one",
"with",
"no",
"super",
"classes",
")",
"to",
"the",
"runtime",
"meta",
"model",
"based",
"on",
"the",
"supplied",
"Grails",
"domain",
"class"
] | train | https://github.com/grails/gorm-hibernate5/blob/0ebb80cd769ef2bea955723d4543828a3e9542ef/grails-datastore-gorm-hibernate5/src/main/groovy/org/grails/orm/hibernate/cfg/GrailsDomainBinder.java#L1374-L1409 |
Azure/azure-sdk-for-java | kusto/resource-manager/v2018_09_07_preview/src/main/java/com/microsoft/azure/management/kusto/v2018_09_07_preview/implementation/EventHubConnectionsInner.java | EventHubConnectionsInner.beginCreateOrUpdateAsync | public Observable<EventHubConnectionInner> beginCreateOrUpdateAsync(String resourceGroupName, String clusterName, String databaseName, String eventHubConnectionName, EventHubConnectionInner parameters) {
"""
Creates or updates a Event Hub connection.
@param resourceGroupName The name of the resource group conta... | java | public Observable<EventHubConnectionInner> beginCreateOrUpdateAsync(String resourceGroupName, String clusterName, String databaseName, String eventHubConnectionName, EventHubConnectionInner parameters) {
return beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, clusterName, databaseName, eventHubCon... | [
"public",
"Observable",
"<",
"EventHubConnectionInner",
">",
"beginCreateOrUpdateAsync",
"(",
"String",
"resourceGroupName",
",",
"String",
"clusterName",
",",
"String",
"databaseName",
",",
"String",
"eventHubConnectionName",
",",
"EventHubConnectionInner",
"parameters",
"... | Creates or updates a Event Hub connection.
@param resourceGroupName The name of the resource group containing the Kusto cluster.
@param clusterName The name of the Kusto cluster.
@param databaseName The name of the database in the Kusto cluster.
@param eventHubConnectionName The name of the event hub connection.
@para... | [
"Creates",
"or",
"updates",
"a",
"Event",
"Hub",
"connection",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/kusto/resource-manager/v2018_09_07_preview/src/main/java/com/microsoft/azure/management/kusto/v2018_09_07_preview/implementation/EventHubConnectionsInner.java#L535-L542 |
jeremybrooks/jinx | src/main/java/net/jeremybrooks/jinx/api/PhotosLicensesApi.java | PhotosLicensesApi.setLicense | public Response setLicense(String photoId, Integer licenseId) throws JinxException {
"""
Sets the license for a photo.
<br>
This method requires authentication with 'write' permission.
@param photoId (Required) The photo to update the license for.
@param licenseId (Required) The license to apply, or 0 (zer... | java | public Response setLicense(String photoId, Integer licenseId) throws JinxException {
JinxUtils.validateParams(photoId, licenseId);
Map<String, String> params = new TreeMap<>();
params.put("method", "flickr.photos.licenses.setLicense");
params.put("photo_id", photoId);
params.put("license_id", licens... | [
"public",
"Response",
"setLicense",
"(",
"String",
"photoId",
",",
"Integer",
"licenseId",
")",
"throws",
"JinxException",
"{",
"JinxUtils",
".",
"validateParams",
"(",
"photoId",
",",
"licenseId",
")",
";",
"Map",
"<",
"String",
",",
"String",
">",
"params",
... | Sets the license for a photo.
<br>
This method requires authentication with 'write' permission.
@param photoId (Required) The photo to update the license for.
@param licenseId (Required) The license to apply, or 0 (zero) to remove the current license.
Note: as of this writing the "no known copyright restrictions" li... | [
"Sets",
"the",
"license",
"for",
"a",
"photo",
".",
"<br",
">",
"This",
"method",
"requires",
"authentication",
"with",
"write",
"permission",
"."
] | train | https://github.com/jeremybrooks/jinx/blob/ab7a4b7462d08bcbfd9b98bd3f5029771c20f6c6/src/main/java/net/jeremybrooks/jinx/api/PhotosLicensesApi.java#L71-L78 |
igniterealtime/Smack | smack-im/src/main/java/org/jivesoftware/smack/roster/Roster.java | Roster.preApproveAndCreateEntry | public void preApproveAndCreateEntry(BareJid user, String name, String[] groups) throws NotLoggedInException, NoResponseException, XMPPErrorException, NotConnectedException, InterruptedException, FeatureNotSupportedException {
"""
Creates a new pre-approved roster entry and presence subscription. The server will
... | java | public void preApproveAndCreateEntry(BareJid user, String name, String[] groups) throws NotLoggedInException, NoResponseException, XMPPErrorException, NotConnectedException, InterruptedException, FeatureNotSupportedException {
preApprove(user);
createItemAndRequestSubscription(user, name, groups);
} | [
"public",
"void",
"preApproveAndCreateEntry",
"(",
"BareJid",
"user",
",",
"String",
"name",
",",
"String",
"[",
"]",
"groups",
")",
"throws",
"NotLoggedInException",
",",
"NoResponseException",
",",
"XMPPErrorException",
",",
"NotConnectedException",
",",
"Interrupte... | Creates a new pre-approved roster entry and presence subscription. The server will
asynchronously update the roster with the subscription status.
@param user the user. (e.g. johndoe@jabber.org)
@param name the nickname of the user.
@param groups the list of group names the entry will belong to, or <tt>null</tt> if... | [
"Creates",
"a",
"new",
"pre",
"-",
"approved",
"roster",
"entry",
"and",
"presence",
"subscription",
".",
"The",
"server",
"will",
"asynchronously",
"update",
"the",
"roster",
"with",
"the",
"subscription",
"status",
"."
] | train | https://github.com/igniterealtime/Smack/blob/870756997faec1e1bfabfac0cd6c2395b04da873/smack-im/src/main/java/org/jivesoftware/smack/roster/Roster.java#L729-L732 |
cdk/cdk | tool/tautomer/src/main/java/org/openscience/cdk/tautomers/InChITautomerGenerator.java | InChITautomerGenerator.getElementsByPosition | private Map<Integer, IAtom> getElementsByPosition(String inputInchi, IAtomContainer inputMolecule)
throws CDKException {
"""
Parses the InChI's formula (ignoring hydrogen) and returns a map
with with a position for each atom, increasing in the order
of the elements as listed in the formula.
@param i... | java | private Map<Integer, IAtom> getElementsByPosition(String inputInchi, IAtomContainer inputMolecule)
throws CDKException {
Map<Integer, IAtom> inchiAtomsByPosition = new HashMap<Integer, IAtom>();
int position = 0;
String inchi = inputInchi;
inchi = inchi.substring(inchi.index... | [
"private",
"Map",
"<",
"Integer",
",",
"IAtom",
">",
"getElementsByPosition",
"(",
"String",
"inputInchi",
",",
"IAtomContainer",
"inputMolecule",
")",
"throws",
"CDKException",
"{",
"Map",
"<",
"Integer",
",",
"IAtom",
">",
"inchiAtomsByPosition",
"=",
"new",
"... | Parses the InChI's formula (ignoring hydrogen) and returns a map
with with a position for each atom, increasing in the order
of the elements as listed in the formula.
@param inputInchi user input InChI
@param inputMolecule user input molecule
@return <Integer,IAtom> map indicating position and atom | [
"Parses",
"the",
"InChI",
"s",
"formula",
"(",
"ignoring",
"hydrogen",
")",
"and",
"returns",
"a",
"map",
"with",
"with",
"a",
"position",
"for",
"each",
"atom",
"increasing",
"in",
"the",
"order",
"of",
"the",
"elements",
"as",
"listed",
"in",
"the",
"f... | train | https://github.com/cdk/cdk/blob/c3d0f16502bf08df50365fee392e11d7c9856657/tool/tautomer/src/main/java/org/openscience/cdk/tautomers/InChITautomerGenerator.java#L200-L247 |
amzn/ion-java | src/com/amazon/ion/impl/IonWriterSystemTextMarkup.java | IonWriterSystemTextMarkup.writeBlob | @Override
public void writeBlob(byte[] value, int start, int len)
throws IOException {
"""
================ Customer Methods for writing Ion data. ================
"""
myTypeBeingWritten = IonType.BLOB;
super.writeBlob(value, start, len);
myTypeBeingWritten = null;
} | java | @Override
public void writeBlob(byte[] value, int start, int len)
throws IOException
{
myTypeBeingWritten = IonType.BLOB;
super.writeBlob(value, start, len);
myTypeBeingWritten = null;
} | [
"@",
"Override",
"public",
"void",
"writeBlob",
"(",
"byte",
"[",
"]",
"value",
",",
"int",
"start",
",",
"int",
"len",
")",
"throws",
"IOException",
"{",
"myTypeBeingWritten",
"=",
"IonType",
".",
"BLOB",
";",
"super",
".",
"writeBlob",
"(",
"value",
",... | ================ Customer Methods for writing Ion data. ================ | [
"================",
"Customer",
"Methods",
"for",
"writing",
"Ion",
"data",
".",
"================"
] | train | https://github.com/amzn/ion-java/blob/4ce1f0f58c6a5a8e42d0425ccdb36e38be3e2270/src/com/amazon/ion/impl/IonWriterSystemTextMarkup.java#L150-L157 |
jbundle/jbundle | app/program/manual/util/src/main/java/org/jbundle/app/program/manual/util/WriteClass.java | WriteClass.writeTextField | public boolean writeTextField(BaseField textField, String strBaseClass, String strMethodName, String strMethodInterface, String strClassName) {
"""
Write this text field out - line by line.
@return true if "super" found in text.
"""
if (textField.getString().length() == 0)
return false;
... | java | public boolean writeTextField(BaseField textField, String strBaseClass, String strMethodName, String strMethodInterface, String strClassName)
{
if (textField.getString().length() == 0)
return false;
String beforeMethodCode; //, currentString;
beforeMethodCode = textField.getSt... | [
"public",
"boolean",
"writeTextField",
"(",
"BaseField",
"textField",
",",
"String",
"strBaseClass",
",",
"String",
"strMethodName",
",",
"String",
"strMethodInterface",
",",
"String",
"strClassName",
")",
"{",
"if",
"(",
"textField",
".",
"getString",
"(",
")",
... | Write this text field out - line by line.
@return true if "super" found in text. | [
"Write",
"this",
"text",
"field",
"out",
"-",
"line",
"by",
"line",
"."
] | train | https://github.com/jbundle/jbundle/blob/4037fcfa85f60c7d0096c453c1a3cd573c2b0abc/app/program/manual/util/src/main/java/org/jbundle/app/program/manual/util/WriteClass.java#L1025-L1043 |
gmessner/gitlab4j-api | src/main/java/org/gitlab4j/api/JobApi.java | JobApi.downloadArtifactsFile | public InputStream downloadArtifactsFile(Object projectIdOrPath, Integer jobId, ArtifactsFile artifactsFile) throws GitLabApiException {
"""
Download a single artifact file from within the job's artifacts archive.
Only a single file is going to be extracted from the archive and streamed to a client.
<pre><co... | java | public InputStream downloadArtifactsFile(Object projectIdOrPath, Integer jobId, ArtifactsFile artifactsFile) throws GitLabApiException {
Response response = get(Response.Status.OK, getDefaultPerPageParam(),
"projects", getProjectIdOrPath(projectIdOrPath), "jobs", jobId, "artifacts", artifactsFil... | [
"public",
"InputStream",
"downloadArtifactsFile",
"(",
"Object",
"projectIdOrPath",
",",
"Integer",
"jobId",
",",
"ArtifactsFile",
"artifactsFile",
")",
"throws",
"GitLabApiException",
"{",
"Response",
"response",
"=",
"get",
"(",
"Response",
".",
"Status",
".",
"OK... | Download a single artifact file from within the job's artifacts archive.
Only a single file is going to be extracted from the archive and streamed to a client.
<pre><code>GitLab Endpoint: GET /projects/:id/jobs/:job_id/artifacts/*artifact_path</code></pre>
@param projectIdOrPath id, path of the project, or a Project... | [
"Download",
"a",
"single",
"artifact",
"file",
"from",
"within",
"the",
"job",
"s",
"artifacts",
"archive",
"."
] | train | https://github.com/gmessner/gitlab4j-api/blob/ab045070abac0a8f4ccbf17b5ed9bfdef5723eed/src/main/java/org/gitlab4j/api/JobApi.java#L352-L356 |
phax/ph-commons | ph-datetime/src/main/java/com/helger/datetime/util/PDTXMLConverter.java | PDTXMLConverter.getXMLCalendarDate | @Nonnull
public static XMLGregorianCalendar getXMLCalendarDate (final int nYear, final int nMonth, final int nDay) {
"""
<p>
Create a Java representation of XML Schema builtin datatype
<code>date</code> or <code>g*</code>.
</p>
<p>
For example, an instance of <code>gYear</code> can be created invoking this
... | java | @Nonnull
public static XMLGregorianCalendar getXMLCalendarDate (final int nYear, final int nMonth, final int nDay)
{
return getXMLCalendarDate (nYear, nMonth, nDay, DatatypeConstants.FIELD_UNDEFINED);
} | [
"@",
"Nonnull",
"public",
"static",
"XMLGregorianCalendar",
"getXMLCalendarDate",
"(",
"final",
"int",
"nYear",
",",
"final",
"int",
"nMonth",
",",
"final",
"int",
"nDay",
")",
"{",
"return",
"getXMLCalendarDate",
"(",
"nYear",
",",
"nMonth",
",",
"nDay",
",",... | <p>
Create a Java representation of XML Schema builtin datatype
<code>date</code> or <code>g*</code>.
</p>
<p>
For example, an instance of <code>gYear</code> can be created invoking this
factory with <code>month</code> and <code>day</code> parameters set to
{@link DatatypeConstants#FIELD_UNDEFINED}.
</p>
<p>
A {@link D... | [
"<p",
">",
"Create",
"a",
"Java",
"representation",
"of",
"XML",
"Schema",
"builtin",
"datatype",
"<code",
">",
"date<",
"/",
"code",
">",
"or",
"<code",
">",
"g",
"*",
"<",
"/",
"code",
">",
".",
"<",
"/",
"p",
">",
"<p",
">",
"For",
"example",
... | train | https://github.com/phax/ph-commons/blob/d28c03565f44a0b804d96028d0969f9bb38c4313/ph-datetime/src/main/java/com/helger/datetime/util/PDTXMLConverter.java#L283-L287 |
eFaps/eFaps-Kernel | src/main/java/org/efaps/init/StartupDatabaseConnection.java | StartupDatabaseConnection.configureEFapsProperties | protected static void configureEFapsProperties(final Context _compCtx,
final Map<String, String> _eFapsProps)
throws StartupException {
"""
Add the eFaps Properties to the JNDI binding.
@param _compCtx Java root naming context
@param _eFapsProps P... | java | protected static void configureEFapsProperties(final Context _compCtx,
final Map<String, String> _eFapsProps)
throws StartupException
{
try {
Util.bind(_compCtx, "env/" + INamingBinds.RESOURCE_CONFIGPROPERTIES, _eFapsProps);
} ca... | [
"protected",
"static",
"void",
"configureEFapsProperties",
"(",
"final",
"Context",
"_compCtx",
",",
"final",
"Map",
"<",
"String",
",",
"String",
">",
"_eFapsProps",
")",
"throws",
"StartupException",
"{",
"try",
"{",
"Util",
".",
"bind",
"(",
"_compCtx",
","... | Add the eFaps Properties to the JNDI binding.
@param _compCtx Java root naming context
@param _eFapsProps Properties to bind
@throws StartupException on error | [
"Add",
"the",
"eFaps",
"Properties",
"to",
"the",
"JNDI",
"binding",
"."
] | train | https://github.com/eFaps/eFaps-Kernel/blob/04b96548f518c2386a93f5ec2b9349f9b9063859/src/main/java/org/efaps/init/StartupDatabaseConnection.java#L349-L362 |
rundeck/rundeck | core/src/main/java/com/dtolabs/rundeck/core/storage/AuthRundeckStorageTree.java | AuthRundeckStorageTree.authorizedPath | private boolean authorizedPath(AuthContext context, Path path, String action) {
"""
Evaluate access based on path
@param context auth context
@param path path
@param action action
@return true if authorized
"""
Decision evaluate = context.evaluate(
resourceForPath(path),
... | java | private boolean authorizedPath(AuthContext context, Path path, String action) {
Decision evaluate = context.evaluate(
resourceForPath(path),
action,
environmentForPath(path)
);
return evaluate.isAuthorized();
} | [
"private",
"boolean",
"authorizedPath",
"(",
"AuthContext",
"context",
",",
"Path",
"path",
",",
"String",
"action",
")",
"{",
"Decision",
"evaluate",
"=",
"context",
".",
"evaluate",
"(",
"resourceForPath",
"(",
"path",
")",
",",
"action",
",",
"environmentFo... | Evaluate access based on path
@param context auth context
@param path path
@param action action
@return true if authorized | [
"Evaluate",
"access",
"based",
"on",
"path"
] | train | https://github.com/rundeck/rundeck/blob/8070f774f55bffaa1118ff0c03aea319d40a9668/core/src/main/java/com/dtolabs/rundeck/core/storage/AuthRundeckStorageTree.java#L58-L65 |
census-instrumentation/opencensus-java | api/src/main/java/io/opencensus/trace/BigendianEncoding.java | BigendianEncoding.longFromBase16String | static long longFromBase16String(CharSequence chars, int offset) {
"""
Returns the {@code long} value whose base16 representation is stored in the first 16 chars of
{@code chars} starting from the {@code offset}.
@param chars the base16 representation of the {@code long}.
@param offset the starting offset in ... | java | static long longFromBase16String(CharSequence chars, int offset) {
Utils.checkArgument(chars.length() >= offset + LONG_BASE16, "chars too small");
return (decodeByte(chars.charAt(offset), chars.charAt(offset + 1)) & 0xFFL) << 56
| (decodeByte(chars.charAt(offset + 2), chars.charAt(offset + 3)) & 0xFFL) ... | [
"static",
"long",
"longFromBase16String",
"(",
"CharSequence",
"chars",
",",
"int",
"offset",
")",
"{",
"Utils",
".",
"checkArgument",
"(",
"chars",
".",
"length",
"(",
")",
">=",
"offset",
"+",
"LONG_BASE16",
",",
"\"chars too small\"",
")",
";",
"return",
... | Returns the {@code long} value whose base16 representation is stored in the first 16 chars of
{@code chars} starting from the {@code offset}.
@param chars the base16 representation of the {@code long}.
@param offset the starting offset in the {@code CharSequence}. | [
"Returns",
"the",
"{",
"@code",
"long",
"}",
"value",
"whose",
"base16",
"representation",
"is",
"stored",
"in",
"the",
"first",
"16",
"chars",
"of",
"{",
"@code",
"chars",
"}",
"starting",
"from",
"the",
"{",
"@code",
"offset",
"}",
"."
] | train | https://github.com/census-instrumentation/opencensus-java/blob/deefac9bed77e40a2297bff1ca5ec5aa48a5f755/api/src/main/java/io/opencensus/trace/BigendianEncoding.java#L98-L108 |
samskivert/samskivert | src/main/java/com/samskivert/servlet/user/UserRepository.java | UserRepository.loadAllRealNames | public String[] loadAllRealNames ()
throws PersistenceException {
"""
Returns an array with the real names of every user in the system.
"""
final ArrayList<String> names = new ArrayList<String>();
// do the query
execute(new Operation<Object>() {
public Object invok... | java | public String[] loadAllRealNames ()
throws PersistenceException
{
final ArrayList<String> names = new ArrayList<String>();
// do the query
execute(new Operation<Object>() {
public Object invoke (Connection conn, DatabaseLiaison liaison)
throws Persistence... | [
"public",
"String",
"[",
"]",
"loadAllRealNames",
"(",
")",
"throws",
"PersistenceException",
"{",
"final",
"ArrayList",
"<",
"String",
">",
"names",
"=",
"new",
"ArrayList",
"<",
"String",
">",
"(",
")",
";",
"// do the query",
"execute",
"(",
"new",
"Opera... | Returns an array with the real names of every user in the system. | [
"Returns",
"an",
"array",
"with",
"the",
"real",
"names",
"of",
"every",
"user",
"in",
"the",
"system",
"."
] | train | https://github.com/samskivert/samskivert/blob/a64d9ef42b69819bdb2c66bddac6a64caef928b6/src/main/java/com/samskivert/servlet/user/UserRepository.java#L341-L370 |
stevespringett/Alpine | alpine/src/main/java/alpine/auth/JsonWebToken.java | JsonWebToken.addDays | private Date addDays(final Date date, final int days) {
"""
Create a new future Date from the specified Date.
@param date The date to base the future date from
@param days The number of dates to + offset
@return a future date
"""
final Calendar cal = Calendar.getInstance();
cal.setTime(dat... | java | private Date addDays(final Date date, final int days) {
final Calendar cal = Calendar.getInstance();
cal.setTime(date);
cal.add(Calendar.DATE, days); //minus number would decrement the days
return cal.getTime();
} | [
"private",
"Date",
"addDays",
"(",
"final",
"Date",
"date",
",",
"final",
"int",
"days",
")",
"{",
"final",
"Calendar",
"cal",
"=",
"Calendar",
".",
"getInstance",
"(",
")",
";",
"cal",
".",
"setTime",
"(",
"date",
")",
";",
"cal",
".",
"add",
"(",
... | Create a new future Date from the specified Date.
@param date The date to base the future date from
@param days The number of dates to + offset
@return a future date | [
"Create",
"a",
"new",
"future",
"Date",
"from",
"the",
"specified",
"Date",
"."
] | train | https://github.com/stevespringett/Alpine/blob/6c5ef5e1ba4f38922096f1307d3950c09edb3093/alpine/src/main/java/alpine/auth/JsonWebToken.java#L176-L181 |
couchbase/couchbase-java-client | src/main/java/com/couchbase/client/java/subdoc/MutateInBuilder.java | MutateInBuilder.arrayPrepend | public <T> MutateInBuilder arrayPrepend(String path, T value) {
"""
Prepend to an existing array, pushing the value to the front/first position in
the array.
@param path the path of the array.
@param value the value to insert at the front of the array.
"""
asyncBuilder.arrayPrepend(path, value);
... | java | public <T> MutateInBuilder arrayPrepend(String path, T value) {
asyncBuilder.arrayPrepend(path, value);
return this;
} | [
"public",
"<",
"T",
">",
"MutateInBuilder",
"arrayPrepend",
"(",
"String",
"path",
",",
"T",
"value",
")",
"{",
"asyncBuilder",
".",
"arrayPrepend",
"(",
"path",
",",
"value",
")",
";",
"return",
"this",
";",
"}"
] | Prepend to an existing array, pushing the value to the front/first position in
the array.
@param path the path of the array.
@param value the value to insert at the front of the array. | [
"Prepend",
"to",
"an",
"existing",
"array",
"pushing",
"the",
"value",
"to",
"the",
"front",
"/",
"first",
"position",
"in",
"the",
"array",
"."
] | train | https://github.com/couchbase/couchbase-java-client/blob/f36a0ee0c66923bdde47838ca543e50cbaa99e14/src/main/java/com/couchbase/client/java/subdoc/MutateInBuilder.java#L707-L710 |
alkacon/opencms-core | src-modules/org/opencms/workplace/tools/modules/CmsModulesDependenciesList.java | CmsModulesDependenciesList.deleteDependency | private void deleteDependency(CmsModule module, String dependencyName) {
"""
Deletes a module dependency from a module.<p>
@param module the module to delete the dependency from
@param dependencyName the name of the dependcency to delete
"""
List oldDependencies = module.getDependencies();
... | java | private void deleteDependency(CmsModule module, String dependencyName) {
List oldDependencies = module.getDependencies();
List newDependencies = new ArrayList();
Iterator i = oldDependencies.iterator();
while (i.hasNext()) {
CmsModuleDependency dep = (CmsModuleDependency)i.n... | [
"private",
"void",
"deleteDependency",
"(",
"CmsModule",
"module",
",",
"String",
"dependencyName",
")",
"{",
"List",
"oldDependencies",
"=",
"module",
".",
"getDependencies",
"(",
")",
";",
"List",
"newDependencies",
"=",
"new",
"ArrayList",
"(",
")",
";",
"I... | Deletes a module dependency from a module.<p>
@param module the module to delete the dependency from
@param dependencyName the name of the dependcency to delete | [
"Deletes",
"a",
"module",
"dependency",
"from",
"a",
"module",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src-modules/org/opencms/workplace/tools/modules/CmsModulesDependenciesList.java#L366-L392 |
google/gson | proto/src/main/java/com/google/gson/protobuf/ProtoTypeAdapter.java | ProtoTypeAdapter.getCustSerializedEnumValue | private String getCustSerializedEnumValue(EnumValueOptions options, String defaultValue) {
"""
Retrieves the custom enum value name from the given options, and if not found, returns the
specified default value.
"""
for (Extension<EnumValueOptions, String> extension : serializedEnumValueExtensions) {
... | java | private String getCustSerializedEnumValue(EnumValueOptions options, String defaultValue) {
for (Extension<EnumValueOptions, String> extension : serializedEnumValueExtensions) {
if (options.hasExtension(extension)) {
return options.getExtension(extension);
}
}
return defaultValue;
} | [
"private",
"String",
"getCustSerializedEnumValue",
"(",
"EnumValueOptions",
"options",
",",
"String",
"defaultValue",
")",
"{",
"for",
"(",
"Extension",
"<",
"EnumValueOptions",
",",
"String",
">",
"extension",
":",
"serializedEnumValueExtensions",
")",
"{",
"if",
"... | Retrieves the custom enum value name from the given options, and if not found, returns the
specified default value. | [
"Retrieves",
"the",
"custom",
"enum",
"value",
"name",
"from",
"the",
"given",
"options",
"and",
"if",
"not",
"found",
"returns",
"the",
"specified",
"default",
"value",
"."
] | train | https://github.com/google/gson/blob/63ee47cb642c8018e5cddd639aa2be143220ad4b/proto/src/main/java/com/google/gson/protobuf/ProtoTypeAdapter.java#L346-L353 |
alexvasilkov/GestureViews | library/src/main/java/com/alexvasilkov/gestures/GestureControllerForPager.java | GestureControllerForPager.skipPagerMovement | private float skipPagerMovement(float pagerDx, State state, RectF movBounds) {
"""
/*
Skips part of pager movement to make it harder scrolling pager when image is zoomed
or when image is over-scrolled in y direction.
"""
float overscrollDist = getSettings().getOverscrollDistanceY() * OVERSCROLL_THRES... | java | private float skipPagerMovement(float pagerDx, State state, RectF movBounds) {
float overscrollDist = getSettings().getOverscrollDistanceY() * OVERSCROLL_THRESHOLD_FACTOR;
float overscrollThreshold = 0f;
if (state.getY() < movBounds.top) {
overscrollThreshold = (movBounds.top - stat... | [
"private",
"float",
"skipPagerMovement",
"(",
"float",
"pagerDx",
",",
"State",
"state",
",",
"RectF",
"movBounds",
")",
"{",
"float",
"overscrollDist",
"=",
"getSettings",
"(",
")",
".",
"getOverscrollDistanceY",
"(",
")",
"*",
"OVERSCROLL_THRESHOLD_FACTOR",
";",... | /*
Skips part of pager movement to make it harder scrolling pager when image is zoomed
or when image is over-scrolled in y direction. | [
"/",
"*",
"Skips",
"part",
"of",
"pager",
"movement",
"to",
"make",
"it",
"harder",
"scrolling",
"pager",
"when",
"image",
"is",
"zoomed",
"or",
"when",
"image",
"is",
"over",
"-",
"scrolled",
"in",
"y",
"direction",
"."
] | train | https://github.com/alexvasilkov/GestureViews/blob/f0a4c266e31dcad23bd0d9013531bc1c501b9c9f/library/src/main/java/com/alexvasilkov/gestures/GestureControllerForPager.java#L284-L323 |
grpc/grpc-java | stub/src/main/java/io/grpc/stub/AbstractStub.java | AbstractStub.withDeadline | public final S withDeadline(@Nullable Deadline deadline) {
"""
Returns a new stub with an absolute deadline.
<p>This is mostly used for propagating an existing deadline. {@link #withDeadlineAfter} is the
recommended way of setting a new deadline,
@since 1.0.0
@param deadline the deadline or {@code null} fo... | java | public final S withDeadline(@Nullable Deadline deadline) {
return build(channel, callOptions.withDeadline(deadline));
} | [
"public",
"final",
"S",
"withDeadline",
"(",
"@",
"Nullable",
"Deadline",
"deadline",
")",
"{",
"return",
"build",
"(",
"channel",
",",
"callOptions",
".",
"withDeadline",
"(",
"deadline",
")",
")",
";",
"}"
] | Returns a new stub with an absolute deadline.
<p>This is mostly used for propagating an existing deadline. {@link #withDeadlineAfter} is the
recommended way of setting a new deadline,
@since 1.0.0
@param deadline the deadline or {@code null} for unsetting the deadline. | [
"Returns",
"a",
"new",
"stub",
"with",
"an",
"absolute",
"deadline",
"."
] | train | https://github.com/grpc/grpc-java/blob/973885457f9609de232d2553b82c67f6c3ff57bf/stub/src/main/java/io/grpc/stub/AbstractStub.java#L113-L115 |
kuali/ojb-1.0.4 | src/xdoclet/java/src/xdoclet/modules/ojb/constraints/ModelConstraints.java | ModelConstraints.ensureReferencedPKs | private void ensureReferencedPKs(ModelDef modelDef, ReferenceDescriptorDef refDef) throws ConstraintException {
"""
Ensures that the primary keys required by the given reference are present in the referenced class.
@param modelDef The model
@param refDef The reference
@throws ConstraintException If there is... | java | private void ensureReferencedPKs(ModelDef modelDef, ReferenceDescriptorDef refDef) throws ConstraintException
{
String targetClassName = refDef.getProperty(PropertyHelper.OJB_PROPERTY_CLASS_REF);
ClassDescriptorDef targetClassDef = modelDef.getClass(targetClassName);
ensur... | [
"private",
"void",
"ensureReferencedPKs",
"(",
"ModelDef",
"modelDef",
",",
"ReferenceDescriptorDef",
"refDef",
")",
"throws",
"ConstraintException",
"{",
"String",
"targetClassName",
"=",
"refDef",
".",
"getProperty",
"(",
"PropertyHelper",
".",
"OJB_PROPERTY_CLASS_REF",... | Ensures that the primary keys required by the given reference are present in the referenced class.
@param modelDef The model
@param refDef The reference
@throws ConstraintException If there is a conflict between the primary keys | [
"Ensures",
"that",
"the",
"primary",
"keys",
"required",
"by",
"the",
"given",
"reference",
"are",
"present",
"in",
"the",
"referenced",
"class",
"."
] | train | https://github.com/kuali/ojb-1.0.4/blob/9a544372f67ce965f662cdc71609dd03683c8f04/src/xdoclet/java/src/xdoclet/modules/ojb/constraints/ModelConstraints.java#L109-L115 |
HubSpot/Singularity | SingularityClient/src/main/java/com/hubspot/singularity/client/SingularityClient.java | SingularityClient.readSandBoxFile | public Optional<MesosFileChunkObject> readSandBoxFile(String taskId, String path, Optional<String> grep, Optional<Long> offset, Optional<Long> length) {
"""
Retrieve part of the contents of a file in a specific task's sandbox.
@param taskId
The task ID of the sandbox to read from
@param path
The path to the ... | java | public Optional<MesosFileChunkObject> readSandBoxFile(String taskId, String path, Optional<String> grep, Optional<Long> offset, Optional<Long> length) {
final Function<String, String> requestUrl = (host) -> String.format(SANDBOX_READ_FILE_FORMAT, getApiBase(host), taskId);
Builder<String, Object> queryParamBui... | [
"public",
"Optional",
"<",
"MesosFileChunkObject",
">",
"readSandBoxFile",
"(",
"String",
"taskId",
",",
"String",
"path",
",",
"Optional",
"<",
"String",
">",
"grep",
",",
"Optional",
"<",
"Long",
">",
"offset",
",",
"Optional",
"<",
"Long",
">",
"length",
... | Retrieve part of the contents of a file in a specific task's sandbox.
@param taskId
The task ID of the sandbox to read from
@param path
The path to the file to be read. Relative to the sandbox root (without a leading slash)
@param grep
Optional string to grep for
@param offset
Byte offset to start reading from
@param ... | [
"Retrieve",
"part",
"of",
"the",
"contents",
"of",
"a",
"file",
"in",
"a",
"specific",
"task",
"s",
"sandbox",
"."
] | train | https://github.com/HubSpot/Singularity/blob/384a8c16a10aa076af5ca45c8dfcedab9e5122c8/SingularityClient/src/main/java/com/hubspot/singularity/client/SingularityClient.java#L1307-L1323 |
umeding/fuzzer | src/main/java/com/uwemeding/fuzzer/java/Java.java | Java.createSource | public static synchronized void createSource(Java._ClassBody clazz)
throws IOException {
"""
Create the source file for a given class
@param clazz is the class description
@throws java.io.IOException
"""
if (baseDir == null) {
throw new IOException("Base directory for output not set, use 'setBaseDi... | java | public static synchronized void createSource(Java._ClassBody clazz)
throws IOException {
if (baseDir == null) {
throw new IOException("Base directory for output not set, use 'setBaseDirectory'");
}
String pkg = clazz.getPackage();
if (pkg == null) {
pkg = "";
// throw new IOException("Class package c... | [
"public",
"static",
"synchronized",
"void",
"createSource",
"(",
"Java",
".",
"_ClassBody",
"clazz",
")",
"throws",
"IOException",
"{",
"if",
"(",
"baseDir",
"==",
"null",
")",
"{",
"throw",
"new",
"IOException",
"(",
"\"Base directory for output not set, use 'setBa... | Create the source file for a given class
@param clazz is the class description
@throws java.io.IOException | [
"Create",
"the",
"source",
"file",
"for",
"a",
"given",
"class"
] | train | https://github.com/umeding/fuzzer/blob/e8aa46313bb1d1328865f26f99455124aede828c/src/main/java/com/uwemeding/fuzzer/java/Java.java#L74-L91 |
spring-projects/spring-shell | spring-shell-table/src/main/java/org/springframework/shell/table/Tables.java | Tables.configureKeyValueRendering | public static TableBuilder configureKeyValueRendering(TableBuilder builder, String delimiter) {
"""
Install all the necessary formatters, aligners, etc for key-value rendering of Maps.
@param builder the builder to configure
@param delimiter the delimiter to apply between keys and values
@return buider for me... | java | public static TableBuilder configureKeyValueRendering(TableBuilder builder, String delimiter) {
return builder.on(CellMatchers.ofType(Map.class))
.addFormatter(new MapFormatter(delimiter))
.addAligner(new KeyValueHorizontalAligner(delimiter.trim()))
.addSizer(new KeyValueSizeConstraints(delimiter))
.a... | [
"public",
"static",
"TableBuilder",
"configureKeyValueRendering",
"(",
"TableBuilder",
"builder",
",",
"String",
"delimiter",
")",
"{",
"return",
"builder",
".",
"on",
"(",
"CellMatchers",
".",
"ofType",
"(",
"Map",
".",
"class",
")",
")",
".",
"addFormatter",
... | Install all the necessary formatters, aligners, etc for key-value rendering of Maps.
@param builder the builder to configure
@param delimiter the delimiter to apply between keys and values
@return buider for method chaining | [
"Install",
"all",
"the",
"necessary",
"formatters",
"aligners",
"etc",
"for",
"key",
"-",
"value",
"rendering",
"of",
"Maps",
"."
] | train | https://github.com/spring-projects/spring-shell/blob/23d99f45eb8f487e31a1f080c837061313bbfafa/spring-shell-table/src/main/java/org/springframework/shell/table/Tables.java#L35-L41 |
ModeShape/modeshape | modeshape-common/src/main/java/org/modeshape/common/util/CheckArg.java | CheckArg.isNonPositive | public static void isNonPositive( int argument,
String name ) {
"""
Check that the argument is non-positive (<=0).
@param argument The argument
@param name The name of the argument
@throws IllegalArgumentException If argument is positive (>0)
"""
if (argument ... | java | public static void isNonPositive( int argument,
String name ) {
if (argument > 0) {
throw new IllegalArgumentException(CommonI18n.argumentMayNotBePositive.text(name, argument));
}
} | [
"public",
"static",
"void",
"isNonPositive",
"(",
"int",
"argument",
",",
"String",
"name",
")",
"{",
"if",
"(",
"argument",
">",
"0",
")",
"{",
"throw",
"new",
"IllegalArgumentException",
"(",
"CommonI18n",
".",
"argumentMayNotBePositive",
".",
"text",
"(",
... | Check that the argument is non-positive (<=0).
@param argument The argument
@param name The name of the argument
@throws IllegalArgumentException If argument is positive (>0) | [
"Check",
"that",
"the",
"argument",
"is",
"non",
"-",
"positive",
"(",
"<",
"=",
"0",
")",
"."
] | train | https://github.com/ModeShape/modeshape/blob/794cfdabb67a90f24629c4fff0424a6125f8f95b/modeshape-common/src/main/java/org/modeshape/common/util/CheckArg.java#L168-L173 |
OpenBEL/openbel-framework | org.openbel.framework.common/src/main/java/org/openbel/framework/common/external/ExternalType.java | ExternalType.writeObject | public static void writeObject(final ObjectOutput out, final Object o)
throws IOException {
"""
Writes the potentially null object to output. If {@code o} is null, one
byte is written to the output to indicate that. Otherwise, the written
size is the serialized object size plus an additional byte to ... | java | public static void writeObject(final ObjectOutput out, final Object o)
throws IOException {
if (o == null) {
out.writeByte(0);
return;
}
out.writeByte(1);
out.writeObject(o);
} | [
"public",
"static",
"void",
"writeObject",
"(",
"final",
"ObjectOutput",
"out",
",",
"final",
"Object",
"o",
")",
"throws",
"IOException",
"{",
"if",
"(",
"o",
"==",
"null",
")",
"{",
"out",
".",
"writeByte",
"(",
"0",
")",
";",
"return",
";",
"}",
"... | Writes the potentially null object to output. If {@code o} is null, one
byte is written to the output to indicate that. Otherwise, the written
size is the serialized object size plus an additional byte to indicate
non-null.
<p>
This method doesn't differ in functionality with
{@link ObjectOutput#writeObject(Object)}, i... | [
"Writes",
"the",
"potentially",
"null",
"object",
"to",
"output",
".",
"If",
"{",
"@code",
"o",
"}",
"is",
"null",
"one",
"byte",
"is",
"written",
"to",
"the",
"output",
"to",
"indicate",
"that",
".",
"Otherwise",
"the",
"written",
"size",
"is",
"the",
... | train | https://github.com/OpenBEL/openbel-framework/blob/149f80b1d6eabb15ab15815b6f745b0afa9fd2d3/org.openbel.framework.common/src/main/java/org/openbel/framework/common/external/ExternalType.java#L128-L136 |
thelinmichael/spotify-web-api-java | src/main/java/com/wrapper/spotify/SpotifyApi.java | SpotifyApi.authorizationCodeUri | public AuthorizationCodeUriRequest.Builder authorizationCodeUri(String client_id, URI redirect_uri) {
"""
Retrieve an URL where the user can give the application permissions.
@param client_id When you register your application, Spotify provides you a Client ID.
@param redirect_uri This parameter is used for... | java | public AuthorizationCodeUriRequest.Builder authorizationCodeUri(String client_id, URI redirect_uri) {
return new AuthorizationCodeUriRequest.Builder()
.setDefaults(httpManager, scheme, host, port)
.client_id(client_id)
.response_type("code")
.redirect_uri(redirect_uri... | [
"public",
"AuthorizationCodeUriRequest",
".",
"Builder",
"authorizationCodeUri",
"(",
"String",
"client_id",
",",
"URI",
"redirect_uri",
")",
"{",
"return",
"new",
"AuthorizationCodeUriRequest",
".",
"Builder",
"(",
")",
".",
"setDefaults",
"(",
"httpManager",
",",
... | Retrieve an URL where the user can give the application permissions.
@param client_id When you register your application, Spotify provides you a Client ID.
@param redirect_uri This parameter is used for validation only (there is no actual redirection). The
value of this parameter must exactly match the value of red... | [
"Retrieve",
"an",
"URL",
"where",
"the",
"user",
"can",
"give",
"the",
"application",
"permissions",
"."
] | train | https://github.com/thelinmichael/spotify-web-api-java/blob/c06b8512344c0310d0c1df362fa267879021da2e/src/main/java/com/wrapper/spotify/SpotifyApi.java#L388-L394 |
netscaler/sdx_nitro | src/main/java/com/citrix/sdx/nitro/resource/config/ns/ns_vlan.java | ns_vlan.get_nitro_bulk_response | protected base_resource[] get_nitro_bulk_response(nitro_service service, String response) throws Exception {
"""
<pre>
Converts API response of bulk operation into object and returns the object array in case of get request.
</pre>
"""
ns_vlan_responses result = (ns_vlan_responses) service.get_payload_form... | java | protected base_resource[] get_nitro_bulk_response(nitro_service service, String response) throws Exception
{
ns_vlan_responses result = (ns_vlan_responses) service.get_payload_formatter().string_to_resource(ns_vlan_responses.class, response);
if(result.errorcode != 0)
{
if (result.errorcode == SESSION_NO... | [
"protected",
"base_resource",
"[",
"]",
"get_nitro_bulk_response",
"(",
"nitro_service",
"service",
",",
"String",
"response",
")",
"throws",
"Exception",
"{",
"ns_vlan_responses",
"result",
"=",
"(",
"ns_vlan_responses",
")",
"service",
".",
"get_payload_formatter",
... | <pre>
Converts API response of bulk operation into object and returns the object array in case of get request.
</pre> | [
"<pre",
">",
"Converts",
"API",
"response",
"of",
"bulk",
"operation",
"into",
"object",
"and",
"returns",
"the",
"object",
"array",
"in",
"case",
"of",
"get",
"request",
".",
"<",
"/",
"pre",
">"
] | train | https://github.com/netscaler/sdx_nitro/blob/c840919f1a8f7c0a5634c0f23d34fa14d1765ff1/src/main/java/com/citrix/sdx/nitro/resource/config/ns/ns_vlan.java#L310-L327 |
couchbase/couchbase-java-client | src/main/java/com/couchbase/client/java/view/SpatialViewQuery.java | SpatialViewQuery.includeDocs | public SpatialViewQuery includeDocs(boolean includeDocs, Class<? extends Document<?>> target) {
"""
Proactively load the full document for the row returned.
This only works if reduce is false, since with reduce the original document ID is not included anymore.
@param includeDocs if it should be enabled or not.... | java | public SpatialViewQuery includeDocs(boolean includeDocs, Class<? extends Document<?>> target) {
this.includeDocs = includeDocs;
this.includeDocsTarget = target;
return this;
} | [
"public",
"SpatialViewQuery",
"includeDocs",
"(",
"boolean",
"includeDocs",
",",
"Class",
"<",
"?",
"extends",
"Document",
"<",
"?",
">",
">",
"target",
")",
"{",
"this",
".",
"includeDocs",
"=",
"includeDocs",
";",
"this",
".",
"includeDocsTarget",
"=",
"ta... | Proactively load the full document for the row returned.
This only works if reduce is false, since with reduce the original document ID is not included anymore.
@param includeDocs if it should be enabled or not.
@param target the custom document type target.
@return the {@link SpatialViewQuery} DSL. | [
"Proactively",
"load",
"the",
"full",
"document",
"for",
"the",
"row",
"returned",
"."
] | train | https://github.com/couchbase/couchbase-java-client/blob/f36a0ee0c66923bdde47838ca543e50cbaa99e14/src/main/java/com/couchbase/client/java/view/SpatialViewQuery.java#L129-L133 |
apache/groovy | src/main/groovy/groovy/lang/Sequence.java | Sequence.checkType | protected void checkType(Object object) {
"""
Checks that the given object instance is of the correct type
otherwise a runtime exception is thrown
"""
if (object == null) {
throw new NullPointerException("Sequences cannot contain null, use a List instead");
}
if (type != nu... | java | protected void checkType(Object object) {
if (object == null) {
throw new NullPointerException("Sequences cannot contain null, use a List instead");
}
if (type != null) {
if (!type.isInstance(object)) {
throw new IllegalArgumentException(
... | [
"protected",
"void",
"checkType",
"(",
"Object",
"object",
")",
"{",
"if",
"(",
"object",
"==",
"null",
")",
"{",
"throw",
"new",
"NullPointerException",
"(",
"\"Sequences cannot contain null, use a List instead\"",
")",
";",
"}",
"if",
"(",
"type",
"!=",
"null"... | Checks that the given object instance is of the correct type
otherwise a runtime exception is thrown | [
"Checks",
"that",
"the",
"given",
"object",
"instance",
"is",
"of",
"the",
"correct",
"type",
"otherwise",
"a",
"runtime",
"exception",
"is",
"thrown"
] | train | https://github.com/apache/groovy/blob/71cf20addb611bb8d097a59e395fd20bc7f31772/src/main/groovy/groovy/lang/Sequence.java#L203-L216 |
junit-team/junit4 | src/main/java/org/junit/internal/Checks.java | Checks.notNull | public static <T> T notNull(T value, String message) {
"""
Checks that the given value is not {@code null}, using the given message
as the exception message if an exception is thrown.
@param value object reference to check
@param message message to use if {@code value} is {@code null}
@return the passed-in v... | java | public static <T> T notNull(T value, String message) {
if (value == null) {
throw new NullPointerException(message);
}
return value;
} | [
"public",
"static",
"<",
"T",
">",
"T",
"notNull",
"(",
"T",
"value",
",",
"String",
"message",
")",
"{",
"if",
"(",
"value",
"==",
"null",
")",
"{",
"throw",
"new",
"NullPointerException",
"(",
"message",
")",
";",
"}",
"return",
"value",
";",
"}"
] | Checks that the given value is not {@code null}, using the given message
as the exception message if an exception is thrown.
@param value object reference to check
@param message message to use if {@code value} is {@code null}
@return the passed-in value, if not {@code null}
@throws NullPointerException if {@code valu... | [
"Checks",
"that",
"the",
"given",
"value",
"is",
"not",
"{",
"@code",
"null",
"}",
"using",
"the",
"given",
"message",
"as",
"the",
"exception",
"message",
"if",
"an",
"exception",
"is",
"thrown",
"."
] | train | https://github.com/junit-team/junit4/blob/d9861ecdb6e487f6c352437ee823879aca3b81d4/src/main/java/org/junit/internal/Checks.java#L31-L36 |
salesforce/Argus | ArgusWebServices/src/main/java/com/salesforce/dva/argus/ws/business/oauth/AuthRequestHelper.java | AuthRequestHelper.validateTokenRequest | public static boolean validateTokenRequest(TokenRequestDto tokenRequestDto, OAuthApplicationDto oAuthApplicationDto) {
"""
Validates Token Request
@param tokenRequestDto Given Application DTO properties
@param oAuthApplicationDto Expected Application DTO properties
@return Returns boolean or OAuth Exce... | java | public static boolean validateTokenRequest(TokenRequestDto tokenRequestDto, OAuthApplicationDto oAuthApplicationDto) {
// basic check
try {
String decodedRedirectUri = java.net.URLDecoder.decode(tokenRequestDto.getRedirectUri(), "UTF-8");
if (StringUtils.isNotBlank(oAuthApplicati... | [
"public",
"static",
"boolean",
"validateTokenRequest",
"(",
"TokenRequestDto",
"tokenRequestDto",
",",
"OAuthApplicationDto",
"oAuthApplicationDto",
")",
"{",
"// basic check",
"try",
"{",
"String",
"decodedRedirectUri",
"=",
"java",
".",
"net",
".",
"URLDecoder",
".",
... | Validates Token Request
@param tokenRequestDto Given Application DTO properties
@param oAuthApplicationDto Expected Application DTO properties
@return Returns boolean or OAuth Exception | [
"Validates",
"Token",
"Request"
] | train | https://github.com/salesforce/Argus/blob/121b59a268da264316cded6a3e9271366a23cd86/ArgusWebServices/src/main/java/com/salesforce/dva/argus/ws/business/oauth/AuthRequestHelper.java#L109-L134 |
albfernandez/itext2 | src/main/java/com/lowagie/text/pdf/PdfContentByte.java | PdfContentByte.arc | public void arc(float x1, float y1, float x2, float y2, float startAng, float extent) {
"""
Draws a partial ellipse inscribed within the rectangle x1,y1,x2,y2,
starting at startAng degrees and covering extent degrees. Angles
start with 0 to the right (+x) and increase counter-clockwise.
@param x1 a corner of ... | java | public void arc(float x1, float y1, float x2, float y2, float startAng, float extent) {
ArrayList ar = bezierArc(x1, y1, x2, y2, startAng, extent);
if (ar.isEmpty())
return;
float pt[] = (float [])ar.get(0);
moveTo(pt[0], pt[1]);
for (int k = 0; k < ar.size(); ++k) {
... | [
"public",
"void",
"arc",
"(",
"float",
"x1",
",",
"float",
"y1",
",",
"float",
"x2",
",",
"float",
"y2",
",",
"float",
"startAng",
",",
"float",
"extent",
")",
"{",
"ArrayList",
"ar",
"=",
"bezierArc",
"(",
"x1",
",",
"y1",
",",
"x2",
",",
"y2",
... | Draws a partial ellipse inscribed within the rectangle x1,y1,x2,y2,
starting at startAng degrees and covering extent degrees. Angles
start with 0 to the right (+x) and increase counter-clockwise.
@param x1 a corner of the enclosing rectangle
@param y1 a corner of the enclosing rectangle
@param x2 a corner of the enclo... | [
"Draws",
"a",
"partial",
"ellipse",
"inscribed",
"within",
"the",
"rectangle",
"x1",
"y1",
"x2",
"y2",
"starting",
"at",
"startAng",
"degrees",
"and",
"covering",
"extent",
"degrees",
".",
"Angles",
"start",
"with",
"0",
"to",
"the",
"right",
"(",
"+",
"x"... | train | https://github.com/albfernandez/itext2/blob/438fc1899367fd13dfdfa8dfdca9a3c1a7783b84/src/main/java/com/lowagie/text/pdf/PdfContentByte.java#L1883-L1893 |
aalmiray/Json-lib | src/main/java/net/sf/json/JSONObject.java | JSONObject.element | public JSONObject element( String key, Map value ) {
"""
Put a key/value pair in the JSONObject, where the value will be a
JSONObject which is produced from a Map.
@param key A key string.
@param value A Map value.
@return this.
@throws JSONException
"""
return element( key, value, new JsonConfig(... | java | public JSONObject element( String key, Map value ) {
return element( key, value, new JsonConfig() );
} | [
"public",
"JSONObject",
"element",
"(",
"String",
"key",
",",
"Map",
"value",
")",
"{",
"return",
"element",
"(",
"key",
",",
"value",
",",
"new",
"JsonConfig",
"(",
")",
")",
";",
"}"
] | Put a key/value pair in the JSONObject, where the value will be a
JSONObject which is produced from a Map.
@param key A key string.
@param value A Map value.
@return this.
@throws JSONException | [
"Put",
"a",
"key",
"/",
"value",
"pair",
"in",
"the",
"JSONObject",
"where",
"the",
"value",
"will",
"be",
"a",
"JSONObject",
"which",
"is",
"produced",
"from",
"a",
"Map",
"."
] | train | https://github.com/aalmiray/Json-lib/blob/9e2b3376ee8f511a48aa7ac05f75a7414e02280f/src/main/java/net/sf/json/JSONObject.java#L1654-L1656 |
UrielCh/ovh-java-sdk | ovh-java-sdk-emaildomain/src/main/java/net/minidev/ovh/api/ApiOvhEmaildomain.java | ApiOvhEmaildomain.domain_account_accountName_updateUsage_POST | public void domain_account_accountName_updateUsage_POST(String domain, String accountName) throws IOException {
"""
Update usage of account
REST: POST /email/domain/{domain}/account/{accountName}/updateUsage
@param domain [required] Name of your domain name
@param accountName [required] Name of account
""... | java | public void domain_account_accountName_updateUsage_POST(String domain, String accountName) throws IOException {
String qPath = "/email/domain/{domain}/account/{accountName}/updateUsage";
StringBuilder sb = path(qPath, domain, accountName);
exec(qPath, "POST", sb.toString(), null);
} | [
"public",
"void",
"domain_account_accountName_updateUsage_POST",
"(",
"String",
"domain",
",",
"String",
"accountName",
")",
"throws",
"IOException",
"{",
"String",
"qPath",
"=",
"\"/email/domain/{domain}/account/{accountName}/updateUsage\"",
";",
"StringBuilder",
"sb",
"=",
... | Update usage of account
REST: POST /email/domain/{domain}/account/{accountName}/updateUsage
@param domain [required] Name of your domain name
@param accountName [required] Name of account | [
"Update",
"usage",
"of",
"account"
] | train | https://github.com/UrielCh/ovh-java-sdk/blob/6d531a40e56e09701943e334c25f90f640c55701/ovh-java-sdk-emaildomain/src/main/java/net/minidev/ovh/api/ApiOvhEmaildomain.java#L635-L639 |
liferay/com-liferay-commerce | commerce-user-segment-service/src/main/java/com/liferay/commerce/user/segment/service/persistence/impl/CommerceUserSegmentEntryPersistenceImpl.java | CommerceUserSegmentEntryPersistenceImpl.findAll | @Override
public List<CommerceUserSegmentEntry> findAll() {
"""
Returns all the commerce user segment entries.
@return the commerce user segment entries
"""
return findAll(QueryUtil.ALL_POS, QueryUtil.ALL_POS, null);
} | java | @Override
public List<CommerceUserSegmentEntry> findAll() {
return findAll(QueryUtil.ALL_POS, QueryUtil.ALL_POS, null);
} | [
"@",
"Override",
"public",
"List",
"<",
"CommerceUserSegmentEntry",
">",
"findAll",
"(",
")",
"{",
"return",
"findAll",
"(",
"QueryUtil",
".",
"ALL_POS",
",",
"QueryUtil",
".",
"ALL_POS",
",",
"null",
")",
";",
"}"
] | Returns all the commerce user segment entries.
@return the commerce user segment entries | [
"Returns",
"all",
"the",
"commerce",
"user",
"segment",
"entries",
"."
] | train | https://github.com/liferay/com-liferay-commerce/blob/9e54362d7f59531fc684016ba49ee7cdc3a2f22b/commerce-user-segment-service/src/main/java/com/liferay/commerce/user/segment/service/persistence/impl/CommerceUserSegmentEntryPersistenceImpl.java#L2770-L2773 |
SonarSource/sonarqube | server/sonar-db-migration/src/main/java/org/sonar/server/platform/db/migration/version/v63/PopulateDefaultPermTemplateColumnsOfOrganizations.java | PopulateDefaultPermTemplateColumnsOfOrganizations.updateKeeIfRequired | private String updateKeeIfRequired(Context context, @Nullable String kee) throws SQLException {
"""
SONAR-10407 Ensure that the kee length is not greater than 40
In this case, we must update the kee to a UUID
"""
if (kee == null || kee.length() <= VarcharColumnDef.UUID_SIZE) {
return kee;
}
... | java | private String updateKeeIfRequired(Context context, @Nullable String kee) throws SQLException {
if (kee == null || kee.length() <= VarcharColumnDef.UUID_SIZE) {
return kee;
}
String newKee = uuidFactory.create();
context.prepareUpsert("update permission_templates set kee=? where kee=?")
.se... | [
"private",
"String",
"updateKeeIfRequired",
"(",
"Context",
"context",
",",
"@",
"Nullable",
"String",
"kee",
")",
"throws",
"SQLException",
"{",
"if",
"(",
"kee",
"==",
"null",
"||",
"kee",
".",
"length",
"(",
")",
"<=",
"VarcharColumnDef",
".",
"UUID_SIZE"... | SONAR-10407 Ensure that the kee length is not greater than 40
In this case, we must update the kee to a UUID | [
"SONAR",
"-",
"10407",
"Ensure",
"that",
"the",
"kee",
"length",
"is",
"not",
"greater",
"than",
"40",
"In",
"this",
"case",
"we",
"must",
"update",
"the",
"kee",
"to",
"a",
"UUID"
] | train | https://github.com/SonarSource/sonarqube/blob/2fffa4c2f79ae3714844d7742796e82822b6a98a/server/sonar-db-migration/src/main/java/org/sonar/server/platform/db/migration/version/v63/PopulateDefaultPermTemplateColumnsOfOrganizations.java#L109-L120 |
alkacon/opencms-core | src/org/opencms/file/CmsObject.java | CmsObject.undoChanges | public void undoChanges(String resourcename, CmsResource.CmsResourceUndoMode mode) throws CmsException {
"""
Undoes all changes to a resource by restoring the version from the
online project to the current offline project.<p>
@param resourcename the name of the resource to undo the changes for
@param mode the... | java | public void undoChanges(String resourcename, CmsResource.CmsResourceUndoMode mode) throws CmsException {
CmsResource resource = readResource(resourcename, CmsResourceFilter.ALL);
getResourceType(resource).undoChanges(this, m_securityManager, resource, mode);
} | [
"public",
"void",
"undoChanges",
"(",
"String",
"resourcename",
",",
"CmsResource",
".",
"CmsResourceUndoMode",
"mode",
")",
"throws",
"CmsException",
"{",
"CmsResource",
"resource",
"=",
"readResource",
"(",
"resourcename",
",",
"CmsResourceFilter",
".",
"ALL",
")"... | Undoes all changes to a resource by restoring the version from the
online project to the current offline project.<p>
@param resourcename the name of the resource to undo the changes for
@param mode the undo mode, one of the <code>{@link CmsResource.CmsResourceUndoMode}#UNDO_XXX</code> constants
@throws CmsException i... | [
"Undoes",
"all",
"changes",
"to",
"a",
"resource",
"by",
"restoring",
"the",
"version",
"from",
"the",
"online",
"project",
"to",
"the",
"current",
"offline",
"project",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/file/CmsObject.java#L3892-L3896 |
OpenLiberty/open-liberty | dev/com.ibm.ws.security.authentication.filter/src/com/ibm/ws/security/authentication/filter/internal/IPAddressRange.java | IPAddressRange.inRange | public boolean inRange(InetAddress ip) {
"""
Is the given ip address in this range? Basically check to see if it is below ipHigher and above ipLower.
To simplify the logic we actually check to see if it is *not* above higher or below lower thus avoiding
another check for equality.
@param ip
@return
"""
... | java | public boolean inRange(InetAddress ip) {
if (greaterThan(ip, ipHigher))
return false;
else if (lessThan(ip, ipLower))
return false;
else
return true;
} | [
"public",
"boolean",
"inRange",
"(",
"InetAddress",
"ip",
")",
"{",
"if",
"(",
"greaterThan",
"(",
"ip",
",",
"ipHigher",
")",
")",
"return",
"false",
";",
"else",
"if",
"(",
"lessThan",
"(",
"ip",
",",
"ipLower",
")",
")",
"return",
"false",
";",
"e... | Is the given ip address in this range? Basically check to see if it is below ipHigher and above ipLower.
To simplify the logic we actually check to see if it is *not* above higher or below lower thus avoiding
another check for equality.
@param ip
@return | [
"Is",
"the",
"given",
"ip",
"address",
"in",
"this",
"range?",
"Basically",
"check",
"to",
"see",
"if",
"it",
"is",
"below",
"ipHigher",
"and",
"above",
"ipLower",
".",
"To",
"simplify",
"the",
"logic",
"we",
"actually",
"check",
"to",
"see",
"if",
"it",... | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.security.authentication.filter/src/com/ibm/ws/security/authentication/filter/internal/IPAddressRange.java#L220-L227 |
Azure/azure-sdk-for-java | sql/resource-manager/v2015_05_01_preview/src/main/java/com/microsoft/azure/management/sql/v2015_05_01_preview/implementation/SyncGroupsInner.java | SyncGroupsInner.beginRefreshHubSchemaAsync | public Observable<Void> beginRefreshHubSchemaAsync(String resourceGroupName, String serverName, String databaseName, String syncGroupName) {
"""
Refreshes a hub database schema.
@param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource ... | java | public Observable<Void> beginRefreshHubSchemaAsync(String resourceGroupName, String serverName, String databaseName, String syncGroupName) {
return beginRefreshHubSchemaWithServiceResponseAsync(resourceGroupName, serverName, databaseName, syncGroupName).map(new Func1<ServiceResponse<Void>, Void>() {
... | [
"public",
"Observable",
"<",
"Void",
">",
"beginRefreshHubSchemaAsync",
"(",
"String",
"resourceGroupName",
",",
"String",
"serverName",
",",
"String",
"databaseName",
",",
"String",
"syncGroupName",
")",
"{",
"return",
"beginRefreshHubSchemaWithServiceResponseAsync",
"("... | Refreshes a hub database schema.
@param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal.
@param serverName The name of the server.
@param databaseName The name of the database on which the sync group is hosted.
@pa... | [
"Refreshes",
"a",
"hub",
"database",
"schema",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/sql/resource-manager/v2015_05_01_preview/src/main/java/com/microsoft/azure/management/sql/v2015_05_01_preview/implementation/SyncGroupsInner.java#L381-L388 |
haraldk/TwelveMonkeys | common/common-lang/src/main/java/com/twelvemonkeys/util/convert/ConverterImpl.java | ConverterImpl.toObject | public Object toObject(String pString, Class pType, String pFormat)
throws ConversionException {
"""
Converts the string to an object of the given type, parsing after the
given format.
@param pString the string to convert
@param pType the type to convert to
@param pFormat the vonversion format
@r... | java | public Object toObject(String pString, Class pType, String pFormat)
throws ConversionException {
if (pString == null) {
return null;
}
if (pType == null) {
throw new MissingTypeException();
}
// Get converter
PropertyConver... | [
"public",
"Object",
"toObject",
"(",
"String",
"pString",
",",
"Class",
"pType",
",",
"String",
"pFormat",
")",
"throws",
"ConversionException",
"{",
"if",
"(",
"pString",
"==",
"null",
")",
"{",
"return",
"null",
";",
"}",
"if",
"(",
"pType",
"==",
"nul... | Converts the string to an object of the given type, parsing after the
given format.
@param pString the string to convert
@param pType the type to convert to
@param pFormat the vonversion format
@return the object created from the given string.
@throws ConversionException if the string cannot be converted for any
rea... | [
"Converts",
"the",
"string",
"to",
"an",
"object",
"of",
"the",
"given",
"type",
"parsing",
"after",
"the",
"given",
"format",
"."
] | train | https://github.com/haraldk/TwelveMonkeys/blob/7fad4d5cd8cb3a6728c7fd3f28a7b84d8ce0101d/common/common-lang/src/main/java/com/twelvemonkeys/util/convert/ConverterImpl.java#L88-L108 |
op4j/op4j | src/main/java/org/op4j/Op.java | Op.onArrayFor | public static <T> Level0ArrayOperator<Boolean[],Boolean> onArrayFor(final Boolean... elements) {
"""
<p>
Creates an array with the specified elements and an <i>operation expression</i> on it.
</p>
@param elements the elements of the array being created
@return an operator, ready for chaining
"""
... | java | public static <T> Level0ArrayOperator<Boolean[],Boolean> onArrayFor(final Boolean... elements) {
return onArrayOf(Types.BOOLEAN, VarArgsUtil.asRequiredObjectArray(elements));
} | [
"public",
"static",
"<",
"T",
">",
"Level0ArrayOperator",
"<",
"Boolean",
"[",
"]",
",",
"Boolean",
">",
"onArrayFor",
"(",
"final",
"Boolean",
"...",
"elements",
")",
"{",
"return",
"onArrayOf",
"(",
"Types",
".",
"BOOLEAN",
",",
"VarArgsUtil",
".",
"asRe... | <p>
Creates an array with the specified elements and an <i>operation expression</i> on it.
</p>
@param elements the elements of the array being created
@return an operator, ready for chaining | [
"<p",
">",
"Creates",
"an",
"array",
"with",
"the",
"specified",
"elements",
"and",
"an",
"<i",
">",
"operation",
"expression<",
"/",
"i",
">",
"on",
"it",
".",
"<",
"/",
"p",
">"
] | train | https://github.com/op4j/op4j/blob/b577596dfe462089d3dd169666defc6de7ad289a/src/main/java/org/op4j/Op.java#L971-L973 |
mikepenz/Android-Iconics | library-core/src/main/java/com/mikepenz/iconics/IconicsDrawable.java | IconicsDrawable.backgroundContourColorRes | @NonNull
public IconicsDrawable backgroundContourColorRes(@ColorRes int colorResId) {
"""
Set background contour color from color res.
@return The current IconicsDrawable for chaining.
"""
return backgroundContourColor(ContextCompat.getColor(mContext, colorResId));
} | java | @NonNull
public IconicsDrawable backgroundContourColorRes(@ColorRes int colorResId) {
return backgroundContourColor(ContextCompat.getColor(mContext, colorResId));
} | [
"@",
"NonNull",
"public",
"IconicsDrawable",
"backgroundContourColorRes",
"(",
"@",
"ColorRes",
"int",
"colorResId",
")",
"{",
"return",
"backgroundContourColor",
"(",
"ContextCompat",
".",
"getColor",
"(",
"mContext",
",",
"colorResId",
")",
")",
";",
"}"
] | Set background contour color from color res.
@return The current IconicsDrawable for chaining. | [
"Set",
"background",
"contour",
"color",
"from",
"color",
"res",
"."
] | train | https://github.com/mikepenz/Android-Iconics/blob/0b2c8f7d07b6d2715a417563c66311e7e1fcc7d8/library-core/src/main/java/com/mikepenz/iconics/IconicsDrawable.java#L743-L746 |
googleapis/google-cloud-java | google-cloud-clients/google-cloud-firestore/src/main/java/com/google/cloud/firestore/Query.java | Query.startAfter | @Nonnull
public Query startAfter(@Nonnull DocumentSnapshot snapshot) {
"""
Creates and returns a new Query that starts after the provided document (exclusive). The
starting position is relative to the order of the query. The document must contain all of the
fields provided in the orderBy of this query.
@par... | java | @Nonnull
public Query startAfter(@Nonnull DocumentSnapshot snapshot) {
QueryOptions newOptions = new QueryOptions(options);
newOptions.fieldOrders = createImplicitOrderBy();
newOptions.startCursor = createCursor(newOptions.fieldOrders, snapshot, false);
return new Query(firestore, path, newOptions);
... | [
"@",
"Nonnull",
"public",
"Query",
"startAfter",
"(",
"@",
"Nonnull",
"DocumentSnapshot",
"snapshot",
")",
"{",
"QueryOptions",
"newOptions",
"=",
"new",
"QueryOptions",
"(",
"options",
")",
";",
"newOptions",
".",
"fieldOrders",
"=",
"createImplicitOrderBy",
"(",... | Creates and returns a new Query that starts after the provided document (exclusive). The
starting position is relative to the order of the query. The document must contain all of the
fields provided in the orderBy of this query.
@param snapshot The snapshot of the document to start after.
@return The created Query. | [
"Creates",
"and",
"returns",
"a",
"new",
"Query",
"that",
"starts",
"after",
"the",
"provided",
"document",
"(",
"exclusive",
")",
".",
"The",
"starting",
"position",
"is",
"relative",
"to",
"the",
"order",
"of",
"the",
"query",
".",
"The",
"document",
"mu... | train | https://github.com/googleapis/google-cloud-java/blob/d2f0bc64a53049040fe9c9d338b12fab3dd1ad6a/google-cloud-clients/google-cloud-firestore/src/main/java/com/google/cloud/firestore/Query.java#L781-L787 |
alkacon/opencms-core | src/org/opencms/configuration/CmsElementWithAttrsParamConfigHelper.java | CmsElementWithAttrsParamConfigHelper.addRules | public void addRules(Digester digester) {
"""
Adds the configuration parsing rules to the digester.<p>
@param digester the digester to which the rules should be added
"""
digester.addRule(m_basePath, new Rule() {
@SuppressWarnings("synthetic-access")
@Override
p... | java | public void addRules(Digester digester) {
digester.addRule(m_basePath, new Rule() {
@SuppressWarnings("synthetic-access")
@Override
public void begin(String namespace, String name, Attributes attributes) throws Exception {
I_CmsConfigurationParameterHandler... | [
"public",
"void",
"addRules",
"(",
"Digester",
"digester",
")",
"{",
"digester",
".",
"addRule",
"(",
"m_basePath",
",",
"new",
"Rule",
"(",
")",
"{",
"@",
"SuppressWarnings",
"(",
"\"synthetic-access\"",
")",
"@",
"Override",
"public",
"void",
"begin",
"(",... | Adds the configuration parsing rules to the digester.<p>
@param digester the digester to which the rules should be added | [
"Adds",
"the",
"configuration",
"parsing",
"rules",
"to",
"the",
"digester",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/configuration/CmsElementWithAttrsParamConfigHelper.java#L74-L100 |
intendia-oss/rxjava-gwt | src/main/modified/io/reactivex/super/io/reactivex/Maybe.java | Maybe.zipWith | @CheckReturnValue
@SchedulerSupport(SchedulerSupport.NONE)
public final <U, R> Maybe<R> zipWith(MaybeSource<? extends U> other, BiFunction<? super T, ? super U, ? extends R> zipper) {
"""
Waits until this and the other MaybeSource signal a success value then applies the given BiFunction
to those values an... | java | @CheckReturnValue
@SchedulerSupport(SchedulerSupport.NONE)
public final <U, R> Maybe<R> zipWith(MaybeSource<? extends U> other, BiFunction<? super T, ? super U, ? extends R> zipper) {
ObjectHelper.requireNonNull(other, "other is null");
return zip(this, other, zipper);
} | [
"@",
"CheckReturnValue",
"@",
"SchedulerSupport",
"(",
"SchedulerSupport",
".",
"NONE",
")",
"public",
"final",
"<",
"U",
",",
"R",
">",
"Maybe",
"<",
"R",
">",
"zipWith",
"(",
"MaybeSource",
"<",
"?",
"extends",
"U",
">",
"other",
",",
"BiFunction",
"<"... | Waits until this and the other MaybeSource signal a success value then applies the given BiFunction
to those values and emits the BiFunction's resulting value to downstream.
<img width="640" height="380" src="https://raw.github.com/wiki/ReactiveX/RxJava/images/rx-operators/zip.png" alt="">
<p>If either this or the ot... | [
"Waits",
"until",
"this",
"and",
"the",
"other",
"MaybeSource",
"signal",
"a",
"success",
"value",
"then",
"applies",
"the",
"given",
"BiFunction",
"to",
"those",
"values",
"and",
"emits",
"the",
"BiFunction",
"s",
"resulting",
"value",
"to",
"downstream",
"."... | train | https://github.com/intendia-oss/rxjava-gwt/blob/8d5635b12ce40da99e76b59dc6bfe6fc2fffc1fa/src/main/modified/io/reactivex/super/io/reactivex/Maybe.java#L4568-L4573 |
jmxtrans/embedded-jmxtrans | src/main/java/org/jmxtrans/embedded/util/net/ssl/SslUtils.java | SslUtils.getSslContext | @Nonnull
public static SSLContext getSslContext(@Nullable String keyStore, @Nullable String keyStorePassword, @Nullable String trustStore, @Nullable String trustStorePassword) {
"""
Build an {@link SSLContext} with the given trust store and key store.
@param keyStore path to the given JKS key stor... | java | @Nonnull
public static SSLContext getSslContext(@Nullable String keyStore, @Nullable String keyStorePassword, @Nullable String trustStore, @Nullable String trustStorePassword) {
try {
KeyManager[] keyManagers;
if (keyStore == null) {
keyManagers = null;
} ... | [
"@",
"Nonnull",
"public",
"static",
"SSLContext",
"getSslContext",
"(",
"@",
"Nullable",
"String",
"keyStore",
",",
"@",
"Nullable",
"String",
"keyStorePassword",
",",
"@",
"Nullable",
"String",
"trustStore",
",",
"@",
"Nullable",
"String",
"trustStorePassword",
"... | Build an {@link SSLContext} with the given trust store and key store.
@param keyStore path to the given JKS key store. Can be a classpath resource ("classpath:com/example/keystore.jks") of file system related. Optional, if {code null}, then the JVM key store is used.
@param keyStorePassword password to ope... | [
"Build",
"an",
"{",
"@link",
"SSLContext",
"}",
"with",
"the",
"given",
"trust",
"store",
"and",
"key",
"store",
"."
] | train | https://github.com/jmxtrans/embedded-jmxtrans/blob/17224389e7d8323284cabc2a5167fc03bed6d223/src/main/java/org/jmxtrans/embedded/util/net/ssl/SslUtils.java#L70-L124 |
tvesalainen/bcc | src/main/java/org/vesalainen/bcc/MethodCompiler.java | MethodCompiler.putField | public void putField(Class<?> cls, String name) throws IOException {
"""
Set field in class
<p>Stack: ..., value => ...
@param cls
@param name
@throws IOException
"""
putField(El.getField(cls, name));
} | java | public void putField(Class<?> cls, String name) throws IOException
{
putField(El.getField(cls, name));
} | [
"public",
"void",
"putField",
"(",
"Class",
"<",
"?",
">",
"cls",
",",
"String",
"name",
")",
"throws",
"IOException",
"{",
"putField",
"(",
"El",
".",
"getField",
"(",
"cls",
",",
"name",
")",
")",
";",
"}"
] | Set field in class
<p>Stack: ..., value => ...
@param cls
@param name
@throws IOException | [
"Set",
"field",
"in",
"class",
"<p",
">",
"Stack",
":",
"...",
"value",
"=",
">",
";",
"..."
] | train | https://github.com/tvesalainen/bcc/blob/4e84e313018d487f1a8cca3952d71bc21e77d16b/src/main/java/org/vesalainen/bcc/MethodCompiler.java#L994-L997 |
BigBadaboom/androidsvg | androidsvg/src/main/java/com/caverock/androidsvg/SVGParser.java | SVGParser.parsePaintSpecifier | private static SvgPaint parsePaintSpecifier(String val) {
"""
/*
Parse a paint specifier such as in the fill and stroke attributes.
"""
if (val.startsWith("url("))
{
int closeBracket = val.indexOf(")");
if (closeBracket != -1)
{
String href = val.s... | java | private static SvgPaint parsePaintSpecifier(String val)
{
if (val.startsWith("url("))
{
int closeBracket = val.indexOf(")");
if (closeBracket != -1)
{
String href = val.substring(4, closeBracket).trim();
SvgPaint fallback = null;
... | [
"private",
"static",
"SvgPaint",
"parsePaintSpecifier",
"(",
"String",
"val",
")",
"{",
"if",
"(",
"val",
".",
"startsWith",
"(",
"\"url(\"",
")",
")",
"{",
"int",
"closeBracket",
"=",
"val",
".",
"indexOf",
"(",
"\")\"",
")",
";",
"if",
"(",
"closeBrack... | /*
Parse a paint specifier such as in the fill and stroke attributes. | [
"/",
"*",
"Parse",
"a",
"paint",
"specifier",
"such",
"as",
"in",
"the",
"fill",
"and",
"stroke",
"attributes",
"."
] | train | https://github.com/BigBadaboom/androidsvg/blob/0d1614dd1a4da10ea4afe3b0cea1361a4ac6b45a/androidsvg/src/main/java/com/caverock/androidsvg/SVGParser.java#L3588-L3610 |
lievendoclo/Valkyrie-RCP | valkyrie-rcp-core/src/main/java/org/valkyriercp/binding/support/AbstractPropertyAccessStrategy.java | AbstractPropertyAccessStrategy.getUserMetadataFor | protected Object getUserMetadataFor(String propertyPath, String key) {
"""
Subclasses may override this method to supply user metadata for the
specified <code>propertyPath</code> and <code>key</code>. The
default implementation invokes {@link #getAllUserMetadataFor(String)} and
uses the returned Map with the <c... | java | protected Object getUserMetadataFor(String propertyPath, String key) {
final Map allMetadata = getAllUserMetadataFor(propertyPath);
return allMetadata != null ? allMetadata.get(key) : null;
} | [
"protected",
"Object",
"getUserMetadataFor",
"(",
"String",
"propertyPath",
",",
"String",
"key",
")",
"{",
"final",
"Map",
"allMetadata",
"=",
"getAllUserMetadataFor",
"(",
"propertyPath",
")",
";",
"return",
"allMetadata",
"!=",
"null",
"?",
"allMetadata",
".",
... | Subclasses may override this method to supply user metadata for the
specified <code>propertyPath</code> and <code>key</code>. The
default implementation invokes {@link #getAllUserMetadataFor(String)} and
uses the returned Map with the <code>key</code> parameter to find the
correlated value.
@param propertyPath path of... | [
"Subclasses",
"may",
"override",
"this",
"method",
"to",
"supply",
"user",
"metadata",
"for",
"the",
"specified",
"<code",
">",
"propertyPath<",
"/",
"code",
">",
"and",
"<code",
">",
"key<",
"/",
"code",
">",
".",
"The",
"default",
"implementation",
"invoke... | train | https://github.com/lievendoclo/Valkyrie-RCP/blob/6aad6e640b348cda8f3b0841f6e42025233f1eb8/valkyrie-rcp-core/src/main/java/org/valkyriercp/binding/support/AbstractPropertyAccessStrategy.java#L109-L112 |
JodaOrg/joda-time | src/main/java/org/joda/time/DateMidnight.java | DateMidnight.withDurationAdded | public DateMidnight withDurationAdded(ReadableDuration durationToAdd, int scalar) {
"""
Returns a copy of this date with the specified duration added.
<p>
If the addition is zero, then <code>this</code> is returned.
@param durationToAdd the duration to add to this one, null means zero
@param scalar the amo... | java | public DateMidnight withDurationAdded(ReadableDuration durationToAdd, int scalar) {
if (durationToAdd == null || scalar == 0) {
return this;
}
return withDurationAdded(durationToAdd.getMillis(), scalar);
} | [
"public",
"DateMidnight",
"withDurationAdded",
"(",
"ReadableDuration",
"durationToAdd",
",",
"int",
"scalar",
")",
"{",
"if",
"(",
"durationToAdd",
"==",
"null",
"||",
"scalar",
"==",
"0",
")",
"{",
"return",
"this",
";",
"}",
"return",
"withDurationAdded",
"... | Returns a copy of this date with the specified duration added.
<p>
If the addition is zero, then <code>this</code> is returned.
@param durationToAdd the duration to add to this one, null means zero
@param scalar the amount of times to add, such as -1 to subtract once
@return a copy of this datetime with the duration... | [
"Returns",
"a",
"copy",
"of",
"this",
"date",
"with",
"the",
"specified",
"duration",
"added",
".",
"<p",
">",
"If",
"the",
"addition",
"is",
"zero",
"then",
"<code",
">",
"this<",
"/",
"code",
">",
"is",
"returned",
"."
] | train | https://github.com/JodaOrg/joda-time/blob/bd79f1c4245e79b3c2c56d7b04fde2a6e191fa42/src/main/java/org/joda/time/DateMidnight.java#L530-L535 |
infinispan/infinispan | server/hotrod/src/main/java/org/infinispan/server/hotrod/tx/PrepareCoordinator.java | PrepareCoordinator.forgetTransaction | private void forgetTransaction(GlobalTransaction gtx, RpcManager rpcManager, CommandsFactory factory) {
"""
Forgets the transaction cluster-wise and from global and local transaction tables.
"""
TxCompletionNotificationCommand cmd = factory.buildTxCompletionNotificationCommand(xid, gtx);
rpcManager... | java | private void forgetTransaction(GlobalTransaction gtx, RpcManager rpcManager, CommandsFactory factory) {
TxCompletionNotificationCommand cmd = factory.buildTxCompletionNotificationCommand(xid, gtx);
rpcManager.sendToAll(cmd, DeliverOrder.NONE);
perCacheTxTable.removeLocalTx(xid);
globalTxTable.re... | [
"private",
"void",
"forgetTransaction",
"(",
"GlobalTransaction",
"gtx",
",",
"RpcManager",
"rpcManager",
",",
"CommandsFactory",
"factory",
")",
"{",
"TxCompletionNotificationCommand",
"cmd",
"=",
"factory",
".",
"buildTxCompletionNotificationCommand",
"(",
"xid",
",",
... | Forgets the transaction cluster-wise and from global and local transaction tables. | [
"Forgets",
"the",
"transaction",
"cluster",
"-",
"wise",
"and",
"from",
"global",
"and",
"local",
"transaction",
"tables",
"."
] | train | https://github.com/infinispan/infinispan/blob/7c62b94886c3febb4774ae8376acf2baa0265ab5/server/hotrod/src/main/java/org/infinispan/server/hotrod/tx/PrepareCoordinator.java#L240-L245 |
cfg4j/cfg4j | cfg4j-core/src/main/java/org/cfg4j/provider/ConfigurationProviderBuilder.java | ConfigurationProviderBuilder.withMetrics | public ConfigurationProviderBuilder withMetrics(MetricRegistry metricRegistry, String prefix) {
"""
Enable metrics emission for {@link ConfigurationProvider}s built by this builder. All metrics will be registered
with {@code metricRegistry} and prefixed by {@code prefix}. Provider built by this builder will emit ... | java | public ConfigurationProviderBuilder withMetrics(MetricRegistry metricRegistry, String prefix) {
this.prefix = requireNonNull(prefix);
this.metricRegistry = metricRegistry;
return this;
} | [
"public",
"ConfigurationProviderBuilder",
"withMetrics",
"(",
"MetricRegistry",
"metricRegistry",
",",
"String",
"prefix",
")",
"{",
"this",
".",
"prefix",
"=",
"requireNonNull",
"(",
"prefix",
")",
";",
"this",
".",
"metricRegistry",
"=",
"metricRegistry",
";",
"... | Enable metrics emission for {@link ConfigurationProvider}s built by this builder. All metrics will be registered
with {@code metricRegistry} and prefixed by {@code prefix}. Provider built by this builder will emit the following metrics:
<p>Provider-level metrics:</p>
<ul>
<li>allConfigurationAsProperties</li>
<li>getPr... | [
"Enable",
"metrics",
"emission",
"for",
"{",
"@link",
"ConfigurationProvider",
"}",
"s",
"built",
"by",
"this",
"builder",
".",
"All",
"metrics",
"will",
"be",
"registered",
"with",
"{",
"@code",
"metricRegistry",
"}",
"and",
"prefixed",
"by",
"{",
"@code",
... | train | https://github.com/cfg4j/cfg4j/blob/47d4f63e5fc820c62631e557adc34a29d8ab396d/cfg4j-core/src/main/java/org/cfg4j/provider/ConfigurationProviderBuilder.java#L123-L127 |
xwiki/xwiki-commons | xwiki-commons-core/xwiki-commons-legacy/xwiki-commons-legacy-component/xwiki-commons-legacy-component-default/src/main/java/org/xwiki/component/logging/AbstractLogger.java | AbstractLogger.formatMessage | protected String formatMessage(String message, Object... objects) {
"""
Formats the message like {@code MessageFormat.format(String, Object...)} but also checks for Exceptions and
catches them as logging should be robust and not interfere with normal program flow. The Exception caught will be
passed to the logge... | java | protected String formatMessage(String message, Object... objects)
{
try {
return MessageFormat.format(message, objects);
} catch (IllegalArgumentException e) {
debug("Caught exception while formatting logging message: " + message, e);
// Try to save the message f... | [
"protected",
"String",
"formatMessage",
"(",
"String",
"message",
",",
"Object",
"...",
"objects",
")",
"{",
"try",
"{",
"return",
"MessageFormat",
".",
"format",
"(",
"message",
",",
"objects",
")",
";",
"}",
"catch",
"(",
"IllegalArgumentException",
"e",
"... | Formats the message like {@code MessageFormat.format(String, Object...)} but also checks for Exceptions and
catches them as logging should be robust and not interfere with normal program flow. The Exception caught will be
passed to the loggers debug output.
@param message message in Formatter format syntax
@param obje... | [
"Formats",
"the",
"message",
"like",
"{",
"@code",
"MessageFormat",
".",
"format",
"(",
"String",
"Object",
"...",
")",
"}",
"but",
"also",
"checks",
"for",
"Exceptions",
"and",
"catches",
"them",
"as",
"logging",
"should",
"be",
"robust",
"and",
"not",
"i... | train | https://github.com/xwiki/xwiki-commons/blob/5374d8c6d966588c1eac7392c83da610dfb9f129/xwiki-commons-core/xwiki-commons-legacy/xwiki-commons-legacy-component/xwiki-commons-legacy-component-default/src/main/java/org/xwiki/component/logging/AbstractLogger.java#L44-L66 |
bbottema/simple-java-mail | modules/core-module/src/main/java/org/simplejavamail/config/ConfigLoader.java | ConfigLoader.loadProperties | public static Map<Property, Object> loadProperties(final String filename, final boolean addProperties) {
"""
Loads properties from property file on the classpath, if provided. Calling this method only has effect on new Email and Mailer instances after
this.
@param filename Any file that is on the classpat... | java | public static Map<Property, Object> loadProperties(final String filename, final boolean addProperties) {
final InputStream input = ConfigLoader.class.getClassLoader().getResourceAsStream(filename);
if (input != null) {
return loadProperties(input, addProperties);
}
LOGGER.debug("Property file not found on cl... | [
"public",
"static",
"Map",
"<",
"Property",
",",
"Object",
">",
"loadProperties",
"(",
"final",
"String",
"filename",
",",
"final",
"boolean",
"addProperties",
")",
"{",
"final",
"InputStream",
"input",
"=",
"ConfigLoader",
".",
"class",
".",
"getClassLoader",
... | Loads properties from property file on the classpath, if provided. Calling this method only has effect on new Email and Mailer instances after
this.
@param filename Any file that is on the classpath that holds a list of key=value pairs.
@param addProperties Flag to indicate if the new properties should be added o... | [
"Loads",
"properties",
"from",
"property",
"file",
"on",
"the",
"classpath",
"if",
"provided",
".",
"Calling",
"this",
"method",
"only",
"has",
"effect",
"on",
"new",
"Email",
"and",
"Mailer",
"instances",
"after",
"this",
"."
] | train | https://github.com/bbottema/simple-java-mail/blob/b03635328aeecd525e35eddfef8f5b9a184559d8/modules/core-module/src/main/java/org/simplejavamail/config/ConfigLoader.java#L214-L221 |
synchronoss/cpo-api | cpo-cassandra/src/main/java/org/synchronoss/cpo/cassandra/CassandraCpoAdapter.java | CassandraCpoAdapter.getGroupType | protected <T> String getGroupType(T obj, String type, String name, Session session) throws CpoException {
"""
DOCUMENT ME!
@param obj DOCUMENT ME!
@param type DOCUMENT ME!
@param name DOCUMENT ME!
@param session DOCUMENT ME!
@return DOCUMENT ME!
@throws CpoException DOCUMENT ME!
"""
String retT... | java | protected <T> String getGroupType(T obj, String type, String name, Session session) throws CpoException {
String retType = type;
long objCount;
if (CpoAdapter.PERSIST_GROUP.equals(retType)) {
objCount = existsObject(name, obj, session, null);
if (objCount == 0) {
retType = CpoAdapter.C... | [
"protected",
"<",
"T",
">",
"String",
"getGroupType",
"(",
"T",
"obj",
",",
"String",
"type",
",",
"String",
"name",
",",
"Session",
"session",
")",
"throws",
"CpoException",
"{",
"String",
"retType",
"=",
"type",
";",
"long",
"objCount",
";",
"if",
"(",... | DOCUMENT ME!
@param obj DOCUMENT ME!
@param type DOCUMENT ME!
@param name DOCUMENT ME!
@param session DOCUMENT ME!
@return DOCUMENT ME!
@throws CpoException DOCUMENT ME! | [
"DOCUMENT",
"ME!"
] | train | https://github.com/synchronoss/cpo-api/blob/dc745aca3b3206abf80b85d9689b0132f5baa694/cpo-cassandra/src/main/java/org/synchronoss/cpo/cassandra/CassandraCpoAdapter.java#L2473-L2490 |
teknux-org/jetty-bootstrap | jetty-bootstrap/src/main/java/org/teknux/jettybootstrap/JettyBootstrap.java | JettyBootstrap.addExplodedWarApp | public WebAppContext addExplodedWarApp(String explodedWar, String descriptor, String contextPath) throws JettyBootstrapException {
"""
Add an exploded (not packaged) War application specifying the context path.
@param explodedWar
the exploded war path
@param descriptor
the web.xml descriptor path
@param con... | java | public WebAppContext addExplodedWarApp(String explodedWar, String descriptor, String contextPath) throws JettyBootstrapException {
ExplodedWarAppJettyHandler explodedWarAppJettyHandler = new ExplodedWarAppJettyHandler(getInitializedConfiguration());
explodedWarAppJettyHandler.setWebAppBase(explodedWar);... | [
"public",
"WebAppContext",
"addExplodedWarApp",
"(",
"String",
"explodedWar",
",",
"String",
"descriptor",
",",
"String",
"contextPath",
")",
"throws",
"JettyBootstrapException",
"{",
"ExplodedWarAppJettyHandler",
"explodedWarAppJettyHandler",
"=",
"new",
"ExplodedWarAppJetty... | Add an exploded (not packaged) War application specifying the context path.
@param explodedWar
the exploded war path
@param descriptor
the web.xml descriptor path
@param contextPath
the path (base URL) to make the resource available
@return WebAppContext
@throws JettyBootstrapException
on failed | [
"Add",
"an",
"exploded",
"(",
"not",
"packaged",
")",
"War",
"application",
"specifying",
"the",
"context",
"path",
"."
] | train | https://github.com/teknux-org/jetty-bootstrap/blob/c16e710b833084c650fce35aa8c1ccaf83cd93ef/jetty-bootstrap/src/main/java/org/teknux/jettybootstrap/JettyBootstrap.java#L322-L332 |
ReactiveX/RxJavaAsyncUtil | src/main/java/rx/util/async/Async.java | Async.fromAction | public static <R> Observable<R> fromAction(Action0 action, R result, Scheduler scheduler) {
"""
Return an Observable that calls the given action and emits the given result when an Observer subscribes.
<p>
<img width="640" src="https://raw.github.com/wiki/ReactiveX/RxJava/images/rx-operators/fromAction.s.png" alt... | java | public static <R> Observable<R> fromAction(Action0 action, R result, Scheduler scheduler) {
return Observable.create(OperatorFromFunctionals.fromAction(action, result)).subscribeOn(scheduler);
} | [
"public",
"static",
"<",
"R",
">",
"Observable",
"<",
"R",
">",
"fromAction",
"(",
"Action0",
"action",
",",
"R",
"result",
",",
"Scheduler",
"scheduler",
")",
"{",
"return",
"Observable",
".",
"create",
"(",
"OperatorFromFunctionals",
".",
"fromAction",
"("... | Return an Observable that calls the given action and emits the given result when an Observer subscribes.
<p>
<img width="640" src="https://raw.github.com/wiki/ReactiveX/RxJava/images/rx-operators/fromAction.s.png" alt="">
@param <R> the return type
@param action the action to invoke on each subscription
@param schedul... | [
"Return",
"an",
"Observable",
"that",
"calls",
"the",
"given",
"action",
"and",
"emits",
"the",
"given",
"result",
"when",
"an",
"Observer",
"subscribes",
".",
"<p",
">",
"<img",
"width",
"=",
"640",
"src",
"=",
"https",
":",
"//",
"raw",
".",
"github",
... | train | https://github.com/ReactiveX/RxJavaAsyncUtil/blob/6294e1da30e639df79f76399906229314c14e74d/src/main/java/rx/util/async/Async.java#L2041-L2043 |
dnsjava/dnsjava | org/xbill/DNS/Mnemonic.java | Mnemonic.add | public void
add(int val, String str) {
"""
Defines the text representation of a numeric value.
@param val The numeric value
@param string The text string
"""
check(val);
Integer value = toInteger(val);
str = sanitize(str);
strings.put(str, value);
values.put(value, str);
} | java | public void
add(int val, String str) {
check(val);
Integer value = toInteger(val);
str = sanitize(str);
strings.put(str, value);
values.put(value, str);
} | [
"public",
"void",
"add",
"(",
"int",
"val",
",",
"String",
"str",
")",
"{",
"check",
"(",
"val",
")",
";",
"Integer",
"value",
"=",
"toInteger",
"(",
"val",
")",
";",
"str",
"=",
"sanitize",
"(",
"str",
")",
";",
"strings",
".",
"put",
"(",
"str"... | Defines the text representation of a numeric value.
@param val The numeric value
@param string The text string | [
"Defines",
"the",
"text",
"representation",
"of",
"a",
"numeric",
"value",
"."
] | train | https://github.com/dnsjava/dnsjava/blob/d97b6a0685d59143372bb392ab591dd8dd840b61/org/xbill/DNS/Mnemonic.java#L128-L135 |
wdullaer/MaterialDateTimePicker | library/src/main/java/com/wdullaer/materialdatetimepicker/time/AmPmCirclesView.java | AmPmCirclesView.getIsTouchingAmOrPm | public int getIsTouchingAmOrPm(float xCoord, float yCoord) {
"""
Calculate whether the coordinates are touching the AM or PM circle.
"""
if (!mDrawValuesReady) {
return -1;
}
int squaredYDistance = (int) ((yCoord - mAmPmYCenter)*(yCoord - mAmPmYCenter));
int distan... | java | public int getIsTouchingAmOrPm(float xCoord, float yCoord) {
if (!mDrawValuesReady) {
return -1;
}
int squaredYDistance = (int) ((yCoord - mAmPmYCenter)*(yCoord - mAmPmYCenter));
int distanceToAmCenter =
(int) Math.sqrt((xCoord - mAmXCenter)*(xCoord - mAmXCe... | [
"public",
"int",
"getIsTouchingAmOrPm",
"(",
"float",
"xCoord",
",",
"float",
"yCoord",
")",
"{",
"if",
"(",
"!",
"mDrawValuesReady",
")",
"{",
"return",
"-",
"1",
";",
"}",
"int",
"squaredYDistance",
"=",
"(",
"int",
")",
"(",
"(",
"yCoord",
"-",
"mAm... | Calculate whether the coordinates are touching the AM or PM circle. | [
"Calculate",
"whether",
"the",
"coordinates",
"are",
"touching",
"the",
"AM",
"or",
"PM",
"circle",
"."
] | train | https://github.com/wdullaer/MaterialDateTimePicker/blob/0a8fe28f19db4f5a5a6cfc525a852416232873a8/library/src/main/java/com/wdullaer/materialdatetimepicker/time/AmPmCirclesView.java#L135-L156 |
alkacon/opencms-core | src/org/opencms/ui/apps/CmsFileExplorer.java | CmsFileExplorer.onSiteOrProjectChange | public void onSiteOrProjectChange(CmsProject project, String siteRoot) {
"""
Call if site and or project have been changed.<p>
@param project the project
@param siteRoot the site root
"""
if ((siteRoot != null) && !siteRoot.equals(getSiteRootFromState())) {
changeSite(siteRoot, null, t... | java | public void onSiteOrProjectChange(CmsProject project, String siteRoot) {
if ((siteRoot != null) && !siteRoot.equals(getSiteRootFromState())) {
changeSite(siteRoot, null, true);
} else if ((project != null) && !project.getUuid().equals(getProjectIdFromState())) {
openPath(getPath... | [
"public",
"void",
"onSiteOrProjectChange",
"(",
"CmsProject",
"project",
",",
"String",
"siteRoot",
")",
"{",
"if",
"(",
"(",
"siteRoot",
"!=",
"null",
")",
"&&",
"!",
"siteRoot",
".",
"equals",
"(",
"getSiteRootFromState",
"(",
")",
")",
")",
"{",
"change... | Call if site and or project have been changed.<p>
@param project the project
@param siteRoot the site root | [
"Call",
"if",
"site",
"and",
"or",
"project",
"have",
"been",
"changed",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/ui/apps/CmsFileExplorer.java#L1017-L1026 |
fuwjax/ev-oss | funco/src/main/java/org/fuwjax/oss/util/io/Files2.java | Files2.copy | public static void copy(final Path source, final Path dest) throws IOException {
"""
Copies a source to a destination, works recursively on directories.
@param source the source path
@param dest the destination path
@throws IOException if the source cannot be copied to the destination
"""
if(Files.exists(... | java | public static void copy(final Path source, final Path dest) throws IOException {
if(Files.exists(source)) {
Files.walkFileTree(source, new SimpleFileVisitor<Path>() {
@Override
public FileVisitResult visitFile(final Path file, final BasicFileAttributes attrs) throws IOException {
Files.copy(file, reso... | [
"public",
"static",
"void",
"copy",
"(",
"final",
"Path",
"source",
",",
"final",
"Path",
"dest",
")",
"throws",
"IOException",
"{",
"if",
"(",
"Files",
".",
"exists",
"(",
"source",
")",
")",
"{",
"Files",
".",
"walkFileTree",
"(",
"source",
",",
"new... | Copies a source to a destination, works recursively on directories.
@param source the source path
@param dest the destination path
@throws IOException if the source cannot be copied to the destination | [
"Copies",
"a",
"source",
"to",
"a",
"destination",
"works",
"recursively",
"on",
"directories",
"."
] | train | https://github.com/fuwjax/ev-oss/blob/cbd88592e9b2fa9547c3bdd41e52e790061a2253/funco/src/main/java/org/fuwjax/oss/util/io/Files2.java#L36-L52 |
MariaDB/mariadb-connector-j | src/main/java/org/mariadb/jdbc/internal/com/read/resultset/SelectResultSet.java | SelectResultSet.createGeneratedData | public static ResultSet createGeneratedData(long[] data, Protocol protocol,
boolean findColumnReturnsOne) {
"""
Create a result set from given data. Useful for creating "fake" resultsets for
DatabaseMetaData, (one example is MariaDbDatabaseMetaData.getTypeInfo())
@param data - each elemen... | java | public static ResultSet createGeneratedData(long[] data, Protocol protocol,
boolean findColumnReturnsOne) {
ColumnInformation[] columns = new ColumnInformation[1];
columns[0] = ColumnInformation.create("insert_id", ColumnType.BIGINT);
List<byte[]> rows = new ArrayList<>();
for (long rowData : dat... | [
"public",
"static",
"ResultSet",
"createGeneratedData",
"(",
"long",
"[",
"]",
"data",
",",
"Protocol",
"protocol",
",",
"boolean",
"findColumnReturnsOne",
")",
"{",
"ColumnInformation",
"[",
"]",
"columns",
"=",
"new",
"ColumnInformation",
"[",
"1",
"]",
";",
... | Create a result set from given data. Useful for creating "fake" resultsets for
DatabaseMetaData, (one example is MariaDbDatabaseMetaData.getTypeInfo())
@param data - each element of this array represents a complete row in the
ResultSet. Each value is given in its string representation, as in
MariaDB te... | [
"Create",
"a",
"result",
"set",
"from",
"given",
"data",
".",
"Useful",
"for",
"creating",
"fake",
"resultsets",
"for",
"DatabaseMetaData",
"(",
"one",
"example",
"is",
"MariaDbDatabaseMetaData",
".",
"getTypeInfo",
"()",
")"
] | train | https://github.com/MariaDB/mariadb-connector-j/blob/d148c7cd347c4680617be65d9e511b289d38a30b/src/main/java/org/mariadb/jdbc/internal/com/read/resultset/SelectResultSet.java#L271-L291 |
thymeleaf/thymeleaf | src/main/java/org/thymeleaf/TemplateEngine.java | TemplateEngine.addDialect | public void addDialect(final String prefix, final IDialect dialect) {
"""
<p>
Adds a new dialect for this template engine, using the specified prefix.
</p>
<p>
This dialect will be added to the set of currently configured ones.
</p>
<p>
This operation can only be executed before processing templates for the... | java | public void addDialect(final String prefix, final IDialect dialect) {
Validate.notNull(dialect, "Dialect cannot be null");
checkNotInitialized();
this.dialectConfigurations.add(new DialectConfiguration(prefix, dialect));
} | [
"public",
"void",
"addDialect",
"(",
"final",
"String",
"prefix",
",",
"final",
"IDialect",
"dialect",
")",
"{",
"Validate",
".",
"notNull",
"(",
"dialect",
",",
"\"Dialect cannot be null\"",
")",
";",
"checkNotInitialized",
"(",
")",
";",
"this",
".",
"dialec... | <p>
Adds a new dialect for this template engine, using the specified prefix.
</p>
<p>
This dialect will be added to the set of currently configured ones.
</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>... | [
"<p",
">",
"Adds",
"a",
"new",
"dialect",
"for",
"this",
"template",
"engine",
"using",
"the",
"specified",
"prefix",
".",
"<",
"/",
"p",
">",
"<p",
">",
"This",
"dialect",
"will",
"be",
"added",
"to",
"the",
"set",
"of",
"currently",
"configured",
"on... | train | https://github.com/thymeleaf/thymeleaf/blob/2b0e6d6d7571fbe638904b5fd222fc9e77188879/src/main/java/org/thymeleaf/TemplateEngine.java#L500-L504 |
lessthanoptimal/BoofCV | main/boofcv-feature/src/main/java/boofcv/alg/feature/describe/DescribePointSift.java | DescribePointSift.process | public void process( double c_x , double c_y , double sigma , double orientation , TupleDesc_F64 descriptor ) {
"""
Computes the SIFT descriptor for the specified key point
@param c_x center of key point. x-axis
@param c_y center of key point. y-axis
@param sigma Computed sigma in scale-space for this point... | java | public void process( double c_x , double c_y , double sigma , double orientation , TupleDesc_F64 descriptor )
{
descriptor.fill(0);
computeRawDescriptor(c_x, c_y, sigma, orientation, descriptor);
normalizeDescriptor(descriptor,maxDescriptorElementValue);
} | [
"public",
"void",
"process",
"(",
"double",
"c_x",
",",
"double",
"c_y",
",",
"double",
"sigma",
",",
"double",
"orientation",
",",
"TupleDesc_F64",
"descriptor",
")",
"{",
"descriptor",
".",
"fill",
"(",
"0",
")",
";",
"computeRawDescriptor",
"(",
"c_x",
... | Computes the SIFT descriptor for the specified key point
@param c_x center of key point. x-axis
@param c_y center of key point. y-axis
@param sigma Computed sigma in scale-space for this point
@param orientation Orientation of keypoint in radians
@param descriptor (output) Storage for computed descriptor. Make sure... | [
"Computes",
"the",
"SIFT",
"descriptor",
"for",
"the",
"specified",
"key",
"point"
] | train | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-feature/src/main/java/boofcv/alg/feature/describe/DescribePointSift.java#L105-L112 |
google/j2objc | xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/dtm/ref/sax2dtm/SAX2DTM2.java | SAX2DTM2.copyAttributes | protected final void copyAttributes(final int nodeID, SerializationHandler handler)
throws SAXException {
"""
Copy attribute nodes from an element .
@param nodeID The Element node identity
@param handler The SerializationHandler
"""
for(int current = getFirstAttributeIdentity(nodeID); curr... | java | protected final void copyAttributes(final int nodeID, SerializationHandler handler)
throws SAXException{
for(int current = getFirstAttributeIdentity(nodeID); current != DTM.NULL; current = getNextAttributeIdentity(current)){
int eType = _exptype2(current);
copyAttribute(current, ... | [
"protected",
"final",
"void",
"copyAttributes",
"(",
"final",
"int",
"nodeID",
",",
"SerializationHandler",
"handler",
")",
"throws",
"SAXException",
"{",
"for",
"(",
"int",
"current",
"=",
"getFirstAttributeIdentity",
"(",
"nodeID",
")",
";",
"current",
"!=",
"... | Copy attribute nodes from an element .
@param nodeID The Element node identity
@param handler The SerializationHandler | [
"Copy",
"attribute",
"nodes",
"from",
"an",
"element",
"."
] | train | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/dtm/ref/sax2dtm/SAX2DTM2.java#L3326-L3333 |
apache/groovy | src/main/java/org/codehaus/groovy/runtime/IOGroovyMethods.java | IOGroovyMethods.newReader | public static BufferedReader newReader(InputStream self, String charset) throws UnsupportedEncodingException {
"""
Creates a reader for this input stream, using the specified
charset as the encoding.
@param self an input stream
@param charset the charset for this input stream
@return a reader
@throws Uns... | java | public static BufferedReader newReader(InputStream self, String charset) throws UnsupportedEncodingException {
return new BufferedReader(new InputStreamReader(self, charset));
} | [
"public",
"static",
"BufferedReader",
"newReader",
"(",
"InputStream",
"self",
",",
"String",
"charset",
")",
"throws",
"UnsupportedEncodingException",
"{",
"return",
"new",
"BufferedReader",
"(",
"new",
"InputStreamReader",
"(",
"self",
",",
"charset",
")",
")",
... | Creates a reader for this input stream, using the specified
charset as the encoding.
@param self an input stream
@param charset the charset for this input stream
@return a reader
@throws UnsupportedEncodingException if the encoding specified is not supported
@since 1.6.0 | [
"Creates",
"a",
"reader",
"for",
"this",
"input",
"stream",
"using",
"the",
"specified",
"charset",
"as",
"the",
"encoding",
"."
] | train | https://github.com/apache/groovy/blob/71cf20addb611bb8d097a59e395fd20bc7f31772/src/main/java/org/codehaus/groovy/runtime/IOGroovyMethods.java#L1067-L1069 |
OpenLiberty/open-liberty | dev/wlp-mavenRepoTasks/src/com/ibm/ws/wlp/mavenFeatures/LibertyFeaturesToMavenRepo.java | LibertyFeaturesToMavenRepo.findCompileDependency | private static MavenCoordinates findCompileDependency(String zipEntryPath, String groupId) {
"""
Find compile dependency from a zip entry in the ESA
@param zipEntryPath The entry path in the zip
@param groupId The group ID of the dependency to look for
@return Maven coordinates corresponding to the entry
... | java | private static MavenCoordinates findCompileDependency(String zipEntryPath, String groupId) {
int apiNameIndex = zipEntryPath.indexOf(groupId);
int extensionIndex = zipEntryPath.lastIndexOf(".jar");
if (apiNameIndex >= 0 && extensionIndex >= 0) {
String fileNameWithoutExtension = zipEntryPath.substring(apiNameI... | [
"private",
"static",
"MavenCoordinates",
"findCompileDependency",
"(",
"String",
"zipEntryPath",
",",
"String",
"groupId",
")",
"{",
"int",
"apiNameIndex",
"=",
"zipEntryPath",
".",
"indexOf",
"(",
"groupId",
")",
";",
"int",
"extensionIndex",
"=",
"zipEntryPath",
... | Find compile dependency from a zip entry in the ESA
@param zipEntryPath The entry path in the zip
@param groupId The group ID of the dependency to look for
@return Maven coordinates corresponding to the entry | [
"Find",
"compile",
"dependency",
"from",
"a",
"zip",
"entry",
"in",
"the",
"ESA"
] | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/wlp-mavenRepoTasks/src/com/ibm/ws/wlp/mavenFeatures/LibertyFeaturesToMavenRepo.java#L496-L509 |
Omertron/api-fanarttv | src/main/java/com/omertron/fanarttvapi/FanartTvApi.java | FanartTvApi.requestWebPage | private String requestWebPage(URL url) throws FanartTvException {
"""
Download the URL into a String
@param url
@return
@throws FanartTvException
"""
try {
HttpGet httpGet = new HttpGet(url.toURI());
httpGet.addHeader("accept", "application/json");
final Digeste... | java | private String requestWebPage(URL url) throws FanartTvException {
try {
HttpGet httpGet = new HttpGet(url.toURI());
httpGet.addHeader("accept", "application/json");
final DigestedResponse response = DigestedResponseReader.requestContent(httpClient, httpGet, charset);
... | [
"private",
"String",
"requestWebPage",
"(",
"URL",
"url",
")",
"throws",
"FanartTvException",
"{",
"try",
"{",
"HttpGet",
"httpGet",
"=",
"new",
"HttpGet",
"(",
"url",
".",
"toURI",
"(",
")",
")",
";",
"httpGet",
".",
"addHeader",
"(",
"\"accept\"",
",",
... | Download the URL into a String
@param url
@return
@throws FanartTvException | [
"Download",
"the",
"URL",
"into",
"a",
"String"
] | train | https://github.com/Omertron/api-fanarttv/blob/2a1854c840d8111935d0f6abe5232e2c3c3f318b/src/main/java/com/omertron/fanarttvapi/FanartTvApi.java#L305-L323 |
inkstand-io/scribble | scribble-core/src/main/java/io/inkstand/scribble/rules/BaseRule.java | BaseRule.apply | @Override
public Statement apply(final Statement base, final Description description) {
"""
Invokes the outer rule - if set - around the base {@link Statement}
"""
if (outerRule != null) {
return outerRule.apply(base, description);
}
return base;
} | java | @Override
public Statement apply(final Statement base, final Description description) {
if (outerRule != null) {
return outerRule.apply(base, description);
}
return base;
} | [
"@",
"Override",
"public",
"Statement",
"apply",
"(",
"final",
"Statement",
"base",
",",
"final",
"Description",
"description",
")",
"{",
"if",
"(",
"outerRule",
"!=",
"null",
")",
"{",
"return",
"outerRule",
".",
"apply",
"(",
"base",
",",
"description",
... | Invokes the outer rule - if set - around the base {@link Statement} | [
"Invokes",
"the",
"outer",
"rule",
"-",
"if",
"set",
"-",
"around",
"the",
"base",
"{"
] | train | https://github.com/inkstand-io/scribble/blob/66e67553bad4b1ff817e1715fd1d3dd833406744/scribble-core/src/main/java/io/inkstand/scribble/rules/BaseRule.java#L61-L67 |
OpenLiberty/open-liberty | dev/com.ibm.ws.messaging.runtime/src/com/ibm/ws/sib/processor/utils/linkedlist/LinkedList.java | LinkedList.insertAtBottom | public Entry insertAtBottom(Entry entry) {
"""
Synchronized. Insert a new entry in to the list at the bottom.
The new entry must not be already in any list, including this one.
@param entry The entry to be added.
@return The entry after it has been added
"""
if (tc.isEntryEnabled())
SibTr.entry(... | java | public Entry insertAtBottom(Entry entry)
{
if (tc.isEntryEnabled())
SibTr.entry(tc, "insertAtBottom", new Object[] { entry });
//only add in the new entry if it is not already in a list.
if(entry.parentList == null)
{
//if the list is empty
if(last == null)
{
//double ... | [
"public",
"Entry",
"insertAtBottom",
"(",
"Entry",
"entry",
")",
"{",
"if",
"(",
"tc",
".",
"isEntryEnabled",
"(",
")",
")",
"SibTr",
".",
"entry",
"(",
"tc",
",",
"\"insertAtBottom\"",
",",
"new",
"Object",
"[",
"]",
"{",
"entry",
"}",
")",
";",
"//... | Synchronized. Insert a new entry in to the list at the bottom.
The new entry must not be already in any list, including this one.
@param entry The entry to be added.
@return The entry after it has been added | [
"Synchronized",
".",
"Insert",
"a",
"new",
"entry",
"in",
"to",
"the",
"list",
"at",
"the",
"bottom",
".",
"The",
"new",
"entry",
"must",
"not",
"be",
"already",
"in",
"any",
"list",
"including",
"this",
"one",
"."
] | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.messaging.runtime/src/com/ibm/ws/sib/processor/utils/linkedlist/LinkedList.java#L109-L166 |
b3dgs/lionengine | lionengine-game/src/main/java/com/b3dgs/lionengine/game/feature/tile/map/pathfinding/PathfindableModel.java | PathfindableModel.checkArrivedX | private boolean checkArrivedX(double extrp, double sx, double dx) {
"""
Check if the pathfindable is horizontally arrived.
@param extrp The extrapolation value.
@param sx The horizontal speed.
@param dx The horizontal tile destination.
@return <code>true</code> if arrived, <code>false</code> else.
"""
... | java | private boolean checkArrivedX(double extrp, double sx, double dx)
{
final double x = transformable.getX();
if (sx < 0 && x <= dx || sx >= 0 && x >= dx)
{
transformable.moveLocation(extrp, dx - x, 0);
return true;
}
return false;
} | [
"private",
"boolean",
"checkArrivedX",
"(",
"double",
"extrp",
",",
"double",
"sx",
",",
"double",
"dx",
")",
"{",
"final",
"double",
"x",
"=",
"transformable",
".",
"getX",
"(",
")",
";",
"if",
"(",
"sx",
"<",
"0",
"&&",
"x",
"<=",
"dx",
"||",
"sx... | Check if the pathfindable is horizontally arrived.
@param extrp The extrapolation value.
@param sx The horizontal speed.
@param dx The horizontal tile destination.
@return <code>true</code> if arrived, <code>false</code> else. | [
"Check",
"if",
"the",
"pathfindable",
"is",
"horizontally",
"arrived",
"."
] | train | https://github.com/b3dgs/lionengine/blob/cac3d5578532cf11724a737b9f09e71bf9995ab2/lionengine-game/src/main/java/com/b3dgs/lionengine/game/feature/tile/map/pathfinding/PathfindableModel.java#L363-L372 |
puniverse/galaxy | src/main/java/co/paralleluniverse/common/io/Streamables.java | Streamables.fromByteArray | public static void fromByteArray(Streamable streamable, byte[] array, int offset, int length) {
"""
Reads a {@link Streamable}'s serialized contents from a byte array.
@param streamable The object whose contents are to be read.
@param array The array from which to read the serialized form.
@param offset The o... | java | public static void fromByteArray(Streamable streamable, byte[] array, int offset, int length) {
try {
final ByteArrayInputStream bais = new ByteArrayInputStream(array, offset, length);
final DataInputStream dis = new DataInputStream(bais);
streamable.read(dis);
... | [
"public",
"static",
"void",
"fromByteArray",
"(",
"Streamable",
"streamable",
",",
"byte",
"[",
"]",
"array",
",",
"int",
"offset",
",",
"int",
"length",
")",
"{",
"try",
"{",
"final",
"ByteArrayInputStream",
"bais",
"=",
"new",
"ByteArrayInputStream",
"(",
... | Reads a {@link Streamable}'s serialized contents from a byte array.
@param streamable The object whose contents are to be read.
@param array The array from which to read the serialized form.
@param offset The offset into the array from which to start reading the serialized form.
@param length The length of the seriali... | [
"Reads",
"a",
"{",
"@link",
"Streamable",
"}",
"s",
"serialized",
"contents",
"from",
"a",
"byte",
"array",
"."
] | train | https://github.com/puniverse/galaxy/blob/1d077532c4a5bcd6c52ff670770c31e98420ff63/src/main/java/co/paralleluniverse/common/io/Streamables.java#L88-L97 |
vnesek/nmote-iim4j | src/main/java/com/nmote/iim4j/IIMFile.java | IIMFile.getDateTimeHelper | public Date getDateTimeHelper(int dateDataSet, int timeDataSet) throws SerializationException {
"""
Gets combined date/time value from two data sets.
@param dateDataSet
data set containing date value
@param timeDataSet
data set containing time value
@return date/time instance
@throws SerializationException... | java | public Date getDateTimeHelper(int dateDataSet, int timeDataSet) throws SerializationException {
DataSet dateDS = null;
DataSet timeDS = null;
for (Iterator<DataSet> i = dataSets.iterator(); (dateDS == null || timeDS == null) && i.hasNext();) {
DataSet ds = i.next();
DataSetInfo info = ds.getInfo();
... | [
"public",
"Date",
"getDateTimeHelper",
"(",
"int",
"dateDataSet",
",",
"int",
"timeDataSet",
")",
"throws",
"SerializationException",
"{",
"DataSet",
"dateDS",
"=",
"null",
";",
"DataSet",
"timeDS",
"=",
"null",
";",
"for",
"(",
"Iterator",
"<",
"DataSet",
">"... | Gets combined date/time value from two data sets.
@param dateDataSet
data set containing date value
@param timeDataSet
data set containing time value
@return date/time instance
@throws SerializationException
if data sets can't be deserialized from binary format or
can't be parsed | [
"Gets",
"combined",
"date",
"/",
"time",
"value",
"from",
"two",
"data",
"sets",
"."
] | train | https://github.com/vnesek/nmote-iim4j/blob/ec55b02fc644cd722e93051ac0bdb96b00cb42a8/src/main/java/com/nmote/iim4j/IIMFile.java#L203-L233 |
grails/grails-core | grails-core/src/main/groovy/org/grails/spring/beans/factory/GenericBeanFactoryAccessor.java | GenericBeanFactoryAccessor.findAnnotationOnBean | public <A extends Annotation> A findAnnotationOnBean(String beanName, Class<A> annotationType) {
"""
Find a {@link Annotation} of <code>annotationType</code> on the specified
bean, traversing its interfaces and super classes if no annotation can be
found on the given class itself, as well as checking its raw bea... | java | public <A extends Annotation> A findAnnotationOnBean(String beanName, Class<A> annotationType) {
Class<?> handlerType = beanFactory.getType(beanName);
A ann = AnnotationUtils.findAnnotation(handlerType, annotationType);
if (ann == null && beanFactory instanceof ConfigurableBeanFactory &&
... | [
"public",
"<",
"A",
"extends",
"Annotation",
">",
"A",
"findAnnotationOnBean",
"(",
"String",
"beanName",
",",
"Class",
"<",
"A",
">",
"annotationType",
")",
"{",
"Class",
"<",
"?",
">",
"handlerType",
"=",
"beanFactory",
".",
"getType",
"(",
"beanName",
"... | Find a {@link Annotation} of <code>annotationType</code> on the specified
bean, traversing its interfaces and super classes if no annotation can be
found on the given class itself, as well as checking its raw bean class
if not found on the exposed bean reference (e.g. in case of a proxy).
@param beanName the name of th... | [
"Find",
"a",
"{"
] | train | https://github.com/grails/grails-core/blob/c0b08aa995b0297143b75d05642abba8cb7b4122/grails-core/src/main/groovy/org/grails/spring/beans/factory/GenericBeanFactoryAccessor.java#L116-L132 |
landawn/AbacusUtil | src/com/landawn/abacus/util/Fraction.java | Fraction.subAndCheck | private static int subAndCheck(final int x, final int y) {
"""
Subtract two integers, checking for overflow.
@param x
the minuend
@param y
the subtrahend
@return the difference <code>x-y</code>
@throws ArithmeticException
if the result can not be represented as an int
"""
final long s = (long)... | java | private static int subAndCheck(final int x, final int y) {
final long s = (long) x - (long) y;
if (s < Integer.MIN_VALUE || s > Integer.MAX_VALUE) {
throw new ArithmeticException("overflow: add");
}
return (int) s;
} | [
"private",
"static",
"int",
"subAndCheck",
"(",
"final",
"int",
"x",
",",
"final",
"int",
"y",
")",
"{",
"final",
"long",
"s",
"=",
"(",
"long",
")",
"x",
"-",
"(",
"long",
")",
"y",
";",
"if",
"(",
"s",
"<",
"Integer",
".",
"MIN_VALUE",
"||",
... | Subtract two integers, checking for overflow.
@param x
the minuend
@param y
the subtrahend
@return the difference <code>x-y</code>
@throws ArithmeticException
if the result can not be represented as an int | [
"Subtract",
"two",
"integers",
"checking",
"for",
"overflow",
"."
] | train | https://github.com/landawn/AbacusUtil/blob/544b7720175d15e9329f83dd22a8cc5fa4515e12/src/com/landawn/abacus/util/Fraction.java#L819-L825 |
javalite/activeweb | activeweb/src/main/java/org/javalite/activeweb/freemarker/TagFactory.java | TagFactory.addAttributesExcept | public void addAttributesExcept(Map params, String ... exceptions) {
"""
Will add values from params map except the exceptions.
@param params map with values. Key used as an attribute name, value as value.
@param exceptions list of excepted keys.
"""
List exceptionList = Arrays.asList(exceptions);... | java | public void addAttributesExcept(Map params, String ... exceptions){
List exceptionList = Arrays.asList(exceptions);
for(Object key: params.keySet()){
if(!exceptionList.contains(key)){
attribute(key.toString(), params.get(key).toString());
}
}
} | [
"public",
"void",
"addAttributesExcept",
"(",
"Map",
"params",
",",
"String",
"...",
"exceptions",
")",
"{",
"List",
"exceptionList",
"=",
"Arrays",
".",
"asList",
"(",
"exceptions",
")",
";",
"for",
"(",
"Object",
"key",
":",
"params",
".",
"keySet",
"(",... | Will add values from params map except the exceptions.
@param params map with values. Key used as an attribute name, value as value.
@param exceptions list of excepted keys. | [
"Will",
"add",
"values",
"from",
"params",
"map",
"except",
"the",
"exceptions",
"."
] | train | https://github.com/javalite/activeweb/blob/f25f589da94852b6f5625182360732e0861794a6/activeweb/src/main/java/org/javalite/activeweb/freemarker/TagFactory.java#L100-L107 |
andygibson/datafactory | src/main/java/org/fluttercode/datafactory/impl/DataFactory.java | DataFactory.getNumberBetween | public int getNumberBetween(final int min, final int max) {
"""
Returns a number betwen min and max
@param min minimum value of result
@param max maximum value of result
@return Random number within range
"""
if (max < min) {
throw new IllegalArgumentException(String.format("Minimum must be ... | java | public int getNumberBetween(final int min, final int max) {
if (max < min) {
throw new IllegalArgumentException(String.format("Minimum must be less than minimum (min=%d, max=%d)", min, max));
}
if (max == min) {
return min;
}
return min + random.nextInt(max - min);
} | [
"public",
"int",
"getNumberBetween",
"(",
"final",
"int",
"min",
",",
"final",
"int",
"max",
")",
"{",
"if",
"(",
"max",
"<",
"min",
")",
"{",
"throw",
"new",
"IllegalArgumentException",
"(",
"String",
".",
"format",
"(",
"\"Minimum must be less than minimum (... | Returns a number betwen min and max
@param min minimum value of result
@param max maximum value of result
@return Random number within range | [
"Returns",
"a",
"number",
"betwen",
"min",
"and",
"max"
] | train | https://github.com/andygibson/datafactory/blob/f748beb93844dea2ad6174715be3b70df0448a9c/src/main/java/org/fluttercode/datafactory/impl/DataFactory.java#L322-L332 |
Mozu/mozu-java | mozu-java-core/src/main/java/com/mozu/api/urls/commerce/catalog/admin/PriceListUrl.java | PriceListUrl.bulkDeletePriceListEntriesUrl | public static MozuUrl bulkDeletePriceListEntriesUrl(Boolean invalidateCache, Boolean publishEvents) {
"""
Get Resource Url for BulkDeletePriceListEntries
@param invalidateCache Disable this property if you expect to encounter unacceptable performance hits related to clearing the cache for each product in the pric... | java | public static MozuUrl bulkDeletePriceListEntriesUrl(Boolean invalidateCache, Boolean publishEvents)
{
UrlFormatter formatter = new UrlFormatter("/api/commerce/catalog/admin/pricelists/bulkdeleteentries?publishEvents={publishEvents}&invalidateCache={invalidateCache}");
formatter.formatUrl("invalidateCache", inva... | [
"public",
"static",
"MozuUrl",
"bulkDeletePriceListEntriesUrl",
"(",
"Boolean",
"invalidateCache",
",",
"Boolean",
"publishEvents",
")",
"{",
"UrlFormatter",
"formatter",
"=",
"new",
"UrlFormatter",
"(",
"\"/api/commerce/catalog/admin/pricelists/bulkdeleteentries?publishEvents={p... | Get Resource Url for BulkDeletePriceListEntries
@param invalidateCache Disable this property if you expect to encounter unacceptable performance hits related to clearing the cache for each product in the price list entries. Otherwise, leave this property enabled.
@param publishEvents Disable this property to prevent pu... | [
"Get",
"Resource",
"Url",
"for",
"BulkDeletePriceListEntries"
] | train | https://github.com/Mozu/mozu-java/blob/5beadde73601a859f845e3e2fc1077b39c8bea83/mozu-java-core/src/main/java/com/mozu/api/urls/commerce/catalog/admin/PriceListUrl.java#L82-L88 |
Chorus-bdd/Chorus | interpreter/chorus-util/src/main/java/org/chorusbdd/chorus/util/assertion/ChorusAssert.java | ChorusAssert.assertEquals | static public void assertEquals(String message, short expected, short actual) {
"""
Asserts that two shorts are equal. If they are not
an AssertionFailedError is thrown with the given message.
"""
assertEquals(message, new Short(expected), new Short(actual));
} | java | static public void assertEquals(String message, short expected, short actual) {
assertEquals(message, new Short(expected), new Short(actual));
} | [
"static",
"public",
"void",
"assertEquals",
"(",
"String",
"message",
",",
"short",
"expected",
",",
"short",
"actual",
")",
"{",
"assertEquals",
"(",
"message",
",",
"new",
"Short",
"(",
"expected",
")",
",",
"new",
"Short",
"(",
"actual",
")",
")",
";"... | Asserts that two shorts are equal. If they are not
an AssertionFailedError is thrown with the given message. | [
"Asserts",
"that",
"two",
"shorts",
"are",
"equal",
".",
"If",
"they",
"are",
"not",
"an",
"AssertionFailedError",
"is",
"thrown",
"with",
"the",
"given",
"message",
"."
] | train | https://github.com/Chorus-bdd/Chorus/blob/1eea7ca858876bce821bb49b43fd5b6ba1737997/interpreter/chorus-util/src/main/java/org/chorusbdd/chorus/util/assertion/ChorusAssert.java#L215-L217 |
Omertron/api-tvrage | src/main/java/com/omertron/tvrageapi/tools/DOMHelper.java | DOMHelper.getEventDocFromUrl | public static Document getEventDocFromUrl(String url) throws TVRageException {
"""
Get a DOM document from the supplied URL
@param url
@return
@throws com.omertron.tvrageapi.TVRageException
"""
Document doc;
InputStream in = null;
try {
in = new ByteArrayInputStream(re... | java | public static Document getEventDocFromUrl(String url) throws TVRageException {
Document doc;
InputStream in = null;
try {
in = new ByteArrayInputStream(requestWebContent(url));
DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();
DocumentBuilde... | [
"public",
"static",
"Document",
"getEventDocFromUrl",
"(",
"String",
"url",
")",
"throws",
"TVRageException",
"{",
"Document",
"doc",
";",
"InputStream",
"in",
"=",
"null",
";",
"try",
"{",
"in",
"=",
"new",
"ByteArrayInputStream",
"(",
"requestWebContent",
"(",... | Get a DOM document from the supplied URL
@param url
@return
@throws com.omertron.tvrageapi.TVRageException | [
"Get",
"a",
"DOM",
"document",
"from",
"the",
"supplied",
"URL"
] | train | https://github.com/Omertron/api-tvrage/blob/4e805a99de812fabea69d97098f2376be14d51bc/src/main/java/com/omertron/tvrageapi/tools/DOMHelper.java#L99-L123 |
avianey/facebook-api-android-maven | facebook/src/main/java/com/facebook/android/Facebook.java | Facebook.setTokenFromCache | @Deprecated
public void setTokenFromCache(String accessToken, long accessExpires, long lastAccessUpdate) {
"""
Restore the token, expiration time, and last update time from cached values.
These should be values obtained from getAccessToken(), getAccessExpires, and
getLastAccessUpdate() respectively.
<p/>
T... | java | @Deprecated
public void setTokenFromCache(String accessToken, long accessExpires, long lastAccessUpdate) {
checkUserSession("setTokenFromCache");
synchronized (this.lock) {
this.accessToken = accessToken;
accessExpiresMillisecondsAfterEpoch = accessExpires;
lastAc... | [
"@",
"Deprecated",
"public",
"void",
"setTokenFromCache",
"(",
"String",
"accessToken",
",",
"long",
"accessExpires",
",",
"long",
"lastAccessUpdate",
")",
"{",
"checkUserSession",
"(",
"\"setTokenFromCache\"",
")",
";",
"synchronized",
"(",
"this",
".",
"lock",
"... | Restore the token, expiration time, and last update time from cached values.
These should be values obtained from getAccessToken(), getAccessExpires, and
getLastAccessUpdate() respectively.
<p/>
This method is deprecated. See {@link Facebook} and {@link Session} for more info.
@param accessToken - access token
@param... | [
"Restore",
"the",
"token",
"expiration",
"time",
"and",
"last",
"update",
"time",
"from",
"cached",
"values",
".",
"These",
"should",
"be",
"values",
"obtained",
"from",
"getAccessToken",
"()",
"getAccessExpires",
"and",
"getLastAccessUpdate",
"()",
"respectively",
... | train | https://github.com/avianey/facebook-api-android-maven/blob/ae6c7aa7ae45739ee19f18c1983e05f7e35b9ede/facebook/src/main/java/com/facebook/android/Facebook.java#L1035-L1043 |
liferay/com-liferay-commerce | commerce-product-service/src/main/java/com/liferay/commerce/product/service/persistence/impl/CPDefinitionOptionValueRelPersistenceImpl.java | CPDefinitionOptionValueRelPersistenceImpl.findByKey | @Override
public List<CPDefinitionOptionValueRel> findByKey(String key, int start,
int end) {
"""
Returns a range of all the cp definition option value rels where key = ?.
<p>
Useful when paginating results. Returns a maximum of <code>end - start</code> instances. <code>start</code> and <code>end</code>... | java | @Override
public List<CPDefinitionOptionValueRel> findByKey(String key, int start,
int end) {
return findByKey(key, start, end, null);
} | [
"@",
"Override",
"public",
"List",
"<",
"CPDefinitionOptionValueRel",
">",
"findByKey",
"(",
"String",
"key",
",",
"int",
"start",
",",
"int",
"end",
")",
"{",
"return",
"findByKey",
"(",
"key",
",",
"start",
",",
"end",
",",
"null",
")",
";",
"}"
] | Returns a range of all the cp definition option value rels where key = ?.
<p>
Useful when paginating results. Returns a maximum of <code>end - start</code> instances. <code>start</code> and <code>end</code> are not primary keys, they are indexes in the result set. Thus, <code>0</code> refers to the first result in... | [
"Returns",
"a",
"range",
"of",
"all",
"the",
"cp",
"definition",
"option",
"value",
"rels",
"where",
"key",
"=",
"?",
";",
"."
] | train | https://github.com/liferay/com-liferay-commerce/blob/9e54362d7f59531fc684016ba49ee7cdc3a2f22b/commerce-product-service/src/main/java/com/liferay/commerce/product/service/persistence/impl/CPDefinitionOptionValueRelPersistenceImpl.java#L3114-L3118 |
sporniket/core | sporniket-core-lang/src/main/java/com/sporniket/libre/lang/functor/FunctorFactory.java | FunctorFactory.instanciateFunctorAsAnInstanceMethodWrapper | public static Functor instanciateFunctorAsAnInstanceMethodWrapper(final Object instance, String methodName) throws Exception {
"""
Create a functor without parameter, wrapping a call to another method.
@param instance
instance to call the method upon. Should not be null.
@param methodName
Name of the method,... | java | public static Functor instanciateFunctorAsAnInstanceMethodWrapper(final Object instance, String methodName) throws Exception
{
if (null == instance)
{
throw new NullPointerException("Instance is null");
}
Method _method = instance.getClass().getMethod(methodName, (Class<?>[]) null);
return instanci... | [
"public",
"static",
"Functor",
"instanciateFunctorAsAnInstanceMethodWrapper",
"(",
"final",
"Object",
"instance",
",",
"String",
"methodName",
")",
"throws",
"Exception",
"{",
"if",
"(",
"null",
"==",
"instance",
")",
"{",
"throw",
"new",
"NullPointerException",
"("... | Create a functor without parameter, wrapping a call to another method.
@param instance
instance to call the method upon. Should not be null.
@param methodName
Name of the method, it must exist.
@return a Functor that call the specified method on the specified instance.
@throws Exception if there is a problem to deal w... | [
"Create",
"a",
"functor",
"without",
"parameter",
"wrapping",
"a",
"call",
"to",
"another",
"method",
"."
] | train | https://github.com/sporniket/core/blob/3480ebd72a07422fcc09971be2607ee25efb2c26/sporniket-core-lang/src/main/java/com/sporniket/libre/lang/functor/FunctorFactory.java#L99-L107 |
box/box-java-sdk | src/main/java/com/box/sdk/BoxTermsOfServiceUserStatus.java | BoxTermsOfServiceUserStatus.getInfo | public static List<BoxTermsOfServiceUserStatus.Info> getInfo(final BoxAPIConnection api,
String termsOfServiceID, String userID) {
"""
Retrieves a list of User Status for Terms of Service as an Iterable.
@param api the API connection to be used by the resourc... | java | public static List<BoxTermsOfServiceUserStatus.Info> getInfo(final BoxAPIConnection api,
String termsOfServiceID, String userID) {
QueryStringBuilder builder = new QueryStringBuilder();
builder.appendParam("tos_id", termsOfServiceID);
if (userID != null) {
... | [
"public",
"static",
"List",
"<",
"BoxTermsOfServiceUserStatus",
".",
"Info",
">",
"getInfo",
"(",
"final",
"BoxAPIConnection",
"api",
",",
"String",
"termsOfServiceID",
",",
"String",
"userID",
")",
"{",
"QueryStringBuilder",
"builder",
"=",
"new",
"QueryStringBuild... | Retrieves a list of User Status for Terms of Service as an Iterable.
@param api the API connection to be used by the resource.
@param termsOfServiceID the ID of the terms of service.
@param userID the ID of the user to retrieve terms of service for.
@return the... | [
"Retrieves",
"a",
"list",
"of",
"User",
"Status",
"for",
"Terms",
"of",
"Service",
"as",
"an",
"Iterable",
"."
] | train | https://github.com/box/box-java-sdk/blob/35b4ba69417f9d6a002c19dfaab57527750ef349/src/main/java/com/box/sdk/BoxTermsOfServiceUserStatus.java#L100-L126 |
netty/netty | codec-http/src/main/java/io/netty/handler/codec/http/multipart/HttpPostRequestEncoder.java | HttpPostRequestEncoder.addBodyFileUpload | public void addBodyFileUpload(String name, File file, String contentType, boolean isText)
throws ErrorDataEncoderException {
"""
Add a file as a FileUpload
@param name
the name of the parameter
@param file
the file to be uploaded (if not Multipart mode, only the filename will be included)
@param... | java | public void addBodyFileUpload(String name, File file, String contentType, boolean isText)
throws ErrorDataEncoderException {
addBodyFileUpload(name, file.getName(), file, contentType, isText);
} | [
"public",
"void",
"addBodyFileUpload",
"(",
"String",
"name",
",",
"File",
"file",
",",
"String",
"contentType",
",",
"boolean",
"isText",
")",
"throws",
"ErrorDataEncoderException",
"{",
"addBodyFileUpload",
"(",
"name",
",",
"file",
".",
"getName",
"(",
")",
... | Add a file as a FileUpload
@param name
the name of the parameter
@param file
the file to be uploaded (if not Multipart mode, only the filename will be included)
@param contentType
the associated contentType for the File
@param isText
True if this file should be transmitted in Text format (else binary)
@throws NullPoin... | [
"Add",
"a",
"file",
"as",
"a",
"FileUpload"
] | train | https://github.com/netty/netty/blob/ba06eafa1c1824bd154f1a380019e7ea2edf3c4c/codec-http/src/main/java/io/netty/handler/codec/http/multipart/HttpPostRequestEncoder.java#L360-L363 |
UrielCh/ovh-java-sdk | ovh-java-sdk-dedicatedCloud/src/main/java/net/minidev/ovh/api/ApiOvhDedicatedCloud.java | ApiOvhDedicatedCloud.serviceName_vmEncryption_kms_kmsId_DELETE | public OvhTask serviceName_vmEncryption_kms_kmsId_DELETE(String serviceName, Long kmsId) throws IOException {
"""
Remove an option user access
REST: DELETE /dedicatedCloud/{serviceName}/vmEncryption/kms/{kmsId}
@param serviceName [required] Domain of the service
@param kmsId [required] Id of the VM Encryption... | java | public OvhTask serviceName_vmEncryption_kms_kmsId_DELETE(String serviceName, Long kmsId) throws IOException {
String qPath = "/dedicatedCloud/{serviceName}/vmEncryption/kms/{kmsId}";
StringBuilder sb = path(qPath, serviceName, kmsId);
String resp = exec(qPath, "DELETE", sb.toString(), null);
return convertTo(re... | [
"public",
"OvhTask",
"serviceName_vmEncryption_kms_kmsId_DELETE",
"(",
"String",
"serviceName",
",",
"Long",
"kmsId",
")",
"throws",
"IOException",
"{",
"String",
"qPath",
"=",
"\"/dedicatedCloud/{serviceName}/vmEncryption/kms/{kmsId}\"",
";",
"StringBuilder",
"sb",
"=",
"p... | Remove an option user access
REST: DELETE /dedicatedCloud/{serviceName}/vmEncryption/kms/{kmsId}
@param serviceName [required] Domain of the service
@param kmsId [required] Id of the VM Encryption KMS | [
"Remove",
"an",
"option",
"user",
"access"
] | train | https://github.com/UrielCh/ovh-java-sdk/blob/6d531a40e56e09701943e334c25f90f640c55701/ovh-java-sdk-dedicatedCloud/src/main/java/net/minidev/ovh/api/ApiOvhDedicatedCloud.java#L621-L626 |
eurekaclinical/protempa | protempa-framework/src/main/java/org/protempa/PropositionCopier.java | PropositionCopier.visit | @Override
public void visit(Event event) {
"""
Creates a derived event with the id specified in the
constructor and the same characteristics (e.g., data source type,
interval, etc.).
@param event an {@link Event}. Cannot be <code>null</code>.
"""
assert this.kh != null : "kh wasn't set";
... | java | @Override
public void visit(Event event) {
assert this.kh != null : "kh wasn't set";
Event e = new Event(propId, this.uniqueIdProvider.getInstance());
e.setInterval(event.getInterval());
e.setSourceSystem(SourceSystem.DERIVED);
e.setCreateDate(new Date());
this.kh.ins... | [
"@",
"Override",
"public",
"void",
"visit",
"(",
"Event",
"event",
")",
"{",
"assert",
"this",
".",
"kh",
"!=",
"null",
":",
"\"kh wasn't set\"",
";",
"Event",
"e",
"=",
"new",
"Event",
"(",
"propId",
",",
"this",
".",
"uniqueIdProvider",
".",
"getInstan... | Creates a derived event with the id specified in the
constructor and the same characteristics (e.g., data source type,
interval, etc.).
@param event an {@link Event}. Cannot be <code>null</code>. | [
"Creates",
"a",
"derived",
"event",
"with",
"the",
"id",
"specified",
"in",
"the",
"constructor",
"and",
"the",
"same",
"characteristics",
"(",
"e",
".",
"g",
".",
"data",
"source",
"type",
"interval",
"etc",
".",
")",
"."
] | train | https://github.com/eurekaclinical/protempa/blob/5a620d1a407c7a5426d1cf17d47b97717cf71634/protempa-framework/src/main/java/org/protempa/PropositionCopier.java#L136-L146 |
apache/groovy | subprojects/groovy-swing/src/main/java/org/codehaus/groovy/runtime/SwingGroovyMethods.java | SwingGroovyMethods.leftShift | public static JComboBox leftShift(JComboBox self, Object i) {
"""
Overloads the left shift operator to provide an easy way to add
items to a JComboBox.
@param self a JComboBox
@param i an item to be added to the comboBox.
@return same comboBox, after the value was added to it.
@since 1.6.4
"""
... | java | public static JComboBox leftShift(JComboBox self, Object i) {
self.addItem(i);
return self;
} | [
"public",
"static",
"JComboBox",
"leftShift",
"(",
"JComboBox",
"self",
",",
"Object",
"i",
")",
"{",
"self",
".",
"addItem",
"(",
"i",
")",
";",
"return",
"self",
";",
"}"
] | Overloads the left shift operator to provide an easy way to add
items to a JComboBox.
@param self a JComboBox
@param i an item to be added to the comboBox.
@return same comboBox, after the value was added to it.
@since 1.6.4 | [
"Overloads",
"the",
"left",
"shift",
"operator",
"to",
"provide",
"an",
"easy",
"way",
"to",
"add",
"items",
"to",
"a",
"JComboBox",
"."
] | train | https://github.com/apache/groovy/blob/71cf20addb611bb8d097a59e395fd20bc7f31772/subprojects/groovy-swing/src/main/java/org/codehaus/groovy/runtime/SwingGroovyMethods.java#L301-L304 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.