repository_name
stringlengths
7
54
func_path_in_repository
stringlengths
18
218
func_name
stringlengths
5
140
whole_func_string
stringlengths
79
3.99k
language
stringclasses
1 value
func_code_string
stringlengths
79
3.99k
func_code_tokens
listlengths
20
624
func_documentation_string
stringlengths
61
1.96k
func_documentation_tokens
listlengths
1
478
split_name
stringclasses
1 value
func_code_url
stringlengths
107
339
JodaOrg/joda-time
src/main/java/org/joda/time/tz/DateTimeZoneBuilder.java
DateTimeZoneBuilder.writeTo
public void writeTo(String zoneID, OutputStream out) throws IOException { if (out instanceof DataOutput) { writeTo(zoneID, (DataOutput)out); } else { DataOutputStream dout = new DataOutputStream(out); writeTo(zoneID, (DataOutput)dout); dout.flush(); } }
java
public void writeTo(String zoneID, OutputStream out) throws IOException { if (out instanceof DataOutput) { writeTo(zoneID, (DataOutput)out); } else { DataOutputStream dout = new DataOutputStream(out); writeTo(zoneID, (DataOutput)dout); dout.flush(); } }
[ "public", "void", "writeTo", "(", "String", "zoneID", ",", "OutputStream", "out", ")", "throws", "IOException", "{", "if", "(", "out", "instanceof", "DataOutput", ")", "{", "writeTo", "(", "zoneID", ",", "(", "DataOutput", ")", "out", ")", ";", "}", "els...
Encodes a built DateTimeZone to the given stream. Call readFrom to decode the data into a DateTimeZone object. @param out the output stream to receive the encoded DateTimeZone @since 1.5 (parameter added)
[ "Encodes", "a", "built", "DateTimeZone", "to", "the", "given", "stream", ".", "Call", "readFrom", "to", "decode", "the", "data", "into", "a", "DateTimeZone", "object", "." ]
train
https://github.com/JodaOrg/joda-time/blob/bd79f1c4245e79b3c2c56d7b04fde2a6e191fa42/src/main/java/org/joda/time/tz/DateTimeZoneBuilder.java#L447-L455
Wolfgang-Schuetzelhofer/jcypher
src/main/java/iot/jcypher/query/LiteralMapList.java
LiteralMapList.selectFirst
public LiteralMap selectFirst(String key, Object value) { for (LiteralMap lm : this) { if (isEqual(value, lm.get(key))) return lm; } return null; }
java
public LiteralMap selectFirst(String key, Object value) { for (LiteralMap lm : this) { if (isEqual(value, lm.get(key))) return lm; } return null; }
[ "public", "LiteralMap", "selectFirst", "(", "String", "key", ",", "Object", "value", ")", "{", "for", "(", "LiteralMap", "lm", ":", "this", ")", "{", "if", "(", "isEqual", "(", "value", ",", "lm", ".", "get", "(", "key", ")", ")", ")", "return", "l...
Answer the first literal map with the given key and value @param key @param value @return
[ "Answer", "the", "first", "literal", "map", "with", "the", "given", "key", "and", "value" ]
train
https://github.com/Wolfgang-Schuetzelhofer/jcypher/blob/0f36914b4d6993a004cc235bb18dd3e02a59d253/src/main/java/iot/jcypher/query/LiteralMapList.java#L91-L97
google/j2objc
jre_emul/android/platform/libcore/ojluni/src/main/java/java/util/logging/Logger.java
Logger.entering
public void entering(String sourceClass, String sourceMethod, Object param1) { if (Level.FINER.intValue() < levelValue) { return; } Object params[] = { param1 }; logp(Level.FINER, sourceClass, sourceMethod, "ENTRY {0}", params); }
java
public void entering(String sourceClass, String sourceMethod, Object param1) { if (Level.FINER.intValue() < levelValue) { return; } Object params[] = { param1 }; logp(Level.FINER, sourceClass, sourceMethod, "ENTRY {0}", params); }
[ "public", "void", "entering", "(", "String", "sourceClass", ",", "String", "sourceMethod", ",", "Object", "param1", ")", "{", "if", "(", "Level", ".", "FINER", ".", "intValue", "(", ")", "<", "levelValue", ")", "{", "return", ";", "}", "Object", "params"...
Log a method entry, with one parameter. <p> This is a convenience method that can be used to log entry to a method. A LogRecord with message "ENTRY {0}", log level FINER, and the given sourceMethod, sourceClass, and parameter is logged. <p> @param sourceClass name of class that issued the logging request @param sourceMethod name of method that is being entered @param param1 parameter to the method being entered
[ "Log", "a", "method", "entry", "with", "one", "parameter", ".", "<p", ">", "This", "is", "a", "convenience", "method", "that", "can", "be", "used", "to", "log", "entry", "to", "a", "method", ".", "A", "LogRecord", "with", "message", "ENTRY", "{", "0", ...
train
https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/libcore/ojluni/src/main/java/java/util/logging/Logger.java#L1045-L1051
ppiastucki/recast4j
detour/src/main/java/org/recast4j/detour/NavMesh.java
NavMesh.encodePolyId
public static long encodePolyId(int salt, int it, int ip) { return (((long) salt) << (DT_POLY_BITS + DT_TILE_BITS)) | ((long) it << DT_POLY_BITS) | ip; }
java
public static long encodePolyId(int salt, int it, int ip) { return (((long) salt) << (DT_POLY_BITS + DT_TILE_BITS)) | ((long) it << DT_POLY_BITS) | ip; }
[ "public", "static", "long", "encodePolyId", "(", "int", "salt", ",", "int", "it", ",", "int", "ip", ")", "{", "return", "(", "(", "(", "long", ")", "salt", ")", "<<", "(", "DT_POLY_BITS", "+", "DT_TILE_BITS", ")", ")", "|", "(", "(", "long", ")", ...
Derives a standard polygon reference. @note This function is generally meant for internal use only. @param salt The tile's salt value. @param it The index of the tile. @param ip The index of the polygon within the tile. @return encoded polygon reference
[ "Derives", "a", "standard", "polygon", "reference", "." ]
train
https://github.com/ppiastucki/recast4j/blob/a414dc34f16b87c95fb4e0f46c28a7830d421788/detour/src/main/java/org/recast4j/detour/NavMesh.java#L124-L126
zaproxy/zaproxy
src/org/apache/commons/httpclient/HttpMethodBase.java
HttpMethodBase.setRequestHeader
@Override public void setRequestHeader(String headerName, String headerValue) { Header header = new Header(headerName, headerValue); setRequestHeader(header); }
java
@Override public void setRequestHeader(String headerName, String headerValue) { Header header = new Header(headerName, headerValue); setRequestHeader(header); }
[ "@", "Override", "public", "void", "setRequestHeader", "(", "String", "headerName", ",", "String", "headerValue", ")", "{", "Header", "header", "=", "new", "Header", "(", "headerName", ",", "headerValue", ")", ";", "setRequestHeader", "(", "header", ")", ";", ...
Set the specified request header, overwriting any previous value. Note that header-name matching is case-insensitive. @param headerName the header's name @param headerValue the header's value
[ "Set", "the", "specified", "request", "header", "overwriting", "any", "previous", "value", ".", "Note", "that", "header", "-", "name", "matching", "is", "case", "-", "insensitive", "." ]
train
https://github.com/zaproxy/zaproxy/blob/0cbe5121f2ae1ecca222513d182759210c569bec/src/org/apache/commons/httpclient/HttpMethodBase.java#L498-L502
caspervg/SC4D-LEX4J
lex4j/src/main/java/net/caspervg/lex4j/route/LotRoute.java
LotRoute.getLotDownload
public boolean getLotDownload(int id, File directory) { ClientResource resource = new ClientResource(Route.DOWNLOAD_LOT.url(id)); resource.setChallengeResponse(this.auth.toChallenge()); try { Representation repr = resource.get(MediaType.APPLICATION_ZIP); Disposition disposition = repr.getDisposition(); File file = new File(directory, disposition.getFilename()); FileOutputStream fos = new FileOutputStream(file); repr.write(fos); // Flush remaining buffer to output and close the stream fos.flush(); fos.close(); return true; } catch (IOException ex) { LEX4JLogger.log(Level.WARNING, "Could not write download to the FileOutputStream!"); return false; } }
java
public boolean getLotDownload(int id, File directory) { ClientResource resource = new ClientResource(Route.DOWNLOAD_LOT.url(id)); resource.setChallengeResponse(this.auth.toChallenge()); try { Representation repr = resource.get(MediaType.APPLICATION_ZIP); Disposition disposition = repr.getDisposition(); File file = new File(directory, disposition.getFilename()); FileOutputStream fos = new FileOutputStream(file); repr.write(fos); // Flush remaining buffer to output and close the stream fos.flush(); fos.close(); return true; } catch (IOException ex) { LEX4JLogger.log(Level.WARNING, "Could not write download to the FileOutputStream!"); return false; } }
[ "public", "boolean", "getLotDownload", "(", "int", "id", ",", "File", "directory", ")", "{", "ClientResource", "resource", "=", "new", "ClientResource", "(", "Route", ".", "DOWNLOAD_LOT", ".", "url", "(", "id", ")", ")", ";", "resource", ".", "setChallengeRe...
Downloads a lot/file @param id ID of the lot/file @param directory Directory where the file should be downloaded @custom.require Authentication @return Download succeeded
[ "Downloads", "a", "lot", "/", "file" ]
train
https://github.com/caspervg/SC4D-LEX4J/blob/3d086ec70c817119a88573c2e23af27276cdb1d6/lex4j/src/main/java/net/caspervg/lex4j/route/LotRoute.java#L105-L126
eyp/serfj
src/main/java/net/sf/serfj/client/Client.java
Client.postRequest
public Object postRequest(String restUrl, Map<String, String> params) throws IOException, WebServiceException { return this.postRequest(HttpMethod.POST, restUrl, params); }
java
public Object postRequest(String restUrl, Map<String, String> params) throws IOException, WebServiceException { return this.postRequest(HttpMethod.POST, restUrl, params); }
[ "public", "Object", "postRequest", "(", "String", "restUrl", ",", "Map", "<", "String", ",", "String", ">", "params", ")", "throws", "IOException", ",", "WebServiceException", "{", "return", "this", ".", "postRequest", "(", "HttpMethod", ".", "POST", ",", "r...
Do a POST HTTP request to the given REST-URL. @param restUrl REST URL. @param params Parameters for adding to the query string. @throws IOException if the request go bad.
[ "Do", "a", "POST", "HTTP", "request", "to", "the", "given", "REST", "-", "URL", "." ]
train
https://github.com/eyp/serfj/blob/e617592af6f24e59ea58443f2785c44aa2312189/src/main/java/net/sf/serfj/client/Client.java#L130-L132
moparisthebest/beehive
beehive-netui-tags/src/main/java/org/apache/beehive/netui/tags/databinding/datagrid/DataGrid.java
DataGrid.setBehavior
public void setBehavior(String name, Object value, String facet) throws JspException { if(facet != null && facet.equals(FACET_RESOURCE)) { _dataGridTagModel.addResourceOverride(name, (value != null ? value.toString() : null)); } else { String s = Bundle.getString("Tags_BehaviorFacetNotSupported", new Object[]{facet}); throw new JspException(s); } }
java
public void setBehavior(String name, Object value, String facet) throws JspException { if(facet != null && facet.equals(FACET_RESOURCE)) { _dataGridTagModel.addResourceOverride(name, (value != null ? value.toString() : null)); } else { String s = Bundle.getString("Tags_BehaviorFacetNotSupported", new Object[]{facet}); throw new JspException(s); } }
[ "public", "void", "setBehavior", "(", "String", "name", ",", "Object", "value", ",", "String", "facet", ")", "throws", "JspException", "{", "if", "(", "facet", "!=", "null", "&&", "facet", ".", "equals", "(", "FACET_RESOURCE", ")", ")", "{", "_dataGridTagM...
<p> Implementation of the {@link IBehaviorConsumer} interface that extends the functionality of this tag beyond that exposed via the JSP tag attributes. This method accepts the following facets: <table> <tr><td>Facet Name</td><td>Operation</td></tr> <tr><td><code>resource</code></td><td>Adds or overrides a data grid resource key with a new value.</td></tr> </table> A new resource key is added in order to override a value defined in {@link org.apache.beehive.netui.databinding.datagrid.api.rendering.IDataGridMessageKeys}. When a message is overridden or added here, the page author is able to override a single string resource such as a pager mesage or sort href. </p> @param name the name of the behavior @param value the value of the behavior @param facet th ebehavior's facet @throws JspException when the behavior's facet isnot recognized
[ "<p", ">", "Implementation", "of", "the", "{" ]
train
https://github.com/moparisthebest/beehive/blob/4246a0cc40ce3c05f1a02c2da2653ac622703d77/beehive-netui-tags/src/main/java/org/apache/beehive/netui/tags/databinding/datagrid/DataGrid.java#L749-L758
UrielCh/ovh-java-sdk
ovh-java-sdk-partners/src/main/java/net/minidev/ovh/api/ApiOvhPartners.java
ApiOvhPartners.register_company_companyId_contact_POST
public OvhContact register_company_companyId_contact_POST(String companyId, String email, String facebook, String firstName, String lastName, String linkedin, Boolean newsletter, OvhNic[] otherNics, String phone, String role, String twitter) throws IOException { String qPath = "/partners/register/company/{companyId}/contact"; StringBuilder sb = path(qPath, companyId); HashMap<String, Object>o = new HashMap<String, Object>(); addBody(o, "email", email); addBody(o, "facebook", facebook); addBody(o, "firstName", firstName); addBody(o, "lastName", lastName); addBody(o, "linkedin", linkedin); addBody(o, "newsletter", newsletter); addBody(o, "otherNics", otherNics); addBody(o, "phone", phone); addBody(o, "role", role); addBody(o, "twitter", twitter); String resp = exec(qPath, "POST", sb.toString(), o); return convertTo(resp, OvhContact.class); }
java
public OvhContact register_company_companyId_contact_POST(String companyId, String email, String facebook, String firstName, String lastName, String linkedin, Boolean newsletter, OvhNic[] otherNics, String phone, String role, String twitter) throws IOException { String qPath = "/partners/register/company/{companyId}/contact"; StringBuilder sb = path(qPath, companyId); HashMap<String, Object>o = new HashMap<String, Object>(); addBody(o, "email", email); addBody(o, "facebook", facebook); addBody(o, "firstName", firstName); addBody(o, "lastName", lastName); addBody(o, "linkedin", linkedin); addBody(o, "newsletter", newsletter); addBody(o, "otherNics", otherNics); addBody(o, "phone", phone); addBody(o, "role", role); addBody(o, "twitter", twitter); String resp = exec(qPath, "POST", sb.toString(), o); return convertTo(resp, OvhContact.class); }
[ "public", "OvhContact", "register_company_companyId_contact_POST", "(", "String", "companyId", ",", "String", "email", ",", "String", "facebook", ",", "String", "firstName", ",", "String", "lastName", ",", "String", "linkedin", ",", "Boolean", "newsletter", ",", "Ov...
Created a new contact for the inscription REST: POST /partners/register/company/{companyId}/contact @param companyId [required] Company's id @param otherNics [required] List of nics to associate with this contact @param firstName [required] Contact's first name @param lastName [required] Contact's last name @param email [required] Contact's email @param role [required] Contact's function in the company @param phone [required] Contact's phone number @param linkedin [required] Contact's linkedin url, must resemble "https://www.linkedin.com/in/ovh") @param facebook [required] Contact's facebook url, must resemble "https://www.facebook.com/ovh") @param twitter [required] Contact's twitter url, must resemble "https://twitter.com/ovh") @param newsletter [required] Newsletter subscription choice
[ "Created", "a", "new", "contact", "for", "the", "inscription" ]
train
https://github.com/UrielCh/ovh-java-sdk/blob/6d531a40e56e09701943e334c25f90f640c55701/ovh-java-sdk-partners/src/main/java/net/minidev/ovh/api/ApiOvhPartners.java#L250-L266
xwiki/xwiki-commons
xwiki-commons-core/xwiki-commons-cache/xwiki-commons-cache-infinispan/src/main/java/org/xwiki/cache/infinispan/internal/InfinispanCache.java
InfinispanCache.cacheEntryRemoved
private void cacheEntryRemoved(String key, T value) { InfinispanCacheEntryEvent<T> event = new InfinispanCacheEntryEvent<>(new InfinispanCacheEntry<T>(this, key, value)); sendEntryRemovedEvent(event); }
java
private void cacheEntryRemoved(String key, T value) { InfinispanCacheEntryEvent<T> event = new InfinispanCacheEntryEvent<>(new InfinispanCacheEntry<T>(this, key, value)); sendEntryRemovedEvent(event); }
[ "private", "void", "cacheEntryRemoved", "(", "String", "key", ",", "T", "value", ")", "{", "InfinispanCacheEntryEvent", "<", "T", ">", "event", "=", "new", "InfinispanCacheEntryEvent", "<>", "(", "new", "InfinispanCacheEntry", "<", "T", ">", "(", "this", ",", ...
Dispatch data remove event. @param key the entry key. @param value the entry value.
[ "Dispatch", "data", "remove", "event", "." ]
train
https://github.com/xwiki/xwiki-commons/blob/5374d8c6d966588c1eac7392c83da610dfb9f129/xwiki-commons-core/xwiki-commons-cache/xwiki-commons-cache-infinispan/src/main/java/org/xwiki/cache/infinispan/internal/InfinispanCache.java#L224-L230
UrielCh/ovh-java-sdk
ovh-java-sdk-order/src/main/java/net/minidev/ovh/api/ApiOvhOrder.java
ApiOvhOrder.license_plesk_new_duration_POST
public OvhOrder license_plesk_new_duration_POST(String duration, OvhOrderableAntivirusEnum antivirus, OvhPleskApplicationSetEnum applicationSet, OvhOrderablePleskDomainNumberEnum domainNumber, String ip, OvhOrderablePleskLanguagePackEnum languagePackNumber, Boolean powerpack, Boolean resellerManagement, OvhLicenseTypeEnum serviceType, OvhPleskVersionEnum version, Boolean wordpressToolkit) throws IOException { String qPath = "/order/license/plesk/new/{duration}"; StringBuilder sb = path(qPath, duration); HashMap<String, Object>o = new HashMap<String, Object>(); addBody(o, "antivirus", antivirus); addBody(o, "applicationSet", applicationSet); addBody(o, "domainNumber", domainNumber); addBody(o, "ip", ip); addBody(o, "languagePackNumber", languagePackNumber); addBody(o, "powerpack", powerpack); addBody(o, "resellerManagement", resellerManagement); addBody(o, "serviceType", serviceType); addBody(o, "version", version); addBody(o, "wordpressToolkit", wordpressToolkit); String resp = exec(qPath, "POST", sb.toString(), o); return convertTo(resp, OvhOrder.class); }
java
public OvhOrder license_plesk_new_duration_POST(String duration, OvhOrderableAntivirusEnum antivirus, OvhPleskApplicationSetEnum applicationSet, OvhOrderablePleskDomainNumberEnum domainNumber, String ip, OvhOrderablePleskLanguagePackEnum languagePackNumber, Boolean powerpack, Boolean resellerManagement, OvhLicenseTypeEnum serviceType, OvhPleskVersionEnum version, Boolean wordpressToolkit) throws IOException { String qPath = "/order/license/plesk/new/{duration}"; StringBuilder sb = path(qPath, duration); HashMap<String, Object>o = new HashMap<String, Object>(); addBody(o, "antivirus", antivirus); addBody(o, "applicationSet", applicationSet); addBody(o, "domainNumber", domainNumber); addBody(o, "ip", ip); addBody(o, "languagePackNumber", languagePackNumber); addBody(o, "powerpack", powerpack); addBody(o, "resellerManagement", resellerManagement); addBody(o, "serviceType", serviceType); addBody(o, "version", version); addBody(o, "wordpressToolkit", wordpressToolkit); String resp = exec(qPath, "POST", sb.toString(), o); return convertTo(resp, OvhOrder.class); }
[ "public", "OvhOrder", "license_plesk_new_duration_POST", "(", "String", "duration", ",", "OvhOrderableAntivirusEnum", "antivirus", ",", "OvhPleskApplicationSetEnum", "applicationSet", ",", "OvhOrderablePleskDomainNumberEnum", "domainNumber", ",", "String", "ip", ",", "OvhOrdera...
Create order REST: POST /order/license/plesk/new/{duration} @param serviceType [required] # DEPRECATED # The kind of service on which this license will be used # Will not be used, keeped only for compatibility # @param languagePackNumber [required] The amount of language pack numbers to include in this licences @param resellerManagement [required] Reseller management option activation @param antivirus [required] The antivirus to enable on this Plesk license @param wordpressToolkit [required] WordpressToolkit option activation @param ip [required] Ip on which this license would be installed @param domainNumber [required] This license domain number @param applicationSet [required] Wanted application set @param version [required] This license version @param powerpack [required] powerpack current activation state on your license @param duration [required] Duration
[ "Create", "order" ]
train
https://github.com/UrielCh/ovh-java-sdk/blob/6d531a40e56e09701943e334c25f90f640c55701/ovh-java-sdk-order/src/main/java/net/minidev/ovh/api/ApiOvhOrder.java#L1830-L1846
Azure/azure-sdk-for-java
network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/PublicIPPrefixesInner.java
PublicIPPrefixesInner.beginCreateOrUpdate
public PublicIPPrefixInner beginCreateOrUpdate(String resourceGroupName, String publicIpPrefixName, PublicIPPrefixInner parameters) { return beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, publicIpPrefixName, parameters).toBlocking().single().body(); }
java
public PublicIPPrefixInner beginCreateOrUpdate(String resourceGroupName, String publicIpPrefixName, PublicIPPrefixInner parameters) { return beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, publicIpPrefixName, parameters).toBlocking().single().body(); }
[ "public", "PublicIPPrefixInner", "beginCreateOrUpdate", "(", "String", "resourceGroupName", ",", "String", "publicIpPrefixName", ",", "PublicIPPrefixInner", "parameters", ")", "{", "return", "beginCreateOrUpdateWithServiceResponseAsync", "(", "resourceGroupName", ",", "publicIp...
Creates or updates a static or dynamic public IP prefix. @param resourceGroupName The name of the resource group. @param publicIpPrefixName The name of the public IP prefix. @param parameters Parameters supplied to the create or update public IP prefix operation. @throws IllegalArgumentException thrown if parameters fail the validation @throws CloudException thrown if the request is rejected by server @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent @return the PublicIPPrefixInner object if successful.
[ "Creates", "or", "updates", "a", "static", "or", "dynamic", "public", "IP", "prefix", "." ]
train
https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/PublicIPPrefixesInner.java#L519-L521
lionsoul2014/jcseg
jcseg-core/src/main/java/org/lionsoul/jcseg/util/StringUtil.java
StringUtil.isLetterOrNumeric
public static boolean isLetterOrNumeric(String str, int beginIndex, int endIndex) { for ( int i = beginIndex; i < endIndex; i++ ) { char chr = str.charAt(i); if ( ! StringUtil.isEnLetter(chr) && ! StringUtil.isEnNumeric(chr) ) { return false; } } return true; }
java
public static boolean isLetterOrNumeric(String str, int beginIndex, int endIndex) { for ( int i = beginIndex; i < endIndex; i++ ) { char chr = str.charAt(i); if ( ! StringUtil.isEnLetter(chr) && ! StringUtil.isEnNumeric(chr) ) { return false; } } return true; }
[ "public", "static", "boolean", "isLetterOrNumeric", "(", "String", "str", ",", "int", "beginIndex", ",", "int", "endIndex", ")", "{", "for", "(", "int", "i", "=", "beginIndex", ";", "i", "<", "endIndex", ";", "i", "++", ")", "{", "char", "chr", "=", ...
check if the specified string is Latin numeric or letter @param str @param beginIndex @param endIndex @return boolean
[ "check", "if", "the", "specified", "string", "is", "Latin", "numeric", "or", "letter" ]
train
https://github.com/lionsoul2014/jcseg/blob/7c8a912e3bbcaf4f8de701180b9c24e2e444a94b/jcseg-core/src/main/java/org/lionsoul/jcseg/util/StringUtil.java#L374-L385
ivanceras/orm
src/main/java/com/ivanceras/db/server/core/DB_PostgreSQL.java
DB_PostgreSQL.correctDataType
private Object correctDataType(Object value, String dataType) { if(value == null ){return null;} return value; }
java
private Object correctDataType(Object value, String dataType) { if(value == null ){return null;} return value; }
[ "private", "Object", "correctDataType", "(", "Object", "value", ",", "String", "dataType", ")", "{", "if", "(", "value", "==", "null", ")", "{", "return", "null", ";", "}", "return", "value", ";", "}" ]
add logic here if PostgreSQL JDBC didn't map DB data type to their correct Java Data type @param value @param dataType @return
[ "add", "logic", "here", "if", "PostgreSQL", "JDBC", "didn", "t", "map", "DB", "data", "type", "to", "their", "correct", "Java", "Data", "type" ]
train
https://github.com/ivanceras/orm/blob/e63213cb8abefd11df0e2d34b1c95477788e600e/src/main/java/com/ivanceras/db/server/core/DB_PostgreSQL.java#L881-L884
rundeck/rundeck
core/src/main/java/com/dtolabs/rundeck/core/utils/PropertyLookup.java
PropertyLookup.create
public static PropertyLookup create(final File propfile, final IPropertyLookup defaultsLookup) { return new PropertyLookup(fetchProperties(propfile), defaultsLookup); }
java
public static PropertyLookup create(final File propfile, final IPropertyLookup defaultsLookup) { return new PropertyLookup(fetchProperties(propfile), defaultsLookup); }
[ "public", "static", "PropertyLookup", "create", "(", "final", "File", "propfile", ",", "final", "IPropertyLookup", "defaultsLookup", ")", "{", "return", "new", "PropertyLookup", "(", "fetchProperties", "(", "propfile", ")", ",", "defaultsLookup", ")", ";", "}" ]
Calls base constructor with data from IPropertyLookup paramater as defaults. Defaults data is read via the {@link IPropertyLookup#getPropertiesMap()} method. @param propfile File containing property data @param defaultsLookup IPropertyLookup of default properties @return lookup
[ "Calls", "base", "constructor", "with", "data", "from", "IPropertyLookup", "paramater", "as", "defaults", ".", "Defaults", "data", "is", "read", "via", "the", "{", "@link", "IPropertyLookup#getPropertiesMap", "()", "}", "method", "." ]
train
https://github.com/rundeck/rundeck/blob/8070f774f55bffaa1118ff0c03aea319d40a9668/core/src/main/java/com/dtolabs/rundeck/core/utils/PropertyLookup.java#L148-L150
undertow-io/undertow
core/src/main/java/io/undertow/util/ETagUtils.java
ETagUtils.handleIfNoneMatch
public static boolean handleIfNoneMatch(final String ifNoneMatch, final ETag etag, boolean allowWeak) { return handleIfNoneMatch(ifNoneMatch, Collections.singletonList(etag), allowWeak); }
java
public static boolean handleIfNoneMatch(final String ifNoneMatch, final ETag etag, boolean allowWeak) { return handleIfNoneMatch(ifNoneMatch, Collections.singletonList(etag), allowWeak); }
[ "public", "static", "boolean", "handleIfNoneMatch", "(", "final", "String", "ifNoneMatch", ",", "final", "ETag", "etag", ",", "boolean", "allowWeak", ")", "{", "return", "handleIfNoneMatch", "(", "ifNoneMatch", ",", "Collections", ".", "singletonList", "(", "etag"...
Handles the if-none-match header. returns true if the request should proceed, false otherwise @param ifNoneMatch the header @param etag The etags @return
[ "Handles", "the", "if", "-", "none", "-", "match", "header", ".", "returns", "true", "if", "the", "request", "should", "proceed", "false", "otherwise" ]
train
https://github.com/undertow-io/undertow/blob/87de0b856a7a4ba8faf5b659537b9af07b763263/core/src/main/java/io/undertow/util/ETagUtils.java#L133-L135
pedrovgs/Renderers
renderers/src/main/java/com/pedrogomez/renderers/RendererAdapter.java
RendererAdapter.getView
@Override public View getView(int position, View convertView, ViewGroup parent) { T content = getItem(position); rendererBuilder.withContent(content); rendererBuilder.withConvertView(convertView); rendererBuilder.withParent(parent); rendererBuilder.withLayoutInflater(LayoutInflater.from(parent.getContext())); Renderer<T> renderer = rendererBuilder.build(); if (renderer == null) { throw new NullRendererBuiltException("RendererBuilder have to return a not null Renderer"); } updateRendererExtraValues(content, renderer, position); renderer.render(); return renderer.getRootView(); }
java
@Override public View getView(int position, View convertView, ViewGroup parent) { T content = getItem(position); rendererBuilder.withContent(content); rendererBuilder.withConvertView(convertView); rendererBuilder.withParent(parent); rendererBuilder.withLayoutInflater(LayoutInflater.from(parent.getContext())); Renderer<T> renderer = rendererBuilder.build(); if (renderer == null) { throw new NullRendererBuiltException("RendererBuilder have to return a not null Renderer"); } updateRendererExtraValues(content, renderer, position); renderer.render(); return renderer.getRootView(); }
[ "@", "Override", "public", "View", "getView", "(", "int", "position", ",", "View", "convertView", ",", "ViewGroup", "parent", ")", "{", "T", "content", "=", "getItem", "(", "position", ")", ";", "rendererBuilder", ".", "withContent", "(", "content", ")", "...
Main method of RendererAdapter. This method has the responsibility of update the RendererBuilder values and create or recycle a new Renderer. Once the renderer has been obtained the RendereBuilder will call the render method in the renderer and will return the Renderer root view to the ListView. If rRendererBuilder returns a null Renderer this method will throw a NullRendererBuiltException. @param position to render. @param convertView to use to recycle. @param parent used to inflate views. @return view rendered.
[ "Main", "method", "of", "RendererAdapter", ".", "This", "method", "has", "the", "responsibility", "of", "update", "the", "RendererBuilder", "values", "and", "create", "or", "recycle", "a", "new", "Renderer", ".", "Once", "the", "renderer", "has", "been", "obta...
train
https://github.com/pedrovgs/Renderers/blob/7477fb6e3984468b32b59c8520b66afb765081ea/renderers/src/main/java/com/pedrogomez/renderers/RendererAdapter.java#L86-L99
UrielCh/ovh-java-sdk
ovh-java-sdk-store/src/main/java/net/minidev/ovh/api/ApiOvhStore.java
ApiOvhStore.contact_POST
public OvhContact contact_POST(String city, String country, String email, String firstname, String lastname, String phone, String province, String street, String title, String zip) throws IOException { String qPath = "/store/contact"; StringBuilder sb = path(qPath); HashMap<String, Object>o = new HashMap<String, Object>(); addBody(o, "city", city); addBody(o, "country", country); addBody(o, "email", email); addBody(o, "firstname", firstname); addBody(o, "lastname", lastname); addBody(o, "phone", phone); addBody(o, "province", province); addBody(o, "street", street); addBody(o, "title", title); addBody(o, "zip", zip); String resp = exec(qPath, "POST", sb.toString(), o); return convertTo(resp, OvhContact.class); }
java
public OvhContact contact_POST(String city, String country, String email, String firstname, String lastname, String phone, String province, String street, String title, String zip) throws IOException { String qPath = "/store/contact"; StringBuilder sb = path(qPath); HashMap<String, Object>o = new HashMap<String, Object>(); addBody(o, "city", city); addBody(o, "country", country); addBody(o, "email", email); addBody(o, "firstname", firstname); addBody(o, "lastname", lastname); addBody(o, "phone", phone); addBody(o, "province", province); addBody(o, "street", street); addBody(o, "title", title); addBody(o, "zip", zip); String resp = exec(qPath, "POST", sb.toString(), o); return convertTo(resp, OvhContact.class); }
[ "public", "OvhContact", "contact_POST", "(", "String", "city", ",", "String", "country", ",", "String", "email", ",", "String", "firstname", ",", "String", "lastname", ",", "String", "phone", ",", "String", "province", ",", "String", "street", ",", "String", ...
Create a 'marketplace' contact for current nic REST: POST /store/contact @param title [required] Title @param firstname [required] First name @param lastname [required] Last name @param email [required] Email address @param street [required] Street address @param country [required] Country @param zip [required] Zipcode @param province [required] Province name @param city [required] City @param phone [required] Phone number API beta
[ "Create", "a", "marketplace", "contact", "for", "current", "nic" ]
train
https://github.com/UrielCh/ovh-java-sdk/blob/6d531a40e56e09701943e334c25f90f640c55701/ovh-java-sdk-store/src/main/java/net/minidev/ovh/api/ApiOvhStore.java#L253-L269
EsotericSoftware/kryo
src/com/esotericsoftware/kryo/unsafe/UnsafeByteBufferInput.java
UnsafeByteBufferInput.readBytes
public void readBytes (Object to, long offset, int count) throws KryoException { int copyCount = Math.min(limit - position, count); while (true) { unsafe.copyMemory(null, bufferAddress + position, to, offset, copyCount); position += copyCount; count -= copyCount; if (count == 0) break; offset += copyCount; copyCount = Math.min(count, capacity); require(copyCount); } byteBuffer.position(position); }
java
public void readBytes (Object to, long offset, int count) throws KryoException { int copyCount = Math.min(limit - position, count); while (true) { unsafe.copyMemory(null, bufferAddress + position, to, offset, copyCount); position += copyCount; count -= copyCount; if (count == 0) break; offset += copyCount; copyCount = Math.min(count, capacity); require(copyCount); } byteBuffer.position(position); }
[ "public", "void", "readBytes", "(", "Object", "to", ",", "long", "offset", ",", "int", "count", ")", "throws", "KryoException", "{", "int", "copyCount", "=", "Math", ".", "min", "(", "limit", "-", "position", ",", "count", ")", ";", "while", "(", "true...
Read count bytes and write them to the object at the given offset inside the in-memory representation of the object.
[ "Read", "count", "bytes", "and", "write", "them", "to", "the", "object", "at", "the", "given", "offset", "inside", "the", "in", "-", "memory", "representation", "of", "the", "object", "." ]
train
https://github.com/EsotericSoftware/kryo/blob/a8be1ab26f347f299a3c3f7171d6447dd5390845/src/com/esotericsoftware/kryo/unsafe/UnsafeByteBufferInput.java#L229-L241
Ekryd/sortpom
sorter/src/main/java/sortpom/util/XmlOrderedResult.java
XmlOrderedResult.childElementDiffers
public static XmlOrderedResult childElementDiffers(String name, int originalSize, int newSize) { return new XmlOrderedResult(false, String.format( "The xml element <%s> with %s child elements should be placed before element <%s> with %s child elements", name, newSize, name, originalSize)); }
java
public static XmlOrderedResult childElementDiffers(String name, int originalSize, int newSize) { return new XmlOrderedResult(false, String.format( "The xml element <%s> with %s child elements should be placed before element <%s> with %s child elements", name, newSize, name, originalSize)); }
[ "public", "static", "XmlOrderedResult", "childElementDiffers", "(", "String", "name", ",", "int", "originalSize", ",", "int", "newSize", ")", "{", "return", "new", "XmlOrderedResult", "(", "false", ",", "String", ".", "format", "(", "\"The xml element <%s> with %s c...
The child elements of two elements differ. Example: When dependencies should be sorted
[ "The", "child", "elements", "of", "two", "elements", "differ", ".", "Example", ":", "When", "dependencies", "should", "be", "sorted" ]
train
https://github.com/Ekryd/sortpom/blob/27056420803ed04001e4149b04a719fbac774c5d/sorter/src/main/java/sortpom/util/XmlOrderedResult.java#L30-L34
datacleaner/AnalyzerBeans
env/xml-config/src/main/java/org/eobjects/analyzer/configuration/DatastoreXmlExternalizer.java
DatastoreXmlExternalizer.toElement
public Element toElement(ExcelDatastore datastore, String filename) { final Element ds = getDocument().createElement("excel-datastore"); ds.setAttribute("name", datastore.getName()); if (!StringUtils.isNullOrEmpty(datastore.getDescription())) { ds.setAttribute("description", datastore.getDescription()); } appendElement(ds, "filename", filename); return ds; }
java
public Element toElement(ExcelDatastore datastore, String filename) { final Element ds = getDocument().createElement("excel-datastore"); ds.setAttribute("name", datastore.getName()); if (!StringUtils.isNullOrEmpty(datastore.getDescription())) { ds.setAttribute("description", datastore.getDescription()); } appendElement(ds, "filename", filename); return ds; }
[ "public", "Element", "toElement", "(", "ExcelDatastore", "datastore", ",", "String", "filename", ")", "{", "final", "Element", "ds", "=", "getDocument", "(", ")", ".", "createElement", "(", "\"excel-datastore\"", ")", ";", "ds", ".", "setAttribute", "(", "\"na...
Externalizes a {@link ExcelDatastore} to a XML element. @param datastore @param filename the filename/path to use in the XML element. Since the appropriate path will depend on the reading application's environment (supported {@link Resource} types), this specific property of the datastore is provided separately. @return
[ "Externalizes", "a", "{", "@link", "ExcelDatastore", "}", "to", "a", "XML", "element", "." ]
train
https://github.com/datacleaner/AnalyzerBeans/blob/f82dae080d80d2a647b706a5fb22b3ea250613b3/env/xml-config/src/main/java/org/eobjects/analyzer/configuration/DatastoreXmlExternalizer.java#L271-L282
Red5/red5-server-common
src/main/java/org/red5/server/net/rtmp/codec/RTMP.java
RTMP.setLastReadPacket
public void setLastReadPacket(int channelId, Packet packet) { final ChannelInfo info = getChannelInfo(channelId); // grab last packet Packet prevPacket = info.getReadPacket(); // set new one info.setReadPacket(packet); // free the previous packet freePacket(prevPacket); }
java
public void setLastReadPacket(int channelId, Packet packet) { final ChannelInfo info = getChannelInfo(channelId); // grab last packet Packet prevPacket = info.getReadPacket(); // set new one info.setReadPacket(packet); // free the previous packet freePacket(prevPacket); }
[ "public", "void", "setLastReadPacket", "(", "int", "channelId", ",", "Packet", "packet", ")", "{", "final", "ChannelInfo", "info", "=", "getChannelInfo", "(", "channelId", ")", ";", "// grab last packet\r", "Packet", "prevPacket", "=", "info", ".", "getReadPacket"...
Setter for last read packet. @param channelId Channel id @param packet Packet
[ "Setter", "for", "last", "read", "packet", "." ]
train
https://github.com/Red5/red5-server-common/blob/39ae73710c25bda86d70b13ef37ae707962217b9/src/main/java/org/red5/server/net/rtmp/codec/RTMP.java#L244-L252
UrielCh/ovh-java-sdk
ovh-java-sdk-telephony/src/main/java/net/minidev/ovh/api/ApiOvhTelephony.java
ApiOvhTelephony.billingAccount_phonebook_bookKey_DELETE
public void billingAccount_phonebook_bookKey_DELETE(String billingAccount, String bookKey) throws IOException { String qPath = "/telephony/{billingAccount}/phonebook/{bookKey}"; StringBuilder sb = path(qPath, billingAccount, bookKey); exec(qPath, "DELETE", sb.toString(), null); }
java
public void billingAccount_phonebook_bookKey_DELETE(String billingAccount, String bookKey) throws IOException { String qPath = "/telephony/{billingAccount}/phonebook/{bookKey}"; StringBuilder sb = path(qPath, billingAccount, bookKey); exec(qPath, "DELETE", sb.toString(), null); }
[ "public", "void", "billingAccount_phonebook_bookKey_DELETE", "(", "String", "billingAccount", ",", "String", "bookKey", ")", "throws", "IOException", "{", "String", "qPath", "=", "\"/telephony/{billingAccount}/phonebook/{bookKey}\"", ";", "StringBuilder", "sb", "=", "path",...
Delete a phonebook REST: DELETE /telephony/{billingAccount}/phonebook/{bookKey} @param billingAccount [required] The name of your billingAccount @param bookKey [required] Identifier of the phonebook
[ "Delete", "a", "phonebook" ]
train
https://github.com/UrielCh/ovh-java-sdk/blob/6d531a40e56e09701943e334c25f90f640c55701/ovh-java-sdk-telephony/src/main/java/net/minidev/ovh/api/ApiOvhTelephony.java#L5596-L5600
ngageoint/geopackage-core-java
src/main/java/mil/nga/geopackage/extension/index/FeatureTableCoreIndex.java
FeatureTableCoreIndex.deleteIndex
public int deleteIndex(long geomId) { int deleted = 0; GeometryIndexKey key = new GeometryIndexKey(tableName, geomId); try { deleted = geometryIndexDao.deleteById(key); } catch (SQLException e) { throw new GeoPackageException( "Failed to delete index, GeoPackage: " + geoPackage.getName() + ", Table Name: " + tableName + ", Geometry Id: " + geomId, e); } return deleted; }
java
public int deleteIndex(long geomId) { int deleted = 0; GeometryIndexKey key = new GeometryIndexKey(tableName, geomId); try { deleted = geometryIndexDao.deleteById(key); } catch (SQLException e) { throw new GeoPackageException( "Failed to delete index, GeoPackage: " + geoPackage.getName() + ", Table Name: " + tableName + ", Geometry Id: " + geomId, e); } return deleted; }
[ "public", "int", "deleteIndex", "(", "long", "geomId", ")", "{", "int", "deleted", "=", "0", ";", "GeometryIndexKey", "key", "=", "new", "GeometryIndexKey", "(", "tableName", ",", "geomId", ")", ";", "try", "{", "deleted", "=", "geometryIndexDao", ".", "de...
Delete the index for the geometry id @param geomId geometry id @return deleted rows, should be 0 or 1
[ "Delete", "the", "index", "for", "the", "geometry", "id" ]
train
https://github.com/ngageoint/geopackage-core-java/blob/6431c3b041a45b7f3802904ea4156b4082a72daa/src/main/java/mil/nga/geopackage/extension/index/FeatureTableCoreIndex.java#L351-L363
geomajas/geomajas-project-client-gwt
common-gwt-smartgwt/src/main/java/org/geomajas/gwt/client/util/HtmlBuilder.java
HtmlBuilder.tagStyleHtmlContent
public static String tagStyleHtmlContent(String tag, String style, String... content) { return openTagStyleHtmlContent(tag, style, content) + closeTag(tag); }
java
public static String tagStyleHtmlContent(String tag, String style, String... content) { return openTagStyleHtmlContent(tag, style, content) + closeTag(tag); }
[ "public", "static", "String", "tagStyleHtmlContent", "(", "String", "tag", ",", "String", "style", ",", "String", "...", "content", ")", "{", "return", "openTagStyleHtmlContent", "(", "tag", ",", "style", ",", "content", ")", "+", "closeTag", "(", "tag", ")"...
Build a String containing a HTML opening tag with given CSS style attribute(s), HTML content and closing tag. @param tag String name of HTML tag @param style style for tag (plain CSS) @param content content string @return HTML tag element as string
[ "Build", "a", "String", "containing", "a", "HTML", "opening", "tag", "with", "given", "CSS", "style", "attribute", "(", "s", ")", "HTML", "content", "and", "closing", "tag", "." ]
train
https://github.com/geomajas/geomajas-project-client-gwt/blob/1c1adc48deb192ed825265eebcc74d70bbf45670/common-gwt-smartgwt/src/main/java/org/geomajas/gwt/client/util/HtmlBuilder.java#L313-L315
moparisthebest/beehive
beehive-controls/src/main/java/org/apache/beehive/controls/runtime/bean/ControlBean.java
ControlBean.setControlProperty
protected void setControlProperty(PropertyKey key, Object o) { AnnotationConstraintValidator.validate(key, o); _properties.setProperty(key, o); }
java
protected void setControlProperty(PropertyKey key, Object o) { AnnotationConstraintValidator.validate(key, o); _properties.setProperty(key, o); }
[ "protected", "void", "setControlProperty", "(", "PropertyKey", "key", ",", "Object", "o", ")", "{", "AnnotationConstraintValidator", ".", "validate", "(", "key", ",", "o", ")", ";", "_properties", ".", "setProperty", "(", "key", ",", "o", ")", ";", "}" ]
Sets a property on the ControlBean instance. All generated property setter methods will delegate down to this method.
[ "Sets", "a", "property", "on", "the", "ControlBean", "instance", ".", "All", "generated", "property", "setter", "methods", "will", "delegate", "down", "to", "this", "method", "." ]
train
https://github.com/moparisthebest/beehive/blob/4246a0cc40ce3c05f1a02c2da2653ac622703d77/beehive-controls/src/main/java/org/apache/beehive/controls/runtime/bean/ControlBean.java#L639-L643
apache/incubator-atlas
repository/src/main/java/org/apache/atlas/services/DefaultMetadataService.java
DefaultMetadataService.deleteTrait
@Override public void deleteTrait(String guid, String traitNameToBeDeleted) throws AtlasException { guid = ParamChecker.notEmpty(guid, "entity id"); traitNameToBeDeleted = ParamChecker.notEmpty(traitNameToBeDeleted, "trait name"); // ensure trait type is already registered with the TS if (!typeSystem.isRegistered(traitNameToBeDeleted)) { final String msg = String.format("trait=%s should be defined in type system before it can be deleted", traitNameToBeDeleted); LOG.error(msg); throw new TypeNotFoundException(msg); } repository.deleteTrait(guid, traitNameToBeDeleted); onTraitDeletedFromEntity(repository.getEntityDefinition(guid), traitNameToBeDeleted); }
java
@Override public void deleteTrait(String guid, String traitNameToBeDeleted) throws AtlasException { guid = ParamChecker.notEmpty(guid, "entity id"); traitNameToBeDeleted = ParamChecker.notEmpty(traitNameToBeDeleted, "trait name"); // ensure trait type is already registered with the TS if (!typeSystem.isRegistered(traitNameToBeDeleted)) { final String msg = String.format("trait=%s should be defined in type system before it can be deleted", traitNameToBeDeleted); LOG.error(msg); throw new TypeNotFoundException(msg); } repository.deleteTrait(guid, traitNameToBeDeleted); onTraitDeletedFromEntity(repository.getEntityDefinition(guid), traitNameToBeDeleted); }
[ "@", "Override", "public", "void", "deleteTrait", "(", "String", "guid", ",", "String", "traitNameToBeDeleted", ")", "throws", "AtlasException", "{", "guid", "=", "ParamChecker", ".", "notEmpty", "(", "guid", ",", "\"entity id\"", ")", ";", "traitNameToBeDeleted",...
Deletes a given trait from an existing entity represented by a guid. @param guid globally unique identifier for the entity @param traitNameToBeDeleted name of the trait @throws AtlasException
[ "Deletes", "a", "given", "trait", "from", "an", "existing", "entity", "represented", "by", "a", "guid", "." ]
train
https://github.com/apache/incubator-atlas/blob/e0d2cdc27c32742ebecd24db4cca62dc04dcdf4b/repository/src/main/java/org/apache/atlas/services/DefaultMetadataService.java#L663-L679
beanshell/beanshell
src/main/java/bsh/ClassGenerator.java
ClassGenerator.generateClass
public Class<?> generateClass(String name, Modifiers modifiers, Class<?>[] interfaces, Class<?> superClass, BSHBlock block, Type type, CallStack callstack, Interpreter interpreter) throws EvalError { // Delegate to the static method return generateClassImpl(name, modifiers, interfaces, superClass, block, type, callstack, interpreter); }
java
public Class<?> generateClass(String name, Modifiers modifiers, Class<?>[] interfaces, Class<?> superClass, BSHBlock block, Type type, CallStack callstack, Interpreter interpreter) throws EvalError { // Delegate to the static method return generateClassImpl(name, modifiers, interfaces, superClass, block, type, callstack, interpreter); }
[ "public", "Class", "<", "?", ">", "generateClass", "(", "String", "name", ",", "Modifiers", "modifiers", ",", "Class", "<", "?", ">", "[", "]", "interfaces", ",", "Class", "<", "?", ">", "superClass", ",", "BSHBlock", "block", ",", "Type", "type", ",",...
Parse the BSHBlock for the class definition and generate the class.
[ "Parse", "the", "BSHBlock", "for", "the", "class", "definition", "and", "generate", "the", "class", "." ]
train
https://github.com/beanshell/beanshell/blob/fdddee3de948c9e6babb2d1337028f6fd0a2ba5c/src/main/java/bsh/ClassGenerator.java#L53-L56
Azure/azure-sdk-for-java
cognitiveservices/data-plane/language/luis/authoring/src/main/java/com/microsoft/azure/cognitiveservices/language/luis/authoring/implementation/ModelsImpl.java
ModelsImpl.addCustomPrebuiltEntity
public UUID addCustomPrebuiltEntity(UUID appId, String versionId, PrebuiltDomainModelCreateObject prebuiltDomainModelCreateObject) { return addCustomPrebuiltEntityWithServiceResponseAsync(appId, versionId, prebuiltDomainModelCreateObject).toBlocking().single().body(); }
java
public UUID addCustomPrebuiltEntity(UUID appId, String versionId, PrebuiltDomainModelCreateObject prebuiltDomainModelCreateObject) { return addCustomPrebuiltEntityWithServiceResponseAsync(appId, versionId, prebuiltDomainModelCreateObject).toBlocking().single().body(); }
[ "public", "UUID", "addCustomPrebuiltEntity", "(", "UUID", "appId", ",", "String", "versionId", ",", "PrebuiltDomainModelCreateObject", "prebuiltDomainModelCreateObject", ")", "{", "return", "addCustomPrebuiltEntityWithServiceResponseAsync", "(", "appId", ",", "versionId", ","...
Adds a custom prebuilt entity model to the application. @param appId The application ID. @param versionId The version ID. @param prebuiltDomainModelCreateObject A model object containing the name of the custom prebuilt entity and the name of the domain to which this model belongs. @throws IllegalArgumentException thrown if parameters fail the validation @throws ErrorResponseException thrown if the request is rejected by server @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent @return the UUID object if successful.
[ "Adds", "a", "custom", "prebuilt", "entity", "model", "to", "the", "application", "." ]
train
https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/cognitiveservices/data-plane/language/luis/authoring/src/main/java/com/microsoft/azure/cognitiveservices/language/luis/authoring/implementation/ModelsImpl.java#L5889-L5891
apache/incubator-atlas
webapp/src/main/java/org/apache/atlas/web/rest/EntityREST.java
EntityREST.getClassification
@GET @Path("/guid/{guid}/classification/{classificationName}") @Produces(Servlets.JSON_MEDIA_TYPE) public AtlasClassification getClassification(@PathParam("guid") String guid, @PathParam("classificationName") final String classificationName) throws AtlasBaseException { AtlasPerfTracer perf = null; try { if (AtlasPerfTracer.isPerfTraceEnabled(PERF_LOG)) { perf = AtlasPerfTracer.getPerfTracer(PERF_LOG, "EntityREST.getClassification(" + guid + "," + classificationName + ")"); } if (StringUtils.isEmpty(guid)) { throw new AtlasBaseException(AtlasErrorCode.INSTANCE_GUID_NOT_FOUND, guid); } ensureClassificationType(classificationName); return entitiesStore.getClassification(guid, classificationName); } finally { AtlasPerfTracer.log(perf); } }
java
@GET @Path("/guid/{guid}/classification/{classificationName}") @Produces(Servlets.JSON_MEDIA_TYPE) public AtlasClassification getClassification(@PathParam("guid") String guid, @PathParam("classificationName") final String classificationName) throws AtlasBaseException { AtlasPerfTracer perf = null; try { if (AtlasPerfTracer.isPerfTraceEnabled(PERF_LOG)) { perf = AtlasPerfTracer.getPerfTracer(PERF_LOG, "EntityREST.getClassification(" + guid + "," + classificationName + ")"); } if (StringUtils.isEmpty(guid)) { throw new AtlasBaseException(AtlasErrorCode.INSTANCE_GUID_NOT_FOUND, guid); } ensureClassificationType(classificationName); return entitiesStore.getClassification(guid, classificationName); } finally { AtlasPerfTracer.log(perf); } }
[ "@", "GET", "@", "Path", "(", "\"/guid/{guid}/classification/{classificationName}\"", ")", "@", "Produces", "(", "Servlets", ".", "JSON_MEDIA_TYPE", ")", "public", "AtlasClassification", "getClassification", "(", "@", "PathParam", "(", "\"guid\"", ")", "String", "guid...
Gets the list of classifications for a given entity represented by a guid. @param guid globally unique identifier for the entity @return classification for the given entity guid
[ "Gets", "the", "list", "of", "classifications", "for", "a", "given", "entity", "represented", "by", "a", "guid", "." ]
train
https://github.com/apache/incubator-atlas/blob/e0d2cdc27c32742ebecd24db4cca62dc04dcdf4b/webapp/src/main/java/org/apache/atlas/web/rest/EntityREST.java#L276-L296
hazelcast/hazelcast
hazelcast/src/main/java/com/hazelcast/internal/partition/impl/PartitionReplicaFragmentVersions.java
PartitionReplicaFragmentVersions.setVersions
private void setVersions(long[] newVersions, int fromReplica) { int fromIndex = fromReplica - 1; int len = newVersions.length - fromIndex; arraycopy(newVersions, fromIndex, versions, fromIndex, len); }
java
private void setVersions(long[] newVersions, int fromReplica) { int fromIndex = fromReplica - 1; int len = newVersions.length - fromIndex; arraycopy(newVersions, fromIndex, versions, fromIndex, len); }
[ "private", "void", "setVersions", "(", "long", "[", "]", "newVersions", ",", "int", "fromReplica", ")", "{", "int", "fromIndex", "=", "fromReplica", "-", "1", ";", "int", "len", "=", "newVersions", ".", "length", "-", "fromIndex", ";", "arraycopy", "(", ...
Change versions for all replicas with an index greater than {@code fromReplica} to the new replica versions
[ "Change", "versions", "for", "all", "replicas", "with", "an", "index", "greater", "than", "{" ]
train
https://github.com/hazelcast/hazelcast/blob/8c4bc10515dbbfb41a33e0302c0caedf3cda1baf/hazelcast/src/main/java/com/hazelcast/internal/partition/impl/PartitionReplicaFragmentVersions.java#L87-L91
Azure/azure-sdk-for-java
cognitiveservices/data-plane/vision/customvision/training/src/main/java/com/microsoft/azure/cognitiveservices/vision/customvision/training/implementation/TrainingsImpl.java
TrainingsImpl.getTaggedImagesWithServiceResponseAsync
public Observable<ServiceResponse<List<Image>>> getTaggedImagesWithServiceResponseAsync(UUID projectId, GetTaggedImagesOptionalParameter getTaggedImagesOptionalParameter) { if (projectId == null) { throw new IllegalArgumentException("Parameter projectId is required and cannot be null."); } if (this.client.apiKey() == null) { throw new IllegalArgumentException("Parameter this.client.apiKey() is required and cannot be null."); } final UUID iterationId = getTaggedImagesOptionalParameter != null ? getTaggedImagesOptionalParameter.iterationId() : null; final List<String> tagIds = getTaggedImagesOptionalParameter != null ? getTaggedImagesOptionalParameter.tagIds() : null; final String orderBy = getTaggedImagesOptionalParameter != null ? getTaggedImagesOptionalParameter.orderBy() : null; final Integer take = getTaggedImagesOptionalParameter != null ? getTaggedImagesOptionalParameter.take() : null; final Integer skip = getTaggedImagesOptionalParameter != null ? getTaggedImagesOptionalParameter.skip() : null; return getTaggedImagesWithServiceResponseAsync(projectId, iterationId, tagIds, orderBy, take, skip); }
java
public Observable<ServiceResponse<List<Image>>> getTaggedImagesWithServiceResponseAsync(UUID projectId, GetTaggedImagesOptionalParameter getTaggedImagesOptionalParameter) { if (projectId == null) { throw new IllegalArgumentException("Parameter projectId is required and cannot be null."); } if (this.client.apiKey() == null) { throw new IllegalArgumentException("Parameter this.client.apiKey() is required and cannot be null."); } final UUID iterationId = getTaggedImagesOptionalParameter != null ? getTaggedImagesOptionalParameter.iterationId() : null; final List<String> tagIds = getTaggedImagesOptionalParameter != null ? getTaggedImagesOptionalParameter.tagIds() : null; final String orderBy = getTaggedImagesOptionalParameter != null ? getTaggedImagesOptionalParameter.orderBy() : null; final Integer take = getTaggedImagesOptionalParameter != null ? getTaggedImagesOptionalParameter.take() : null; final Integer skip = getTaggedImagesOptionalParameter != null ? getTaggedImagesOptionalParameter.skip() : null; return getTaggedImagesWithServiceResponseAsync(projectId, iterationId, tagIds, orderBy, take, skip); }
[ "public", "Observable", "<", "ServiceResponse", "<", "List", "<", "Image", ">", ">", ">", "getTaggedImagesWithServiceResponseAsync", "(", "UUID", "projectId", ",", "GetTaggedImagesOptionalParameter", "getTaggedImagesOptionalParameter", ")", "{", "if", "(", "projectId", ...
Get tagged images for a given project iteration. This API supports batching and range selection. By default it will only return first 50 images matching images. Use the {take} and {skip} parameters to control how many images to return in a given batch. The filtering is on an and/or relationship. For example, if the provided tag ids are for the "Dog" and "Cat" tags, then only images tagged with Dog and/or Cat will be returned. @param projectId The project id @param getTaggedImagesOptionalParameter the object representing the optional parameters to be set before calling this API @throws IllegalArgumentException thrown if parameters fail the validation @return the observable to the List&lt;Image&gt; object
[ "Get", "tagged", "images", "for", "a", "given", "project", "iteration", ".", "This", "API", "supports", "batching", "and", "range", "selection", ".", "By", "default", "it", "will", "only", "return", "first", "50", "images", "matching", "images", ".", "Use", ...
train
https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/cognitiveservices/data-plane/vision/customvision/training/src/main/java/com/microsoft/azure/cognitiveservices/vision/customvision/training/implementation/TrainingsImpl.java#L5028-L5042
RestComm/sip-servlets
sip-servlets-examples/facebook-c2c/src/main/java/com/facebook/api/FacebookRestClient.java
FacebookRestClient.profile_setFBML
public boolean profile_setFBML(CharSequence profileFbmlMarkup, CharSequence profileActionFbmlMarkup) throws FacebookException, IOException { return profile_setFBML(profileFbmlMarkup, profileActionFbmlMarkup, /* mobileFbmlMarkup */null, /* profileId */null); }
java
public boolean profile_setFBML(CharSequence profileFbmlMarkup, CharSequence profileActionFbmlMarkup) throws FacebookException, IOException { return profile_setFBML(profileFbmlMarkup, profileActionFbmlMarkup, /* mobileFbmlMarkup */null, /* profileId */null); }
[ "public", "boolean", "profile_setFBML", "(", "CharSequence", "profileFbmlMarkup", ",", "CharSequence", "profileActionFbmlMarkup", ")", "throws", "FacebookException", ",", "IOException", "{", "return", "profile_setFBML", "(", "profileFbmlMarkup", ",", "profileActionFbmlMarkup"...
Sets the FBML for the profile box and profile actions for the logged-in user. Refer to the FBML documentation for a description of the markup and its role in various contexts. @param profileFbmlMarkup the FBML for the profile box @param profileActionFbmlMarkup the FBML for the profile actions @return a boolean indicating whether the FBML was successfully set @see <a href="http://wiki.developers.facebook.com/index.php/Profile.setFBML"> Developers wiki: Profile.setFBML</a>
[ "Sets", "the", "FBML", "for", "the", "profile", "box", "and", "profile", "actions", "for", "the", "logged", "-", "in", "user", ".", "Refer", "to", "the", "FBML", "documentation", "for", "a", "description", "of", "the", "markup", "and", "its", "role", "in...
train
https://github.com/RestComm/sip-servlets/blob/fd7011d2803ab1d205b140768a760c8c69e0c997/sip-servlets-examples/facebook-c2c/src/main/java/com/facebook/api/FacebookRestClient.java#L1515-L1518
mapfish/mapfish-print
core/src/main/java/org/mapfish/print/wrapper/PAbstractObject.java
PAbstractObject.getInt
@Override public final int getInt(final String key) { Integer result = optInt(key); if (result == null) { throw new ObjectMissingException(this, key); } return result; }
java
@Override public final int getInt(final String key) { Integer result = optInt(key); if (result == null) { throw new ObjectMissingException(this, key); } return result; }
[ "@", "Override", "public", "final", "int", "getInt", "(", "final", "String", "key", ")", "{", "Integer", "result", "=", "optInt", "(", "key", ")", ";", "if", "(", "result", "==", "null", ")", "{", "throw", "new", "ObjectMissingException", "(", "this", ...
Get a property as an int or throw an exception. @param key the property name
[ "Get", "a", "property", "as", "an", "int", "or", "throw", "an", "exception", "." ]
train
https://github.com/mapfish/mapfish-print/blob/25a452cb39f592bd8a53b20db1037703898e1e22/core/src/main/java/org/mapfish/print/wrapper/PAbstractObject.java#L50-L57
Netflix/dyno
dyno-core/src/main/java/com/netflix/dyno/connectionpool/impl/HostStatusTracker.java
HostStatusTracker.checkIfChanged
public boolean checkIfChanged(Collection<Host> hostsUp, Collection<Host> hostsDown) { boolean changed = activeSetChanged(hostsUp) || inactiveSetChanged(hostsUp, hostsDown); if (changed && logger.isDebugEnabled()) { Set<Host> changedHostsUp = new HashSet<>(hostsUp); changedHostsUp.removeAll(activeHosts); changedHostsUp.forEach(x -> logger.debug("New host up: {}", x.getHostAddress())); Set<Host> changedHostsDown = new HashSet<>(hostsDown); changedHostsDown.removeAll(inactiveHosts); changedHostsDown.forEach(x -> logger.debug("New host down: {}", x.getHostAddress())); } return changed; }
java
public boolean checkIfChanged(Collection<Host> hostsUp, Collection<Host> hostsDown) { boolean changed = activeSetChanged(hostsUp) || inactiveSetChanged(hostsUp, hostsDown); if (changed && logger.isDebugEnabled()) { Set<Host> changedHostsUp = new HashSet<>(hostsUp); changedHostsUp.removeAll(activeHosts); changedHostsUp.forEach(x -> logger.debug("New host up: {}", x.getHostAddress())); Set<Host> changedHostsDown = new HashSet<>(hostsDown); changedHostsDown.removeAll(inactiveHosts); changedHostsDown.forEach(x -> logger.debug("New host down: {}", x.getHostAddress())); } return changed; }
[ "public", "boolean", "checkIfChanged", "(", "Collection", "<", "Host", ">", "hostsUp", ",", "Collection", "<", "Host", ">", "hostsDown", ")", "{", "boolean", "changed", "=", "activeSetChanged", "(", "hostsUp", ")", "||", "inactiveSetChanged", "(", "hostsUp", "...
Helper method that checks if anything has changed b/w the current state and the new set of hosts up and down @param hostsUp @param hostsDown @return true/false indicating whether the set of hosts has changed or not.
[ "Helper", "method", "that", "checks", "if", "anything", "has", "changed", "b", "/", "w", "the", "current", "state", "and", "the", "new", "set", "of", "hosts", "up", "and", "down" ]
train
https://github.com/Netflix/dyno/blob/158f807083ea8e9b09c8089cb07f98e954ad5b23/dyno-core/src/main/java/com/netflix/dyno/connectionpool/impl/HostStatusTracker.java#L130-L143
alibaba/ARouter
arouter-api/src/main/java/com/alibaba/android/arouter/facade/Postcard.java
Postcard.withBundle
public Postcard withBundle(@Nullable String key, @Nullable Bundle value) { mBundle.putBundle(key, value); return this; }
java
public Postcard withBundle(@Nullable String key, @Nullable Bundle value) { mBundle.putBundle(key, value); return this; }
[ "public", "Postcard", "withBundle", "(", "@", "Nullable", "String", "key", ",", "@", "Nullable", "Bundle", "value", ")", "{", "mBundle", ".", "putBundle", "(", "key", ",", "value", ")", ";", "return", "this", ";", "}" ]
Inserts a Bundle value into the mapping of this Bundle, replacing any existing value for the given key. Either key or value may be null. @param key a String, or null @param value a Bundle object, or null @return current
[ "Inserts", "a", "Bundle", "value", "into", "the", "mapping", "of", "this", "Bundle", "replacing", "any", "existing", "value", "for", "the", "given", "key", ".", "Either", "key", "or", "value", "may", "be", "null", "." ]
train
https://github.com/alibaba/ARouter/blob/1a06912a6e14a57112db1204b43f81c43d721732/arouter-api/src/main/java/com/alibaba/android/arouter/facade/Postcard.java#L546-L549
OpenLiberty/open-liberty
dev/com.ibm.ws.security.csiv2.common/src/com/ibm/ws/transport/iiop/security/util/Util.java
Util.extractUserNameFromScopedName
public static String extractUserNameFromScopedName(byte[] scopedNameBytes) throws UnsupportedEncodingException { String scopedUserName = new String(scopedNameBytes, "UTF8"); return extractUserNameFromScopedName(scopedUserName); }
java
public static String extractUserNameFromScopedName(byte[] scopedNameBytes) throws UnsupportedEncodingException { String scopedUserName = new String(scopedNameBytes, "UTF8"); return extractUserNameFromScopedName(scopedUserName); }
[ "public", "static", "String", "extractUserNameFromScopedName", "(", "byte", "[", "]", "scopedNameBytes", ")", "throws", "UnsupportedEncodingException", "{", "String", "scopedUserName", "=", "new", "String", "(", "scopedNameBytes", ",", "\"UTF8\"", ")", ";", "return", ...
See csiv2 spec 16.2.5 par. 63-64. We extract the username if any and un-escape any escaped \ and @ characters. @param scopedNameBytes @return @throws UnsupportedEncodingException
[ "See", "csiv2", "spec", "16", ".", "2", ".", "5", "par", ".", "63", "-", "64", ".", "We", "extract", "the", "username", "if", "any", "and", "un", "-", "escape", "any", "escaped", "\\", "and", "@", "characters", "." ]
train
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.security.csiv2.common/src/com/ibm/ws/transport/iiop/security/util/Util.java#L317-L320
fuinorg/utils4j
src/main/java/org/fuin/utils4j/Utils4J.java
Utils4J.createInstance
public static Object createInstance(final String className, final ClassLoader classLoader) { checkNotNull("className", className); checkNotNull("classLoader", classLoader); try { final Class<?> clasz = Class.forName(className, true, classLoader); return clasz.newInstance(); } catch (final ClassNotFoundException e) { throw new RuntimeException("Unknown class!", e); } catch (final InstantiationException e) { throw new RuntimeException("Error instanciating class!", e); } catch (final IllegalAccessException e) { throw new RuntimeException("Error accessing class!", e); } }
java
public static Object createInstance(final String className, final ClassLoader classLoader) { checkNotNull("className", className); checkNotNull("classLoader", classLoader); try { final Class<?> clasz = Class.forName(className, true, classLoader); return clasz.newInstance(); } catch (final ClassNotFoundException e) { throw new RuntimeException("Unknown class!", e); } catch (final InstantiationException e) { throw new RuntimeException("Error instanciating class!", e); } catch (final IllegalAccessException e) { throw new RuntimeException("Error accessing class!", e); } }
[ "public", "static", "Object", "createInstance", "(", "final", "String", "className", ",", "final", "ClassLoader", "classLoader", ")", "{", "checkNotNull", "(", "\"className\"", ",", "className", ")", ";", "checkNotNull", "(", "\"classLoader\"", ",", "classLoader", ...
Create an instance with Class.forName(..) and wrap all exceptions into RuntimeExceptions. @param className Full qualified class name - Cannot be <code>null</code>. @param classLoader Dedicated class loader to use - Cannot be <code>NULL</code>. @return New instance of the class.
[ "Create", "an", "instance", "with", "Class", ".", "forName", "(", "..", ")", "and", "wrap", "all", "exceptions", "into", "RuntimeExceptions", "." ]
train
https://github.com/fuinorg/utils4j/blob/71cf88e0a8d8ed67bbac513bf3cab165cd7e3280/src/main/java/org/fuin/utils4j/Utils4J.java#L194-L207
JodaOrg/joda-time
src/main/java/org/joda/time/PeriodType.java
PeriodType.setIndexedField
boolean setIndexedField(ReadablePeriod period, int index, int[] values, int newValue) { int realIndex = iIndices[index]; if (realIndex == -1) { throw new UnsupportedOperationException("Field is not supported"); } values[realIndex] = newValue; return true; }
java
boolean setIndexedField(ReadablePeriod period, int index, int[] values, int newValue) { int realIndex = iIndices[index]; if (realIndex == -1) { throw new UnsupportedOperationException("Field is not supported"); } values[realIndex] = newValue; return true; }
[ "boolean", "setIndexedField", "(", "ReadablePeriod", "period", ",", "int", "index", ",", "int", "[", "]", "values", ",", "int", "newValue", ")", "{", "int", "realIndex", "=", "iIndices", "[", "index", "]", ";", "if", "(", "realIndex", "==", "-", "1", "...
Sets the indexed field part of the period. @param period the period to query @param index the index to use @param values the array to populate @param newValue the value to set @throws UnsupportedOperationException if not supported
[ "Sets", "the", "indexed", "field", "part", "of", "the", "period", "." ]
train
https://github.com/JodaOrg/joda-time/blob/bd79f1c4245e79b3c2c56d7b04fde2a6e191fa42/src/main/java/org/joda/time/PeriodType.java#L687-L694
sarl/sarl
main/coreplugins/io.sarl.lang.mwe2/src/io/sarl/lang/mwe2/externalspec/vim/VimGenerator2.java
VimGenerator2.generateKeywords
protected void generateKeywords(IStyleAppendable it, String family, VimSyntaxGroup color, Iterable<String> keywords) { appendComment(it, "keywords for the '" + family + "' family."); //$NON-NLS-1$ //$NON-NLS-2$ final Iterator<String> iterator = keywords.iterator(); if (iterator.hasNext()) { it.append("syn keyword "); //$NON-NLS-1$ it.append(family); do { it.append(" "); //$NON-NLS-1$ it.append(iterator.next()); } while (iterator.hasNext()); } it.newLine(); appendCluster(it, family); hilight(family, color); it.newLine(); }
java
protected void generateKeywords(IStyleAppendable it, String family, VimSyntaxGroup color, Iterable<String> keywords) { appendComment(it, "keywords for the '" + family + "' family."); //$NON-NLS-1$ //$NON-NLS-2$ final Iterator<String> iterator = keywords.iterator(); if (iterator.hasNext()) { it.append("syn keyword "); //$NON-NLS-1$ it.append(family); do { it.append(" "); //$NON-NLS-1$ it.append(iterator.next()); } while (iterator.hasNext()); } it.newLine(); appendCluster(it, family); hilight(family, color); it.newLine(); }
[ "protected", "void", "generateKeywords", "(", "IStyleAppendable", "it", ",", "String", "family", ",", "VimSyntaxGroup", "color", ",", "Iterable", "<", "String", ">", "keywords", ")", "{", "appendComment", "(", "it", ",", "\"keywords for the '\"", "+", "family", ...
Generate the Vim keywords. @param it the receiver of the generated elements. @param family the name of the keyword family. @param color the color to be associated to the elements. @param keywords the keywords.
[ "Generate", "the", "Vim", "keywords", "." ]
train
https://github.com/sarl/sarl/blob/ca00ff994598c730339972def4e19a60e0b8cace/main/coreplugins/io.sarl.lang.mwe2/src/io/sarl/lang/mwe2/externalspec/vim/VimGenerator2.java#L311-L326
jmchilton/galaxy-bootstrap
src/main/java/com/github/jmchilton/galaxybootstrap/GalaxyProperties.java
GalaxyProperties.getConfigSampleIni
private File getConfigSampleIni(File galaxyRoot) { if (isPre20141006Release(galaxyRoot)) { return new File(galaxyRoot, "universe_wsgi.ini.sample"); } else { File configDirectory = new File(galaxyRoot, CONFIG_DIR_NAME); return new File(configDirectory, "galaxy.ini.sample"); } }
java
private File getConfigSampleIni(File galaxyRoot) { if (isPre20141006Release(galaxyRoot)) { return new File(galaxyRoot, "universe_wsgi.ini.sample"); } else { File configDirectory = new File(galaxyRoot, CONFIG_DIR_NAME); return new File(configDirectory, "galaxy.ini.sample"); } }
[ "private", "File", "getConfigSampleIni", "(", "File", "galaxyRoot", ")", "{", "if", "(", "isPre20141006Release", "(", "galaxyRoot", ")", ")", "{", "return", "new", "File", "(", "galaxyRoot", ",", "\"universe_wsgi.ini.sample\"", ")", ";", "}", "else", "{", "Fil...
Gets the sample config ini for this Galaxy installation. @param galaxyRoot The root directory of Galaxy. @return A File object for the sample config ini for Galaxy.
[ "Gets", "the", "sample", "config", "ini", "for", "this", "Galaxy", "installation", "." ]
train
https://github.com/jmchilton/galaxy-bootstrap/blob/4a899f5e6ec0c9f6f4b9b21d5a0320e5925ec649/src/main/java/com/github/jmchilton/galaxybootstrap/GalaxyProperties.java#L142-L149
deeplearning4j/deeplearning4j
deeplearning4j/deeplearning4j-modelimport/src/main/java/org/deeplearning4j/nn/modelimport/keras/utils/KerasModelUtils.java
KerasModelUtils.determineKerasBackend
public static String determineKerasBackend(Map<String, Object> modelConfig, KerasModelConfiguration config) { String kerasBackend = null; if (!modelConfig.containsKey(config.getFieldBackend())) { // TODO: H5 files unfortunately do not seem to have this property in keras 1. log.warn("Could not read keras backend used (no " + config.getFieldBackend() + " field found) \n" ); } else { kerasBackend = (String) modelConfig.get(config.getFieldBackend()); } return kerasBackend; }
java
public static String determineKerasBackend(Map<String, Object> modelConfig, KerasModelConfiguration config) { String kerasBackend = null; if (!modelConfig.containsKey(config.getFieldBackend())) { // TODO: H5 files unfortunately do not seem to have this property in keras 1. log.warn("Could not read keras backend used (no " + config.getFieldBackend() + " field found) \n" ); } else { kerasBackend = (String) modelConfig.get(config.getFieldBackend()); } return kerasBackend; }
[ "public", "static", "String", "determineKerasBackend", "(", "Map", "<", "String", ",", "Object", ">", "modelConfig", ",", "KerasModelConfiguration", "config", ")", "{", "String", "kerasBackend", "=", "null", ";", "if", "(", "!", "modelConfig", ".", "containsKey"...
Determine Keras backend @param modelConfig parsed model configuration for keras model @param config basic model configuration (KerasModelConfiguration) @return Keras backend string @throws InvalidKerasConfigurationException Invalid Keras config
[ "Determine", "Keras", "backend" ]
train
https://github.com/deeplearning4j/deeplearning4j/blob/effce52f2afd7eeb53c5bcca699fcd90bd06822f/deeplearning4j/deeplearning4j-modelimport/src/main/java/org/deeplearning4j/nn/modelimport/keras/utils/KerasModelUtils.java#L126-L137
BorderTech/wcomponents
wcomponents-core/src/main/java/com/github/bordertech/wcomponents/util/thumbnail/ThumbnailUtil.java
ThumbnailUtil.createThumbnail
public static com.github.bordertech.wcomponents.Image createThumbnail(final InputStream is, final String name, final Dimension scaledSize, final String mimeType) { final Dimension scale = scaledSize == null ? THUMBNAIL_SCALE_SIZE : scaledSize; // Generate thumbnail for image files if (is != null && mimeType != null && (mimeType.equals("image/jpeg") || mimeType.equals( "image/bmp") || mimeType.equals("image/png") || mimeType.equals("image/gif"))) { byte[] bytes = createImageThumbnail(is, scale); if (bytes != null) { return new BytesImage(bytes, "image/jpeg", "Thumbnail of " + name, null); } } // Use default thumbnail depending on mime type com.github.bordertech.wcomponents.Image image = handleDefaultImage(mimeType, name, scale); return image; }
java
public static com.github.bordertech.wcomponents.Image createThumbnail(final InputStream is, final String name, final Dimension scaledSize, final String mimeType) { final Dimension scale = scaledSize == null ? THUMBNAIL_SCALE_SIZE : scaledSize; // Generate thumbnail for image files if (is != null && mimeType != null && (mimeType.equals("image/jpeg") || mimeType.equals( "image/bmp") || mimeType.equals("image/png") || mimeType.equals("image/gif"))) { byte[] bytes = createImageThumbnail(is, scale); if (bytes != null) { return new BytesImage(bytes, "image/jpeg", "Thumbnail of " + name, null); } } // Use default thumbnail depending on mime type com.github.bordertech.wcomponents.Image image = handleDefaultImage(mimeType, name, scale); return image; }
[ "public", "static", "com", ".", "github", ".", "bordertech", ".", "wcomponents", ".", "Image", "createThumbnail", "(", "final", "InputStream", "is", ",", "final", "String", "name", ",", "final", "Dimension", "scaledSize", ",", "final", "String", "mimeType", ")...
This method takes a input document (represented by an {@link InputStream}) and returns a byte[] representing a JPEG "thumb nail" of a given page of the document. It can do this for a limited number of input document "types"images. @param is The {@link InputStream} representing the input document. @param name The name of the file from which the input document was sourced. @param scaledSize the size to which the given <em>image</em> is to be scaled, null for default @param mimeType the mime type @return a byte[] array representing a JEPG thumb nail of the specified page within the Office document or Image.
[ "This", "method", "takes", "a", "input", "document", "(", "represented", "by", "an", "{", "@link", "InputStream", "}", ")", "and", "returns", "a", "byte", "[]", "representing", "a", "JPEG", "thumb", "nail", "of", "a", "given", "page", "of", "the", "docum...
train
https://github.com/BorderTech/wcomponents/blob/d1a2b2243270067db030feb36ca74255aaa94436/wcomponents-core/src/main/java/com/github/bordertech/wcomponents/util/thumbnail/ThumbnailUtil.java#L134-L152
lessthanoptimal/ejml
main/ejml-ddense/src/org/ejml/dense/row/mult/VectorVectorMult_DDRM.java
VectorVectorMult_DDRM.outerProd
public static void outerProd(DMatrixD1 x, DMatrixD1 y, DMatrix1Row A ) { int m = A.numRows; int n = A.numCols; int index = 0; for( int i = 0; i < m; i++ ) { double xdat = x.get(i); for( int j = 0; j < n; j++ ) { A.set(index++ , xdat*y.get(j) ); } } }
java
public static void outerProd(DMatrixD1 x, DMatrixD1 y, DMatrix1Row A ) { int m = A.numRows; int n = A.numCols; int index = 0; for( int i = 0; i < m; i++ ) { double xdat = x.get(i); for( int j = 0; j < n; j++ ) { A.set(index++ , xdat*y.get(j) ); } } }
[ "public", "static", "void", "outerProd", "(", "DMatrixD1", "x", ",", "DMatrixD1", "y", ",", "DMatrix1Row", "A", ")", "{", "int", "m", "=", "A", ".", "numRows", ";", "int", "n", "=", "A", ".", "numCols", ";", "int", "index", "=", "0", ";", "for", ...
<p> Sets A &isin; &real; <sup>m &times; n</sup> equal to an outer product multiplication of the two vectors. This is also known as a rank-1 operation.<br> <br> A = x * y' where x &isin; &real; <sup>m</sup> and y &isin; &real; <sup>n</sup> are vectors. </p> <p> Which is equivalent to: A<sub>ij</sub> = x<sub>i</sub>*y<sub>j</sub> </p> <p> These functions are often used inside of highly optimized code and therefor sanity checks are kept to a minimum. It is not recommended that any of these functions be used directly. </p> @param x A vector with m elements. Not modified. @param y A vector with n elements. Not modified. @param A A Matrix with m by n elements. Modified.
[ "<p", ">", "Sets", "A", "&isin", ";", "&real", ";", "<sup", ">", "m", "&times", ";", "n<", "/", "sup", ">", "equal", "to", "an", "outer", "product", "multiplication", "of", "the", "two", "vectors", ".", "This", "is", "also", "known", "as", "a", "ra...
train
https://github.com/lessthanoptimal/ejml/blob/1444680cc487af5e866730e62f48f5f9636850d9/main/ejml-ddense/src/org/ejml/dense/row/mult/VectorVectorMult_DDRM.java#L157-L168
alibaba/canal
client-adapter/common/src/main/java/com/alibaba/otter/canal/client/adapter/config/bind/RelaxedDataBinder.java
RelaxedDataBinder.normalizePath
protected String normalizePath(BeanWrapper wrapper, String path) { return initializePath(wrapper, new RelaxedDataBinder.BeanPath(path), 0); }
java
protected String normalizePath(BeanWrapper wrapper, String path) { return initializePath(wrapper, new RelaxedDataBinder.BeanPath(path), 0); }
[ "protected", "String", "normalizePath", "(", "BeanWrapper", "wrapper", ",", "String", "path", ")", "{", "return", "initializePath", "(", "wrapper", ",", "new", "RelaxedDataBinder", ".", "BeanPath", "(", "path", ")", ",", "0", ")", ";", "}" ]
Normalize a bean property path to a format understood by a BeanWrapper. This is used so that <ul> <li>Fuzzy matching can be employed for bean property names</li> <li>Period separators can be used instead of indexing ([...]) for map keys</li> </ul> @param wrapper a bean wrapper for the object to bind @param path the bean path to bind @return a transformed path with correct bean wrapper syntax
[ "Normalize", "a", "bean", "property", "path", "to", "a", "format", "understood", "by", "a", "BeanWrapper", ".", "This", "is", "used", "so", "that", "<ul", ">", "<li", ">", "Fuzzy", "matching", "can", "be", "employed", "for", "bean", "property", "names<", ...
train
https://github.com/alibaba/canal/blob/8f088cddc0755f4350c5aaae95c6e4002d90a40f/client-adapter/common/src/main/java/com/alibaba/otter/canal/client/adapter/config/bind/RelaxedDataBinder.java#L239-L241
gallandarakhneorg/afc
core/inputoutput/src/main/java/org/arakhne/afc/inputoutput/xml/XMLUtil.java
XMLUtil.readXMLFragment
public static DocumentFragment readXMLFragment(URL file, boolean skipRoot) throws IOException, SAXException, ParserConfigurationException { assert file != null : AssertMessages.notNullParameter(); return readXMLFragment(file.openStream(), skipRoot); }
java
public static DocumentFragment readXMLFragment(URL file, boolean skipRoot) throws IOException, SAXException, ParserConfigurationException { assert file != null : AssertMessages.notNullParameter(); return readXMLFragment(file.openStream(), skipRoot); }
[ "public", "static", "DocumentFragment", "readXMLFragment", "(", "URL", "file", ",", "boolean", "skipRoot", ")", "throws", "IOException", ",", "SAXException", ",", "ParserConfigurationException", "{", "assert", "file", "!=", "null", ":", "AssertMessages", ".", "notNu...
Read an XML fragment from an XML file. The XML file is well-formed. It means that the fragment will contains a single element: the root element within the input file. @param file is the file to read @param skipRoot if {@code true} the root element itself is not part of the fragment, and the children of the root element are directly added within the fragment. @return the fragment from the {@code file}. @throws IOException if the stream cannot be read. @throws SAXException if the stream does not contains valid XML data. @throws ParserConfigurationException if the parser cannot be configured.
[ "Read", "an", "XML", "fragment", "from", "an", "XML", "file", ".", "The", "XML", "file", "is", "well", "-", "formed", ".", "It", "means", "that", "the", "fragment", "will", "contains", "a", "single", "element", ":", "the", "root", "element", "within", ...
train
https://github.com/gallandarakhneorg/afc/blob/0c7d2e1ddefd4167ef788416d970a6c1ef6f8bbb/core/inputoutput/src/main/java/org/arakhne/afc/inputoutput/xml/XMLUtil.java#L2154-L2158
spotbugs/spotbugs
spotbugs/src/main/java/edu/umd/cs/findbugs/ba/Frame.java
Frame.setValue
public void setValue(int n, ValueType value) { if (VERIFY_INTEGRITY && value == null) { throw new IllegalArgumentException(); } if (!isValid()) { throw new IllegalStateException("accessing top or bottom frame"); } slotList.set(n, value); }
java
public void setValue(int n, ValueType value) { if (VERIFY_INTEGRITY && value == null) { throw new IllegalArgumentException(); } if (!isValid()) { throw new IllegalStateException("accessing top or bottom frame"); } slotList.set(n, value); }
[ "public", "void", "setValue", "(", "int", "n", ",", "ValueType", "value", ")", "{", "if", "(", "VERIFY_INTEGRITY", "&&", "value", "==", "null", ")", "{", "throw", "new", "IllegalArgumentException", "(", ")", ";", "}", "if", "(", "!", "isValid", "(", ")...
Set the value at the <i>n</i>th slot. @param n the slot in which to set a new value @param value the value to set
[ "Set", "the", "value", "at", "the", "<i", ">", "n<", "/", "i", ">", "th", "slot", "." ]
train
https://github.com/spotbugs/spotbugs/blob/f6365c6eea6515035bded38efa4a7c8b46ccf28c/spotbugs/src/main/java/edu/umd/cs/findbugs/ba/Frame.java#L552-L560
netscaler/nitro
src/main/java/com/citrix/netscaler/nitro/resource/stat/gslb/gslbservice_stats.java
gslbservice_stats.get
public static gslbservice_stats get(nitro_service service, String servicename) throws Exception{ gslbservice_stats obj = new gslbservice_stats(); obj.set_servicename(servicename); gslbservice_stats response = (gslbservice_stats) obj.stat_resource(service); return response; }
java
public static gslbservice_stats get(nitro_service service, String servicename) throws Exception{ gslbservice_stats obj = new gslbservice_stats(); obj.set_servicename(servicename); gslbservice_stats response = (gslbservice_stats) obj.stat_resource(service); return response; }
[ "public", "static", "gslbservice_stats", "get", "(", "nitro_service", "service", ",", "String", "servicename", ")", "throws", "Exception", "{", "gslbservice_stats", "obj", "=", "new", "gslbservice_stats", "(", ")", ";", "obj", ".", "set_servicename", "(", "service...
Use this API to fetch statistics of gslbservice_stats resource of given name .
[ "Use", "this", "API", "to", "fetch", "statistics", "of", "gslbservice_stats", "resource", "of", "given", "name", "." ]
train
https://github.com/netscaler/nitro/blob/2a98692dcf4e4ec430c7d7baab8382e4ba5a35e4/src/main/java/com/citrix/netscaler/nitro/resource/stat/gslb/gslbservice_stats.java#L309-L314
Stratio/deep-spark
deep-commons/src/main/java/com/stratio/deep/commons/entity/Cells.java
Cells.getFloat
public Float getFloat(String nameSpace, String cellName) { return getValue(nameSpace, cellName, Float.class); }
java
public Float getFloat(String nameSpace, String cellName) { return getValue(nameSpace, cellName, Float.class); }
[ "public", "Float", "getFloat", "(", "String", "nameSpace", ",", "String", "cellName", ")", "{", "return", "getValue", "(", "nameSpace", ",", "cellName", ",", "Float", ".", "class", ")", ";", "}" ]
Returns the {@code Float} value of the {@link Cell} (associated to {@code table}) whose name iscellName, or null if this Cells object contains no cell whose name is cellName. @param nameSpace the name of the owning table @param cellName the name of the Cell we want to retrieve from this Cells object. @return the {@code Float} value of the {@link Cell} (associated to {@code table}) whose name is cellName, or null if this Cells object contains no cell whose name is cellName
[ "Returns", "the", "{", "@code", "Float", "}", "value", "of", "the", "{", "@link", "Cell", "}", "(", "associated", "to", "{", "@code", "table", "}", ")", "whose", "name", "iscellName", "or", "null", "if", "this", "Cells", "object", "contains", "no", "ce...
train
https://github.com/Stratio/deep-spark/blob/b9621c9b7a6d996f80fce1d073d696a157bed095/deep-commons/src/main/java/com/stratio/deep/commons/entity/Cells.java#L1075-L1077
SimiaCryptus/utilities
java-util/src/main/java/com/simiacryptus/text/CompressionUtil.java
CompressionUtil.encodeLZ
public static byte[] encodeLZ(String data, String dictionary) { byte[] asBytes = new byte[0]; try { asBytes = data.getBytes("UTF-8"); } catch (UnsupportedEncodingException e) { throw new RuntimeException(e); } return encodeLZ(asBytes, dictionary); }
java
public static byte[] encodeLZ(String data, String dictionary) { byte[] asBytes = new byte[0]; try { asBytes = data.getBytes("UTF-8"); } catch (UnsupportedEncodingException e) { throw new RuntimeException(e); } return encodeLZ(asBytes, dictionary); }
[ "public", "static", "byte", "[", "]", "encodeLZ", "(", "String", "data", ",", "String", "dictionary", ")", "{", "byte", "[", "]", "asBytes", "=", "new", "byte", "[", "0", "]", ";", "try", "{", "asBytes", "=", "data", ".", "getBytes", "(", "\"UTF-8\""...
Encode lz byte [ ]. @param data the data @param dictionary the dictionary @return the byte [ ]
[ "Encode", "lz", "byte", "[", "]", "." ]
train
https://github.com/SimiaCryptus/utilities/blob/b5a5e73449aae57de7dbfca2ed7a074432c5b17e/java-util/src/main/java/com/simiacryptus/text/CompressionUtil.java#L52-L60
alkacon/opencms-core
src/org/opencms/ui/apps/publishqueue/CmsQueuedTable.java
CmsQueuedTable.onItemClick
void onItemClick(MouseEvents.ClickEvent event, Object itemId, Object propertyId) { setValue(null); select(itemId); if (event.getButton().equals(MouseButton.RIGHT) || (propertyId == null)) { m_menu.setEntries( getMenuEntries(), Collections.singleton((((CmsPublishJobBase)getValue()).getPublishHistoryId()).getStringValue())); m_menu.openForTable(event, itemId, propertyId, CmsQueuedTable.this); } else if (event.getButton().equals(MouseButton.LEFT) && PROP_RESOURCES.equals(propertyId)) { showResourceDialog(((CmsPublishJobBase)getValue()).getPublishHistoryId().getStringValue()); } else if (event.getButton().equals(MouseButton.LEFT) && PROP_PROJECT.equals(propertyId)) { if (!(getValue() instanceof CmsPublishJobEnqueued)) { showReportDialog((((CmsPublishJobBase)getValue()).getPublishHistoryId().getStringValue())); } } }
java
void onItemClick(MouseEvents.ClickEvent event, Object itemId, Object propertyId) { setValue(null); select(itemId); if (event.getButton().equals(MouseButton.RIGHT) || (propertyId == null)) { m_menu.setEntries( getMenuEntries(), Collections.singleton((((CmsPublishJobBase)getValue()).getPublishHistoryId()).getStringValue())); m_menu.openForTable(event, itemId, propertyId, CmsQueuedTable.this); } else if (event.getButton().equals(MouseButton.LEFT) && PROP_RESOURCES.equals(propertyId)) { showResourceDialog(((CmsPublishJobBase)getValue()).getPublishHistoryId().getStringValue()); } else if (event.getButton().equals(MouseButton.LEFT) && PROP_PROJECT.equals(propertyId)) { if (!(getValue() instanceof CmsPublishJobEnqueued)) { showReportDialog((((CmsPublishJobBase)getValue()).getPublishHistoryId().getStringValue())); } } }
[ "void", "onItemClick", "(", "MouseEvents", ".", "ClickEvent", "event", ",", "Object", "itemId", ",", "Object", "propertyId", ")", "{", "setValue", "(", "null", ")", ";", "select", "(", "itemId", ")", ";", "if", "(", "event", ".", "getButton", "(", ")", ...
Handles the table item clicks, including clicks on images inside of a table item.<p> @param event the click event @param itemId of the clicked row @param propertyId column id
[ "Handles", "the", "table", "item", "clicks", "including", "clicks", "on", "images", "inside", "of", "a", "table", "item", ".", "<p", ">" ]
train
https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/ui/apps/publishqueue/CmsQueuedTable.java#L540-L556
google/allocation-instrumenter
src/main/java/com/google/monitoring/runtime/instrumentation/AllocationClassAdapter.java
AllocationClassAdapter.visitMethod
@Override public MethodVisitor visitMethod( int access, String base, String desc, String signature, String[] exceptions) { MethodVisitor mv = cv.visitMethod(access, base, desc, signature, exceptions); if (mv != null) { // We need to compute stackmaps (see // AllocationInstrumenter#instrument). This can't really be // done for old bytecode that contains JSR and RET instructions. // So, we remove JSRs and RETs. JSRInlinerAdapter jsria = new JSRInlinerAdapter(mv, access, base, desc, signature, exceptions); AllocationMethodAdapter aimv = new AllocationMethodAdapter(jsria, recorderClass, recorderMethod); LocalVariablesSorter lvs = new LocalVariablesSorter(access, desc, aimv); aimv.lvs = lvs; mv = lvs; } return mv; }
java
@Override public MethodVisitor visitMethod( int access, String base, String desc, String signature, String[] exceptions) { MethodVisitor mv = cv.visitMethod(access, base, desc, signature, exceptions); if (mv != null) { // We need to compute stackmaps (see // AllocationInstrumenter#instrument). This can't really be // done for old bytecode that contains JSR and RET instructions. // So, we remove JSRs and RETs. JSRInlinerAdapter jsria = new JSRInlinerAdapter(mv, access, base, desc, signature, exceptions); AllocationMethodAdapter aimv = new AllocationMethodAdapter(jsria, recorderClass, recorderMethod); LocalVariablesSorter lvs = new LocalVariablesSorter(access, desc, aimv); aimv.lvs = lvs; mv = lvs; } return mv; }
[ "@", "Override", "public", "MethodVisitor", "visitMethod", "(", "int", "access", ",", "String", "base", ",", "String", "desc", ",", "String", "signature", ",", "String", "[", "]", "exceptions", ")", "{", "MethodVisitor", "mv", "=", "cv", ".", "visitMethod", ...
For each method in the class being instrumented, <code>visitMethod</code> is called and the returned MethodVisitor is used to visit the method. Note that a new MethodVisitor is constructed for each method.
[ "For", "each", "method", "in", "the", "class", "being", "instrumented", "<code", ">", "visitMethod<", "/", "code", ">", "is", "called", "and", "the", "returned", "MethodVisitor", "is", "used", "to", "visit", "the", "method", ".", "Note", "that", "a", "new"...
train
https://github.com/google/allocation-instrumenter/blob/58d8473e8832e51f39ae7aa38328f61c4b747bff/src/main/java/com/google/monitoring/runtime/instrumentation/AllocationClassAdapter.java#L45-L64
Azure/azure-sdk-for-java
edgegateway/resource-manager/v2019_03_01/src/main/java/com/microsoft/azure/management/edgegateway/v2019_03_01/implementation/DevicesInner.java
DevicesInner.beginDownloadUpdates
public void beginDownloadUpdates(String deviceName, String resourceGroupName) { beginDownloadUpdatesWithServiceResponseAsync(deviceName, resourceGroupName).toBlocking().single().body(); }
java
public void beginDownloadUpdates(String deviceName, String resourceGroupName) { beginDownloadUpdatesWithServiceResponseAsync(deviceName, resourceGroupName).toBlocking().single().body(); }
[ "public", "void", "beginDownloadUpdates", "(", "String", "deviceName", ",", "String", "resourceGroupName", ")", "{", "beginDownloadUpdatesWithServiceResponseAsync", "(", "deviceName", ",", "resourceGroupName", ")", ".", "toBlocking", "(", ")", ".", "single", "(", ")",...
Downloads the updates on a data box edge/gateway device. @param deviceName The device name. @param resourceGroupName The resource group name. @throws IllegalArgumentException thrown if parameters fail the validation @throws CloudException thrown if the request is rejected by server @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent
[ "Downloads", "the", "updates", "on", "a", "data", "box", "edge", "/", "gateway", "device", "." ]
train
https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/edgegateway/resource-manager/v2019_03_01/src/main/java/com/microsoft/azure/management/edgegateway/v2019_03_01/implementation/DevicesInner.java#L1270-L1272
line/armeria
core/src/main/java/com/linecorp/armeria/internal/annotation/AnnotatedElementNameUtil.java
AnnotatedElementNameUtil.findName
static String findName(Header header, Object nameRetrievalTarget) { requireNonNull(nameRetrievalTarget, "nameRetrievalTarget"); final String value = header.value(); if (DefaultValues.isSpecified(value)) { checkArgument(!value.isEmpty(), "value is empty"); return value; } return toHeaderName(getName(nameRetrievalTarget)); }
java
static String findName(Header header, Object nameRetrievalTarget) { requireNonNull(nameRetrievalTarget, "nameRetrievalTarget"); final String value = header.value(); if (DefaultValues.isSpecified(value)) { checkArgument(!value.isEmpty(), "value is empty"); return value; } return toHeaderName(getName(nameRetrievalTarget)); }
[ "static", "String", "findName", "(", "Header", "header", ",", "Object", "nameRetrievalTarget", ")", "{", "requireNonNull", "(", "nameRetrievalTarget", ",", "\"nameRetrievalTarget\"", ")", ";", "final", "String", "value", "=", "header", ".", "value", "(", ")", ";...
Returns the value of the {@link Header} annotation which is specified on the {@code element} if the value is not blank. If the value is blank, it returns the name of the specified {@code nameRetrievalTarget} object which is an instance of {@link Parameter} or {@link Field}. <p>Note that the name of the specified {@code nameRetrievalTarget} will be converted as {@link CaseFormat#LOWER_HYPHEN} that the string elements are separated with one hyphen({@code -}) character. The value of the {@link Header} annotation will not be converted because it is clearly specified by a user.
[ "Returns", "the", "value", "of", "the", "{", "@link", "Header", "}", "annotation", "which", "is", "specified", "on", "the", "{", "@code", "element", "}", "if", "the", "value", "is", "not", "blank", ".", "If", "the", "value", "is", "blank", "it", "retur...
train
https://github.com/line/armeria/blob/67d29e019fd35a35f89c45cc8f9119ff9b12b44d/core/src/main/java/com/linecorp/armeria/internal/annotation/AnnotatedElementNameUtil.java#L60-L69
JakeWharton/NineOldAndroids
library/src/com/nineoldandroids/animation/ValueAnimator.java
ValueAnimator.ofObject
public static ValueAnimator ofObject(TypeEvaluator evaluator, Object... values) { ValueAnimator anim = new ValueAnimator(); anim.setObjectValues(values); anim.setEvaluator(evaluator); return anim; }
java
public static ValueAnimator ofObject(TypeEvaluator evaluator, Object... values) { ValueAnimator anim = new ValueAnimator(); anim.setObjectValues(values); anim.setEvaluator(evaluator); return anim; }
[ "public", "static", "ValueAnimator", "ofObject", "(", "TypeEvaluator", "evaluator", ",", "Object", "...", "values", ")", "{", "ValueAnimator", "anim", "=", "new", "ValueAnimator", "(", ")", ";", "anim", ".", "setObjectValues", "(", "values", ")", ";", "anim", ...
Constructs and returns a ValueAnimator that animates between Object values. A single value implies that that value is the one being animated to. However, this is not typically useful in a ValueAnimator object because there is no way for the object to determine the starting value for the animation (unlike ObjectAnimator, which can derive that value from the target object and property being animated). Therefore, there should typically be two or more values. <p>Since ValueAnimator does not know how to animate between arbitrary Objects, this factory method also takes a TypeEvaluator object that the ValueAnimator will use to perform that interpolation. @param evaluator A TypeEvaluator that will be called on each animation frame to provide the ncessry interpolation between the Object values to derive the animated value. @param values A set of values that the animation will animate between over time. @return A ValueAnimator object that is set up to animate between the given values.
[ "Constructs", "and", "returns", "a", "ValueAnimator", "that", "animates", "between", "Object", "values", ".", "A", "single", "value", "implies", "that", "that", "value", "is", "the", "one", "being", "animated", "to", ".", "However", "this", "is", "not", "typ...
train
https://github.com/JakeWharton/NineOldAndroids/blob/d582f0ec8e79013e9fa96c07986160b52e662e63/library/src/com/nineoldandroids/animation/ValueAnimator.java#L351-L356
box/box-java-sdk
src/main/java/com/box/sdk/BoxFolder.java
BoxFolder.deleteMetadata
public void deleteMetadata(String templateName, String scope) { URL url = METADATA_URL_TEMPLATE.build(this.getAPI().getBaseURL(), this.getID(), scope, templateName); BoxAPIRequest request = new BoxAPIRequest(this.getAPI(), url, "DELETE"); BoxAPIResponse response = request.send(); response.disconnect(); }
java
public void deleteMetadata(String templateName, String scope) { URL url = METADATA_URL_TEMPLATE.build(this.getAPI().getBaseURL(), this.getID(), scope, templateName); BoxAPIRequest request = new BoxAPIRequest(this.getAPI(), url, "DELETE"); BoxAPIResponse response = request.send(); response.disconnect(); }
[ "public", "void", "deleteMetadata", "(", "String", "templateName", ",", "String", "scope", ")", "{", "URL", "url", "=", "METADATA_URL_TEMPLATE", ".", "build", "(", "this", ".", "getAPI", "(", ")", ".", "getBaseURL", "(", ")", ",", "this", ".", "getID", "...
Deletes the metadata on this folder associated with a specified scope and template. @param templateName the metadata template type name. @param scope the scope of the template (usually "global" or "enterprise").
[ "Deletes", "the", "metadata", "on", "this", "folder", "associated", "with", "a", "specified", "scope", "and", "template", "." ]
train
https://github.com/box/box-java-sdk/blob/35b4ba69417f9d6a002c19dfaab57527750ef349/src/main/java/com/box/sdk/BoxFolder.java#L970-L975
looly/hutool
hutool-core/src/main/java/cn/hutool/core/date/DateUtil.java
DateUtil.round
public static DateTime round(Date date, DateField dateField) { return new DateTime(round(calendar(date), dateField)); }
java
public static DateTime round(Date date, DateField dateField) { return new DateTime(round(calendar(date), dateField)); }
[ "public", "static", "DateTime", "round", "(", "Date", "date", ",", "DateField", "dateField", ")", "{", "return", "new", "DateTime", "(", "round", "(", "calendar", "(", "date", ")", ",", "dateField", ")", ")", ";", "}" ]
修改日期为某个时间字段四舍五入时间 @param date {@link Date} @param dateField 时间字段 @return {@link DateTime} @since 4.5.7
[ "修改日期为某个时间字段四舍五入时间" ]
train
https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-core/src/main/java/cn/hutool/core/date/DateUtil.java#L779-L781
Azure/azure-sdk-for-java
cognitiveservices/data-plane/language/luis/authoring/src/main/java/com/microsoft/azure/cognitiveservices/language/luis/authoring/implementation/ModelsImpl.java
ModelsImpl.createCustomPrebuiltEntityRoleAsync
public Observable<UUID> createCustomPrebuiltEntityRoleAsync(UUID appId, String versionId, UUID entityId, CreateCustomPrebuiltEntityRoleOptionalParameter createCustomPrebuiltEntityRoleOptionalParameter) { return createCustomPrebuiltEntityRoleWithServiceResponseAsync(appId, versionId, entityId, createCustomPrebuiltEntityRoleOptionalParameter).map(new Func1<ServiceResponse<UUID>, UUID>() { @Override public UUID call(ServiceResponse<UUID> response) { return response.body(); } }); }
java
public Observable<UUID> createCustomPrebuiltEntityRoleAsync(UUID appId, String versionId, UUID entityId, CreateCustomPrebuiltEntityRoleOptionalParameter createCustomPrebuiltEntityRoleOptionalParameter) { return createCustomPrebuiltEntityRoleWithServiceResponseAsync(appId, versionId, entityId, createCustomPrebuiltEntityRoleOptionalParameter).map(new Func1<ServiceResponse<UUID>, UUID>() { @Override public UUID call(ServiceResponse<UUID> response) { return response.body(); } }); }
[ "public", "Observable", "<", "UUID", ">", "createCustomPrebuiltEntityRoleAsync", "(", "UUID", "appId", ",", "String", "versionId", ",", "UUID", "entityId", ",", "CreateCustomPrebuiltEntityRoleOptionalParameter", "createCustomPrebuiltEntityRoleOptionalParameter", ")", "{", "re...
Create an entity role for an entity in the application. @param appId The application ID. @param versionId The version ID. @param entityId The entity model ID. @param createCustomPrebuiltEntityRoleOptionalParameter the object representing the optional parameters to be set before calling this API @throws IllegalArgumentException thrown if parameters fail the validation @return the observable to the UUID object
[ "Create", "an", "entity", "role", "for", "an", "entity", "in", "the", "application", "." ]
train
https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/cognitiveservices/data-plane/language/luis/authoring/src/main/java/com/microsoft/azure/cognitiveservices/language/luis/authoring/implementation/ModelsImpl.java#L9741-L9748
docusign/docusign-java-client
src/main/java/com/docusign/esign/client/ApiClient.java
ApiClient.getAuthorizationUri
public URI getAuthorizationUri(String clientId, java.util.List<String> scopes, String redirectUri, String responseType) throws IllegalArgumentException, UriBuilderException { return this.getAuthorizationUri(clientId, scopes, redirectUri, responseType, null); }
java
public URI getAuthorizationUri(String clientId, java.util.List<String> scopes, String redirectUri, String responseType) throws IllegalArgumentException, UriBuilderException { return this.getAuthorizationUri(clientId, scopes, redirectUri, responseType, null); }
[ "public", "URI", "getAuthorizationUri", "(", "String", "clientId", ",", "java", ".", "util", ".", "List", "<", "String", ">", "scopes", ",", "String", "redirectUri", ",", "String", "responseType", ")", "throws", "IllegalArgumentException", ",", "UriBuilderExceptio...
Helper method to configure the OAuth accessCode/implicit flow parameters @param clientId OAuth2 client ID: Identifies the client making the request. Client applications may be scoped to a limited set of system access. @param scopes the list of requested scopes. Values include {@link OAuth#Scope_SIGNATURE}, {@link OAuth#Scope_EXTENDED}, {@link OAuth#Scope_IMPERSONATION}. You can also pass any advanced scope. @param redirectUri this determines where to deliver the response containing the authorization code or access token. @param responseType determines the response type of the authorization request. <br><i>Note</i>: these response types are mutually exclusive for a client application. A public/native client application may only request a response type of "token"; a private/trusted client application may only request a response type of "code".
[ "Helper", "method", "to", "configure", "the", "OAuth", "accessCode", "/", "implicit", "flow", "parameters" ]
train
https://github.com/docusign/docusign-java-client/blob/17ae82ace0f023e98edf813be832950568212e34/src/main/java/com/docusign/esign/client/ApiClient.java#L512-L514
Azure/azure-sdk-for-java
batch/data-plane/src/main/java/com/microsoft/azure/batch/protocol/implementation/JobsImpl.java
JobsImpl.listPreparationAndReleaseTaskStatusAsync
public Observable<Page<JobPreparationAndReleaseTaskExecutionInformation>> listPreparationAndReleaseTaskStatusAsync(final String jobId, final JobListPreparationAndReleaseTaskStatusOptions jobListPreparationAndReleaseTaskStatusOptions) { return listPreparationAndReleaseTaskStatusWithServiceResponseAsync(jobId, jobListPreparationAndReleaseTaskStatusOptions) .map(new Func1<ServiceResponseWithHeaders<Page<JobPreparationAndReleaseTaskExecutionInformation>, JobListPreparationAndReleaseTaskStatusHeaders>, Page<JobPreparationAndReleaseTaskExecutionInformation>>() { @Override public Page<JobPreparationAndReleaseTaskExecutionInformation> call(ServiceResponseWithHeaders<Page<JobPreparationAndReleaseTaskExecutionInformation>, JobListPreparationAndReleaseTaskStatusHeaders> response) { return response.body(); } }); }
java
public Observable<Page<JobPreparationAndReleaseTaskExecutionInformation>> listPreparationAndReleaseTaskStatusAsync(final String jobId, final JobListPreparationAndReleaseTaskStatusOptions jobListPreparationAndReleaseTaskStatusOptions) { return listPreparationAndReleaseTaskStatusWithServiceResponseAsync(jobId, jobListPreparationAndReleaseTaskStatusOptions) .map(new Func1<ServiceResponseWithHeaders<Page<JobPreparationAndReleaseTaskExecutionInformation>, JobListPreparationAndReleaseTaskStatusHeaders>, Page<JobPreparationAndReleaseTaskExecutionInformation>>() { @Override public Page<JobPreparationAndReleaseTaskExecutionInformation> call(ServiceResponseWithHeaders<Page<JobPreparationAndReleaseTaskExecutionInformation>, JobListPreparationAndReleaseTaskStatusHeaders> response) { return response.body(); } }); }
[ "public", "Observable", "<", "Page", "<", "JobPreparationAndReleaseTaskExecutionInformation", ">", ">", "listPreparationAndReleaseTaskStatusAsync", "(", "final", "String", "jobId", ",", "final", "JobListPreparationAndReleaseTaskStatusOptions", "jobListPreparationAndReleaseTaskStatusO...
Lists the execution status of the Job Preparation and Job Release task for the specified job across the compute nodes where the job has run. This API returns the Job Preparation and Job Release task status on all compute nodes that have run the Job Preparation or Job Release task. This includes nodes which have since been removed from the pool. If this API is invoked on a job which has no Job Preparation or Job Release task, the Batch service returns HTTP status code 409 (Conflict) with an error code of JobPreparationTaskNotSpecified. @param jobId The ID of the job. @param jobListPreparationAndReleaseTaskStatusOptions Additional parameters for the operation @throws IllegalArgumentException thrown if parameters fail the validation @return the observable to the PagedList&lt;JobPreparationAndReleaseTaskExecutionInformation&gt; object
[ "Lists", "the", "execution", "status", "of", "the", "Job", "Preparation", "and", "Job", "Release", "task", "for", "the", "specified", "job", "across", "the", "compute", "nodes", "where", "the", "job", "has", "run", ".", "This", "API", "returns", "the", "Jo...
train
https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/batch/data-plane/src/main/java/com/microsoft/azure/batch/protocol/implementation/JobsImpl.java#L2996-L3004
QSFT/Doradus
doradus-server/src/main/java/com/dell/doradus/service/schema/SchemaService.java
SchemaService.defineApplication
public void defineApplication(Tenant tenant, ApplicationDefinition appDef) { checkServiceState(); appDef.setTenantName(tenant.getName()); ApplicationDefinition currAppDef = checkApplicationKey(appDef); StorageService storageService = verifyStorageServiceOption(currAppDef, appDef); storageService.validateSchema(appDef); initializeApplication(currAppDef, appDef); }
java
public void defineApplication(Tenant tenant, ApplicationDefinition appDef) { checkServiceState(); appDef.setTenantName(tenant.getName()); ApplicationDefinition currAppDef = checkApplicationKey(appDef); StorageService storageService = verifyStorageServiceOption(currAppDef, appDef); storageService.validateSchema(appDef); initializeApplication(currAppDef, appDef); }
[ "public", "void", "defineApplication", "(", "Tenant", "tenant", ",", "ApplicationDefinition", "appDef", ")", "{", "checkServiceState", "(", ")", ";", "appDef", ".", "setTenantName", "(", "tenant", ".", "getName", "(", ")", ")", ";", "ApplicationDefinition", "cur...
Create the application with the given name in the given Tenant. If the given application already exists, the request is treated as an application update. If the update is successfully validated, its schema is stored in the database, and the appropriate storage service is notified to implement required physical database changes, if any. @param tenant {@link Tenant} in which application is being created or updated. @param appDef {@link ApplicationDefinition} of application to create or update. Note that appDef is updated with the "Tenant" option.
[ "Create", "the", "application", "with", "the", "given", "name", "in", "the", "given", "Tenant", ".", "If", "the", "given", "application", "already", "exists", "the", "request", "is", "treated", "as", "an", "application", "update", ".", "If", "the", "update",...
train
https://github.com/QSFT/Doradus/blob/ad64d3c37922eefda68ec8869ef089c1ca604b70/doradus-server/src/main/java/com/dell/doradus/service/schema/SchemaService.java#L134-L141
bbossgroups/bboss-elasticsearch
bboss-elasticsearch-rest/src/main/java/org/frameworkset/elasticsearch/client/RestClientUtil.java
RestClientUtil.searchAllParallel
public <T> ESDatas<T> searchAllParallel(String index,ScrollHandler<T> scrollHandler, Class<T> type,int thread) throws ElasticSearchException{ return searchAllParallel(index, DEFAULT_FETCHSIZE,scrollHandler,type,thread); }
java
public <T> ESDatas<T> searchAllParallel(String index,ScrollHandler<T> scrollHandler, Class<T> type,int thread) throws ElasticSearchException{ return searchAllParallel(index, DEFAULT_FETCHSIZE,scrollHandler,type,thread); }
[ "public", "<", "T", ">", "ESDatas", "<", "T", ">", "searchAllParallel", "(", "String", "index", ",", "ScrollHandler", "<", "T", ">", "scrollHandler", ",", "Class", "<", "T", ">", "type", ",", "int", "thread", ")", "throws", "ElasticSearchException", "{", ...
并行检索索引所有数据,每批次返回默认为5000条数据, @param index @param scrollHandler 每批数据处理方法 @param type @param <T> @return @throws ElasticSearchException
[ "并行检索索引所有数据", "每批次返回默认为5000条数据," ]
train
https://github.com/bbossgroups/bboss-elasticsearch/blob/31717c8aa2c4c880987be53aeeb8a0cf5183c3a7/bboss-elasticsearch-rest/src/main/java/org/frameworkset/elasticsearch/client/RestClientUtil.java#L1840-L1842
authlete/authlete-java-common
src/main/java/com/authlete/common/dto/AuthorizationIssueRequest.java
AuthorizationIssueRequest.setClaims
public AuthorizationIssueRequest setClaims(Map<String, Object> claims) { if (claims == null || claims.size() == 0) { this.claims = null; return this; } String json = Utils.toJson(claims); return setClaims(json); }
java
public AuthorizationIssueRequest setClaims(Map<String, Object> claims) { if (claims == null || claims.size() == 0) { this.claims = null; return this; } String json = Utils.toJson(claims); return setClaims(json); }
[ "public", "AuthorizationIssueRequest", "setClaims", "(", "Map", "<", "String", ",", "Object", ">", "claims", ")", "{", "if", "(", "claims", "==", "null", "||", "claims", ".", "size", "(", ")", "==", "0", ")", "{", "this", ".", "claims", "=", "null", ...
Set the value of {@code "claims"} which is the claims of the subject. The argument is converted into a JSON string and passed to {@link #setClaims(String)} method. @param claims The claims of the subject. Keys are claim names. @return {@code this} object. @since 1.24
[ "Set", "the", "value", "of", "{", "@code", "claims", "}", "which", "is", "the", "claims", "of", "the", "subject", ".", "The", "argument", "is", "converted", "into", "a", "JSON", "string", "and", "passed", "to", "{", "@link", "#setClaims", "(", "String", ...
train
https://github.com/authlete/authlete-java-common/blob/49c94c483713cbf5a04d805ff7dbd83766c9c964/src/main/java/com/authlete/common/dto/AuthorizationIssueRequest.java#L517-L528
sirthias/parboiled
parboiled-core/src/main/java/org/parboiled/trees/GraphUtils.java
GraphUtils.printTree
public static <T extends GraphNode<T>> String printTree(T node, Formatter<T> formatter) { checkArgNotNull(formatter, "formatter"); return printTree(node, formatter, Predicates.<T>alwaysTrue(), Predicates.<T>alwaysTrue()); }
java
public static <T extends GraphNode<T>> String printTree(T node, Formatter<T> formatter) { checkArgNotNull(formatter, "formatter"); return printTree(node, formatter, Predicates.<T>alwaysTrue(), Predicates.<T>alwaysTrue()); }
[ "public", "static", "<", "T", "extends", "GraphNode", "<", "T", ">", ">", "String", "printTree", "(", "T", "node", ",", "Formatter", "<", "T", ">", "formatter", ")", "{", "checkArgNotNull", "(", "formatter", ",", "\"formatter\"", ")", ";", "return", "pri...
Creates a string representation of the graph reachable from the given node using the given formatter. @param node the root node @param formatter the node formatter @return a new string
[ "Creates", "a", "string", "representation", "of", "the", "graph", "reachable", "from", "the", "given", "node", "using", "the", "given", "formatter", "." ]
train
https://github.com/sirthias/parboiled/blob/84f3ed43e3e171b4c6ab5e6ca6297d264a9d686a/parboiled-core/src/main/java/org/parboiled/trees/GraphUtils.java#L104-L107
exoplatform/jcr
exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/dataflow/persistent/CacheableWorkspaceDataManager.java
CacheableWorkspaceDataManager.initACL
private ItemData initACL(NodeData parent, NodeData node) throws RepositoryException { return initACL(parent, node, null); }
java
private ItemData initACL(NodeData parent, NodeData node) throws RepositoryException { return initACL(parent, node, null); }
[ "private", "ItemData", "initACL", "(", "NodeData", "parent", ",", "NodeData", "node", ")", "throws", "RepositoryException", "{", "return", "initACL", "(", "parent", ",", "node", ",", "null", ")", ";", "}" ]
Init ACL of the node. @param parent - a parent, can be null (get item by id) @param node - an item data @return - an item data with ACL was initialized @throws RepositoryException
[ "Init", "ACL", "of", "the", "node", "." ]
train
https://github.com/exoplatform/jcr/blob/3e7f9ee1b5683640d73a4316fb4b0ad5eac5b8a2/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/dataflow/persistent/CacheableWorkspaceDataManager.java#L2375-L2378
SpartaTech/sparta-spring-web-utils
src/main/java/org/sparta/springwebutils/util/ExternalEntryPointHelper.java
ExternalEntryPointHelper.isAnEntryPoint
public static boolean isAnEntryPoint(Method method, boolean scanEntryPointAnnotation) { return !scanEntryPointAnnotation || scanEntryPointAnnotation && method.isAnnotationPresent(ExternalEntryPoint.class) || scanEntryPointAnnotation && method.getDeclaringClass().isAnnotationPresent(ExternalEntryPoint.class); }
java
public static boolean isAnEntryPoint(Method method, boolean scanEntryPointAnnotation) { return !scanEntryPointAnnotation || scanEntryPointAnnotation && method.isAnnotationPresent(ExternalEntryPoint.class) || scanEntryPointAnnotation && method.getDeclaringClass().isAnnotationPresent(ExternalEntryPoint.class); }
[ "public", "static", "boolean", "isAnEntryPoint", "(", "Method", "method", ",", "boolean", "scanEntryPointAnnotation", ")", "{", "return", "!", "scanEntryPointAnnotation", "||", "scanEntryPointAnnotation", "&&", "method", ".", "isAnnotationPresent", "(", "ExternalEntryPoin...
Returns whether the supplied method is an Entry Point or not. It might be annotated by @ExternalEntryPoint @param method Method to be scanned @param scanEntryPointAnnotation Does it has annotation @return boolean
[ "Returns", "whether", "the", "supplied", "method", "is", "an", "Entry", "Point", "or", "not", ".", "It", "might", "be", "annotated", "by", "@ExternalEntryPoint" ]
train
https://github.com/SpartaTech/sparta-spring-web-utils/blob/f5382474d46a6048d58707fc64e7936277e8b2ce/src/main/java/org/sparta/springwebutils/util/ExternalEntryPointHelper.java#L38-L42
kenyee/android-ddp-client
src/com/keysolutions/ddpclient/android/DDPStateSingleton.java
DDPStateSingleton.removeDoc
public boolean removeDoc(String collName, String docId) { if (mCollections.containsKey(collName)) { // remove IDs from collection Map<String, Map<String,Object>> collection = mCollections.get(collName); if (BuildConfig.DEBUG) { log.debug("Removed doc: " + docId); } collection.remove(docId); return true; } else { log.warn("Received invalid removed msg for collection " + collName); return false; } }
java
public boolean removeDoc(String collName, String docId) { if (mCollections.containsKey(collName)) { // remove IDs from collection Map<String, Map<String,Object>> collection = mCollections.get(collName); if (BuildConfig.DEBUG) { log.debug("Removed doc: " + docId); } collection.remove(docId); return true; } else { log.warn("Received invalid removed msg for collection " + collName); return false; } }
[ "public", "boolean", "removeDoc", "(", "String", "collName", ",", "String", "docId", ")", "{", "if", "(", "mCollections", ".", "containsKey", "(", "collName", ")", ")", "{", "// remove IDs from collection", "Map", "<", "String", ",", "Map", "<", "String", ",...
Handles deleting a document in a collection. Override if you want to use your own collection data store. @param collName collection name @param docId document ID @return true if doc was deleted, false otherwise
[ "Handles", "deleting", "a", "document", "in", "a", "collection", ".", "Override", "if", "you", "want", "to", "use", "your", "own", "collection", "data", "store", "." ]
train
https://github.com/kenyee/android-ddp-client/blob/6ab416e415570a03f96c383497144dd742de3f08/src/com/keysolutions/ddpclient/android/DDPStateSingleton.java#L731-L745
looly/hulu
src/main/java/com/xiaoleilu/hulu/Request.java
Request.convertGetMethodParamValue
private static String convertGetMethodParamValue(String value, String charsetOfServlet) { if (isGetMethod()) { if (null == charsetOfServlet) { charsetOfServlet = CharsetUtil.ISO_8859_1; } String destCharset = CharsetUtil.UTF_8; if (isIE()) { // IE浏览器GET请求使用GBK编码 destCharset = CharsetUtil.GBK; } value = CharsetUtil.convert(value, charsetOfServlet, destCharset); } return value; }
java
private static String convertGetMethodParamValue(String value, String charsetOfServlet) { if (isGetMethod()) { if (null == charsetOfServlet) { charsetOfServlet = CharsetUtil.ISO_8859_1; } String destCharset = CharsetUtil.UTF_8; if (isIE()) { // IE浏览器GET请求使用GBK编码 destCharset = CharsetUtil.GBK; } value = CharsetUtil.convert(value, charsetOfServlet, destCharset); } return value; }
[ "private", "static", "String", "convertGetMethodParamValue", "(", "String", "value", ",", "String", "charsetOfServlet", ")", "{", "if", "(", "isGetMethod", "(", ")", ")", "{", "if", "(", "null", "==", "charsetOfServlet", ")", "{", "charsetOfServlet", "=", "Cha...
转换值得编码 会根据浏览器类型自动识别GET请求的编码方式从而解码<br> 考虑到Servlet容器中会首先解码,给定的charsetOfServlet就是Servlet设置的解码charset<br> charsetOfServlet为null则默认的ISO_8859_1 @param value 值 @param charsetOfServlet Servlet的编码 @return 转换后的字符串
[ "转换值得编码", "会根据浏览器类型自动识别GET请求的编码方式从而解码<br", ">", "考虑到Servlet容器中会首先解码,给定的charsetOfServlet就是Servlet设置的解码charset<br", ">", "charsetOfServlet为null则默认的ISO_8859_1" ]
train
https://github.com/looly/hulu/blob/4072de684e2e2f28ac8a3a44c0d5a690b289ef28/src/main/java/com/xiaoleilu/hulu/Request.java#L614-L629
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/SyncMembersInner.java
SyncMembersInner.beginUpdate
public SyncMemberInner beginUpdate(String resourceGroupName, String serverName, String databaseName, String syncGroupName, String syncMemberName, SyncMemberInner parameters) { return beginUpdateWithServiceResponseAsync(resourceGroupName, serverName, databaseName, syncGroupName, syncMemberName, parameters).toBlocking().single().body(); }
java
public SyncMemberInner beginUpdate(String resourceGroupName, String serverName, String databaseName, String syncGroupName, String syncMemberName, SyncMemberInner parameters) { return beginUpdateWithServiceResponseAsync(resourceGroupName, serverName, databaseName, syncGroupName, syncMemberName, parameters).toBlocking().single().body(); }
[ "public", "SyncMemberInner", "beginUpdate", "(", "String", "resourceGroupName", ",", "String", "serverName", ",", "String", "databaseName", ",", "String", "syncGroupName", ",", "String", "syncMemberName", ",", "SyncMemberInner", "parameters", ")", "{", "return", "begi...
Updates an existing sync member. @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. @param syncGroupName The name of the sync group on which the sync member is hosted. @param syncMemberName The name of the sync member. @param parameters The requested sync member resource state. @throws IllegalArgumentException thrown if parameters fail the validation @throws CloudException thrown if the request is rejected by server @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent @return the SyncMemberInner object if successful.
[ "Updates", "an", "existing", "sync", "member", "." ]
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/SyncMembersInner.java#L751-L753
twitter/hraven
hraven-etl/src/main/java/com/twitter/hraven/etl/FileLister.java
FileLister.traverseDirs
private static void traverseDirs(List<FileStatus> fileStatusesList, FileSystem hdfs, Path inputPath, JobFileModifiedRangePathFilter jobFileModifiedRangePathFilter) throws IOException { // get all the files and dirs in the current dir FileStatus allFiles[] = hdfs.listStatus(inputPath); for (FileStatus aFile: allFiles) { if (aFile.isDir()) { //recurse here traverseDirs(fileStatusesList, hdfs, aFile.getPath(), jobFileModifiedRangePathFilter); } else { // check if the pathFilter is accepted for this file if (jobFileModifiedRangePathFilter.accept(aFile.getPath())) { fileStatusesList.add(aFile); } } } }
java
private static void traverseDirs(List<FileStatus> fileStatusesList, FileSystem hdfs, Path inputPath, JobFileModifiedRangePathFilter jobFileModifiedRangePathFilter) throws IOException { // get all the files and dirs in the current dir FileStatus allFiles[] = hdfs.listStatus(inputPath); for (FileStatus aFile: allFiles) { if (aFile.isDir()) { //recurse here traverseDirs(fileStatusesList, hdfs, aFile.getPath(), jobFileModifiedRangePathFilter); } else { // check if the pathFilter is accepted for this file if (jobFileModifiedRangePathFilter.accept(aFile.getPath())) { fileStatusesList.add(aFile); } } } }
[ "private", "static", "void", "traverseDirs", "(", "List", "<", "FileStatus", ">", "fileStatusesList", ",", "FileSystem", "hdfs", ",", "Path", "inputPath", ",", "JobFileModifiedRangePathFilter", "jobFileModifiedRangePathFilter", ")", "throws", "IOException", "{", "// get...
Recursively traverses the dirs to get the list of files for a given path filtered as per the input path range filter
[ "Recursively", "traverses", "the", "dirs", "to", "get", "the", "list", "of", "files", "for", "a", "given", "path", "filtered", "as", "per", "the", "input", "path", "range", "filter" ]
train
https://github.com/twitter/hraven/blob/e35996b6e2f016bcd18db0bad320be7c93d95208/hraven-etl/src/main/java/com/twitter/hraven/etl/FileLister.java#L53-L71
Bernardo-MG/repository-pattern-java
src/main/java/com/wandrell/pattern/repository/jpa/JpaRepository.java
JpaRepository.getEntity
@SuppressWarnings("unchecked") @Override public final V getEntity(final NamedParameterQueryData query) { final Query builtQuery; // Query created from the query data V entity; // Entity acquired from the query checkNotNull(query, "Received a null pointer as the query"); // Builds the query builtQuery = buildQuery(query); // Tries to acquire the entity try { entity = (V) builtQuery.getSingleResult(); } catch (final NoResultException exception) { entity = null; } return entity; }
java
@SuppressWarnings("unchecked") @Override public final V getEntity(final NamedParameterQueryData query) { final Query builtQuery; // Query created from the query data V entity; // Entity acquired from the query checkNotNull(query, "Received a null pointer as the query"); // Builds the query builtQuery = buildQuery(query); // Tries to acquire the entity try { entity = (V) builtQuery.getSingleResult(); } catch (final NoResultException exception) { entity = null; } return entity; }
[ "@", "SuppressWarnings", "(", "\"unchecked\"", ")", "@", "Override", "public", "final", "V", "getEntity", "(", "final", "NamedParameterQueryData", "query", ")", "{", "final", "Query", "builtQuery", ";", "// Query created from the query data", "V", "entity", ";", "//...
Queries the entities in the repository and returns a single one. <p> The entity is acquired by building a query from the received {@code QueryData} and executing it. @param query the query user to acquire the entities @return the queried entity
[ "Queries", "the", "entities", "in", "the", "repository", "and", "returns", "a", "single", "one", ".", "<p", ">", "The", "entity", "is", "acquired", "by", "building", "a", "query", "from", "the", "received", "{", "@code", "QueryData", "}", "and", "executing...
train
https://github.com/Bernardo-MG/repository-pattern-java/blob/e94d5bbf9aeeb45acc8485f3686a6e791b082ea8/src/main/java/com/wandrell/pattern/repository/jpa/JpaRepository.java#L248-L267
google/closure-compiler
src/com/google/javascript/jscomp/Es6ConvertSuperConstructorCalls.java
Es6ConvertSuperConstructorCalls.isDefinedInSources
private boolean isDefinedInSources(NodeTraversal t, String varName) { Var objectVar = t.getScope().getVar(varName); return objectVar != null && !objectVar.isExtern(); }
java
private boolean isDefinedInSources(NodeTraversal t, String varName) { Var objectVar = t.getScope().getVar(varName); return objectVar != null && !objectVar.isExtern(); }
[ "private", "boolean", "isDefinedInSources", "(", "NodeTraversal", "t", ",", "String", "varName", ")", "{", "Var", "objectVar", "=", "t", ".", "getScope", "(", ")", ".", "getVar", "(", "varName", ")", ";", "return", "objectVar", "!=", "null", "&&", "!", "...
Is a variable with the given name defined in the source code being compiled? <p>Please note that the call to {@code t.getScope()} is expensive, so we should avoid calling this method when possible. @param t @param varName
[ "Is", "a", "variable", "with", "the", "given", "name", "defined", "in", "the", "source", "code", "being", "compiled?" ]
train
https://github.com/google/closure-compiler/blob/d81e36740f6a9e8ac31a825ee8758182e1dc5aae/src/com/google/javascript/jscomp/Es6ConvertSuperConstructorCalls.java#L484-L487
ManfredTremmel/gwt-commons-lang3
src/main/java/org/apache/commons/lang3/reflect/TypeUtils.java
TypeUtils.typesSatisfyVariables
public static boolean typesSatisfyVariables(final Map<TypeVariable<?>, Type> typeVarAssigns) { Validate.notNull(typeVarAssigns, "typeVarAssigns is null"); // all types must be assignable to all the bounds of the their mapped // type variable. for (final Map.Entry<TypeVariable<?>, Type> entry : typeVarAssigns.entrySet()) { final TypeVariable<?> typeVar = entry.getKey(); final Type type = entry.getValue(); for (final Type bound : getImplicitBounds(typeVar)) { if (!isAssignable(type, substituteTypeVariables(bound, typeVarAssigns), typeVarAssigns)) { return false; } } } return true; }
java
public static boolean typesSatisfyVariables(final Map<TypeVariable<?>, Type> typeVarAssigns) { Validate.notNull(typeVarAssigns, "typeVarAssigns is null"); // all types must be assignable to all the bounds of the their mapped // type variable. for (final Map.Entry<TypeVariable<?>, Type> entry : typeVarAssigns.entrySet()) { final TypeVariable<?> typeVar = entry.getKey(); final Type type = entry.getValue(); for (final Type bound : getImplicitBounds(typeVar)) { if (!isAssignable(type, substituteTypeVariables(bound, typeVarAssigns), typeVarAssigns)) { return false; } } } return true; }
[ "public", "static", "boolean", "typesSatisfyVariables", "(", "final", "Map", "<", "TypeVariable", "<", "?", ">", ",", "Type", ">", "typeVarAssigns", ")", "{", "Validate", ".", "notNull", "(", "typeVarAssigns", ",", "\"typeVarAssigns is null\"", ")", ";", "// all...
<p>Determines whether or not specified types satisfy the bounds of their mapped type variables. When a type parameter extends another (such as {@code <T, S extends T>}), uses another as a type parameter (such as {@code <T, S extends Comparable>>}), or otherwise depends on another type variable to be specified, the dependencies must be included in {@code typeVarAssigns}.</p> @param typeVarAssigns specifies the potential types to be assigned to the type variables, not {@code null}. @return whether or not the types can be assigned to their respective type variables.
[ "<p", ">", "Determines", "whether", "or", "not", "specified", "types", "satisfy", "the", "bounds", "of", "their", "mapped", "type", "variables", ".", "When", "a", "type", "parameter", "extends", "another", "(", "such", "as", "{", "@code", "<T", "S", "exten...
train
https://github.com/ManfredTremmel/gwt-commons-lang3/blob/9e2dfbbda3668cfa5d935fe76479d1426c294504/src/main/java/org/apache/commons/lang3/reflect/TypeUtils.java#L1220-L1236
UrielCh/ovh-java-sdk
ovh-java-sdk-ip/src/main/java/net/minidev/ovh/api/ApiOvhIp.java
ApiOvhIp.ip_phishing_id_GET
public OvhAntiphishing ip_phishing_id_GET(String ip, Long id) throws IOException { String qPath = "/ip/{ip}/phishing/{id}"; StringBuilder sb = path(qPath, ip, id); String resp = exec(qPath, "GET", sb.toString(), null); return convertTo(resp, OvhAntiphishing.class); }
java
public OvhAntiphishing ip_phishing_id_GET(String ip, Long id) throws IOException { String qPath = "/ip/{ip}/phishing/{id}"; StringBuilder sb = path(qPath, ip, id); String resp = exec(qPath, "GET", sb.toString(), null); return convertTo(resp, OvhAntiphishing.class); }
[ "public", "OvhAntiphishing", "ip_phishing_id_GET", "(", "String", "ip", ",", "Long", "id", ")", "throws", "IOException", "{", "String", "qPath", "=", "\"/ip/{ip}/phishing/{id}\"", ";", "StringBuilder", "sb", "=", "path", "(", "qPath", ",", "ip", ",", "id", ")"...
Get this object properties REST: GET /ip/{ip}/phishing/{id} @param ip [required] @param id [required] Internal ID of the phishing entry
[ "Get", "this", "object", "properties" ]
train
https://github.com/UrielCh/ovh-java-sdk/blob/6d531a40e56e09701943e334c25f90f640c55701/ovh-java-sdk-ip/src/main/java/net/minidev/ovh/api/ApiOvhIp.java#L98-L103
Carbonado/Carbonado
src/main/java/com/amazon/carbonado/qe/JoinedQueryExecutor.java
JoinedQueryExecutor.commonOrderingCount
private static <T extends Storable> int commonOrderingCount(OrderingList<T> orderingA, OrderingList<T> orderingB) { int commonCount = Math.min(orderingA.size(), orderingB.size()); for (int i=0; i<commonCount; i++) { if (!orderingA.get(i).equals(orderingB.get(i))) { return i; } } return commonCount; }
java
private static <T extends Storable> int commonOrderingCount(OrderingList<T> orderingA, OrderingList<T> orderingB) { int commonCount = Math.min(orderingA.size(), orderingB.size()); for (int i=0; i<commonCount; i++) { if (!orderingA.get(i).equals(orderingB.get(i))) { return i; } } return commonCount; }
[ "private", "static", "<", "T", "extends", "Storable", ">", "int", "commonOrderingCount", "(", "OrderingList", "<", "T", ">", "orderingA", ",", "OrderingList", "<", "T", ">", "orderingB", ")", "{", "int", "commonCount", "=", "Math", ".", "min", "(", "orderi...
Returns the count of exactly matching properties from the two orderings. The match must be consecutive and start at the first property.
[ "Returns", "the", "count", "of", "exactly", "matching", "properties", "from", "the", "two", "orderings", ".", "The", "match", "must", "be", "consecutive", "and", "start", "at", "the", "first", "property", "." ]
train
https://github.com/Carbonado/Carbonado/blob/eee29b365a61c8f03e1a1dc6bed0692e6b04b1db/src/main/java/com/amazon/carbonado/qe/JoinedQueryExecutor.java#L445-L457
hazelcast/hazelcast
hazelcast/src/main/java/com/hazelcast/mapreduce/aggregation/Aggregations.java
Aggregations.longAvg
public static <Key, Value> Aggregation<Key, Long, Long> longAvg() { return new AggregationAdapter(new LongAvgAggregation<Key, Value>()); }
java
public static <Key, Value> Aggregation<Key, Long, Long> longAvg() { return new AggregationAdapter(new LongAvgAggregation<Key, Value>()); }
[ "public", "static", "<", "Key", ",", "Value", ">", "Aggregation", "<", "Key", ",", "Long", ",", "Long", ">", "longAvg", "(", ")", "{", "return", "new", "AggregationAdapter", "(", "new", "LongAvgAggregation", "<", "Key", ",", "Value", ">", "(", ")", ")"...
Returns an aggregation to calculate the long average of all supplied values.<br/> This aggregation is similar to: <pre>SELECT AVG(value) FROM x</pre> @param <Key> the input key type @param <Value> the supplied value type @return the average over all supplied values
[ "Returns", "an", "aggregation", "to", "calculate", "the", "long", "average", "of", "all", "supplied", "values", ".", "<br", "/", ">", "This", "aggregation", "is", "similar", "to", ":", "<pre", ">", "SELECT", "AVG", "(", "value", ")", "FROM", "x<", "/", ...
train
https://github.com/hazelcast/hazelcast/blob/8c4bc10515dbbfb41a33e0302c0caedf3cda1baf/hazelcast/src/main/java/com/hazelcast/mapreduce/aggregation/Aggregations.java#L150-L152
teatrove/teatrove
trove/src/main/java/org/teatrove/trove/io/LinePositionReader.java
LinePositionReader.createSequence
public static String createSequence(char c, int length) { if (length < 0) length = 1; StringBuffer buf = new StringBuffer(length); for (; length > 0; length--) { buf.append(c); } return buf.toString(); }
java
public static String createSequence(char c, int length) { if (length < 0) length = 1; StringBuffer buf = new StringBuffer(length); for (; length > 0; length--) { buf.append(c); } return buf.toString(); }
[ "public", "static", "String", "createSequence", "(", "char", "c", ",", "int", "length", ")", "{", "if", "(", "length", "<", "0", ")", "length", "=", "1", ";", "StringBuffer", "buf", "=", "new", "StringBuffer", "(", "length", ")", ";", "for", "(", ";"...
Creates and returns a String containing a sequence of the specified length, repeating the given character.
[ "Creates", "and", "returns", "a", "String", "containing", "a", "sequence", "of", "the", "specified", "length", "repeating", "the", "given", "character", "." ]
train
https://github.com/teatrove/teatrove/blob/7039bdd4da6817ff8c737f7e4e07bac7e3ad8bea/trove/src/main/java/org/teatrove/trove/io/LinePositionReader.java#L118-L126
joniles/mpxj
src/main/java/net/sf/mpxj/primavera/UserFieldCounters.java
UserFieldCounters.nextField
public <E extends Enum<E> & FieldType> E nextField(Class<E> clazz, UserFieldDataType type) { for (String name : m_names[type.ordinal()]) { int i = NumberHelper.getInt(m_counters.get(name)) + 1; try { E e = Enum.valueOf(clazz, name + i); m_counters.put(name, Integer.valueOf(i)); return e; } catch (IllegalArgumentException ex) { // try the next name } } // no more fields available throw new IllegalArgumentException("No fields for type " + type + " available"); }
java
public <E extends Enum<E> & FieldType> E nextField(Class<E> clazz, UserFieldDataType type) { for (String name : m_names[type.ordinal()]) { int i = NumberHelper.getInt(m_counters.get(name)) + 1; try { E e = Enum.valueOf(clazz, name + i); m_counters.put(name, Integer.valueOf(i)); return e; } catch (IllegalArgumentException ex) { // try the next name } } // no more fields available throw new IllegalArgumentException("No fields for type " + type + " available"); }
[ "public", "<", "E", "extends", "Enum", "<", "E", ">", "&", "FieldType", ">", "E", "nextField", "(", "Class", "<", "E", ">", "clazz", ",", "UserFieldDataType", "type", ")", "{", "for", "(", "String", "name", ":", "m_names", "[", "type", ".", "ordinal"...
Generate the next available field for a user defined field. @param <E> field type class @param clazz class of the desired field enum @param type user defined field type. @return field of specified type
[ "Generate", "the", "next", "available", "field", "for", "a", "user", "defined", "field", "." ]
train
https://github.com/joniles/mpxj/blob/143ea0e195da59cd108f13b3b06328e9542337e8/src/main/java/net/sf/mpxj/primavera/UserFieldCounters.java#L70-L89
molgenis/molgenis
molgenis-data-import/src/main/java/org/molgenis/data/importer/emx/EmxMetadataParser.java
EmxMetadataParser.parseAttributesSheet
private void parseAttributesSheet( Repository<Entity> attributesRepo, IntermediateParseResults intermediateResults) { for (Attribute attr : attributesRepo.getEntityType().getAtomicAttributes()) { checkAttrSheetHeaders(attr); } Map<String, Map<String, EmxAttribute>> attributesMap = newLinkedHashMap(); // 1st pass: create attribute stubs int rowIndex = 1; // Header createAttributeStubs(attributesRepo, attributesMap, rowIndex); // 2nd pass: set all properties on attribute stubs except for attribute relations rowIndex = 1; // Header for (Entity emxAttrEntity : attributesRepo) { rowIndex++; parseSingleAttribute(intermediateResults, attributesMap, rowIndex, emxAttrEntity); } // 3rd pass Map<String, Set<String>> rootAttributes = validateAndCreateAttributeRelationships(attributesRepo, attributesMap); // store attributes with entities storeAttributes(intermediateResults, attributesMap, rootAttributes); }
java
private void parseAttributesSheet( Repository<Entity> attributesRepo, IntermediateParseResults intermediateResults) { for (Attribute attr : attributesRepo.getEntityType().getAtomicAttributes()) { checkAttrSheetHeaders(attr); } Map<String, Map<String, EmxAttribute>> attributesMap = newLinkedHashMap(); // 1st pass: create attribute stubs int rowIndex = 1; // Header createAttributeStubs(attributesRepo, attributesMap, rowIndex); // 2nd pass: set all properties on attribute stubs except for attribute relations rowIndex = 1; // Header for (Entity emxAttrEntity : attributesRepo) { rowIndex++; parseSingleAttribute(intermediateResults, attributesMap, rowIndex, emxAttrEntity); } // 3rd pass Map<String, Set<String>> rootAttributes = validateAndCreateAttributeRelationships(attributesRepo, attributesMap); // store attributes with entities storeAttributes(intermediateResults, attributesMap, rootAttributes); }
[ "private", "void", "parseAttributesSheet", "(", "Repository", "<", "Entity", ">", "attributesRepo", ",", "IntermediateParseResults", "intermediateResults", ")", "{", "for", "(", "Attribute", "attr", ":", "attributesRepo", ".", "getEntityType", "(", ")", ".", "getAto...
Load all attributes from the source repository and add it to the {@link IntermediateParseResults}. @param attributesRepo Repository for the attributes @param intermediateResults {@link IntermediateParseResults} with the tags already parsed
[ "Load", "all", "attributes", "from", "the", "source", "repository", "and", "add", "it", "to", "the", "{", "@link", "IntermediateParseResults", "}", "." ]
train
https://github.com/molgenis/molgenis/blob/b4d0d6b27e6f6c8d7505a3863dc03b589601f987/molgenis-data-import/src/main/java/org/molgenis/data/importer/emx/EmxMetadataParser.java#L718-L743
jbundle/jbundle
base/base/src/main/java/org/jbundle/base/field/event/MoveOnChangeHandler.java
MoveOnChangeHandler.init
public void init(BaseField field, Converter fldDest, Converter fldSource, boolean bClearIfThisNull, boolean bOnlyIfDestNull, boolean bDontMoveNull) { super.init(field); this.setRespondsToMode(DBConstants.INIT_MOVE, false); this.setRespondsToMode(DBConstants.READ_MOVE, false); // By default, only respond to screen moves m_fldDest = fldDest; m_fldSource = fldSource; m_bClearIfThisNull = bClearIfThisNull; m_bOnlyIfDestNull = bOnlyIfDestNull; m_bDontMoveNull = bDontMoveNull; }
java
public void init(BaseField field, Converter fldDest, Converter fldSource, boolean bClearIfThisNull, boolean bOnlyIfDestNull, boolean bDontMoveNull) { super.init(field); this.setRespondsToMode(DBConstants.INIT_MOVE, false); this.setRespondsToMode(DBConstants.READ_MOVE, false); // By default, only respond to screen moves m_fldDest = fldDest; m_fldSource = fldSource; m_bClearIfThisNull = bClearIfThisNull; m_bOnlyIfDestNull = bOnlyIfDestNull; m_bDontMoveNull = bDontMoveNull; }
[ "public", "void", "init", "(", "BaseField", "field", ",", "Converter", "fldDest", ",", "Converter", "fldSource", ",", "boolean", "bClearIfThisNull", ",", "boolean", "bOnlyIfDestNull", ",", "boolean", "bDontMoveNull", ")", "{", "super", ".", "init", "(", "field",...
Constructor. @param field The basefield owner of this listener (usually null and set on setOwner()). @param fldDest The destination field. @param fldSource The source field. @param bClearIfThisNull If this listener's owner is set to null, set the destination field to null. @param bOnlyIfDestNull Move only if the destination field is null.
[ "Constructor", "." ]
train
https://github.com/jbundle/jbundle/blob/4037fcfa85f60c7d0096c453c1a3cd573c2b0abc/base/base/src/main/java/org/jbundle/base/field/event/MoveOnChangeHandler.java#L109-L119
jqm4gwt/jqm4gwt
library/src/main/java/com/sksamuel/jqm4gwt/toolbar/JQMHeader.java
JQMHeader.setRightButton
public JQMButton setRightButton(String text, String url, DataIcon icon) { JQMButton button = createButton(text, url, icon); setRightButton(button); return button; }
java
public JQMButton setRightButton(String text, String url, DataIcon icon) { JQMButton button = createButton(text, url, icon); setRightButton(button); return button; }
[ "public", "JQMButton", "setRightButton", "(", "String", "text", ",", "String", "url", ",", "DataIcon", "icon", ")", "{", "JQMButton", "button", "=", "createButton", "(", "text", ",", "url", ",", "icon", ")", ";", "setRightButton", "(", "button", ")", ";", ...
Creates a new {@link JQMButton} with the given text and linking to the given url and with the given icon and then sets that button in the right slot. Any existing right button will be replaced. @param text the text for the button @param url the optional url for the button, if null then this button does not navigate by default @param icon the icon to use or null if no icon is required @return the created button
[ "Creates", "a", "new", "{", "@link", "JQMButton", "}", "with", "the", "given", "text", "and", "linking", "to", "the", "given", "url", "and", "with", "the", "given", "icon", "and", "then", "sets", "that", "button", "in", "the", "right", "slot", ".", "An...
train
https://github.com/jqm4gwt/jqm4gwt/blob/cf59958e9ba6d4b70f42507b2c77f10c2465085b/library/src/main/java/com/sksamuel/jqm4gwt/toolbar/JQMHeader.java#L365-L369
spring-projects/spring-plugin
core/src/main/java/org/springframework/plugin/core/OrderAwarePluginRegistry.java
OrderAwarePluginRegistry.ofReverse
public static <S, T extends Plugin<S>> OrderAwarePluginRegistry<T, S> ofReverse(List<? extends T> plugins) { return of(plugins, DEFAULT_REVERSE_COMPARATOR); }
java
public static <S, T extends Plugin<S>> OrderAwarePluginRegistry<T, S> ofReverse(List<? extends T> plugins) { return of(plugins, DEFAULT_REVERSE_COMPARATOR); }
[ "public", "static", "<", "S", ",", "T", "extends", "Plugin", "<", "S", ">", ">", "OrderAwarePluginRegistry", "<", "T", ",", "S", ">", "ofReverse", "(", "List", "<", "?", "extends", "T", ">", "plugins", ")", "{", "return", "of", "(", "plugins", ",", ...
Creates a new {@link OrderAwarePluginRegistry} with the given {@link Plugin}s and the order of the {@link Plugin}s reverted. @param plugins must not be {@literal null}. @return @since 2.0
[ "Creates", "a", "new", "{", "@link", "OrderAwarePluginRegistry", "}", "with", "the", "given", "{", "@link", "Plugin", "}", "s", "and", "the", "order", "of", "the", "{", "@link", "Plugin", "}", "s", "reverted", "." ]
train
https://github.com/spring-projects/spring-plugin/blob/953d2ce12f05f26444fbb3bf21011f538f729868/core/src/main/java/org/springframework/plugin/core/OrderAwarePluginRegistry.java#L123-L125
Azure/azure-sdk-for-java
cognitiveservices/data-plane/vision/computervision/src/main/java/com/microsoft/azure/cognitiveservices/vision/computervision/implementation/ComputerVisionImpl.java
ComputerVisionImpl.generateThumbnailAsync
public Observable<InputStream> generateThumbnailAsync(int width, int height, String url, GenerateThumbnailOptionalParameter generateThumbnailOptionalParameter) { return generateThumbnailWithServiceResponseAsync(width, height, url, generateThumbnailOptionalParameter).map(new Func1<ServiceResponse<InputStream>, InputStream>() { @Override public InputStream call(ServiceResponse<InputStream> response) { return response.body(); } }); }
java
public Observable<InputStream> generateThumbnailAsync(int width, int height, String url, GenerateThumbnailOptionalParameter generateThumbnailOptionalParameter) { return generateThumbnailWithServiceResponseAsync(width, height, url, generateThumbnailOptionalParameter).map(new Func1<ServiceResponse<InputStream>, InputStream>() { @Override public InputStream call(ServiceResponse<InputStream> response) { return response.body(); } }); }
[ "public", "Observable", "<", "InputStream", ">", "generateThumbnailAsync", "(", "int", "width", ",", "int", "height", ",", "String", "url", ",", "GenerateThumbnailOptionalParameter", "generateThumbnailOptionalParameter", ")", "{", "return", "generateThumbnailWithServiceResp...
This operation generates a thumbnail image with the user-specified width and height. By default, the service analyzes the image, identifies the region of interest (ROI), and generates smart cropping coordinates based on the ROI. Smart cropping helps when you specify an aspect ratio that differs from that of the input image. A successful response contains the thumbnail image binary. If the request failed, the response contains an error code and a message to help determine what went wrong. @param width Width of the thumbnail. It must be between 1 and 1024. Recommended minimum of 50. @param height Height of the thumbnail. It must be between 1 and 1024. Recommended minimum of 50. @param url Publicly reachable URL of an image @param generateThumbnailOptionalParameter the object representing the optional parameters to be set before calling this API @throws IllegalArgumentException thrown if parameters fail the validation @return the observable to the InputStream object
[ "This", "operation", "generates", "a", "thumbnail", "image", "with", "the", "user", "-", "specified", "width", "and", "height", ".", "By", "default", "the", "service", "analyzes", "the", "image", "identifies", "the", "region", "of", "interest", "(", "ROI", "...
train
https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/cognitiveservices/data-plane/vision/computervision/src/main/java/com/microsoft/azure/cognitiveservices/vision/computervision/implementation/ComputerVisionImpl.java#L2095-L2102
jmrozanec/cron-utils
src/main/java/com/cronutils/mapper/ConstantsMapper.java
ConstantsMapper.weekDayMapping
public static int weekDayMapping(final WeekDay source, final WeekDay target, final int weekday) { return source.mapTo(weekday, target); }
java
public static int weekDayMapping(final WeekDay source, final WeekDay target, final int weekday) { return source.mapTo(weekday, target); }
[ "public", "static", "int", "weekDayMapping", "(", "final", "WeekDay", "source", ",", "final", "WeekDay", "target", ",", "final", "int", "weekday", ")", "{", "return", "source", ".", "mapTo", "(", "weekday", ",", "target", ")", ";", "}" ]
Performs weekday mapping between two weekday definitions. @param source - source @param target - target weekday definition @param weekday - value in source range. @return int - mapped value
[ "Performs", "weekday", "mapping", "between", "two", "weekday", "definitions", "." ]
train
https://github.com/jmrozanec/cron-utils/blob/adac5ec8fd9160b082f9762a6eedea0715731170/src/main/java/com/cronutils/mapper/ConstantsMapper.java#L31-L33
wildfly/wildfly-core
controller/src/main/java/org/jboss/as/controller/parsing/ParseUtils.java
ParseUtils.missingRequiredElement
public static XMLStreamException missingRequiredElement(final XMLExtendedStreamReader reader, final Set<?> required) { final StringBuilder b = new StringBuilder(); Iterator<?> iterator = required.iterator(); while (iterator.hasNext()) { final Object o = iterator.next(); b.append(o.toString()); if (iterator.hasNext()) { b.append(", "); } } final XMLStreamException ex = ControllerLogger.ROOT_LOGGER.missingRequiredElements(b, reader.getLocation()); Set<String> set = new HashSet<>(); for (Object o : required) { String toString = o.toString(); set.add(toString); } return new XMLStreamValidationException(ex.getMessage(), ValidationError.from(ex, ErrorType.REQUIRED_ELEMENTS_MISSING) .element(reader.getName()) .alternatives(set), ex); }
java
public static XMLStreamException missingRequiredElement(final XMLExtendedStreamReader reader, final Set<?> required) { final StringBuilder b = new StringBuilder(); Iterator<?> iterator = required.iterator(); while (iterator.hasNext()) { final Object o = iterator.next(); b.append(o.toString()); if (iterator.hasNext()) { b.append(", "); } } final XMLStreamException ex = ControllerLogger.ROOT_LOGGER.missingRequiredElements(b, reader.getLocation()); Set<String> set = new HashSet<>(); for (Object o : required) { String toString = o.toString(); set.add(toString); } return new XMLStreamValidationException(ex.getMessage(), ValidationError.from(ex, ErrorType.REQUIRED_ELEMENTS_MISSING) .element(reader.getName()) .alternatives(set), ex); }
[ "public", "static", "XMLStreamException", "missingRequiredElement", "(", "final", "XMLExtendedStreamReader", "reader", ",", "final", "Set", "<", "?", ">", "required", ")", "{", "final", "StringBuilder", "b", "=", "new", "StringBuilder", "(", ")", ";", "Iterator", ...
Get an exception reporting a missing, required XML child element. @param reader the stream reader @param required a set of enums whose toString method returns the attribute name @return the exception
[ "Get", "an", "exception", "reporting", "a", "missing", "required", "XML", "child", "element", "." ]
train
https://github.com/wildfly/wildfly-core/blob/cfaf0479dcbb2d320a44c5374b93b944ec39fade/controller/src/main/java/org/jboss/as/controller/parsing/ParseUtils.java#L246-L268
j-a-w-r/jawr-main-repo
jawr/jawr-core/src/main/java/net/jawr/web/resource/bundle/variant/VariantUtils.java
VariantUtils.getVariantBundleName
public static String getVariantBundleName(String bundleName, Map<String, String> variants, boolean isGeneratedResource) { String variantKey = getVariantKey(variants); return getVariantBundleName(bundleName, variantKey, isGeneratedResource); }
java
public static String getVariantBundleName(String bundleName, Map<String, String> variants, boolean isGeneratedResource) { String variantKey = getVariantKey(variants); return getVariantBundleName(bundleName, variantKey, isGeneratedResource); }
[ "public", "static", "String", "getVariantBundleName", "(", "String", "bundleName", ",", "Map", "<", "String", ",", "String", ">", "variants", ",", "boolean", "isGeneratedResource", ")", "{", "String", "variantKey", "=", "getVariantKey", "(", "variants", ")", ";"...
Returns the bundle name from the variants given in parameter @param bundleName the original bundle name @param variants the map of variant @param isGeneratedResource the flag indicating if it's a generated resource or not @return the variant bundle name
[ "Returns", "the", "bundle", "name", "from", "the", "variants", "given", "in", "parameter" ]
train
https://github.com/j-a-w-r/jawr-main-repo/blob/5381f6acf461cd2502593c67a77bd6ef9eab848d/jawr/jawr-core/src/main/java/net/jawr/web/resource/bundle/variant/VariantUtils.java#L277-L282
apache/groovy
subprojects/parser-antlr4/src/main/java/org/apache/groovy/parser/antlr4/AstBuilder.java
AstBuilder.visitIntegerLiteralAlt
@Override public ConstantExpression visitIntegerLiteralAlt(IntegerLiteralAltContext ctx) { String text = ctx.IntegerLiteral().getText(); Number num = null; try { num = Numbers.parseInteger(null, text); } catch (Exception e) { this.numberFormatError = tuple(ctx, e); } ConstantExpression constantExpression = new ConstantExpression(num, !text.startsWith(SUB_STR)); constantExpression.putNodeMetaData(IS_NUMERIC, true); constantExpression.putNodeMetaData(INTEGER_LITERAL_TEXT, text); return configureAST(constantExpression, ctx); }
java
@Override public ConstantExpression visitIntegerLiteralAlt(IntegerLiteralAltContext ctx) { String text = ctx.IntegerLiteral().getText(); Number num = null; try { num = Numbers.parseInteger(null, text); } catch (Exception e) { this.numberFormatError = tuple(ctx, e); } ConstantExpression constantExpression = new ConstantExpression(num, !text.startsWith(SUB_STR)); constantExpression.putNodeMetaData(IS_NUMERIC, true); constantExpression.putNodeMetaData(INTEGER_LITERAL_TEXT, text); return configureAST(constantExpression, ctx); }
[ "@", "Override", "public", "ConstantExpression", "visitIntegerLiteralAlt", "(", "IntegerLiteralAltContext", "ctx", ")", "{", "String", "text", "=", "ctx", ".", "IntegerLiteral", "(", ")", ".", "getText", "(", ")", ";", "Number", "num", "=", "null", ";", "try",...
literal { --------------------------------------------------------------------
[ "literal", "{", "--------------------------------------------------------------------" ]
train
https://github.com/apache/groovy/blob/71cf20addb611bb8d097a59e395fd20bc7f31772/subprojects/parser-antlr4/src/main/java/org/apache/groovy/parser/antlr4/AstBuilder.java#L3510-L3526
before/quality-check
modules/quality-check/src/main/java/net/sf/qualitycheck/ConditionalCheck.java
ConditionalCheck.notPositive
@Throws(IllegalPositiveArgumentException.class) public static void notPositive(final boolean condition, final int value, @Nullable final String name) { if (condition) { Check.notPositive(value, name); } }
java
@Throws(IllegalPositiveArgumentException.class) public static void notPositive(final boolean condition, final int value, @Nullable final String name) { if (condition) { Check.notPositive(value, name); } }
[ "@", "Throws", "(", "IllegalPositiveArgumentException", ".", "class", ")", "public", "static", "void", "notPositive", "(", "final", "boolean", "condition", ",", "final", "int", "value", ",", "@", "Nullable", "final", "String", "name", ")", "{", "if", "(", "c...
Ensures that an integer reference passed as a parameter to the calling method is not greater than {@code 0}. @param condition condition must be {@code true}^ so that the check will be performed @param value a number @param name name of the number reference (in source code) @throws IllegalNullArgumentException if the given argument {@code reference} is smaller than {@code 0}
[ "Ensures", "that", "an", "integer", "reference", "passed", "as", "a", "parameter", "to", "the", "calling", "method", "is", "not", "greater", "than", "{", "@code", "0", "}", "." ]
train
https://github.com/before/quality-check/blob/a75c32c39434ddb1f89bece57acae0536724c15a/modules/quality-check/src/main/java/net/sf/qualitycheck/ConditionalCheck.java#L2063-L2068
unbescape/unbescape
src/main/java/org/unbescape/properties/PropertiesEscape.java
PropertiesEscape.escapePropertiesValue
public static String escapePropertiesValue(final String text, final PropertiesValueEscapeLevel level) { if (level == null) { throw new IllegalArgumentException("The 'level' argument cannot be null"); } return PropertiesValueEscapeUtil.escape(text, level); }
java
public static String escapePropertiesValue(final String text, final PropertiesValueEscapeLevel level) { if (level == null) { throw new IllegalArgumentException("The 'level' argument cannot be null"); } return PropertiesValueEscapeUtil.escape(text, level); }
[ "public", "static", "String", "escapePropertiesValue", "(", "final", "String", "text", ",", "final", "PropertiesValueEscapeLevel", "level", ")", "{", "if", "(", "level", "==", "null", ")", "{", "throw", "new", "IllegalArgumentException", "(", "\"The 'level' argument...
<p> Perform a (configurable) Java Properties Value <strong>escape</strong> operation on a <tt>String</tt> input. </p> <p> This method will perform an escape operation according to the specified {@link org.unbescape.properties.PropertiesValueEscapeLevel} argument value. </p> <p> All other <tt>String</tt>-based <tt>escapePropertiesValue*(...)</tt> methods call this one with preconfigured <tt>level</tt> values. </p> <p> This method is <strong>thread-safe</strong>. </p> @param text the <tt>String</tt> to be escaped. @param level the escape level to be applied, see {@link org.unbescape.properties.PropertiesValueEscapeLevel}. @return The escaped result <tt>String</tt>. As a memory-performance improvement, will return the exact same object as the <tt>text</tt> input argument if no escaping modifications were required (and no additional <tt>String</tt> objects will be created during processing). Will return <tt>null</tt> if input is <tt>null</tt>.
[ "<p", ">", "Perform", "a", "(", "configurable", ")", "Java", "Properties", "Value", "<strong", ">", "escape<", "/", "strong", ">", "operation", "on", "a", "<tt", ">", "String<", "/", "tt", ">", "input", ".", "<", "/", "p", ">", "<p", ">", "This", "...
train
https://github.com/unbescape/unbescape/blob/ec5435fb3508c2eed25d8165dc27ded2602cae13/src/main/java/org/unbescape/properties/PropertiesEscape.java#L282-L290
SvenEwald/xmlbeam
src/main/java/org/xmlbeam/io/UrlIO.java
UrlIO.readAsMapOf
@Scope(DocScope.IO) public <T> XBAutoMap<T> readAsMapOf(final Class<T> valueType) throws IOException { DefaultXPathBinder.validateEvaluationType(valueType); final Class<?> resourceAwareClass = ReflectionHelper.getDirectCallerClass(); Document document = IOHelper.getDocumentFromURL(projector.config().createDocumentBuilder(), url, requestProperties, resourceAwareClass); InvocationContext invocationContext = new InvocationContext(null, null, null, null, null, valueType, projector); return new AutoMap<T>(document, invocationContext, valueType); }
java
@Scope(DocScope.IO) public <T> XBAutoMap<T> readAsMapOf(final Class<T> valueType) throws IOException { DefaultXPathBinder.validateEvaluationType(valueType); final Class<?> resourceAwareClass = ReflectionHelper.getDirectCallerClass(); Document document = IOHelper.getDocumentFromURL(projector.config().createDocumentBuilder(), url, requestProperties, resourceAwareClass); InvocationContext invocationContext = new InvocationContext(null, null, null, null, null, valueType, projector); return new AutoMap<T>(document, invocationContext, valueType); }
[ "@", "Scope", "(", "DocScope", ".", "IO", ")", "public", "<", "T", ">", "XBAutoMap", "<", "T", ">", "readAsMapOf", "(", "final", "Class", "<", "T", ">", "valueType", ")", "throws", "IOException", "{", "DefaultXPathBinder", ".", "validateEvaluationType", "(...
Read complete document to a Map. @param valueType @return Closeable map bound to complete document. @throws IOException
[ "Read", "complete", "document", "to", "a", "Map", "." ]
train
https://github.com/SvenEwald/xmlbeam/blob/acaac1b8fa28d246f17187f5e3c6696458a0b447/src/main/java/org/xmlbeam/io/UrlIO.java#L142-L149
Stratio/deep-spark
deep-commons/src/main/java/com/stratio/deep/commons/entity/Cells.java
Cells.getBigInteger
public BigInteger getBigInteger(String nameSpace, String cellName) { return getValue(nameSpace, cellName, BigInteger.class); }
java
public BigInteger getBigInteger(String nameSpace, String cellName) { return getValue(nameSpace, cellName, BigInteger.class); }
[ "public", "BigInteger", "getBigInteger", "(", "String", "nameSpace", ",", "String", "cellName", ")", "{", "return", "getValue", "(", "nameSpace", ",", "cellName", ",", "BigInteger", ".", "class", ")", ";", "}" ]
Returns the {@code BigInteger} value of the {@link Cell} (associated to {@code table}) whose name iscellName, or null if this Cells object contains no cell whose name is cellName. @param nameSpace the name of the owning table @param cellName the name of the Cell we want to retrieve from this Cells object. @return the {@code BigInteger} value of the {@link Cell} (associated to {@code table}) whose name is cellName, or null if this Cells object contains no cell whose name is cellName
[ "Returns", "the", "{", "@code", "BigInteger", "}", "value", "of", "the", "{", "@link", "Cell", "}", "(", "associated", "to", "{", "@code", "table", "}", ")", "whose", "name", "iscellName", "or", "null", "if", "this", "Cells", "object", "contains", "no", ...
train
https://github.com/Stratio/deep-spark/blob/b9621c9b7a6d996f80fce1d073d696a157bed095/deep-commons/src/main/java/com/stratio/deep/commons/entity/Cells.java#L1219-L1221
Azure/azure-sdk-for-java
edgegateway/resource-manager/v2019_03_01/src/main/java/com/microsoft/azure/management/edgegateway/v2019_03_01/implementation/OrdersInner.java
OrdersInner.beginCreateOrUpdate
public OrderInner beginCreateOrUpdate(String deviceName, String resourceGroupName, OrderInner order) { return beginCreateOrUpdateWithServiceResponseAsync(deviceName, resourceGroupName, order).toBlocking().single().body(); }
java
public OrderInner beginCreateOrUpdate(String deviceName, String resourceGroupName, OrderInner order) { return beginCreateOrUpdateWithServiceResponseAsync(deviceName, resourceGroupName, order).toBlocking().single().body(); }
[ "public", "OrderInner", "beginCreateOrUpdate", "(", "String", "deviceName", ",", "String", "resourceGroupName", ",", "OrderInner", "order", ")", "{", "return", "beginCreateOrUpdateWithServiceResponseAsync", "(", "deviceName", ",", "resourceGroupName", ",", "order", ")", ...
Creates or updates an order. @param deviceName The device name. @param resourceGroupName The resource group name. @param order The order to be created or updated. @throws IllegalArgumentException thrown if parameters fail the validation @throws CloudException thrown if the request is rejected by server @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent @return the OrderInner object if successful.
[ "Creates", "or", "updates", "an", "order", "." ]
train
https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/edgegateway/resource-manager/v2019_03_01/src/main/java/com/microsoft/azure/management/edgegateway/v2019_03_01/implementation/OrdersInner.java#L392-L394
recruit-mp/android-RMP-Appirater
library/src/main/java/jp/co/recruit_mp/android/rmp_appirater/RmpAppirater.java
RmpAppirater.tryToShowPrompt
public static void tryToShowPrompt(Context context, Options options, OnCompleteListener onCompleteListener) { tryToShowPrompt(context, null, options, onCompleteListener); }
java
public static void tryToShowPrompt(Context context, Options options, OnCompleteListener onCompleteListener) { tryToShowPrompt(context, null, options, onCompleteListener); }
[ "public", "static", "void", "tryToShowPrompt", "(", "Context", "context", ",", "Options", "options", ",", "OnCompleteListener", "onCompleteListener", ")", "{", "tryToShowPrompt", "(", "context", ",", "null", ",", "options", ",", "onCompleteListener", ")", ";", "}"...
Show rating dialog. <p/> The dialog will be showed if the user hasn't declined to rate or hasn't rated current version. @param context Context @param options RMP-Appirater options. @param onCompleteListener Listener which be called after process of review dialog finished.
[ "Show", "rating", "dialog", ".", "<p", "/", ">", "The", "dialog", "will", "be", "showed", "if", "the", "user", "hasn", "t", "declined", "to", "rate", "or", "hasn", "t", "rated", "current", "version", "." ]
train
https://github.com/recruit-mp/android-RMP-Appirater/blob/14fcdf110dfb97120303f39aab1de9393e84b90a/library/src/main/java/jp/co/recruit_mp/android/rmp_appirater/RmpAppirater.java#L205-L207
amzn/ion-java
src/com/amazon/ion/facet/Facets.java
Facets.asFacet
public static <T> T asFacet(Class<T> facetType, Object subject) { T facet = null; if (subject instanceof Faceted) { facet = ((Faceted)subject).asFacet(facetType); } else if (facetType.isInstance(subject)) { facet = facetType.cast(subject); } return facet; }
java
public static <T> T asFacet(Class<T> facetType, Object subject) { T facet = null; if (subject instanceof Faceted) { facet = ((Faceted)subject).asFacet(facetType); } else if (facetType.isInstance(subject)) { facet = facetType.cast(subject); } return facet; }
[ "public", "static", "<", "T", ">", "T", "asFacet", "(", "Class", "<", "T", ">", "facetType", ",", "Object", "subject", ")", "{", "T", "facet", "=", "null", ";", "if", "(", "subject", "instanceof", "Faceted", ")", "{", "facet", "=", "(", "(", "Facet...
Returns a facet of the given subject if supported, returning null otherwise. <p> If the subject implements {@link Faceted}, then this conversion is delegated to {@link Faceted#asFacet(Class)}. Otherwise, a simple cast of the subject is attempted. @return the requested facet, or null if {@code subject} is null or if subject doesn't support the requested facet type.
[ "Returns", "a", "facet", "of", "the", "given", "subject", "if", "supported", "returning", "null", "otherwise", ".", "<p", ">", "If", "the", "subject", "implements", "{", "@link", "Faceted", "}", "then", "this", "conversion", "is", "delegated", "to", "{", "...
train
https://github.com/amzn/ion-java/blob/4ce1f0f58c6a5a8e42d0425ccdb36e38be3e2270/src/com/amazon/ion/facet/Facets.java#L61-L74
BranchMetrics/android-branch-deep-linking
Branch-SDK/src/io/branch/referral/util/LinkProperties.java
LinkProperties.addControlParameter
public LinkProperties addControlParameter(String key, String value) { this.controlParams_.put(key, value); return this; }
java
public LinkProperties addControlParameter(String key, String value) { this.controlParams_.put(key, value); return this; }
[ "public", "LinkProperties", "addControlParameter", "(", "String", "key", ",", "String", "value", ")", "{", "this", ".", "controlParams_", ".", "put", "(", "key", ",", "value", ")", ";", "return", "this", ";", "}" ]
<p>Adds any control params that control the behaviour of the link. Control parameters include Custom redirect url ($android_url,$ios_url), path for auto deep linking($android_deeplink_path,$deeplink_path) etc </p> @param key A {@link String} with value of key for the parameter @param value A {@link String} with value of value for the parameter @return This Builder object to allow for chaining of calls to set methods.
[ "<p", ">", "Adds", "any", "control", "params", "that", "control", "the", "behaviour", "of", "the", "link", ".", "Control", "parameters", "include", "Custom", "redirect", "url", "(", "$android_url", "$ios_url", ")", "path", "for", "auto", "deep", "linking", "...
train
https://github.com/BranchMetrics/android-branch-deep-linking/blob/e3bee2ccfcbf6d4bf1a5815b5b86666e4ff8f848/Branch-SDK/src/io/branch/referral/util/LinkProperties.java#L89-L92
liferay/com-liferay-commerce
commerce-product-service/src/main/java/com/liferay/commerce/product/service/persistence/impl/CProductPersistenceImpl.java
CProductPersistenceImpl.fetchByUUID_G
@Override public CProduct fetchByUUID_G(String uuid, long groupId) { return fetchByUUID_G(uuid, groupId, true); }
java
@Override public CProduct fetchByUUID_G(String uuid, long groupId) { return fetchByUUID_G(uuid, groupId, true); }
[ "@", "Override", "public", "CProduct", "fetchByUUID_G", "(", "String", "uuid", ",", "long", "groupId", ")", "{", "return", "fetchByUUID_G", "(", "uuid", ",", "groupId", ",", "true", ")", ";", "}" ]
Returns the c product where uuid = &#63; and groupId = &#63; or returns <code>null</code> if it could not be found. Uses the finder cache. @param uuid the uuid @param groupId the group ID @return the matching c product, or <code>null</code> if a matching c product could not be found
[ "Returns", "the", "c", "product", "where", "uuid", "=", "&#63", ";", "and", "groupId", "=", "&#63", ";", "or", "returns", "<code", ">", "null<", "/", "code", ">", "if", "it", "could", "not", "be", "found", ".", "Uses", "the", "finder", "cache", "." ]
train
https://github.com/liferay/com-liferay-commerce/blob/9e54362d7f59531fc684016ba49ee7cdc3a2f22b/commerce-product-service/src/main/java/com/liferay/commerce/product/service/persistence/impl/CProductPersistenceImpl.java#L693-L696
j256/simplecsv
src/main/java/com/j256/simplecsv/processor/CsvProcessor.java
CsvProcessor.readHeader
public String[] readHeader(BufferedReader bufferedReader, ParseError parseError) throws ParseException, IOException { checkEntityConfig(); String header = bufferedReader.readLine(); if (header == null) { if (parseError == null) { throw new ParseException("no header line read", 0); } else { parseError.setErrorType(ErrorType.NO_HEADER); parseError.setLineNumber(getLineNumber(bufferedReader)); return null; } } String[] columns = processHeader(header, parseError, getLineNumber(bufferedReader)); if (columns == null) { return null; } else if (headerValidation && !validateHeaderColumns(columns, parseError, getLineNumber(bufferedReader))) { if (parseError == null) { throw new ParseException("header line is not valid: " + header, 0); } else { return null; } } return columns; }
java
public String[] readHeader(BufferedReader bufferedReader, ParseError parseError) throws ParseException, IOException { checkEntityConfig(); String header = bufferedReader.readLine(); if (header == null) { if (parseError == null) { throw new ParseException("no header line read", 0); } else { parseError.setErrorType(ErrorType.NO_HEADER); parseError.setLineNumber(getLineNumber(bufferedReader)); return null; } } String[] columns = processHeader(header, parseError, getLineNumber(bufferedReader)); if (columns == null) { return null; } else if (headerValidation && !validateHeaderColumns(columns, parseError, getLineNumber(bufferedReader))) { if (parseError == null) { throw new ParseException("header line is not valid: " + header, 0); } else { return null; } } return columns; }
[ "public", "String", "[", "]", "readHeader", "(", "BufferedReader", "bufferedReader", ",", "ParseError", "parseError", ")", "throws", "ParseException", ",", "IOException", "{", "checkEntityConfig", "(", ")", ";", "String", "header", "=", "bufferedReader", ".", "rea...
Read in a line and process it as a CSV header. @param bufferedReader Where to read the header from. It needs to be closed by the caller. Consider using {@link BufferedReaderLineCounter} to populate the line-number for parse errors. @param parseError If not null, this will be set with the first parse error and it will return null. If this is null then a ParseException will be thrown instead. @return Array of header column names or null on error. @throws ParseException Thrown on any parsing problems. If parseError is not null then the error will be added there and an exception should not be thrown. @throws IOException If there are any IO exceptions thrown when reading.
[ "Read", "in", "a", "line", "and", "process", "it", "as", "a", "CSV", "header", "." ]
train
https://github.com/j256/simplecsv/blob/964fe53073c43e2a311341e3f8fd2c94372f60cb/src/main/java/com/j256/simplecsv/processor/CsvProcessor.java#L216-L240
mgledi/DRUMS
src/main/java/com/unister/semweb/drums/storable/GeneralStorable.java
GeneralStorable.setValue
public void setValue(int index, byte[] value) throws IOException { if (index >= structure.valueSizes.size()) { throw new IOException("Index " + index + " is out of range."); } int length = structure.valueSizes.get(index); if (value.length != length) { throw new IOException("The length of the given value is not equal to the expected one. (" + value.length + "!=" + length + ")"); } Bytes.putBytes(this.value, structure.valueByteOffsets.get(index), value, 0, value.length); }
java
public void setValue(int index, byte[] value) throws IOException { if (index >= structure.valueSizes.size()) { throw new IOException("Index " + index + " is out of range."); } int length = structure.valueSizes.get(index); if (value.length != length) { throw new IOException("The length of the given value is not equal to the expected one. (" + value.length + "!=" + length + ")"); } Bytes.putBytes(this.value, structure.valueByteOffsets.get(index), value, 0, value.length); }
[ "public", "void", "setValue", "(", "int", "index", ",", "byte", "[", "]", "value", ")", "throws", "IOException", "{", "if", "(", "index", ">=", "structure", ".", "valueSizes", ".", "size", "(", ")", ")", "{", "throw", "new", "IOException", "(", "\"Inde...
Sets the value belonging to the given field. @param index the index of the requested field @param value the value to set @throws IOException
[ "Sets", "the", "value", "belonging", "to", "the", "given", "field", "." ]
train
https://github.com/mgledi/DRUMS/blob/a670f17a2186c9a15725f26617d77ce8e444e072/src/main/java/com/unister/semweb/drums/storable/GeneralStorable.java#L137-L147
ironjacamar/ironjacamar
codegenerator/src/main/java/org/ironjacamar/codegenerator/code/PropsCodeGen.java
PropsCodeGen.writeHashCode
@Override void writeHashCode(Definition def, Writer out, int indent) throws IOException { writeIndent(out, indent); out.write("/** \n"); writeIndent(out, indent); out.write(" * Returns a hash code value for the object.\n"); writeIndent(out, indent); out.write(" * @return A hash code value for this object.\n"); writeIndent(out, indent); out.write(" */\n"); writeIndent(out, indent); out.write("@Override\n"); writeIndent(out, indent); out.write("public int hashCode()"); writeLeftCurlyBracket(out, indent); writeWithIndent(out, indent + 1, "int result = 17;\n"); for (int i = 0; i < getConfigProps(def).size(); i++) { writeWithIndent(out, indent + 1, "if (" + getConfigProps(def).get(i).getName() + " != null)\n"); writeWithIndent(out, indent + 2, "result += 31 * result + 7 * " + getConfigProps(def).get(i).getName() + ".hashCode();\n"); writeIndent(out, indent + 1); out.write("else\n"); writeWithIndent(out, indent + 2, "result += 31 * result + 7;\n"); } writeWithIndent(out, indent + 1, "return result;"); writeRightCurlyBracket(out, indent); writeEol(out); }
java
@Override void writeHashCode(Definition def, Writer out, int indent) throws IOException { writeIndent(out, indent); out.write("/** \n"); writeIndent(out, indent); out.write(" * Returns a hash code value for the object.\n"); writeIndent(out, indent); out.write(" * @return A hash code value for this object.\n"); writeIndent(out, indent); out.write(" */\n"); writeIndent(out, indent); out.write("@Override\n"); writeIndent(out, indent); out.write("public int hashCode()"); writeLeftCurlyBracket(out, indent); writeWithIndent(out, indent + 1, "int result = 17;\n"); for (int i = 0; i < getConfigProps(def).size(); i++) { writeWithIndent(out, indent + 1, "if (" + getConfigProps(def).get(i).getName() + " != null)\n"); writeWithIndent(out, indent + 2, "result += 31 * result + 7 * " + getConfigProps(def).get(i).getName() + ".hashCode();\n"); writeIndent(out, indent + 1); out.write("else\n"); writeWithIndent(out, indent + 2, "result += 31 * result + 7;\n"); } writeWithIndent(out, indent + 1, "return result;"); writeRightCurlyBracket(out, indent); writeEol(out); }
[ "@", "Override", "void", "writeHashCode", "(", "Definition", "def", ",", "Writer", "out", ",", "int", "indent", ")", "throws", "IOException", "{", "writeIndent", "(", "out", ",", "indent", ")", ";", "out", ".", "write", "(", "\"/** \\n\"", ")", ";", "wri...
Output hashCode method @param def definition @param out Writer @param indent space number @throws IOException ioException
[ "Output", "hashCode", "method" ]
train
https://github.com/ironjacamar/ironjacamar/blob/f0389ee7e62aa8b40ba09b251edad76d220ea796/codegenerator/src/main/java/org/ironjacamar/codegenerator/code/PropsCodeGen.java#L135-L166
xwiki/xwiki-rendering
xwiki-rendering-transformations/xwiki-rendering-transformation-macro/src/main/java/org/xwiki/rendering/internal/transformation/macro/MacroTransformation.java
MacroTransformation.wrapInMacroMarker
private Block wrapInMacroMarker(MacroBlock macroBlockToWrap, List<Block> newBlocks) { return new MacroMarkerBlock(macroBlockToWrap.getId(), macroBlockToWrap.getParameters(), macroBlockToWrap.getContent(), newBlocks, macroBlockToWrap.isInline()); }
java
private Block wrapInMacroMarker(MacroBlock macroBlockToWrap, List<Block> newBlocks) { return new MacroMarkerBlock(macroBlockToWrap.getId(), macroBlockToWrap.getParameters(), macroBlockToWrap.getContent(), newBlocks, macroBlockToWrap.isInline()); }
[ "private", "Block", "wrapInMacroMarker", "(", "MacroBlock", "macroBlockToWrap", ",", "List", "<", "Block", ">", "newBlocks", ")", "{", "return", "new", "MacroMarkerBlock", "(", "macroBlockToWrap", ".", "getId", "(", ")", ",", "macroBlockToWrap", ".", "getParameter...
Wrap the output of a macro block with a {@link MacroMarkerBlock}. @param macroBlockToWrap the block that should be replaced @param newBlocks list of blocks to wrap @return the wrapper
[ "Wrap", "the", "output", "of", "a", "macro", "block", "with", "a", "{", "@link", "MacroMarkerBlock", "}", "." ]
train
https://github.com/xwiki/xwiki-rendering/blob/a21cdfcb64ef5b76872e3eedf78c530f26d7beb0/xwiki-rendering-transformations/xwiki-rendering-transformation-macro/src/main/java/org/xwiki/rendering/internal/transformation/macro/MacroTransformation.java#L331-L335