repository_name
stringlengths
7
58
func_path_in_repository
stringlengths
11
218
func_name
stringlengths
4
140
whole_func_string
stringlengths
153
5.32k
language
stringclasses
1 value
func_code_string
stringlengths
72
4k
func_code_tokens
listlengths
20
832
func_documentation_string
stringlengths
61
2k
func_documentation_tokens
listlengths
1
647
split_name
stringclasses
1 value
func_code_url
stringlengths
102
339
smartsheet-platform/smartsheet-java-sdk
src/main/java/com/smartsheet/api/internal/util/Util.java
Util.throwIfNull
public static void throwIfNull(Object obj1, Object obj2) { """ faster util method that avoids creation of array for two-arg cases """ if(obj1 == null){ throw new IllegalArgumentException(); } if(obj2 == null){ throw new IllegalArgumentException(); } }
java
public static void throwIfNull(Object obj1, Object obj2) { if(obj1 == null){ throw new IllegalArgumentException(); } if(obj2 == null){ throw new IllegalArgumentException(); } }
[ "public", "static", "void", "throwIfNull", "(", "Object", "obj1", ",", "Object", "obj2", ")", "{", "if", "(", "obj1", "==", "null", ")", "{", "throw", "new", "IllegalArgumentException", "(", ")", ";", "}", "if", "(", "obj2", "==", "null", ")", "{", "...
faster util method that avoids creation of array for two-arg cases
[ "faster", "util", "method", "that", "avoids", "creation", "of", "array", "for", "two", "-", "arg", "cases" ]
train
https://github.com/smartsheet-platform/smartsheet-java-sdk/blob/f60e264412076271f83b65889ef9b891fad83df8/src/main/java/com/smartsheet/api/internal/util/Util.java#L36-L43
Azure/azure-sdk-for-java
containerservice/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/containerservice/v2019_02_01/implementation/OpenShiftManagedClustersInner.java
OpenShiftManagedClustersInner.updateTagsAsync
public Observable<OpenShiftManagedClusterInner> updateTagsAsync(String resourceGroupName, String resourceName) { """ Updates tags on an OpenShift managed cluster. Updates an OpenShift managed cluster with the specified tags. @param resourceGroupName The name of the resource group. @param resourceName The name...
java
public Observable<OpenShiftManagedClusterInner> updateTagsAsync(String resourceGroupName, String resourceName) { return updateTagsWithServiceResponseAsync(resourceGroupName, resourceName).map(new Func1<ServiceResponse<OpenShiftManagedClusterInner>, OpenShiftManagedClusterInner>() { @Override ...
[ "public", "Observable", "<", "OpenShiftManagedClusterInner", ">", "updateTagsAsync", "(", "String", "resourceGroupName", ",", "String", "resourceName", ")", "{", "return", "updateTagsWithServiceResponseAsync", "(", "resourceGroupName", ",", "resourceName", ")", ".", "map"...
Updates tags on an OpenShift managed cluster. Updates an OpenShift managed cluster with the specified tags. @param resourceGroupName The name of the resource group. @param resourceName The name of the OpenShift managed cluster resource. @throws IllegalArgumentException thrown if parameters fail the validation @return ...
[ "Updates", "tags", "on", "an", "OpenShift", "managed", "cluster", ".", "Updates", "an", "OpenShift", "managed", "cluster", "with", "the", "specified", "tags", "." ]
train
https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/containerservice/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/containerservice/v2019_02_01/implementation/OpenShiftManagedClustersInner.java#L646-L653
google/j2objc
xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/serializer/ToUnknownStream.java
ToUnknownStream.startDTD
public void startDTD(String name, String publicId, String systemId) throws SAXException { """ Pass the call on to the underlying handler @see org.xml.sax.ext.LexicalHandler#startDTD(String, String, String) """ m_handler.startDTD(name, publicId, systemId); }
java
public void startDTD(String name, String publicId, String systemId) throws SAXException { m_handler.startDTD(name, publicId, systemId); }
[ "public", "void", "startDTD", "(", "String", "name", ",", "String", "publicId", ",", "String", "systemId", ")", "throws", "SAXException", "{", "m_handler", ".", "startDTD", "(", "name", ",", "publicId", ",", "systemId", ")", ";", "}" ]
Pass the call on to the underlying handler @see org.xml.sax.ext.LexicalHandler#startDTD(String, String, String)
[ "Pass", "the", "call", "on", "to", "the", "underlying", "handler" ]
train
https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/serializer/ToUnknownStream.java#L944-L948
cache2k/cache2k
cache2k-core/src/main/java/org/cache2k/core/HeapCache.java
HeapCache.removeEntryForEviction
public void removeEntryForEviction(Entry<K, V> e) { """ Remove the entry from the hash table. The entry is already removed from the replacement list. Stop the timer, if needed. The remove races with a clear. The clear is not updating each entry state to e.isGone() but just drops the whole hash table instead. ...
java
public void removeEntryForEviction(Entry<K, V> e) { boolean f = hash.remove(e); checkForHashCodeChange(e); timing.cancelExpiryTimer(e); e.setGone(); }
[ "public", "void", "removeEntryForEviction", "(", "Entry", "<", "K", ",", "V", ">", "e", ")", "{", "boolean", "f", "=", "hash", ".", "remove", "(", "e", ")", ";", "checkForHashCodeChange", "(", "e", ")", ";", "timing", ".", "cancelExpiryTimer", "(", "e"...
Remove the entry from the hash table. The entry is already removed from the replacement list. Stop the timer, if needed. The remove races with a clear. The clear is not updating each entry state to e.isGone() but just drops the whole hash table instead. <p>With completion of the method the entry content is no more vis...
[ "Remove", "the", "entry", "from", "the", "hash", "table", ".", "The", "entry", "is", "already", "removed", "from", "the", "replacement", "list", ".", "Stop", "the", "timer", "if", "needed", ".", "The", "remove", "races", "with", "a", "clear", ".", "The",...
train
https://github.com/cache2k/cache2k/blob/3c9ccff12608c598c387ec50957089784cc4b618/cache2k-core/src/main/java/org/cache2k/core/HeapCache.java#L1322-L1327
podio/podio-java
src/main/java/com/podio/org/OrgAPI.java
OrgAPI.updateOrganization
public void updateOrganization(int orgId, OrganizationCreate data) { """ Updates an organization with new name and logo. Note that the URL of the organization will not change even though the name changes. @param orgId The id of the organization @param data The new data """ getResourceFactory().getApi...
java
public void updateOrganization(int orgId, OrganizationCreate data) { getResourceFactory().getApiResource("/org/" + orgId) .entity(data, MediaType.APPLICATION_JSON_TYPE).put(); }
[ "public", "void", "updateOrganization", "(", "int", "orgId", ",", "OrganizationCreate", "data", ")", "{", "getResourceFactory", "(", ")", ".", "getApiResource", "(", "\"/org/\"", "+", "orgId", ")", ".", "entity", "(", "data", ",", "MediaType", ".", "APPLICATIO...
Updates an organization with new name and logo. Note that the URL of the organization will not change even though the name changes. @param orgId The id of the organization @param data The new data
[ "Updates", "an", "organization", "with", "new", "name", "and", "logo", ".", "Note", "that", "the", "URL", "of", "the", "organization", "will", "not", "change", "even", "though", "the", "name", "changes", "." ]
train
https://github.com/podio/podio-java/blob/a520b23bac118c957ce02cdd8ff42a6c7d17b49a/src/main/java/com/podio/org/OrgAPI.java#L42-L45
Cornutum/tcases
tcases-openapi/src/main/java/org/cornutum/tcases/openapi/io/TcasesOpenApiIO.java
TcasesOpenApiIO.getRequestInputModel
public static SystemInputDef getRequestInputModel( InputStream api, ModelOptions options) { """ Returns a {@link SystemInputDef system input definition} for the API requests defined by the given OpenAPI specification. Returns null if the given spec defines no API requests to model. """ try( OpenApiReader ...
java
public static SystemInputDef getRequestInputModel( InputStream api, ModelOptions options) { try( OpenApiReader reader = new OpenApiReader( api)) { return TcasesOpenApi.getRequestInputModel( reader.read(), options); } }
[ "public", "static", "SystemInputDef", "getRequestInputModel", "(", "InputStream", "api", ",", "ModelOptions", "options", ")", "{", "try", "(", "OpenApiReader", "reader", "=", "new", "OpenApiReader", "(", "api", ")", ")", "{", "return", "TcasesOpenApi", ".", "get...
Returns a {@link SystemInputDef system input definition} for the API requests defined by the given OpenAPI specification. Returns null if the given spec defines no API requests to model.
[ "Returns", "a", "{" ]
train
https://github.com/Cornutum/tcases/blob/21e15cf107fa149620c40f4bda1829c1224fcfb1/tcases-openapi/src/main/java/org/cornutum/tcases/openapi/io/TcasesOpenApiIO.java#L49-L55
Viascom/groundwork
foxhttp/src/main/java/ch/viascom/groundwork/foxhttp/placeholder/DefaultPlaceholderStrategy.java
DefaultPlaceholderStrategy.addPlaceholder
@Override public void addPlaceholder(String placeholder, String value) { """ Add a placeholder to the strategy @param placeholder name of the placholder @param value value of the placeholder """ placeholderMap.put(placeholder, value); }
java
@Override public void addPlaceholder(String placeholder, String value) { placeholderMap.put(placeholder, value); }
[ "@", "Override", "public", "void", "addPlaceholder", "(", "String", "placeholder", ",", "String", "value", ")", "{", "placeholderMap", ".", "put", "(", "placeholder", ",", "value", ")", ";", "}" ]
Add a placeholder to the strategy @param placeholder name of the placholder @param value value of the placeholder
[ "Add", "a", "placeholder", "to", "the", "strategy" ]
train
https://github.com/Viascom/groundwork/blob/d3f7d0df65e2e75861fc7db938090683f2cdf919/foxhttp/src/main/java/ch/viascom/groundwork/foxhttp/placeholder/DefaultPlaceholderStrategy.java#L46-L49
Omertron/api-themoviedb
src/main/java/com/omertron/themoviedbapi/methods/TmdbAccount.java
TmdbAccount.modifyWatchList
public StatusCode modifyWatchList(String sessionId, int accountId, MediaType mediaType, Integer movieId, boolean addToWatchlist) throws MovieDbException { """ Add or remove a movie to an accounts watch list. @param sessionId @param accountId @param movieId @param mediaType @param addToWatchlist @return @t...
java
public StatusCode modifyWatchList(String sessionId, int accountId, MediaType mediaType, Integer movieId, boolean addToWatchlist) throws MovieDbException { TmdbParameters parameters = new TmdbParameters(); parameters.add(Param.SESSION_ID, sessionId); parameters.add(Param.ID, accountId); ...
[ "public", "StatusCode", "modifyWatchList", "(", "String", "sessionId", ",", "int", "accountId", ",", "MediaType", "mediaType", ",", "Integer", "movieId", ",", "boolean", "addToWatchlist", ")", "throws", "MovieDbException", "{", "TmdbParameters", "parameters", "=", "...
Add or remove a movie to an accounts watch list. @param sessionId @param accountId @param movieId @param mediaType @param addToWatchlist @return @throws MovieDbException
[ "Add", "or", "remove", "a", "movie", "to", "an", "accounts", "watch", "list", "." ]
train
https://github.com/Omertron/api-themoviedb/blob/bf132d7c7271734e13b58ba3bc92bba46f220118/src/main/java/com/omertron/themoviedbapi/methods/TmdbAccount.java#L275-L294
Azure/azure-sdk-for-java
sql/resource-manager/v2014_04_01/src/main/java/com/microsoft/azure/management/sql/v2014_04_01/implementation/ElasticPoolsInner.java
ElasticPoolsInner.beginUpdateAsync
public Observable<ElasticPoolInner> beginUpdateAsync(String resourceGroupName, String serverName, String elasticPoolName, ElasticPoolUpdate parameters) { """ Updates an existing elastic pool. @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the A...
java
public Observable<ElasticPoolInner> beginUpdateAsync(String resourceGroupName, String serverName, String elasticPoolName, ElasticPoolUpdate parameters) { return beginUpdateWithServiceResponseAsync(resourceGroupName, serverName, elasticPoolName, parameters).map(new Func1<ServiceResponse<ElasticPoolInner>, Elasti...
[ "public", "Observable", "<", "ElasticPoolInner", ">", "beginUpdateAsync", "(", "String", "resourceGroupName", ",", "String", "serverName", ",", "String", "elasticPoolName", ",", "ElasticPoolUpdate", "parameters", ")", "{", "return", "beginUpdateWithServiceResponseAsync", ...
Updates an existing elastic pool. @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 elasticPoolName The name of the elastic pool to be updated. @param paramete...
[ "Updates", "an", "existing", "elastic", "pool", "." ]
train
https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/sql/resource-manager/v2014_04_01/src/main/java/com/microsoft/azure/management/sql/v2014_04_01/implementation/ElasticPoolsInner.java#L411-L418
google/closure-compiler
src/com/google/javascript/jscomp/NodeUtil.java
NodeUtil.newQNameDeclaration
public static Node newQNameDeclaration( AbstractCompiler compiler, String name, Node value, JSDocInfo info) { """ Creates a node representing a qualified name. @param name A qualified name (e.g. "foo" or "foo.bar.baz") @return A VAR node, or an EXPR_RESULT node containing an ASSIGN or NAME node. """ ...
java
public static Node newQNameDeclaration( AbstractCompiler compiler, String name, Node value, JSDocInfo info) { return newQNameDeclaration(compiler, name, value, info, Token.VAR); }
[ "public", "static", "Node", "newQNameDeclaration", "(", "AbstractCompiler", "compiler", ",", "String", "name", ",", "Node", "value", ",", "JSDocInfo", "info", ")", "{", "return", "newQNameDeclaration", "(", "compiler", ",", "name", ",", "value", ",", "info", "...
Creates a node representing a qualified name. @param name A qualified name (e.g. "foo" or "foo.bar.baz") @return A VAR node, or an EXPR_RESULT node containing an ASSIGN or NAME node.
[ "Creates", "a", "node", "representing", "a", "qualified", "name", "." ]
train
https://github.com/google/closure-compiler/blob/d81e36740f6a9e8ac31a825ee8758182e1dc5aae/src/com/google/javascript/jscomp/NodeUtil.java#L4050-L4053
gallandarakhneorg/afc
advanced/mathfx/src/main/java/org/arakhne/afc/math/geometry/d3/ifx/RectangularPrism3ifx.java
RectangularPrism3ifx.depthProperty
@Pure public IntegerProperty depthProperty() { """ Replies the property that is the depth of the box. @return the depth property. """ if (this.depth == null) { this.depth = new ReadOnlyIntegerWrapper(this, MathFXAttributeNames.DEPTH); this.depth.bind(Bindings.subtract(maxZProperty(), minZProperty()...
java
@Pure public IntegerProperty depthProperty() { if (this.depth == null) { this.depth = new ReadOnlyIntegerWrapper(this, MathFXAttributeNames.DEPTH); this.depth.bind(Bindings.subtract(maxZProperty(), minZProperty())); } return this.depth; }
[ "@", "Pure", "public", "IntegerProperty", "depthProperty", "(", ")", "{", "if", "(", "this", ".", "depth", "==", "null", ")", "{", "this", ".", "depth", "=", "new", "ReadOnlyIntegerWrapper", "(", "this", ",", "MathFXAttributeNames", ".", "DEPTH", ")", ";",...
Replies the property that is the depth of the box. @return the depth property.
[ "Replies", "the", "property", "that", "is", "the", "depth", "of", "the", "box", "." ]
train
https://github.com/gallandarakhneorg/afc/blob/0c7d2e1ddefd4167ef788416d970a6c1ef6f8bbb/advanced/mathfx/src/main/java/org/arakhne/afc/math/geometry/d3/ifx/RectangularPrism3ifx.java#L397-L404
kiegroup/jbpm
jbpm-human-task/jbpm-human-task-jpa/src/main/java/org/jbpm/services/task/impl/model/TaskDataImpl.java
TaskDataImpl.setOutput
public void setOutput(long outputContentId, ContentData outputContentData) { """ Sets the content data for this task data. It will set the <field>outputContentId</field> from the specified outputContentId, <field>outputAccessType</field>, <field>outputType</field> from the specified outputContentData. @param ou...
java
public void setOutput(long outputContentId, ContentData outputContentData) { setOutputContentId(outputContentId); setOutputAccessType(outputContentData.getAccessType()); setOutputType(outputContentData.getType()); }
[ "public", "void", "setOutput", "(", "long", "outputContentId", ",", "ContentData", "outputContentData", ")", "{", "setOutputContentId", "(", "outputContentId", ")", ";", "setOutputAccessType", "(", "outputContentData", ".", "getAccessType", "(", ")", ")", ";", "setO...
Sets the content data for this task data. It will set the <field>outputContentId</field> from the specified outputContentId, <field>outputAccessType</field>, <field>outputType</field> from the specified outputContentData. @param outputContentId id of output content @param outputContentData contentData
[ "Sets", "the", "content", "data", "for", "this", "task", "data", ".", "It", "will", "set", "the", "<field", ">", "outputContentId<", "/", "field", ">", "from", "the", "specified", "outputContentId", "<field", ">", "outputAccessType<", "/", "field", ">", "<fi...
train
https://github.com/kiegroup/jbpm/blob/c3473c728aa382ebbea01e380c5e754a96647b82/jbpm-human-task/jbpm-human-task-jpa/src/main/java/org/jbpm/services/task/impl/model/TaskDataImpl.java#L568-L572
Mozu/mozu-java
mozu-java-core/src/main/java/com/mozu/api/urls/commerce/customer/CustomerSegmentUrl.java
CustomerSegmentUrl.getSegmentUrl
public static MozuUrl getSegmentUrl(Integer id, String responseFields) { """ Get Resource Url for GetSegment @param id Unique identifier of the customer segment to retrieve. @param responseFields Filtering syntax appended to an API call to increase or decrease the amount of data returned inside a JSON object. Th...
java
public static MozuUrl getSegmentUrl(Integer id, String responseFields) { UrlFormatter formatter = new UrlFormatter("/api/commerce/customer/segments/{id}?responseFields={responseFields}"); formatter.formatUrl("id", id); formatter.formatUrl("responseFields", responseFields); return new MozuUrl(formatter.get...
[ "public", "static", "MozuUrl", "getSegmentUrl", "(", "Integer", "id", ",", "String", "responseFields", ")", "{", "UrlFormatter", "formatter", "=", "new", "UrlFormatter", "(", "\"/api/commerce/customer/segments/{id}?responseFields={responseFields}\"", ")", ";", "formatter", ...
Get Resource Url for GetSegment @param id Unique identifier of the customer segment to retrieve. @param responseFields Filtering syntax appended to an API call to increase or decrease the amount of data returned inside a JSON object. This parameter should only be used to retrieve data. Attempting to update data using t...
[ "Get", "Resource", "Url", "for", "GetSegment" ]
train
https://github.com/Mozu/mozu-java/blob/5beadde73601a859f845e3e2fc1077b39c8bea83/mozu-java-core/src/main/java/com/mozu/api/urls/commerce/customer/CustomerSegmentUrl.java#L42-L48
mozilla/rhino
src/org/mozilla/javascript/UintMap.java
UintMap.getInt
public int getInt(int key, int defaultValue) { """ Get integer value assigned with key. @return key integer value or defaultValue if key is absent """ if (key < 0) Kit.codeBug(); int index = findIndex(key); if (0 <= index) { if (ivaluesShift != 0) { return k...
java
public int getInt(int key, int defaultValue) { if (key < 0) Kit.codeBug(); int index = findIndex(key); if (0 <= index) { if (ivaluesShift != 0) { return keys[ivaluesShift + index]; } return 0; } return defaultValue; }
[ "public", "int", "getInt", "(", "int", "key", ",", "int", "defaultValue", ")", "{", "if", "(", "key", "<", "0", ")", "Kit", ".", "codeBug", "(", ")", ";", "int", "index", "=", "findIndex", "(", "key", ")", ";", "if", "(", "0", "<=", "index", ")...
Get integer value assigned with key. @return key integer value or defaultValue if key is absent
[ "Get", "integer", "value", "assigned", "with", "key", "." ]
train
https://github.com/mozilla/rhino/blob/fa8a86df11d37623f5faa8d445a5876612bc47b0/src/org/mozilla/javascript/UintMap.java#L77-L87
OpenLiberty/open-liberty
dev/com.ibm.ws.cdi.internal/src/com/ibm/ws/cdi/internal/archive/AbstractCDIArchive.java
AbstractCDIArchive.getBeanDiscoveryMode
public BeanDiscoveryMode getBeanDiscoveryMode(CDIRuntime cdiRuntime, BeansXml beansXml) { """ Determine the bean deployment archive scanning mode If there is a beans.xml, the bean discovery mode will be used. If there is no beans.xml, the mode will be annotated, unless the enableImplicitBeanArchives is configure...
java
public BeanDiscoveryMode getBeanDiscoveryMode(CDIRuntime cdiRuntime, BeansXml beansXml) { BeanDiscoveryMode mode = BeanDiscoveryMode.ANNOTATED; if (beansXml != null) { mode = beansXml.getBeanDiscoveryMode(); } else if (cdiRuntime.isImplicitBeanArchivesScanningDisabled(this)) { ...
[ "public", "BeanDiscoveryMode", "getBeanDiscoveryMode", "(", "CDIRuntime", "cdiRuntime", ",", "BeansXml", "beansXml", ")", "{", "BeanDiscoveryMode", "mode", "=", "BeanDiscoveryMode", ".", "ANNOTATED", ";", "if", "(", "beansXml", "!=", "null", ")", "{", "mode", "=",...
Determine the bean deployment archive scanning mode If there is a beans.xml, the bean discovery mode will be used. If there is no beans.xml, the mode will be annotated, unless the enableImplicitBeanArchives is configured as false via the server.xml. If there is no beans.xml and the enableImplicitBeanArchives attribute ...
[ "Determine", "the", "bean", "deployment", "archive", "scanning", "mode", "If", "there", "is", "a", "beans", ".", "xml", "the", "bean", "discovery", "mode", "will", "be", "used", ".", "If", "there", "is", "no", "beans", ".", "xml", "the", "mode", "will", ...
train
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.cdi.internal/src/com/ibm/ws/cdi/internal/archive/AbstractCDIArchive.java#L183-L192
JRebirth/JRebirth
org.jrebirth.af/core/src/main/java/org/jrebirth/af/core/service/AbstractService.java
AbstractService.updateProgress
public void updateProgress(final Wave wave, final double workDone, final double totalWork, final double progressIncrement) { """ Update the progress of the service task related to the given wave. @param wave the wave that trigger the service task call @param workDone the amount of overall work done @param tot...
java
public void updateProgress(final Wave wave, final double workDone, final double totalWork, final double progressIncrement) { if (wave.get(JRebirthWaves.SERVICE_TASK).checkProgressRatio(workDone, totalWork, progressIncrement)) { // Increase the task progression JRebirth.runIntoJAT("Serv...
[ "public", "void", "updateProgress", "(", "final", "Wave", "wave", ",", "final", "double", "workDone", ",", "final", "double", "totalWork", ",", "final", "double", "progressIncrement", ")", "{", "if", "(", "wave", ".", "get", "(", "JRebirthWaves", ".", "SERVI...
Update the progress of the service task related to the given wave. @param wave the wave that trigger the service task call @param workDone the amount of overall work done @param totalWork the amount of total work to do @param progressIncrement the value increment used to filter useless progress event
[ "Update", "the", "progress", "of", "the", "service", "task", "related", "to", "the", "given", "wave", "." ]
train
https://github.com/JRebirth/JRebirth/blob/93f4fc087b83c73db540333b9686e97b4cec694d/org.jrebirth.af/core/src/main/java/org/jrebirth/af/core/service/AbstractService.java#L330-L338
ManfredTremmel/gwt-commons-lang3
src/main/java/org/apache/commons/lang3/text/WordUtils.java
WordUtils.isDelimiter
private static boolean isDelimiter(final char ch, final char[] delimiters) { """ Is the character a delimiter. @param ch the character to check @param delimiters the delimiters @return true if it is a delimiter """ if (delimiters == null) { return CharUtils.isWhitespace(ch); ...
java
private static boolean isDelimiter(final char ch, final char[] delimiters) { if (delimiters == null) { return CharUtils.isWhitespace(ch); } for (final char delimiter : delimiters) { if (ch == delimiter) { return true; } } return...
[ "private", "static", "boolean", "isDelimiter", "(", "final", "char", "ch", ",", "final", "char", "[", "]", "delimiters", ")", "{", "if", "(", "delimiters", "==", "null", ")", "{", "return", "CharUtils", ".", "isWhitespace", "(", "ch", ")", ";", "}", "f...
Is the character a delimiter. @param ch the character to check @param delimiters the delimiters @return true if it is a delimiter
[ "Is", "the", "character", "a", "delimiter", "." ]
train
https://github.com/ManfredTremmel/gwt-commons-lang3/blob/9e2dfbbda3668cfa5d935fe76479d1426c294504/src/main/java/org/apache/commons/lang3/text/WordUtils.java#L743-L753
ppiastucki/recast4j
detour/src/main/java/org/recast4j/detour/DetourCommon.java
DetourCommon.overlapPolyPoly2D
static boolean overlapPolyPoly2D(float[] polya, int npolya, float[] polyb, int npolyb) { """ / All vertices are projected onto the xz-plane, so the y-values are ignored. """ for (int i = 0, j = npolya - 1; i < npolya; j = i++) { int va = j * 3; int vb = i * 3; floa...
java
static boolean overlapPolyPoly2D(float[] polya, int npolya, float[] polyb, int npolyb) { for (int i = 0, j = npolya - 1; i < npolya; j = i++) { int va = j * 3; int vb = i * 3; float[] n = new float[] { polya[vb + 2] - polya[va + 2], 0, -(polya[vb + 0] - polya[va + 0]) }; ...
[ "static", "boolean", "overlapPolyPoly2D", "(", "float", "[", "]", "polya", ",", "int", "npolya", ",", "float", "[", "]", "polyb", ",", "int", "npolyb", ")", "{", "for", "(", "int", "i", "=", "0", ",", "j", "=", "npolya", "-", "1", ";", "i", "<", ...
/ All vertices are projected onto the xz-plane, so the y-values are ignored.
[ "/", "All", "vertices", "are", "projected", "onto", "the", "xz", "-", "plane", "so", "the", "y", "-", "values", "are", "ignored", "." ]
train
https://github.com/ppiastucki/recast4j/blob/a414dc34f16b87c95fb4e0f46c28a7830d421788/detour/src/main/java/org/recast4j/detour/DetourCommon.java#L407-L436
guppy4j/libraries
static/src/main/java/org/guppy4j/Objects.java
Objects.castIfInstance
public static <T> T castIfInstance(Object o, Class<T> c) { """ Conditional casting, useful for equals() implementations using instanceof @param o The other object @param c The class to check for @param <T> The generic type of the target class @return The object cast as a T, or null if o is not an instanc...
java
public static <T> T castIfInstance(Object o, Class<T> c) { return o != null && c.isInstance(o) ? c.cast(o) : null; }
[ "public", "static", "<", "T", ">", "T", "castIfInstance", "(", "Object", "o", ",", "Class", "<", "T", ">", "c", ")", "{", "return", "o", "!=", "null", "&&", "c", ".", "isInstance", "(", "o", ")", "?", "c", ".", "cast", "(", "o", ")", ":", "nu...
Conditional casting, useful for equals() implementations using instanceof @param o The other object @param c The class to check for @param <T> The generic type of the target class @return The object cast as a T, or null if o is not an instance of c
[ "Conditional", "casting", "useful", "for", "equals", "()", "implementations", "using", "instanceof" ]
train
https://github.com/guppy4j/libraries/blob/5d7a0a7b3fe1ad5c907a5c232b8187727f51f474/static/src/main/java/org/guppy4j/Objects.java#L32-L34
fhoeben/hsac-fitnesse-fixtures
src/main/java/nl/hsac/fitnesse/fixture/fit/MapColumnFixture.java
MapColumnFixture.acceptAlternativeInputValuesFromTable
public static void acceptAlternativeInputValuesFromTable(Map<String, Object> rowValues, String[][] leftAcceptedForRight) { """ Replaces values found in the rowValues based on the supplied table. Cell 0,1 defines the key to work with. Other rows define a replacement value: if value in first column is found it is...
java
public static void acceptAlternativeInputValuesFromTable(Map<String, Object> rowValues, String[][] leftAcceptedForRight) { String key = leftAcceptedForRight[0][1]; Object valuePresent = rowValues.get(key); String translation = findToValue(leftAcceptedForRight, 0, 1, valuePresent); if (tr...
[ "public", "static", "void", "acceptAlternativeInputValuesFromTable", "(", "Map", "<", "String", ",", "Object", ">", "rowValues", ",", "String", "[", "]", "[", "]", "leftAcceptedForRight", ")", "{", "String", "key", "=", "leftAcceptedForRight", "[", "0", "]", "...
Replaces values found in the rowValues based on the supplied table. Cell 0,1 defines the key to work with. Other rows define a replacement value: if value in first column is found it is replaced with the one from the second. @param rowValues values to replace in. @param leftAcceptedForRight table describing replacement...
[ "Replaces", "values", "found", "in", "the", "rowValues", "based", "on", "the", "supplied", "table", ".", "Cell", "0", "1", "defines", "the", "key", "to", "work", "with", ".", "Other", "rows", "define", "a", "replacement", "value", ":", "if", "value", "in...
train
https://github.com/fhoeben/hsac-fitnesse-fixtures/blob/4e9018d7386a9aa65bfcbf07eb28ae064edd1732/src/main/java/nl/hsac/fitnesse/fixture/fit/MapColumnFixture.java#L99-L106
jwtk/jjwt
impl/src/main/java/io/jsonwebtoken/impl/crypto/EllipticCurveProvider.java
EllipticCurveProvider.generateKeyPair
public static KeyPair generateKeyPair(SignatureAlgorithm alg, SecureRandom random) { """ Generates a new secure-random key pair of sufficient strength for the specified Elliptic Curve {@link SignatureAlgorithm} (must be one of {@code ES256}, {@code ES384} or {@code ES512}) using the specified {@link SecureRandom...
java
public static KeyPair generateKeyPair(SignatureAlgorithm alg, SecureRandom random) { return generateKeyPair("EC", null, alg, random); }
[ "public", "static", "KeyPair", "generateKeyPair", "(", "SignatureAlgorithm", "alg", ",", "SecureRandom", "random", ")", "{", "return", "generateKeyPair", "(", "\"EC\"", ",", "null", ",", "alg", ",", "random", ")", ";", "}" ]
Generates a new secure-random key pair of sufficient strength for the specified Elliptic Curve {@link SignatureAlgorithm} (must be one of {@code ES256}, {@code ES384} or {@code ES512}) using the specified {@link SecureRandom} random number generator. This is a convenience method that immediately delegates to {@link #g...
[ "Generates", "a", "new", "secure", "-", "random", "key", "pair", "of", "sufficient", "strength", "for", "the", "specified", "Elliptic", "Curve", "{", "@link", "SignatureAlgorithm", "}", "(", "must", "be", "one", "of", "{", "@code", "ES256", "}", "{", "@cod...
train
https://github.com/jwtk/jjwt/blob/86b6096946752cffcfbc9b0a5503f1ea195cc140/impl/src/main/java/io/jsonwebtoken/impl/crypto/EllipticCurveProvider.java#L103-L105
baidubce/bce-sdk-java
src/main/java/com/baidubce/services/tsdb/model/Datapoint.java
Datapoint.addDoubleValue
public Datapoint addDoubleValue(long time, double value) { """ Add datapoint of double type value. @param time datapoint's timestamp @param value datapoint's value @return Datapoint """ initialValues(); checkType(TsdbConstants.TYPE_DOUBLE); values.add(Lists.<JsonNode> newArrayList...
java
public Datapoint addDoubleValue(long time, double value) { initialValues(); checkType(TsdbConstants.TYPE_DOUBLE); values.add(Lists.<JsonNode> newArrayList(new LongNode(time), new DoubleNode(value))); return this; }
[ "public", "Datapoint", "addDoubleValue", "(", "long", "time", ",", "double", "value", ")", "{", "initialValues", "(", ")", ";", "checkType", "(", "TsdbConstants", ".", "TYPE_DOUBLE", ")", ";", "values", ".", "add", "(", "Lists", ".", "<", "JsonNode", ">", ...
Add datapoint of double type value. @param time datapoint's timestamp @param value datapoint's value @return Datapoint
[ "Add", "datapoint", "of", "double", "type", "value", "." ]
train
https://github.com/baidubce/bce-sdk-java/blob/f7140f28dd82121515c88ded7bfe769a37d0ec4a/src/main/java/com/baidubce/services/tsdb/model/Datapoint.java#L125-L131
VueGWT/vue-gwt
processors/src/main/java/com/axellience/vuegwt/processors/component/template/parser/TemplateParser.java
TemplateParser.shouldSkipExpressionProcessing
private boolean shouldSkipExpressionProcessing(String expressionString) { """ In some cases we want to skip expression processing for optimization. This is when we are sure the expression is valid and there is no need to create a Java method for it. @param expressionString The expression to asses @return true...
java
private boolean shouldSkipExpressionProcessing(String expressionString) { // We don't skip if it's a component prop as we want Java validation // We don't optimize String expression, as we want GWT to convert Java values // to String for us (Enums, wrapped primitives...) return currentProp == null && !S...
[ "private", "boolean", "shouldSkipExpressionProcessing", "(", "String", "expressionString", ")", "{", "// We don't skip if it's a component prop as we want Java validation", "// We don't optimize String expression, as we want GWT to convert Java values", "// to String for us (Enums, wrapped primi...
In some cases we want to skip expression processing for optimization. This is when we are sure the expression is valid and there is no need to create a Java method for it. @param expressionString The expression to asses @return true if we can skip the expression
[ "In", "some", "cases", "we", "want", "to", "skip", "expression", "processing", "for", "optimization", ".", "This", "is", "when", "we", "are", "sure", "the", "expression", "is", "valid", "and", "there", "is", "no", "need", "to", "create", "a", "Java", "me...
train
https://github.com/VueGWT/vue-gwt/blob/961cd83aed6fe8e2dd80c279847f1b3f62918a1f/processors/src/main/java/com/axellience/vuegwt/processors/component/template/parser/TemplateParser.java#L591-L599
banq/jdonframework
src/main/java/com/jdon/util/UtilDateTime.java
UtilDateTime.toDate
public static java.util.Date toDate(String monthStr, String dayStr, String yearStr, String hourStr, String minuteStr, String secondStr) { """ Makes a Date from separate Strings for month, day, year, hour, minute, and second. @param monthStr The month String @param dayStr The day String @param yearStr The ...
java
public static java.util.Date toDate(String monthStr, String dayStr, String yearStr, String hourStr, String minuteStr, String secondStr) { int month, day, year, hour, minute, second; try { month = Integer.parseInt(monthStr); day = Integer.parseInt(dayStr); year = Integer.parseInt(yearStr); hour =...
[ "public", "static", "java", ".", "util", ".", "Date", "toDate", "(", "String", "monthStr", ",", "String", "dayStr", ",", "String", "yearStr", ",", "String", "hourStr", ",", "String", "minuteStr", ",", "String", "secondStr", ")", "{", "int", "month", ",", ...
Makes a Date from separate Strings for month, day, year, hour, minute, and second. @param monthStr The month String @param dayStr The day String @param yearStr The year String @param hourStr The hour String @param minuteStr The minute String @param secondStr The second String @return A Date made from separate Strings ...
[ "Makes", "a", "Date", "from", "separate", "Strings", "for", "month", "day", "year", "hour", "minute", "and", "second", "." ]
train
https://github.com/banq/jdonframework/blob/72b451caac04f775e57f52aaed3d8775044ead53/src/main/java/com/jdon/util/UtilDateTime.java#L375-L389
wcm-io-caravan/caravan-hal
resource/src/main/java/io/wcm/caravan/hal/resource/HalResource.java
HalResource.removeEmbedded
public HalResource removeEmbedded(String relation, int index) { """ Removes one embedded resource for the given relation and index. @param relation Embedded resource relation @param index Array index @return HAL resource """ return removeResource(HalResourceType.EMBEDDED, relation, index); }
java
public HalResource removeEmbedded(String relation, int index) { return removeResource(HalResourceType.EMBEDDED, relation, index); }
[ "public", "HalResource", "removeEmbedded", "(", "String", "relation", ",", "int", "index", ")", "{", "return", "removeResource", "(", "HalResourceType", ".", "EMBEDDED", ",", "relation", ",", "index", ")", ";", "}" ]
Removes one embedded resource for the given relation and index. @param relation Embedded resource relation @param index Array index @return HAL resource
[ "Removes", "one", "embedded", "resource", "for", "the", "given", "relation", "and", "index", "." ]
train
https://github.com/wcm-io-caravan/caravan-hal/blob/25d58756b58c70c8c48a17fe781e673dd93d5085/resource/src/main/java/io/wcm/caravan/hal/resource/HalResource.java#L469-L471
haraldk/TwelveMonkeys
imageio/imageio-icns/src/main/java/com/twelvemonkeys/imageio/plugins/icns/ICNSUtil.java
ICNSUtil.decompress
static void decompress(final DataInputStream input, final byte[] result, int offset, int length) throws IOException { """ NOTE: This is very close to PackBits (as described by the Wikipedia article), but it is not PackBits! """ int resultPos = offset; int remaining = length; while (rem...
java
static void decompress(final DataInputStream input, final byte[] result, int offset, int length) throws IOException { int resultPos = offset; int remaining = length; while (remaining > 0) { byte run = input.readByte(); int runLength; if ((run & 0x80) != 0) {...
[ "static", "void", "decompress", "(", "final", "DataInputStream", "input", ",", "final", "byte", "[", "]", "result", ",", "int", "offset", ",", "int", "length", ")", "throws", "IOException", "{", "int", "resultPos", "=", "offset", ";", "int", "remaining", "...
NOTE: This is very close to PackBits (as described by the Wikipedia article), but it is not PackBits!
[ "NOTE", ":", "This", "is", "very", "close", "to", "PackBits", "(", "as", "described", "by", "the", "Wikipedia", "article", ")", "but", "it", "is", "not", "PackBits!" ]
train
https://github.com/haraldk/TwelveMonkeys/blob/7fad4d5cd8cb3a6728c7fd3f28a7b84d8ce0101d/imageio/imageio-icns/src/main/java/com/twelvemonkeys/imageio/plugins/icns/ICNSUtil.java#L75-L103
jenkinsci/jenkins
core/src/main/java/hudson/FilePath.java
FilePath.act
public <T> T act(final FileCallable<T> callable) throws IOException, InterruptedException { """ Executes some program on the machine that this {@link FilePath} exists, so that one can perform local file operations. """ return act(callable,callable.getClass().getClassLoader()); }
java
public <T> T act(final FileCallable<T> callable) throws IOException, InterruptedException { return act(callable,callable.getClass().getClassLoader()); }
[ "public", "<", "T", ">", "T", "act", "(", "final", "FileCallable", "<", "T", ">", "callable", ")", "throws", "IOException", ",", "InterruptedException", "{", "return", "act", "(", "callable", ",", "callable", ".", "getClass", "(", ")", ".", "getClassLoader...
Executes some program on the machine that this {@link FilePath} exists, so that one can perform local file operations.
[ "Executes", "some", "program", "on", "the", "machine", "that", "this", "{" ]
train
https://github.com/jenkinsci/jenkins/blob/44c4d3989232082c254d27ae360aa810669f44b7/core/src/main/java/hudson/FilePath.java#L1057-L1059
netscaler/nitro
src/main/java/com/citrix/netscaler/nitro/resource/stat/audit/audit_stats.java
audit_stats.get_nitro_response
protected base_resource[] get_nitro_response(nitro_service service, String response) throws Exception { """ <pre> converts nitro response into object and returns the object array in case of get request. </pre> """ audit_stats[] resources = new audit_stats[1]; audit_response result = (audit_response) serv...
java
protected base_resource[] get_nitro_response(nitro_service service, String response) throws Exception { audit_stats[] resources = new audit_stats[1]; audit_response result = (audit_response) service.get_payload_formatter().string_to_resource(audit_response.class, response); if(result.errorcode != 0) { if (resu...
[ "protected", "base_resource", "[", "]", "get_nitro_response", "(", "nitro_service", "service", ",", "String", "response", ")", "throws", "Exception", "{", "audit_stats", "[", "]", "resources", "=", "new", "audit_stats", "[", "1", "]", ";", "audit_response", "res...
<pre> converts nitro response into object and returns the object array in case of get request. </pre>
[ "<pre", ">", "converts", "nitro", "response", "into", "object", "and", "returns", "the", "object", "array", "in", "case", "of", "get", "request", ".", "<", "/", "pre", ">" ]
train
https://github.com/netscaler/nitro/blob/2a98692dcf4e4ec430c7d7baab8382e4ba5a35e4/src/main/java/com/citrix/netscaler/nitro/resource/stat/audit/audit_stats.java#L280-L299
killme2008/xmemcached
src/main/java/net/rubyeye/xmemcached/auth/AuthInfo.java
AuthInfo.cramMD5
public static AuthInfo cramMD5(String username, String password) { """ Get a typical auth descriptor for CRAM-MD5 auth with the given username and password. @param u the username @param p the password @return an AuthInfo """ return new AuthInfo(new PlainCallbackHandler(username, password), new Strin...
java
public static AuthInfo cramMD5(String username, String password) { return new AuthInfo(new PlainCallbackHandler(username, password), new String[] {"CRAM-MD5"}); }
[ "public", "static", "AuthInfo", "cramMD5", "(", "String", "username", ",", "String", "password", ")", "{", "return", "new", "AuthInfo", "(", "new", "PlainCallbackHandler", "(", "username", ",", "password", ")", ",", "new", "String", "[", "]", "{", "\"CRAM-MD...
Get a typical auth descriptor for CRAM-MD5 auth with the given username and password. @param u the username @param p the password @return an AuthInfo
[ "Get", "a", "typical", "auth", "descriptor", "for", "CRAM", "-", "MD5", "auth", "with", "the", "given", "username", "and", "password", "." ]
train
https://github.com/killme2008/xmemcached/blob/66150915938813b3e3413de1d7b43b6ff9b1478d/src/main/java/net/rubyeye/xmemcached/auth/AuthInfo.java#L60-L62
datumbox/datumbox-framework
datumbox-framework-core/src/main/java/com/datumbox/framework/core/mathematics/regularization/L1Regularizer.java
L1Regularizer.estimatePenalty
public static <K> double estimatePenalty(double l1, Map<K, Double> weights) { """ Estimates the penalty by adding the L1 regularization. @param l1 @param weights @param <K> @return """ double penalty = 0.0; if(l1 > 0.0) { double sumAbsWeights = 0.0; for(double w : ...
java
public static <K> double estimatePenalty(double l1, Map<K, Double> weights) { double penalty = 0.0; if(l1 > 0.0) { double sumAbsWeights = 0.0; for(double w : weights.values()) { sumAbsWeights += Math.abs(w); } penalty = l1*sumAbsWeights; ...
[ "public", "static", "<", "K", ">", "double", "estimatePenalty", "(", "double", "l1", ",", "Map", "<", "K", ",", "Double", ">", "weights", ")", "{", "double", "penalty", "=", "0.0", ";", "if", "(", "l1", ">", "0.0", ")", "{", "double", "sumAbsWeights"...
Estimates the penalty by adding the L1 regularization. @param l1 @param weights @param <K> @return
[ "Estimates", "the", "penalty", "by", "adding", "the", "L1", "regularization", "." ]
train
https://github.com/datumbox/datumbox-framework/blob/909dff0476e80834f05ecdde0624dd2390e9b0ca/datumbox-framework-core/src/main/java/com/datumbox/framework/core/mathematics/regularization/L1Regularizer.java#L71-L81
JodaOrg/joda-time
src/main/java/org/joda/time/format/DateTimeFormatter.java
DateTimeFormatter.parseInto
public int parseInto(ReadWritableInstant instant, String text, int position) { """ Parses a datetime from the given text, at the given position, saving the result into the fields of the given ReadWritableInstant. If the parse succeeds, the return value is the new text position. Note that the parse may succeed w...
java
public int parseInto(ReadWritableInstant instant, String text, int position) { InternalParser parser = requireParser(); if (instant == null) { throw new IllegalArgumentException("Instant must not be null"); } long instantMillis = instant.getMillis(); Chronolo...
[ "public", "int", "parseInto", "(", "ReadWritableInstant", "instant", ",", "String", "text", ",", "int", "position", ")", "{", "InternalParser", "parser", "=", "requireParser", "(", ")", ";", "if", "(", "instant", "==", "null", ")", "{", "throw", "new", "Il...
Parses a datetime from the given text, at the given position, saving the result into the fields of the given ReadWritableInstant. If the parse succeeds, the return value is the new text position. Note that the parse may succeed without fully reading the text and in this case those fields that were read will be set. <p>...
[ "Parses", "a", "datetime", "from", "the", "given", "text", "at", "the", "given", "position", "saving", "the", "result", "into", "the", "fields", "of", "the", "given", "ReadWritableInstant", ".", "If", "the", "parse", "succeeds", "the", "return", "value", "is...
train
https://github.com/JodaOrg/joda-time/blob/bd79f1c4245e79b3c2c56d7b04fde2a6e191fa42/src/main/java/org/joda/time/format/DateTimeFormatter.java#L780-L808
Omertron/api-themoviedb
src/main/java/com/omertron/themoviedbapi/methods/TmdbPeople.java
TmdbPeople.getPersonInfo
public PersonInfo getPersonInfo(int personId, String... appendToResponse) throws MovieDbException { """ Get the general person information for a specific id. @param personId @param appendToResponse @return @throws MovieDbException """ TmdbParameters parameters = new TmdbParameters(); para...
java
public PersonInfo getPersonInfo(int personId, String... appendToResponse) throws MovieDbException { TmdbParameters parameters = new TmdbParameters(); parameters.add(Param.ID, personId); parameters.add(Param.APPEND, appendToResponse); // Switch combined credits for tv & movie. St...
[ "public", "PersonInfo", "getPersonInfo", "(", "int", "personId", ",", "String", "...", "appendToResponse", ")", "throws", "MovieDbException", "{", "TmdbParameters", "parameters", "=", "new", "TmdbParameters", "(", ")", ";", "parameters", ".", "add", "(", "Param", ...
Get the general person information for a specific id. @param personId @param appendToResponse @return @throws MovieDbException
[ "Get", "the", "general", "person", "information", "for", "a", "specific", "id", "." ]
train
https://github.com/Omertron/api-themoviedb/blob/bf132d7c7271734e13b58ba3bc92bba46f220118/src/main/java/com/omertron/themoviedbapi/methods/TmdbPeople.java#L77-L97
yegor256/takes
src/main/java/org/takes/rs/RsWithHeaders.java
RsWithHeaders.extend
@SuppressWarnings("PMD.AvoidInstantiatingObjectsInLoops") private static Iterable<String> extend(final Response res, final Iterable<? extends CharSequence> headers) throws IOException { """ Add to head additional headers. @param res Original response @param headers Values witch will be added to head ...
java
@SuppressWarnings("PMD.AvoidInstantiatingObjectsInLoops") private static Iterable<String> extend(final Response res, final Iterable<? extends CharSequence> headers) throws IOException { Response resp = res; for (final CharSequence hdr: headers) { resp = new RsWithHeader(resp, hdr...
[ "@", "SuppressWarnings", "(", "\"PMD.AvoidInstantiatingObjectsInLoops\"", ")", "private", "static", "Iterable", "<", "String", ">", "extend", "(", "final", "Response", "res", ",", "final", "Iterable", "<", "?", "extends", "CharSequence", ">", "headers", ")", "thro...
Add to head additional headers. @param res Original response @param headers Values witch will be added to head @return Head with additional headers @throws IOException If fails
[ "Add", "to", "head", "additional", "headers", "." ]
train
https://github.com/yegor256/takes/blob/a4f4d939c8f8e0af190025716ad7f22b7de40e70/src/main/java/org/takes/rs/RsWithHeaders.java#L90-L98
apiman/apiman
gateway/engine/ispn/src/main/java/io/apiman/gateway/engine/ispn/io/RegistryCacheMapWrapper.java
RegistryCacheMapWrapper.unmarshalAs
private <T> T unmarshalAs(String valueAsString, Class<T> asClass) throws IOException { """ Unmarshall the given type of object. @param valueAsString @param asClass @throws IOException """ return mapper.reader(asClass).readValue(valueAsString); }
java
private <T> T unmarshalAs(String valueAsString, Class<T> asClass) throws IOException { return mapper.reader(asClass).readValue(valueAsString); }
[ "private", "<", "T", ">", "T", "unmarshalAs", "(", "String", "valueAsString", ",", "Class", "<", "T", ">", "asClass", ")", "throws", "IOException", "{", "return", "mapper", ".", "reader", "(", "asClass", ")", ".", "readValue", "(", "valueAsString", ")", ...
Unmarshall the given type of object. @param valueAsString @param asClass @throws IOException
[ "Unmarshall", "the", "given", "type", "of", "object", "." ]
train
https://github.com/apiman/apiman/blob/8c049c2a2f2e4a69bbb6125686a15edd26f29c21/gateway/engine/ispn/src/main/java/io/apiman/gateway/engine/ispn/io/RegistryCacheMapWrapper.java#L188-L190
Azure/azure-sdk-for-java
keyvault/data-plane/azure-keyvault/src/main/java/com/microsoft/azure/keyvault/implementation/KeyVaultClientBaseImpl.java
KeyVaultClientBaseImpl.updateCertificateIssuerAsync
public ServiceFuture<IssuerBundle> updateCertificateIssuerAsync(String vaultBaseUrl, String issuerName, String provider, IssuerCredentials credentials, OrganizationDetails organizationDetails, IssuerAttributes attributes, final ServiceCallback<IssuerBundle> serviceCallback) { """ Updates the specified certificate ...
java
public ServiceFuture<IssuerBundle> updateCertificateIssuerAsync(String vaultBaseUrl, String issuerName, String provider, IssuerCredentials credentials, OrganizationDetails organizationDetails, IssuerAttributes attributes, final ServiceCallback<IssuerBundle> serviceCallback) { return ServiceFuture.fromResponse(u...
[ "public", "ServiceFuture", "<", "IssuerBundle", ">", "updateCertificateIssuerAsync", "(", "String", "vaultBaseUrl", ",", "String", "issuerName", ",", "String", "provider", ",", "IssuerCredentials", "credentials", ",", "OrganizationDetails", "organizationDetails", ",", "Is...
Updates the specified certificate issuer. The UpdateCertificateIssuer operation performs an update on the specified certificate issuer entity. This operation requires the certificates/setissuers permission. @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. @param issuerName The name of t...
[ "Updates", "the", "specified", "certificate", "issuer", ".", "The", "UpdateCertificateIssuer", "operation", "performs", "an", "update", "on", "the", "specified", "certificate", "issuer", "entity", ".", "This", "operation", "requires", "the", "certificates", "/", "se...
train
https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/keyvault/data-plane/azure-keyvault/src/main/java/com/microsoft/azure/keyvault/implementation/KeyVaultClientBaseImpl.java#L6222-L6224
juebanlin/util4j
util4j/src/main/java/net/jueb/util4j/bytesStream/bytes/HexUtil.java
HexUtil.SimplePrettyHexDump
public static String SimplePrettyHexDump(byte bytes[], int offset, int length) { """ 将字节转换成十六进制字符串 @param bytes 数据 @param offset 起始位置 @param length 从起始位置开始的长度 @return """ ByteArrayOutputStream bos = new ByteArrayOutputStream(); PrintStream ps = new PrintStream(bos); int rows = length / 16...
java
public static String SimplePrettyHexDump(byte bytes[], int offset, int length) { ByteArrayOutputStream bos = new ByteArrayOutputStream(); PrintStream ps = new PrintStream(bos); int rows = length / 16;//打印的行数 int ac = length % 16;//剩余的字节数 for (int i = 0; i < rows; ++i) ps.printf...
[ "public", "static", "String", "SimplePrettyHexDump", "(", "byte", "bytes", "[", "]", ",", "int", "offset", ",", "int", "length", ")", "{", "ByteArrayOutputStream", "bos", "=", "new", "ByteArrayOutputStream", "(", ")", ";", "PrintStream", "ps", "=", "new", "P...
将字节转换成十六进制字符串 @param bytes 数据 @param offset 起始位置 @param length 从起始位置开始的长度 @return
[ "将字节转换成十六进制字符串" ]
train
https://github.com/juebanlin/util4j/blob/c404b2dbdedf7a8890533b351257fa8af4f1439f/util4j/src/main/java/net/jueb/util4j/bytesStream/bytes/HexUtil.java#L291-L338
landawn/AbacusUtil
src/com/landawn/abacus/hash/BloomFilter.java
BloomFilter.optimalNumOfHashFunctions
static int optimalNumOfHashFunctions(long n, long m) { """ Computes the optimal k (number of hashes per element inserted in Bloom filter), given the expected insertions and total number of bits in the Bloom filter. See http://en.wikipedia.org/wiki/File:Bloom_filter_fp_probability.svg for the formula. @param...
java
static int optimalNumOfHashFunctions(long n, long m) { // (m / n) * log(2), but avoid truncation due to division! return Math.max(1, (int) Math.round((double) m / n * Math.log(2))); }
[ "static", "int", "optimalNumOfHashFunctions", "(", "long", "n", ",", "long", "m", ")", "{", "// (m / n) * log(2), but avoid truncation due to division!", "return", "Math", ".", "max", "(", "1", ",", "(", "int", ")", "Math", ".", "round", "(", "(", "double", ")...
Computes the optimal k (number of hashes per element inserted in Bloom filter), given the expected insertions and total number of bits in the Bloom filter. See http://en.wikipedia.org/wiki/File:Bloom_filter_fp_probability.svg for the formula. @param n expected insertions (must be positive) @param m total number of bi...
[ "Computes", "the", "optimal", "k", "(", "number", "of", "hashes", "per", "element", "inserted", "in", "Bloom", "filter", ")", "given", "the", "expected", "insertions", "and", "total", "number", "of", "bits", "in", "the", "Bloom", "filter", "." ]
train
https://github.com/landawn/AbacusUtil/blob/544b7720175d15e9329f83dd22a8cc5fa4515e12/src/com/landawn/abacus/hash/BloomFilter.java#L386-L389
rhuss/jolokia
agent/core/src/main/java/org/jolokia/detector/AbstractServerDetector.java
AbstractServerDetector.getVersionFromJsr77
protected String getVersionFromJsr77(MBeanServerExecutor pMbeanServers) { """ Get the version number from a JSR-77 compliant server @param pMbeanServers servers to query @return version number or null if not found. """ Set<ObjectName> names = searchMBeans(pMbeanServers, "*:j2eeType=J2EEServer,*")...
java
protected String getVersionFromJsr77(MBeanServerExecutor pMbeanServers) { Set<ObjectName> names = searchMBeans(pMbeanServers, "*:j2eeType=J2EEServer,*"); // Take the first one if (names.size() > 0) { return getAttributeValue(pMbeanServers, names.iterator().next(), "serverVersion"); ...
[ "protected", "String", "getVersionFromJsr77", "(", "MBeanServerExecutor", "pMbeanServers", ")", "{", "Set", "<", "ObjectName", ">", "names", "=", "searchMBeans", "(", "pMbeanServers", ",", "\"*:j2eeType=J2EEServer,*\"", ")", ";", "// Take the first one", "if", "(", "n...
Get the version number from a JSR-77 compliant server @param pMbeanServers servers to query @return version number or null if not found.
[ "Get", "the", "version", "number", "from", "a", "JSR", "-", "77", "compliant", "server" ]
train
https://github.com/rhuss/jolokia/blob/dc95e7bef859b1829776c5a84c8f7738f5d7d9c3/agent/core/src/main/java/org/jolokia/detector/AbstractServerDetector.java#L148-L155
dropwizard/metrics
metrics-core/src/main/java/com/codahale/metrics/ConsoleReporter.java
ConsoleReporter.printIfEnabled
private void printIfEnabled(MetricAttribute type, String status) { """ Print only if the attribute is enabled @param type Metric attribute @param status Status to be logged """ if (getDisabledMetricAttributes().contains(type)) { return; } output.println(status); }
java
private void printIfEnabled(MetricAttribute type, String status) { if (getDisabledMetricAttributes().contains(type)) { return; } output.println(status); }
[ "private", "void", "printIfEnabled", "(", "MetricAttribute", "type", ",", "String", "status", ")", "{", "if", "(", "getDisabledMetricAttributes", "(", ")", ".", "contains", "(", "type", ")", ")", "{", "return", ";", "}", "output", ".", "println", "(", "sta...
Print only if the attribute is enabled @param type Metric attribute @param status Status to be logged
[ "Print", "only", "if", "the", "attribute", "is", "enabled" ]
train
https://github.com/dropwizard/metrics/blob/3c6105a0b9b4416c59e16b6b841b123052d6f57d/metrics-core/src/main/java/com/codahale/metrics/ConsoleReporter.java#L350-L356
kuali/ojb-1.0.4
src/java/org/apache/ojb/broker/accesslayer/StatementManager.java
StatementManager.getDeleteStatement
public PreparedStatement getDeleteStatement(ClassDescriptor cld) throws PersistenceBrokerSQLException, PersistenceBrokerException { """ return a prepared DELETE Statement fitting for the given ClassDescriptor """ try { return cld.getStatementsForClass(m_conMan).getDeleteStmt(m_co...
java
public PreparedStatement getDeleteStatement(ClassDescriptor cld) throws PersistenceBrokerSQLException, PersistenceBrokerException { try { return cld.getStatementsForClass(m_conMan).getDeleteStmt(m_conMan.getConnection()); } catch (SQLException e) { ...
[ "public", "PreparedStatement", "getDeleteStatement", "(", "ClassDescriptor", "cld", ")", "throws", "PersistenceBrokerSQLException", ",", "PersistenceBrokerException", "{", "try", "{", "return", "cld", ".", "getStatementsForClass", "(", "m_conMan", ")", ".", "getDeleteStmt...
return a prepared DELETE Statement fitting for the given ClassDescriptor
[ "return", "a", "prepared", "DELETE", "Statement", "fitting", "for", "the", "given", "ClassDescriptor" ]
train
https://github.com/kuali/ojb-1.0.4/blob/9a544372f67ce965f662cdc71609dd03683c8f04/src/java/org/apache/ojb/broker/accesslayer/StatementManager.java#L549-L563
Bedework/bw-util
bw-util-http/src/main/java/org/bedework/util/http/BasicHttpClient.java
BasicHttpClient.setCredentials
public void setCredentials(final String user, final String pw) { """ Set the credentials. user == null for unauthenticated. @param user @param pw """ if (user == null) { credentials = null; } else { credentials = new UsernamePasswordCredentials(user, pw); } }
java
public void setCredentials(final String user, final String pw) { if (user == null) { credentials = null; } else { credentials = new UsernamePasswordCredentials(user, pw); } }
[ "public", "void", "setCredentials", "(", "final", "String", "user", ",", "final", "String", "pw", ")", "{", "if", "(", "user", "==", "null", ")", "{", "credentials", "=", "null", ";", "}", "else", "{", "credentials", "=", "new", "UsernamePasswordCredential...
Set the credentials. user == null for unauthenticated. @param user @param pw
[ "Set", "the", "credentials", ".", "user", "==", "null", "for", "unauthenticated", "." ]
train
https://github.com/Bedework/bw-util/blob/f51de4af3d7eb88fe63a0e22be8898a16c6cc3ad/bw-util-http/src/main/java/org/bedework/util/http/BasicHttpClient.java#L420-L426
OpenLiberty/open-liberty
dev/com.ibm.ws.ejbcontainer.core/src/com/ibm/ws/traceinfo/ejbcontainer/TETxLifeCycleInfo.java
TETxLifeCycleInfo.traceCommon
public static void traceCommon(int opType, String txId, String desc) { """ This is called by the EJB container server code to write a common record to the trace log, if enabled. """ if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) { StringBuffer sbuf = new StringBuf...
java
public static void traceCommon(int opType, String txId, String desc) { if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) { StringBuffer sbuf = new StringBuffer(); sbuf .append(TxLifeCycle_State_Type_Str).append(DataDelimiter) ...
[ "public", "static", "void", "traceCommon", "(", "int", "opType", ",", "String", "txId", ",", "String", "desc", ")", "{", "if", "(", "TraceComponent", ".", "isAnyTracingEnabled", "(", ")", "&&", "tc", ".", "isDebugEnabled", "(", ")", ")", "{", "StringBuffer...
This is called by the EJB container server code to write a common record to the trace log, if enabled.
[ "This", "is", "called", "by", "the", "EJB", "container", "server", "code", "to", "write", "a", "common", "record", "to", "the", "trace", "log", "if", "enabled", "." ]
train
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.ejbcontainer.core/src/com/ibm/ws/traceinfo/ejbcontainer/TETxLifeCycleInfo.java#L76-L91
Azure/azure-sdk-for-java
applicationinsights/resource-manager/v2015_05_01/src/main/java/com/microsoft/azure/management/applicationinsights/v2015_05_01/implementation/ComponentsInner.java
ComponentsInner.getByResourceGroupAsync
public Observable<ApplicationInsightsComponentInner> getByResourceGroupAsync(String resourceGroupName, String resourceName) { """ Returns an Application Insights component. @param resourceGroupName The name of the resource group. @param resourceName The name of the Application Insights component resource. @th...
java
public Observable<ApplicationInsightsComponentInner> getByResourceGroupAsync(String resourceGroupName, String resourceName) { return getByResourceGroupWithServiceResponseAsync(resourceGroupName, resourceName).map(new Func1<ServiceResponse<ApplicationInsightsComponentInner>, ApplicationInsightsComponentInner>() ...
[ "public", "Observable", "<", "ApplicationInsightsComponentInner", ">", "getByResourceGroupAsync", "(", "String", "resourceGroupName", ",", "String", "resourceName", ")", "{", "return", "getByResourceGroupWithServiceResponseAsync", "(", "resourceGroupName", ",", "resourceName", ...
Returns an Application Insights component. @param resourceGroupName The name of the resource group. @param resourceName The name of the Application Insights component resource. @throws IllegalArgumentException thrown if parameters fail the validation @return the observable to the ApplicationInsightsComponentInner obje...
[ "Returns", "an", "Application", "Insights", "component", "." ]
train
https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/applicationinsights/resource-manager/v2015_05_01/src/main/java/com/microsoft/azure/management/applicationinsights/v2015_05_01/implementation/ComponentsInner.java#L457-L464
lucee/Lucee
core/src/main/java/lucee/commons/io/res/util/ResourceUtil.java
ResourceUtil.getPathToChild
public static String getPathToChild(Resource file, Resource dir) { """ return diffrents of one file to a other if first is child of second otherwise return null @param file file to search @param dir directory to search """ if (dir == null || !file.getResourceProvider().getScheme().equals(dir.getResourcePr...
java
public static String getPathToChild(Resource file, Resource dir) { if (dir == null || !file.getResourceProvider().getScheme().equals(dir.getResourceProvider().getScheme())) return null; boolean isFile = file.isFile(); String str = "/"; while (file != null) { if (file.equals(dir)) { if (isFile) return str.sub...
[ "public", "static", "String", "getPathToChild", "(", "Resource", "file", ",", "Resource", "dir", ")", "{", "if", "(", "dir", "==", "null", "||", "!", "file", ".", "getResourceProvider", "(", ")", ".", "getScheme", "(", ")", ".", "equals", "(", "dir", "...
return diffrents of one file to a other if first is child of second otherwise return null @param file file to search @param dir directory to search
[ "return", "diffrents", "of", "one", "file", "to", "a", "other", "if", "first", "is", "child", "of", "second", "otherwise", "return", "null" ]
train
https://github.com/lucee/Lucee/blob/29b153fc4e126e5edb97da937f2ee2e231b87593/core/src/main/java/lucee/commons/io/res/util/ResourceUtil.java#L819-L832
ops4j/org.ops4j.pax.logging
pax-logging-log4j2/src/main/java/org/apache/logging/log4j/core/config/plugins/util/ResolverUtil.java
ResolverUtil.loadImplementationsInJar
private void loadImplementationsInJar(final Test test, final String parent, final File jarFile) { """ Finds matching classes within a jar files that contains a folder structure matching the package structure. If the File is not a JarFile or does not exist a warning will be logged, but no error will be raised. ...
java
private void loadImplementationsInJar(final Test test, final String parent, final File jarFile) { @SuppressWarnings("resource") JarInputStream jarStream = null; try { jarStream = new JarInputStream(new FileInputStream(jarFile)); loadImplementationsInJar(test, parent, jarF...
[ "private", "void", "loadImplementationsInJar", "(", "final", "Test", "test", ",", "final", "String", "parent", ",", "final", "File", "jarFile", ")", "{", "@", "SuppressWarnings", "(", "\"resource\"", ")", "JarInputStream", "jarStream", "=", "null", ";", "try", ...
Finds matching classes within a jar files that contains a folder structure matching the package structure. If the File is not a JarFile or does not exist a warning will be logged, but no error will be raised. @param test a Test used to filter the classes that are discovered @param parent the parent package under which...
[ "Finds", "matching", "classes", "within", "a", "jar", "files", "that", "contains", "a", "folder", "structure", "matching", "the", "package", "structure", ".", "If", "the", "File", "is", "not", "a", "JarFile", "or", "does", "not", "exist", "a", "warning", "...
train
https://github.com/ops4j/org.ops4j.pax.logging/blob/493de4e1db4fe9f981f3dd78b8e40e5bf2b2e59d/pax-logging-log4j2/src/main/java/org/apache/logging/log4j/core/config/plugins/util/ResolverUtil.java#L309-L324
sculptor/sculptor
sculptor-generator/sculptor-generator-core/src/main/java/org/sculptor/generator/util/HelperBase.java
HelperBase.getGetAccessor
public String getGetAccessor(TypedElement e, String prefix) { """ Get-accessor method name of a property, according to JavaBeans naming conventions. """ String capName = toFirstUpper(e.getName()); if (prefix != null) { capName = toFirstUpper(prefix) + capName; } // Note that Boolean object type is ...
java
public String getGetAccessor(TypedElement e, String prefix) { String capName = toFirstUpper(e.getName()); if (prefix != null) { capName = toFirstUpper(prefix) + capName; } // Note that Boolean object type is not named with is prefix (according // to java beans spec) String result = isBooleanPrimitiveType...
[ "public", "String", "getGetAccessor", "(", "TypedElement", "e", ",", "String", "prefix", ")", "{", "String", "capName", "=", "toFirstUpper", "(", "e", ".", "getName", "(", ")", ")", ";", "if", "(", "prefix", "!=", "null", ")", "{", "capName", "=", "toF...
Get-accessor method name of a property, according to JavaBeans naming conventions.
[ "Get", "-", "accessor", "method", "name", "of", "a", "property", "according", "to", "JavaBeans", "naming", "conventions", "." ]
train
https://github.com/sculptor/sculptor/blob/38df06ceb7e40f5f52dbd53b1cd1d07ee11aade5/sculptor-generator/sculptor-generator-core/src/main/java/org/sculptor/generator/util/HelperBase.java#L479-L488
apache/flink
flink-table/flink-table-runtime-blink/src/main/java/org/apache/flink/table/runtime/functions/SqlFunctionUtils.java
SqlFunctionUtils.regexpReplace
public static String regexpReplace(String str, String regex, String replacement) { """ Returns a string resulting from replacing all substrings that match the regular expression with replacement. """ if (regex.isEmpty()) { return str; } try { // we should use StringBuffer here because Matcher only...
java
public static String regexpReplace(String str, String regex, String replacement) { if (regex.isEmpty()) { return str; } try { // we should use StringBuffer here because Matcher only accept it StringBuffer sb = new StringBuffer(); Matcher m = REGEXP_PATTERN_CACHE.get(regex).matcher(str); while (m.fi...
[ "public", "static", "String", "regexpReplace", "(", "String", "str", ",", "String", "regex", ",", "String", "replacement", ")", "{", "if", "(", "regex", ".", "isEmpty", "(", ")", ")", "{", "return", "str", ";", "}", "try", "{", "// we should use StringBuff...
Returns a string resulting from replacing all substrings that match the regular expression with replacement.
[ "Returns", "a", "string", "resulting", "from", "replacing", "all", "substrings", "that", "match", "the", "regular", "expression", "with", "replacement", "." ]
train
https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-table/flink-table-runtime-blink/src/main/java/org/apache/flink/table/runtime/functions/SqlFunctionUtils.java#L346-L366
Stratio/bdt
src/main/java/com/stratio/qa/specs/SeleniumSpec.java
SeleniumSpec.setupApp
@Given("^My app is running in '([^:]+?)(:.+?)?'$") public void setupApp(String host, String port) { """ Set app host and port {@code host, @code port} @param host host where app is running @param port port where app is running """ assertThat(host).isNotEmpty(); if (port == null) { ...
java
@Given("^My app is running in '([^:]+?)(:.+?)?'$") public void setupApp(String host, String port) { assertThat(host).isNotEmpty(); if (port == null) { port = ":80"; } commonspec.setWebHost(host); commonspec.setWebPort(port); commonspec.setRestHost(host);...
[ "@", "Given", "(", "\"^My app is running in '([^:]+?)(:.+?)?'$\"", ")", "public", "void", "setupApp", "(", "String", "host", ",", "String", "port", ")", "{", "assertThat", "(", "host", ")", ".", "isNotEmpty", "(", ")", ";", "if", "(", "port", "==", "null", ...
Set app host and port {@code host, @code port} @param host host where app is running @param port port where app is running
[ "Set", "app", "host", "and", "port", "{", "@code", "host", "@code", "port", "}" ]
train
https://github.com/Stratio/bdt/blob/55324d19e7497764ad3dd7139923e13eb9841d75/src/main/java/com/stratio/qa/specs/SeleniumSpec.java#L89-L101
SvenEwald/xmlbeam
src/main/java/org/xmlbeam/DefaultXPathBinder.java
DefaultXPathBinder.asString
@Override public CloseableValue<String> asString() { """ Evaluates the XPath as a String value. This method is just a shortcut for as(String.class); @return String value of evaluation result. """ final Class<?> callerClass = ReflectionHelper.getDirectCallerClass(); return bindSingeValue(...
java
@Override public CloseableValue<String> asString() { final Class<?> callerClass = ReflectionHelper.getDirectCallerClass(); return bindSingeValue(String.class, callerClass); }
[ "@", "Override", "public", "CloseableValue", "<", "String", ">", "asString", "(", ")", "{", "final", "Class", "<", "?", ">", "callerClass", "=", "ReflectionHelper", ".", "getDirectCallerClass", "(", ")", ";", "return", "bindSingeValue", "(", "String", ".", "...
Evaluates the XPath as a String value. This method is just a shortcut for as(String.class); @return String value of evaluation result.
[ "Evaluates", "the", "XPath", "as", "a", "String", "value", ".", "This", "method", "is", "just", "a", "shortcut", "for", "as", "(", "String", ".", "class", ")", ";" ]
train
https://github.com/SvenEwald/xmlbeam/blob/acaac1b8fa28d246f17187f5e3c6696458a0b447/src/main/java/org/xmlbeam/DefaultXPathBinder.java#L98-L102
johncarl81/transfuse
transfuse-api/src/main/java/org/androidtransfuse/util/InjectionUtil.java
InjectionUtil.setField
public static void setField(Class<?> targetClass, Object target, String field, Object value) { """ Updates field with the given value. @param targetClass class representing the object containing the field. @param target object containing the field to update @param field name of the field @param value object ...
java
public static void setField(Class<?> targetClass, Object target, String field, Object value) { try { Field classField = targetClass.getDeclaredField(field); AccessController.doPrivileged( new SetFieldPrivilegedAction(classField, target, value)); } catch (NoS...
[ "public", "static", "void", "setField", "(", "Class", "<", "?", ">", "targetClass", ",", "Object", "target", ",", "String", "field", ",", "Object", "value", ")", "{", "try", "{", "Field", "classField", "=", "targetClass", ".", "getDeclaredField", "(", "fie...
Updates field with the given value. @param targetClass class representing the object containing the field. @param target object containing the field to update @param field name of the field @param value object to update the field to
[ "Updates", "field", "with", "the", "given", "value", "." ]
train
https://github.com/johncarl81/transfuse/blob/a5f837504797a6c4f8628f7e1dde09b8e6368c8b/transfuse-api/src/main/java/org/androidtransfuse/util/InjectionUtil.java#L96-L111
osmdroid/osmdroid
osmdroid-mapsforge/src/main/java/org/osmdroid/mapsforge/MapsForgeTileSource.java
MapsForgeTileSource.createFromFiles
public static MapsForgeTileSource createFromFiles(File[] file, XmlRenderTheme theme, String themeName) { """ Creates a new MapsForgeTileSource from file[]. <p></p> Parameters minZoom and maxZoom are obtained from the database. If they cannot be obtained from the DB, the default values as defined by this class ...
java
public static MapsForgeTileSource createFromFiles(File[] file, XmlRenderTheme theme, String themeName) { //these settings are ignored and are set based on .map file info int minZoomLevel = MIN_ZOOM; int maxZoomLevel = MAX_ZOOM; int tileSizePixels = TILE_SIZE_PIXELS; return new M...
[ "public", "static", "MapsForgeTileSource", "createFromFiles", "(", "File", "[", "]", "file", ",", "XmlRenderTheme", "theme", ",", "String", "themeName", ")", "{", "//these settings are ignored and are set based on .map file info", "int", "minZoomLevel", "=", "MIN_ZOOM", "...
Creates a new MapsForgeTileSource from file[]. <p></p> Parameters minZoom and maxZoom are obtained from the database. If they cannot be obtained from the DB, the default values as defined by this class are used, which is zoom = 3-20 @param file @param theme this can be null, in which case the default them will be ...
[ "Creates", "a", "new", "MapsForgeTileSource", "from", "file", "[]", ".", "<p", ">", "<", "/", "p", ">", "Parameters", "minZoom", "and", "maxZoom", "are", "obtained", "from", "the", "database", ".", "If", "they", "cannot", "be", "obtained", "from", "the", ...
train
https://github.com/osmdroid/osmdroid/blob/3b178b2f078497dd88c137110e87aafe45ad2b16/osmdroid-mapsforge/src/main/java/org/osmdroid/mapsforge/MapsForgeTileSource.java#L145-L152
ManfredTremmel/gwt-commons-lang3
src/main/java/org/apache/commons/lang3/time/DateUtils.java
DateUtils.parseDateStrictly
@GwtIncompatible("incompatible method") public static Date parseDateStrictly(final String str, final Locale locale, final String... parsePatterns) throws ParseException { """ <p>Parses a string representing a date by trying a variety of different parsers, using the default date format symbols for the given lo...
java
@GwtIncompatible("incompatible method") public static Date parseDateStrictly(final String str, final Locale locale, final String... parsePatterns) throws ParseException { return parseDateWithLeniency(str, locale, parsePatterns, false); }
[ "@", "GwtIncompatible", "(", "\"incompatible method\"", ")", "public", "static", "Date", "parseDateStrictly", "(", "final", "String", "str", ",", "final", "Locale", "locale", ",", "final", "String", "...", "parsePatterns", ")", "throws", "ParseException", "{", "re...
<p>Parses a string representing a date by trying a variety of different parsers, using the default date format symbols for the given locale..</p> <p>The parse will try each parse pattern in turn. A parse is only deemed successful if it parses the whole of the input string. If no parse patterns match, a ParseException ...
[ "<p", ">", "Parses", "a", "string", "representing", "a", "date", "by", "trying", "a", "variety", "of", "different", "parsers", "using", "the", "default", "date", "format", "symbols", "for", "the", "given", "locale", "..", "<", "/", "p", ">" ]
train
https://github.com/ManfredTremmel/gwt-commons-lang3/blob/9e2dfbbda3668cfa5d935fe76479d1426c294504/src/main/java/org/apache/commons/lang3/time/DateUtils.java#L348-L351
sdl/odata
odata_api/src/main/java/com/sdl/odata/util/edm/EntityDataModelUtil.java
EntityDataModelUtil.getAndCheckFunctionImport
public static FunctionImport getAndCheckFunctionImport(EntityDataModel entityDataModel, String functionImportName) { """ Gets the function import by the specified name, throw an exception if no function import with the specified name exists. @param entityDataModel The entity data model. @param functionImpo...
java
public static FunctionImport getAndCheckFunctionImport(EntityDataModel entityDataModel, String functionImportName) { FunctionImport functionImport = entityDataModel.getEntityContainer().getFunctionImport(functionImportName); if (functionImport == null) { throw new ODataSystemException("Funct...
[ "public", "static", "FunctionImport", "getAndCheckFunctionImport", "(", "EntityDataModel", "entityDataModel", ",", "String", "functionImportName", ")", "{", "FunctionImport", "functionImport", "=", "entityDataModel", ".", "getEntityContainer", "(", ")", ".", "getFunctionImp...
Gets the function import by the specified name, throw an exception if no function import with the specified name exists. @param entityDataModel The entity data model. @param functionImportName The name of the function import. @return The function import
[ "Gets", "the", "function", "import", "by", "the", "specified", "name", "throw", "an", "exception", "if", "no", "function", "import", "with", "the", "specified", "name", "exists", "." ]
train
https://github.com/sdl/odata/blob/eb747d73e9af0f4e59a25b82ed656e526a7e2189/odata_api/src/main/java/com/sdl/odata/util/edm/EntityDataModelUtil.java#L598-L605
jhunters/jprotobuf
src/main/java/com/baidu/bjf/remoting/protobuf/ProtobufIDLProxy.java
ProtobufIDLProxy.createSingle
public static IDLProxyObject createSingle(Reader reader, boolean debug, File path) throws IOException { """ Creates the single. @param reader the reader @param debug the debug @param path the path @return the IDL proxy object @throws IOException Signals that an I/O exception has occurred. """ re...
java
public static IDLProxyObject createSingle(Reader reader, boolean debug, File path) throws IOException { return createSingle(reader, debug, path, true); }
[ "public", "static", "IDLProxyObject", "createSingle", "(", "Reader", "reader", ",", "boolean", "debug", ",", "File", "path", ")", "throws", "IOException", "{", "return", "createSingle", "(", "reader", ",", "debug", ",", "path", ",", "true", ")", ";", "}" ]
Creates the single. @param reader the reader @param debug the debug @param path the path @return the IDL proxy object @throws IOException Signals that an I/O exception has occurred.
[ "Creates", "the", "single", "." ]
train
https://github.com/jhunters/jprotobuf/blob/55832c9b4792afb128e5b35139d8a3891561d8a3/src/main/java/com/baidu/bjf/remoting/protobuf/ProtobufIDLProxy.java#L1057-L1059
GerdHolz/TOVAL
src/de/invation/code/toval/graphic/diagrams/panels/ScatterChartPanel.java
ScatterChartPanel.setTickSpacing
public void setTickSpacing(ValueDimension dim, double minorTickSpacing, int multiplicator, boolean repaint) { """ Sets the tick spacing for the coordinate axis of the given dimension.<br> <value>minorTickSpacing</value> sets the minor tick spacing, major tick spacing is a multiple of minor tick spacing and deter...
java
public void setTickSpacing(ValueDimension dim, double minorTickSpacing, int multiplicator, boolean repaint) { double tickSpacing = minorTickSpacing; if(onlyIntegerTicks.get(dim)) { tickSpacing = (int) tickSpacing; if (tickSpacing == 0) tickSpacing = 1; } getTickInfo(dim).setTickSpacing(tickSpacing, ...
[ "public", "void", "setTickSpacing", "(", "ValueDimension", "dim", ",", "double", "minorTickSpacing", ",", "int", "multiplicator", ",", "boolean", "repaint", ")", "{", "double", "tickSpacing", "=", "minorTickSpacing", ";", "if", "(", "onlyIntegerTicks", ".", "get",...
Sets the tick spacing for the coordinate axis of the given dimension.<br> <value>minorTickSpacing</value> sets the minor tick spacing, major tick spacing is a multiple of minor tick spacing and determined with the help of <value>multiplicator</value> @param dim Reference dimension for calculation @param minorTickSpacin...
[ "Sets", "the", "tick", "spacing", "for", "the", "coordinate", "axis", "of", "the", "given", "dimension", ".", "<br", ">", "<value", ">", "minorTickSpacing<", "/", "value", ">", "sets", "the", "minor", "tick", "spacing", "major", "tick", "spacing", "is", "a...
train
https://github.com/GerdHolz/TOVAL/blob/036922cdfd710fa53b18e5dbe1e07f226f731fde/src/de/invation/code/toval/graphic/diagrams/panels/ScatterChartPanel.java#L223-L234
drinkjava2/jDialects
core/src/main/java/com/github/drinkjava2/jdialects/StrUtils.java
StrUtils.countMatches
public static int countMatches(final CharSequence str, final char ch) { """ <p> Counts how many times the char appears in the given string. </p> <p> A {@code null} or empty ("") String input returns {@code 0}. </p> <pre> StringUtils.countMatches(null, *) = 0 StringUtils.countMatches("", *) ...
java
public static int countMatches(final CharSequence str, final char ch) { if (isEmpty(str)) { return 0; } int count = 0; // We could also call str.toCharArray() for faster look ups but that // would generate more garbage. for (int i = 0; i < str.length(); i++) { if (ch == str.charAt(i)) { count++; ...
[ "public", "static", "int", "countMatches", "(", "final", "CharSequence", "str", ",", "final", "char", "ch", ")", "{", "if", "(", "isEmpty", "(", "str", ")", ")", "{", "return", "0", ";", "}", "int", "count", "=", "0", ";", "// We could also call str.toCh...
<p> Counts how many times the char appears in the given string. </p> <p> A {@code null} or empty ("") String input returns {@code 0}. </p> <pre> StringUtils.countMatches(null, *) = 0 StringUtils.countMatches("", *) = 0 StringUtils.countMatches("abba", 0) = 0 StringUtils.countMatches("abba", 'a') = 2 ...
[ "<p", ">", "Counts", "how", "many", "times", "the", "char", "appears", "in", "the", "given", "string", ".", "<", "/", "p", ">" ]
train
https://github.com/drinkjava2/jDialects/blob/1c165f09c6042a599b681c279024abcc1b848b88/core/src/main/java/com/github/drinkjava2/jdialects/StrUtils.java#L821-L834
Samsung/GearVRf
GVRf/Framework/framework/src/main/java/org/gearvrf/animation/GVRAvatar.java
GVRAvatar.animate
public GVRAnimator animate(int animIndex, float timeInSec) { """ Evaluates the animation with the given index at the specified time. @param animIndex 0-based index of {@link GVRAnimator} to start @param timeInSec time to evaluate the animation at @see GVRAvatar#stop() @see #start(String) """ if ((a...
java
public GVRAnimator animate(int animIndex, float timeInSec) { if ((animIndex < 0) || (animIndex >= mAnimations.size())) { throw new IndexOutOfBoundsException("Animation index out of bounds"); } GVRAnimator anim = mAnimations.get(animIndex); anim.animate(timeInSec);...
[ "public", "GVRAnimator", "animate", "(", "int", "animIndex", ",", "float", "timeInSec", ")", "{", "if", "(", "(", "animIndex", "<", "0", ")", "||", "(", "animIndex", ">=", "mAnimations", ".", "size", "(", ")", ")", ")", "{", "throw", "new", "IndexOutOf...
Evaluates the animation with the given index at the specified time. @param animIndex 0-based index of {@link GVRAnimator} to start @param timeInSec time to evaluate the animation at @see GVRAvatar#stop() @see #start(String)
[ "Evaluates", "the", "animation", "with", "the", "given", "index", "at", "the", "specified", "time", "." ]
train
https://github.com/Samsung/GearVRf/blob/05034d465a7b0a494fabb9e9f2971ac19392f32d/GVRf/Framework/framework/src/main/java/org/gearvrf/animation/GVRAvatar.java#L449-L458
Azure/azure-sdk-for-java
locks/resource-manager/v2016_09_01/src/main/java/com/microsoft/azure/management/locks/v2016_09_01/implementation/ManagementLocksInner.java
ManagementLocksInner.createOrUpdateAtSubscriptionLevel
public ManagementLockObjectInner createOrUpdateAtSubscriptionLevel(String lockName, ManagementLockObjectInner parameters) { """ Creates or updates a management lock at the subscription level. When you apply a lock at a parent scope, all child resources inherit the same lock. To create management locks, you must h...
java
public ManagementLockObjectInner createOrUpdateAtSubscriptionLevel(String lockName, ManagementLockObjectInner parameters) { return createOrUpdateAtSubscriptionLevelWithServiceResponseAsync(lockName, parameters).toBlocking().single().body(); }
[ "public", "ManagementLockObjectInner", "createOrUpdateAtSubscriptionLevel", "(", "String", "lockName", ",", "ManagementLockObjectInner", "parameters", ")", "{", "return", "createOrUpdateAtSubscriptionLevelWithServiceResponseAsync", "(", "lockName", ",", "parameters", ")", ".", ...
Creates or updates a management lock at the subscription level. When you apply a lock at a parent scope, all child resources inherit the same lock. To create management locks, you must have access to Microsoft.Authorization/* or Microsoft.Authorization/locks/* actions. Of the built-in roles, only Owner and User Access ...
[ "Creates", "or", "updates", "a", "management", "lock", "at", "the", "subscription", "level", ".", "When", "you", "apply", "a", "lock", "at", "a", "parent", "scope", "all", "child", "resources", "inherit", "the", "same", "lock", ".", "To", "create", "manage...
train
https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/locks/resource-manager/v2016_09_01/src/main/java/com/microsoft/azure/management/locks/v2016_09_01/implementation/ManagementLocksInner.java#L1043-L1045
UrielCh/ovh-java-sdk
ovh-java-sdk-ip/src/main/java/net/minidev/ovh/api/ApiOvhIp.java
ApiOvhIp.ip_mitigation_ipOnMitigation_GET
public OvhMitigationIp ip_mitigation_ipOnMitigation_GET(String ip, String ipOnMitigation) throws IOException { """ Get this object properties REST: GET /ip/{ip}/mitigation/{ipOnMitigation} @param ip [required] @param ipOnMitigation [required] """ String qPath = "/ip/{ip}/mitigation/{ipOnMitigation}"; ...
java
public OvhMitigationIp ip_mitigation_ipOnMitigation_GET(String ip, String ipOnMitigation) throws IOException { String qPath = "/ip/{ip}/mitigation/{ipOnMitigation}"; StringBuilder sb = path(qPath, ip, ipOnMitigation); String resp = exec(qPath, "GET", sb.toString(), null); return convertTo(resp, OvhMitigationIp....
[ "public", "OvhMitigationIp", "ip_mitigation_ipOnMitigation_GET", "(", "String", "ip", ",", "String", "ipOnMitigation", ")", "throws", "IOException", "{", "String", "qPath", "=", "\"/ip/{ip}/mitigation/{ipOnMitigation}\"", ";", "StringBuilder", "sb", "=", "path", "(", "q...
Get this object properties REST: GET /ip/{ip}/mitigation/{ipOnMitigation} @param ip [required] @param ipOnMitigation [required]
[ "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#L696-L701
google/jimfs
jimfs/src/main/java/com/google/common/jimfs/AttributeService.java
AttributeService.copyAttributes
public void copyAttributes(File file, File copy, AttributeCopyOption copyOption) { """ Copies the attributes of the given file to the given copy file. """ switch (copyOption) { case ALL: file.copyAttributes(copy); break; case BASIC: file.copyBasicAttributes(copy); ...
java
public void copyAttributes(File file, File copy, AttributeCopyOption copyOption) { switch (copyOption) { case ALL: file.copyAttributes(copy); break; case BASIC: file.copyBasicAttributes(copy); break; default: // don't copy } }
[ "public", "void", "copyAttributes", "(", "File", "file", ",", "File", "copy", ",", "AttributeCopyOption", "copyOption", ")", "{", "switch", "(", "copyOption", ")", "{", "case", "ALL", ":", "file", ".", "copyAttributes", "(", "copy", ")", ";", "break", ";",...
Copies the attributes of the given file to the given copy file.
[ "Copies", "the", "attributes", "of", "the", "given", "file", "to", "the", "given", "copy", "file", "." ]
train
https://github.com/google/jimfs/blob/3eadff747a3afa7b498030f420d2d04ce700534a/jimfs/src/main/java/com/google/common/jimfs/AttributeService.java#L172-L183
Impetus/Kundera
src/kundera-cassandra/cassandra-core/src/main/java/com/impetus/client/cassandra/schemamanager/CassandraSchemaManager.java
CassandraSchemaManager.createIndexUsingThrift
private void createIndexUsingThrift(TableInfo tableInfo, CfDef cfDef) throws Exception { """ Creates the index using thrift. @param tableInfo the table info @param cfDef the cf def @throws Exception the exception """ for (IndexInfo indexInfo : tableInfo.getColumnsToBeIndexed()) { ...
java
private void createIndexUsingThrift(TableInfo tableInfo, CfDef cfDef) throws Exception { for (IndexInfo indexInfo : tableInfo.getColumnsToBeIndexed()) { for (ColumnDef columnDef : cfDef.getColumn_metadata()) { if (new String(columnDef.getName(), Constants.ENCO...
[ "private", "void", "createIndexUsingThrift", "(", "TableInfo", "tableInfo", ",", "CfDef", "cfDef", ")", "throws", "Exception", "{", "for", "(", "IndexInfo", "indexInfo", ":", "tableInfo", ".", "getColumnsToBeIndexed", "(", ")", ")", "{", "for", "(", "ColumnDef",...
Creates the index using thrift. @param tableInfo the table info @param cfDef the cf def @throws Exception the exception
[ "Creates", "the", "index", "using", "thrift", "." ]
train
https://github.com/Impetus/Kundera/blob/268958ab1ec09d14ec4d9184f0c8ded7a9158908/src/kundera-cassandra/cassandra-core/src/main/java/com/impetus/client/cassandra/schemamanager/CassandraSchemaManager.java#L1368-L1382
pwheel/spring-security-oauth2-client
src/main/java/com/racquettrack/security/oauth/OAuth2AuthenticationEntryPoint.java
OAuth2AuthenticationEntryPoint.constructAdditionalAuthParameters
protected StringBuilder constructAdditionalAuthParameters(Map<String, String> additionalParameters) { """ Provided so that subclasses can override the default behaviour. Note that the recommended method to add additional parameters is via {@link OAuth2ServiceProperties#setAdditionalAuthParams(java.util.Map)}. ...
java
protected StringBuilder constructAdditionalAuthParameters(Map<String, String> additionalParameters) { StringBuilder result = new StringBuilder(); if (additionalParameters != null && !additionalParameters.isEmpty()) { for (Map.Entry<String, String> entry : additionalParameter...
[ "protected", "StringBuilder", "constructAdditionalAuthParameters", "(", "Map", "<", "String", ",", "String", ">", "additionalParameters", ")", "{", "StringBuilder", "result", "=", "new", "StringBuilder", "(", ")", ";", "if", "(", "additionalParameters", "!=", "null"...
Provided so that subclasses can override the default behaviour. Note that the recommended method to add additional parameters is via {@link OAuth2ServiceProperties#setAdditionalAuthParams(java.util.Map)}. Subclasses should never return null, as this was result in "null" being appended to the redirect uri (see {@link S...
[ "Provided", "so", "that", "subclasses", "can", "override", "the", "default", "behaviour", ".", "Note", "that", "the", "recommended", "method", "to", "add", "additional", "parameters", "is", "via", "{", "@link", "OAuth2ServiceProperties#setAdditionalAuthParams", "(", ...
train
https://github.com/pwheel/spring-security-oauth2-client/blob/c0258823493e268495c9752c5d752f74c6809c6b/src/main/java/com/racquettrack/security/oauth/OAuth2AuthenticationEntryPoint.java#L83-L97
zaproxy/zaproxy
src/org/parosproxy/paros/network/HttpSender.java
HttpSender.sendAndReceive
public void sendAndReceive(HttpMessage message, HttpRequestConfig requestConfig) throws IOException { """ Sends the request of given HTTP {@code message} with the given configurations. @param message the message that will be sent @param requestConfig the request configurations. @throws IllegalArgumentExceptio...
java
public void sendAndReceive(HttpMessage message, HttpRequestConfig requestConfig) throws IOException { if (message == null) { throw new IllegalArgumentException("Parameter message must not be null."); } if (requestConfig == null) { throw new IllegalArgumentException("...
[ "public", "void", "sendAndReceive", "(", "HttpMessage", "message", ",", "HttpRequestConfig", "requestConfig", ")", "throws", "IOException", "{", "if", "(", "message", "==", "null", ")", "{", "throw", "new", "IllegalArgumentException", "(", "\"Parameter message must no...
Sends the request of given HTTP {@code message} with the given configurations. @param message the message that will be sent @param requestConfig the request configurations. @throws IllegalArgumentException if any of the parameters is {@code null} @throws IOException if an error occurred while sending the message or fo...
[ "Sends", "the", "request", "of", "given", "HTTP", "{", "@code", "message", "}", "with", "the", "given", "configurations", "." ]
train
https://github.com/zaproxy/zaproxy/blob/0cbe5121f2ae1ecca222513d182759210c569bec/src/org/parosproxy/paros/network/HttpSender.java#L877-L890
networknt/light-4j
client/src/main/java/com/networknt/client/Http2Client.java
Http2Client.populateHeader
public Result populateHeader(ClientRequest request, String authToken, String correlationId, String traceabilityId) { """ Support API to API calls with scope token. The token is the original token from consumer and the client credentials token of caller API is added from cache. authToken, correlationId and tracea...
java
public Result populateHeader(ClientRequest request, String authToken, String correlationId, String traceabilityId) { if(traceabilityId != null) { addAuthTokenTrace(request, authToken, traceabilityId); } else { addAuthToken(request, authToken); } Result<Jwt> result...
[ "public", "Result", "populateHeader", "(", "ClientRequest", "request", ",", "String", "authToken", ",", "String", "correlationId", ",", "String", "traceabilityId", ")", "{", "if", "(", "traceabilityId", "!=", "null", ")", "{", "addAuthTokenTrace", "(", "request", ...
Support API to API calls with scope token. The token is the original token from consumer and the client credentials token of caller API is added from cache. authToken, correlationId and traceabilityId are passed in as strings. This method is used in API to API call @param request the http request @param authToken the...
[ "Support", "API", "to", "API", "calls", "with", "scope", "token", ".", "The", "token", "is", "the", "original", "token", "from", "consumer", "and", "the", "client", "credentials", "token", "of", "caller", "API", "is", "added", "from", "cache", ".", "authTo...
train
https://github.com/networknt/light-4j/blob/2a60257c60663684c8f6dc8b5ea3cf184e534db6/client/src/main/java/com/networknt/client/Http2Client.java#L370-L381
Nexmo/nexmo-java
src/main/java/com/nexmo/client/auth/RequestSigning.java
RequestSigning.verifyRequestSignature
public static boolean verifyRequestSignature(HttpServletRequest request, String secretKey) { """ Verifies the signature in an HttpServletRequest. @param request The HttpServletRequest to be verified @param secretKey The pre-shared secret key used by the sender of the request to create the signature @return ...
java
public static boolean verifyRequestSignature(HttpServletRequest request, String secretKey) { return verifyRequestSignature(request, secretKey, System.currentTimeMillis()); }
[ "public", "static", "boolean", "verifyRequestSignature", "(", "HttpServletRequest", "request", ",", "String", "secretKey", ")", "{", "return", "verifyRequestSignature", "(", "request", ",", "secretKey", ",", "System", ".", "currentTimeMillis", "(", ")", ")", ";", ...
Verifies the signature in an HttpServletRequest. @param request The HttpServletRequest to be verified @param secretKey The pre-shared secret key used by the sender of the request to create the signature @return true if the signature is correct for this request and secret key.
[ "Verifies", "the", "signature", "in", "an", "HttpServletRequest", "." ]
train
https://github.com/Nexmo/nexmo-java/blob/7427eff6d6baa5a5bd9197fa096bcf2564191cf5/src/main/java/com/nexmo/client/auth/RequestSigning.java#L127-L129
bitcoinj/bitcoinj
core/src/main/java/org/bitcoinj/protocols/channels/StoredPaymentChannelClientStates.java
StoredPaymentChannelClientStates.getAnnouncePeerGroup
private TransactionBroadcaster getAnnouncePeerGroup() { """ If the peer group has not been set for MAX_SECONDS_TO_WAIT_FOR_BROADCASTER_TO_BE_SET seconds, then the programmer probably forgot to set it and we should throw exception. """ try { return announcePeerGroupFuture.get(MAX_SECONDS_TO...
java
private TransactionBroadcaster getAnnouncePeerGroup() { try { return announcePeerGroupFuture.get(MAX_SECONDS_TO_WAIT_FOR_BROADCASTER_TO_BE_SET, TimeUnit.SECONDS); } catch (InterruptedException e) { throw new RuntimeException(e); } catch (ExecutionException e) { ...
[ "private", "TransactionBroadcaster", "getAnnouncePeerGroup", "(", ")", "{", "try", "{", "return", "announcePeerGroupFuture", ".", "get", "(", "MAX_SECONDS_TO_WAIT_FOR_BROADCASTER_TO_BE_SET", ",", "TimeUnit", ".", "SECONDS", ")", ";", "}", "catch", "(", "InterruptedExcep...
If the peer group has not been set for MAX_SECONDS_TO_WAIT_FOR_BROADCASTER_TO_BE_SET seconds, then the programmer probably forgot to set it and we should throw exception.
[ "If", "the", "peer", "group", "has", "not", "been", "set", "for", "MAX_SECONDS_TO_WAIT_FOR_BROADCASTER_TO_BE_SET", "seconds", "then", "the", "programmer", "probably", "forgot", "to", "set", "it", "and", "we", "should", "throw", "exception", "." ]
train
https://github.com/bitcoinj/bitcoinj/blob/9cf13d29315014ed59cf4fc5944e5f227e8df9a6/core/src/main/java/org/bitcoinj/protocols/channels/StoredPaymentChannelClientStates.java#L245-L257
anotheria/moskito
moskito-integration/moskito-cdi/src/main/java/net/anotheria/moskito/integration/cdi/AbstractInterceptor.java
AbstractInterceptor.createMethodLevelAccumulators
private void createMethodLevelAccumulators(OnDemandStatsProducer<T> producer, Method method) { """ Create method level accumulators. @param producer {@link OnDemandStatsProducer} @param method annotated method """ //several @Accumulators in accumulators holder String methodName = getMethodN...
java
private void createMethodLevelAccumulators(OnDemandStatsProducer<T> producer, Method method) { //several @Accumulators in accumulators holder String methodName = getMethodName(method); Accumulates accAnnotationHolderMethods = (Accumulates) method.getAnnotation(Accumulates.class); if (acc...
[ "private", "void", "createMethodLevelAccumulators", "(", "OnDemandStatsProducer", "<", "T", ">", "producer", ",", "Method", "method", ")", "{", "//several @Accumulators in accumulators holder", "String", "methodName", "=", "getMethodName", "(", "method", ")", ";", "Accu...
Create method level accumulators. @param producer {@link OnDemandStatsProducer} @param method annotated method
[ "Create", "method", "level", "accumulators", "." ]
train
https://github.com/anotheria/moskito/blob/0fdb79053b98a6ece610fa159f59bc3331e4cf05/moskito-integration/moskito-cdi/src/main/java/net/anotheria/moskito/integration/cdi/AbstractInterceptor.java#L150-L173
Labs64/swid-generator
src/main/java/com/labs64/utils/swid/processor/DefaultSwidProcessor.java
DefaultSwidProcessor.setSoftwareId
public DefaultSwidProcessor setSoftwareId(final String uniqueId, final String tagCreatorRegid) { """ Identifies the specific version of a product (tag: software_id). @param uniqueId software unique ID @param tagCreatorRegid tag creator registration ID @return a reference to this object. """ swid...
java
public DefaultSwidProcessor setSoftwareId(final String uniqueId, final String tagCreatorRegid) { swidTag.setSoftwareId( new SoftwareIdComplexType( new Token(uniqueId, idGenerator.nextId()), new RegistrationId(tagCreatorRegid, idGenerator.nextId()),...
[ "public", "DefaultSwidProcessor", "setSoftwareId", "(", "final", "String", "uniqueId", ",", "final", "String", "tagCreatorRegid", ")", "{", "swidTag", ".", "setSoftwareId", "(", "new", "SoftwareIdComplexType", "(", "new", "Token", "(", "uniqueId", ",", "idGenerator"...
Identifies the specific version of a product (tag: software_id). @param uniqueId software unique ID @param tagCreatorRegid tag creator registration ID @return a reference to this object.
[ "Identifies", "the", "specific", "version", "of", "a", "product", "(", "tag", ":", "software_id", ")", "." ]
train
https://github.com/Labs64/swid-generator/blob/cf78d2469469a09701bce7c5f966ac6de2b7c613/src/main/java/com/labs64/utils/swid/processor/DefaultSwidProcessor.java#L174-L181
google/j2objc
jre_emul/android/platform/external/icu/android_icu4j/src/main/java/android/icu/impl/PluralRulesLoader.java
PluralRulesLoader.getRulesIdForLocale
public String getRulesIdForLocale(ULocale locale, PluralType type) { """ Gets the rulesId from the locale,with locale fallback. If there is no rulesId, return null. The rulesId might be the empty string if the rule is the default rule. """ Map<String, String> idMap = getLocaleIdToRulesIdMap(type); ...
java
public String getRulesIdForLocale(ULocale locale, PluralType type) { Map<String, String> idMap = getLocaleIdToRulesIdMap(type); String localeId = ULocale.canonicalize(locale.getBaseName()); String rulesId = null; while (null == (rulesId = idMap.get(localeId))) { int ix = loca...
[ "public", "String", "getRulesIdForLocale", "(", "ULocale", "locale", ",", "PluralType", "type", ")", "{", "Map", "<", "String", ",", "String", ">", "idMap", "=", "getLocaleIdToRulesIdMap", "(", "type", ")", ";", "String", "localeId", "=", "ULocale", ".", "ca...
Gets the rulesId from the locale,with locale fallback. If there is no rulesId, return null. The rulesId might be the empty string if the rule is the default rule.
[ "Gets", "the", "rulesId", "from", "the", "locale", "with", "locale", "fallback", ".", "If", "there", "is", "no", "rulesId", "return", "null", ".", "The", "rulesId", "might", "be", "the", "empty", "string", "if", "the", "rule", "is", "the", "default", "ru...
train
https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/external/icu/android_icu4j/src/main/java/android/icu/impl/PluralRulesLoader.java#L166-L178
Alluxio/alluxio
core/common/src/main/java/alluxio/underfs/ObjectUnderFileSystem.java
ObjectUnderFileSystem.getChildName
protected String getChildName(String child, String parent) throws IOException { """ Gets the child name based on the parent name. @param child the key of the child @param parent the key of the parent @return the child key with the parent prefix removed """ if (child.startsWith(parent)) { return ...
java
protected String getChildName(String child, String parent) throws IOException { if (child.startsWith(parent)) { return child.substring(parent.length()); } throw new IOException(ExceptionMessage.INVALID_PREFIX.getMessage(parent, child)); }
[ "protected", "String", "getChildName", "(", "String", "child", ",", "String", "parent", ")", "throws", "IOException", "{", "if", "(", "child", ".", "startsWith", "(", "parent", ")", ")", "{", "return", "child", ".", "substring", "(", "parent", ".", "length...
Gets the child name based on the parent name. @param child the key of the child @param parent the key of the parent @return the child key with the parent prefix removed
[ "Gets", "the", "child", "name", "based", "on", "the", "parent", "name", "." ]
train
https://github.com/Alluxio/alluxio/blob/af38cf3ab44613355b18217a3a4d961f8fec3a10/core/common/src/main/java/alluxio/underfs/ObjectUnderFileSystem.java#L894-L899
pressgang-ccms/PressGangCCMSContentSpecProcessor
src/main/java/org/jboss/pressgang/ccms/contentspec/processor/ContentSpecProcessor.java
ContentSpecProcessor.getTopicForTopicNode
protected TopicWrapper getTopicForTopicNode(final DataProviderFactory providerFactory, final ITopicNode topicNode) { """ Gets or creates the underlying Topic Entity for a spec topic. @param providerFactory @param topicNode The spec topic to get the topic entity for. @return The topic entity if one could...
java
protected TopicWrapper getTopicForTopicNode(final DataProviderFactory providerFactory, final ITopicNode topicNode) { TopicWrapper topic = null; if (topicNode.isTopicANewTopic()) { topic = getTopicForNewTopicNode(providerFactory, topicNode); } else if (topicNode.isTopicAClonedTopic()...
[ "protected", "TopicWrapper", "getTopicForTopicNode", "(", "final", "DataProviderFactory", "providerFactory", ",", "final", "ITopicNode", "topicNode", ")", "{", "TopicWrapper", "topic", "=", "null", ";", "if", "(", "topicNode", ".", "isTopicANewTopic", "(", ")", ")",...
Gets or creates the underlying Topic Entity for a spec topic. @param providerFactory @param topicNode The spec topic to get the topic entity for. @return The topic entity if one could be found, otherwise null.
[ "Gets", "or", "creates", "the", "underlying", "Topic", "Entity", "for", "a", "spec", "topic", "." ]
train
https://github.com/pressgang-ccms/PressGangCCMSContentSpecProcessor/blob/85ffac047c4ede0f972364ab1f03f7d61a4de5f1/src/main/java/org/jboss/pressgang/ccms/contentspec/processor/ContentSpecProcessor.java#L628-L640
facebookarchive/hadoop-20
src/contrib/highavailability/src/java/org/apache/hadoop/hdfs/server/namenode/AvatarStorageSetup.java
AvatarStorageSetup.checkImageStorage
private static String checkImageStorage(URI sharedImage, URI sharedEdits) { """ Shared image needs to be in file storage, or QJM providing that QJM also stores edits. """ if (sharedImage.getScheme().equals(NNStorage.LOCAL_URI_SCHEME)) { // shared image is stored in file storage return ""; ...
java
private static String checkImageStorage(URI sharedImage, URI sharedEdits) { if (sharedImage.getScheme().equals(NNStorage.LOCAL_URI_SCHEME)) { // shared image is stored in file storage return ""; } else if (sharedImage.getScheme().equals( QuorumJournalManager.QJM_URI_SCHEME) && shared...
[ "private", "static", "String", "checkImageStorage", "(", "URI", "sharedImage", ",", "URI", "sharedEdits", ")", "{", "if", "(", "sharedImage", ".", "getScheme", "(", ")", ".", "equals", "(", "NNStorage", ".", "LOCAL_URI_SCHEME", ")", ")", "{", "// shared image ...
Shared image needs to be in file storage, or QJM providing that QJM also stores edits.
[ "Shared", "image", "needs", "to", "be", "in", "file", "storage", "or", "QJM", "providing", "that", "QJM", "also", "stores", "edits", "." ]
train
https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/contrib/highavailability/src/java/org/apache/hadoop/hdfs/server/namenode/AvatarStorageSetup.java#L123-L135
tracee/tracee
core/src/main/java/io/tracee/Utilities.java
Utilities.generateSessionIdIfNecessary
public static void generateSessionIdIfNecessary(final TraceeBackend backend, final String sessionId) { """ Generate session id hash if it doesn't exist in TraceeBackend and configuration asks for one @param backend Currently used TraceeBackend @param sessionId Current http sessionId """ if (backend != ...
java
public static void generateSessionIdIfNecessary(final TraceeBackend backend, final String sessionId) { if (backend != null && !backend.containsKey(TraceeConstants.SESSION_ID_KEY) && backend.getConfiguration().shouldGenerateSessionId()) { backend.put(TraceeConstants.SESSION_ID_KEY, Utilities.createAlphanumericHash(...
[ "public", "static", "void", "generateSessionIdIfNecessary", "(", "final", "TraceeBackend", "backend", ",", "final", "String", "sessionId", ")", "{", "if", "(", "backend", "!=", "null", "&&", "!", "backend", ".", "containsKey", "(", "TraceeConstants", ".", "SESSI...
Generate session id hash if it doesn't exist in TraceeBackend and configuration asks for one @param backend Currently used TraceeBackend @param sessionId Current http sessionId
[ "Generate", "session", "id", "hash", "if", "it", "doesn", "t", "exist", "in", "TraceeBackend", "and", "configuration", "asks", "for", "one" ]
train
https://github.com/tracee/tracee/blob/15a68e435248f57757beb8ceac6db5b7f6035bb3/core/src/main/java/io/tracee/Utilities.java#L78-L82
derari/cthul
objects/src/main/java/org/cthul/objects/Boxing.java
Boxing.unboxAll
public static Object unboxAll(Object[] src, int srcPos, int len) { """ Transforms an array of {@code Boolean}, {@code Character}, or {@code Number} into a primitive array. @param src source array @param srcPos start position @param len length @return primitive array """ if (srcPos >= src.length) {...
java
public static Object unboxAll(Object[] src, int srcPos, int len) { if (srcPos >= src.length) { throw new IndexOutOfBoundsException(String.valueOf(srcPos)); } Class<?> type = src[srcPos].getClass(); return unboxAll(type, src, srcPos, len); }
[ "public", "static", "Object", "unboxAll", "(", "Object", "[", "]", "src", ",", "int", "srcPos", ",", "int", "len", ")", "{", "if", "(", "srcPos", ">=", "src", ".", "length", ")", "{", "throw", "new", "IndexOutOfBoundsException", "(", "String", ".", "va...
Transforms an array of {@code Boolean}, {@code Character}, or {@code Number} into a primitive array. @param src source array @param srcPos start position @param len length @return primitive array
[ "Transforms", "an", "array", "of", "{" ]
train
https://github.com/derari/cthul/blob/74a31e3cb6a94f5f25cc5253d1dbd42e19a17ebc/objects/src/main/java/org/cthul/objects/Boxing.java#L157-L163
prestodb/presto
presto-main/src/main/java/com/facebook/presto/execution/buffer/ClientBuffer.java
ClientBuffer.loadPagesIfNecessary
private boolean loadPagesIfNecessary(PagesSupplier pagesSupplier, DataSize maxSize) { """ If there no data, attempt to load some from the pages supplier. """ checkState(!Thread.holdsLock(this), "Can not load pages while holding a lock on this"); boolean dataAddedOrNoMorePages; List<Ser...
java
private boolean loadPagesIfNecessary(PagesSupplier pagesSupplier, DataSize maxSize) { checkState(!Thread.holdsLock(this), "Can not load pages while holding a lock on this"); boolean dataAddedOrNoMorePages; List<SerializedPageReference> pageReferences; synchronized (this) { ...
[ "private", "boolean", "loadPagesIfNecessary", "(", "PagesSupplier", "pagesSupplier", ",", "DataSize", "maxSize", ")", "{", "checkState", "(", "!", "Thread", ".", "holdsLock", "(", "this", ")", ",", "\"Can not load pages while holding a lock on this\"", ")", ";", "bool...
If there no data, attempt to load some from the pages supplier.
[ "If", "there", "no", "data", "attempt", "to", "load", "some", "from", "the", "pages", "supplier", "." ]
train
https://github.com/prestodb/presto/blob/89de5e379d8f85e139d292b0add8c537a2a01a88/presto-main/src/main/java/com/facebook/presto/execution/buffer/ClientBuffer.java#L257-L291
Samsung/GearVRf
GVRf/Framework/framework/src/main/java/org/gearvrf/utility/ResourceCache.java
ResourceCache.wrapCallback
public static CompressedTextureCallback wrapCallback( ResourceCache<GVRImage> cache, CompressedTextureCallback callback) { """ Wrap the callback, to cache the {@link CompressedTextureCallback#loaded(GVRHybridObject, GVRAndroidResource) loaded()} resource """ return new CompressedTextureCa...
java
public static CompressedTextureCallback wrapCallback( ResourceCache<GVRImage> cache, CompressedTextureCallback callback) { return new CompressedTextureCallbackWrapper(cache, callback); }
[ "public", "static", "CompressedTextureCallback", "wrapCallback", "(", "ResourceCache", "<", "GVRImage", ">", "cache", ",", "CompressedTextureCallback", "callback", ")", "{", "return", "new", "CompressedTextureCallbackWrapper", "(", "cache", ",", "callback", ")", ";", ...
Wrap the callback, to cache the {@link CompressedTextureCallback#loaded(GVRHybridObject, GVRAndroidResource) loaded()} resource
[ "Wrap", "the", "callback", "to", "cache", "the", "{" ]
train
https://github.com/Samsung/GearVRf/blob/05034d465a7b0a494fabb9e9f2971ac19392f32d/GVRf/Framework/framework/src/main/java/org/gearvrf/utility/ResourceCache.java#L77-L80
aws/aws-sdk-java
aws-java-sdk-apigatewayv2/src/main/java/com/amazonaws/services/apigatewayv2/model/UpdateRouteResponseResult.java
UpdateRouteResponseResult.withResponseModels
public UpdateRouteResponseResult withResponseModels(java.util.Map<String, String> responseModels) { """ <p> Represents the response models of a route response. </p> @param responseModels Represents the response models of a route response. @return Returns a reference to this object so that method calls can b...
java
public UpdateRouteResponseResult withResponseModels(java.util.Map<String, String> responseModels) { setResponseModels(responseModels); return this; }
[ "public", "UpdateRouteResponseResult", "withResponseModels", "(", "java", ".", "util", ".", "Map", "<", "String", ",", "String", ">", "responseModels", ")", "{", "setResponseModels", "(", "responseModels", ")", ";", "return", "this", ";", "}" ]
<p> Represents the response models of a route response. </p> @param responseModels Represents the response models of a route response. @return Returns a reference to this object so that method calls can be chained together.
[ "<p", ">", "Represents", "the", "response", "models", "of", "a", "route", "response", ".", "<", "/", "p", ">" ]
train
https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-apigatewayv2/src/main/java/com/amazonaws/services/apigatewayv2/model/UpdateRouteResponseResult.java#L127-L130
grails/grails-core
grails-spring/src/main/groovy/org/grails/spring/GrailsApplicationContext.java
GrailsApplicationContext.registerSingleton
public void registerSingleton(String name, Class<?> clazz) throws BeansException { """ Register a singleton bean with the underlying bean factory. <p>For more advanced needs, register with the underlying BeanFactory directly. @see #getDefaultListableBeanFactory """ GenericBeanDefinition bd = new Gene...
java
public void registerSingleton(String name, Class<?> clazz) throws BeansException { GenericBeanDefinition bd = new GenericBeanDefinition(); bd.setBeanClass(clazz); getDefaultListableBeanFactory().registerBeanDefinition(name, bd); }
[ "public", "void", "registerSingleton", "(", "String", "name", ",", "Class", "<", "?", ">", "clazz", ")", "throws", "BeansException", "{", "GenericBeanDefinition", "bd", "=", "new", "GenericBeanDefinition", "(", ")", ";", "bd", ".", "setBeanClass", "(", "clazz"...
Register a singleton bean with the underlying bean factory. <p>For more advanced needs, register with the underlying BeanFactory directly. @see #getDefaultListableBeanFactory
[ "Register", "a", "singleton", "bean", "with", "the", "underlying", "bean", "factory", ".", "<p", ">", "For", "more", "advanced", "needs", "register", "with", "the", "underlying", "BeanFactory", "directly", "." ]
train
https://github.com/grails/grails-core/blob/c0b08aa995b0297143b75d05642abba8cb7b4122/grails-spring/src/main/groovy/org/grails/spring/GrailsApplicationContext.java#L132-L136
Microsoft/malmo
Minecraft/src/main/java/com/microsoft/Malmo/Utils/TCPSocketChannel.java
TCPSocketChannel.sendTCPString
public boolean sendTCPString(String message, int retries) { """ Send string over TCP to the specified address via the specified port, including a header. @param message string to be sent over TCP @param retries number of times to retry in event of failure @return true if message was successfully sent """ ...
java
public boolean sendTCPString(String message, int retries) { Log(Level.FINE, "About to send: " + message); byte[] bytes = message.getBytes(); return sendTCPBytes(bytes, retries); }
[ "public", "boolean", "sendTCPString", "(", "String", "message", ",", "int", "retries", ")", "{", "Log", "(", "Level", ".", "FINE", ",", "\"About to send: \"", "+", "message", ")", ";", "byte", "[", "]", "bytes", "=", "message", ".", "getBytes", "(", ")",...
Send string over TCP to the specified address via the specified port, including a header. @param message string to be sent over TCP @param retries number of times to retry in event of failure @return true if message was successfully sent
[ "Send", "string", "over", "TCP", "to", "the", "specified", "address", "via", "the", "specified", "port", "including", "a", "header", "." ]
train
https://github.com/Microsoft/malmo/blob/4139cd6f3e52f6e893a931a1d4b70d35f8e70e5a/Minecraft/src/main/java/com/microsoft/Malmo/Utils/TCPSocketChannel.java#L108-L113
deeplearning4j/deeplearning4j
nd4j/nd4j-common/src/main/java/org/nd4j/base/Preconditions.java
Preconditions.checkNotNull
public static void checkNotNull(Object o, String message, Object... args) { """ Check the specified boolean argument. Throws an IllegalStateException with the specified message if {@code o} is false. Note that the message may specify argument locations using "%s" - for example, {@code checkArgument(false, "Got %...
java
public static void checkNotNull(Object o, String message, Object... args) { if (o == null) { throwStateEx(message, args); } }
[ "public", "static", "void", "checkNotNull", "(", "Object", "o", ",", "String", "message", ",", "Object", "...", "args", ")", "{", "if", "(", "o", "==", "null", ")", "{", "throwStateEx", "(", "message", ",", "args", ")", ";", "}", "}" ]
Check the specified boolean argument. Throws an IllegalStateException with the specified message if {@code o} is false. Note that the message may specify argument locations using "%s" - for example, {@code checkArgument(false, "Got %s values, expected %s", 3, "more"} would throw an IllegalStateException with the messag...
[ "Check", "the", "specified", "boolean", "argument", ".", "Throws", "an", "IllegalStateException", "with", "the", "specified", "message", "if", "{", "@code", "o", "}", "is", "false", ".", "Note", "that", "the", "message", "may", "specify", "argument", "location...
train
https://github.com/deeplearning4j/deeplearning4j/blob/effce52f2afd7eeb53c5bcca699fcd90bd06822f/nd4j/nd4j-common/src/main/java/org/nd4j/base/Preconditions.java#L628-L632
deeplearning4j/deeplearning4j
deeplearning4j/deeplearning4j-nn/src/main/java/org/deeplearning4j/util/ValidationUtils.java
ValidationUtils.validate2x2NonNegative
public static int[][] validate2x2NonNegative(int[][] data, String paramName) { """ Reformats the input array to a 2x2 array and checks that all values are >= 0. If the array is 2x1 ([[a], [b]]), returns [[a, a], [b, b]] If the array is 1x2 ([[a, b]]), returns [[a, b], [a, b]] If the array is 2x2, returns the ...
java
public static int[][] validate2x2NonNegative(int[][] data, String paramName){ for(int[] part : data) validateNonNegative(part, paramName); return validate2x2(data, paramName); } /** * Reformats the input array to a 2x2 array. * * If the array is 2x1 ([[a], [b]]), ret...
[ "public", "static", "int", "[", "]", "[", "]", "validate2x2NonNegative", "(", "int", "[", "]", "[", "]", "data", ",", "String", "paramName", ")", "{", "for", "(", "int", "[", "]", "part", ":", "data", ")", "validateNonNegative", "(", "part", ",", "pa...
Reformats the input array to a 2x2 array and checks that all values are >= 0. If the array is 2x1 ([[a], [b]]), returns [[a, a], [b, b]] If the array is 1x2 ([[a, b]]), returns [[a, b], [a, b]] If the array is 2x2, returns the array @param data An array @param paramName The param name, for error reporting @return An ...
[ "Reformats", "the", "input", "array", "to", "a", "2x2", "array", "and", "checks", "that", "all", "values", "are", ">", "=", "0", "." ]
train
https://github.com/deeplearning4j/deeplearning4j/blob/effce52f2afd7eeb53c5bcca699fcd90bd06822f/deeplearning4j/deeplearning4j-nn/src/main/java/org/deeplearning4j/util/ValidationUtils.java#L172-L218
PeterisP/LVTagger
src/main/java/edu/stanford/nlp/io/IOUtils.java
IOUtils.writeObjectToFileNoExceptions
public static File writeObjectToFileNoExceptions(Object o, String filename) { """ Write object to a file with the specified name. @param o object to be written to file @param filename name of the temp file @return File containing the object, or null if an exception was caught """ File file = null...
java
public static File writeObjectToFileNoExceptions(Object o, String filename) { File file = null; ObjectOutputStream oos = null; try { file = new File(filename); // file.createNewFile(); // cdm may 2005: does nothing needed oos = new ObjectOutputStream(new BufferedOutputStream( ...
[ "public", "static", "File", "writeObjectToFileNoExceptions", "(", "Object", "o", ",", "String", "filename", ")", "{", "File", "file", "=", "null", ";", "ObjectOutputStream", "oos", "=", "null", ";", "try", "{", "file", "=", "new", "File", "(", "filename", ...
Write object to a file with the specified name. @param o object to be written to file @param filename name of the temp file @return File containing the object, or null if an exception was caught
[ "Write", "object", "to", "a", "file", "with", "the", "specified", "name", "." ]
train
https://github.com/PeterisP/LVTagger/blob/b3d44bab9ec07ace0d13612c448a6b7298c1f681/src/main/java/edu/stanford/nlp/io/IOUtils.java#L95-L111
eclipse/xtext-extras
org.eclipse.xtext.xbase/src/org/eclipse/xtext/xbase/typesystem/internal/ScopeProviderAccess.java
ScopeProviderAccess.getErrorNode
private INode getErrorNode(XExpression expression, INode node) { """ Returns the node that best describes the error, e.g. if there is an expression <code>com::foo::DoesNotExist::method()</code> the error will be rooted at <code>com</code>, but the real problem is <code>com::foo::DoesNotExist</code>. """ if...
java
private INode getErrorNode(XExpression expression, INode node) { if (expression instanceof XFeatureCall) { XFeatureCall featureCall = (XFeatureCall) expression; if (!canBeTypeLiteral(featureCall)) { return node; } if (featureCall.eContainingFeature() == XbasePackage.Literals.XMEMBER_FEATURE_CALL__MEMB...
[ "private", "INode", "getErrorNode", "(", "XExpression", "expression", ",", "INode", "node", ")", "{", "if", "(", "expression", "instanceof", "XFeatureCall", ")", "{", "XFeatureCall", "featureCall", "=", "(", "XFeatureCall", ")", "expression", ";", "if", "(", "...
Returns the node that best describes the error, e.g. if there is an expression <code>com::foo::DoesNotExist::method()</code> the error will be rooted at <code>com</code>, but the real problem is <code>com::foo::DoesNotExist</code>.
[ "Returns", "the", "node", "that", "best", "describes", "the", "error", "e", ".", "g", ".", "if", "there", "is", "an", "expression", "<code", ">", "com", "::", "foo", "::", "DoesNotExist", "::", "method", "()", "<", "/", "code", ">", "the", "error", "...
train
https://github.com/eclipse/xtext-extras/blob/451359541295323a29f5855e633f770cec02069a/org.eclipse.xtext.xbase/src/org/eclipse/xtext/xbase/typesystem/internal/ScopeProviderAccess.java#L187-L204
vatbub/common
core/src/main/java/com/github/vatbub/common/core/Prefs.java
Prefs.setPreference
public void setPreference(String prefKey, String prefValue) { """ Sets the value of the specified preference in the properties file @param prefKey The key of the preference to save @param prefValue The value of the preference to save """ props.setProperty(prefKey, prefValue); savePreferen...
java
public void setPreference(String prefKey, String prefValue) { props.setProperty(prefKey, prefValue); savePreferences(); }
[ "public", "void", "setPreference", "(", "String", "prefKey", ",", "String", "prefValue", ")", "{", "props", ".", "setProperty", "(", "prefKey", ",", "prefValue", ")", ";", "savePreferences", "(", ")", ";", "}" ]
Sets the value of the specified preference in the properties file @param prefKey The key of the preference to save @param prefValue The value of the preference to save
[ "Sets", "the", "value", "of", "the", "specified", "preference", "in", "the", "properties", "file" ]
train
https://github.com/vatbub/common/blob/8b9fd2ece0a23d520ce53b66c84cbd094e378443/core/src/main/java/com/github/vatbub/common/core/Prefs.java#L73-L76
GoogleCloudPlatform/bigdata-interop
gcsio/src/main/java/com/google/cloud/hadoop/gcsio/GoogleCloudStorageImpl.java
GoogleCloudStorageImpl.createItemInfoForBucket
public static GoogleCloudStorageItemInfo createItemInfoForBucket( StorageResourceId resourceId, Bucket bucket) { """ Helper for converting a StorageResourceId + Bucket into a GoogleCloudStorageItemInfo. """ Preconditions.checkArgument(resourceId != null, "resourceId must not be null"); Preconditi...
java
public static GoogleCloudStorageItemInfo createItemInfoForBucket( StorageResourceId resourceId, Bucket bucket) { Preconditions.checkArgument(resourceId != null, "resourceId must not be null"); Preconditions.checkArgument(bucket != null, "bucket must not be null"); Preconditions.checkArgument( ...
[ "public", "static", "GoogleCloudStorageItemInfo", "createItemInfoForBucket", "(", "StorageResourceId", "resourceId", ",", "Bucket", "bucket", ")", "{", "Preconditions", ".", "checkArgument", "(", "resourceId", "!=", "null", ",", "\"resourceId must not be null\"", ")", ";"...
Helper for converting a StorageResourceId + Bucket into a GoogleCloudStorageItemInfo.
[ "Helper", "for", "converting", "a", "StorageResourceId", "+", "Bucket", "into", "a", "GoogleCloudStorageItemInfo", "." ]
train
https://github.com/GoogleCloudPlatform/bigdata-interop/blob/918d91c80a63e36046edb28972a5c65d3326a858/gcsio/src/main/java/com/google/cloud/hadoop/gcsio/GoogleCloudStorageImpl.java#L1451-L1465
liferay/com-liferay-commerce
commerce-tax-service/src/main/java/com/liferay/commerce/tax/service/persistence/impl/CommerceTaxMethodPersistenceImpl.java
CommerceTaxMethodPersistenceImpl.findAll
@Override public List<CommerceTaxMethod> findAll(int start, int end) { """ Returns a range of all the commerce tax methods. <p> Useful when paginating results. Returns a maximum of <code>end - start</code> instances. <code>start</code> and <code>end</code> are not primary keys, they are indexes in the result ...
java
@Override public List<CommerceTaxMethod> findAll(int start, int end) { return findAll(start, end, null); }
[ "@", "Override", "public", "List", "<", "CommerceTaxMethod", ">", "findAll", "(", "int", "start", ",", "int", "end", ")", "{", "return", "findAll", "(", "start", ",", "end", ",", "null", ")", ";", "}" ]
Returns a range of all the commerce tax methods. <p> Useful when paginating results. Returns a maximum of <code>end - start</code> instances. <code>start</code> and <code>end</code> are not primary keys, they are indexes in the result set. Thus, <code>0</code> refers to the first result in the set. Setting both <code>...
[ "Returns", "a", "range", "of", "all", "the", "commerce", "tax", "methods", "." ]
train
https://github.com/liferay/com-liferay-commerce/blob/9e54362d7f59531fc684016ba49ee7cdc3a2f22b/commerce-tax-service/src/main/java/com/liferay/commerce/tax/service/persistence/impl/CommerceTaxMethodPersistenceImpl.java#L2005-L2008
Azure/azure-sdk-for-java
containerregistry/resource-manager/v2018_09_01/src/main/java/com/microsoft/azure/management/containerregistry/v2018_09_01/implementation/TasksInner.java
TasksInner.createAsync
public Observable<TaskInner> createAsync(String resourceGroupName, String registryName, String taskName, TaskInner taskCreateParameters) { """ Creates a task for a container registry with the specified parameters. @param resourceGroupName The name of the resource group to which the container registry belongs. ...
java
public Observable<TaskInner> createAsync(String resourceGroupName, String registryName, String taskName, TaskInner taskCreateParameters) { return createWithServiceResponseAsync(resourceGroupName, registryName, taskName, taskCreateParameters).map(new Func1<ServiceResponse<TaskInner>, TaskInner>() { @...
[ "public", "Observable", "<", "TaskInner", ">", "createAsync", "(", "String", "resourceGroupName", ",", "String", "registryName", ",", "String", "taskName", ",", "TaskInner", "taskCreateParameters", ")", "{", "return", "createWithServiceResponseAsync", "(", "resourceGrou...
Creates a task for a container registry with the specified parameters. @param resourceGroupName The name of the resource group to which the container registry belongs. @param registryName The name of the container registry. @param taskName The name of the container registry task. @param taskCreateParameters The parame...
[ "Creates", "a", "task", "for", "a", "container", "registry", "with", "the", "specified", "parameters", "." ]
train
https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/containerregistry/resource-manager/v2018_09_01/src/main/java/com/microsoft/azure/management/containerregistry/v2018_09_01/implementation/TasksInner.java#L362-L369
getlantern/kaleidoscope
src/main/java/org/kaleidoscope/LocalTrustGraph.java
LocalTrustGraph.addRoute
public void addRoute(final LocalTrustGraphNode a, final LocalTrustGraphNode b) { """ add bidirectioanl trust graph links between two nodes. @param a node that will form a trust link with 'b' @param b node that will form a trust link with 'a' """ addDirectedRoute(a,b); addDirectedRoute(b,a);...
java
public void addRoute(final LocalTrustGraphNode a, final LocalTrustGraphNode b) { addDirectedRoute(a,b); addDirectedRoute(b,a); }
[ "public", "void", "addRoute", "(", "final", "LocalTrustGraphNode", "a", ",", "final", "LocalTrustGraphNode", "b", ")", "{", "addDirectedRoute", "(", "a", ",", "b", ")", ";", "addDirectedRoute", "(", "b", ",", "a", ")", ";", "}" ]
add bidirectioanl trust graph links between two nodes. @param a node that will form a trust link with 'b' @param b node that will form a trust link with 'a'
[ "add", "bidirectioanl", "trust", "graph", "links", "between", "two", "nodes", "." ]
train
https://github.com/getlantern/kaleidoscope/blob/7516f05724c8f54e5d535d23da9116817c08a09f/src/main/java/org/kaleidoscope/LocalTrustGraph.java#L271-L274
powermock/powermock
powermock-reflect/src/main/java/org/powermock/reflect/internal/WhiteboxImpl.java
WhiteboxImpl.setInternalState
public static void setInternalState(Object object, Object value, Object... additionalValues) { """ Set the value of a field using reflection. This method will traverse the super class hierarchy until the first field assignable to the <tt>value</tt> type is found. The <tt>value</tt> (or <tt>additionaValues</tt> ...
java
public static void setInternalState(Object object, Object value, Object... additionalValues) { setField(object, value, findFieldInHierarchy(object, new AssignableFromFieldTypeMatcherStrategy(getType(value)))); if (additionalValues != null && additionalValues.length > 0) { for...
[ "public", "static", "void", "setInternalState", "(", "Object", "object", ",", "Object", "value", ",", "Object", "...", "additionalValues", ")", "{", "setField", "(", "object", ",", "value", ",", "findFieldInHierarchy", "(", "object", ",", "new", "AssignableFromF...
Set the value of a field using reflection. This method will traverse the super class hierarchy until the first field assignable to the <tt>value</tt> type is found. The <tt>value</tt> (or <tt>additionaValues</tt> if present) will then be assigned to this field. @param object the object to modify @param value...
[ "Set", "the", "value", "of", "a", "field", "using", "reflection", ".", "This", "method", "will", "traverse", "the", "super", "class", "hierarchy", "until", "the", "first", "field", "assignable", "to", "the", "<tt", ">", "value<", "/", "tt", ">", "type", ...
train
https://github.com/powermock/powermock/blob/e8cd68026c284c6a7efe66959809eeebd8d1f9ad/powermock-reflect/src/main/java/org/powermock/reflect/internal/WhiteboxImpl.java#L343-L355
exoplatform/jcr
exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/RepositoryImpl.java
RepositoryImpl.internalLogin
SessionImpl internalLogin(ConversationState state, String workspaceName) throws LoginException, NoSuchWorkspaceException, RepositoryException { """ Internal login. @param state ConversationState @param workspaceName workspace name @return SessionImpl @throws LoginException error of logic @throws NoSuc...
java
SessionImpl internalLogin(ConversationState state, String workspaceName) throws LoginException, NoSuchWorkspaceException, RepositoryException { if (workspaceName == null) { workspaceName = config.getDefaultWorkspaceName(); if (workspaceName == null) { throw n...
[ "SessionImpl", "internalLogin", "(", "ConversationState", "state", ",", "String", "workspaceName", ")", "throws", "LoginException", ",", "NoSuchWorkspaceException", ",", "RepositoryException", "{", "if", "(", "workspaceName", "==", "null", ")", "{", "workspaceName", "...
Internal login. @param state ConversationState @param workspaceName workspace name @return SessionImpl @throws LoginException error of logic @throws NoSuchWorkspaceException if no workspace found with name @throws RepositoryException Repository error
[ "Internal", "login", "." ]
train
https://github.com/exoplatform/jcr/blob/3e7f9ee1b5683640d73a4316fb4b0ad5eac5b8a2/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/RepositoryImpl.java#L684-L705
foundation-runtime/service-directory
1.2/sd-api/src/main/java/com/cisco/oss/foundation/directory/lookup/LookupManagerImpl.java
LookupManagerImpl.removeNotificationHandler
@Override public void removeNotificationHandler(String serviceName, NotificationHandler handler) throws ServiceException { """ Remove the NotificationHandler from the Service. @param serviceName the service name. @param handler the NotificationHandler for the service. @deprecated """ Servic...
java
@Override public void removeNotificationHandler(String serviceName, NotificationHandler handler) throws ServiceException { ServiceInstanceUtils.validateManagerIsStarted(isStarted.get()); ServiceInstanceUtils.validateServiceName(serviceName); if (handler == null) { throw new Serv...
[ "@", "Override", "public", "void", "removeNotificationHandler", "(", "String", "serviceName", ",", "NotificationHandler", "handler", ")", "throws", "ServiceException", "{", "ServiceInstanceUtils", ".", "validateManagerIsStarted", "(", "isStarted", ".", "get", "(", ")", ...
Remove the NotificationHandler from the Service. @param serviceName the service name. @param handler the NotificationHandler for the service. @deprecated
[ "Remove", "the", "NotificationHandler", "from", "the", "Service", "." ]
train
https://github.com/foundation-runtime/service-directory/blob/a7bdefe173dc99e75eff4a24e07e6407e62f2ed4/1.2/sd-api/src/main/java/com/cisco/oss/foundation/directory/lookup/LookupManagerImpl.java#L385-L397
Tourenathan-G5organisation/SiliCompressor
silicompressor/src/main/java/com/iceteck/silicompressorr/SiliCompressor.java
SiliCompressor.getCompressBitmap
public Bitmap getCompressBitmap(String imagePath, boolean deleteSourceImage) throws IOException { """ Compress the image at with the specified path and return the bitmap data of the compressed image. @param imagePath The path of the image file you wish to compress. @param deleteSourceImage If True will...
java
public Bitmap getCompressBitmap(String imagePath, boolean deleteSourceImage) throws IOException { File imageFile = new File(compressImage(imagePath, new File(Environment.getExternalStoragePublicDirectory(Environment.DIRECTORY_PICTURES), "Silicompressor/images"))); Uri newImageUri = FileProvider.getUriFo...
[ "public", "Bitmap", "getCompressBitmap", "(", "String", "imagePath", ",", "boolean", "deleteSourceImage", ")", "throws", "IOException", "{", "File", "imageFile", "=", "new", "File", "(", "compressImage", "(", "imagePath", ",", "new", "File", "(", "Environment", ...
Compress the image at with the specified path and return the bitmap data of the compressed image. @param imagePath The path of the image file you wish to compress. @param deleteSourceImage If True will delete the source file @return Compress image bitmap @throws IOException
[ "Compress", "the", "image", "at", "with", "the", "specified", "path", "and", "return", "the", "bitmap", "data", "of", "the", "compressed", "image", "." ]
train
https://github.com/Tourenathan-G5organisation/SiliCompressor/blob/546f6cd7b2a7a783e1122df46c1e237f8938fe72/silicompressor/src/main/java/com/iceteck/silicompressorr/SiliCompressor.java#L161-L178
BorderTech/wcomponents
wcomponents-core/src/main/java/com/github/bordertech/wcomponents/render/webxml/WDataTableRenderer.java
WDataTableRenderer.doPaintRows
private void doPaintRows(final WDataTable table, final WebXmlRenderContext renderContext) { """ Override paintRow so that we only paint the first-level nodes for tree-tables. @param table the table to paint the rows for. @param renderContext the RenderContext to paint to. """ TableDataModel model = table...
java
private void doPaintRows(final WDataTable table, final WebXmlRenderContext renderContext) { TableDataModel model = table.getDataModel(); WRepeater repeater = table.getRepeater(); List<?> beanList = repeater.getBeanList(); final int rowCount = beanList.size(); WComponent row = repeater.getRepeatedComponent(); ...
[ "private", "void", "doPaintRows", "(", "final", "WDataTable", "table", ",", "final", "WebXmlRenderContext", "renderContext", ")", "{", "TableDataModel", "model", "=", "table", ".", "getDataModel", "(", ")", ";", "WRepeater", "repeater", "=", "table", ".", "getRe...
Override paintRow so that we only paint the first-level nodes for tree-tables. @param table the table to paint the rows for. @param renderContext the RenderContext to paint to.
[ "Override", "paintRow", "so", "that", "we", "only", "paint", "the", "first", "-", "level", "nodes", "for", "tree", "-", "tables", "." ]
train
https://github.com/BorderTech/wcomponents/blob/d1a2b2243270067db030feb36ca74255aaa94436/wcomponents-core/src/main/java/com/github/bordertech/wcomponents/render/webxml/WDataTableRenderer.java#L332-L362
Azure/azure-sdk-for-java
kusto/resource-manager/v2018_09_07_preview/src/main/java/com/microsoft/azure/management/kusto/v2018_09_07_preview/implementation/ClustersInner.java
ClustersInner.beginUpdate
public ClusterInner beginUpdate(String resourceGroupName, String clusterName, ClusterUpdate parameters) { """ Update a Kusto cluster. @param resourceGroupName The name of the resource group containing the Kusto cluster. @param clusterName The name of the Kusto cluster. @param parameters The Kusto cluster para...
java
public ClusterInner beginUpdate(String resourceGroupName, String clusterName, ClusterUpdate parameters) { return beginUpdateWithServiceResponseAsync(resourceGroupName, clusterName, parameters).toBlocking().single().body(); }
[ "public", "ClusterInner", "beginUpdate", "(", "String", "resourceGroupName", ",", "String", "clusterName", ",", "ClusterUpdate", "parameters", ")", "{", "return", "beginUpdateWithServiceResponseAsync", "(", "resourceGroupName", ",", "clusterName", ",", "parameters", ")", ...
Update a Kusto cluster. @param resourceGroupName The name of the resource group containing the Kusto cluster. @param clusterName The name of the Kusto cluster. @param parameters The Kusto cluster parameters supplied to the Update operation. @throws IllegalArgumentException thrown if parameters fail the validation @thr...
[ "Update", "a", "Kusto", "cluster", "." ]
train
https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/kusto/resource-manager/v2018_09_07_preview/src/main/java/com/microsoft/azure/management/kusto/v2018_09_07_preview/implementation/ClustersInner.java#L480-L482
eduarddrenth/ConfigurableReports
src/main/java/com/vectorprint/report/itext/EventHelper.java
EventHelper.printFailureHeader
protected void printFailureHeader(PdfTemplate template, float x, float y) { """ when failure information is appended to the report, a header on each page will be printed refering to this information. @param template @param x @param y """ Font f = DebugHelper.debugFontLink(template, getSettings()); ...
java
protected void printFailureHeader(PdfTemplate template, float x, float y) { Font f = DebugHelper.debugFontLink(template, getSettings()); Chunk c = new Chunk(getSettings().getProperty("failures in report, see end of report", "failureheader"), f); ColumnText.showTextAligned(template, Element.ALIGN_LEFT,...
[ "protected", "void", "printFailureHeader", "(", "PdfTemplate", "template", ",", "float", "x", ",", "float", "y", ")", "{", "Font", "f", "=", "DebugHelper", ".", "debugFontLink", "(", "template", ",", "getSettings", "(", ")", ")", ";", "Chunk", "c", "=", ...
when failure information is appended to the report, a header on each page will be printed refering to this information. @param template @param x @param y
[ "when", "failure", "information", "is", "appended", "to", "the", "report", "a", "header", "on", "each", "page", "will", "be", "printed", "refering", "to", "this", "information", "." ]
train
https://github.com/eduarddrenth/ConfigurableReports/blob/b5fb7a89e16d9b35f557f3bf620594f821fa1552/src/main/java/com/vectorprint/report/itext/EventHelper.java#L242-L246
netscaler/nitro
src/main/java/com/citrix/netscaler/nitro/resource/config/aaa/aaapreauthenticationpolicy_binding.java
aaapreauthenticationpolicy_binding.get
public static aaapreauthenticationpolicy_binding get(nitro_service service, String name) throws Exception { """ Use this API to fetch aaapreauthenticationpolicy_binding resource of given name . """ aaapreauthenticationpolicy_binding obj = new aaapreauthenticationpolicy_binding(); obj.set_name(name); aaap...
java
public static aaapreauthenticationpolicy_binding get(nitro_service service, String name) throws Exception{ aaapreauthenticationpolicy_binding obj = new aaapreauthenticationpolicy_binding(); obj.set_name(name); aaapreauthenticationpolicy_binding response = (aaapreauthenticationpolicy_binding) obj.get_resource(serv...
[ "public", "static", "aaapreauthenticationpolicy_binding", "get", "(", "nitro_service", "service", ",", "String", "name", ")", "throws", "Exception", "{", "aaapreauthenticationpolicy_binding", "obj", "=", "new", "aaapreauthenticationpolicy_binding", "(", ")", ";", "obj", ...
Use this API to fetch aaapreauthenticationpolicy_binding resource of given name .
[ "Use", "this", "API", "to", "fetch", "aaapreauthenticationpolicy_binding", "resource", "of", "given", "name", "." ]
train
https://github.com/netscaler/nitro/blob/2a98692dcf4e4ec430c7d7baab8382e4ba5a35e4/src/main/java/com/citrix/netscaler/nitro/resource/config/aaa/aaapreauthenticationpolicy_binding.java#L114-L119
dustin/java-memcached-client
src/main/java/net/spy/memcached/MemcachedClient.java
MemcachedClient.getVersions
@Override public Map<SocketAddress, String> getVersions() { """ Get the versions of all of the connected memcacheds. @return a Map of SocketAddress to String for connected servers @throws IllegalStateException in the rare circumstance where queue is too full to accept any more requests """ final Map...
java
@Override public Map<SocketAddress, String> getVersions() { final Map<SocketAddress, String> rv = new ConcurrentHashMap<SocketAddress, String>(); CountDownLatch blatch = broadcastOp(new BroadcastOpFactory() { @Override public Operation newOp(final MemcachedNode n, final CountDow...
[ "@", "Override", "public", "Map", "<", "SocketAddress", ",", "String", ">", "getVersions", "(", ")", "{", "final", "Map", "<", "SocketAddress", ",", "String", ">", "rv", "=", "new", "ConcurrentHashMap", "<", "SocketAddress", ",", "String", ">", "(", ")", ...
Get the versions of all of the connected memcacheds. @return a Map of SocketAddress to String for connected servers @throws IllegalStateException in the rare circumstance where queue is too full to accept any more requests
[ "Get", "the", "versions", "of", "all", "of", "the", "connected", "memcacheds", "." ]
train
https://github.com/dustin/java-memcached-client/blob/c232307ad8e0c7ccc926e495dd7d5aad2d713318/src/main/java/net/spy/memcached/MemcachedClient.java#L1658-L1687
liferay/com-liferay-commerce
commerce-service/src/main/java/com/liferay/commerce/service/persistence/impl/CommerceAddressPersistenceImpl.java
CommerceAddressPersistenceImpl.findByCommerceCountryId
@Override public List<CommerceAddress> findByCommerceCountryId( long commerceCountryId, int start, int end) { """ Returns a range of all the commerce addresses where commerceCountryId = &#63;. <p> Useful when paginating results. Returns a maximum of <code>end - start</code> instances. <code>start</code> and...
java
@Override public List<CommerceAddress> findByCommerceCountryId( long commerceCountryId, int start, int end) { return findByCommerceCountryId(commerceCountryId, start, end, null); }
[ "@", "Override", "public", "List", "<", "CommerceAddress", ">", "findByCommerceCountryId", "(", "long", "commerceCountryId", ",", "int", "start", ",", "int", "end", ")", "{", "return", "findByCommerceCountryId", "(", "commerceCountryId", ",", "start", ",", "end", ...
Returns a range of all the commerce addresses where commerceCountryId = &#63;. <p> Useful when paginating results. Returns a maximum of <code>end - start</code> instances. <code>start</code> and <code>end</code> are not primary keys, they are indexes in the result set. Thus, <code>0</code> refers to the first result i...
[ "Returns", "a", "range", "of", "all", "the", "commerce", "addresses", "where", "commerceCountryId", "=", "&#63", ";", "." ]
train
https://github.com/liferay/com-liferay-commerce/blob/9e54362d7f59531fc684016ba49ee7cdc3a2f22b/commerce-service/src/main/java/com/liferay/commerce/service/persistence/impl/CommerceAddressPersistenceImpl.java#L660-L664
ManfredTremmel/gwt-commons-lang3
src/main/java/org/apache/commons/lang3/builder/ReflectionToStringBuilder.java
ReflectionToStringBuilder.toStringExclude
public static String toStringExclude(final Object object, final Collection<String> excludeFieldNames) { """ Builds a String for a toString method excluding the given field names. @param object The object to "toString". @param excludeFieldNames The field names to exclude. Null excludes nothing. @return The t...
java
public static String toStringExclude(final Object object, final Collection<String> excludeFieldNames) { return toStringExclude(object, toNoNullStringArray(excludeFieldNames)); }
[ "public", "static", "String", "toStringExclude", "(", "final", "Object", "object", ",", "final", "Collection", "<", "String", ">", "excludeFieldNames", ")", "{", "return", "toStringExclude", "(", "object", ",", "toNoNullStringArray", "(", "excludeFieldNames", ")", ...
Builds a String for a toString method excluding the given field names. @param object The object to "toString". @param excludeFieldNames The field names to exclude. Null excludes nothing. @return The toString value.
[ "Builds", "a", "String", "for", "a", "toString", "method", "excluding", "the", "given", "field", "names", "." ]
train
https://github.com/ManfredTremmel/gwt-commons-lang3/blob/9e2dfbbda3668cfa5d935fe76479d1426c294504/src/main/java/org/apache/commons/lang3/builder/ReflectionToStringBuilder.java#L375-L377
glyptodon/guacamole-client
extensions/guacamole-auth-totp/src/main/java/org/apache/guacamole/totp/TOTPGenerator.java
TOTPGenerator.getMacInstance
private static Mac getMacInstance(Mode mode, Key key) throws InvalidKeyException { """ Returns a new Mac instance which produces message authentication codes using the given secret key and the algorithm required by the given TOTP mode. @param mode The TOTP mode which dictates the HMAC algorithm t...
java
private static Mac getMacInstance(Mode mode, Key key) throws InvalidKeyException { try { Mac hmac = Mac.getInstance(mode.getAlgorithmName()); hmac.init(key); return hmac; } catch (NoSuchAlgorithmException e) { throw new UnsupportedOper...
[ "private", "static", "Mac", "getMacInstance", "(", "Mode", "mode", ",", "Key", "key", ")", "throws", "InvalidKeyException", "{", "try", "{", "Mac", "hmac", "=", "Mac", ".", "getInstance", "(", "mode", ".", "getAlgorithmName", "(", ")", ")", ";", "hmac", ...
Returns a new Mac instance which produces message authentication codes using the given secret key and the algorithm required by the given TOTP mode. @param mode The TOTP mode which dictates the HMAC algorithm to be used. @param key The secret key to use to produce message authentication codes. @return A new Mac inst...
[ "Returns", "a", "new", "Mac", "instance", "which", "produces", "message", "authentication", "codes", "using", "the", "given", "secret", "key", "and", "the", "algorithm", "required", "by", "the", "given", "TOTP", "mode", "." ]
train
https://github.com/glyptodon/guacamole-client/blob/ea1b10e9d1e3f1fa640dff2ca64d61b44bf1ace9/extensions/guacamole-auth-totp/src/main/java/org/apache/guacamole/totp/TOTPGenerator.java#L298-L312