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
netscaler/sdx_nitro
src/main/java/com/citrix/sdx/nitro/resource/config/br/br_restoreconfig.java
br_restoreconfig.get_nitro_bulk_response
protected base_resource[] get_nitro_bulk_response(nitro_service service, String response) throws Exception { """ <pre> Converts API response of bulk operation into object and returns the object array in case of get request. </pre> """ br_restoreconfig_responses result = (br_restoreconfig_responses) servic...
java
protected base_resource[] get_nitro_bulk_response(nitro_service service, String response) throws Exception { br_restoreconfig_responses result = (br_restoreconfig_responses) service.get_payload_formatter().string_to_resource(br_restoreconfig_responses.class, response); if(result.errorcode != 0) { if (res...
[ "protected", "base_resource", "[", "]", "get_nitro_bulk_response", "(", "nitro_service", "service", ",", "String", "response", ")", "throws", "Exception", "{", "br_restoreconfig_responses", "result", "=", "(", "br_restoreconfig_responses", ")", "service", ".", "get_payl...
<pre> Converts API response of bulk operation into object and returns the object array in case of get request. </pre>
[ "<pre", ">", "Converts", "API", "response", "of", "bulk", "operation", "into", "object", "and", "returns", "the", "object", "array", "in", "case", "of", "get", "request", ".", "<", "/", "pre", ">" ]
train
https://github.com/netscaler/sdx_nitro/blob/c840919f1a8f7c0a5634c0f23d34fa14d1765ff1/src/main/java/com/citrix/sdx/nitro/resource/config/br/br_restoreconfig.java#L157-L174
sagiegurari/fax4j
src/main/java/org/fax4j/spi/http/ApacheHTTPClient.java
ApacheHTTPClient.createMultiPartRequestContent
protected RequestEntity createMultiPartRequestContent(HTTPRequest httpRequest,HttpMethodBase httpMethodClient) { """ This function creates a multi part type request entity and populates it with the data from the provided HTTP request. @param httpRequest The HTTP request @param httpMethodClient The apach...
java
protected RequestEntity createMultiPartRequestContent(HTTPRequest httpRequest,HttpMethodBase httpMethodClient) { RequestEntity requestEntity=null; ContentPart<?>[] contentParts=httpRequest.getContentAsParts(); if(contentParts!=null) { int partsAmount=contentParts.length; ...
[ "protected", "RequestEntity", "createMultiPartRequestContent", "(", "HTTPRequest", "httpRequest", ",", "HttpMethodBase", "httpMethodClient", ")", "{", "RequestEntity", "requestEntity", "=", "null", ";", "ContentPart", "<", "?", ">", "[", "]", "contentParts", "=", "htt...
This function creates a multi part type request entity and populates it with the data from the provided HTTP request. @param httpRequest The HTTP request @param httpMethodClient The apache HTTP method @return The request entity
[ "This", "function", "creates", "a", "multi", "part", "type", "request", "entity", "and", "populates", "it", "with", "the", "data", "from", "the", "provided", "HTTP", "request", "." ]
train
https://github.com/sagiegurari/fax4j/blob/42fa51acabe7bf279e27ab3dd1cf76146b27955f/src/main/java/org/fax4j/spi/http/ApacheHTTPClient.java#L331-L387
moparisthebest/beehive
beehive-netui-tags/src/main/java/org/apache/beehive/netui/tags/tree/TreeRenderer.java
TreeRenderer.renderIndentation
protected void renderIndentation(AbstractRenderAppender writer, TreeElement node, int level, InheritableState state) { """ Write out the images that create the leading indentation for the given node. @param writer the appender where the node indentation images are appended @param node the node to render @param ...
java
protected void renderIndentation(AbstractRenderAppender writer, TreeElement node, int level, InheritableState state) { InternalStringBuilder img = new InternalStringBuilder(32); // Create the appropriate number of indents // These are either the spacer.gif if the parent is the last in the l...
[ "protected", "void", "renderIndentation", "(", "AbstractRenderAppender", "writer", ",", "TreeElement", "node", ",", "int", "level", ",", "InheritableState", "state", ")", "{", "InternalStringBuilder", "img", "=", "new", "InternalStringBuilder", "(", "32", ")", ";", ...
Write out the images that create the leading indentation for the given node. @param writer the appender where the node indentation images are appended @param node the node to render @param level the level or depth of the node within the tree @param state the set of tree properties that are used to render the tree marku...
[ "Write", "out", "the", "images", "that", "create", "the", "leading", "indentation", "for", "the", "given", "node", "." ]
train
https://github.com/moparisthebest/beehive/blob/4246a0cc40ce3c05f1a02c2da2653ac622703d77/beehive-netui-tags/src/main/java/org/apache/beehive/netui/tags/tree/TreeRenderer.java#L263-L304
maxirosson/jdroid-android
jdroid-android-sqlite/src/main/java/com/jdroid/android/sqlite/repository/SQLiteRepository.java
SQLiteRepository.addColumn
private void addColumn(StringBuilder builder, Column column) { """ Generate the SQL definition for a column. @param builder current StringBuilder to add the SQL definition. @param column column definition. """ builder.append(column.getColumnName()); builder.append(" "); builder.append(column.getDataT...
java
private void addColumn(StringBuilder builder, Column column) { builder.append(column.getColumnName()); builder.append(" "); builder.append(column.getDataType().getType()); Boolean optional = column.isOptional(); if (optional != null) { builder.append(optional ? " NULL" : " NOT NULL"); } String extraQua...
[ "private", "void", "addColumn", "(", "StringBuilder", "builder", ",", "Column", "column", ")", "{", "builder", ".", "append", "(", "column", ".", "getColumnName", "(", ")", ")", ";", "builder", ".", "append", "(", "\" \"", ")", ";", "builder", ".", "appe...
Generate the SQL definition for a column. @param builder current StringBuilder to add the SQL definition. @param column column definition.
[ "Generate", "the", "SQL", "definition", "for", "a", "column", "." ]
train
https://github.com/maxirosson/jdroid-android/blob/1ba9cae56a16fa36bdb2c9c04379853f0300707f/jdroid-android-sqlite/src/main/java/com/jdroid/android/sqlite/repository/SQLiteRepository.java#L508-L521
j-a-w-r/jawr
jawr-core/src/main/java/net/jawr/web/resource/bundle/css/CssDebugUrlRewriter.java
CssDebugUrlRewriter.rewriteGeneratedBinaryResourceDebugUrl
public static String rewriteGeneratedBinaryResourceDebugUrl(String requestPath, String content, String binaryServletMapping) { """ Rewrites the generated binary resource URL for debug mode @param requestPath the request path @param content the content to rewrite @param binaryServletMapping the binary servl...
java
public static String rewriteGeneratedBinaryResourceDebugUrl(String requestPath, String content, String binaryServletMapping) { // Write the content of the CSS in the Stringwriter if (binaryServletMapping == null) { binaryServletMapping = ""; } // Define the replacement pattern for the generated binary reso...
[ "public", "static", "String", "rewriteGeneratedBinaryResourceDebugUrl", "(", "String", "requestPath", ",", "String", "content", ",", "String", "binaryServletMapping", ")", "{", "// Write the content of the CSS in the Stringwriter", "if", "(", "binaryServletMapping", "==", "nu...
Rewrites the generated binary resource URL for debug mode @param requestPath the request path @param content the content to rewrite @param binaryServletMapping the binary servlet mapping @return the rewritten content
[ "Rewrites", "the", "generated", "binary", "resource", "URL", "for", "debug", "mode" ]
train
https://github.com/j-a-w-r/jawr/blob/1fa7cd46ebcd36908bd90b298ca316fa5b0c1b0d/jawr-core/src/main/java/net/jawr/web/resource/bundle/css/CssDebugUrlRewriter.java#L44-L68
Azure/azure-sdk-for-java
automation/resource-manager/v2015_10_31/src/main/java/com/microsoft/azure/management/automation/v2015_10_31/implementation/AutomationAccountsInner.java
AutomationAccountsInner.createOrUpdateAsync
public Observable<AutomationAccountInner> createOrUpdateAsync(String resourceGroupName, String automationAccountName, AutomationAccountCreateOrUpdateParameters parameters) { """ Create or update automation account. @param resourceGroupName Name of an Azure Resource group. @param automationAccountName The name ...
java
public Observable<AutomationAccountInner> createOrUpdateAsync(String resourceGroupName, String automationAccountName, AutomationAccountCreateOrUpdateParameters parameters) { return createOrUpdateWithServiceResponseAsync(resourceGroupName, automationAccountName, parameters).map(new Func1<ServiceResponse<Automati...
[ "public", "Observable", "<", "AutomationAccountInner", ">", "createOrUpdateAsync", "(", "String", "resourceGroupName", ",", "String", "automationAccountName", ",", "AutomationAccountCreateOrUpdateParameters", "parameters", ")", "{", "return", "createOrUpdateWithServiceResponseAsy...
Create or update automation account. @param resourceGroupName Name of an Azure Resource group. @param automationAccountName The name of the automation account. @param parameters Parameters supplied to the create or update automation account. @throws IllegalArgumentException thrown if parameters fail the validation @re...
[ "Create", "or", "update", "automation", "account", "." ]
train
https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/automation/resource-manager/v2015_10_31/src/main/java/com/microsoft/azure/management/automation/v2015_10_31/implementation/AutomationAccountsInner.java#L234-L241
JM-Lab/utils-java8
src/main/java/kr/jm/utils/datastructure/JMMap.java
JMMap.removeAllIfByEntry
public static <K, V> List<V> removeAllIfByEntry(Map<K, V> map, Predicate<? super Entry<K, V>> filter) { """ Remove all if by entry list. @param <K> the type parameter @param <V> the type parameter @param map the map @param filter the filter @return the list """ return getEnt...
java
public static <K, V> List<V> removeAllIfByEntry(Map<K, V> map, Predicate<? super Entry<K, V>> filter) { return getEntryStreamWithFilter(map, filter).map(Entry::getKey) .collect(toList()).stream().map(map::remove) .collect(toList()); }
[ "public", "static", "<", "K", ",", "V", ">", "List", "<", "V", ">", "removeAllIfByEntry", "(", "Map", "<", "K", ",", "V", ">", "map", ",", "Predicate", "<", "?", "super", "Entry", "<", "K", ",", "V", ">", ">", "filter", ")", "{", "return", "get...
Remove all if by entry list. @param <K> the type parameter @param <V> the type parameter @param map the map @param filter the filter @return the list
[ "Remove", "all", "if", "by", "entry", "list", "." ]
train
https://github.com/JM-Lab/utils-java8/blob/9e407b3f28a7990418a1e877229fa8344f4d78a5/src/main/java/kr/jm/utils/datastructure/JMMap.java#L47-L52
comapi/comapi-sdk-android
COMAPI/foundation/src/main/java/com/comapi/internal/network/InternalService.java
InternalService.updateMessageStatus
public void updateMessageStatus(@NonNull final String conversationId, @NonNull final List<MessageStatusUpdate> msgStatusList, @Nullable Callback<ComapiResult<Void>> callback) { """ Sets statuses for sets of messages. @param conversationId ID of a conversation to modify. @param msgStatusList List of status mod...
java
public void updateMessageStatus(@NonNull final String conversationId, @NonNull final List<MessageStatusUpdate> msgStatusList, @Nullable Callback<ComapiResult<Void>> callback) { adapter.adapt(updateMessageStatus(conversationId, msgStatusList), callback); }
[ "public", "void", "updateMessageStatus", "(", "@", "NonNull", "final", "String", "conversationId", ",", "@", "NonNull", "final", "List", "<", "MessageStatusUpdate", ">", "msgStatusList", ",", "@", "Nullable", "Callback", "<", "ComapiResult", "<", "Void", ">", ">...
Sets statuses for sets of messages. @param conversationId ID of a conversation to modify. @param msgStatusList List of status modifications. @param callback Callback to deliver new session instance.
[ "Sets", "statuses", "for", "sets", "of", "messages", "." ]
train
https://github.com/comapi/comapi-sdk-android/blob/53140a58d5a62afe196047ccc5120bfe090ef211/COMAPI/foundation/src/main/java/com/comapi/internal/network/InternalService.java#L803-L805
javalite/activejdbc
javalite-common/src/main/java/org/javalite/common/Util.java
Util.readFile
public static String readFile(String fileName, String charset) { """ Reads contents of file fully and returns as string. @param fileName file name. @param charset name of supported charset. @return contents of entire file. """ FileInputStream in = null; try { in = new FileInput...
java
public static String readFile(String fileName, String charset) { FileInputStream in = null; try { in = new FileInputStream(fileName); return read(in, charset); } catch (IOException e) { throw new RuntimeException(e); } finally { closeQuietl...
[ "public", "static", "String", "readFile", "(", "String", "fileName", ",", "String", "charset", ")", "{", "FileInputStream", "in", "=", "null", ";", "try", "{", "in", "=", "new", "FileInputStream", "(", "fileName", ")", ";", "return", "read", "(", "in", "...
Reads contents of file fully and returns as string. @param fileName file name. @param charset name of supported charset. @return contents of entire file.
[ "Reads", "contents", "of", "file", "fully", "and", "returns", "as", "string", "." ]
train
https://github.com/javalite/activejdbc/blob/ffcf5457cace19622a8f71e856cbbbe9e7dd5fcc/javalite-common/src/main/java/org/javalite/common/Util.java#L95-L105
elki-project/elki
addons/batikvis/src/main/java/de/lmu/ifi/dbs/elki/visualization/svg/SVGUtil.java
SVGUtil.setStyle
public static void setStyle(Element el, String d) { """ Set a SVG style attribute @param el element @param d style value """ el.setAttribute(SVGConstants.SVG_STYLE_ATTRIBUTE, d); }
java
public static void setStyle(Element el, String d) { el.setAttribute(SVGConstants.SVG_STYLE_ATTRIBUTE, d); }
[ "public", "static", "void", "setStyle", "(", "Element", "el", ",", "String", "d", ")", "{", "el", ".", "setAttribute", "(", "SVGConstants", ".", "SVG_STYLE_ATTRIBUTE", ",", "d", ")", ";", "}" ]
Set a SVG style attribute @param el element @param d style value
[ "Set", "a", "SVG", "style", "attribute" ]
train
https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/addons/batikvis/src/main/java/de/lmu/ifi/dbs/elki/visualization/svg/SVGUtil.java#L326-L328
apache/reef
lang/java/reef-bridge-client/src/main/java/org/apache/reef/bridge/client/YarnClusterSubmissionFromCS.java
YarnClusterSubmissionFromCS.fromJobSubmissionParametersFile
static YarnClusterSubmissionFromCS fromJobSubmissionParametersFile(final File yarnClusterAppSubmissionParametersFile, final File yarnClusterJobSubmissionParametersFile) throws IOException { """ Takes the YARN cluster job submission configur...
java
static YarnClusterSubmissionFromCS fromJobSubmissionParametersFile(final File yarnClusterAppSubmissionParametersFile, final File yarnClusterJobSubmissionParametersFile) throws IOException { try (final FileInputStream appFileInputStream = new...
[ "static", "YarnClusterSubmissionFromCS", "fromJobSubmissionParametersFile", "(", "final", "File", "yarnClusterAppSubmissionParametersFile", ",", "final", "File", "yarnClusterJobSubmissionParametersFile", ")", "throws", "IOException", "{", "try", "(", "final", "FileInputStream", ...
Takes the YARN cluster job submission configuration file, deserializes it, and creates submission object.
[ "Takes", "the", "YARN", "cluster", "job", "submission", "configuration", "file", "deserializes", "it", "and", "creates", "submission", "object", "." ]
train
https://github.com/apache/reef/blob/e2c47121cde21108a602c560cf76565a40d0e916/lang/java/reef-bridge-client/src/main/java/org/apache/reef/bridge/client/YarnClusterSubmissionFromCS.java#L255-L264
alkacon/opencms-core
src-gwt/org/opencms/gwt/client/util/impl/DOMImpl.java
DOMImpl.createIFrameElement
public com.google.gwt.dom.client.Element createIFrameElement(Document doc, String name) { """ Creates an iFrame element with the given name attribute.<p> @param doc the document @param name the name attribute value @return the iFrame element """ IFrameElement element = doc.createIFrameElement()...
java
public com.google.gwt.dom.client.Element createIFrameElement(Document doc, String name) { IFrameElement element = doc.createIFrameElement(); element.setName(name); return element; }
[ "public", "com", ".", "google", ".", "gwt", ".", "dom", ".", "client", ".", "Element", "createIFrameElement", "(", "Document", "doc", ",", "String", "name", ")", "{", "IFrameElement", "element", "=", "doc", ".", "createIFrameElement", "(", ")", ";", "eleme...
Creates an iFrame element with the given name attribute.<p> @param doc the document @param name the name attribute value @return the iFrame element
[ "Creates", "an", "iFrame", "element", "with", "the", "given", "name", "attribute", ".", "<p", ">" ]
train
https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src-gwt/org/opencms/gwt/client/util/impl/DOMImpl.java#L50-L55
j256/simplejmx
src/main/java/com/j256/simplejmx/client/JmxClient.java
JmxClient.getAttributeString
public String getAttributeString(ObjectName name, String attributeName) throws Exception { """ Return the value of a JMX attribute as a String or null if attribute has a null value. """ Object bean = getAttribute(name, attributeName); if (bean == null) { return null; } else { return ClientUtils.val...
java
public String getAttributeString(ObjectName name, String attributeName) throws Exception { Object bean = getAttribute(name, attributeName); if (bean == null) { return null; } else { return ClientUtils.valueToString(bean); } }
[ "public", "String", "getAttributeString", "(", "ObjectName", "name", ",", "String", "attributeName", ")", "throws", "Exception", "{", "Object", "bean", "=", "getAttribute", "(", "name", ",", "attributeName", ")", ";", "if", "(", "bean", "==", "null", ")", "{...
Return the value of a JMX attribute as a String or null if attribute has a null value.
[ "Return", "the", "value", "of", "a", "JMX", "attribute", "as", "a", "String", "or", "null", "if", "attribute", "has", "a", "null", "value", "." ]
train
https://github.com/j256/simplejmx/blob/1a04f52512dfa0a711ba0cc7023c604dbc82a352/src/main/java/com/j256/simplejmx/client/JmxClient.java#L327-L334
netscaler/nitro
src/main/java/com/citrix/netscaler/nitro/resource/stat/cache/cachepolicylabel_stats.java
cachepolicylabel_stats.get
public static cachepolicylabel_stats get(nitro_service service, String labelname) throws Exception { """ Use this API to fetch statistics of cachepolicylabel_stats resource of given name . """ cachepolicylabel_stats obj = new cachepolicylabel_stats(); obj.set_labelname(labelname); cachepolicylabel_stats ...
java
public static cachepolicylabel_stats get(nitro_service service, String labelname) throws Exception{ cachepolicylabel_stats obj = new cachepolicylabel_stats(); obj.set_labelname(labelname); cachepolicylabel_stats response = (cachepolicylabel_stats) obj.stat_resource(service); return response; }
[ "public", "static", "cachepolicylabel_stats", "get", "(", "nitro_service", "service", ",", "String", "labelname", ")", "throws", "Exception", "{", "cachepolicylabel_stats", "obj", "=", "new", "cachepolicylabel_stats", "(", ")", ";", "obj", ".", "set_labelname", "(",...
Use this API to fetch statistics of cachepolicylabel_stats resource of given name .
[ "Use", "this", "API", "to", "fetch", "statistics", "of", "cachepolicylabel_stats", "resource", "of", "given", "name", "." ]
train
https://github.com/netscaler/nitro/blob/2a98692dcf4e4ec430c7d7baab8382e4ba5a35e4/src/main/java/com/citrix/netscaler/nitro/resource/stat/cache/cachepolicylabel_stats.java#L149-L154
GenesysPureEngage/workspace-client-java
src/main/java/com/genesys/internal/workspace/api/MediaApi.java
MediaApi.attachMediaUserData
public ApiSuccessResponse attachMediaUserData(String mediatype, String id, UserDataOperationId userData) throws ApiException { """ Attach user data to an interaction Attach the provided data to the specified interaction. @param mediatype The media channel. (required) @param id The ID of the interaction. (requir...
java
public ApiSuccessResponse attachMediaUserData(String mediatype, String id, UserDataOperationId userData) throws ApiException { ApiResponse<ApiSuccessResponse> resp = attachMediaUserDataWithHttpInfo(mediatype, id, userData); return resp.getData(); }
[ "public", "ApiSuccessResponse", "attachMediaUserData", "(", "String", "mediatype", ",", "String", "id", ",", "UserDataOperationId", "userData", ")", "throws", "ApiException", "{", "ApiResponse", "<", "ApiSuccessResponse", ">", "resp", "=", "attachMediaUserDataWithHttpInfo...
Attach user data to an interaction Attach the provided data to the specified interaction. @param mediatype The media channel. (required) @param id The ID of the interaction. (required) @param userData The data to attach to the interaction. This is an array of objects with the properties key, type, and value. (required)...
[ "Attach", "user", "data", "to", "an", "interaction", "Attach", "the", "provided", "data", "to", "the", "specified", "interaction", "." ]
train
https://github.com/GenesysPureEngage/workspace-client-java/blob/509fdd9e89b9359d012f9a72be95037a3cef53e6/src/main/java/com/genesys/internal/workspace/api/MediaApi.java#L1015-L1018
impossibl/stencil
engine/src/main/java/com/impossibl/stencil/engine/internal/StencilOperands.java
StencilOperands.greaterThan
public boolean greaterThan(Object left, Object right) { """ Test if left > right. @param left first value @param right second value @return test result. """ if ((left == right) || left == null || right == null) { return false; } else { return compare(left, right, ">") > 0; } ...
java
public boolean greaterThan(Object left, Object right) { if ((left == right) || left == null || right == null) { return false; } else { return compare(left, right, ">") > 0; } }
[ "public", "boolean", "greaterThan", "(", "Object", "left", ",", "Object", "right", ")", "{", "if", "(", "(", "left", "==", "right", ")", "||", "left", "==", "null", "||", "right", "==", "null", ")", "{", "return", "false", ";", "}", "else", "{", "r...
Test if left > right. @param left first value @param right second value @return test result.
[ "Test", "if", "left", ">", "right", "." ]
train
https://github.com/impossibl/stencil/blob/4aac1be605542b4248be95bf8916be4e2f755d1c/engine/src/main/java/com/impossibl/stencil/engine/internal/StencilOperands.java#L833-L840
cdk/cdk
tool/sdg/src/main/java/org/openscience/cdk/layout/OverlapResolver.java
OverlapResolver.getOverlapScore
public double getOverlapScore(IAtomContainer ac, Vector overlappingAtoms, Vector overlappingBonds) { """ Calculates a score based on the overlap of atoms and intersection of bonds. The overlap is calculated by summing up the distances between all pairs of atoms, if they are less than half the standard bondlength...
java
public double getOverlapScore(IAtomContainer ac, Vector overlappingAtoms, Vector overlappingBonds) { double overlapScore = 0; overlapScore = getAtomOverlapScore(ac, overlappingAtoms); //overlapScore += getBondOverlapScore(ac, overlappingBonds); return overlapScore; }
[ "public", "double", "getOverlapScore", "(", "IAtomContainer", "ac", ",", "Vector", "overlappingAtoms", ",", "Vector", "overlappingBonds", ")", "{", "double", "overlapScore", "=", "0", ";", "overlapScore", "=", "getAtomOverlapScore", "(", "ac", ",", "overlappingAtoms...
Calculates a score based on the overlap of atoms and intersection of bonds. The overlap is calculated by summing up the distances between all pairs of atoms, if they are less than half the standard bondlength apart. @param ac The Atomcontainer to work on @param overlappingAtoms Description of the Par...
[ "Calculates", "a", "score", "based", "on", "the", "overlap", "of", "atoms", "and", "intersection", "of", "bonds", ".", "The", "overlap", "is", "calculated", "by", "summing", "up", "the", "distances", "between", "all", "pairs", "of", "atoms", "if", "they", ...
train
https://github.com/cdk/cdk/blob/c3d0f16502bf08df50365fee392e11d7c9856657/tool/sdg/src/main/java/org/openscience/cdk/layout/OverlapResolver.java#L162-L167
alkacon/opencms-core
src/org/opencms/jsp/CmsJspTagImage.java
CmsJspTagImage.setAttribute
private void setAttribute(String key, String value, boolean allowEmptyValue) { """ Sets the given key with the given value in the attribute map.<p> @param key the key to set @param value the value to set @param allowEmptyValue flag to determine if an empty value (not <code>null</code>!) should be set """ ...
java
private void setAttribute(String key, String value, boolean allowEmptyValue) { if (CmsStringUtil.isNotEmptyOrWhitespaceOnly(value) || (allowEmptyValue && (value != null))) { if (m_attributes == null) { m_attributes = new HashMap<String, String>(); } m_attribu...
[ "private", "void", "setAttribute", "(", "String", "key", ",", "String", "value", ",", "boolean", "allowEmptyValue", ")", "{", "if", "(", "CmsStringUtil", ".", "isNotEmptyOrWhitespaceOnly", "(", "value", ")", "||", "(", "allowEmptyValue", "&&", "(", "value", "!...
Sets the given key with the given value in the attribute map.<p> @param key the key to set @param value the value to set @param allowEmptyValue flag to determine if an empty value (not <code>null</code>!) should be set
[ "Sets", "the", "given", "key", "with", "the", "given", "value", "in", "the", "attribute", "map", ".", "<p", ">" ]
train
https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/jsp/CmsJspTagImage.java#L735-L743
apptik/JustJson
json-core/src/main/java/io/apptik/json/JsonObject.java
JsonObject.put
public JsonObject put(String name, JsonElement value) throws JsonException { """ Maps {@code name} to {@code value}, clobbering any existing name/value mapping with the same name. If the value is {@code null}, any existing mapping for {@code name} is removed. @param value a {@link JsonObject}, {@link JsonArra...
java
public JsonObject put(String name, JsonElement value) throws JsonException { checkIfFrozen(); putInternal(name, value); return this; }
[ "public", "JsonObject", "put", "(", "String", "name", ",", "JsonElement", "value", ")", "throws", "JsonException", "{", "checkIfFrozen", "(", ")", ";", "putInternal", "(", "name", ",", "value", ")", ";", "return", "this", ";", "}" ]
Maps {@code name} to {@code value}, clobbering any existing name/value mapping with the same name. If the value is {@code null}, any existing mapping for {@code name} is removed. @param value a {@link JsonObject}, {@link JsonArray}, {@link JsonString}, {@link JsonBoolean}, {@link JsonNumber}, {@link JsonNull}. May not...
[ "Maps", "{", "@code", "name", "}", "to", "{", "@code", "value", "}", "clobbering", "any", "existing", "name", "/", "value", "mapping", "with", "the", "same", "name", ".", "If", "the", "value", "is", "{", "@code", "null", "}", "any", "existing", "mappin...
train
https://github.com/apptik/JustJson/blob/c90f0dd7f84df26da4749be8cd9b026fff499a79/json-core/src/main/java/io/apptik/json/JsonObject.java#L205-L209
arnaudroger/SimpleFlatMapper
sfm-jdbc/src/main/java/org/simpleflatmapper/jdbc/JdbcMapperFactory.java
JdbcMapperFactory.addCustomGetter
public JdbcMapperFactory addCustomGetter(String key, Getter<ResultSet, ?> getter) { """ Associate the specified Getter for the specified property. @param key the property @param getter the getter @return the current factory """ return addColumnDefinition(key, FieldMapperColumnDefinition.<JdbcColumnKey>cus...
java
public JdbcMapperFactory addCustomGetter(String key, Getter<ResultSet, ?> getter) { return addColumnDefinition(key, FieldMapperColumnDefinition.<JdbcColumnKey>customGetter(getter)); }
[ "public", "JdbcMapperFactory", "addCustomGetter", "(", "String", "key", ",", "Getter", "<", "ResultSet", ",", "?", ">", "getter", ")", "{", "return", "addColumnDefinition", "(", "key", ",", "FieldMapperColumnDefinition", ".", "<", "JdbcColumnKey", ">", "customGett...
Associate the specified Getter for the specified property. @param key the property @param getter the getter @return the current factory
[ "Associate", "the", "specified", "Getter", "for", "the", "specified", "property", "." ]
train
https://github.com/arnaudroger/SimpleFlatMapper/blob/93435438c18f26c87963d5e0f3ebf0f264dcd8c2/sfm-jdbc/src/main/java/org/simpleflatmapper/jdbc/JdbcMapperFactory.java#L120-L122
DiUS/pact-jvm
pact-jvm-consumer/src/main/java/au/com/dius/pact/consumer/dsl/PactDslJsonArray.java
PactDslJsonArray.maxArrayLike
public PactDslJsonArray maxArrayLike(Integer size, PactDslJsonRootValue value, int numberExamples) { """ Array of values with a maximum size that are not objects where each item must match the provided example @param size maximum size of the array @param value Value to use to match each item @param numberExampl...
java
public PactDslJsonArray maxArrayLike(Integer size, PactDslJsonRootValue value, int numberExamples) { if (numberExamples > size) { throw new IllegalArgumentException(String.format("Number of example %d is more than the maximum size of %d", numberExamples, size)); } matchers.addRule(rootPath + a...
[ "public", "PactDslJsonArray", "maxArrayLike", "(", "Integer", "size", ",", "PactDslJsonRootValue", "value", ",", "int", "numberExamples", ")", "{", "if", "(", "numberExamples", ">", "size", ")", "{", "throw", "new", "IllegalArgumentException", "(", "String", ".", ...
Array of values with a maximum size that are not objects where each item must match the provided example @param size maximum size of the array @param value Value to use to match each item @param numberExamples number of examples to generate
[ "Array", "of", "values", "with", "a", "maximum", "size", "that", "are", "not", "objects", "where", "each", "item", "must", "match", "the", "provided", "example" ]
train
https://github.com/DiUS/pact-jvm/blob/2f447e9dd4ac152a6a36b7fcf8962d07de9ef3ef/pact-jvm-consumer/src/main/java/au/com/dius/pact/consumer/dsl/PactDslJsonArray.java#L1089-L1099
JadiraOrg/jadira
bindings/src/main/java/org/jadira/bindings/core/binder/BasicBinder.java
BasicBinder.registerUnmarshaller
public final <S, T> void registerUnmarshaller(Class<S> source, Class<T> target, FromUnmarshaller<S, T> converter, Class<? extends Annotation> qualifier) { """ Register an UnMarshaller with the given source and target class. The unmarshaller is used as follows: Instances of the source can be marshalled into the ta...
java
public final <S, T> void registerUnmarshaller(Class<S> source, Class<T> target, FromUnmarshaller<S, T> converter, Class<? extends Annotation> qualifier) { registerUnmarshaller(new ConverterKey<S,T>(source, target, qualifier == null ? DefaultBinding.class : qualifier), converter); }
[ "public", "final", "<", "S", ",", "T", ">", "void", "registerUnmarshaller", "(", "Class", "<", "S", ">", "source", ",", "Class", "<", "T", ">", "target", ",", "FromUnmarshaller", "<", "S", ",", "T", ">", "converter", ",", "Class", "<", "?", "extends"...
Register an UnMarshaller with the given source and target class. The unmarshaller is used as follows: Instances of the source can be marshalled into the target class. @param source The source (input) class @param target The target (output) class @param converter The FromUnmarshaller to be registered @param qualifier Th...
[ "Register", "an", "UnMarshaller", "with", "the", "given", "source", "and", "target", "class", ".", "The", "unmarshaller", "is", "used", "as", "follows", ":", "Instances", "of", "the", "source", "can", "be", "marshalled", "into", "the", "target", "class", "."...
train
https://github.com/JadiraOrg/jadira/blob/d55d0238395f0cb900531f1f08b4b2d87fa9a4f6/bindings/src/main/java/org/jadira/bindings/core/binder/BasicBinder.java#L623-L625
gallandarakhneorg/afc
core/vmutils/src/main/java/org/arakhne/afc/vmutil/asserts/AssertMessages.java
AssertMessages.invalidFalseValue
@Pure @Inline(value = "AssertMessages.invalidFalseValue(0, $1)", imported = { """ The value of first Parameter must be <code>true</code>. @param functionName the name of the function that should reply <code>true</code>. @return the error message. """AssertMessages.class}) public static String invalidFals...
java
@Pure @Inline(value = "AssertMessages.invalidFalseValue(0, $1)", imported = {AssertMessages.class}) public static String invalidFalseValue(String functionName) { return invalidFalseValue(0, functionName); }
[ "@", "Pure", "@", "Inline", "(", "value", "=", "\"AssertMessages.invalidFalseValue(0, $1)\"", ",", "imported", "=", "{", "AssertMessages", ".", "class", "}", ")", "public", "static", "String", "invalidFalseValue", "(", "String", "functionName", ")", "{", "return",...
The value of first Parameter must be <code>true</code>. @param functionName the name of the function that should reply <code>true</code>. @return the error message.
[ "The", "value", "of", "first", "Parameter", "must", "be", "<code", ">", "true<", "/", "code", ">", "." ]
train
https://github.com/gallandarakhneorg/afc/blob/0c7d2e1ddefd4167ef788416d970a6c1ef6f8bbb/core/vmutils/src/main/java/org/arakhne/afc/vmutil/asserts/AssertMessages.java#L71-L75
dottydingo/hyperion
client/src/main/java/com/dottydingo/hyperion/client/HyperionClient.java
HyperionClient.readResponse
protected <T> T readResponse(Response response,JavaType javaType) { """ Read the response and unmarshall into the expected type @param response The http response @param javaType The type to return @return The response value """ try { return objectMapper.readValue(response.body()....
java
protected <T> T readResponse(Response response,JavaType javaType) { try { return objectMapper.readValue(response.body().byteStream(), javaType); } catch (IOException e) { throw new ClientMarshallingException("Error reading results.",e); } }
[ "protected", "<", "T", ">", "T", "readResponse", "(", "Response", "response", ",", "JavaType", "javaType", ")", "{", "try", "{", "return", "objectMapper", ".", "readValue", "(", "response", ".", "body", "(", ")", ".", "byteStream", "(", ")", ",", "javaTy...
Read the response and unmarshall into the expected type @param response The http response @param javaType The type to return @return The response value
[ "Read", "the", "response", "and", "unmarshall", "into", "the", "expected", "type" ]
train
https://github.com/dottydingo/hyperion/blob/c4d119c90024a88c0335d7d318e9ccdb70149764/client/src/main/java/com/dottydingo/hyperion/client/HyperionClient.java#L371-L381
alkacon/opencms-core
src-gwt/org/opencms/ade/galleries/client/CmsGalleryControllerHandler.java
CmsGalleryControllerHandler.onUpdateGalleryTree
public void onUpdateGalleryTree(List<CmsGalleryTreeEntry> galleryTreeEntries, List<String> selectedGalleries) { """ Updates the gallery tree.<p> @param galleryTreeEntries the gallery tree entries @param selectedGalleries the selected galleries """ m_galleryDialog.getGalleriesTab().updateTreeConten...
java
public void onUpdateGalleryTree(List<CmsGalleryTreeEntry> galleryTreeEntries, List<String> selectedGalleries) { m_galleryDialog.getGalleriesTab().updateTreeContent(galleryTreeEntries, selectedGalleries); }
[ "public", "void", "onUpdateGalleryTree", "(", "List", "<", "CmsGalleryTreeEntry", ">", "galleryTreeEntries", ",", "List", "<", "String", ">", "selectedGalleries", ")", "{", "m_galleryDialog", ".", "getGalleriesTab", "(", ")", ".", "updateTreeContent", "(", "galleryT...
Updates the gallery tree.<p> @param galleryTreeEntries the gallery tree entries @param selectedGalleries the selected galleries
[ "Updates", "the", "gallery", "tree", ".", "<p", ">" ]
train
https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src-gwt/org/opencms/ade/galleries/client/CmsGalleryControllerHandler.java#L396-L399
Azure/azure-sdk-for-java
sql/resource-manager/v2014_04_01/src/main/java/com/microsoft/azure/management/sql/v2014_04_01/implementation/ServerAzureADAdministratorsInner.java
ServerAzureADAdministratorsInner.getAsync
public Observable<ServerAzureADAdministratorInner> getAsync(String resourceGroupName, String serverName) { """ Returns an server Administrator. @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...
java
public Observable<ServerAzureADAdministratorInner> getAsync(String resourceGroupName, String serverName) { return getWithServiceResponseAsync(resourceGroupName, serverName).map(new Func1<ServiceResponse<ServerAzureADAdministratorInner>, ServerAzureADAdministratorInner>() { @Override publ...
[ "public", "Observable", "<", "ServerAzureADAdministratorInner", ">", "getAsync", "(", "String", "resourceGroupName", ",", "String", "serverName", ")", "{", "return", "getWithServiceResponseAsync", "(", "resourceGroupName", ",", "serverName", ")", ".", "map", "(", "new...
Returns an server Administrator. @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. @throws IllegalArgumentException thrown if parameters fail the validation @return t...
[ "Returns", "an", "server", "Administrator", "." ]
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/ServerAzureADAdministratorsInner.java#L455-L462
lessthanoptimal/BoofCV
main/boofcv-sfm/src/main/java/boofcv/alg/sfm/d3/VisOdomDualTrackPnP.java
VisOdomDualTrackPnP.selectCandidateTracks
private void selectCandidateTracks() { """ Searches for tracks which are active and meet the epipolar constraints """ // mark tracks in right frame that are active List<PointTrack> activeRight = trackerRight.getActiveTracks(null); for( PointTrack t : activeRight ) { RightTrackInfo info = t.getCookie()...
java
private void selectCandidateTracks() { // mark tracks in right frame that are active List<PointTrack> activeRight = trackerRight.getActiveTracks(null); for( PointTrack t : activeRight ) { RightTrackInfo info = t.getCookie(); info.lastActiveList = tick; } int mutualActive = 0; List<PointTrack> activeL...
[ "private", "void", "selectCandidateTracks", "(", ")", "{", "// mark tracks in right frame that are active", "List", "<", "PointTrack", ">", "activeRight", "=", "trackerRight", ".", "getActiveTracks", "(", "null", ")", ";", "for", "(", "PointTrack", "t", ":", "active...
Searches for tracks which are active and meet the epipolar constraints
[ "Searches", "for", "tracks", "which", "are", "active", "and", "meet", "the", "epipolar", "constraints" ]
train
https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-sfm/src/main/java/boofcv/alg/sfm/d3/VisOdomDualTrackPnP.java#L307-L344
mebigfatguy/fb-contrib
src/main/java/com/mebigfatguy/fbcontrib/detect/Section508Compliance.java
Section508Compliance.visitCode
@Override public void visitCode(Code obj) { """ implements the visitor to reset the stack @param obj the context object for the currently visited code block """ stack.resetForMethodEntry(this); localLabels.clear(); super.visitCode(obj); for (SourceLineAnnotation sla : lo...
java
@Override public void visitCode(Code obj) { stack.resetForMethodEntry(this); localLabels.clear(); super.visitCode(obj); for (SourceLineAnnotation sla : localLabels.values()) { BugInstance bug = new BugInstance(this, BugType.S508C_NO_SETLABELFOR.name(), NORMAL_PRIORITY).ad...
[ "@", "Override", "public", "void", "visitCode", "(", "Code", "obj", ")", "{", "stack", ".", "resetForMethodEntry", "(", "this", ")", ";", "localLabels", ".", "clear", "(", ")", ";", "super", ".", "visitCode", "(", "obj", ")", ";", "for", "(", "SourceLi...
implements the visitor to reset the stack @param obj the context object for the currently visited code block
[ "implements", "the", "visitor", "to", "reset", "the", "stack" ]
train
https://github.com/mebigfatguy/fb-contrib/blob/3b5203196f627b399fbcea3c2ab2b1f4e56cc7b8/src/main/java/com/mebigfatguy/fbcontrib/detect/Section508Compliance.java#L214-L228
zzycjcg/foundation
foundation-jersey/foundation-jersey-server/src/main/java/com/github/zzycjcg/foundation/jersey/server/container/SpringServletContainer.java
SpringServletContainer.initResourceConfig
protected void initResourceConfig(WebConfig webConfig) throws ServletException { """ Inits the resource config. @param webConfig the web config @throws ServletException the servlet exception """ try { Field field = ServletContainer.class.getDeclaredField("resourceCon...
java
protected void initResourceConfig(WebConfig webConfig) throws ServletException { try { Field field = ServletContainer.class.getDeclaredField("resourceConfig"); field.setAccessible(true); field.set(this, createResourceConfig(webConfig)); } ...
[ "protected", "void", "initResourceConfig", "(", "WebConfig", "webConfig", ")", "throws", "ServletException", "{", "try", "{", "Field", "field", "=", "ServletContainer", ".", "class", ".", "getDeclaredField", "(", "\"resourceConfig\"", ")", ";", "field", ".", "setA...
Inits the resource config. @param webConfig the web config @throws ServletException the servlet exception
[ "Inits", "the", "resource", "config", "." ]
train
https://github.com/zzycjcg/foundation/blob/99267a1b7401b99bf65ea1ac6f3c466873049fd8/foundation-jersey/foundation-jersey-server/src/main/java/com/github/zzycjcg/foundation/jersey/server/container/SpringServletContainer.java#L44-L61
jbundle/jbundle
base/base/src/main/java/org/jbundle/base/field/event/CheckMoveHandler.java
CheckMoveHandler.moveIt
public int moveIt(boolean bDisplayOption, int iMoveMode) { """ The Field has Changed. @param bDisplayOption If true, display the change. @param iMoveMode The type of move being done (init/read/screen). @return The error code (or NORMAL_RETURN if okay). """ ((BaseField)m_fldDest.getField()).setEnable...
java
public int moveIt(boolean bDisplayOption, int iMoveMode) { ((BaseField)m_fldDest.getField()).setEnabled(!this.getOwner().getState()); if (iMoveMode != DBConstants.SCREEN_MOVE) return DBConstants.NORMAL_RETURN; if (this.getOwner().getState() == false) { if (bDi...
[ "public", "int", "moveIt", "(", "boolean", "bDisplayOption", ",", "int", "iMoveMode", ")", "{", "(", "(", "BaseField", ")", "m_fldDest", ".", "getField", "(", ")", ")", ".", "setEnabled", "(", "!", "this", ".", "getOwner", "(", ")", ".", "getState", "(...
The Field has Changed. @param bDisplayOption If true, display the change. @param iMoveMode The type of move being done (init/read/screen). @return The error code (or NORMAL_RETURN if okay).
[ "The", "Field", "has", "Changed", "." ]
train
https://github.com/jbundle/jbundle/blob/4037fcfa85f60c7d0096c453c1a3cd573c2b0abc/base/base/src/main/java/org/jbundle/base/field/event/CheckMoveHandler.java#L60-L73
finmath/finmath-lib
src/main/java/net/finmath/time/FloatingpointDate.java
FloatingpointDate.getFloatingPointDateFromDate
public static double getFloatingPointDateFromDate(LocalDateTime referenceDate, LocalDateTime date) { """ Convert a given date to a floating point date using a given reference date. @param referenceDate The reference date associated with \( t=0 \). @param date The given date to be associated with the return val...
java
public static double getFloatingPointDateFromDate(LocalDateTime referenceDate, LocalDateTime date) { Duration duration = Duration.between(referenceDate, date); return ((double)duration.getSeconds()) / SECONDS_PER_DAY; }
[ "public", "static", "double", "getFloatingPointDateFromDate", "(", "LocalDateTime", "referenceDate", ",", "LocalDateTime", "date", ")", "{", "Duration", "duration", "=", "Duration", ".", "between", "(", "referenceDate", ",", "date", ")", ";", "return", "(", "(", ...
Convert a given date to a floating point date using a given reference date. @param referenceDate The reference date associated with \( t=0 \). @param date The given date to be associated with the return value \( T \). @return The value T measuring the distance of reference date and date by ACT/365 with SECONDS_PER_DAY...
[ "Convert", "a", "given", "date", "to", "a", "floating", "point", "date", "using", "a", "given", "reference", "date", "." ]
train
https://github.com/finmath/finmath-lib/blob/a3c067d52dd33feb97d851df6cab130e4116759f/src/main/java/net/finmath/time/FloatingpointDate.java#L83-L86
openengsb/openengsb
components/services/src/main/java/org/openengsb/core/services/internal/security/ldap/EntryFactory.java
EntryFactory.namedObject
public static Entry namedObject(String name, Dn baseDn) { """ Returns an {@link Entry} whose {@link Dn} is baseDn followed by name as Rdn. The attribute type of the Rdn is 'common name'. """ Dn dn = LdapUtils.concatDn(SchemaConstants.CN_ATTRIBUTE, name, baseDn); Entry entry = new DefaultEntry(...
java
public static Entry namedObject(String name, Dn baseDn) { Dn dn = LdapUtils.concatDn(SchemaConstants.CN_ATTRIBUTE, name, baseDn); Entry entry = new DefaultEntry(dn); try { entry.add(SchemaConstants.OBJECT_CLASS_ATTRIBUTE, SchemaConstants.NAMED_OBJECT_OC); entry.add(Schema...
[ "public", "static", "Entry", "namedObject", "(", "String", "name", ",", "Dn", "baseDn", ")", "{", "Dn", "dn", "=", "LdapUtils", ".", "concatDn", "(", "SchemaConstants", ".", "CN_ATTRIBUTE", ",", "name", ",", "baseDn", ")", ";", "Entry", "entry", "=", "ne...
Returns an {@link Entry} whose {@link Dn} is baseDn followed by name as Rdn. The attribute type of the Rdn is 'common name'.
[ "Returns", "an", "{" ]
train
https://github.com/openengsb/openengsb/blob/d39058000707f617cd405629f9bc7f17da7b414a/components/services/src/main/java/org/openengsb/core/services/internal/security/ldap/EntryFactory.java#L61-L71
qiujuer/Genius-Android
caprice/ui/src/main/java/net/qiujuer/genius/ui/Ui.java
Ui.isTrueFromAttribute
public static boolean isTrueFromAttribute(AttributeSet attrs, String attribute, boolean defaultValue) { """ Get the attribute have enabled value Form android styles namespace @param attrs AttributeSet @param attribute The attribute to retrieve @param defaultValue What to return if the attribute isn...
java
public static boolean isTrueFromAttribute(AttributeSet attrs, String attribute, boolean defaultValue) { return attrs.getAttributeBooleanValue(Ui.androidStyleNameSpace, attribute, defaultValue); }
[ "public", "static", "boolean", "isTrueFromAttribute", "(", "AttributeSet", "attrs", ",", "String", "attribute", ",", "boolean", "defaultValue", ")", "{", "return", "attrs", ".", "getAttributeBooleanValue", "(", "Ui", ".", "androidStyleNameSpace", ",", "attribute", "...
Get the attribute have enabled value Form android styles namespace @param attrs AttributeSet @param attribute The attribute to retrieve @param defaultValue What to return if the attribute isn't found @return Resulting value
[ "Get", "the", "attribute", "have", "enabled", "value", "Form", "android", "styles", "namespace" ]
train
https://github.com/qiujuer/Genius-Android/blob/babefaf1321f5883a21cada582b6fa5104adc648/caprice/ui/src/main/java/net/qiujuer/genius/ui/Ui.java#L140-L142
Hygieia/Hygieia
hygieia-jenkins-plugin/src/main/java/hygieia/builder/SonarBuilder.java
SonarBuilder.sonarProcessingComplete
private boolean sonarProcessingComplete(Run<?, ?> run, TaskListener listener, RestCall restCall, String ceQueryIntervalInSecondsString, String ceQueryMaxAttemptsString) throws ParseException { """ Keeps polling Sonar's Compute Engine (CE) API to determine status of sonar analysis From Sonar 5.2+, the final analys...
java
private boolean sonarProcessingComplete(Run<?, ?> run, TaskListener listener, RestCall restCall, String ceQueryIntervalInSecondsString, String ceQueryMaxAttemptsString) throws ParseException { // Sonar 5.2+ check if the sonar ce api url exists. If not, // then the project is using old sonar version and ...
[ "private", "boolean", "sonarProcessingComplete", "(", "Run", "<", "?", ",", "?", ">", "run", ",", "TaskListener", "listener", ",", "RestCall", "restCall", ",", "String", "ceQueryIntervalInSecondsString", ",", "String", "ceQueryMaxAttemptsString", ")", "throws", "Par...
Keeps polling Sonar's Compute Engine (CE) API to determine status of sonar analysis From Sonar 5.2+, the final analysis is now an asynchronous and the status of the sonar analysis needs to be determined from the Sonar CE API @param restCall RestCall @return true after Compute Engine has completed processing or it is a...
[ "Keeps", "polling", "Sonar", "s", "Compute", "Engine", "(", "CE", ")", "API", "to", "determine", "status", "of", "sonar", "analysis", "From", "Sonar", "5", ".", "2", "+", "the", "final", "analysis", "is", "now", "an", "asynchronous", "and", "the", "statu...
train
https://github.com/Hygieia/Hygieia/blob/d8b67a590da2744acf59bcd99d9b34ef1bb84890/hygieia-jenkins-plugin/src/main/java/hygieia/builder/SonarBuilder.java#L112-L167
wirecardBrasil/moip-sdk-java
src/main/java/br/com/moip/api/request/RequestMaker.java
RequestMaker.doRequest
public Map<String, Object> doRequest(final RequestProperties requestProps) { """ This method is used to build the request, it set the environment (Sandbox or Production) and the headers, create the {@code connection} object to establish connection with Moip APIResources, authenticate the connection, load the req...
java
public Map<String, Object> doRequest(final RequestProperties requestProps) { try { URL url = new URL(moipEnvironment + requestProps.endpoint); HttpURLConnection connection = (HttpURLConnection) url.openConnection(); connection.setRequestProperty("User-Agent", getUserAgent(...
[ "public", "Map", "<", "String", ",", "Object", ">", "doRequest", "(", "final", "RequestProperties", "requestProps", ")", "{", "try", "{", "URL", "url", "=", "new", "URL", "(", "moipEnvironment", "+", "requestProps", ".", "endpoint", ")", ";", "HttpURLConnect...
This method is used to build the request, it set the environment (Sandbox or Production) and the headers, create the {@code connection} object to establish connection with Moip APIResources, authenticate the connection, load the request properties received from parameter, serialize the request object and send it to the...
[ "This", "method", "is", "used", "to", "build", "the", "request", "it", "set", "the", "environment", "(", "Sandbox", "or", "Production", ")", "and", "the", "headers", "create", "the", "{", "@code", "connection", "}", "object", "to", "establish", "connection",...
train
https://github.com/wirecardBrasil/moip-sdk-java/blob/5bee84fa9457d7becfd18954bf5105037f49829c/src/main/java/br/com/moip/api/request/RequestMaker.java#L71-L129
paoding-code/paoding-rose
paoding-rose-jade/src/main/java/net/paoding/rose/jade/statement/expression/impl/ExqlCompiler.java
ExqlCompiler.match
private boolean match(String keyword, int fromIndex) { """ 匹配指定的关键字。 如果匹配成功, 当前位置是关键字最后一个字符之后。 @param keyword - 匹配的关键字 @param fromIndex - 查找的起始位置 @return true / false """ int match = 0; // 查找非空白字符。 for (int index = fromIndex; index < length; index++) { char ch =...
java
private boolean match(String keyword, int fromIndex) { int match = 0; // 查找非空白字符。 for (int index = fromIndex; index < length; index++) { char ch = pattern.charAt(index); if (!Character.isWhitespace(ch)) { match = index; break; ...
[ "private", "boolean", "match", "(", "String", "keyword", ",", "int", "fromIndex", ")", "{", "int", "match", "=", "0", ";", "// 查找非空白字符。", "for", "(", "int", "index", "=", "fromIndex", ";", "index", "<", "length", ";", "index", "++", ")", "{", "char", ...
匹配指定的关键字。 如果匹配成功, 当前位置是关键字最后一个字符之后。 @param keyword - 匹配的关键字 @param fromIndex - 查找的起始位置 @return true / false
[ "匹配指定的关键字。" ]
train
https://github.com/paoding-code/paoding-rose/blob/8b512704174dd6cba95e544c7d6ab66105cb8ec4/paoding-rose-jade/src/main/java/net/paoding/rose/jade/statement/expression/impl/ExqlCompiler.java#L410-L442
mebigfatguy/fb-contrib
src/main/java/com/mebigfatguy/fbcontrib/detect/JPAIssues.java
JPAIssues.visitMethod
@Override public void visitMethod(Method obj) { """ implements the visitor to look for non public methods that have an @Transactional annotation applied to it. Spring only scans public methods for special handling. It also looks to see if the exceptions thrown by the method line up with the declared exception...
java
@Override public void visitMethod(Method obj) { if (getMethod().isSynthetic()) { return; } methodTransType = getTransactionalType(obj); if ((methodTransType != TransactionalType.NONE) && !obj.isPublic()) { bugReporter .reportBug(new BugIns...
[ "@", "Override", "public", "void", "visitMethod", "(", "Method", "obj", ")", "{", "if", "(", "getMethod", "(", ")", ".", "isSynthetic", "(", ")", ")", "{", "return", ";", "}", "methodTransType", "=", "getTransactionalType", "(", "obj", ")", ";", "if", ...
implements the visitor to look for non public methods that have an @Transactional annotation applied to it. Spring only scans public methods for special handling. It also looks to see if the exceptions thrown by the method line up with the declared exceptions handled in the @Transactional annotation. @param obj the cu...
[ "implements", "the", "visitor", "to", "look", "for", "non", "public", "methods", "that", "have", "an", "@Transactional", "annotation", "applied", "to", "it", ".", "Spring", "only", "scans", "public", "methods", "for", "special", "handling", ".", "It", "also", ...
train
https://github.com/mebigfatguy/fb-contrib/blob/3b5203196f627b399fbcea3c2ab2b1f4e56cc7b8/src/main/java/com/mebigfatguy/fbcontrib/detect/JPAIssues.java#L154-L178
sarl/sarl
main/coreplugins/io.sarl.eclipse/src/io/sarl/eclipse/util/Jdt2Ecore.java
Jdt2Ecore.isGeneratedOperation
public boolean isGeneratedOperation(IMethod method) { """ Replies if the given method is marked has automatically generated by the SARL compiler. @param method the method to check. @return <code>true</code> if the method is annoted with SyntheticMember; <code>false</code> otherwise. """ return getAnnota...
java
public boolean isGeneratedOperation(IMethod method) { return getAnnotation(method, SyntheticMember.class.getName()) != null || getAnnotation(method, Generated.class.getName()) != null; }
[ "public", "boolean", "isGeneratedOperation", "(", "IMethod", "method", ")", "{", "return", "getAnnotation", "(", "method", ",", "SyntheticMember", ".", "class", ".", "getName", "(", ")", ")", "!=", "null", "||", "getAnnotation", "(", "method", ",", "Generated"...
Replies if the given method is marked has automatically generated by the SARL compiler. @param method the method to check. @return <code>true</code> if the method is annoted with SyntheticMember; <code>false</code> otherwise.
[ "Replies", "if", "the", "given", "method", "is", "marked", "has", "automatically", "generated", "by", "the", "SARL", "compiler", "." ]
train
https://github.com/sarl/sarl/blob/ca00ff994598c730339972def4e19a60e0b8cace/main/coreplugins/io.sarl.eclipse/src/io/sarl/eclipse/util/Jdt2Ecore.java#L324-L327
arakelian/docker-junit-rule
src/main/java/com/arakelian/docker/junit/Container.java
Container.waitForLog
public final void waitForLog(final int timeout, final TimeUnit unit, final String... messages) throws DockerException, InterruptedException { """ Wait for nth occurrence of message to appear in docker logs within the specified timeframe. @param timeout timeout value @param unit timeout units @pa...
java
public final void waitForLog(final int timeout, final TimeUnit unit, final String... messages) throws DockerException, InterruptedException { final long startTime = System.currentTimeMillis(); final long timeoutTimeMillis = startTime + TimeUnit.MILLISECONDS.convert(timeout, unit); i...
[ "public", "final", "void", "waitForLog", "(", "final", "int", "timeout", ",", "final", "TimeUnit", "unit", ",", "final", "String", "...", "messages", ")", "throws", "DockerException", ",", "InterruptedException", "{", "final", "long", "startTime", "=", "System",...
Wait for nth occurrence of message to appear in docker logs within the specified timeframe. @param timeout timeout value @param unit timeout units @param messages The sequence of messages to wait for @throws DockerException if docker throws exception while tailing logs @throws InterruptedException if thread interrupte...
[ "Wait", "for", "nth", "occurrence", "of", "message", "to", "appear", "in", "docker", "logs", "within", "the", "specified", "timeframe", "." ]
train
https://github.com/arakelian/docker-junit-rule/blob/cc99d63896a07df398b53fd5f0f6e4777e3b23cf/src/main/java/com/arakelian/docker/junit/Container.java#L335-L363
jamesagnew/hapi-fhir
hapi-fhir-narrativegenerator/src/main/java/ca/uhn/fhir/narrative/template/filters/Sort.java
Sort.apply
@Override public Object apply(Object value, Object... params) { """ /* sort(input, property = nil) Sort elements of the array provide optional property with which to sort an array of hashes or drops """ if (value == null) { return ""; } if(!super.isArray(value)) {...
java
@Override public Object apply(Object value, Object... params) { if (value == null) { return ""; } if(!super.isArray(value)) { throw new RuntimeException("cannot sort: " + value); } Object[] array = super.asArray(value); String property = par...
[ "@", "Override", "public", "Object", "apply", "(", "Object", "value", ",", "Object", "...", "params", ")", "{", "if", "(", "value", "==", "null", ")", "{", "return", "\"\"", ";", "}", "if", "(", "!", "super", ".", "isArray", "(", "value", ")", ")",...
/* sort(input, property = nil) Sort elements of the array provide optional property with which to sort an array of hashes or drops
[ "/", "*", "sort", "(", "input", "property", "=", "nil", ")" ]
train
https://github.com/jamesagnew/hapi-fhir/blob/150a84d52fe691b7f48fcb28247c4bddb7aec352/hapi-fhir-narrativegenerator/src/main/java/ca/uhn/fhir/narrative/template/filters/Sort.java#L14-L35
paypal/SeLion
dataproviders/src/main/java/com/paypal/selion/platform/dataprovider/impl/ExcelReader.java
ExcelReader.getRowIndex
public int getRowIndex(String sheetName, String key) { """ Search for the input key from the specified sheet name and return the index position of the row that contained the key @param sheetName - A String that represents the Sheet name from which data is to be read @param key - A String that represents the...
java
public int getRowIndex(String sheetName, String key) { logger.entering(new Object[] { sheetName, key }); int index = -1; Sheet sheet = fetchSheet(sheetName); int rowCount = sheet.getPhysicalNumberOfRows(); for (int i = 0; i < rowCount; i++) { Row row = sheet.getRow(i...
[ "public", "int", "getRowIndex", "(", "String", "sheetName", ",", "String", "key", ")", "{", "logger", ".", "entering", "(", "new", "Object", "[", "]", "{", "sheetName", ",", "key", "}", ")", ";", "int", "index", "=", "-", "1", ";", "Sheet", "sheet", ...
Search for the input key from the specified sheet name and return the index position of the row that contained the key @param sheetName - A String that represents the Sheet name from which data is to be read @param key - A String that represents the key for the row for which search is being done. @return - An int that...
[ "Search", "for", "the", "input", "key", "from", "the", "specified", "sheet", "name", "and", "return", "the", "index", "position", "of", "the", "row", "that", "contained", "the", "key" ]
train
https://github.com/paypal/SeLion/blob/694d12d0df76db48d0360b16192770c6a4fbdfd2/dataproviders/src/main/java/com/paypal/selion/platform/dataprovider/impl/ExcelReader.java#L240-L259
petergeneric/stdlib
stdlib/src/main/java/com/peterphi/std/types/CompareHelper.java
CompareHelper.lt
public static <T> boolean lt(Comparable<T> a, T b) { """ <code>a < b</code> @param <T> @param a @param b @return true if a < b """ return lt(a.compareTo(b)); }
java
public static <T> boolean lt(Comparable<T> a, T b) { return lt(a.compareTo(b)); }
[ "public", "static", "<", "T", ">", "boolean", "lt", "(", "Comparable", "<", "T", ">", "a", ",", "T", "b", ")", "{", "return", "lt", "(", "a", ".", "compareTo", "(", "b", ")", ")", ";", "}" ]
<code>a < b</code> @param <T> @param a @param b @return true if a < b
[ "<code", ">", "a", "<", "b<", "/", "code", ">" ]
train
https://github.com/petergeneric/stdlib/blob/d4025d2f881bc0542b1e004c5f65a1ccaf895836/stdlib/src/main/java/com/peterphi/std/types/CompareHelper.java#L82-L85
elki-project/elki
elki-core-math/src/main/java/de/lmu/ifi/dbs/elki/math/linearalgebra/ProjectedCentroid.java
ProjectedCentroid.make
public static ProjectedCentroid make(long[] dims, Relation<? extends NumberVector> relation) { """ Static Constructor from a relation. @param dims Dimensions to use (indexed with 0) @param relation Relation to process @return Centroid """ ProjectedCentroid c = new ProjectedCentroid(dims, RelationUtil....
java
public static ProjectedCentroid make(long[] dims, Relation<? extends NumberVector> relation) { ProjectedCentroid c = new ProjectedCentroid(dims, RelationUtil.dimensionality(relation)); for(DBIDIter iditer = relation.iterDBIDs(); iditer.valid(); iditer.advance()) { c.put(relation.get(iditer)); } re...
[ "public", "static", "ProjectedCentroid", "make", "(", "long", "[", "]", "dims", ",", "Relation", "<", "?", "extends", "NumberVector", ">", "relation", ")", "{", "ProjectedCentroid", "c", "=", "new", "ProjectedCentroid", "(", "dims", ",", "RelationUtil", ".", ...
Static Constructor from a relation. @param dims Dimensions to use (indexed with 0) @param relation Relation to process @return Centroid
[ "Static", "Constructor", "from", "a", "relation", "." ]
train
https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-core-math/src/main/java/de/lmu/ifi/dbs/elki/math/linearalgebra/ProjectedCentroid.java#L138-L144
deeplearning4j/deeplearning4j
nd4j/nd4j-backends/nd4j-backend-impls/nd4j-cuda/src/main/java/org/nd4j/jita/memory/impl/CudaDirectProvider.java
CudaDirectProvider.pingDeviceForFreeMemory
public boolean pingDeviceForFreeMemory(Integer deviceId, long requiredMemory) { """ This method checks specified device for specified amount of memory @param deviceId @param requiredMemory @return """ /* long[] totalMem = new long[1]; long[] freeMem = new long[1]; ...
java
public boolean pingDeviceForFreeMemory(Integer deviceId, long requiredMemory) { /* long[] totalMem = new long[1]; long[] freeMem = new long[1]; JCuda.cudaMemGetInfo(freeMem, totalMem); long free = freeMem[0]; long total = totalMem[0]; lo...
[ "public", "boolean", "pingDeviceForFreeMemory", "(", "Integer", "deviceId", ",", "long", "requiredMemory", ")", "{", "/*\n long[] totalMem = new long[1];\n long[] freeMem = new long[1];\n \n \n JCuda.cudaMemGetInfo(freeMem, totalMem);\n \n long ...
This method checks specified device for specified amount of memory @param deviceId @param requiredMemory @return
[ "This", "method", "checks", "specified", "device", "for", "specified", "amount", "of", "memory" ]
train
https://github.com/deeplearning4j/deeplearning4j/blob/effce52f2afd7eeb53c5bcca699fcd90bd06822f/nd4j/nd4j-backends/nd4j-backend-impls/nd4j-cuda/src/main/java/org/nd4j/jita/memory/impl/CudaDirectProvider.java#L189-L216
HubSpot/Singularity
SingularityClient/src/main/java/com/hubspot/singularity/client/SingularityClient.java
SingularityClient.getActiveSingularityRequests
public Collection<SingularityRequestParent> getActiveSingularityRequests() { """ Get all requests that their state is ACTIVE @return All ACTIVE {@link SingularityRequestParent} instances """ final Function<String, String> requestUri = (host) -> String.format(REQUESTS_GET_ACTIVE_FORMAT, getApiBase(host)...
java
public Collection<SingularityRequestParent> getActiveSingularityRequests() { final Function<String, String> requestUri = (host) -> String.format(REQUESTS_GET_ACTIVE_FORMAT, getApiBase(host)); return getCollection(requestUri, "ACTIVE requests", REQUESTS_COLLECTION); }
[ "public", "Collection", "<", "SingularityRequestParent", ">", "getActiveSingularityRequests", "(", ")", "{", "final", "Function", "<", "String", ",", "String", ">", "requestUri", "=", "(", "host", ")", "-", ">", "String", ".", "format", "(", "REQUESTS_GET_ACTIVE...
Get all requests that their state is ACTIVE @return All ACTIVE {@link SingularityRequestParent} instances
[ "Get", "all", "requests", "that", "their", "state", "is", "ACTIVE" ]
train
https://github.com/HubSpot/Singularity/blob/384a8c16a10aa076af5ca45c8dfcedab9e5122c8/SingularityClient/src/main/java/com/hubspot/singularity/client/SingularityClient.java#L765-L769
rythmengine/rythmengine
src/main/java/org/rythmengine/toString/ToStringStyle.java
ToStringStyle.appendSummary
protected void appendSummary(StringBuilder buffer, String fieldName, int[] array) { """ <p>Append to the <code>toString</code> a summary of an <code>int</code> array.</p> @param buffer the <code>StringBuilder</code> to populate @param fieldName the field name, typically not used as already appended @param...
java
protected void appendSummary(StringBuilder buffer, String fieldName, int[] array) { appendSummarySize(buffer, fieldName, array.length); }
[ "protected", "void", "appendSummary", "(", "StringBuilder", "buffer", ",", "String", "fieldName", ",", "int", "[", "]", "array", ")", "{", "appendSummarySize", "(", "buffer", ",", "fieldName", ",", "array", ".", "length", ")", ";", "}" ]
<p>Append to the <code>toString</code> a summary of an <code>int</code> array.</p> @param buffer the <code>StringBuilder</code> to populate @param fieldName the field name, typically not used as already appended @param array the array to add to the <code>toString</code>, not <code>null</code>
[ "<p", ">", "Append", "to", "the", "<code", ">", "toString<", "/", "code", ">", "a", "summary", "of", "an", "<code", ">", "int<", "/", "code", ">", "array", ".", "<", "/", "p", ">" ]
train
https://github.com/rythmengine/rythmengine/blob/064b565f08d9da07378bf77a9dd856ea5831cc92/src/main/java/org/rythmengine/toString/ToStringStyle.java#L1070-L1072
igniterealtime/Smack
smack-experimental/src/main/java/org/jivesoftware/smackx/muclight/MultiUserChatLightManager.java
MultiUserChatLightManager.unblockUser
public void unblockUser(DomainBareJid mucLightService, Jid userJid) throws NoResponseException, XMPPErrorException, NotConnectedException, InterruptedException { """ Unblock a user. @param mucLightService @param userJid @throws NoResponseException @throws XMPPErrorException @throws NotConnectedE...
java
public void unblockUser(DomainBareJid mucLightService, Jid userJid) throws NoResponseException, XMPPErrorException, NotConnectedException, InterruptedException { HashMap<Jid, Boolean> users = new HashMap<>(); users.put(userJid, true); sendUnblockUsers(mucLightService, users); }
[ "public", "void", "unblockUser", "(", "DomainBareJid", "mucLightService", ",", "Jid", "userJid", ")", "throws", "NoResponseException", ",", "XMPPErrorException", ",", "NotConnectedException", ",", "InterruptedException", "{", "HashMap", "<", "Jid", ",", "Boolean", ">"...
Unblock a user. @param mucLightService @param userJid @throws NoResponseException @throws XMPPErrorException @throws NotConnectedException @throws InterruptedException
[ "Unblock", "a", "user", "." ]
train
https://github.com/igniterealtime/Smack/blob/870756997faec1e1bfabfac0cd6c2395b04da873/smack-experimental/src/main/java/org/jivesoftware/smackx/muclight/MultiUserChatLightManager.java#L384-L389
apache/flink
flink-table/flink-table-planner/src/main/java/org/apache/calcite/sql/validate/SqlValidatorImpl.java
SqlValidatorImpl.validateOrderItem
private void validateOrderItem(SqlSelect select, SqlNode orderItem) { """ Validates an item in the ORDER BY clause of a SELECT statement. @param select Select statement @param orderItem ORDER BY clause item """ switch (orderItem.getKind()) { case DESCENDING: validateFeature(RESOURCE.sQLConformance...
java
private void validateOrderItem(SqlSelect select, SqlNode orderItem) { switch (orderItem.getKind()) { case DESCENDING: validateFeature(RESOURCE.sQLConformance_OrderByDesc(), orderItem.getParserPosition()); validateOrderItem(select, ((SqlCall) orderItem).operand(0)); return; } final SqlVal...
[ "private", "void", "validateOrderItem", "(", "SqlSelect", "select", ",", "SqlNode", "orderItem", ")", "{", "switch", "(", "orderItem", ".", "getKind", "(", ")", ")", "{", "case", "DESCENDING", ":", "validateFeature", "(", "RESOURCE", ".", "sQLConformance_OrderBy...
Validates an item in the ORDER BY clause of a SELECT statement. @param select Select statement @param orderItem ORDER BY clause item
[ "Validates", "an", "item", "in", "the", "ORDER", "BY", "clause", "of", "a", "SELECT", "statement", "." ]
train
https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-table/flink-table-planner/src/main/java/org/apache/calcite/sql/validate/SqlValidatorImpl.java#L3861-L3873
Jasig/uPortal
uPortal-layout/uPortal-layout-impl/src/main/java/org/apereo/portal/layout/dlm/PositionManager.java
PositionManager.getPositionSet
private static Element getPositionSet(Element plfParent, IPerson person, boolean create) throws PortalException { """ This method locates the position set element in the child list of the passed in plfParent or if not found it will create one automatically and return it if the passed in create flag is...
java
private static Element getPositionSet(Element plfParent, IPerson person, boolean create) throws PortalException { Node child = plfParent.getFirstChild(); while (child != null) { if (child.getNodeName().equals(Constants.ELM_POSITION_SET)) return (Element) child; child...
[ "private", "static", "Element", "getPositionSet", "(", "Element", "plfParent", ",", "IPerson", "person", ",", "boolean", "create", ")", "throws", "PortalException", "{", "Node", "child", "=", "plfParent", ".", "getFirstChild", "(", ")", ";", "while", "(", "chi...
This method locates the position set element in the child list of the passed in plfParent or if not found it will create one automatically and return it if the passed in create flag is true.
[ "This", "method", "locates", "the", "position", "set", "element", "in", "the", "child", "list", "of", "the", "passed", "in", "plfParent", "or", "if", "not", "found", "it", "will", "create", "one", "automatically", "and", "return", "it", "if", "the", "passe...
train
https://github.com/Jasig/uPortal/blob/c1986542abb9acd214268f2df21c6305ad2f262b/uPortal-layout/uPortal-layout-impl/src/main/java/org/apereo/portal/layout/dlm/PositionManager.java#L657-L685
kaazing/gateway
mina.core/core/src/main/java/org/apache/mina/proxy/utils/ByteUtilities.java
ByteUtilities.asHex
public static String asHex(byte[] bytes, String separator) { """ Returns a hexadecimal representation of the given byte array. @param bytes the array to output to an hex string @param separator the separator to use between each byte in the output string. If null no char is inserted between each byte value. @...
java
public static String asHex(byte[] bytes, String separator) { StringBuilder sb = new StringBuilder(); for (int i = 0; i < bytes.length; i++) { String code = Integer.toHexString(bytes[i] & 0xFF); if ((bytes[i] & 0xFF) < 16) { sb.append('0'); } ...
[ "public", "static", "String", "asHex", "(", "byte", "[", "]", "bytes", ",", "String", "separator", ")", "{", "StringBuilder", "sb", "=", "new", "StringBuilder", "(", ")", ";", "for", "(", "int", "i", "=", "0", ";", "i", "<", "bytes", ".", "length", ...
Returns a hexadecimal representation of the given byte array. @param bytes the array to output to an hex string @param separator the separator to use between each byte in the output string. If null no char is inserted between each byte value. @return the hex representation as a string
[ "Returns", "a", "hexadecimal", "representation", "of", "the", "given", "byte", "array", "." ]
train
https://github.com/kaazing/gateway/blob/06017b19273109b3b992e528e702586446168d57/mina.core/core/src/main/java/org/apache/mina/proxy/utils/ByteUtilities.java#L246-L262
rzwitserloot/lombok
src/launch/lombok/launch/ShadowClassLoader.java
ShadowClassLoader.inOwnBase
private boolean inOwnBase(String item, String name) { """ Checks if the stated item is located inside the same classpath root as the jar that hosts ShadowClassLoader.class. {@code item} and {@code name} refer to the same thing. """ if (item == null) return false; return (item.length() == SELF_BASE_LENGTH +...
java
private boolean inOwnBase(String item, String name) { if (item == null) return false; return (item.length() == SELF_BASE_LENGTH + name.length()) && SELF_BASE.regionMatches(0, item, 0, SELF_BASE_LENGTH); }
[ "private", "boolean", "inOwnBase", "(", "String", "item", ",", "String", "name", ")", "{", "if", "(", "item", "==", "null", ")", "return", "false", ";", "return", "(", "item", ".", "length", "(", ")", "==", "SELF_BASE_LENGTH", "+", "name", ".", "length...
Checks if the stated item is located inside the same classpath root as the jar that hosts ShadowClassLoader.class. {@code item} and {@code name} refer to the same thing.
[ "Checks", "if", "the", "stated", "item", "is", "located", "inside", "the", "same", "classpath", "root", "as", "the", "jar", "that", "hosts", "ShadowClassLoader", ".", "class", ".", "{" ]
train
https://github.com/rzwitserloot/lombok/blob/75601240760bd81ff95fcde7a1b8185769ce64e8/src/launch/lombok/launch/ShadowClassLoader.java#L308-L311
kaazing/gateway
resource.address/spi/src/main/java/org/kaazing/gateway/resource/address/ResourceAddressFactory.java
ResourceAddressFactory.newResourceAddress
public ResourceAddress newResourceAddress(String location, ResourceOptions options) { """ Creates a new resource address for the given location and options @param options cannot be null, otherwise NullPointerException is thrown @return resource address """ return newResourceAddress(location, option...
java
public ResourceAddress newResourceAddress(String location, ResourceOptions options) { return newResourceAddress(location, options, null /* qualifier */); }
[ "public", "ResourceAddress", "newResourceAddress", "(", "String", "location", ",", "ResourceOptions", "options", ")", "{", "return", "newResourceAddress", "(", "location", ",", "options", ",", "null", "/* qualifier */", ")", ";", "}" ]
Creates a new resource address for the given location and options @param options cannot be null, otherwise NullPointerException is thrown @return resource address
[ "Creates", "a", "new", "resource", "address", "for", "the", "given", "location", "and", "options" ]
train
https://github.com/kaazing/gateway/blob/06017b19273109b3b992e528e702586446168d57/resource.address/spi/src/main/java/org/kaazing/gateway/resource/address/ResourceAddressFactory.java#L134-L136
carewebframework/carewebframework-core
org.carewebframework.api-parent/org.carewebframework.api.core/src/main/java/org/carewebframework/api/messaging/MessageUtil.java
MessageUtil.isMessageExcluded
public static boolean isMessageExcluded(Message message, RecipientType recipientType, String recipientValue) { """ Returns true if the message should be excluded based on the given recipient values. A message is considered excluded if it has any constraint on the recipient type and does not have a matching recip...
java
public static boolean isMessageExcluded(Message message, RecipientType recipientType, String recipientValue) { Recipient[] recipients = (Recipient[]) message.getMetadata("cwf.pub.recipients"); if (recipients == null || recipients.length == 0) { return false; } ...
[ "public", "static", "boolean", "isMessageExcluded", "(", "Message", "message", ",", "RecipientType", "recipientType", ",", "String", "recipientValue", ")", "{", "Recipient", "[", "]", "recipients", "=", "(", "Recipient", "[", "]", ")", "message", ".", "getMetada...
Returns true if the message should be excluded based on the given recipient values. A message is considered excluded if it has any constraint on the recipient type and does not have a matching recipient for that type. @param message The message to examine. @param recipientType The type of recipient. @param recipientVa...
[ "Returns", "true", "if", "the", "message", "should", "be", "excluded", "based", "on", "the", "given", "recipient", "values", ".", "A", "message", "is", "considered", "excluded", "if", "it", "has", "any", "constraint", "on", "the", "recipient", "type", "and",...
train
https://github.com/carewebframework/carewebframework-core/blob/fa3252d4f7541dbe151b92c3d4f6f91433cd1673/org.carewebframework.api-parent/org.carewebframework.api.core/src/main/java/org/carewebframework/api/messaging/MessageUtil.java#L58-L78
apiman/apiman
manager/api/rest-impl/src/main/java/io/apiman/manager/api/rest/impl/audit/AuditUtils.java
AuditUtils.contractBrokenFromClient
public static AuditEntryBean contractBrokenFromClient(ContractBean bean, ISecurityContext securityContext) { """ Creates an audit entry for the 'contract broken' event. @param bean the bean @param securityContext the security context @return the audit entry """ AuditEntryBean entry = newEntry(bean.g...
java
public static AuditEntryBean contractBrokenFromClient(ContractBean bean, ISecurityContext securityContext) { AuditEntryBean entry = newEntry(bean.getClient().getClient().getOrganization().getId(), AuditEntityType.Client, securityContext); entry.setWhat(AuditEntryType.BreakContract); entry.setEnt...
[ "public", "static", "AuditEntryBean", "contractBrokenFromClient", "(", "ContractBean", "bean", ",", "ISecurityContext", "securityContext", ")", "{", "AuditEntryBean", "entry", "=", "newEntry", "(", "bean", ".", "getClient", "(", ")", ".", "getClient", "(", ")", "....
Creates an audit entry for the 'contract broken' event. @param bean the bean @param securityContext the security context @return the audit entry
[ "Creates", "an", "audit", "entry", "for", "the", "contract", "broken", "event", "." ]
train
https://github.com/apiman/apiman/blob/8c049c2a2f2e4a69bbb6125686a15edd26f29c21/manager/api/rest-impl/src/main/java/io/apiman/manager/api/rest/impl/audit/AuditUtils.java#L458-L466
foundation-runtime/service-directory
2.0/sd-api/src/main/java/com/cisco/oss/foundation/directory/impl/DirectoryServiceClient.java
DirectoryServiceClient.getService
public void getService(String serviceName, final GetServiceCallback cb, Object context) { """ Get Service in Callback. @param serviceName the serviceName. @param cb the Callback. @param context the callback context object. """ ProtocolHeader header = new ProtocolHeader(); header.setType...
java
public void getService(String serviceName, final GetServiceCallback cb, Object context){ ProtocolHeader header = new ProtocolHeader(); header.setType(ProtocolType.GetService); GetServiceProtocol p = new GetServiceProtocol(serviceName); p.setWatcher(false); ProtocolCallback pcb ...
[ "public", "void", "getService", "(", "String", "serviceName", ",", "final", "GetServiceCallback", "cb", ",", "Object", "context", ")", "{", "ProtocolHeader", "header", "=", "new", "ProtocolHeader", "(", ")", ";", "header", ".", "setType", "(", "ProtocolType", ...
Get Service in Callback. @param serviceName the serviceName. @param cb the Callback. @param context the callback context object.
[ "Get", "Service", "in", "Callback", "." ]
train
https://github.com/foundation-runtime/service-directory/blob/a7bdefe173dc99e75eff4a24e07e6407e62f2ed4/2.0/sd-api/src/main/java/com/cisco/oss/foundation/directory/impl/DirectoryServiceClient.java#L712-L734
geomajas/geomajas-project-server
plugin/print/print/src/main/java/org/geomajas/plugin/printing/component/PdfContext.java
PdfContext.strokeEllipse
public void strokeEllipse(Rectangle rect, Color color, float linewidth) { """ Draw an elliptical exterior with this color. @param rect rectangle in which ellipse should fit @param color colour to use for stroking @param linewidth line width """ template.saveState(); setStroke(color, linewidth, null); ...
java
public void strokeEllipse(Rectangle rect, Color color, float linewidth) { template.saveState(); setStroke(color, linewidth, null); template.ellipse(origX + rect.getLeft(), origY + rect.getBottom(), origX + rect.getRight(), origY + rect.getTop()); template.stroke(); template.restoreState(); }
[ "public", "void", "strokeEllipse", "(", "Rectangle", "rect", ",", "Color", "color", ",", "float", "linewidth", ")", "{", "template", ".", "saveState", "(", ")", ";", "setStroke", "(", "color", ",", "linewidth", ",", "null", ")", ";", "template", ".", "el...
Draw an elliptical exterior with this color. @param rect rectangle in which ellipse should fit @param color colour to use for stroking @param linewidth line width
[ "Draw", "an", "elliptical", "exterior", "with", "this", "color", "." ]
train
https://github.com/geomajas/geomajas-project-server/blob/904b7d7deed1350d28955589098dd1e0a786d76e/plugin/print/print/src/main/java/org/geomajas/plugin/printing/component/PdfContext.java#L271-L278
atomix/copycat
client/src/main/java/io/atomix/copycat/client/util/AddressSelector.java
AddressSelector.matches
private boolean matches(Collection<Address> left, Collection<Address> right) { """ Returns a boolean value indicating whether the servers in the first list match the servers in the second list. """ if (left.size() != right.size()) return false; for (Address address : left) { if (!right.con...
java
private boolean matches(Collection<Address> left, Collection<Address> right) { if (left.size() != right.size()) return false; for (Address address : left) { if (!right.contains(address)) { return false; } } return true; }
[ "private", "boolean", "matches", "(", "Collection", "<", "Address", ">", "left", ",", "Collection", "<", "Address", ">", "right", ")", "{", "if", "(", "left", ".", "size", "(", ")", "!=", "right", ".", "size", "(", ")", ")", "return", "false", ";", ...
Returns a boolean value indicating whether the servers in the first list match the servers in the second list.
[ "Returns", "a", "boolean", "value", "indicating", "whether", "the", "servers", "in", "the", "first", "list", "match", "the", "servers", "in", "the", "second", "list", "." ]
train
https://github.com/atomix/copycat/blob/c90b88ccd5c63d6ea0b49fb77c25e2f3272a7b10/client/src/main/java/io/atomix/copycat/client/util/AddressSelector.java#L150-L160
google/j2objc
jre_emul/android/platform/external/icu/android_icu4j/src/main/java/android/icu/text/DateFormat.java
DateFormat.getTimeInstance
static final public DateFormat getTimeInstance(Calendar cal, int timeStyle, Locale locale) { """ Creates a {@link DateFormat} object that can be used to format times in the calendar system specified by <code>cal</code>. @param cal The calendar system for which a time format is desired. @param timeStyle The ...
java
static final public DateFormat getTimeInstance(Calendar cal, int timeStyle, Locale locale) { return getDateTimeInstance(cal, -1, timeStyle, ULocale.forLocale(locale)); }
[ "static", "final", "public", "DateFormat", "getTimeInstance", "(", "Calendar", "cal", ",", "int", "timeStyle", ",", "Locale", "locale", ")", "{", "return", "getDateTimeInstance", "(", "cal", ",", "-", "1", ",", "timeStyle", ",", "ULocale", ".", "forLocale", ...
Creates a {@link DateFormat} object that can be used to format times in the calendar system specified by <code>cal</code>. @param cal The calendar system for which a time format is desired. @param timeStyle The type of time format desired. This can be {@link DateFormat#SHORT}, {@link DateFormat#MEDIUM}, etc. @para...
[ "Creates", "a", "{", "@link", "DateFormat", "}", "object", "that", "can", "be", "used", "to", "format", "times", "in", "the", "calendar", "system", "specified", "by", "<code", ">", "cal<", "/", "code", ">", ".", "@param", "cal", "The", "calendar", "syste...
train
https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/external/icu/android_icu4j/src/main/java/android/icu/text/DateFormat.java#L1788-L1791
baidubce/bce-sdk-java
src/main/java/com/baidubce/services/doc/DocClient.java
DocClient.createDocument
public CreateDocumentResponse createDocument(File file, String title, String format) { """ Create a Document. @param file The document . @param title The document title. @param format The document format. @return A CreateDocumentResponse object containing the information returned by Document. """ ...
java
public CreateDocumentResponse createDocument(File file, String title, String format) { CreateDocumentRequest request = new CreateDocumentRequest(); request.setFile(file); request.setTitle(title); request.setFormat(format); return this.createDocument(request); }
[ "public", "CreateDocumentResponse", "createDocument", "(", "File", "file", ",", "String", "title", ",", "String", "format", ")", "{", "CreateDocumentRequest", "request", "=", "new", "CreateDocumentRequest", "(", ")", ";", "request", ".", "setFile", "(", "file", ...
Create a Document. @param file The document . @param title The document title. @param format The document format. @return A CreateDocumentResponse object containing the information returned by Document.
[ "Create", "a", "Document", "." ]
train
https://github.com/baidubce/bce-sdk-java/blob/f7140f28dd82121515c88ded7bfe769a37d0ec4a/src/main/java/com/baidubce/services/doc/DocClient.java#L143-L149
netty/netty
codec-http2/src/main/java/io/netty/handler/codec/http2/HttpConversionUtil.java
HttpConversionUtil.toFullHttpRequest
public static FullHttpRequest toFullHttpRequest(int streamId, Http2Headers http2Headers, ByteBufAllocator alloc, boolean validateHttpHeaders) throws Http2Exception { """ Create a new object to contain the request data @param streamId The stream...
java
public static FullHttpRequest toFullHttpRequest(int streamId, Http2Headers http2Headers, ByteBufAllocator alloc, boolean validateHttpHeaders) throws Http2Exception { // HTTP/2 does not define a way to carry the version identifier that is includ...
[ "public", "static", "FullHttpRequest", "toFullHttpRequest", "(", "int", "streamId", ",", "Http2Headers", "http2Headers", ",", "ByteBufAllocator", "alloc", ",", "boolean", "validateHttpHeaders", ")", "throws", "Http2Exception", "{", "// HTTP/2 does not define a way to carry th...
Create a new object to contain the request data @param streamId The stream associated with the request @param http2Headers The initial set of HTTP/2 headers to create the request with @param alloc The {@link ByteBufAllocator} to use to generate the content of the message @param validateHttpHeaders <ul> <li>{@code true...
[ "Create", "a", "new", "object", "to", "contain", "the", "request", "data" ]
train
https://github.com/netty/netty/blob/ba06eafa1c1824bd154f1a380019e7ea2edf3c4c/codec-http2/src/main/java/io/netty/handler/codec/http2/HttpConversionUtil.java#L246-L266
phax/ph-commons
ph-commons/src/main/java/com/helger/commons/lang/ServiceLoaderHelper.java
ServiceLoaderHelper.getAllSPIImplementations
@Nonnull @ReturnsMutableCopy public static <T> ICommonsList <T> getAllSPIImplementations (@Nonnull final Class <T> aSPIClass, @Nullable final Logger aLogger) { """ Uses the {@link ServiceLoader} to load all SPI implementations of the passed class ...
java
@Nonnull @ReturnsMutableCopy public static <T> ICommonsList <T> getAllSPIImplementations (@Nonnull final Class <T> aSPIClass, @Nullable final Logger aLogger) { return getAllSPIImplementations (aSPIClass, ClassLoaderHelper.getDefaultClassLoader (),...
[ "@", "Nonnull", "@", "ReturnsMutableCopy", "public", "static", "<", "T", ">", "ICommonsList", "<", "T", ">", "getAllSPIImplementations", "(", "@", "Nonnull", "final", "Class", "<", "T", ">", "aSPIClass", ",", "@", "Nullable", "final", "Logger", "aLogger", ")...
Uses the {@link ServiceLoader} to load all SPI implementations of the passed class @param <T> The implementation type to be loaded @param aSPIClass The SPI interface class. May not be <code>null</code>. @param aLogger An optional logger to use. May be <code>null</code>. @return A list of all currently available plugin...
[ "Uses", "the", "{", "@link", "ServiceLoader", "}", "to", "load", "all", "SPI", "implementations", "of", "the", "passed", "class" ]
train
https://github.com/phax/ph-commons/blob/d28c03565f44a0b804d96028d0969f9bb38c4313/ph-commons/src/main/java/com/helger/commons/lang/ServiceLoaderHelper.java#L103-L109
pravega/pravega
controller/src/main/java/io/pravega/controller/metrics/StreamMetrics.java
StreamMetrics.truncateStreamFailed
public void truncateStreamFailed(String scope, String streamName) { """ This method increments the counter of failed Stream truncate operations in the system as well as the failed truncate attempts for this specific Stream. @param scope Scope. @param streamName Name of the Stream. """ D...
java
public void truncateStreamFailed(String scope, String streamName) { DYNAMIC_LOGGER.incCounterValue(globalMetricName(TRUNCATE_STREAM_FAILED), 1); DYNAMIC_LOGGER.incCounterValue(TRUNCATE_STREAM_FAILED, 1, streamTags(scope, streamName)); }
[ "public", "void", "truncateStreamFailed", "(", "String", "scope", ",", "String", "streamName", ")", "{", "DYNAMIC_LOGGER", ".", "incCounterValue", "(", "globalMetricName", "(", "TRUNCATE_STREAM_FAILED", ")", ",", "1", ")", ";", "DYNAMIC_LOGGER", ".", "incCounterValu...
This method increments the counter of failed Stream truncate operations in the system as well as the failed truncate attempts for this specific Stream. @param scope Scope. @param streamName Name of the Stream.
[ "This", "method", "increments", "the", "counter", "of", "failed", "Stream", "truncate", "operations", "in", "the", "system", "as", "well", "as", "the", "failed", "truncate", "attempts", "for", "this", "specific", "Stream", "." ]
train
https://github.com/pravega/pravega/blob/6e24df7470669b3956a07018f52b2c6b3c2a3503/controller/src/main/java/io/pravega/controller/metrics/StreamMetrics.java#L178-L181
bitcoinj/bitcoinj
core/src/main/java/org/bitcoinj/core/SegwitAddress.java
SegwitAddress.fromBech32
public static SegwitAddress fromBech32(@Nullable NetworkParameters params, String bech32) throws AddressFormatException { """ Construct a {@link SegwitAddress} from its textual form. @param params expected network this address is valid for, or null if the network should be derived from the bech32 ...
java
public static SegwitAddress fromBech32(@Nullable NetworkParameters params, String bech32) throws AddressFormatException { Bech32.Bech32Data bechData = Bech32.decode(bech32); if (params == null) { for (NetworkParameters p : Networks.get()) { if (bechData.hrp.equals...
[ "public", "static", "SegwitAddress", "fromBech32", "(", "@", "Nullable", "NetworkParameters", "params", ",", "String", "bech32", ")", "throws", "AddressFormatException", "{", "Bech32", ".", "Bech32Data", "bechData", "=", "Bech32", ".", "decode", "(", "bech32", ")"...
Construct a {@link SegwitAddress} from its textual form. @param params expected network this address is valid for, or null if the network should be derived from the bech32 @param bech32 bech32-encoded textual form of the address @return constructed address @throws AddressFormatException if something about the given be...
[ "Construct", "a", "{", "@link", "SegwitAddress", "}", "from", "its", "textual", "form", "." ]
train
https://github.com/bitcoinj/bitcoinj/blob/9cf13d29315014ed59cf4fc5944e5f227e8df9a6/core/src/main/java/org/bitcoinj/core/SegwitAddress.java#L165-L179
alkacon/opencms-core
src/org/opencms/xml/CmsXmlUtils.java
CmsXmlUtils.validateXmlStructure
public static void validateXmlStructure(Document document, String encoding, EntityResolver resolver) throws CmsXmlException { """ Validates the structure of a XML document with the DTD or XML schema used by the document.<p> @param document a XML document that should be validated @param encoding the encodi...
java
public static void validateXmlStructure(Document document, String encoding, EntityResolver resolver) throws CmsXmlException { // generate bytes from document byte[] xmlData = ((ByteArrayOutputStream)marshal( document, new ByteArrayOutputStream(512), encoding)).to...
[ "public", "static", "void", "validateXmlStructure", "(", "Document", "document", ",", "String", "encoding", ",", "EntityResolver", "resolver", ")", "throws", "CmsXmlException", "{", "// generate bytes from document", "byte", "[", "]", "xmlData", "=", "(", "(", "Byte...
Validates the structure of a XML document with the DTD or XML schema used by the document.<p> @param document a XML document that should be validated @param encoding the encoding to use when marshalling the XML document (required) @param resolver the XML entity resolver to use @throws CmsXmlException if the validatio...
[ "Validates", "the", "structure", "of", "a", "XML", "document", "with", "the", "DTD", "or", "XML", "schema", "used", "by", "the", "document", ".", "<p", ">" ]
train
https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/xml/CmsXmlUtils.java#L842-L851
Azure/azure-sdk-for-java
cognitiveservices/data-plane/vision/contentmoderator/src/main/java/com/microsoft/azure/cognitiveservices/vision/contentmoderator/implementation/ImageModerationsImpl.java
ImageModerationsImpl.findFacesFileInputWithServiceResponseAsync
public Observable<ServiceResponse<FoundFaces>> findFacesFileInputWithServiceResponseAsync(byte[] imageStream, FindFacesFileInputOptionalParameter findFacesFileInputOptionalParameter) { """ Returns the list of faces found. @param imageStream The image file. @param findFacesFileInputOptionalParameter the object ...
java
public Observable<ServiceResponse<FoundFaces>> findFacesFileInputWithServiceResponseAsync(byte[] imageStream, FindFacesFileInputOptionalParameter findFacesFileInputOptionalParameter) { if (this.client.baseUrl() == null) { throw new IllegalArgumentException("Parameter this.client.baseUrl() is require...
[ "public", "Observable", "<", "ServiceResponse", "<", "FoundFaces", ">", ">", "findFacesFileInputWithServiceResponseAsync", "(", "byte", "[", "]", "imageStream", ",", "FindFacesFileInputOptionalParameter", "findFacesFileInputOptionalParameter", ")", "{", "if", "(", "this", ...
Returns the list of faces found. @param imageStream The image file. @param findFacesFileInputOptionalParameter the object representing the optional parameters to be set before calling this API @throws IllegalArgumentException thrown if parameters fail the validation @return the observable to the FoundFaces object
[ "Returns", "the", "list", "of", "faces", "found", "." ]
train
https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/cognitiveservices/data-plane/vision/contentmoderator/src/main/java/com/microsoft/azure/cognitiveservices/vision/contentmoderator/implementation/ImageModerationsImpl.java#L764-L774
graknlabs/grakn
server/src/server/kb/concept/ElementFactory.java
ElementFactory.buildVertexElement
public VertexElement buildVertexElement(Vertex vertex) { """ Builds a VertexElement from an already existing Vertex. * @throws TransactionException if vertex is not valid. A vertex is not valid if it is null or has been deleted @param vertex A vertex which can possibly be turned into a VertexElement @return A ...
java
public VertexElement buildVertexElement(Vertex vertex) { if (!tx.isValidElement(vertex)) { Objects.requireNonNull(vertex); throw TransactionException.invalidElement(vertex); } return new VertexElement(tx, vertex); }
[ "public", "VertexElement", "buildVertexElement", "(", "Vertex", "vertex", ")", "{", "if", "(", "!", "tx", ".", "isValidElement", "(", "vertex", ")", ")", "{", "Objects", ".", "requireNonNull", "(", "vertex", ")", ";", "throw", "TransactionException", ".", "i...
Builds a VertexElement from an already existing Vertex. * @throws TransactionException if vertex is not valid. A vertex is not valid if it is null or has been deleted @param vertex A vertex which can possibly be turned into a VertexElement @return A VertexElement of
[ "Builds", "a", "VertexElement", "from", "an", "already", "existing", "Vertex", ".", "*" ]
train
https://github.com/graknlabs/grakn/blob/6aaee75ea846202474d591f8809d62028262fac5/server/src/server/kb/concept/ElementFactory.java#L295-L301
unbescape/unbescape
src/main/java/org/unbescape/html/HtmlEscape.java
HtmlEscape.unescapeHtml
public static void unescapeHtml(final String text, final Writer writer) throws IOException { """ <p> Perform an HTML <strong>unescape</strong> operation on a <tt>String</tt> input, writing results to a <tt>Writer</tt>. </p> <p> No additional configuration arguments are required. Unescape operation...
java
public static void unescapeHtml(final String text, final Writer writer) throws IOException { if (writer == null) { throw new IllegalArgumentException("Argument 'writer' cannot be null"); } if (text == null) { return; } if (text.indexOf('&') < ...
[ "public", "static", "void", "unescapeHtml", "(", "final", "String", "text", ",", "final", "Writer", "writer", ")", "throws", "IOException", "{", "if", "(", "writer", "==", "null", ")", "{", "throw", "new", "IllegalArgumentException", "(", "\"Argument 'writer' ca...
<p> Perform an HTML <strong>unescape</strong> operation on a <tt>String</tt> input, writing results to a <tt>Writer</tt>. </p> <p> No additional configuration arguments are required. Unescape operations will always perform <em>complete</em> unescape of NCRs (whole HTML5 set supported), decimal and hexadecimal reference...
[ "<p", ">", "Perform", "an", "HTML", "<strong", ">", "unescape<", "/", "strong", ">", "operation", "on", "a", "<tt", ">", "String<", "/", "tt", ">", "input", "writing", "results", "to", "a", "<tt", ">", "Writer<", "/", "tt", ">", ".", "<", "/", "p",...
train
https://github.com/unbescape/unbescape/blob/ec5435fb3508c2eed25d8165dc27ded2602cae13/src/main/java/org/unbescape/html/HtmlEscape.java#L1123-L1140
inkstand-io/scribble
scribble-jcr/src/main/java/io/inkstand/scribble/jcr/rules/ContentRepository.java
ContentRepository.removeAccessControlEntries
private void removeAccessControlEntries(final AccessControlList acl, final String principalName) throws RepositoryException { """ Removes all entries from the {@link AccessControlList} that match the given principal name. @param acl the acl from which the entries should be removed @param principal...
java
private void removeAccessControlEntries(final AccessControlList acl, final String principalName) throws RepositoryException { for (final AccessControlEntry e : acl.getAccessControlEntries()) { this.removeAccessControlEntry(acl, e, principalName); } }
[ "private", "void", "removeAccessControlEntries", "(", "final", "AccessControlList", "acl", ",", "final", "String", "principalName", ")", "throws", "RepositoryException", "{", "for", "(", "final", "AccessControlEntry", "e", ":", "acl", ".", "getAccessControlEntries", "...
Removes all entries from the {@link AccessControlList} that match the given principal name. @param acl the acl from which the entries should be removed @param principalName the name of the principal whose matching entries should be removed. If the wildcard '*' is used, all entries will be removed. @throws RepositoryE...
[ "Removes", "all", "entries", "from", "the", "{", "@link", "AccessControlList", "}", "that", "match", "the", "given", "principal", "name", "." ]
train
https://github.com/inkstand-io/scribble/blob/66e67553bad4b1ff817e1715fd1d3dd833406744/scribble-jcr/src/main/java/io/inkstand/scribble/jcr/rules/ContentRepository.java#L473-L479
vanilladb/vanillacore
src/main/java/org/vanilladb/core/storage/record/RecordPage.java
RecordPage.setVal
public void setVal(String fldName, Constant val) { """ Stores a value at the specified field of this record. @param fldName the name of the field @param val the constant value stored in that field """ int position = fieldPos(fldName); setVal(position, val); }
java
public void setVal(String fldName, Constant val) { int position = fieldPos(fldName); setVal(position, val); }
[ "public", "void", "setVal", "(", "String", "fldName", ",", "Constant", "val", ")", "{", "int", "position", "=", "fieldPos", "(", "fldName", ")", ";", "setVal", "(", "position", ",", "val", ")", ";", "}" ]
Stores a value at the specified field of this record. @param fldName the name of the field @param val the constant value stored in that field
[ "Stores", "a", "value", "at", "the", "specified", "field", "of", "this", "record", "." ]
train
https://github.com/vanilladb/vanillacore/blob/d9a34e876b1b83226036d1fa982a614bbef59bd1/src/main/java/org/vanilladb/core/storage/record/RecordPage.java#L200-L203
aws/aws-sdk-java
aws-java-sdk-kms/src/main/java/com/amazonaws/services/kms/model/ReEncryptRequest.java
ReEncryptRequest.setDestinationEncryptionContext
public void setDestinationEncryptionContext(java.util.Map<String, String> destinationEncryptionContext) { """ <p> Encryption context to use when the data is reencrypted. </p> @param destinationEncryptionContext Encryption context to use when the data is reencrypted. """ this.destinationEncryption...
java
public void setDestinationEncryptionContext(java.util.Map<String, String> destinationEncryptionContext) { this.destinationEncryptionContext = destinationEncryptionContext == null ? null : new com.amazonaws.internal.SdkInternalMap<String, String>( destinationEncryptionContext); }
[ "public", "void", "setDestinationEncryptionContext", "(", "java", ".", "util", ".", "Map", "<", "String", ",", "String", ">", "destinationEncryptionContext", ")", "{", "this", ".", "destinationEncryptionContext", "=", "destinationEncryptionContext", "==", "null", "?",...
<p> Encryption context to use when the data is reencrypted. </p> @param destinationEncryptionContext Encryption context to use when the data is reencrypted.
[ "<p", ">", "Encryption", "context", "to", "use", "when", "the", "data", "is", "reencrypted", ".", "<", "/", "p", ">" ]
train
https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-kms/src/main/java/com/amazonaws/services/kms/model/ReEncryptRequest.java#L494-L497
OpenLiberty/open-liberty
dev/com.ibm.ws.kernel.boot.core/src/com/ibm/ws/kernel/boot/BootstrapConfig.java
BootstrapConfig.mergeProperties
protected void mergeProperties(Map<String, String> target, URL baseURL, String urlStr) { """ Merge properties from resource specified by urlStr (which is resolved against the given baseURL, in the case of relative paths) into the target map. @param target Target map to populate with new properties @param ba...
java
protected void mergeProperties(Map<String, String> target, URL baseURL, String urlStr) { String includes = null; URL url; try { if (baseURL != null && urlStr == null) url = baseURL; else url = new URL(baseURL, urlStr); // Read ...
[ "protected", "void", "mergeProperties", "(", "Map", "<", "String", ",", "String", ">", "target", ",", "URL", "baseURL", ",", "String", "urlStr", ")", "{", "String", "includes", "=", "null", ";", "URL", "url", ";", "try", "{", "if", "(", "baseURL", "!="...
Merge properties from resource specified by urlStr (which is resolved against the given baseURL, in the case of relative paths) into the target map. @param target Target map to populate with new properties @param baseURL Base location used for resolving relative paths @param urlStr URL string describing the properties...
[ "Merge", "properties", "from", "resource", "specified", "by", "urlStr", "(", "which", "is", "resolved", "against", "the", "given", "baseURL", "in", "the", "case", "of", "relative", "paths", ")", "into", "the", "target", "map", "." ]
train
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.kernel.boot.core/src/com/ibm/ws/kernel/boot/BootstrapConfig.java#L666-L693
Kickflip/kickflip-android-sdk
sdk/src/main/java/io/kickflip/sdk/Kickflip.java
Kickflip.addLocationToStream
public static void addLocationToStream(final Context context, final Stream stream, final EventBus eventBus) { """ Convenience method for attaching the current reverse geocoded device location to a given {@link io.kickflip.sdk.api.json.Stream} @param context the host application {@link android.content.Context}...
java
public static void addLocationToStream(final Context context, final Stream stream, final EventBus eventBus) { DeviceLocation.getLastKnownLocation(context, false, new DeviceLocation.LocationResult() { @Override public void gotLocation(Location location) { stream.setLatitud...
[ "public", "static", "void", "addLocationToStream", "(", "final", "Context", "context", ",", "final", "Stream", "stream", ",", "final", "EventBus", "eventBus", ")", "{", "DeviceLocation", ".", "getLastKnownLocation", "(", "context", ",", "false", ",", "new", "Dev...
Convenience method for attaching the current reverse geocoded device location to a given {@link io.kickflip.sdk.api.json.Stream} @param context the host application {@link android.content.Context} @param stream the {@link io.kickflip.sdk.api.json.Stream} to attach location to @param eventBus an {@link com.google.co...
[ "Convenience", "method", "for", "attaching", "the", "current", "reverse", "geocoded", "device", "location", "to", "a", "given", "{", "@link", "io", ".", "kickflip", ".", "sdk", ".", "api", ".", "json", ".", "Stream", "}" ]
train
https://github.com/Kickflip/kickflip-android-sdk/blob/af3aae5f1128d7376e67aefe11a3a1a3844be734/sdk/src/main/java/io/kickflip/sdk/Kickflip.java#L191-L214
google/closure-templates
java/src/com/google/template/soy/parsepasses/contextautoesc/RawTextContextUpdater.java
RawTextContextUpdater.makeTransitionToSelf
private static Transition makeTransitionToSelf(Pattern regex) { """ A transition that consumes some content without changing state. """ return new Transition(regex) { @Override Context computeNextContext(Context prior, Matcher matcher) { return prior; } }; }
java
private static Transition makeTransitionToSelf(Pattern regex) { return new Transition(regex) { @Override Context computeNextContext(Context prior, Matcher matcher) { return prior; } }; }
[ "private", "static", "Transition", "makeTransitionToSelf", "(", "Pattern", "regex", ")", "{", "return", "new", "Transition", "(", "regex", ")", "{", "@", "Override", "Context", "computeNextContext", "(", "Context", "prior", ",", "Matcher", "matcher", ")", "{", ...
A transition that consumes some content without changing state.
[ "A", "transition", "that", "consumes", "some", "content", "without", "changing", "state", "." ]
train
https://github.com/google/closure-templates/blob/cc61e1dff70ae97f24f417a57410081bc498bd56/java/src/com/google/template/soy/parsepasses/contextautoesc/RawTextContextUpdater.java#L336-L343
shrinkwrap/resolver
maven/impl-maven/src/main/java/org/jboss/shrinkwrap/resolver/impl/maven/aether/ClasspathWorkspaceReader.java
ClasspathWorkspaceReader.areEquivalent
private boolean areEquivalent(final Artifact artifact, final Artifact foundArtifact) { """ Returns if two artifacts are equivalent, that is, have the same groupId, artifactId and Version @param artifact left side artifact to be compared @param foundArtifact right side artifact to be compared @return true ...
java
private boolean areEquivalent(final Artifact artifact, final Artifact foundArtifact) { boolean areEquivalent = (foundArtifact.getGroupId().equals(artifact.getGroupId()) && foundArtifact.getArtifactId().equals(artifact.getArtifactId()) && foundArtifact.getVersion().equals( artifac...
[ "private", "boolean", "areEquivalent", "(", "final", "Artifact", "artifact", ",", "final", "Artifact", "foundArtifact", ")", "{", "boolean", "areEquivalent", "=", "(", "foundArtifact", ".", "getGroupId", "(", ")", ".", "equals", "(", "artifact", ".", "getGroupId...
Returns if two artifacts are equivalent, that is, have the same groupId, artifactId and Version @param artifact left side artifact to be compared @param foundArtifact right side artifact to be compared @return true if the groupId, artifactId and version matches
[ "Returns", "if", "two", "artifacts", "are", "equivalent", "that", "is", "have", "the", "same", "groupId", "artifactId", "and", "Version" ]
train
https://github.com/shrinkwrap/resolver/blob/e881a84b8cff5b0a014f2a5ebf612be3eb9db01f/maven/impl-maven/src/main/java/org/jboss/shrinkwrap/resolver/impl/maven/aether/ClasspathWorkspaceReader.java#L236-L241
tango-controls/JTango
server/src/main/java/org/tango/server/cache/PollingManager.java
PollingManager.addCommandPolling
public void addCommandPolling(final String commandName, final int pollingPeriod) throws DevFailed { """ Add command polling. Init command cannot be polled. Only command with parameter void can be polled @param commandName the command to poll @param pollingPeriod the polling period @throws DevFailed """...
java
public void addCommandPolling(final String commandName, final int pollingPeriod) throws DevFailed { checkPollingLimits(commandName, pollingPeriod, minCommandPolling); final CommandImpl command = CommandGetter.getCommand(commandName, commandList); if (!command.getName().equals(DeviceImpl.INIT_...
[ "public", "void", "addCommandPolling", "(", "final", "String", "commandName", ",", "final", "int", "pollingPeriod", ")", "throws", "DevFailed", "{", "checkPollingLimits", "(", "commandName", ",", "pollingPeriod", ",", "minCommandPolling", ")", ";", "final", "Command...
Add command polling. Init command cannot be polled. Only command with parameter void can be polled @param commandName the command to poll @param pollingPeriod the polling period @throws DevFailed
[ "Add", "command", "polling", ".", "Init", "command", "cannot", "be", "polled", ".", "Only", "command", "with", "parameter", "void", "can", "be", "polled" ]
train
https://github.com/tango-controls/JTango/blob/1ccc9dcb83e6de2359a9f1906d170571cacf1345/server/src/main/java/org/tango/server/cache/PollingManager.java#L239-L257
camunda/camunda-bpm-platform
engine/src/main/java/org/camunda/bpm/engine/impl/pvm/runtime/LegacyBehavior.java
LegacyBehavior.isCompensationThrowing
public static boolean isCompensationThrowing(PvmExecutionImpl execution, Map<ScopeImpl, PvmExecutionImpl> activityExecutionMapping) { """ Returns true if the given execution is in a compensation-throwing activity but there is no dedicated scope execution in the given mapping. """ if (CompensationBehavior....
java
public static boolean isCompensationThrowing(PvmExecutionImpl execution, Map<ScopeImpl, PvmExecutionImpl> activityExecutionMapping) { if (CompensationBehavior.isCompensationThrowing(execution)) { ScopeImpl compensationThrowingActivity = execution.getActivity(); if (compensationThrowingActivity.isScope(...
[ "public", "static", "boolean", "isCompensationThrowing", "(", "PvmExecutionImpl", "execution", ",", "Map", "<", "ScopeImpl", ",", "PvmExecutionImpl", ">", "activityExecutionMapping", ")", "{", "if", "(", "CompensationBehavior", ".", "isCompensationThrowing", "(", "execu...
Returns true if the given execution is in a compensation-throwing activity but there is no dedicated scope execution in the given mapping.
[ "Returns", "true", "if", "the", "given", "execution", "is", "in", "a", "compensation", "-", "throwing", "activity", "but", "there", "is", "no", "dedicated", "scope", "execution", "in", "the", "given", "mapping", "." ]
train
https://github.com/camunda/camunda-bpm-platform/blob/1a464fc887ef3760e53d6f91b9e5b871a0d77cc0/engine/src/main/java/org/camunda/bpm/engine/impl/pvm/runtime/LegacyBehavior.java#L604-L621
Azure/azure-sdk-for-java
logic/resource-manager/v2016_06_01/src/main/java/com/microsoft/azure/management/logic/v2016_06_01/implementation/IntegrationAccountsInner.java
IntegrationAccountsInner.getByResourceGroupAsync
public Observable<IntegrationAccountInner> getByResourceGroupAsync(String resourceGroupName, String integrationAccountName) { """ Gets an integration account. @param resourceGroupName The resource group name. @param integrationAccountName The integration account name. @throws IllegalArgumentException thrown i...
java
public Observable<IntegrationAccountInner> getByResourceGroupAsync(String resourceGroupName, String integrationAccountName) { return getByResourceGroupWithServiceResponseAsync(resourceGroupName, integrationAccountName).map(new Func1<ServiceResponse<IntegrationAccountInner>, IntegrationAccountInner>() { ...
[ "public", "Observable", "<", "IntegrationAccountInner", ">", "getByResourceGroupAsync", "(", "String", "resourceGroupName", ",", "String", "integrationAccountName", ")", "{", "return", "getByResourceGroupWithServiceResponseAsync", "(", "resourceGroupName", ",", "integrationAcco...
Gets an integration account. @param resourceGroupName The resource group name. @param integrationAccountName The integration account name. @throws IllegalArgumentException thrown if parameters fail the validation @return the observable to the IntegrationAccountInner object
[ "Gets", "an", "integration", "account", "." ]
train
https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/logic/resource-manager/v2016_06_01/src/main/java/com/microsoft/azure/management/logic/v2016_06_01/implementation/IntegrationAccountsInner.java#L601-L608
RestComm/media-core
component/src/main/java/org/restcomm/media/core/component/audio/GoertzelFilter.java
GoertzelFilter.getPower
public double getPower(double[] signal, int offset) { """ Calculates power of the specified frequence of the specified signal. @param signal sampled signal. @param offset index of the first sample of the signal. @return the power of the specified frequency """ int M = hamming.length + offset; ...
java
public double getPower(double[] signal, int offset) { int M = hamming.length + offset; //hamming window for (int i = offset; i < M; i++) { signal[i] *= hamming[i-offset]; } //Goertzel filter double d1 = 0.0; double d2 = 0.0; d...
[ "public", "double", "getPower", "(", "double", "[", "]", "signal", ",", "int", "offset", ")", "{", "int", "M", "=", "hamming", ".", "length", "+", "offset", ";", "//hamming window", "for", "(", "int", "i", "=", "offset", ";", "i", "<", "M", ";", "i...
Calculates power of the specified frequence of the specified signal. @param signal sampled signal. @param offset index of the first sample of the signal. @return the power of the specified frequency
[ "Calculates", "power", "of", "the", "specified", "frequence", "of", "the", "specified", "signal", "." ]
train
https://github.com/RestComm/media-core/blob/07b8703343708599f60af66bae62aded77ee81b5/component/src/main/java/org/restcomm/media/core/component/audio/GoertzelFilter.java#L106-L129
UrielCh/ovh-java-sdk
ovh-java-sdk-cloud/src/main/java/net/minidev/ovh/api/ApiOvhCloud.java
ApiOvhCloud.project_serviceName_volume_POST
public OvhVolume project_serviceName_volume_POST(String serviceName, String description, String imageId, String name, String region, Long size, String snapshotId, OvhVolumeTypeEnum type) throws IOException { """ Create a volume REST: POST /cloud/project/{serviceName}/volume @param description [required] Volume...
java
public OvhVolume project_serviceName_volume_POST(String serviceName, String description, String imageId, String name, String region, Long size, String snapshotId, OvhVolumeTypeEnum type) throws IOException { String qPath = "/cloud/project/{serviceName}/volume"; StringBuilder sb = path(qPath, serviceName); HashMap...
[ "public", "OvhVolume", "project_serviceName_volume_POST", "(", "String", "serviceName", ",", "String", "description", ",", "String", "imageId", ",", "String", "name", ",", "String", "region", ",", "Long", "size", ",", "String", "snapshotId", ",", "OvhVolumeTypeEnum"...
Create a volume REST: POST /cloud/project/{serviceName}/volume @param description [required] Volume description @param imageId [required] Id of image to create a bootable volume @param name [required] Volume name @param region [required] Volume region @param serviceName [required] Project id @param size [required] Vol...
[ "Create", "a", "volume" ]
train
https://github.com/UrielCh/ovh-java-sdk/blob/6d531a40e56e09701943e334c25f90f640c55701/ovh-java-sdk-cloud/src/main/java/net/minidev/ovh/api/ApiOvhCloud.java#L1227-L1240
j-easy/easy-random
easy-random-core/src/main/java/org/jeasy/random/randomizers/range/LocalDateRangeRandomizer.java
LocalDateRangeRandomizer.aNewLocalDateRangeRandomizer
public static LocalDateRangeRandomizer aNewLocalDateRangeRandomizer(final LocalDate min, final LocalDate max, final long seed) { """ Create a new {@link LocalDateRangeRandomizer}. @param min min value @param max max value @param seed initial seed @return a new {@link LocalDateRangeRandomizer}. """ ...
java
public static LocalDateRangeRandomizer aNewLocalDateRangeRandomizer(final LocalDate min, final LocalDate max, final long seed) { return new LocalDateRangeRandomizer(min, max, seed); }
[ "public", "static", "LocalDateRangeRandomizer", "aNewLocalDateRangeRandomizer", "(", "final", "LocalDate", "min", ",", "final", "LocalDate", "max", ",", "final", "long", "seed", ")", "{", "return", "new", "LocalDateRangeRandomizer", "(", "min", ",", "max", ",", "s...
Create a new {@link LocalDateRangeRandomizer}. @param min min value @param max max value @param seed initial seed @return a new {@link LocalDateRangeRandomizer}.
[ "Create", "a", "new", "{", "@link", "LocalDateRangeRandomizer", "}", "." ]
train
https://github.com/j-easy/easy-random/blob/816b0d6a74c7288af111e70ae1b0b57d7fe3b59d/easy-random-core/src/main/java/org/jeasy/random/randomizers/range/LocalDateRangeRandomizer.java#L76-L78
finmath/finmath-lib
src/main/java6/net/finmath/marketdata/products/SwapAnnuity.java
SwapAnnuity.getSwapAnnuity
public static double getSwapAnnuity(double evaluationTime, ScheduleInterface schedule, DiscountCurveInterface discountCurve, AnalyticModelInterface model) { """ Function to calculate an (idealized) swap annuity for a given schedule and discount curve. Note that, the value returned is divided by the discount fac...
java
public static double getSwapAnnuity(double evaluationTime, ScheduleInterface schedule, DiscountCurveInterface discountCurve, AnalyticModelInterface model) { double value = 0.0; for(int periodIndex=0; periodIndex<schedule.getNumberOfPeriods(); periodIndex++) { double paymentDate = schedule.getPayment(periodIndex...
[ "public", "static", "double", "getSwapAnnuity", "(", "double", "evaluationTime", ",", "ScheduleInterface", "schedule", ",", "DiscountCurveInterface", "discountCurve", ",", "AnalyticModelInterface", "model", ")", "{", "double", "value", "=", "0.0", ";", "for", "(", "...
Function to calculate an (idealized) swap annuity for a given schedule and discount curve. Note that, the value returned is divided by the discount factor at evaluation. This matters, if the discount factor at evaluationTime is not equal to 1.0. @param evaluationTime The evaluation time as double. Cash flows prior an...
[ "Function", "to", "calculate", "an", "(", "idealized", ")", "swap", "annuity", "for", "a", "given", "schedule", "and", "discount", "curve", "." ]
train
https://github.com/finmath/finmath-lib/blob/a3c067d52dd33feb97d851df6cab130e4116759f/src/main/java6/net/finmath/marketdata/products/SwapAnnuity.java#L117-L130
opsmatters/opsmatters-core
src/main/java/com/opsmatters/core/util/DateUtilities.java
DateUtilities.addDays
public static Date addDays(long dt, int days) { """ Returns the given date adding the given number of days. @param dt The date to add the days to @param days The number of days to add. To subtract days, use a negative value. @return The date with the given days added """ Calendar c = getCalendar(); ...
java
public static Date addDays(long dt, int days) { Calendar c = getCalendar(); if(dt > 0L) c.setTimeInMillis(dt); c.add(Calendar.DATE, days); return c.getTime(); }
[ "public", "static", "Date", "addDays", "(", "long", "dt", ",", "int", "days", ")", "{", "Calendar", "c", "=", "getCalendar", "(", ")", ";", "if", "(", "dt", ">", "0L", ")", "c", ".", "setTimeInMillis", "(", "dt", ")", ";", "c", ".", "add", "(", ...
Returns the given date adding the given number of days. @param dt The date to add the days to @param days The number of days to add. To subtract days, use a negative value. @return The date with the given days added
[ "Returns", "the", "given", "date", "adding", "the", "given", "number", "of", "days", "." ]
train
https://github.com/opsmatters/opsmatters-core/blob/c48904f7e8d029fd45357811ec38a735e261e3fd/src/main/java/com/opsmatters/core/util/DateUtilities.java#L354-L361
morimekta/providence
providence-core/src/main/java/net/morimekta/providence/util/ProvidenceHelper.java
ProvidenceHelper.parseDebugString
@Nonnull public static <Message extends PMessage<Message, Field>, Field extends PField> Message parseDebugString(String string, PMessageDescriptor<Message, Field> descriptor) { """ Parses a pretty formatted string, and makes exceptions unchecked. @param string The message string to parse. @param descri...
java
@Nonnull public static <Message extends PMessage<Message, Field>, Field extends PField> Message parseDebugString(String string, PMessageDescriptor<Message, Field> descriptor) { try { ByteArrayInputStream bais = new ByteArrayInputStream(string.getBytes(UTF_8)); return DEBUG_STRING...
[ "@", "Nonnull", "public", "static", "<", "Message", "extends", "PMessage", "<", "Message", ",", "Field", ">", ",", "Field", "extends", "PField", ">", "Message", "parseDebugString", "(", "String", "string", ",", "PMessageDescriptor", "<", "Message", ",", "Field...
Parses a pretty formatted string, and makes exceptions unchecked. @param string The message string to parse. @param descriptor The message descriptor. @param <Message> The message type. @param <Field> The message field type. @return The parsed message.
[ "Parses", "a", "pretty", "formatted", "string", "and", "makes", "exceptions", "unchecked", "." ]
train
https://github.com/morimekta/providence/blob/7c17dc1c96b1a1d4b9ff942c2cfeb725278bd3aa/providence-core/src/main/java/net/morimekta/providence/util/ProvidenceHelper.java#L134-L143
BioPAX/Paxtools
paxtools-core/src/main/java/org/biopax/paxtools/converter/LevelUpgrader.java
LevelUpgrader.createSimplePhysicalEntity
private SimplePhysicalEntity createSimplePhysicalEntity(physicalEntityParticipant pep) { """ /* Create L3 simple PE type using the L2 pEP. When pEP's PHYSICAL_ENTITY is either complex or basic physicalEntity, null will be the result. """ physicalEntity pe2 = pep.getPHYSICAL_ENTITY(); return createSimp...
java
private SimplePhysicalEntity createSimplePhysicalEntity(physicalEntityParticipant pep) { physicalEntity pe2 = pep.getPHYSICAL_ENTITY(); return createSimplePhysicalEntity(pe2, pep.getUri()); }
[ "private", "SimplePhysicalEntity", "createSimplePhysicalEntity", "(", "physicalEntityParticipant", "pep", ")", "{", "physicalEntity", "pe2", "=", "pep", ".", "getPHYSICAL_ENTITY", "(", ")", ";", "return", "createSimplePhysicalEntity", "(", "pe2", ",", "pep", ".", "get...
/* Create L3 simple PE type using the L2 pEP. When pEP's PHYSICAL_ENTITY is either complex or basic physicalEntity, null will be the result.
[ "/", "*", "Create", "L3", "simple", "PE", "type", "using", "the", "L2", "pEP", "." ]
train
https://github.com/BioPAX/Paxtools/blob/2f93afa94426bf8b5afc2e0e61cd4b269a83288d/paxtools-core/src/main/java/org/biopax/paxtools/converter/LevelUpgrader.java#L250-L253
aws/aws-cloudtrail-processing-library
src/main/java/com/amazonaws/services/cloudtrail/processinglibrary/serializer/AbstractEventSerializer.java
AbstractEventSerializer.parseResources
private void parseResources(CloudTrailEventData eventData) throws IOException { """ Parses a list of Resource. @param eventData the resources belong to @throws IOException """ JsonToken nextToken = jsonParser.nextToken(); if (nextToken == JsonToken.VALUE_NULL) { eventData.add(Cl...
java
private void parseResources(CloudTrailEventData eventData) throws IOException { JsonToken nextToken = jsonParser.nextToken(); if (nextToken == JsonToken.VALUE_NULL) { eventData.add(CloudTrailEventField.resources.name(), null); return; } if (nextToken != JsonToken...
[ "private", "void", "parseResources", "(", "CloudTrailEventData", "eventData", ")", "throws", "IOException", "{", "JsonToken", "nextToken", "=", "jsonParser", ".", "nextToken", "(", ")", ";", "if", "(", "nextToken", "==", "JsonToken", ".", "VALUE_NULL", ")", "{",...
Parses a list of Resource. @param eventData the resources belong to @throws IOException
[ "Parses", "a", "list", "of", "Resource", "." ]
train
https://github.com/aws/aws-cloudtrail-processing-library/blob/411315808d8d3dc6b45e4182212e3e04d82e3782/src/main/java/com/amazonaws/services/cloudtrail/processinglibrary/serializer/AbstractEventSerializer.java#L419-L437
google/error-prone-javac
src/jdk.javadoc/share/classes/com/sun/tools/doclets/internal/toolkit/AbstractDoclet.java
AbstractDoclet.generateClassFiles
protected void generateClassFiles(RootDoc root, ClassTree classtree) { """ Iterate through all classes and construct documentation for them. @param root the RootDoc of source to document. @param classtree the data structure representing the class tree. """ generateClassFiles(classtree); ...
java
protected void generateClassFiles(RootDoc root, ClassTree classtree) { generateClassFiles(classtree); PackageDoc[] packages = root.specifiedPackages(); for (PackageDoc pkg : packages) { generateClassFiles(pkg.allClasses(), classtree); } }
[ "protected", "void", "generateClassFiles", "(", "RootDoc", "root", ",", "ClassTree", "classtree", ")", "{", "generateClassFiles", "(", "classtree", ")", ";", "PackageDoc", "[", "]", "packages", "=", "root", ".", "specifiedPackages", "(", ")", ";", "for", "(", ...
Iterate through all classes and construct documentation for them. @param root the RootDoc of source to document. @param classtree the data structure representing the class tree.
[ "Iterate", "through", "all", "classes", "and", "construct", "documentation", "for", "them", "." ]
train
https://github.com/google/error-prone-javac/blob/a53d069bbdb2c60232ed3811c19b65e41c3e60e0/src/jdk.javadoc/share/classes/com/sun/tools/doclets/internal/toolkit/AbstractDoclet.java#L190-L196
spring-projects/spring-android
spring-android-core/src/main/java/org/springframework/core/io/UrlResource.java
UrlResource.createRelative
@Override public Resource createRelative(String relativePath) throws MalformedURLException { """ This implementation creates a UrlResource, applying the given path relative to the path of the underlying URL of this resource descriptor. @see java.net.URL#URL(java.net.URL, String) """ if (relativePath.start...
java
@Override public Resource createRelative(String relativePath) throws MalformedURLException { if (relativePath.startsWith("/")) { relativePath = relativePath.substring(1); } return new UrlResource(new URL(this.url, relativePath)); }
[ "@", "Override", "public", "Resource", "createRelative", "(", "String", "relativePath", ")", "throws", "MalformedURLException", "{", "if", "(", "relativePath", ".", "startsWith", "(", "\"/\"", ")", ")", "{", "relativePath", "=", "relativePath", ".", "substring", ...
This implementation creates a UrlResource, applying the given path relative to the path of the underlying URL of this resource descriptor. @see java.net.URL#URL(java.net.URL, String)
[ "This", "implementation", "creates", "a", "UrlResource", "applying", "the", "given", "path", "relative", "to", "the", "path", "of", "the", "underlying", "URL", "of", "this", "resource", "descriptor", "." ]
train
https://github.com/spring-projects/spring-android/blob/941296e152d49a40e0745a3e81628a974f72b7e4/spring-android-core/src/main/java/org/springframework/core/io/UrlResource.java#L220-L226
ehcache/ehcache3
core/src/main/java/org/ehcache/core/spi/service/ServiceUtils.java
ServiceUtils.findOptionalAmongst
public static <T> Optional<T> findOptionalAmongst(Class<T> clazz, Collection<?> instances) { """ Find the only expected instance of {@code clazz} among the {@code instances}. @param clazz searched class @param instances instances looked at @param <T> type of the searched instance @return the optionally found...
java
public static <T> Optional<T> findOptionalAmongst(Class<T> clazz, Collection<?> instances) { return findStreamAmongst(clazz, instances) .reduce((i1, i2) -> { throw new IllegalArgumentException("More than one " + clazz.getName() + " found"); }); }
[ "public", "static", "<", "T", ">", "Optional", "<", "T", ">", "findOptionalAmongst", "(", "Class", "<", "T", ">", "clazz", ",", "Collection", "<", "?", ">", "instances", ")", "{", "return", "findStreamAmongst", "(", "clazz", ",", "instances", ")", ".", ...
Find the only expected instance of {@code clazz} among the {@code instances}. @param clazz searched class @param instances instances looked at @param <T> type of the searched instance @return the optionally found compatible instance @throws IllegalArgumentException if more than one matching instance
[ "Find", "the", "only", "expected", "instance", "of", "{", "@code", "clazz", "}", "among", "the", "{", "@code", "instances", "}", "." ]
train
https://github.com/ehcache/ehcache3/blob/3cceda57185e522f8d241ddb75146d67ee2af898/core/src/main/java/org/ehcache/core/spi/service/ServiceUtils.java#L89-L94
btrplace/scheduler
btrpsl/src/main/java/org/btrplace/btrpsl/Script.java
Script.canImport
public boolean canImport(String label, String namespace) { """ Indicates whether a namespace can import an exported variable or not. To be imported, the label must point to an exported variable, with no import restrictions or with a given namespace compatible with the restrictions. @param label the label ...
java
public boolean canImport(String label, String namespace) { if (!exported.containsKey(label)) { return false; } Set<String> scopes = exportScopes.get(label); for (String scope : scopes) { if (scope.equals(namespace)) { return true; } els...
[ "public", "boolean", "canImport", "(", "String", "label", ",", "String", "namespace", ")", "{", "if", "(", "!", "exported", ".", "containsKey", "(", "label", ")", ")", "{", "return", "false", ";", "}", "Set", "<", "String", ">", "scopes", "=", "exportS...
Indicates whether a namespace can import an exported variable or not. To be imported, the label must point to an exported variable, with no import restrictions or with a given namespace compatible with the restrictions. @param label the label to import @param namespace the namespace of the script asking for the va...
[ "Indicates", "whether", "a", "namespace", "can", "import", "an", "exported", "variable", "or", "not", ".", "To", "be", "imported", "the", "label", "must", "point", "to", "an", "exported", "variable", "with", "no", "import", "restrictions", "or", "with", "a",...
train
https://github.com/btrplace/scheduler/blob/611063aad0b47a016e57ebf36fa4dfdf24de09e8/btrpsl/src/main/java/org/btrplace/btrpsl/Script.java#L252-L265
crnk-project/crnk-framework
crnk-core/src/main/java/io/crnk/core/engine/internal/utils/PropertyUtils.java
PropertyUtils.setProperty
public static void setProperty(Object bean, String field, Object value) { """ Set bean's property value. The sequence of searches for setting a value is as follows: <ol> <li>All class fields are found using {@link ClassUtils#getClassFields(Class)}</li> <li>Search for a field with the name of the desired one is ...
java
public static void setProperty(Object bean, String field, Object value) { INSTANCE.checkParameters(bean, field); try { INSTANCE.setPropertyValue(bean, field, value); } catch (NoSuchMethodException | IllegalAccessException | InvocationTargetException e) { throw handleReflectionException(bean.getClass(), fie...
[ "public", "static", "void", "setProperty", "(", "Object", "bean", ",", "String", "field", ",", "Object", "value", ")", "{", "INSTANCE", ".", "checkParameters", "(", "bean", ",", "field", ")", ";", "try", "{", "INSTANCE", ".", "setPropertyValue", "(", "bean...
Set bean's property value. The sequence of searches for setting a value is as follows: <ol> <li>All class fields are found using {@link ClassUtils#getClassFields(Class)}</li> <li>Search for a field with the name of the desired one is made</li> <li>If a field is found and it's a non-public field, the value is assigned u...
[ "Set", "bean", "s", "property", "value", ".", "The", "sequence", "of", "searches", "for", "setting", "a", "value", "is", "as", "follows", ":", "<ol", ">", "<li", ">", "All", "class", "fields", "are", "found", "using", "{", "@link", "ClassUtils#getClassFiel...
train
https://github.com/crnk-project/crnk-framework/blob/2fd3ef9a991788d46fd2e83b43c8ea37cbaf8681/crnk-core/src/main/java/io/crnk/core/engine/internal/utils/PropertyUtils.java#L152-L160
Berico-Technologies/CLAVIN
src/main/java/com/bericotech/clavin/GeoParserFactory.java
GeoParserFactory.getDefault
public static GeoParser getDefault(String pathToLuceneIndex, int maxHitDepth, int maxContentWindow, boolean fuzzy) throws ClavinException { """ Get a GeoParser with defined values for maxHitDepth and maxContentWindow, and fuzzy matching explicitly turned on or off. @param pathToLuceneIndex ...
java
public static GeoParser getDefault(String pathToLuceneIndex, int maxHitDepth, int maxContentWindow, boolean fuzzy) throws ClavinException { try { // instantiate default LocationExtractor LocationExtractor extractor = new ApacheExtractor(); return getDefaul...
[ "public", "static", "GeoParser", "getDefault", "(", "String", "pathToLuceneIndex", ",", "int", "maxHitDepth", ",", "int", "maxContentWindow", ",", "boolean", "fuzzy", ")", "throws", "ClavinException", "{", "try", "{", "// instantiate default LocationExtractor", "Locatio...
Get a GeoParser with defined values for maxHitDepth and maxContentWindow, and fuzzy matching explicitly turned on or off. @param pathToLuceneIndex Path to the local Lucene index. @param maxHitDepth Number of candidate matches to consider @param maxContentWindow How much context to consider when reso...
[ "Get", "a", "GeoParser", "with", "defined", "values", "for", "maxHitDepth", "and", "maxContentWindow", "and", "fuzzy", "matching", "explicitly", "turned", "on", "or", "off", "." ]
train
https://github.com/Berico-Technologies/CLAVIN/blob/f73c741f33a01b91aa5b06e71860bc354ef3010d/src/main/java/com/bericotech/clavin/GeoParserFactory.java#L94-L103
BorderTech/wcomponents
wcomponents-core/src/main/java/com/github/bordertech/wcomponents/AbstractInput.java
AbstractInput.doHandleChanged
protected void doHandleChanged() { """ Perform change logic for this component. <p>Reset focus ONLY if the current Request is an Ajax request. See https://github.com/BorderTech/wcomponents/issues/501.</p> """ // If there is an associated action, execute it if (getActionOnChange() != null) { final Actio...
java
protected void doHandleChanged() { // If there is an associated action, execute it if (getActionOnChange() != null) { final ActionEvent event = new ActionEvent(this, getActionCommand(), getActionObject()); final boolean isCAT = isCurrentAjaxTrigger(); Runnable later = new Runnable() { @Override pub...
[ "protected", "void", "doHandleChanged", "(", ")", "{", "// If there is an associated action, execute it", "if", "(", "getActionOnChange", "(", ")", "!=", "null", ")", "{", "final", "ActionEvent", "event", "=", "new", "ActionEvent", "(", "this", ",", "getActionComman...
Perform change logic for this component. <p>Reset focus ONLY if the current Request is an Ajax request. See https://github.com/BorderTech/wcomponents/issues/501.</p>
[ "Perform", "change", "logic", "for", "this", "component", ".", "<p", ">", "Reset", "focus", "ONLY", "if", "the", "current", "Request", "is", "an", "Ajax", "request", ".", "See", "https", ":", "//", "github", ".", "com", "/", "BorderTech", "/", "wcomponen...
train
https://github.com/BorderTech/wcomponents/blob/d1a2b2243270067db030feb36ca74255aaa94436/wcomponents-core/src/main/java/com/github/bordertech/wcomponents/AbstractInput.java#L301-L320
googleapis/google-cloud-java
google-cloud-clients/google-cloud-core/src/main/java/com/google/cloud/RetryOption.java
RetryOption.mergeToSettings
public static RetrySettings mergeToSettings(RetrySettings settings, RetryOption... options) { """ Creates a new {@code RetrySettings} instance, merging provided settings and multiple {@code RetryOptions}, each of which represents a single property in {@code RetrySettings}. It is an alternative way of initializin...
java
public static RetrySettings mergeToSettings(RetrySettings settings, RetryOption... options) { if (options.length <= 0) { return settings; } RetrySettings.Builder builder = settings.toBuilder(); for (RetryOption option : options) { switch (option.type) { case TOTAL_TIMEOUT: ...
[ "public", "static", "RetrySettings", "mergeToSettings", "(", "RetrySettings", "settings", ",", "RetryOption", "...", "options", ")", "{", "if", "(", "options", ".", "length", "<=", "0", ")", "{", "return", "settings", ";", "}", "RetrySettings", ".", "Builder",...
Creates a new {@code RetrySettings} instance, merging provided settings and multiple {@code RetryOptions}, each of which represents a single property in {@code RetrySettings}. It is an alternative way of initializing {@link RetrySettings} instances. @param settings retry settings @param options zero or more Retry @ret...
[ "Creates", "a", "new", "{", "@code", "RetrySettings", "}", "instance", "merging", "provided", "settings", "and", "multiple", "{", "@code", "RetryOptions", "}", "each", "of", "which", "represents", "a", "single", "property", "in", "{", "@code", "RetrySettings", ...
train
https://github.com/googleapis/google-cloud-java/blob/d2f0bc64a53049040fe9c9d338b12fab3dd1ad6a/google-cloud-clients/google-cloud-core/src/main/java/com/google/cloud/RetryOption.java#L119-L149
headius/invokebinder
src/main/java/com/headius/invokebinder/Signature.java
Signature.argType
public Signature argType(int index, Class<?> type) { """ Set the argument type at the given index. @param index the index at which to set the argument type @param type the type to set @return a new signature with the given type at the given index """ return new Signature(type().changeParameterType...
java
public Signature argType(int index, Class<?> type) { return new Signature(type().changeParameterType(index, type), argNames()); }
[ "public", "Signature", "argType", "(", "int", "index", ",", "Class", "<", "?", ">", "type", ")", "{", "return", "new", "Signature", "(", "type", "(", ")", ".", "changeParameterType", "(", "index", ",", "type", ")", ",", "argNames", "(", ")", ")", ";"...
Set the argument type at the given index. @param index the index at which to set the argument type @param type the type to set @return a new signature with the given type at the given index
[ "Set", "the", "argument", "type", "at", "the", "given", "index", "." ]
train
https://github.com/headius/invokebinder/blob/ce6bfeb8e33265480daa7b797989dd915d51238d/src/main/java/com/headius/invokebinder/Signature.java#L653-L655
Red5/red5-server-common
src/main/java/org/red5/server/net/rtmp/status/StatusObjectService.java
StatusObjectService.serializeStatusObject
public void serializeStatusObject(IoBuffer out, StatusObject statusObject) { """ Serializes status object @param out Byte buffer for output object @param statusObject Status object to serialize """ Map<?, ?> statusMap = new BeanMap(statusObject); Output output = new Output(out); ...
java
public void serializeStatusObject(IoBuffer out, StatusObject statusObject) { Map<?, ?> statusMap = new BeanMap(statusObject); Output output = new Output(out); Serializer.serialize(output, statusMap); }
[ "public", "void", "serializeStatusObject", "(", "IoBuffer", "out", ",", "StatusObject", "statusObject", ")", "{", "Map", "<", "?", ",", "?", ">", "statusMap", "=", "new", "BeanMap", "(", "statusObject", ")", ";", "Output", "output", "=", "new", "Output", "...
Serializes status object @param out Byte buffer for output object @param statusObject Status object to serialize
[ "Serializes", "status", "object" ]
train
https://github.com/Red5/red5-server-common/blob/39ae73710c25bda86d70b13ef37ae707962217b9/src/main/java/org/red5/server/net/rtmp/status/StatusObjectService.java#L158-L162
TheHortonMachine/hortonmachine
gears/src/main/java/org/hortonmachine/gears/io/dxfdwg/libs/dwg/DwgUtil.java
DwgUtil.getBitShort
public static Vector getBitShort(int[] data, int offset) throws Exception { """ Read a short value from a group of unsigned bytes @param data Array of unsigned bytes obtained from the DWG binary file @param offset The current bit offset where the value begins @throws Exception If an unexpected bit value is fo...
java
public static Vector getBitShort(int[] data, int offset) throws Exception { Vector v = new Vector(); int type = ((Integer)getBits(data, 2, offset)).intValue(); int read = 2; int val = 0; if (type==0x00) { byte[] bytes = (byte[])getBits(data, 16, (offset+2)); ByteBuffer bb = ByteBuffer.wrap(bytes); bb...
[ "public", "static", "Vector", "getBitShort", "(", "int", "[", "]", "data", ",", "int", "offset", ")", "throws", "Exception", "{", "Vector", "v", "=", "new", "Vector", "(", ")", ";", "int", "type", "=", "(", "(", "Integer", ")", "getBits", "(", "data"...
Read a short value from a group of unsigned bytes @param data Array of unsigned bytes obtained from the DWG binary file @param offset The current bit offset where the value begins @throws Exception If an unexpected bit value is found in the DWG file. Occurs when we are looking for LwPolylines. @return Vector This vect...
[ "Read", "a", "short", "value", "from", "a", "group", "of", "unsigned", "bytes" ]
train
https://github.com/TheHortonMachine/hortonmachine/blob/d2b436bbdf951dc1fda56096a42dbc0eae4d35a5/gears/src/main/java/org/hortonmachine/gears/io/dxfdwg/libs/dwg/DwgUtil.java#L302-L324
hankcs/HanLP
src/main/java/com/hankcs/hanlp/HanLP.java
HanLP.getSummary
public static String getSummary(String document, int max_length, String sentence_separator) { """ 自动摘要 @param document 目标文档 @param max_length 需要摘要的长度 @param sentence_separator 分割目标文档时的句子分割符,正则格式, 如:[。??!!;;] @return 摘要文本 """ // Parameter size in this method refers to the string ...
java
public static String getSummary(String document, int max_length, String sentence_separator) { // Parameter size in this method refers to the string length of the summary required; // The actual length of the summary generated may be short than the required length, but never longer; return Te...
[ "public", "static", "String", "getSummary", "(", "String", "document", ",", "int", "max_length", ",", "String", "sentence_separator", ")", "{", "// Parameter size in this method refers to the string length of the summary required;", "// The actual length of the summary generated may ...
自动摘要 @param document 目标文档 @param max_length 需要摘要的长度 @param sentence_separator 分割目标文档时的句子分割符,正则格式, 如:[。??!!;;] @return 摘要文本
[ "自动摘要" ]
train
https://github.com/hankcs/HanLP/blob/a538d0722ab2e4980a9dcd9ea40324fc3ddba7ce/src/main/java/com/hankcs/hanlp/HanLP.java#L856-L861
Arnauld/org.technbolts.junit
src/main/java/org/technbolts/junit/runners/FrameworkMethodRunner.java
FrameworkMethodRunner.withPotentialTimeout
@Deprecated protected Statement withPotentialTimeout(FrameworkMethod method, Object test, Statement next) { """ Returns a {@link Statement}: if {@code method}'s {@code @Test} annotation has the {@code timeout} attribute, throw an exception if {@code next} takes mo...
java
@Deprecated protected Statement withPotentialTimeout(FrameworkMethod method, Object test, Statement next) { long timeout = getTimeout(method.getAnnotation(Test.class)); return timeout > 0 ? new FailOnTimeout(next, timeout) : next; }
[ "@", "Deprecated", "protected", "Statement", "withPotentialTimeout", "(", "FrameworkMethod", "method", ",", "Object", "test", ",", "Statement", "next", ")", "{", "long", "timeout", "=", "getTimeout", "(", "method", ".", "getAnnotation", "(", "Test", ".", "class"...
Returns a {@link Statement}: if {@code method}'s {@code @Test} annotation has the {@code timeout} attribute, throw an exception if {@code next} takes more than the specified number of milliseconds. @deprecated Will be private soon: use Rules instead
[ "Returns", "a", "{", "@link", "Statement", "}", ":", "if", "{", "@code", "method", "}", "s", "{", "@code", "@Test", "}", "annotation", "has", "the", "{", "@code", "timeout", "}", "attribute", "throw", "an", "exception", "if", "{", "@code", "next", "}",...
train
https://github.com/Arnauld/org.technbolts.junit/blob/90fb8032bbbcaf25f266693a4bdd3bde8dcc37a9/src/main/java/org/technbolts/junit/runners/FrameworkMethodRunner.java#L189-L194
RobotiumTech/robotium
robotium-solo/src/main/java/com/robotium/solo/Solo.java
Solo.scrollViewToSide
public void scrollViewToSide(View view, int side, float scrollPosition) { """ Scrolls a View horizontally. @param view the View to scroll @param side the side to scroll; {@link #RIGHT} or {@link #LEFT} @param scrollPosition the position to scroll to, from 0 to 1 where 1 is all the way. Example is: 0.60 ""...
java
public void scrollViewToSide(View view, int side, float scrollPosition) { if(config.commandLogging){ Log.d(config.commandLoggingTag, "scrollViewToSide("+view+", "+side+", "+scrollPosition+")"); } scrollViewToSide(view, side, scrollPosition, 20); }
[ "public", "void", "scrollViewToSide", "(", "View", "view", ",", "int", "side", ",", "float", "scrollPosition", ")", "{", "if", "(", "config", ".", "commandLogging", ")", "{", "Log", ".", "d", "(", "config", ".", "commandLoggingTag", ",", "\"scrollViewToSide(...
Scrolls a View horizontally. @param view the View to scroll @param side the side to scroll; {@link #RIGHT} or {@link #LEFT} @param scrollPosition the position to scroll to, from 0 to 1 where 1 is all the way. Example is: 0.60
[ "Scrolls", "a", "View", "horizontally", "." ]
train
https://github.com/RobotiumTech/robotium/blob/75e567c38f26a6a87dc8bef90b3886a20e28d291/robotium-solo/src/main/java/com/robotium/solo/Solo.java#L2377-L2383
HolmesNL/kafka-spout
src/main/java/nl/minvenj/nfi/storm/kafka/util/ConfigUtils.java
ConfigUtils.configFromResource
public static Properties configFromResource(final String resource) { """ Reads configuration from a classpath resource stream obtained from the current thread's class loader through {@link ClassLoader#getSystemResourceAsStream(String)}. @param resource The resource to be read. @return A {@link java.util.Prope...
java
public static Properties configFromResource(final String resource) { InputStream input = Thread.currentThread().getContextClassLoader().getResourceAsStream(resource); if (input == null) { // non-existent resource will *not* throw an exception, do this anyway throw new IllegalArgu...
[ "public", "static", "Properties", "configFromResource", "(", "final", "String", "resource", ")", "{", "InputStream", "input", "=", "Thread", ".", "currentThread", "(", ")", ".", "getContextClassLoader", "(", ")", ".", "getResourceAsStream", "(", "resource", ")", ...
Reads configuration from a classpath resource stream obtained from the current thread's class loader through {@link ClassLoader#getSystemResourceAsStream(String)}. @param resource The resource to be read. @return A {@link java.util.Properties} object read from the specified resource. @throws IllegalArgumentException W...
[ "Reads", "configuration", "from", "a", "classpath", "resource", "stream", "obtained", "from", "the", "current", "thread", "s", "class", "loader", "through", "{", "@link", "ClassLoader#getSystemResourceAsStream", "(", "String", ")", "}", "." ]
train
https://github.com/HolmesNL/kafka-spout/blob/bef626b9fab6946a7e0d3c85979ec36ae0870233/src/main/java/nl/minvenj/nfi/storm/kafka/util/ConfigUtils.java#L95-L110