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
bwkimmel/jdcp
jdcp-console/src/main/java/ca/eandb/jdcp/client/ScriptFacade.java
ScriptFacade.submitJob
public UUID submitJob(ParallelizableJob job, String description) throws Exception { """ Submits a job to be processed. @param job The <code>ParallelizableJob</code> to submit. @param description A description of the job. @return The <code>UUID</code> identifying the submitted job. @throws Exception if an error...
java
public UUID submitJob(ParallelizableJob job, String description) throws Exception { return config.getJobService().submitJob( new Serialized<ParallelizableJob>(job), description); }
[ "public", "UUID", "submitJob", "(", "ParallelizableJob", "job", ",", "String", "description", ")", "throws", "Exception", "{", "return", "config", ".", "getJobService", "(", ")", ".", "submitJob", "(", "new", "Serialized", "<", "ParallelizableJob", ">", "(", "...
Submits a job to be processed. @param job The <code>ParallelizableJob</code> to submit. @param description A description of the job. @return The <code>UUID</code> identifying the submitted job. @throws Exception if an error occurs in delegating the request to the configured job service
[ "Submits", "a", "job", "to", "be", "processed", "." ]
train
https://github.com/bwkimmel/jdcp/blob/630c5150c245054e2556ff370f4bad2ec793dfb7/jdcp-console/src/main/java/ca/eandb/jdcp/client/ScriptFacade.java#L115-L118
sarl/sarl
main/coreplugins/io.sarl.lang/src/io/sarl/lang/typesystem/SARLOperationHelper.java
SARLOperationHelper._hasSideEffects
protected Boolean _hasSideEffects(XIfExpression expression, ISideEffectContext context) { """ Test if the given expression has side effects. @param expression the expression. @param context the list of context expressions. @return {@code true} if the expression has side effects. """ if (hasSideEffects(e...
java
protected Boolean _hasSideEffects(XIfExpression expression, ISideEffectContext context) { if (hasSideEffects(expression.getIf(), context)) { return true; } final Map<String, List<XExpression>> buffer1 = context.createVariableAssignmentBufferForBranch(); if (hasSideEffects(expression.getThen(), context.branch...
[ "protected", "Boolean", "_hasSideEffects", "(", "XIfExpression", "expression", ",", "ISideEffectContext", "context", ")", "{", "if", "(", "hasSideEffects", "(", "expression", ".", "getIf", "(", ")", ",", "context", ")", ")", "{", "return", "true", ";", "}", ...
Test if the given expression has side effects. @param expression the expression. @param context the list of context expressions. @return {@code true} if the expression has side effects.
[ "Test", "if", "the", "given", "expression", "has", "side", "effects", "." ]
train
https://github.com/sarl/sarl/blob/ca00ff994598c730339972def4e19a60e0b8cace/main/coreplugins/io.sarl.lang/src/io/sarl/lang/typesystem/SARLOperationHelper.java#L317-L331
MariaDB/mariadb-connector-j
src/main/java/org/mariadb/jdbc/internal/com/read/resultset/rowprotocol/TextRowProtocol.java
TextRowProtocol.getInternalFloat
public float getInternalFloat(ColumnInformation columnInfo) throws SQLException { """ Get float from raw text format. @param columnInfo column information @return float value @throws SQLException if column type doesn't permit conversion or not in Float range """ if (lastValueWasNull()) { return ...
java
public float getInternalFloat(ColumnInformation columnInfo) throws SQLException { if (lastValueWasNull()) { return 0; } switch (columnInfo.getColumnType()) { case BIT: return parseBit(); case TINYINT: case SMALLINT: case YEAR: case INTEGER: case MEDIUMINT: ...
[ "public", "float", "getInternalFloat", "(", "ColumnInformation", "columnInfo", ")", "throws", "SQLException", "{", "if", "(", "lastValueWasNull", "(", ")", ")", "{", "return", "0", ";", "}", "switch", "(", "columnInfo", ".", "getColumnType", "(", ")", ")", "...
Get float from raw text format. @param columnInfo column information @return float value @throws SQLException if column type doesn't permit conversion or not in Float range
[ "Get", "float", "from", "raw", "text", "format", "." ]
train
https://github.com/MariaDB/mariadb-connector-j/blob/d148c7cd347c4680617be65d9e511b289d38a30b/src/main/java/org/mariadb/jdbc/internal/com/read/resultset/rowprotocol/TextRowProtocol.java#L350-L387
cverges/expect4j
src/main/java/expect4j/Expect4j.java
Expect4j.expect
public int expect(String pattern, Closure handler) throws MalformedPatternException, Exception { """ Attempts to detect the provided pattern and executes the provided {@link Closure} if it is detected. @param pattern the pattern to find in the reader stream @param handler the handler to execute if the pattern i...
java
public int expect(String pattern, Closure handler) throws MalformedPatternException, Exception { logger.trace("Searching for '" + pattern + "' in the reader stream and executing Closure " + handler + " if found"); PatternPair match = new GlobMatch(pattern, handler); List<Match> list = new ArrayL...
[ "public", "int", "expect", "(", "String", "pattern", ",", "Closure", "handler", ")", "throws", "MalformedPatternException", ",", "Exception", "{", "logger", ".", "trace", "(", "\"Searching for '\"", "+", "pattern", "+", "\"' in the reader stream and executing Closure \"...
Attempts to detect the provided pattern and executes the provided {@link Closure} if it is detected. @param pattern the pattern to find in the reader stream @param handler the handler to execute if the pattern is found @return the number of times the pattern is found, or an error code @throws MalformedPatternException ...
[ "Attempts", "to", "detect", "the", "provided", "pattern", "and", "executes", "the", "provided", "{" ]
train
https://github.com/cverges/expect4j/blob/97b1da9b7bd231344cd7b7ce26d14caf8bb16cd6/src/main/java/expect4j/Expect4j.java#L277-L283
groupon/odo
proxylib/src/main/java/com/groupon/odo/proxylib/HistoryService.java
HistoryService.clearHistory
public void clearHistory(int profileId, String clientUUID) { """ Clear history for a client @param profileId ID of profile @param clientUUID UUID of client """ PreparedStatement query = null; try (Connection sqlConnection = sqlService.getConnection()) { String sqlQuery = "DELET...
java
public void clearHistory(int profileId, String clientUUID) { PreparedStatement query = null; try (Connection sqlConnection = sqlService.getConnection()) { String sqlQuery = "DELETE FROM " + Constants.DB_TABLE_HISTORY + " "; // see if profileId is null or not (-1) if...
[ "public", "void", "clearHistory", "(", "int", "profileId", ",", "String", "clientUUID", ")", "{", "PreparedStatement", "query", "=", "null", ";", "try", "(", "Connection", "sqlConnection", "=", "sqlService", ".", "getConnection", "(", ")", ")", "{", "String", ...
Clear history for a client @param profileId ID of profile @param clientUUID UUID of client
[ "Clear", "history", "for", "a", "client" ]
train
https://github.com/groupon/odo/blob/3bae43d5eca8ace036775e5b2d3ed9af1a9ff9b1/proxylib/src/main/java/com/groupon/odo/proxylib/HistoryService.java#L518-L548
biojava/biojava
biojava-structure/src/main/java/org/biojava/nbio/structure/align/multiple/util/MultipleAlignmentScorer.java
MultipleAlignmentScorer.getAvgTMScore
public static double getAvgTMScore(MultipleAlignment alignment) throws StructureException { """ Calculates the average TMScore of all the possible pairwise structure comparisons of the given alignment. <p> Complexity: T(n,l) = O(l*n^2), if n=number of structures and l=alignment length. @param alignment ...
java
public static double getAvgTMScore(MultipleAlignment alignment) throws StructureException { List<Atom[]> trans = MultipleAlignmentTools.transformAtoms(alignment); List<Integer> lengths = new ArrayList<Integer>(alignment.size()); for (Atom[] atoms : alignment.getAtomArrays()) { lengths.add(atoms.length); ...
[ "public", "static", "double", "getAvgTMScore", "(", "MultipleAlignment", "alignment", ")", "throws", "StructureException", "{", "List", "<", "Atom", "[", "]", ">", "trans", "=", "MultipleAlignmentTools", ".", "transformAtoms", "(", "alignment", ")", ";", "List", ...
Calculates the average TMScore of all the possible pairwise structure comparisons of the given alignment. <p> Complexity: T(n,l) = O(l*n^2), if n=number of structures and l=alignment length. @param alignment @return double Average TMscore @throws StructureException
[ "Calculates", "the", "average", "TMScore", "of", "all", "the", "possible", "pairwise", "structure", "comparisons", "of", "the", "given", "alignment", ".", "<p", ">", "Complexity", ":", "T", "(", "n", "l", ")", "=", "O", "(", "l", "*", "n^2", ")", "if",...
train
https://github.com/biojava/biojava/blob/a1c71a8e3d40cc32104b1d387a3d3b560b43356e/biojava-structure/src/main/java/org/biojava/nbio/structure/align/multiple/util/MultipleAlignmentScorer.java#L235-L245
CODAIT/stocator
src/main/java/com/ibm/stocator/fs/cos/COSUtils.java
COSUtils.extractException
public static IOException extractException(String operation, String path, ExecutionException ee) { """ Extract an exception from a failed future, and convert to an IOE. @param operation operation which failed @param path path operated on (may be null) @param ee execution exception @return an IOE which ...
java
public static IOException extractException(String operation, String path, ExecutionException ee) { IOException ioe; Throwable cause = ee.getCause(); if (cause instanceof AmazonClientException) { ioe = translateException(operation, path, (AmazonClientException) cause); } else if (cause instan...
[ "public", "static", "IOException", "extractException", "(", "String", "operation", ",", "String", "path", ",", "ExecutionException", "ee", ")", "{", "IOException", "ioe", ";", "Throwable", "cause", "=", "ee", ".", "getCause", "(", ")", ";", "if", "(", "cause...
Extract an exception from a failed future, and convert to an IOE. @param operation operation which failed @param path path operated on (may be null) @param ee execution exception @return an IOE which can be thrown
[ "Extract", "an", "exception", "from", "a", "failed", "future", "and", "convert", "to", "an", "IOE", "." ]
train
https://github.com/CODAIT/stocator/blob/35969cadd2e8faa6fdac45e8bec1799fdd3d8299/src/main/java/com/ibm/stocator/fs/cos/COSUtils.java#L164-L176
alkacon/opencms-core
src/org/opencms/workplace/tools/CmsToolManager.java
CmsToolManager.linkForToolPath
public static String linkForToolPath(CmsJspActionElement jsp, String toolPath, Map<String, String[]> params) { """ Returns the OpenCms link for the given tool path which requires parameters.<p> Please note: Don't overuse the parameter map because this will likely introduce issues with encoding. If possible, do...
java
public static String linkForToolPath(CmsJspActionElement jsp, String toolPath, Map<String, String[]> params) { if (params == null) { // no parameters - take the shortcut return linkForToolPath(jsp, toolPath); } params.put(CmsToolDialog.PARAM_PATH, new String[] {toolPath}...
[ "public", "static", "String", "linkForToolPath", "(", "CmsJspActionElement", "jsp", ",", "String", "toolPath", ",", "Map", "<", "String", ",", "String", "[", "]", ">", "params", ")", "{", "if", "(", "params", "==", "null", ")", "{", "// no parameters - take ...
Returns the OpenCms link for the given tool path which requires parameters.<p> Please note: Don't overuse the parameter map because this will likely introduce issues with encoding. If possible, don't pass parameters at all, or only very simple parameters with no special chars that can easily be parsed.<p> @param jsp ...
[ "Returns", "the", "OpenCms", "link", "for", "the", "given", "tool", "path", "which", "requires", "parameters", ".", "<p", ">" ]
train
https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/workplace/tools/CmsToolManager.java#L138-L146
lessthanoptimal/BoofCV
main/boofcv-geo/src/main/java/boofcv/alg/geo/MultiViewOps.java
MultiViewOps.extractFundamental
public static void extractFundamental( TrifocalTensor tensor , DMatrixRMaj F21 , DMatrixRMaj F31 ) { """ <p> Extract the fundamental matrices between views 1 + 2 and views 1 + 3. The returned Fundamental matrices will have the following properties: x<sub>i</sub><sup>T</sup>*Fi*x<sub>1</sub> = 0, where i is view...
java
public static void extractFundamental( TrifocalTensor tensor , DMatrixRMaj F21 , DMatrixRMaj F31 ) { TrifocalExtractGeometries e = new TrifocalExtractGeometries(); e.setTensor(tensor); e.extractFundmental(F21,F31); }
[ "public", "static", "void", "extractFundamental", "(", "TrifocalTensor", "tensor", ",", "DMatrixRMaj", "F21", ",", "DMatrixRMaj", "F31", ")", "{", "TrifocalExtractGeometries", "e", "=", "new", "TrifocalExtractGeometries", "(", ")", ";", "e", ".", "setTensor", "(",...
<p> Extract the fundamental matrices between views 1 + 2 and views 1 + 3. The returned Fundamental matrices will have the following properties: x<sub>i</sub><sup>T</sup>*Fi*x<sub>1</sub> = 0, where i is view 2 or 3. </p> <p> NOTE: The first camera is assumed to have the camera matrix of P1 = [I|0]. Thus observations...
[ "<p", ">", "Extract", "the", "fundamental", "matrices", "between", "views", "1", "+", "2", "and", "views", "1", "+", "3", ".", "The", "returned", "Fundamental", "matrices", "will", "have", "the", "following", "properties", ":", "x<sub", ">", "i<", "/", "...
train
https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-geo/src/main/java/boofcv/alg/geo/MultiViewOps.java#L626-L630
eFaps/eFaps-Kernel
src/main/java/org/efaps/jaas/SetPasswordHandler.java
SetPasswordHandler.setPassword
public boolean setPassword(final String _name, final String _newpasswd, final String _oldpasswd) throws LoginException { """ Set the password. @param _name Username @param _newpasswd new passowrd @param _oldpasswd old passowrd ...
java
public boolean setPassword(final String _name, final String _newpasswd, final String _oldpasswd) throws LoginException { boolean ret = false; final LoginContext login = new LoginContext( this.application, ...
[ "public", "boolean", "setPassword", "(", "final", "String", "_name", ",", "final", "String", "_newpasswd", ",", "final", "String", "_oldpasswd", ")", "throws", "LoginException", "{", "boolean", "ret", "=", "false", ";", "final", "LoginContext", "login", "=", "...
Set the password. @param _name Username @param _newpasswd new passowrd @param _oldpasswd old passowrd @return true if successful @throws LoginException on error
[ "Set", "the", "password", "." ]
train
https://github.com/eFaps/eFaps-Kernel/blob/04b96548f518c2386a93f5ec2b9349f9b9063859/src/main/java/org/efaps/jaas/SetPasswordHandler.java#L78-L91
spring-projects/spring-social
spring-social-core/src/main/java/org/springframework/social/oauth1/SigningSupport.java
SigningSupport.buildAuthorizationHeaderValue
public String buildAuthorizationHeaderValue(HttpRequest request, byte[] body, OAuth1Credentials oauth1Credentials) { """ Builds an authorization header from a request. Expects that the request's query parameters are form-encoded. """ Map<String, String> oauthParameters = commonOAuthParameters(oauth1Credenti...
java
public String buildAuthorizationHeaderValue(HttpRequest request, byte[] body, OAuth1Credentials oauth1Credentials) { Map<String, String> oauthParameters = commonOAuthParameters(oauth1Credentials.getConsumerKey()); oauthParameters.put("oauth_token", oauth1Credentials.getAccessToken()); MultiValueMap<String, String...
[ "public", "String", "buildAuthorizationHeaderValue", "(", "HttpRequest", "request", ",", "byte", "[", "]", "body", ",", "OAuth1Credentials", "oauth1Credentials", ")", "{", "Map", "<", "String", ",", "String", ">", "oauthParameters", "=", "commonOAuthParameters", "("...
Builds an authorization header from a request. Expects that the request's query parameters are form-encoded.
[ "Builds", "an", "authorization", "header", "from", "a", "request", ".", "Expects", "that", "the", "request", "s", "query", "parameters", "are", "form", "-", "encoded", "." ]
train
https://github.com/spring-projects/spring-social/blob/e41cfecb288022b83c79413b58f52511c3c9d4fc/spring-social-core/src/main/java/org/springframework/social/oauth1/SigningSupport.java#L75-L80
OpenLiberty/open-liberty
dev/com.ibm.jbatch.container/src/com/ibm/jbatch/container/services/impl/JPAPersistenceManagerImpl.java
JPAPersistenceManagerImpl.updateStepExecutionOnRecovery
public StepThreadExecutionEntity updateStepExecutionOnRecovery(PersistenceServiceUnit psu, final long stepExecutionId, final BatchStatus newStepBatchStatus, ...
java
public StepThreadExecutionEntity updateStepExecutionOnRecovery(PersistenceServiceUnit psu, final long stepExecutionId, final BatchStatus newStepBatchStatus, ...
[ "public", "StepThreadExecutionEntity", "updateStepExecutionOnRecovery", "(", "PersistenceServiceUnit", "psu", ",", "final", "long", "stepExecutionId", ",", "final", "BatchStatus", "newStepBatchStatus", ",", "final", "String", "newStepExitStatus", ",", "final", "Date", "endT...
This method is called during recovery. Set the batchStatus, exitStatus, and endTime for the given stepExecution.
[ "This", "method", "is", "called", "during", "recovery", "." ]
train
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.jbatch.container/src/com/ibm/jbatch/container/services/impl/JPAPersistenceManagerImpl.java#L2134-L2166
motown-io/motown
utils/rest/src/main/java/io/motown/utils/rest/response/ResponseBuilder.java
ResponseBuilder.getNextPageOffset
private static long getNextPageOffset(final int offset, final int limit, final long total) { """ Gets the next page offset. @param offset the current offset. @param limit the limit. @param total the total. @return the next page offset. """ return hasFullNextPage(offset, limit, total) ?...
java
private static long getNextPageOffset(final int offset, final int limit, final long total) { return hasFullNextPage(offset, limit, total) ? getNextFullPageOffset(offset, limit) : getLastPageOffset(total, limit); }
[ "private", "static", "long", "getNextPageOffset", "(", "final", "int", "offset", ",", "final", "int", "limit", ",", "final", "long", "total", ")", "{", "return", "hasFullNextPage", "(", "offset", ",", "limit", ",", "total", ")", "?", "getNextFullPageOffset", ...
Gets the next page offset. @param offset the current offset. @param limit the limit. @param total the total. @return the next page offset.
[ "Gets", "the", "next", "page", "offset", "." ]
train
https://github.com/motown-io/motown/blob/783ccda7c28b273a529ddd47defe8673b1ea365b/utils/rest/src/main/java/io/motown/utils/rest/response/ResponseBuilder.java#L104-L106
google/error-prone
check_api/src/main/java/com/google/errorprone/util/Comments.java
Comments.after
private static <T> T after(T target, Iterable<? extends T> iterable, T defaultValue) { """ Find the element in the iterable following the target @param target is the element to search for @param iterable is the iterable to search @param defaultValue will be returned if there is no item following the searched ...
java
private static <T> T after(T target, Iterable<? extends T> iterable, T defaultValue) { Iterator<? extends T> iterator = iterable.iterator(); while (iterator.hasNext()) { if (iterator.next().equals(target)) { break; } } if (iterator.hasNext()) { return iterator.next(); } ...
[ "private", "static", "<", "T", ">", "T", "after", "(", "T", "target", ",", "Iterable", "<", "?", "extends", "T", ">", "iterable", ",", "T", "defaultValue", ")", "{", "Iterator", "<", "?", "extends", "T", ">", "iterator", "=", "iterable", ".", "iterat...
Find the element in the iterable following the target @param target is the element to search for @param iterable is the iterable to search @param defaultValue will be returned if there is no item following the searched for item @return the item following {@code target} or {@code defaultValue} if not found
[ "Find", "the", "element", "in", "the", "iterable", "following", "the", "target" ]
train
https://github.com/google/error-prone/blob/fe2e3cc2cf1958cb7c487bfe89852bb4c225ba9d/check_api/src/main/java/com/google/errorprone/util/Comments.java#L300-L313
Arasthel/AsyncJobLibrary
AsyncJob/src/main/java/com/arasthel/asyncjob/AsyncJob.java
AsyncJob.doInBackground
public static FutureTask doInBackground(final OnBackgroundJob onBackgroundJob, ExecutorService executor) { """ Executes the provided code immediately on a background thread that will be submitted to the provided ExecutorService @param onBackgroundJob Interface that wraps the code to execute @param executor Will...
java
public static FutureTask doInBackground(final OnBackgroundJob onBackgroundJob, ExecutorService executor) { FutureTask task = (FutureTask) executor.submit(new Runnable() { @Override public void run() { onBackgroundJob.doOnBackground(); } }); re...
[ "public", "static", "FutureTask", "doInBackground", "(", "final", "OnBackgroundJob", "onBackgroundJob", ",", "ExecutorService", "executor", ")", "{", "FutureTask", "task", "=", "(", "FutureTask", ")", "executor", ".", "submit", "(", "new", "Runnable", "(", ")", ...
Executes the provided code immediately on a background thread that will be submitted to the provided ExecutorService @param onBackgroundJob Interface that wraps the code to execute @param executor Will queue the provided code
[ "Executes", "the", "provided", "code", "immediately", "on", "a", "background", "thread", "that", "will", "be", "submitted", "to", "the", "provided", "ExecutorService" ]
train
https://github.com/Arasthel/AsyncJobLibrary/blob/64299f642724274c7805a69ee0d693ce7a0425b8/AsyncJob/src/main/java/com/arasthel/asyncjob/AsyncJob.java#L70-L79
algolia/algoliasearch-client-java
src/main/java/com/algolia/search/saas/Index.java
Index.getApiKey
public JSONObject getApiKey(String key, RequestOptions requestOptions) throws AlgoliaException { """ Get ACL of an api key @param requestOptions Options to pass to this request """ return client.getRequest("/1/indexes/" + encodedIndexName + "/keys/" + key, false, requestOptions); }
java
public JSONObject getApiKey(String key, RequestOptions requestOptions) throws AlgoliaException { return client.getRequest("/1/indexes/" + encodedIndexName + "/keys/" + key, false, requestOptions); }
[ "public", "JSONObject", "getApiKey", "(", "String", "key", ",", "RequestOptions", "requestOptions", ")", "throws", "AlgoliaException", "{", "return", "client", ".", "getRequest", "(", "\"/1/indexes/\"", "+", "encodedIndexName", "+", "\"/keys/\"", "+", "key", ",", ...
Get ACL of an api key @param requestOptions Options to pass to this request
[ "Get", "ACL", "of", "an", "api", "key" ]
train
https://github.com/algolia/algoliasearch-client-java/blob/a05da2f66c099fe6f77295c7b6a8a12c24e95f9b/src/main/java/com/algolia/search/saas/Index.java#L997-L999
powermock/powermock
powermock-api/powermock-api-easymock/src/main/java/org/powermock/api/easymock/PowerMock.java
PowerMock.createStrictPartialMock
public static synchronized <T> T createStrictPartialMock(Class<T> type, String... methodNames) { """ A utility method that may be used to strictly mock several methods in an easy way (by just passing in the method names of the method you wish to mock). Note that you cannot uniquely specify a method to mock using...
java
public static synchronized <T> T createStrictPartialMock(Class<T> type, String... methodNames) { return createStrictMock(type, Whitebox.getMethods(type, methodNames)); }
[ "public", "static", "synchronized", "<", "T", ">", "T", "createStrictPartialMock", "(", "Class", "<", "T", ">", "type", ",", "String", "...", "methodNames", ")", "{", "return", "createStrictMock", "(", "type", ",", "Whitebox", ".", "getMethods", "(", "type",...
A utility method that may be used to strictly mock several methods in an easy way (by just passing in the method names of the method you wish to mock). Note that you cannot uniquely specify a method to mock using this method if there are several methods with the same name in {@code type}. This method will mock ALL meth...
[ "A", "utility", "method", "that", "may", "be", "used", "to", "strictly", "mock", "several", "methods", "in", "an", "easy", "way", "(", "by", "just", "passing", "in", "the", "method", "names", "of", "the", "method", "you", "wish", "to", "mock", ")", "."...
train
https://github.com/powermock/powermock/blob/e8cd68026c284c6a7efe66959809eeebd8d1f9ad/powermock-api/powermock-api-easymock/src/main/java/org/powermock/api/easymock/PowerMock.java#L725-L727
CloudSlang/cs-actions
cs-json/src/main/java/io/cloudslang/content/json/actions/EditJson.java
EditJson.execute
@Action(name = "Edit Json", outputs = { """ * This operation edits a JSON object given in the form of a string using a jsonPath and returns the edited json @param jsonObject The JSON object in a form of a string @param jsonPath The JSON Path query used for editing the json object @param action ...
java
@Action(name = "Edit Json", outputs = { @Output(OutputNames.RETURN_RESULT), @Output(OutputNames.RETURN_CODE), @Output(OutputNames.EXCEPTION) }, responses = { @Response(text = ResponseNames.SUCCESS, field ...
[ "@", "Action", "(", "name", "=", "\"Edit Json\"", ",", "outputs", "=", "{", "@", "Output", "(", "OutputNames", ".", "RETURN_RESULT", ")", ",", "@", "Output", "(", "OutputNames", ".", "RETURN_CODE", ")", ",", "@", "Output", "(", "OutputNames", ".", "EXCEP...
* This operation edits a JSON object given in the form of a string using a jsonPath and returns the edited json @param jsonObject The JSON object in a form of a string @param jsonPath The JSON Path query used for editing the json object @param action The action used for editing the json. Valid values are: get, i...
[ "*", "This", "operation", "edits", "a", "JSON", "object", "given", "in", "the", "form", "of", "a", "string", "using", "a", "jsonPath", "and", "returns", "the", "edited", "json" ]
train
https://github.com/CloudSlang/cs-actions/blob/9a1be1e99ad88286a6c153d5f2275df6ae1a57a1/cs-json/src/main/java/io/cloudslang/content/json/actions/EditJson.java#L64-L111
JOML-CI/JOML
src/org/joml/Matrix4f.java
Matrix4f.orthoSymmetric
public Matrix4f orthoSymmetric(float width, float height, float zNear, float zFar) { """ Apply a symmetric orthographic projection transformation for a right-handed coordinate system using OpenGL's NDC z range of <code>[-1..+1]</code> to this matrix. <p> This method is equivalent to calling {@link #ortho(float,...
java
public Matrix4f orthoSymmetric(float width, float height, float zNear, float zFar) { return orthoSymmetric(width, height, zNear, zFar, false, thisOrNew()); }
[ "public", "Matrix4f", "orthoSymmetric", "(", "float", "width", ",", "float", "height", ",", "float", "zNear", ",", "float", "zFar", ")", "{", "return", "orthoSymmetric", "(", "width", ",", "height", ",", "zNear", ",", "zFar", ",", "false", ",", "thisOrNew"...
Apply a symmetric orthographic projection transformation for a right-handed coordinate system using OpenGL's NDC z range of <code>[-1..+1]</code> to this matrix. <p> This method is equivalent to calling {@link #ortho(float, float, float, float, float, float) ortho()} with <code>left=-width/2</code>, <code>right=+width/...
[ "Apply", "a", "symmetric", "orthographic", "projection", "transformation", "for", "a", "right", "-", "handed", "coordinate", "system", "using", "OpenGL", "s", "NDC", "z", "range", "of", "<code", ">", "[", "-", "1", "..", "+", "1", "]", "<", "/", "code", ...
train
https://github.com/JOML-CI/JOML/blob/ce2652fc236b42bda3875c591f8e6645048a678f/src/org/joml/Matrix4f.java#L7467-L7469
apache/incubator-shardingsphere
sharding-core/sharding-core-common/src/main/java/org/apache/shardingsphere/core/util/NumberUtil.java
NumberUtil.getExactlyNumber
public static Number getExactlyNumber(final String value, final int radix) { """ Get exactly number value and type. @param value string to be converted @param radix radix @return exactly number value and type """ try { return getBigInteger(value, radix); } catch (final NumberFo...
java
public static Number getExactlyNumber(final String value, final int radix) { try { return getBigInteger(value, radix); } catch (final NumberFormatException ex) { return new BigDecimal(value); } }
[ "public", "static", "Number", "getExactlyNumber", "(", "final", "String", "value", ",", "final", "int", "radix", ")", "{", "try", "{", "return", "getBigInteger", "(", "value", ",", "radix", ")", ";", "}", "catch", "(", "final", "NumberFormatException", "ex",...
Get exactly number value and type. @param value string to be converted @param radix radix @return exactly number value and type
[ "Get", "exactly", "number", "value", "and", "type", "." ]
train
https://github.com/apache/incubator-shardingsphere/blob/f88fd29fc345dfb31fdce12e9e96cbfa0fd2402d/sharding-core/sharding-core-common/src/main/java/org/apache/shardingsphere/core/util/NumberUtil.java#L71-L77
jeremybrooks/jinx
src/main/java/net/jeremybrooks/jinx/api/ContactsApi.java
ContactsApi.getListRecentlyUploaded
public Contacts getListRecentlyUploaded(Date dateLastUpload, JinxConstants.Contacts filter) throws JinxException { """ Return a list of contacts for a user who have recently uploaded photos along with the total count of photos uploaded. <br> Flickr documentation states: "This method is still considered experime...
java
public Contacts getListRecentlyUploaded(Date dateLastUpload, JinxConstants.Contacts filter) throws JinxException { Map<String, String> params = new TreeMap<>(); params.put("method", "flickr.contacts.getListRecentlyUploaded"); if (dateLastUpload != null) { params.put("date_lastupload", JinxUtils.format...
[ "public", "Contacts", "getListRecentlyUploaded", "(", "Date", "dateLastUpload", ",", "JinxConstants", ".", "Contacts", "filter", ")", "throws", "JinxException", "{", "Map", "<", "String", ",", "String", ">", "params", "=", "new", "TreeMap", "<>", "(", ")", ";"...
Return a list of contacts for a user who have recently uploaded photos along with the total count of photos uploaded. <br> Flickr documentation states: "This method is still considered experimental. We don't plan for it to change or to go away but so long as this notice is present you should write your code accordingly...
[ "Return", "a", "list", "of", "contacts", "for", "a", "user", "who", "have", "recently", "uploaded", "photos", "along", "with", "the", "total", "count", "of", "photos", "uploaded", ".", "<br", ">", "Flickr", "documentation", "states", ":", "This", "method", ...
train
https://github.com/jeremybrooks/jinx/blob/ab7a4b7462d08bcbfd9b98bd3f5029771c20f6c6/src/main/java/net/jeremybrooks/jinx/api/ContactsApi.java#L92-L102
goldmansachs/gs-collections
collections/src/main/java/com/gs/collections/impl/list/primitive/IntInterval.java
IntInterval.fromToBy
public static IntInterval fromToBy(int from, int to, int stepBy) { """ Returns an IntInterval for the range of integers inclusively between from and to with the specified stepBy value. """ if (stepBy == 0) { throw new IllegalArgumentException("Cannot use a step by of 0"); }...
java
public static IntInterval fromToBy(int from, int to, int stepBy) { if (stepBy == 0) { throw new IllegalArgumentException("Cannot use a step by of 0"); } if (from > to && stepBy > 0 || from < to && stepBy < 0) { throw new IllegalArgumentException("Step ...
[ "public", "static", "IntInterval", "fromToBy", "(", "int", "from", ",", "int", "to", ",", "int", "stepBy", ")", "{", "if", "(", "stepBy", "==", "0", ")", "{", "throw", "new", "IllegalArgumentException", "(", "\"Cannot use a step by of 0\"", ")", ";", "}", ...
Returns an IntInterval for the range of integers inclusively between from and to with the specified stepBy value.
[ "Returns", "an", "IntInterval", "for", "the", "range", "of", "integers", "inclusively", "between", "from", "and", "to", "with", "the", "specified", "stepBy", "value", "." ]
train
https://github.com/goldmansachs/gs-collections/blob/fa8bf3e103689efa18bca2ab70203e71cde34b52/collections/src/main/java/com/gs/collections/impl/list/primitive/IntInterval.java#L238-L249
kuali/ojb-1.0.4
src/java/org/apache/ojb/broker/accesslayer/StatementManager.java
StatementManager.bindStatement
private int bindStatement(PreparedStatement stmt, int index, ExistsCriteria crit, ClassDescriptor cld) throws SQLException { """ bind ExistsCriteria @param stmt the PreparedStatement @param index the position of the parameter to bind @param crit the Criteria containing the parameter @param cld the ClassDescrip...
java
private int bindStatement(PreparedStatement stmt, int index, ExistsCriteria crit, ClassDescriptor cld) throws SQLException { Query subQuery = (Query) crit.getValue(); // if query has criteria, bind them if (subQuery.getCriteria() != null && !subQuery.getCriteria().isEmpty()) {...
[ "private", "int", "bindStatement", "(", "PreparedStatement", "stmt", ",", "int", "index", ",", "ExistsCriteria", "crit", ",", "ClassDescriptor", "cld", ")", "throws", "SQLException", "{", "Query", "subQuery", "=", "(", "Query", ")", "crit", ".", "getValue", "(...
bind ExistsCriteria @param stmt the PreparedStatement @param index the position of the parameter to bind @param crit the Criteria containing the parameter @param cld the ClassDescriptor @return next index for PreparedStatement
[ "bind", "ExistsCriteria" ]
train
https://github.com/kuali/ojb-1.0.4/blob/9a544372f67ce965f662cdc71609dd03683c8f04/src/java/org/apache/ojb/broker/accesslayer/StatementManager.java#L337-L352
czyzby/gdx-lml
lml/src/main/java/com/github/czyzby/lml/parser/impl/DefaultLmlTemplateReader.java
DefaultLmlTemplateReader.appendSequence
protected void appendSequence(final CharSequence sequence, final String name) { """ Actual appending method, referenced by all others. @param sequence should be appended to the reader and set as currently parsed sequence. @param name name of the template for debugging purposes. """ if (Strings.isNo...
java
protected void appendSequence(final CharSequence sequence, final String name) { if (Strings.isNotEmpty(sequence)) { queueCurrentSequence(); setCurrentSequence(new CharSequenceEntry(sequence, name)); } }
[ "protected", "void", "appendSequence", "(", "final", "CharSequence", "sequence", ",", "final", "String", "name", ")", "{", "if", "(", "Strings", ".", "isNotEmpty", "(", "sequence", ")", ")", "{", "queueCurrentSequence", "(", ")", ";", "setCurrentSequence", "("...
Actual appending method, referenced by all others. @param sequence should be appended to the reader and set as currently parsed sequence. @param name name of the template for debugging purposes.
[ "Actual", "appending", "method", "referenced", "by", "all", "others", "." ]
train
https://github.com/czyzby/gdx-lml/blob/7623b322e6afe49ad4dd636c80c230150a1cfa4e/lml/src/main/java/com/github/czyzby/lml/parser/impl/DefaultLmlTemplateReader.java#L59-L64
voldemort/voldemort
src/java/voldemort/utils/ByteUtils.java
ByteUtils.readUnsignedInt
public static long readUnsignedInt(byte[] bytes, int offset) { """ Read an unsigned integer from the given byte array @param bytes The bytes to read from @param offset The offset to begin reading at @return The integer as a long """ return (((bytes[offset + 0] & 0xffL) << 24) | ((bytes[offset + 1]...
java
public static long readUnsignedInt(byte[] bytes, int offset) { return (((bytes[offset + 0] & 0xffL) << 24) | ((bytes[offset + 1] & 0xffL) << 16) | ((bytes[offset + 2] & 0xffL) << 8) | (bytes[offset + 3] & 0xffL)); }
[ "public", "static", "long", "readUnsignedInt", "(", "byte", "[", "]", "bytes", ",", "int", "offset", ")", "{", "return", "(", "(", "(", "bytes", "[", "offset", "+", "0", "]", "&", "0xff", "L", ")", "<<", "24", ")", "|", "(", "(", "bytes", "[", ...
Read an unsigned integer from the given byte array @param bytes The bytes to read from @param offset The offset to begin reading at @return The integer as a long
[ "Read", "an", "unsigned", "integer", "from", "the", "given", "byte", "array" ]
train
https://github.com/voldemort/voldemort/blob/a7dbdea58032021361680faacf2782cf981c5332/src/java/voldemort/utils/ByteUtils.java#L191-L194
mapsforge/mapsforge
mapsforge-map-awt/src/main/java/org/mapsforge/map/awt/util/AwtUtil.java
AwtUtil.createTileCache
public static TileCache createTileCache(int tileSize, double overdrawFactor, int capacity, File cacheDirectory) { """ Utility function to create a two-level tile cache with the right size, using the size of the screen. <p> Combine with <code>FrameBufferController.setUseSquareFrameBuffer(false);</code> @param ...
java
public static TileCache createTileCache(int tileSize, double overdrawFactor, int capacity, File cacheDirectory) { int cacheSize = getMinimumCacheSize(tileSize, overdrawFactor); TileCache firstLevelTileCache = new InMemoryTileCache(cacheSize); TileCache secondLevelTileCache = new FileSystemTileCa...
[ "public", "static", "TileCache", "createTileCache", "(", "int", "tileSize", ",", "double", "overdrawFactor", ",", "int", "capacity", ",", "File", "cacheDirectory", ")", "{", "int", "cacheSize", "=", "getMinimumCacheSize", "(", "tileSize", ",", "overdrawFactor", ")...
Utility function to create a two-level tile cache with the right size, using the size of the screen. <p> Combine with <code>FrameBufferController.setUseSquareFrameBuffer(false);</code> @param tileSize the tile size @param overdrawFactor the overdraw factor applied to the map view @param capacity the maximu...
[ "Utility", "function", "to", "create", "a", "two", "-", "level", "tile", "cache", "with", "the", "right", "size", "using", "the", "size", "of", "the", "screen", ".", "<p", ">", "Combine", "with", "<code", ">", "FrameBufferController", ".", "setUseSquareFrame...
train
https://github.com/mapsforge/mapsforge/blob/c49c83f7f727552f793dff15cefa532ade030842/mapsforge-map-awt/src/main/java/org/mapsforge/map/awt/util/AwtUtil.java#L40-L45
jbundle/jbundle
base/base/src/main/java/org/jbundle/base/db/BaseDatabase.java
BaseDatabase.makeResourceTable
public BaseTable makeResourceTable(Record record, BaseTable table, BaseDatabase databaseBase, boolean bHierarchicalTable) { """ If one exists, set up the Local version of this record. Do this by opening a local version of this database and attaching a ResourceTable to the record. @param record The record to set...
java
public BaseTable makeResourceTable(Record record, BaseTable table, BaseDatabase databaseBase, boolean bHierarchicalTable) { // Create a mirrored record in the locale database Record record2 = (Record)ClassServiceUtility.getClassService().makeObjectFromClassName(record.getClass().getName()); if (re...
[ "public", "BaseTable", "makeResourceTable", "(", "Record", "record", ",", "BaseTable", "table", ",", "BaseDatabase", "databaseBase", ",", "boolean", "bHierarchicalTable", ")", "{", "// Create a mirrored record in the locale database", "Record", "record2", "=", "(", "Recor...
If one exists, set up the Local version of this record. Do this by opening a local version of this database and attaching a ResourceTable to the record. @param record The record to set up. @param table The table for the record. @return The new locale-sensitive table that has been setup for this record.
[ "If", "one", "exists", "set", "up", "the", "Local", "version", "of", "this", "record", ".", "Do", "this", "by", "opening", "a", "local", "version", "of", "this", "database", "and", "attaching", "a", "ResourceTable", "to", "the", "record", "." ]
train
https://github.com/jbundle/jbundle/blob/4037fcfa85f60c7d0096c453c1a3cd573c2b0abc/base/base/src/main/java/org/jbundle/base/db/BaseDatabase.java#L439-L459
biojava/biojava
biojava-structure/src/main/java/org/biojava/nbio/structure/scop/ScopFactory.java
ScopFactory.setScopDatabase
public static void setScopDatabase(String version, boolean forceLocalData) { """ Set the default scop version @param version A version number, such as {@link #VERSION_1_75A} @param forceLocalData Whether to use a local installation or a remote installation """ logger.debug("ScopFactory: Setting ScopDatabas...
java
public static void setScopDatabase(String version, boolean forceLocalData) { logger.debug("ScopFactory: Setting ScopDatabase to version: {}, forced local: {}", version, forceLocalData); getSCOP(version,forceLocalData); defaultVersion = version; }
[ "public", "static", "void", "setScopDatabase", "(", "String", "version", ",", "boolean", "forceLocalData", ")", "{", "logger", ".", "debug", "(", "\"ScopFactory: Setting ScopDatabase to version: {}, forced local: {}\"", ",", "version", ",", "forceLocalData", ")", ";", "...
Set the default scop version @param version A version number, such as {@link #VERSION_1_75A} @param forceLocalData Whether to use a local installation or a remote installation
[ "Set", "the", "default", "scop", "version" ]
train
https://github.com/biojava/biojava/blob/a1c71a8e3d40cc32104b1d387a3d3b560b43356e/biojava-structure/src/main/java/org/biojava/nbio/structure/scop/ScopFactory.java#L178-L182
mailin-api/sendinblue-java-mvn
src/main/java/com/sendinblue/Sendinblue.java
Sendinblue.send_bat_sms
public String send_bat_sms(Map<String, Object> data) { """ /* Send a Test SMS. @param {Object} data contains json objects as a key value pair from HashMap. @options data {Integer} id: Id of the SMS campaign [Mandatory] @options data {String} to: Mobile number with the country code to send test SMS. The mobile ...
java
public String send_bat_sms(Map<String, Object> data) { String id = data.get("id").toString(); String to = data.get("to").toString(); Gson gson = new Gson(); String json = gson.toJson(data); return get("sms/" + id + "/" + to, EMPTY_STRING); }
[ "public", "String", "send_bat_sms", "(", "Map", "<", "String", ",", "Object", ">", "data", ")", "{", "String", "id", "=", "data", ".", "get", "(", "\"id\"", ")", ".", "toString", "(", ")", ";", "String", "to", "=", "data", ".", "get", "(", "\"to\""...
/* Send a Test SMS. @param {Object} data contains json objects as a key value pair from HashMap. @options data {Integer} id: Id of the SMS campaign [Mandatory] @options data {String} to: Mobile number with the country code to send test SMS. The mobile number defined here should belong to one of your contacts in SendinB...
[ "/", "*", "Send", "a", "Test", "SMS", "." ]
train
https://github.com/mailin-api/sendinblue-java-mvn/blob/3a186b004003450f18d619aa084adc8d75086183/src/main/java/com/sendinblue/Sendinblue.java#L316-L322
apache/groovy
src/main/java/org/codehaus/groovy/runtime/DefaultGroovyMethods.java
DefaultGroovyMethods.putAt
public static void putAt(List self, IntRange range, Object value) { """ List subscript assignment operator when given a range as the index. Example: <pre class="groovyTestCase">def myList = [4, 3, 5, 1, 2, 8, 10] myList[3..5] = "b" assert myList == [4, 3, 5, "b", 10]</pre> Items in the given range are repla...
java
public static void putAt(List self, IntRange range, Object value) { List sublist = resizeListWithRangeAndGetSublist(self, range); sublist.add(value); }
[ "public", "static", "void", "putAt", "(", "List", "self", ",", "IntRange", "range", ",", "Object", "value", ")", "{", "List", "sublist", "=", "resizeListWithRangeAndGetSublist", "(", "self", ",", "range", ")", ";", "sublist", ".", "add", "(", "value", ")",...
List subscript assignment operator when given a range as the index. Example: <pre class="groovyTestCase">def myList = [4, 3, 5, 1, 2, 8, 10] myList[3..5] = "b" assert myList == [4, 3, 5, "b", 10]</pre> Items in the given range are replaced with the operand. The <code>value</code> operand is always treated as a single...
[ "List", "subscript", "assignment", "operator", "when", "given", "a", "range", "as", "the", "index", ".", "Example", ":", "<pre", "class", "=", "groovyTestCase", ">", "def", "myList", "=", "[", "4", "3", "5", "1", "2", "8", "10", "]", "myList", "[", "...
train
https://github.com/apache/groovy/blob/71cf20addb611bb8d097a59e395fd20bc7f31772/src/main/java/org/codehaus/groovy/runtime/DefaultGroovyMethods.java#L8065-L8068
apache/flink
flink-streaming-java/src/main/java/org/apache/flink/streaming/api/datastream/AsyncDataStream.java
AsyncDataStream.orderedWait
public static <IN, OUT> SingleOutputStreamOperator<OUT> orderedWait( DataStream<IN> in, AsyncFunction<IN, OUT> func, long timeout, TimeUnit timeUnit, int capacity) { """ Add an AsyncWaitOperator. The order to process input records is guaranteed to be the same as input ones. @param in Input {@lin...
java
public static <IN, OUT> SingleOutputStreamOperator<OUT> orderedWait( DataStream<IN> in, AsyncFunction<IN, OUT> func, long timeout, TimeUnit timeUnit, int capacity) { return addOperator(in, func, timeUnit.toMillis(timeout), capacity, OutputMode.ORDERED); }
[ "public", "static", "<", "IN", ",", "OUT", ">", "SingleOutputStreamOperator", "<", "OUT", ">", "orderedWait", "(", "DataStream", "<", "IN", ">", "in", ",", "AsyncFunction", "<", "IN", ",", "OUT", ">", "func", ",", "long", "timeout", ",", "TimeUnit", "tim...
Add an AsyncWaitOperator. The order to process input records is guaranteed to be the same as input ones. @param in Input {@link DataStream} @param func {@link AsyncFunction} @param timeout for the asynchronous operation to complete @param timeUnit of the given timeout @param capacity The max number of async i/o operat...
[ "Add", "an", "AsyncWaitOperator", ".", "The", "order", "to", "process", "input", "records", "is", "guaranteed", "to", "be", "the", "same", "as", "input", "ones", "." ]
train
https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-streaming-java/src/main/java/org/apache/flink/streaming/api/datastream/AsyncDataStream.java#L147-L154
liferay/com-liferay-commerce
commerce-api/src/main/java/com/liferay/commerce/model/CommerceShippingMethodWrapper.java
CommerceShippingMethodWrapper.getName
@Override public String getName(String languageId, boolean useDefault) { """ Returns the localized name of this commerce shipping method in the language, optionally using the default language if no localization exists for the requested language. @param languageId the ID of the language @param useDefault wheth...
java
@Override public String getName(String languageId, boolean useDefault) { return _commerceShippingMethod.getName(languageId, useDefault); }
[ "@", "Override", "public", "String", "getName", "(", "String", "languageId", ",", "boolean", "useDefault", ")", "{", "return", "_commerceShippingMethod", ".", "getName", "(", "languageId", ",", "useDefault", ")", ";", "}" ]
Returns the localized name of this commerce shipping method in the language, optionally using the default language if no localization exists for the requested language. @param languageId the ID of the language @param useDefault whether to use the default language if no localization exists for the requested language @r...
[ "Returns", "the", "localized", "name", "of", "this", "commerce", "shipping", "method", "in", "the", "language", "optionally", "using", "the", "default", "language", "if", "no", "localization", "exists", "for", "the", "requested", "language", "." ]
train
https://github.com/liferay/com-liferay-commerce/blob/9e54362d7f59531fc684016ba49ee7cdc3a2f22b/commerce-api/src/main/java/com/liferay/commerce/model/CommerceShippingMethodWrapper.java#L399-L402
lecousin/java-framework-core
net.lecousin.core/src/main/java/net/lecousin/framework/concurrent/synch/AsyncWork.java
AsyncWork.listenInlineGenericError
public final void listenInlineGenericError(AsyncWork<T, Exception> sp) { """ Forward the result, error, or cancellation to the given AsyncWork. """ listenInline(new AsyncWorkListener<T,TError>() { @Override public void ready(T result) { sp.unblockSuccess(result); } @Override pu...
java
public final void listenInlineGenericError(AsyncWork<T, Exception> sp) { listenInline(new AsyncWorkListener<T,TError>() { @Override public void ready(T result) { sp.unblockSuccess(result); } @Override public void error(TError error) { sp.unblockError(error); } @Overrid...
[ "public", "final", "void", "listenInlineGenericError", "(", "AsyncWork", "<", "T", ",", "Exception", ">", "sp", ")", "{", "listenInline", "(", "new", "AsyncWorkListener", "<", "T", ",", "TError", ">", "(", ")", "{", "@", "Override", "public", "void", "read...
Forward the result, error, or cancellation to the given AsyncWork.
[ "Forward", "the", "result", "error", "or", "cancellation", "to", "the", "given", "AsyncWork", "." ]
train
https://github.com/lecousin/java-framework-core/blob/b0c893b44bfde2c03f90ea846a49ef5749d598f3/net.lecousin.core/src/main/java/net/lecousin/framework/concurrent/synch/AsyncWork.java#L313-L330
jtablesaw/tablesaw
core/src/main/java/tech/tablesaw/table/Relation.java
Relation.get
public Object get(int r, int c) { """ Returns the value at the given row and column indexes @param r the row index, 0 based @param c the column index, 0 based """ Column<?> column = column(c); return column.get(r); }
java
public Object get(int r, int c) { Column<?> column = column(c); return column.get(r); }
[ "public", "Object", "get", "(", "int", "r", ",", "int", "c", ")", "{", "Column", "<", "?", ">", "column", "=", "column", "(", "c", ")", ";", "return", "column", ".", "get", "(", "r", ")", ";", "}" ]
Returns the value at the given row and column indexes @param r the row index, 0 based @param c the column index, 0 based
[ "Returns", "the", "value", "at", "the", "given", "row", "and", "column", "indexes" ]
train
https://github.com/jtablesaw/tablesaw/blob/68a75b4098ac677e9486df5572cf13ec39f9f701/core/src/main/java/tech/tablesaw/table/Relation.java#L175-L178
Drivemode/TypefaceHelper
TypefaceHelper/src/main/java/com/drivemode/android/typeface/TypefaceHelper.java
TypefaceHelper.setTypeface
public <V extends ViewGroup> void setTypeface(V viewGroup, @StringRes int strResId) { """ Set the typeface to the all text views belong to the view group. Note that this method recursively trace the child view groups and set typeface for the text views. @param viewGroup the view group that contains text views. ...
java
public <V extends ViewGroup> void setTypeface(V viewGroup, @StringRes int strResId) { setTypeface(viewGroup, mApplication.getString(strResId)); }
[ "public", "<", "V", "extends", "ViewGroup", ">", "void", "setTypeface", "(", "V", "viewGroup", ",", "@", "StringRes", "int", "strResId", ")", "{", "setTypeface", "(", "viewGroup", ",", "mApplication", ".", "getString", "(", "strResId", ")", ")", ";", "}" ]
Set the typeface to the all text views belong to the view group. Note that this method recursively trace the child view groups and set typeface for the text views. @param viewGroup the view group that contains text views. @param strResId string resource containing typeface name. @param <V> view group parameter.
[ "Set", "the", "typeface", "to", "the", "all", "text", "views", "belong", "to", "the", "view", "group", ".", "Note", "that", "this", "method", "recursively", "trace", "the", "child", "view", "groups", "and", "set", "typeface", "for", "the", "text", "views",...
train
https://github.com/Drivemode/TypefaceHelper/blob/86bef9ce16b9626b7076559e846db1b9f043c008/TypefaceHelper/src/main/java/com/drivemode/android/typeface/TypefaceHelper.java#L151-L153
OpenFeign/feign
core/src/main/java/feign/Request.java
Request.create
public static Request create(HttpMethod httpMethod, String url, Map<String, Collection<String>> headers, byte[] body, Charset charset) { """ Builds a Request. All parameters must be effective...
java
public static Request create(HttpMethod httpMethod, String url, Map<String, Collection<String>> headers, byte[] body, Charset charset) { return create(httpMethod, url, headers, Body.encoded(bo...
[ "public", "static", "Request", "create", "(", "HttpMethod", "httpMethod", ",", "String", "url", ",", "Map", "<", "String", ",", "Collection", "<", "String", ">", ">", "headers", ",", "byte", "[", "]", "body", ",", "Charset", "charset", ")", "{", "return"...
Builds a Request. All parameters must be effectively immutable, via safe copies. @param httpMethod for the request. @param url for the request. @param headers to include. @param body of the request, can be {@literal null} @param charset of the request, can be {@literal null} @return a Request
[ "Builds", "a", "Request", ".", "All", "parameters", "must", "be", "effectively", "immutable", "via", "safe", "copies", "." ]
train
https://github.com/OpenFeign/feign/blob/318fb0e955b8cfcf64f70d6aeea0ba5795f8a7eb/core/src/main/java/feign/Request.java#L117-L123
spotbugs/spotbugs
spotbugs/src/main/java/edu/umd/cs/findbugs/BugInstance.java
BugInstance.addClassAndMethod
@Nonnull public BugInstance addClassAndMethod(MethodGen methodGen, String sourceFile) { """ Add class and method annotations for given method. @param methodGen the method @param sourceFile source file the method is defined in @return this object """ addClass(methodGen.getClassName()); ...
java
@Nonnull public BugInstance addClassAndMethod(MethodGen methodGen, String sourceFile) { addClass(methodGen.getClassName()); addMethod(methodGen, sourceFile); if (!MemberUtils.isUserGenerated(methodGen)) { foundInAutogeneratedMethod(); } return this; }
[ "@", "Nonnull", "public", "BugInstance", "addClassAndMethod", "(", "MethodGen", "methodGen", ",", "String", "sourceFile", ")", "{", "addClass", "(", "methodGen", ".", "getClassName", "(", ")", ")", ";", "addMethod", "(", "methodGen", ",", "sourceFile", ")", ";...
Add class and method annotations for given method. @param methodGen the method @param sourceFile source file the method is defined in @return this object
[ "Add", "class", "and", "method", "annotations", "for", "given", "method", "." ]
train
https://github.com/spotbugs/spotbugs/blob/f6365c6eea6515035bded38efa4a7c8b46ccf28c/spotbugs/src/main/java/edu/umd/cs/findbugs/BugInstance.java#L884-L892
astrapi69/jaulp-wicket
jaulp-wicket-base/src/main/java/de/alpharogroup/wicket/base/util/PageProviderFactory.java
PageProviderFactory.newPageProvider
public static PageProvider newPageProvider(final Class<? extends IRequestablePage> pageClass, final PageParameters pageParameters) { """ Factory method to create a new Page provider with the given page. @param pageClass the page class @param pageParameters the page parameters @return the page provider ...
java
public static PageProvider newPageProvider(final Class<? extends IRequestablePage> pageClass, final PageParameters pageParameters) { return new PageProvider(pageClass, pageParameters); }
[ "public", "static", "PageProvider", "newPageProvider", "(", "final", "Class", "<", "?", "extends", "IRequestablePage", ">", "pageClass", ",", "final", "PageParameters", "pageParameters", ")", "{", "return", "new", "PageProvider", "(", "pageClass", ",", "pageParamete...
Factory method to create a new Page provider with the given page. @param pageClass the page class @param pageParameters the page parameters @return the page provider
[ "Factory", "method", "to", "create", "a", "new", "Page", "provider", "with", "the", "given", "page", "." ]
train
https://github.com/astrapi69/jaulp-wicket/blob/85d74368d00abd9bb97659b5794e38c0f8a013d4/jaulp-wicket-base/src/main/java/de/alpharogroup/wicket/base/util/PageProviderFactory.java#L49-L53
datumbox/datumbox-framework
datumbox-framework-common/src/main/java/com/datumbox/framework/common/ConfigurableFactory.java
ConfigurableFactory.getConfiguration
public static <C extends Configurable> C getConfiguration(Class<C> klass, Properties properties) { """ Initializes the Configuration Object using a properties object. @param klass @param properties @param <C> @return """ //Initialize configuration object C configuration; try { ...
java
public static <C extends Configurable> C getConfiguration(Class<C> klass, Properties properties) { //Initialize configuration object C configuration; try { Constructor<C> constructor = klass.getDeclaredConstructor(); constructor.setAccessible(true); configurat...
[ "public", "static", "<", "C", "extends", "Configurable", ">", "C", "getConfiguration", "(", "Class", "<", "C", ">", "klass", ",", "Properties", "properties", ")", "{", "//Initialize configuration object", "C", "configuration", ";", "try", "{", "Constructor", "<"...
Initializes the Configuration Object using a properties object. @param klass @param properties @param <C> @return
[ "Initializes", "the", "Configuration", "Object", "using", "a", "properties", "object", "." ]
train
https://github.com/datumbox/datumbox-framework/blob/909dff0476e80834f05ecdde0624dd2390e9b0ca/datumbox-framework-common/src/main/java/com/datumbox/framework/common/ConfigurableFactory.java#L90-L105
netscaler/nitro
src/main/java/com/citrix/netscaler/nitro/resource/stat/ipsec/ipseccounters_stats.java
ipseccounters_stats.get_nitro_response
protected base_resource[] get_nitro_response(nitro_service service, String response) throws Exception { """ <pre> converts nitro response into object and returns the object array in case of get request. </pre> """ ipseccounters_stats[] resources = new ipseccounters_stats[1]; ipseccounters_response result...
java
protected base_resource[] get_nitro_response(nitro_service service, String response) throws Exception { ipseccounters_stats[] resources = new ipseccounters_stats[1]; ipseccounters_response result = (ipseccounters_response) service.get_payload_formatter().string_to_resource(ipseccounters_response.class, response); ...
[ "protected", "base_resource", "[", "]", "get_nitro_response", "(", "nitro_service", "service", ",", "String", "response", ")", "throws", "Exception", "{", "ipseccounters_stats", "[", "]", "resources", "=", "new", "ipseccounters_stats", "[", "1", "]", ";", "ipsecco...
<pre> converts nitro response into object and returns the object array in case of get request. </pre>
[ "<pre", ">", "converts", "nitro", "response", "into", "object", "and", "returns", "the", "object", "array", "in", "case", "of", "get", "request", ".", "<", "/", "pre", ">" ]
train
https://github.com/netscaler/nitro/blob/2a98692dcf4e4ec430c7d7baab8382e4ba5a35e4/src/main/java/com/citrix/netscaler/nitro/resource/stat/ipsec/ipseccounters_stats.java#L140-L159
mapbox/mapbox-java
services-geojson/src/main/java/com/mapbox/geojson/LineString.java
LineString.fromLngLats
public static LineString fromLngLats(@NonNull List<Point> points) { """ Create a new instance of this class by defining a list of {@link Point}s which follow the correct specifications described in the Point documentation. Note that there should not be any duplicate points inside the list and the points combined...
java
public static LineString fromLngLats(@NonNull List<Point> points) { return new LineString(TYPE, null, points); }
[ "public", "static", "LineString", "fromLngLats", "(", "@", "NonNull", "List", "<", "Point", ">", "points", ")", "{", "return", "new", "LineString", "(", "TYPE", ",", "null", ",", "points", ")", ";", "}" ]
Create a new instance of this class by defining a list of {@link Point}s which follow the correct specifications described in the Point documentation. Note that there should not be any duplicate points inside the list and the points combined should create a LineString with a distance greater than 0. <p> Note that if le...
[ "Create", "a", "new", "instance", "of", "this", "class", "by", "defining", "a", "list", "of", "{", "@link", "Point", "}", "s", "which", "follow", "the", "correct", "specifications", "described", "in", "the", "Point", "documentation", ".", "Note", "that", "...
train
https://github.com/mapbox/mapbox-java/blob/c0be138f462f91441388584c668f3760ba0e18e2/services-geojson/src/main/java/com/mapbox/geojson/LineString.java#L108-L110
maestrano/maestrano-java
src/main/java/com/maestrano/Maestrano.java
Maestrano.loadProperties
public static Properties loadProperties(String filePath) throws MnoConfigurationException { """ load Properties from a filePath, in the classPath or absolute @param filePath @return @throws MnoConfigurationException """ Properties properties = new Properties(); InputStream input = getInputStreamFromCl...
java
public static Properties loadProperties(String filePath) throws MnoConfigurationException { Properties properties = new Properties(); InputStream input = getInputStreamFromClassPathOrFile(filePath); try { properties.load(input); } catch (IOException e) { throw new MnoConfigurationException("Could not load...
[ "public", "static", "Properties", "loadProperties", "(", "String", "filePath", ")", "throws", "MnoConfigurationException", "{", "Properties", "properties", "=", "new", "Properties", "(", ")", ";", "InputStream", "input", "=", "getInputStreamFromClassPathOrFile", "(", ...
load Properties from a filePath, in the classPath or absolute @param filePath @return @throws MnoConfigurationException
[ "load", "Properties", "from", "a", "filePath", "in", "the", "classPath", "or", "absolute" ]
train
https://github.com/maestrano/maestrano-java/blob/e71c6d3172d7645529d678d1cb3ea9e0a59de314/src/main/java/com/maestrano/Maestrano.java#L189-L200
jeremybrooks/jinx
src/main/java/net/jeremybrooks/jinx/Jinx.java
Jinx.flickrGet
public <T> T flickrGet(Map<String, String> params, Class<T> tClass) throws JinxException { """ Call Flickr, returning the specified class deserialized from the Flickr response. <br> This will make a signed call to Flickr using http GET. <p> Do not call this method directly. The classes in the net.jeremybrooks....
java
public <T> T flickrGet(Map<String, String> params, Class<T> tClass) throws JinxException { return callFlickr(params, Method.GET, tClass, true); }
[ "public", "<", "T", ">", "T", "flickrGet", "(", "Map", "<", "String", ",", "String", ">", "params", ",", "Class", "<", "T", ">", "tClass", ")", "throws", "JinxException", "{", "return", "callFlickr", "(", "params", ",", "Method", ".", "GET", ",", "tC...
Call Flickr, returning the specified class deserialized from the Flickr response. <br> This will make a signed call to Flickr using http GET. <p> Do not call this method directly. The classes in the net.jeremybrooks.jinx.api package will call this. @param params request parameters. @param tClass the class that will be...
[ "Call", "Flickr", "returning", "the", "specified", "class", "deserialized", "from", "the", "Flickr", "response", ".", "<br", ">", "This", "will", "make", "a", "signed", "call", "to", "Flickr", "using", "http", "GET", ".", "<p", ">", "Do", "not", "call", ...
train
https://github.com/jeremybrooks/jinx/blob/ab7a4b7462d08bcbfd9b98bd3f5029771c20f6c6/src/main/java/net/jeremybrooks/jinx/Jinx.java#L453-L455
dropbox/dropbox-sdk-java
src/main/java/com/dropbox/core/android/AuthActivity.java
AuthActivity.makeIntent
public static Intent makeIntent(Context context, String appKey, String webHost, String apiType) { """ Create an intent which can be sent to this activity to start OAuth 2 authentication. @param context the source context @param appKey the consumer key for the app @par...
java
public static Intent makeIntent(Context context, String appKey, String webHost, String apiType) { return makeIntent(context, appKey, null, null, null, webHost, apiType); }
[ "public", "static", "Intent", "makeIntent", "(", "Context", "context", ",", "String", "appKey", ",", "String", "webHost", ",", "String", "apiType", ")", "{", "return", "makeIntent", "(", "context", ",", "appKey", ",", "null", ",", "null", ",", "null", ",",...
Create an intent which can be sent to this activity to start OAuth 2 authentication. @param context the source context @param appKey the consumer key for the app @param webHost the host to use for web authentication, or null for the default @param apiType an identifier for the type of API being supported, or null for ...
[ "Create", "an", "intent", "which", "can", "be", "sent", "to", "this", "activity", "to", "start", "OAuth", "2", "authentication", "." ]
train
https://github.com/dropbox/dropbox-sdk-java/blob/d86157005fad6233c18b4b0f10f00b8d9d56ae92/src/main/java/com/dropbox/core/android/AuthActivity.java#L230-L233
google/j2objc
jre_emul/android/platform/external/icu/android_icu4j/src/main/java/android/icu/util/MeasureUnit.java
MeasureUnit.internalGetInstance
@Deprecated public static MeasureUnit internalGetInstance(String type, String subType) { """ Create a MeasureUnit instance (creates a singleton instance). <p> Normally this method should not be used, since there will be no formatting data available for it, and it may not be returned by getAvailable(). Howe...
java
@Deprecated public static MeasureUnit internalGetInstance(String type, String subType) { if (type == null || subType == null) { throw new NullPointerException("Type and subType must be non-null"); } if (!"currency".equals(type)) { if (!ASCII.containsAll(type) || !ASCI...
[ "@", "Deprecated", "public", "static", "MeasureUnit", "internalGetInstance", "(", "String", "type", ",", "String", "subType", ")", "{", "if", "(", "type", "==", "null", "||", "subType", "==", "null", ")", "{", "throw", "new", "NullPointerException", "(", "\"...
Create a MeasureUnit instance (creates a singleton instance). <p> Normally this method should not be used, since there will be no formatting data available for it, and it may not be returned by getAvailable(). However, for special purposes (such as CLDR tooling), it is available. @deprecated This API is ICU internal o...
[ "Create", "a", "MeasureUnit", "instance", "(", "creates", "a", "singleton", "instance", ")", ".", "<p", ">", "Normally", "this", "method", "should", "not", "be", "used", "since", "there", "will", "be", "no", "formatting", "data", "available", "for", "it", ...
train
https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/external/icu/android_icu4j/src/main/java/android/icu/util/MeasureUnit.java#L172-L191
deeplearning4j/deeplearning4j
deeplearning4j/deeplearning4j-nlp-parent/deeplearning4j-nlp/src/main/java/org/deeplearning4j/models/paragraphvectors/ParagraphVectors.java
ParagraphVectors.inferVector
public INDArray inferVector(String text, double learningRate, double minLearningRate, int iterations) { """ This method calculates inferred vector for given text @param text @return """ if (tokenizerFactory == null) throw new IllegalStateException("TokenizerFactory should be defined, pr...
java
public INDArray inferVector(String text, double learningRate, double minLearningRate, int iterations) { if (tokenizerFactory == null) throw new IllegalStateException("TokenizerFactory should be defined, prior to predict() call"); if (this.vocab == null || this.vocab.numWords() == 0) ...
[ "public", "INDArray", "inferVector", "(", "String", "text", ",", "double", "learningRate", ",", "double", "minLearningRate", ",", "int", "iterations", ")", "{", "if", "(", "tokenizerFactory", "==", "null", ")", "throw", "new", "IllegalStateException", "(", "\"To...
This method calculates inferred vector for given text @param text @return
[ "This", "method", "calculates", "inferred", "vector", "for", "given", "text" ]
train
https://github.com/deeplearning4j/deeplearning4j/blob/effce52f2afd7eeb53c5bcca699fcd90bd06822f/deeplearning4j/deeplearning4j-nlp-parent/deeplearning4j-nlp/src/main/java/org/deeplearning4j/models/paragraphvectors/ParagraphVectors.java#L196-L215
apache/flink
flink-core/src/main/java/org/apache/flink/types/parser/FloatParser.java
FloatParser.parseField
public static final float parseField(byte[] bytes, int startPos, int length, char delimiter) { """ Static utility to parse a field of type float from a byte sequence that represents text characters (such as when read from a file stream). @param bytes The bytes containing the text data that should be parse...
java
public static final float parseField(byte[] bytes, int startPos, int length, char delimiter) { final int limitedLen = nextStringLength(bytes, startPos, length, delimiter); if (limitedLen > 0 && (Character.isWhitespace(bytes[startPos]) || Character.isWhitespace(bytes[startPos + limitedLen - 1]))) { throw new...
[ "public", "static", "final", "float", "parseField", "(", "byte", "[", "]", "bytes", ",", "int", "startPos", ",", "int", "length", ",", "char", "delimiter", ")", "{", "final", "int", "limitedLen", "=", "nextStringLength", "(", "bytes", ",", "startPos", ",",...
Static utility to parse a field of type float from a byte sequence that represents text characters (such as when read from a file stream). @param bytes The bytes containing the text data that should be parsed. @param startPos The offset to start the parsing. @param length The length of the byte sequence (count...
[ "Static", "utility", "to", "parse", "a", "field", "of", "type", "float", "from", "a", "byte", "sequence", "that", "represents", "text", "characters", "(", "such", "as", "when", "read", "from", "a", "file", "stream", ")", "." ]
train
https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-core/src/main/java/org/apache/flink/types/parser/FloatParser.java#L95-L105
cdk/cdk
tool/formula/src/main/java/org/openscience/cdk/tools/manipulator/MolecularFormulaManipulator.java
MolecularFormulaManipulator.getAtomContainer
public static IAtomContainer getAtomContainer(IMolecularFormula formula) { """ Method that actually does the work of convert the IMolecularFormula to IAtomContainer. <p> The hydrogens must be implicit. @param formula IMolecularFormula object @return the filled AtomContainer @see #getA...
java
public static IAtomContainer getAtomContainer(IMolecularFormula formula) { IAtomContainer atomContainer = formula.getBuilder().newInstance(IAtomContainer.class); return getAtomContainer(formula, atomContainer); }
[ "public", "static", "IAtomContainer", "getAtomContainer", "(", "IMolecularFormula", "formula", ")", "{", "IAtomContainer", "atomContainer", "=", "formula", ".", "getBuilder", "(", ")", ".", "newInstance", "(", "IAtomContainer", ".", "class", ")", ";", "return", "g...
Method that actually does the work of convert the IMolecularFormula to IAtomContainer. <p> The hydrogens must be implicit. @param formula IMolecularFormula object @return the filled AtomContainer @see #getAtomContainer(IMolecularFormula, IAtomContainer)
[ "Method", "that", "actually", "does", "the", "work", "of", "convert", "the", "IMolecularFormula", "to", "IAtomContainer", ".", "<p", ">", "The", "hydrogens", "must", "be", "implicit", "." ]
train
https://github.com/cdk/cdk/blob/c3d0f16502bf08df50365fee392e11d7c9856657/tool/formula/src/main/java/org/openscience/cdk/tools/manipulator/MolecularFormulaManipulator.java#L1094-L1098
UrielCh/ovh-java-sdk
ovh-java-sdk-ipLoadbalancing/src/main/java/net/minidev/ovh/api/ApiOvhIpLoadbalancing.java
ApiOvhIpLoadbalancing.serviceName_tcp_farm_farmId_server_serverId_GET
public OvhBackendTCPServer serviceName_tcp_farm_farmId_server_serverId_GET(String serviceName, Long farmId, Long serverId) throws IOException { """ Get this object properties REST: GET /ipLoadbalancing/{serviceName}/tcp/farm/{farmId}/server/{serverId} @param serviceName [required] The internal name of your IP ...
java
public OvhBackendTCPServer serviceName_tcp_farm_farmId_server_serverId_GET(String serviceName, Long farmId, Long serverId) throws IOException { String qPath = "/ipLoadbalancing/{serviceName}/tcp/farm/{farmId}/server/{serverId}"; StringBuilder sb = path(qPath, serviceName, farmId, serverId); String resp = exec(qPa...
[ "public", "OvhBackendTCPServer", "serviceName_tcp_farm_farmId_server_serverId_GET", "(", "String", "serviceName", ",", "Long", "farmId", ",", "Long", "serverId", ")", "throws", "IOException", "{", "String", "qPath", "=", "\"/ipLoadbalancing/{serviceName}/tcp/farm/{farmId}/serve...
Get this object properties REST: GET /ipLoadbalancing/{serviceName}/tcp/farm/{farmId}/server/{serverId} @param serviceName [required] The internal name of your IP load balancing @param farmId [required] Id of your farm @param serverId [required] Id of your server
[ "Get", "this", "object", "properties" ]
train
https://github.com/UrielCh/ovh-java-sdk/blob/6d531a40e56e09701943e334c25f90f640c55701/ovh-java-sdk-ipLoadbalancing/src/main/java/net/minidev/ovh/api/ApiOvhIpLoadbalancing.java#L1611-L1616
yidongnan/grpc-spring-boot-starter
grpc-server-spring-boot-autoconfigure/src/main/java/net/devh/boot/grpc/server/security/interceptors/ExceptionTranslatingServerInterceptor.java
ExceptionTranslatingServerInterceptor.closeCallUnauthenticated
protected void closeCallUnauthenticated(final ServerCall<?, ?> call, final AuthenticationException aex) { """ Close the call with {@link Status#UNAUTHENTICATED}. @param call The call to close. @param aex The exception that was the cause. """ call.close(Status.UNAUTHENTICATED.withCause(aex).withDesc...
java
protected void closeCallUnauthenticated(final ServerCall<?, ?> call, final AuthenticationException aex) { call.close(Status.UNAUTHENTICATED.withCause(aex).withDescription(UNAUTHENTICATED_DESCRIPTION), new Metadata()); }
[ "protected", "void", "closeCallUnauthenticated", "(", "final", "ServerCall", "<", "?", ",", "?", ">", "call", ",", "final", "AuthenticationException", "aex", ")", "{", "call", ".", "close", "(", "Status", ".", "UNAUTHENTICATED", ".", "withCause", "(", "aex", ...
Close the call with {@link Status#UNAUTHENTICATED}. @param call The call to close. @param aex The exception that was the cause.
[ "Close", "the", "call", "with", "{", "@link", "Status#UNAUTHENTICATED", "}", "." ]
train
https://github.com/yidongnan/grpc-spring-boot-starter/blob/07f8853cfafc9707584f2371aff012e590217b85/grpc-server-spring-boot-autoconfigure/src/main/java/net/devh/boot/grpc/server/security/interceptors/ExceptionTranslatingServerInterceptor.java#L77-L79
baratine/baratine
framework/src/main/java/com/caucho/v5/bartender/heartbeat/RootHeartbeat.java
RootHeartbeat.createCluster
ClusterHeartbeat createCluster(String clusterName) { """ Returns the cluster with the given name, creating it if necessary. """ ClusterHeartbeat cluster = _clusterMap.get(clusterName); if (cluster == null) { cluster = new ClusterHeartbeat(clusterName, this); _clusterMap.putIfAbs...
java
ClusterHeartbeat createCluster(String clusterName) { ClusterHeartbeat cluster = _clusterMap.get(clusterName); if (cluster == null) { cluster = new ClusterHeartbeat(clusterName, this); _clusterMap.putIfAbsent(clusterName, cluster); cluster = _clusterMap.get(clusterName); ...
[ "ClusterHeartbeat", "createCluster", "(", "String", "clusterName", ")", "{", "ClusterHeartbeat", "cluster", "=", "_clusterMap", ".", "get", "(", "clusterName", ")", ";", "if", "(", "cluster", "==", "null", ")", "{", "cluster", "=", "new", "ClusterHeartbeat", "...
Returns the cluster with the given name, creating it if necessary.
[ "Returns", "the", "cluster", "with", "the", "given", "name", "creating", "it", "if", "necessary", "." ]
train
https://github.com/baratine/baratine/blob/db34b45c03c5a5e930d8142acc72319125569fcf/framework/src/main/java/com/caucho/v5/bartender/heartbeat/RootHeartbeat.java#L197-L210
mpetazzoni/ttorrent
ttorrent-client/src/main/java/com/turn/ttorrent/client/CommunicationManager.java
CommunicationManager.addTorrent
public TorrentManager addTorrent(TorrentMetadataProvider metadataProvider, PieceStorage pieceStorage) throws IOException { """ Adds torrent to storage with any storage and metadata source @param metadataProvider specified metadata source @param pieceStorage specified storage of pieces @return {@link Torre...
java
public TorrentManager addTorrent(TorrentMetadataProvider metadataProvider, PieceStorage pieceStorage) throws IOException { return addTorrent(metadataProvider, pieceStorage, Collections.<TorrentListener>emptyList()); }
[ "public", "TorrentManager", "addTorrent", "(", "TorrentMetadataProvider", "metadataProvider", ",", "PieceStorage", "pieceStorage", ")", "throws", "IOException", "{", "return", "addTorrent", "(", "metadataProvider", ",", "pieceStorage", ",", "Collections", ".", "<", "Tor...
Adds torrent to storage with any storage and metadata source @param metadataProvider specified metadata source @param pieceStorage specified storage of pieces @return {@link TorrentManager} instance for monitoring torrent state @throws IOException if IO error occurs in reading metadata file
[ "Adds", "torrent", "to", "storage", "with", "any", "storage", "and", "metadata", "source" ]
train
https://github.com/mpetazzoni/ttorrent/blob/ecd0e6caf853b63393c4ab63cfd8f20114f73f70/ttorrent-client/src/main/java/com/turn/ttorrent/client/CommunicationManager.java#L191-L193
awin/rabbiteasy
rabbiteasy-cdi/src/main/java/com/zanox/rabbiteasy/cdi/EventPublisher.java
EventPublisher.buildMessage
static Message buildMessage(PublisherConfiguration publisherConfiguration, Object event) { """ Builds a message based on a CDI event and its publisher configuration. @param publisherConfiguration The publisher configuration @param event The CDI event @return The message """ Message message = new ...
java
static Message buildMessage(PublisherConfiguration publisherConfiguration, Object event) { Message message = new Message(publisherConfiguration.basicProperties) .exchange(publisherConfiguration.exchange) .routingKey(publisherConfiguration.routingKey); if (publisherCon...
[ "static", "Message", "buildMessage", "(", "PublisherConfiguration", "publisherConfiguration", ",", "Object", "event", ")", "{", "Message", "message", "=", "new", "Message", "(", "publisherConfiguration", ".", "basicProperties", ")", ".", "exchange", "(", "publisherCon...
Builds a message based on a CDI event and its publisher configuration. @param publisherConfiguration The publisher configuration @param event The CDI event @return The message
[ "Builds", "a", "message", "based", "on", "a", "CDI", "event", "and", "its", "publisher", "configuration", "." ]
train
https://github.com/awin/rabbiteasy/blob/c161efda6c0f7ef319aedf09dfe40a4a90165510/rabbiteasy-cdi/src/main/java/com/zanox/rabbiteasy/cdi/EventPublisher.java#L135-L150
jroyalty/jglm
src/main/java/com/hackoeur/jglm/Matrices.java
Matrices.lookAt
public static final Mat4 lookAt(final Vec3 eye, final Vec3 center, final Vec3 up) { """ Defines a viewing transformation. This method is analogous to the now deprecated {@code gluLookAt} method. @param eye position of the eye point @param center position of the reference point @param up direction of the up ...
java
public static final Mat4 lookAt(final Vec3 eye, final Vec3 center, final Vec3 up) { final Vec3 f = center.subtract(eye).getUnitVector(); Vec3 u = up.getUnitVector(); final Vec3 s = f.cross(u).getUnitVector(); u = s.cross(f); return new Mat4( s.x, u.x, -f.x, 0f, s.y, u.y, -f.y, 0f, s.z, u.z, -f....
[ "public", "static", "final", "Mat4", "lookAt", "(", "final", "Vec3", "eye", ",", "final", "Vec3", "center", ",", "final", "Vec3", "up", ")", "{", "final", "Vec3", "f", "=", "center", ".", "subtract", "(", "eye", ")", ".", "getUnitVector", "(", ")", "...
Defines a viewing transformation. This method is analogous to the now deprecated {@code gluLookAt} method. @param eye position of the eye point @param center position of the reference point @param up direction of the up vector @return
[ "Defines", "a", "viewing", "transformation", ".", "This", "method", "is", "analogous", "to", "the", "now", "deprecated", "{", "@code", "gluLookAt", "}", "method", "." ]
train
https://github.com/jroyalty/jglm/blob/9397c2fcf0d4d62844c64d0b14065ee7bf8cafc6/src/main/java/com/hackoeur/jglm/Matrices.java#L94-L106
m-m-m/util
core/src/main/java/net/sf/mmm/util/transformer/base/StringTransformerChain.java
StringTransformerChain.transformRecursive
private String transformRecursive(String original, State state) { """ This method implements {@link #transform(String)} recursively. @param original is the original value. @param state is the {@link State} used to indicate if a {@link StringTransformerRule rule} causes the chain to {@link State#stop}. @retur...
java
private String transformRecursive(String original, State state) { String value = original; if (this.parent != null) { value = this.parent.transformRecursive(original, state); if (state.stop) { return value; } } for (StringTransformerRule rule : this.rules) { String trans...
[ "private", "String", "transformRecursive", "(", "String", "original", ",", "State", "state", ")", "{", "String", "value", "=", "original", ";", "if", "(", "this", ".", "parent", "!=", "null", ")", "{", "value", "=", "this", ".", "parent", ".", "transform...
This method implements {@link #transform(String)} recursively. @param original is the original value. @param state is the {@link State} used to indicate if a {@link StringTransformerRule rule} causes the chain to {@link State#stop}. @return the transformed result.
[ "This", "method", "implements", "{", "@link", "#transform", "(", "String", ")", "}", "recursively", "." ]
train
https://github.com/m-m-m/util/blob/f0e4e084448f8dfc83ca682a9e1618034a094ce6/core/src/main/java/net/sf/mmm/util/transformer/base/StringTransformerChain.java#L88-L106
UrielCh/ovh-java-sdk
ovh-java-sdk-cloud/src/main/java/net/minidev/ovh/api/ApiOvhCloud.java
ApiOvhCloud.project_serviceName_sshkey_keyId_DELETE
public void project_serviceName_sshkey_keyId_DELETE(String serviceName, String keyId) throws IOException { """ Delete SSH key REST: DELETE /cloud/project/{serviceName}/sshkey/{keyId} @param keyId [required] SSH key id @param serviceName [required] Project name """ String qPath = "/cloud/project/{service...
java
public void project_serviceName_sshkey_keyId_DELETE(String serviceName, String keyId) throws IOException { String qPath = "/cloud/project/{serviceName}/sshkey/{keyId}"; StringBuilder sb = path(qPath, serviceName, keyId); exec(qPath, "DELETE", sb.toString(), null); }
[ "public", "void", "project_serviceName_sshkey_keyId_DELETE", "(", "String", "serviceName", ",", "String", "keyId", ")", "throws", "IOException", "{", "String", "qPath", "=", "\"/cloud/project/{serviceName}/sshkey/{keyId}\"", ";", "StringBuilder", "sb", "=", "path", "(", ...
Delete SSH key REST: DELETE /cloud/project/{serviceName}/sshkey/{keyId} @param keyId [required] SSH key id @param serviceName [required] Project name
[ "Delete", "SSH", "key" ]
train
https://github.com/UrielCh/ovh-java-sdk/blob/6d531a40e56e09701943e334c25f90f640c55701/ovh-java-sdk-cloud/src/main/java/net/minidev/ovh/api/ApiOvhCloud.java#L1513-L1517
Azure/azure-sdk-for-java
batch/data-plane/src/main/java/com/microsoft/azure/batch/protocol/implementation/PoolsImpl.java
PoolsImpl.stopResize
public void stopResize(String poolId, PoolStopResizeOptions poolStopResizeOptions) { """ Stops an ongoing resize operation on the pool. This does not restore the pool to its previous state before the resize operation: it only stops any further changes being made, and the pool maintains its current state. After st...
java
public void stopResize(String poolId, PoolStopResizeOptions poolStopResizeOptions) { stopResizeWithServiceResponseAsync(poolId, poolStopResizeOptions).toBlocking().single().body(); }
[ "public", "void", "stopResize", "(", "String", "poolId", ",", "PoolStopResizeOptions", "poolStopResizeOptions", ")", "{", "stopResizeWithServiceResponseAsync", "(", "poolId", ",", "poolStopResizeOptions", ")", ".", "toBlocking", "(", ")", ".", "single", "(", ")", "....
Stops an ongoing resize operation on the pool. This does not restore the pool to its previous state before the resize operation: it only stops any further changes being made, and the pool maintains its current state. After stopping, the pool stabilizes at the number of nodes it was at when the stop operation was done. ...
[ "Stops", "an", "ongoing", "resize", "operation", "on", "the", "pool", ".", "This", "does", "not", "restore", "the", "pool", "to", "its", "previous", "state", "before", "the", "resize", "operation", ":", "it", "only", "stops", "any", "further", "changes", "...
train
https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/batch/data-plane/src/main/java/com/microsoft/azure/batch/protocol/implementation/PoolsImpl.java#L3063-L3065
steveash/jopenfst
src/main/java/com/github/steveash/jopenfst/io/Convert.java
Convert.importFst
public static MutableFst importFst(File fileToFst, Semiring semiring) { """ Imports an openfst text format. You pass in the file pointing to the fst.txt file and it assumes that the other files has the same prefix, but with input.syms and output.syms as suffixes. For exmaple if you pass in: path/to/mymodel.fst...
java
public static MutableFst importFst(File fileToFst, Semiring semiring) { Preconditions.checkArgument(fileToFst.exists(), "File to the fst.txt openfst output doesnt exist", fileToFst); Preconditions.checkArgument(fileToFst.getName().endsWith(FST_TXT), "fst.txt path must end in .fst.txt", fileToFst); String ba...
[ "public", "static", "MutableFst", "importFst", "(", "File", "fileToFst", ",", "Semiring", "semiring", ")", "{", "Preconditions", ".", "checkArgument", "(", "fileToFst", ".", "exists", "(", ")", ",", "\"File to the fst.txt openfst output doesnt exist\"", ",", "fileToFs...
Imports an openfst text format. You pass in the file pointing to the fst.txt file and it assumes that the other files has the same prefix, but with input.syms and output.syms as suffixes. For exmaple if you pass in: path/to/mymodel.fst.txt It assumes that you also have: path/to/mymodel.input.syms path/to/mymodel.outpu...
[ "Imports", "an", "openfst", "text", "format", ".", "You", "pass", "in", "the", "file", "pointing", "to", "the", "fst", ".", "txt", "file", "and", "it", "assumes", "that", "the", "other", "files", "has", "the", "same", "prefix", "but", "with", "input", ...
train
https://github.com/steveash/jopenfst/blob/4c675203015c1cfad2072556cb532b6edc73261d/src/main/java/com/github/steveash/jopenfst/io/Convert.java#L288-L300
fuinorg/event-store-commons
eshttp/src/main/java/org/fuin/esc/eshttp/ESHttpUtils.java
ESHttpUtils.findNodes
@Nullable public static NodeList findNodes(@NotNull final Node rootNode, @NotNull final XPath xPath, @NotNull final String expression) { """ Returns a list of nodes from a given document using xpath. @param rootNode Node to search. @param xPath XPath to use. @param expression XPath expressi...
java
@Nullable public static NodeList findNodes(@NotNull final Node rootNode, @NotNull final XPath xPath, @NotNull final String expression) { Contract.requireArgNotNull("doc", rootNode); Contract.requireArgNotNull("xPath", xPath); Contract.requireArgNotNull("expression", expression); ...
[ "@", "Nullable", "public", "static", "NodeList", "findNodes", "(", "@", "NotNull", "final", "Node", "rootNode", ",", "@", "NotNull", "final", "XPath", "xPath", ",", "@", "NotNull", "final", "String", "expression", ")", "{", "Contract", ".", "requireArgNotNull"...
Returns a list of nodes from a given document using xpath. @param rootNode Node to search. @param xPath XPath to use. @param expression XPath expression. @return Nodes or <code>null</code> if no match was found.
[ "Returns", "a", "list", "of", "nodes", "from", "a", "given", "document", "using", "xpath", "." ]
train
https://github.com/fuinorg/event-store-commons/blob/ea175582d8cda2b5a6d2fe52bbb2f1c183eee77c/eshttp/src/main/java/org/fuin/esc/eshttp/ESHttpUtils.java#L130-L141
sarl/sarl
main/coreplugins/io.sarl.lang/src/io/sarl/lang/util/Utils.java
Utils.getSARLLibraryVersionOnClasspath
@Deprecated public static String getSARLLibraryVersionOnClasspath(TypeReferences typeReferences, Notifier context) { """ Replies the version of the SARL library on the classpath. @param typeReferences - the accessor to the types. @param context - the context that is providing the access to the classpath. @re...
java
@Deprecated public static String getSARLLibraryVersionOnClasspath(TypeReferences typeReferences, Notifier context) { final OutParameter<String> version = new OutParameter<>(); final SarlLibraryErrorCode code = getSARLLibraryVersionOnClasspath(typeReferences, context, version); if (code == SarlLibraryErrorCode.SA...
[ "@", "Deprecated", "public", "static", "String", "getSARLLibraryVersionOnClasspath", "(", "TypeReferences", "typeReferences", ",", "Notifier", "context", ")", "{", "final", "OutParameter", "<", "String", ">", "version", "=", "new", "OutParameter", "<>", "(", ")", ...
Replies the version of the SARL library on the classpath. @param typeReferences - the accessor to the types. @param context - the context that is providing the access to the classpath. @return the version, or <code>null</code> if the SARL library cannot be found or is too old. @deprecated see {@link #getSARLLibraryVer...
[ "Replies", "the", "version", "of", "the", "SARL", "library", "on", "the", "classpath", "." ]
train
https://github.com/sarl/sarl/blob/ca00ff994598c730339972def4e19a60e0b8cace/main/coreplugins/io.sarl.lang/src/io/sarl/lang/util/Utils.java#L1135-L1143
virgo47/javasimon
core/src/main/java/org/javasimon/utils/bean/ClassUtils.java
ClassUtils.getGetter
static Method getGetter(Class<?> targetClass, String propertyName) { """ Get getter method for a specified property. @param targetClass class for which a getter will be returned @param propertyName name of the property for which a getter will be returned @return getter of a specified property if one exists, nul...
java
static Method getGetter(Class<?> targetClass, String propertyName) { if (targetClass == null) { return null; } final String getterName = getterName(propertyName, false); Method result = findPublicGetter(targetClass, getterName, propertyName, false); if (result == null) { final String booleanGetterName =...
[ "static", "Method", "getGetter", "(", "Class", "<", "?", ">", "targetClass", ",", "String", "propertyName", ")", "{", "if", "(", "targetClass", "==", "null", ")", "{", "return", "null", ";", "}", "final", "String", "getterName", "=", "getterName", "(", "...
Get getter method for a specified property. @param targetClass class for which a getter will be returned @param propertyName name of the property for which a getter will be returned @return getter of a specified property if one exists, null otherwise
[ "Get", "getter", "method", "for", "a", "specified", "property", "." ]
train
https://github.com/virgo47/javasimon/blob/17dfaa93cded9ce8ef64a134b28ccbf4d0284d2f/core/src/main/java/org/javasimon/utils/bean/ClassUtils.java#L128-L148
TimeAndSpaceIO/SmoothieMap
src/main/java/net/openhft/smoothie/SmoothieMap.java
SmoothieMap.getOrDefault
@Override public final V getOrDefault(Object key, V defaultValue) { """ Returns the value to which the specified key is mapped, or {@code defaultValue} if this map contains no mapping for the key. @param key the key whose associated value is to be returned @param defaultValue the default mapping of the ke...
java
@Override public final V getOrDefault(Object key, V defaultValue) { long hash, allocIndex; Segment<K, V> segment; return (allocIndex = (segment = segment(segmentIndex(hash = keyHashCode(key)))) .find(this, hash, key)) > 0 ? segment.readValue(allocIndex) : defa...
[ "@", "Override", "public", "final", "V", "getOrDefault", "(", "Object", "key", ",", "V", "defaultValue", ")", "{", "long", "hash", ",", "allocIndex", ";", "Segment", "<", "K", ",", "V", ">", "segment", ";", "return", "(", "allocIndex", "=", "(", "segme...
Returns the value to which the specified key is mapped, or {@code defaultValue} if this map contains no mapping for the key. @param key the key whose associated value is to be returned @param defaultValue the default mapping of the key @return the value to which the specified key is mapped, or {@code defaultValue} if ...
[ "Returns", "the", "value", "to", "which", "the", "specified", "key", "is", "mapped", "or", "{", "@code", "defaultValue", "}", "if", "this", "map", "contains", "no", "mapping", "for", "the", "key", "." ]
train
https://github.com/TimeAndSpaceIO/SmoothieMap/blob/c798f6cae1d377f6913e8821a1fcf5bf45ee0412/src/main/java/net/openhft/smoothie/SmoothieMap.java#L734-L741
gallandarakhneorg/afc
advanced/gis/gisbus/src/main/java/org/arakhne/afc/gis/bus/network/BusNetwork.java
BusNetwork.getNearestBusStop
@Pure public BusStop getNearestBusStop(double x, double y) { """ Replies the nearest bus stops to the given point. @param x x coordinate. @param y y coordinate. @return the nearest bus stop or <code>null</code> if none was found. """ double distance = Double.POSITIVE_INFINITY; BusStop bestStop = null...
java
@Pure public BusStop getNearestBusStop(double x, double y) { double distance = Double.POSITIVE_INFINITY; BusStop bestStop = null; double dist; for (final BusStop stop : this.validBusStops) { dist = stop.distance(x, y); if (dist < distance) { distance = dist; bestStop = stop; } } return b...
[ "@", "Pure", "public", "BusStop", "getNearestBusStop", "(", "double", "x", ",", "double", "y", ")", "{", "double", "distance", "=", "Double", ".", "POSITIVE_INFINITY", ";", "BusStop", "bestStop", "=", "null", ";", "double", "dist", ";", "for", "(", "final"...
Replies the nearest bus stops to the given point. @param x x coordinate. @param y y coordinate. @return the nearest bus stop or <code>null</code> if none was found.
[ "Replies", "the", "nearest", "bus", "stops", "to", "the", "given", "point", "." ]
train
https://github.com/gallandarakhneorg/afc/blob/0c7d2e1ddefd4167ef788416d970a6c1ef6f8bbb/advanced/gis/gisbus/src/main/java/org/arakhne/afc/gis/bus/network/BusNetwork.java#L1028-L1043
alkacon/opencms-core
src/org/opencms/xml/CmsXmlMessages.java
CmsXmlMessages.keyDefault
@Override public String keyDefault(String keyName, String defaultValue) { """ Returns the localized resource String from the configuration file, if not found or set from the resource bundle.<p> @see org.opencms.i18n.CmsMessages#keyDefault(java.lang.String, java.lang.String) """ if (hasConfigVal...
java
@Override public String keyDefault(String keyName, String defaultValue) { if (hasConfigValue(keyName)) { return getConfigValue(keyName); } return m_messages.keyDefault(keyName, defaultValue); }
[ "@", "Override", "public", "String", "keyDefault", "(", "String", "keyName", ",", "String", "defaultValue", ")", "{", "if", "(", "hasConfigValue", "(", "keyName", ")", ")", "{", "return", "getConfigValue", "(", "keyName", ")", ";", "}", "return", "m_messages...
Returns the localized resource String from the configuration file, if not found or set from the resource bundle.<p> @see org.opencms.i18n.CmsMessages#keyDefault(java.lang.String, java.lang.String)
[ "Returns", "the", "localized", "resource", "String", "from", "the", "configuration", "file", "if", "not", "found", "or", "set", "from", "the", "resource", "bundle", ".", "<p", ">" ]
train
https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/xml/CmsXmlMessages.java#L192-L199
tomgibara/bits
src/main/java/com/tomgibara/bits/BitVector.java
BitVector.resizedCopy
public BitVector resizedCopy(int newSize, boolean anchorLeft) { """ Creates a mutable copy of this {@link BitVector} that may have a different size. @param newSize the size of the returned {@link BitVector} @param anchorLeft true if the most-significant bit of this {@link BitVector} remains the most-signif...
java
public BitVector resizedCopy(int newSize, boolean anchorLeft) { if (newSize < 0) throw new IllegalArgumentException(); final int size = finish - start; if (newSize == size) return duplicate(true, true); int from; int to; if (anchorLeft) { from = size - newSize; to = size; } else { from = 0; to...
[ "public", "BitVector", "resizedCopy", "(", "int", "newSize", ",", "boolean", "anchorLeft", ")", "{", "if", "(", "newSize", "<", "0", ")", "throw", "new", "IllegalArgumentException", "(", ")", ";", "final", "int", "size", "=", "finish", "-", "start", ";", ...
Creates a mutable copy of this {@link BitVector} that may have a different size. @param newSize the size of the returned {@link BitVector} @param anchorLeft true if the most-significant bit of this {@link BitVector} remains the most-significant bit of the returned {@link BitVector}, false if the least-significant bit ...
[ "Creates", "a", "mutable", "copy", "of", "this", "{", "@link", "BitVector", "}", "that", "may", "have", "a", "different", "size", "." ]
train
https://github.com/tomgibara/bits/blob/56c32c0a30efd3d7c4e7c6600a0ca39e51eecc97/src/main/java/com/tomgibara/bits/BitVector.java#L941-L958
flow/caustic
api/src/main/java/com/flowpowered/caustic/api/Material.java
Material.addTexture
public void addTexture(int unit, Texture texture) { """ Adds a texture to the material. If a texture is a already present in the same unit as this one, it will be replaced. @param unit The unit to add the texture to @param texture The texture to add """ if (texture == null) { throw new ...
java
public void addTexture(int unit, Texture texture) { if (texture == null) { throw new IllegalStateException("Texture cannot be null"); } texture.checkCreated(); if (textures == null) { textures = new TIntObjectHashMap<>(); } textures.put(unit, textu...
[ "public", "void", "addTexture", "(", "int", "unit", ",", "Texture", "texture", ")", "{", "if", "(", "texture", "==", "null", ")", "{", "throw", "new", "IllegalStateException", "(", "\"Texture cannot be null\"", ")", ";", "}", "texture", ".", "checkCreated", ...
Adds a texture to the material. If a texture is a already present in the same unit as this one, it will be replaced. @param unit The unit to add the texture to @param texture The texture to add
[ "Adds", "a", "texture", "to", "the", "material", ".", "If", "a", "texture", "is", "a", "already", "present", "in", "the", "same", "unit", "as", "this", "one", "it", "will", "be", "replaced", "." ]
train
https://github.com/flow/caustic/blob/88652fcf0621ce158a0e92ce4c570ed6b1f6fca9/api/src/main/java/com/flowpowered/caustic/api/Material.java#L124-L133
authorjapps/zerocode
core/src/main/java/org/jsmart/zerocode/core/httpclient/BasicHttpClient.java
BasicHttpClient.handleUrlAndQueryParams
public String handleUrlAndQueryParams(String httpUrl, Map<String, Object> queryParams) throws IOException { """ If(optionally) query parameters was sent as a JSON in the request below, this gets available to this method for processing them with the url. <pre>{@code e.g. "url": "/api/v1/search/people" "request...
java
public String handleUrlAndQueryParams(String httpUrl, Map<String, Object> queryParams) throws IOException { if ((queryParams != null) && (!queryParams.isEmpty())) { httpUrl = setQueryParams(httpUrl, queryParams); } return httpUrl; }
[ "public", "String", "handleUrlAndQueryParams", "(", "String", "httpUrl", ",", "Map", "<", "String", ",", "Object", ">", "queryParams", ")", "throws", "IOException", "{", "if", "(", "(", "queryParams", "!=", "null", ")", "&&", "(", "!", "queryParams", ".", ...
If(optionally) query parameters was sent as a JSON in the request below, this gets available to this method for processing them with the url. <pre>{@code e.g. "url": "/api/v1/search/people" "request": { "queryParams": { "city":"Lon", "lang":"Awesome" } } }</pre> will resolve to effective url "/api/v1/search/people?city...
[ "If", "(", "optionally", ")", "query", "parameters", "was", "sent", "as", "a", "JSON", "in", "the", "request", "below", "this", "gets", "available", "to", "this", "method", "for", "processing", "them", "with", "the", "url", ".", "<pre", ">", "{", "@code"...
train
https://github.com/authorjapps/zerocode/blob/d66a3e8778d2eb5e4f0006bfcccfc0922ceb7cef/core/src/main/java/org/jsmart/zerocode/core/httpclient/BasicHttpClient.java#L220-L225
MindscapeHQ/raygun4java
core/src/main/java/com/mindscapehq/raygun4java/core/RaygunClientFactory.java
RaygunClientFactory.withData
public RaygunClientFactory withData(Object key, Object value) { """ This data will be added to every error sent @param key @param value @return factory """ factoryData.put(key, value); return this; }
java
public RaygunClientFactory withData(Object key, Object value) { factoryData.put(key, value); return this; }
[ "public", "RaygunClientFactory", "withData", "(", "Object", "key", ",", "Object", "value", ")", "{", "factoryData", ".", "put", "(", "key", ",", "value", ")", ";", "return", "this", ";", "}" ]
This data will be added to every error sent @param key @param value @return factory
[ "This", "data", "will", "be", "added", "to", "every", "error", "sent" ]
train
https://github.com/MindscapeHQ/raygun4java/blob/284a818446cfc6f0c2f83b5365514bc1bfc129b0/core/src/main/java/com/mindscapehq/raygun4java/core/RaygunClientFactory.java#L178-L181
couchbase/couchbase-java-client
src/main/java/com/couchbase/client/java/document/json/JsonObject.java
JsonObject.put
public JsonObject put(String name, Map<String, ?> value) { """ Attempt to convert a {@link Map} to a {@link JsonObject} value and store it, identified by the field name. @param name the name of the JSON field. @param value the value of the JSON field. @return the {@link JsonObject}. @see #from(Map) """ ...
java
public JsonObject put(String name, Map<String, ?> value) { return put(name, JsonObject.from(value)); }
[ "public", "JsonObject", "put", "(", "String", "name", ",", "Map", "<", "String", ",", "?", ">", "value", ")", "{", "return", "put", "(", "name", ",", "JsonObject", ".", "from", "(", "value", ")", ")", ";", "}" ]
Attempt to convert a {@link Map} to a {@link JsonObject} value and store it, identified by the field name. @param name the name of the JSON field. @param value the value of the JSON field. @return the {@link JsonObject}. @see #from(Map)
[ "Attempt", "to", "convert", "a", "{", "@link", "Map", "}", "to", "a", "{", "@link", "JsonObject", "}", "value", "and", "store", "it", "identified", "by", "the", "field", "name", "." ]
train
https://github.com/couchbase/couchbase-java-client/blob/f36a0ee0c66923bdde47838ca543e50cbaa99e14/src/main/java/com/couchbase/client/java/document/json/JsonObject.java#L723-L725
xdcrafts/flower
flower-tools/src/main/java/com/github/xdcrafts/flower/tools/ListApi.java
ListApi.getUnsafe
public static <T> T getUnsafe(final List list, final Class<T> clazz, final Integer... path) { """ Walks by list's nodes and extracts optional value of type T. @param <T> value type @param clazz type of value @param list subject @param path nodes to walk in map @return optional value of type T """ ...
java
public static <T> T getUnsafe(final List list, final Class<T> clazz, final Integer... path) { return get(list, clazz, path).orElseThrow(() -> new IllegalAccessError( "List " + list + " does not have value of type " + clazz.getName() + " by " ...
[ "public", "static", "<", "T", ">", "T", "getUnsafe", "(", "final", "List", "list", ",", "final", "Class", "<", "T", ">", "clazz", ",", "final", "Integer", "...", "path", ")", "{", "return", "get", "(", "list", ",", "clazz", ",", "path", ")", ".", ...
Walks by list's nodes and extracts optional value of type T. @param <T> value type @param clazz type of value @param list subject @param path nodes to walk in map @return optional value of type T
[ "Walks", "by", "list", "s", "nodes", "and", "extracts", "optional", "value", "of", "type", "T", "." ]
train
https://github.com/xdcrafts/flower/blob/96a8e49102fea434bd383a3c7852f0ee9545f999/flower-tools/src/main/java/com/github/xdcrafts/flower/tools/ListApi.java#L113-L122
sai-pullabhotla/catatumbo
src/main/java/com/jmethods/catatumbo/impl/Unmarshaller.java
Unmarshaller.unmarshalProperty
private void unmarshalProperty(PropertyMetadata propertyMetadata, Object target) throws Throwable { """ Unmarshals the property represented by the given property metadata and updates the target object with the property value. @param propertyMetadata the property metadata @param target the target objec...
java
private void unmarshalProperty(PropertyMetadata propertyMetadata, Object target) throws Throwable { unmarshalProperty(propertyMetadata, target, nativeEntity); }
[ "private", "void", "unmarshalProperty", "(", "PropertyMetadata", "propertyMetadata", ",", "Object", "target", ")", "throws", "Throwable", "{", "unmarshalProperty", "(", "propertyMetadata", ",", "target", ",", "nativeEntity", ")", ";", "}" ]
Unmarshals the property represented by the given property metadata and updates the target object with the property value. @param propertyMetadata the property metadata @param target the target object to update @throws Throwable propagated
[ "Unmarshals", "the", "property", "represented", "by", "the", "given", "property", "metadata", "and", "updates", "the", "target", "object", "with", "the", "property", "value", "." ]
train
https://github.com/sai-pullabhotla/catatumbo/blob/96d4c6dce3a5009624f7112a398406914dd19165/src/main/java/com/jmethods/catatumbo/impl/Unmarshaller.java#L309-L312
visallo/vertexium
cypher/src/main/java/org/vertexium/cypher/executor/ReturnClauseExecutor.java
ReturnClauseExecutor.expandResultMapSubItems
private Object expandResultMapSubItems(VertexiumCypherQueryContext ctx, Object value, ExpressionScope scope) { """ /* This method will expand return items such as RETURN coalesce(a.prop, b.prop) AS foo, b.prop AS bar, {y: count(b)} AS baz In the above example {y: count(b)} in the map this method will expa...
java
private Object expandResultMapSubItems(VertexiumCypherQueryContext ctx, Object value, ExpressionScope scope) { if (value instanceof Map) { Map<?, ?> map = (Map<?, ?>) value; Map<Object, Object> result = new LinkedHashMap<>(); for (Map.Entry<?, ?> entry : map.entrySet()) { ...
[ "private", "Object", "expandResultMapSubItems", "(", "VertexiumCypherQueryContext", "ctx", ",", "Object", "value", ",", "ExpressionScope", "scope", ")", "{", "if", "(", "value", "instanceof", "Map", ")", "{", "Map", "<", "?", ",", "?", ">", "map", "=", "(", ...
/* This method will expand return items such as RETURN coalesce(a.prop, b.prop) AS foo, b.prop AS bar, {y: count(b)} AS baz In the above example {y: count(b)} in the map this method will expand
[ "/", "*", "This", "method", "will", "expand", "return", "items", "such", "as" ]
train
https://github.com/visallo/vertexium/blob/bb132b5425ac168957667164e1409b78adbea769/cypher/src/main/java/org/vertexium/cypher/executor/ReturnClauseExecutor.java#L170-L187
albfernandez/itext2
src/main/java/com/lowagie/text/pdf/parser/PdfTextExtractor.java
PdfTextExtractor.getTextFromPage
public String getTextFromPage(int page) throws IOException { """ Gets the text from a page. @param page the page number of the page @return a String with the content as plain text (without PDF syntax) @throws IOException """ int totalPages = reader.getNumberOfPages(); if (totalPages < page) { ...
java
public String getTextFromPage(int page) throws IOException { int totalPages = reader.getNumberOfPages(); if (totalPages < page) { throw new IOException("indicated page does not exists, requested page " + page + " document pages " + totalPages); } if (page <= 0) { throw new IOExcept...
[ "public", "String", "getTextFromPage", "(", "int", "page", ")", "throws", "IOException", "{", "int", "totalPages", "=", "reader", ".", "getNumberOfPages", "(", ")", ";", "if", "(", "totalPages", "<", "page", ")", "{", "throw", "new", "IOException", "(", "\...
Gets the text from a page. @param page the page number of the page @return a String with the content as plain text (without PDF syntax) @throws IOException
[ "Gets", "the", "text", "from", "a", "page", "." ]
train
https://github.com/albfernandez/itext2/blob/438fc1899367fd13dfdfa8dfdca9a3c1a7783b84/src/main/java/com/lowagie/text/pdf/parser/PdfTextExtractor.java#L95-L110
deeplearning4j/deeplearning4j
nd4j/nd4j-backends/nd4j-api-parent/nd4j-api/src/main/java/org/nd4j/autodiff/samediff/ops/SDMath.java
SDMath.diagPart
public SDVariable diagPart(String name, SDVariable x) { """ Extract the diagonal part from the input array.<br> If input is<br> [ 1, 0, 0]<br> [ 0, 2, 0]<br> [ 0, 0, 3]<br> then output is [1, 2, 3].<br> Supports higher dimensions: in general, out[i,...,k] = in[i,...,k,i,...,k] @param x Input variable @re...
java
public SDVariable diagPart(String name, SDVariable x) { SDVariable ret = f().diagPart(x); return updateVariableNameAndReference(ret, name); }
[ "public", "SDVariable", "diagPart", "(", "String", "name", ",", "SDVariable", "x", ")", "{", "SDVariable", "ret", "=", "f", "(", ")", ".", "diagPart", "(", "x", ")", ";", "return", "updateVariableNameAndReference", "(", "ret", ",", "name", ")", ";", "}" ...
Extract the diagonal part from the input array.<br> If input is<br> [ 1, 0, 0]<br> [ 0, 2, 0]<br> [ 0, 0, 3]<br> then output is [1, 2, 3].<br> Supports higher dimensions: in general, out[i,...,k] = in[i,...,k,i,...,k] @param x Input variable @return Diagonal part of the input @see #diag(String, SDVariable)
[ "Extract", "the", "diagonal", "part", "from", "the", "input", "array", ".", "<br", ">", "If", "input", "is<br", ">", "[", "1", "0", "0", "]", "<br", ">", "[", "0", "2", "0", "]", "<br", ">", "[", "0", "0", "3", "]", "<br", ">", "then", "outpu...
train
https://github.com/deeplearning4j/deeplearning4j/blob/effce52f2afd7eeb53c5bcca699fcd90bd06822f/nd4j/nd4j-backends/nd4j-api-parent/nd4j-api/src/main/java/org/nd4j/autodiff/samediff/ops/SDMath.java#L824-L827
anotheria/moskito
moskito-core/src/main/java/net/anotheria/moskito/core/config/producers/MBeanProducerConfig.java
MBeanProducerConfig.isMBeanRequired
public boolean isMBeanRequired(final String domainName, final String className) { """ Checks is mbean with given domain and class required by this configuration. @param domainName name of mbean domain @param className class name of mbean @return true - configuration require to add this mbean as producer. f...
java
public boolean isMBeanRequired(final String domainName, final String className) { if(domains == null || domains.length == 0) return true; // No domain configuration set. All domains should pass for(MBeanProducerDomainConfig domainConfig : domains) if(domainConfig.getName(...
[ "public", "boolean", "isMBeanRequired", "(", "final", "String", "domainName", ",", "final", "String", "className", ")", "{", "if", "(", "domains", "==", "null", "||", "domains", ".", "length", "==", "0", ")", "return", "true", ";", "// No domain configuration ...
Checks is mbean with given domain and class required by this configuration. @param domainName name of mbean domain @param className class name of mbean @return true - configuration require to add this mbean as producer. false - mbean should be skipped.
[ "Checks", "is", "mbean", "with", "given", "domain", "and", "class", "required", "by", "this", "configuration", "." ]
train
https://github.com/anotheria/moskito/blob/0fdb79053b98a6ece610fa159f59bc3331e4cf05/moskito-core/src/main/java/net/anotheria/moskito/core/config/producers/MBeanProducerConfig.java#L69-L84
onelogin/onelogin-java-sdk
src/main/java/com/onelogin/sdk/conn/Client.java
Client.getUserRoles
public List<Integer> getUserRoles(long id) throws OAuthSystemException, OAuthProblemException, URISyntaxException { """ Gets a list of role IDs that have been assigned to a user. @param id Id of the user @return List of Role Ids @throws OAuthSystemException - if there is a IOException reading parameters ...
java
public List<Integer> getUserRoles(long id) throws OAuthSystemException, OAuthProblemException, URISyntaxException { cleanError(); prepareToken(); URIBuilder url = new URIBuilder(settings.getURL(Constants.GET_ROLES_FOR_USER_URL, Long.toString(id))); OneloginURLConnectionClient httpClient = new OneloginURLConne...
[ "public", "List", "<", "Integer", ">", "getUserRoles", "(", "long", "id", ")", "throws", "OAuthSystemException", ",", "OAuthProblemException", ",", "URISyntaxException", "{", "cleanError", "(", ")", ";", "prepareToken", "(", ")", ";", "URIBuilder", "url", "=", ...
Gets a list of role IDs that have been assigned to a user. @param id Id of the user @return List of Role Ids @throws OAuthSystemException - if there is a IOException reading parameters of the httpURLConnection @throws OAuthProblemException - if there are errors validating the OneloginOAuthJSONResourceResponse and th...
[ "Gets", "a", "list", "of", "role", "IDs", "that", "have", "been", "assigned", "to", "a", "user", "." ]
train
https://github.com/onelogin/onelogin-java-sdk/blob/1570b78033dcc1c7387099e77fe41b6b0638df8c/src/main/java/com/onelogin/sdk/conn/Client.java#L595-L618
trellis-ldp/trellis
core/http/src/main/java/org/trellisldp/http/TrellisHttpResource.java
TrellisHttpResource.setResource
@PUT @Timed public void setResource(@Suspended final AsyncResponse response, @Context final Request request, @Context final UriInfo uriInfo, @Context final HttpHeaders headers, @Context final SecurityContext secContext, final InputStream body) { """ Perform a PUT operation on a LDP ...
java
@PUT @Timed public void setResource(@Suspended final AsyncResponse response, @Context final Request request, @Context final UriInfo uriInfo, @Context final HttpHeaders headers, @Context final SecurityContext secContext, final InputStream body) { final TrellisRequest req = new Tre...
[ "@", "PUT", "@", "Timed", "public", "void", "setResource", "(", "@", "Suspended", "final", "AsyncResponse", "response", ",", "@", "Context", "final", "Request", "request", ",", "@", "Context", "final", "UriInfo", "uriInfo", ",", "@", "Context", "final", "Htt...
Perform a PUT operation on a LDP Resource. @param response the async response @param uriInfo the URI info @param secContext the security context @param headers the HTTP headers @param request the request @param body the body
[ "Perform", "a", "PUT", "operation", "on", "a", "LDP", "Resource", "." ]
train
https://github.com/trellis-ldp/trellis/blob/789fd7a3df86cab7ebba63e72bf4e58397e5f42d/core/http/src/main/java/org/trellisldp/http/TrellisHttpResource.java#L341-L355
xcesco/kripton
kripton-processor/src/main/java/com/abubusoft/kripton/processor/core/TypeAdapterHelper.java
TypeAdapterHelper.detectSourceType
public static String detectSourceType(SQLiteModelMethod method, TypeName adapterTypeName) { """ Give a param with type adapter, obtain type used to convert param """ TypeElement a = BaseProcessor.elementUtils.getTypeElement(adapterTypeName.toString()); for (Element i : BaseProcessor.elementUtils.getAllMemb...
java
public static String detectSourceType(SQLiteModelMethod method, TypeName adapterTypeName) { TypeElement a = BaseProcessor.elementUtils.getTypeElement(adapterTypeName.toString()); for (Element i : BaseProcessor.elementUtils.getAllMembers(a)) { if (i.getKind() == ElementKind.METHOD && "toJava".equals(i.getSimpleNa...
[ "public", "static", "String", "detectSourceType", "(", "SQLiteModelMethod", "method", ",", "TypeName", "adapterTypeName", ")", "{", "TypeElement", "a", "=", "BaseProcessor", ".", "elementUtils", ".", "getTypeElement", "(", "adapterTypeName", ".", "toString", "(", ")...
Give a param with type adapter, obtain type used to convert param
[ "Give", "a", "param", "with", "type", "adapter", "obtain", "type", "used", "to", "convert", "param" ]
train
https://github.com/xcesco/kripton/blob/90de2c0523d39b99e81b8d38aa996898762f594a/kripton-processor/src/main/java/com/abubusoft/kripton/processor/core/TypeAdapterHelper.java#L67-L78
padrig64/ValidationFramework
validationframework-core/src/main/java/com/google/code/validationframework/base/property/AbstractReadableMapProperty.java
AbstractReadableMapProperty.doNotifyListenersOfRemovedValues
protected void doNotifyListenersOfRemovedValues(Map<K, R> oldValues) { """ Notifies the change listeners that values have been removed. <p> Note that the specified map of values will be wrapped in an unmodifiable map before being passed to the listeners. @param oldValues Removed values. """ List<...
java
protected void doNotifyListenersOfRemovedValues(Map<K, R> oldValues) { List<MapValueChangeListener<K, R>> listenersCopy = new ArrayList<MapValueChangeListener<K, R>>(listeners); Map<K, R> unmodifiable = Collections.unmodifiableMap(oldValues); for (MapValueChangeListener<K, R> listener : listener...
[ "protected", "void", "doNotifyListenersOfRemovedValues", "(", "Map", "<", "K", ",", "R", ">", "oldValues", ")", "{", "List", "<", "MapValueChangeListener", "<", "K", ",", "R", ">", ">", "listenersCopy", "=", "new", "ArrayList", "<", "MapValueChangeListener", "...
Notifies the change listeners that values have been removed. <p> Note that the specified map of values will be wrapped in an unmodifiable map before being passed to the listeners. @param oldValues Removed values.
[ "Notifies", "the", "change", "listeners", "that", "values", "have", "been", "removed", ".", "<p", ">", "Note", "that", "the", "specified", "map", "of", "values", "will", "be", "wrapped", "in", "an", "unmodifiable", "map", "before", "being", "passed", "to", ...
train
https://github.com/padrig64/ValidationFramework/blob/2dd3c7b3403993db366d24a927645f467ccd1dda/validationframework-core/src/main/java/com/google/code/validationframework/base/property/AbstractReadableMapProperty.java#L125-L131
liferay/com-liferay-commerce
commerce-discount-service/src/main/java/com/liferay/commerce/discount/service/persistence/impl/CommerceDiscountPersistenceImpl.java
CommerceDiscountPersistenceImpl.findAll
@Override public List<CommerceDiscount> findAll() { """ Returns all the commerce discounts. @return the commerce discounts """ return findAll(QueryUtil.ALL_POS, QueryUtil.ALL_POS, null); }
java
@Override public List<CommerceDiscount> findAll() { return findAll(QueryUtil.ALL_POS, QueryUtil.ALL_POS, null); }
[ "@", "Override", "public", "List", "<", "CommerceDiscount", ">", "findAll", "(", ")", "{", "return", "findAll", "(", "QueryUtil", ".", "ALL_POS", ",", "QueryUtil", ".", "ALL_POS", ",", "null", ")", ";", "}" ]
Returns all the commerce discounts. @return the commerce discounts
[ "Returns", "all", "the", "commerce", "discounts", "." ]
train
https://github.com/liferay/com-liferay-commerce/blob/9e54362d7f59531fc684016ba49ee7cdc3a2f22b/commerce-discount-service/src/main/java/com/liferay/commerce/discount/service/persistence/impl/CommerceDiscountPersistenceImpl.java#L5155-L5158
allure-framework/allure1
allure-java-adaptor-api/src/main/java/ru/yandex/qatools/allure/utils/AllureResultsUtils.java
AllureResultsUtils.createResultsDirectory
private static File createResultsDirectory() { """ Create results directory. First step try to create {@link #CONFIG#getResultsDirectory()}, if cannot, try to create {@link ru.yandex.qatools.allure.config.AllureConfig#getDefaultResultsDirectory}, and if cannot, returns a new <code>File</code> instance by convert...
java
private static File createResultsDirectory() { File resultsDirectory = CONFIG.getResultsDirectory(); if (createDirectories(resultsDirectory)) { return resultsDirectory; } LOGGER.error(String.format( "Results directory <%s> doesn't exists and can't be created...
[ "private", "static", "File", "createResultsDirectory", "(", ")", "{", "File", "resultsDirectory", "=", "CONFIG", ".", "getResultsDirectory", "(", ")", ";", "if", "(", "createDirectories", "(", "resultsDirectory", ")", ")", "{", "return", "resultsDirectory", ";", ...
Create results directory. First step try to create {@link #CONFIG#getResultsDirectory()}, if cannot, try to create {@link ru.yandex.qatools.allure.config.AllureConfig#getDefaultResultsDirectory}, and if cannot, returns a new <code>File</code> instance by converting the "allure-results" pathname string into an abstract ...
[ "Create", "results", "directory", ".", "First", "step", "try", "to", "create", "{", "@link", "#CONFIG#getResultsDirectory", "()", "}", "if", "cannot", "try", "to", "create", "{", "@link", "ru", ".", "yandex", ".", "qatools", ".", "allure", ".", "config", "...
train
https://github.com/allure-framework/allure1/blob/9a816fa05d8b894a917b7ebb7fd1a4056dee4693/allure-java-adaptor-api/src/main/java/ru/yandex/qatools/allure/utils/AllureResultsUtils.java#L80-L107
bushidowallet/bushido-java-service
bushido-service-lib/src/main/java/com/bccapi/bitlib/StandardTransactionBuilder.java
StandardTransactionBuilder.estimateTransacrionSize
private static int estimateTransacrionSize(UnsignedTransaction unsigned) { """ Estimate transaction size by clearing all input scripts and adding 140 bytes for each input. (The type of scripts we generate are 138-140 bytes long). This allows us to give a good estimate of the final transaction size, and determin...
java
private static int estimateTransacrionSize(UnsignedTransaction unsigned) { // Create fake empty inputs TransactionInput[] inputs = new TransactionInput[unsigned._funding.length]; for (int i = 0; i < inputs.length; i++) { inputs[i] = new TransactionInput(unsigned._funding[i].outPoint, ScriptIn...
[ "private", "static", "int", "estimateTransacrionSize", "(", "UnsignedTransaction", "unsigned", ")", "{", "// Create fake empty inputs", "TransactionInput", "[", "]", "inputs", "=", "new", "TransactionInput", "[", "unsigned", ".", "_funding", ".", "length", "]", ";", ...
Estimate transaction size by clearing all input scripts and adding 140 bytes for each input. (The type of scripts we generate are 138-140 bytes long). This allows us to give a good estimate of the final transaction size, and determine whether out fee size is large enough. @param unsigned The unsigned transaction to es...
[ "Estimate", "transaction", "size", "by", "clearing", "all", "input", "scripts", "and", "adding", "140", "bytes", "for", "each", "input", ".", "(", "The", "type", "of", "scripts", "we", "generate", "are", "138", "-", "140", "bytes", "long", ")", ".", "Thi...
train
https://github.com/bushidowallet/bushido-java-service/blob/e1a0157527e57459b509718044d2df44084876a2/bushido-service-lib/src/main/java/com/bccapi/bitlib/StandardTransactionBuilder.java#L354-L369
micronaut-projects/micronaut-core
inject/src/main/java/io/micronaut/context/DefaultBeanContext.java
DefaultBeanContext.getBeanProvider
protected @Nonnull <T> Provider<T> getBeanProvider(@Nullable BeanResolutionContext resolutionContext, @Nonnull Class<T> beanType, @Nullable Qualifier<T> qualifier) { """ Get a bean provider. @param resolutionContext The bean resolution context @param beanType The bean type @param qualifier Th...
java
protected @Nonnull <T> Provider<T> getBeanProvider(@Nullable BeanResolutionContext resolutionContext, @Nonnull Class<T> beanType, @Nullable Qualifier<T> qualifier) { ArgumentUtils.requireNonNull("beanType", beanType); @SuppressWarnings("unchecked") BeanRegistration<T> beanRegistration = singletonObjects...
[ "protected", "@", "Nonnull", "<", "T", ">", "Provider", "<", "T", ">", "getBeanProvider", "(", "@", "Nullable", "BeanResolutionContext", "resolutionContext", ",", "@", "Nonnull", "Class", "<", "T", ">", "beanType", ",", "@", "Nullable", "Qualifier", "<", "T"...
Get a bean provider. @param resolutionContext The bean resolution context @param beanType The bean type @param qualifier The qualifier @param <T> The bean type parameter @return The bean provider
[ "Get", "a", "bean", "provider", "." ]
train
https://github.com/micronaut-projects/micronaut-core/blob/c31f5b03ce0eb88c2f6470710987db03b8967d5c/inject/src/main/java/io/micronaut/context/DefaultBeanContext.java#L1107-L1120
lightblueseas/swing-components
src/main/java/de/alpharogroup/swing/tree/model/AbstractGenericTreeNode.java
AbstractGenericTreeNode.addChildAt
@Override public void addChildAt(final int index, final ITreeNode<T> child) throws IndexOutOfBoundsException { """ Adds the child. @param index the index @param child the child @throws IndexOutOfBoundsException the index out of bounds exception """ if (children != null && children.size() < inde...
java
@Override public void addChildAt(final int index, final ITreeNode<T> child) throws IndexOutOfBoundsException { if (children != null && children.size() < index) { children.add(index, child); } else { addChild(child); } }
[ "@", "Override", "public", "void", "addChildAt", "(", "final", "int", "index", ",", "final", "ITreeNode", "<", "T", ">", "child", ")", "throws", "IndexOutOfBoundsException", "{", "if", "(", "children", "!=", "null", "&&", "children", ".", "size", "(", ")",...
Adds the child. @param index the index @param child the child @throws IndexOutOfBoundsException the index out of bounds exception
[ "Adds", "the", "child", "." ]
train
https://github.com/lightblueseas/swing-components/blob/4045e85cabd8f0ce985cbfff134c3c9873930c79/src/main/java/de/alpharogroup/swing/tree/model/AbstractGenericTreeNode.java#L96-L108
thinkaurelius/titan
titan-core/src/main/java/com/thinkaurelius/titan/diskstorage/locking/consistentkey/ConsistentKeyLocker.java
ConsistentKeyLocker.writeSingleLock
@Override protected ConsistentKeyLockStatus writeSingleLock(KeyColumn lockID, StoreTransaction txh) throws Throwable { """ Try to write a lock record remotely up to the configured number of times. If the store produces {@link TemporaryLockingException}, then we'll call mutate again to add a new column with ...
java
@Override protected ConsistentKeyLockStatus writeSingleLock(KeyColumn lockID, StoreTransaction txh) throws Throwable { final StaticBuffer lockKey = serializer.toLockKey(lockID.getKey(), lockID.getColumn()); StaticBuffer oldLockCol = null; for (int i = 0; i < lockRetryCount; i++) { ...
[ "@", "Override", "protected", "ConsistentKeyLockStatus", "writeSingleLock", "(", "KeyColumn", "lockID", ",", "StoreTransaction", "txh", ")", "throws", "Throwable", "{", "final", "StaticBuffer", "lockKey", "=", "serializer", ".", "toLockKey", "(", "lockID", ".", "get...
Try to write a lock record remotely up to the configured number of times. If the store produces {@link TemporaryLockingException}, then we'll call mutate again to add a new column with an updated timestamp and to delete the column that tried to write when the store threw an exception. We continue like that up to the re...
[ "Try", "to", "write", "a", "lock", "record", "remotely", "up", "to", "the", "configured", "number", "of", "times", ".", "If", "the", "store", "produces", "{", "@link", "TemporaryLockingException", "}", "then", "we", "ll", "call", "mutate", "again", "to", "...
train
https://github.com/thinkaurelius/titan/blob/ee226e52415b8bf43b700afac75fa5b9767993a5/titan-core/src/main/java/com/thinkaurelius/titan/diskstorage/locking/consistentkey/ConsistentKeyLocker.java#L307-L326
apache/flink
flink-runtime/src/main/java/org/apache/flink/runtime/jobgraph/JobGraph.java
JobGraph.addUserArtifact
public void addUserArtifact(String name, DistributedCache.DistributedCacheEntry file) { """ Adds the path of a custom file required to run the job on a task manager. @param name a name under which this artifact will be accessible through {@link DistributedCache} @param file path of a custom file required to ru...
java
public void addUserArtifact(String name, DistributedCache.DistributedCacheEntry file) { if (file == null) { throw new IllegalArgumentException(); } userArtifacts.putIfAbsent(name, file); }
[ "public", "void", "addUserArtifact", "(", "String", "name", ",", "DistributedCache", ".", "DistributedCacheEntry", "file", ")", "{", "if", "(", "file", "==", "null", ")", "{", "throw", "new", "IllegalArgumentException", "(", ")", ";", "}", "userArtifacts", "."...
Adds the path of a custom file required to run the job on a task manager. @param name a name under which this artifact will be accessible through {@link DistributedCache} @param file path of a custom file required to run the job on a task manager
[ "Adds", "the", "path", "of", "a", "custom", "file", "required", "to", "run", "the", "job", "on", "a", "task", "manager", "." ]
train
https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-runtime/src/main/java/org/apache/flink/runtime/jobgraph/JobGraph.java#L517-L523
TheCoder4eu/BootsFaces-OSP
src/main/java/net/bootsfaces/component/tree/model/TreeModelUtils.java
TreeModelUtils.searchNodeById
public static Node searchNodeById(Node rootNode, int nodeId) { """ Basic implementation of recursive node search by id It works only on a DefaultNodeImpl @param rootNode @param nodeId @return Node instance or null if there is no node with specific id """ if (rootNode.getNodeId() == nodeId) { ...
java
public static Node searchNodeById(Node rootNode, int nodeId) { if (rootNode.getNodeId() == nodeId) { return rootNode; } Node foundNode = null; for (Node n : rootNode.getChilds()) { foundNode = searchNodeById(n, nodeId); if (foundNode != null) { ...
[ "public", "static", "Node", "searchNodeById", "(", "Node", "rootNode", ",", "int", "nodeId", ")", "{", "if", "(", "rootNode", ".", "getNodeId", "(", ")", "==", "nodeId", ")", "{", "return", "rootNode", ";", "}", "Node", "foundNode", "=", "null", ";", "...
Basic implementation of recursive node search by id It works only on a DefaultNodeImpl @param rootNode @param nodeId @return Node instance or null if there is no node with specific id
[ "Basic", "implementation", "of", "recursive", "node", "search", "by", "id", "It", "works", "only", "on", "a", "DefaultNodeImpl" ]
train
https://github.com/TheCoder4eu/BootsFaces-OSP/blob/d1a70952bc240979b5272fa4fe1c7f100873add0/src/main/java/net/bootsfaces/component/tree/model/TreeModelUtils.java#L57-L69
reactor/reactor-netty
src/main/java/reactor/netty/tcp/TcpServer.java
TcpServer.doOnBound
public final TcpServer doOnBound(Consumer<? super DisposableServer> doOnBound) { """ Setups a callback called when {@link io.netty.channel.ServerChannel} is bound. @param doOnBound a consumer observing server started event @return a new {@link TcpServer} """ Objects.requireNonNull(doOnBound, "doOnBoun...
java
public final TcpServer doOnBound(Consumer<? super DisposableServer> doOnBound) { Objects.requireNonNull(doOnBound, "doOnBound"); return new TcpServerDoOn(this, null, doOnBound, null); }
[ "public", "final", "TcpServer", "doOnBound", "(", "Consumer", "<", "?", "super", "DisposableServer", ">", "doOnBound", ")", "{", "Objects", ".", "requireNonNull", "(", "doOnBound", ",", "\"doOnBound\"", ")", ";", "return", "new", "TcpServerDoOn", "(", "this", ...
Setups a callback called when {@link io.netty.channel.ServerChannel} is bound. @param doOnBound a consumer observing server started event @return a new {@link TcpServer}
[ "Setups", "a", "callback", "called", "when", "{", "@link", "io", ".", "netty", ".", "channel", ".", "ServerChannel", "}", "is", "bound", "." ]
train
https://github.com/reactor/reactor-netty/blob/4ed14316e1d7fca3cecd18d6caa5f2251e159e49/src/main/java/reactor/netty/tcp/TcpServer.java#L260-L263
vkostyukov/la4j
src/main/java/org/la4j/Matrix.java
Matrix.updateColumn
public void updateColumn(int j, VectorFunction function) { """ Updates all elements of the specified column in this matrix by applying given {@code function}. @param j the column index @param function the vector function """ VectorIterator it = iteratorOfColumn(j); while (it.hasNext()) { ...
java
public void updateColumn(int j, VectorFunction function) { VectorIterator it = iteratorOfColumn(j); while (it.hasNext()) { double x = it.next(); int i = it.index(); it.set(function.evaluate(i, x)); } }
[ "public", "void", "updateColumn", "(", "int", "j", ",", "VectorFunction", "function", ")", "{", "VectorIterator", "it", "=", "iteratorOfColumn", "(", "j", ")", ";", "while", "(", "it", ".", "hasNext", "(", ")", ")", "{", "double", "x", "=", "it", ".", ...
Updates all elements of the specified column in this matrix by applying given {@code function}. @param j the column index @param function the vector function
[ "Updates", "all", "elements", "of", "the", "specified", "column", "in", "this", "matrix", "by", "applying", "given", "{", "@code", "function", "}", "." ]
train
https://github.com/vkostyukov/la4j/blob/dd1b917caf9606399a49afa6b0d738934cd3a7b3/src/main/java/org/la4j/Matrix.java#L1586-L1594
Stratio/stratio-cassandra
src/java/com/stratio/cassandra/index/query/Search.java
Search.toJson
public String toJson() { """ Returns the JSON representation of this object. @return the JSON representation of this object. """ try { return JsonSerializer.toString(this); } catch (Exception e) { String message = String.format("Unformateable JSON search: %s", e.getMe...
java
public String toJson() { try { return JsonSerializer.toString(this); } catch (Exception e) { String message = String.format("Unformateable JSON search: %s", e.getMessage()); Log.error(e, message); throw new IllegalArgumentException(message, e); } ...
[ "public", "String", "toJson", "(", ")", "{", "try", "{", "return", "JsonSerializer", ".", "toString", "(", "this", ")", ";", "}", "catch", "(", "Exception", "e", ")", "{", "String", "message", "=", "String", ".", "format", "(", "\"Unformateable JSON search...
Returns the JSON representation of this object. @return the JSON representation of this object.
[ "Returns", "the", "JSON", "representation", "of", "this", "object", "." ]
train
https://github.com/Stratio/stratio-cassandra/blob/f6416b43ad5309083349ad56266450fa8c6a2106/src/java/com/stratio/cassandra/index/query/Search.java#L88-L96
mikepenz/FastAdapter
library/src/main/java/com/mikepenz/fastadapter/commons/utils/FastAdapterDiffUtil.java
FastAdapterDiffUtil.calculateDiff
public static <A extends ModelAdapter<Model, Item>, Model, Item extends IItem> DiffUtil.DiffResult calculateDiff(final A adapter, final List<Item> items, final DiffCallback<Item> callback, final boolean detectMoves) { """ This method will compute a {@link androidx.recyclerview.widget.DiffUtil.DiffResult} based on ...
java
public static <A extends ModelAdapter<Model, Item>, Model, Item extends IItem> DiffUtil.DiffResult calculateDiff(final A adapter, final List<Item> items, final DiffCallback<Item> callback, final boolean detectMoves) { if (adapter.isUseIdDistributor()) { adapter.getIdDistributor().checkIds(items); ...
[ "public", "static", "<", "A", "extends", "ModelAdapter", "<", "Model", ",", "Item", ">", ",", "Model", ",", "Item", "extends", "IItem", ">", "DiffUtil", ".", "DiffResult", "calculateDiff", "(", "final", "A", "adapter", ",", "final", "List", "<", "Item", ...
This method will compute a {@link androidx.recyclerview.widget.DiffUtil.DiffResult} based on the given adapter, and the list of new items. <p> It automatically collapses all expandables (if enabled) as they are not supported by the diff util, pre sort the items based on the comparator if available, map the new item typ...
[ "This", "method", "will", "compute", "a", "{", "@link", "androidx", ".", "recyclerview", ".", "widget", ".", "DiffUtil", ".", "DiffResult", "}", "based", "on", "the", "given", "adapter", "and", "the", "list", "of", "new", "items", ".", "<p", ">", "It", ...
train
https://github.com/mikepenz/FastAdapter/blob/3b2412abe001ba58422e0125846b704d4dba4ae9/library/src/main/java/com/mikepenz/fastadapter/commons/utils/FastAdapterDiffUtil.java#L43-L78
groundupworks/wings
wings-facebook/src/main/java/com/groundupworks/wings/facebook/FacebookSettings.java
FacebookSettings.newInstance
static FacebookSettings newInstance(Bundle bundle) { """ Creates a new {@link FacebookSettings} instance from a {@link Bundle} created by the {@link #toBundle()} method. @param bundle the {@link Bundle}. @return a new {@link FacebookSettings} instance; or null if the {@link Bundle} is invalid. """ ...
java
static FacebookSettings newInstance(Bundle bundle) { FacebookSettings settings = null; int destinationId = bundle.getInt(BUNDLE_KEY_DESTINATION_ID); String accountName = bundle.getString(BUNDLE_KEY_ACCOUNT_NAME); String albumName = bundle.getString(BUNDLE_KEY_ALBUM_NAME); String...
[ "static", "FacebookSettings", "newInstance", "(", "Bundle", "bundle", ")", "{", "FacebookSettings", "settings", "=", "null", ";", "int", "destinationId", "=", "bundle", ".", "getInt", "(", "BUNDLE_KEY_DESTINATION_ID", ")", ";", "String", "accountName", "=", "bundl...
Creates a new {@link FacebookSettings} instance from a {@link Bundle} created by the {@link #toBundle()} method. @param bundle the {@link Bundle}. @return a new {@link FacebookSettings} instance; or null if the {@link Bundle} is invalid.
[ "Creates", "a", "new", "{", "@link", "FacebookSettings", "}", "instance", "from", "a", "{", "@link", "Bundle", "}", "created", "by", "the", "{", "@link", "#toBundle", "()", "}", "method", "." ]
train
https://github.com/groundupworks/wings/blob/03d2827c30ef55f2db4e23f7500e016c7771fa39/wings-facebook/src/main/java/com/groundupworks/wings/facebook/FacebookSettings.java#L117-L137
lucee/Lucee
core/src/main/java/lucee/runtime/type/util/ListUtil.java
ListUtil.listToArray
public static Array listToArray(String list, char delimiter) { """ casts a list to Array object @param list list to cast @param delimiter delimter of the list @return Array Object """ if (list.length() == 0) return new ArrayImpl(); int len = list.length(); int last = 0; Array array = new ArrayImpl();...
java
public static Array listToArray(String list, char delimiter) { if (list.length() == 0) return new ArrayImpl(); int len = list.length(); int last = 0; Array array = new ArrayImpl(); try { for (int i = 0; i < len; i++) { if (list.charAt(i) == delimiter) { array.append(list.substring(last, i)); la...
[ "public", "static", "Array", "listToArray", "(", "String", "list", ",", "char", "delimiter", ")", "{", "if", "(", "list", ".", "length", "(", ")", "==", "0", ")", "return", "new", "ArrayImpl", "(", ")", ";", "int", "len", "=", "list", ".", "length", ...
casts a list to Array object @param list list to cast @param delimiter delimter of the list @return Array Object
[ "casts", "a", "list", "to", "Array", "object" ]
train
https://github.com/lucee/Lucee/blob/29b153fc4e126e5edb97da937f2ee2e231b87593/core/src/main/java/lucee/runtime/type/util/ListUtil.java#L164-L181
XDean/Java-EX
src/main/java/xdean/jex/util/reflect/TypeUtil.java
TypeUtil.isAssignableFrom
public static boolean isAssignableFrom(Type from, Class<?> to) { """ Determine if a 'from' type object can assign to 'to' type.<br> If the to class is primitive type, see {@link Class#isAssignableFrom(Class)} @see Class#isAssignableFrom(Class) @param from @param to @return """ return TypeVisitor.of...
java
public static boolean isAssignableFrom(Type from, Class<?> to) { return TypeVisitor.of(from, b -> b .onClass(to::isAssignableFrom) .onParameterizedType(pt -> TypeVisitor.of(pt.getRawType(), bb -> bb .onClass(to::isAssignableFrom) .result())) .onTypeVariable(tv -...
[ "public", "static", "boolean", "isAssignableFrom", "(", "Type", "from", ",", "Class", "<", "?", ">", "to", ")", "{", "return", "TypeVisitor", ".", "of", "(", "from", ",", "b", "->", "b", ".", "onClass", "(", "to", "::", "isAssignableFrom", ")", ".", ...
Determine if a 'from' type object can assign to 'to' type.<br> If the to class is primitive type, see {@link Class#isAssignableFrom(Class)} @see Class#isAssignableFrom(Class) @param from @param to @return
[ "Determine", "if", "a", "from", "type", "object", "can", "assign", "to", "to", "type", ".", "<br", ">", "If", "the", "to", "class", "is", "primitive", "type", "see", "{", "@link", "Class#isAssignableFrom", "(", "Class", ")", "}" ]
train
https://github.com/XDean/Java-EX/blob/9208ba71c5b2af9f9bd979d01fab2ff5e433b3e7/src/main/java/xdean/jex/util/reflect/TypeUtil.java#L16-L25
jbundle/jbundle
base/base/src/main/java/org/jbundle/base/db/util/ResourceTable.java
ResourceTable.restoreMainRecord
public void restoreMainRecord(Record record, boolean altMatchesToNull) { """ Restore the unchangeable info from the buffer to this main record. @param record The main record @param altMatchesToNull If the alternate field is the same as the main field, set it to null (no change). """ Iterator<BaseTabl...
java
public void restoreMainRecord(Record record, boolean altMatchesToNull) { Iterator<BaseTable> iterator = this.getTables(); while (iterator.hasNext()) { BaseTable table = iterator.next(); if ((table != null) && (table != this.getNextTable())) { ...
[ "public", "void", "restoreMainRecord", "(", "Record", "record", ",", "boolean", "altMatchesToNull", ")", "{", "Iterator", "<", "BaseTable", ">", "iterator", "=", "this", ".", "getTables", "(", ")", ";", "while", "(", "iterator", ".", "hasNext", "(", ")", "...
Restore the unchangeable info from the buffer to this main record. @param record The main record @param altMatchesToNull If the alternate field is the same as the main field, set it to null (no change).
[ "Restore", "the", "unchangeable", "info", "from", "the", "buffer", "to", "this", "main", "record", "." ]
train
https://github.com/jbundle/jbundle/blob/4037fcfa85f60c7d0096c453c1a3cd573c2b0abc/base/base/src/main/java/org/jbundle/base/db/util/ResourceTable.java#L175-L187
duracloud/duracloud
durastore/src/main/java/org/duracloud/durastore/rest/SpaceResource.java
SpaceResource.deleteSpace
public void deleteSpace(String spaceID, String storeID) throws ResourceException { """ Deletes a space, removing all included content. @param spaceID @param storeID """ try { StorageProvider storage = storageProviderFactory.getStorageProvider(storeID); storage.deleteSpace(sp...
java
public void deleteSpace(String spaceID, String storeID) throws ResourceException { try { StorageProvider storage = storageProviderFactory.getStorageProvider(storeID); storage.deleteSpace(spaceID); } catch (NotFoundException e) { throw new ResourceNotFoundException("de...
[ "public", "void", "deleteSpace", "(", "String", "spaceID", ",", "String", "storeID", ")", "throws", "ResourceException", "{", "try", "{", "StorageProvider", "storage", "=", "storageProviderFactory", ".", "getStorageProvider", "(", "storeID", ")", ";", "storage", "...
Deletes a space, removing all included content. @param spaceID @param storeID
[ "Deletes", "a", "space", "removing", "all", "included", "content", "." ]
train
https://github.com/duracloud/duracloud/blob/dc4f3a1716d43543cc3b2e1880605f9389849b66/durastore/src/main/java/org/duracloud/durastore/rest/SpaceResource.java#L245-L255
osiegmar/logback-gelf
src/main/java/de/siegmar/logbackgelf/SimpleJsonEncoder.java
SimpleJsonEncoder.appendToJSONUnquoted
SimpleJsonEncoder appendToJSONUnquoted(final String key, final Object value) { """ Append field with quotes and escape characters added in the key, if required. The value is added without quotes and any escape characters. @return this """ if (closed) { throw new IllegalStateException("E...
java
SimpleJsonEncoder appendToJSONUnquoted(final String key, final Object value) { if (closed) { throw new IllegalStateException("Encoder already closed"); } if (value != null) { appendKey(key); sb.append(value); } return this; }
[ "SimpleJsonEncoder", "appendToJSONUnquoted", "(", "final", "String", "key", ",", "final", "Object", "value", ")", "{", "if", "(", "closed", ")", "{", "throw", "new", "IllegalStateException", "(", "\"Encoder already closed\"", ")", ";", "}", "if", "(", "value", ...
Append field with quotes and escape characters added in the key, if required. The value is added without quotes and any escape characters. @return this
[ "Append", "field", "with", "quotes", "and", "escape", "characters", "added", "in", "the", "key", "if", "required", ".", "The", "value", "is", "added", "without", "quotes", "and", "any", "escape", "characters", "." ]
train
https://github.com/osiegmar/logback-gelf/blob/35c41eda363db803c8c4570f31d518451e9a879b/src/main/java/de/siegmar/logbackgelf/SimpleJsonEncoder.java#L74-L83
netplex/json-smart-v2
json-smart/src/main/java/net/minidev/json/JSONValue.java
JSONValue.compress
public static String compress(String input, JSONStyle style) { """ Reformat Json input keeping element order @since 1.0.6.2 need to be rewrite in 2.0 """ try { StringBuilder sb = new StringBuilder(); new JSONParser(DEFAULT_PERMISSIVE_MODE).parse(input, new CompessorMapper(defaultReader, sb, style...
java
public static String compress(String input, JSONStyle style) { try { StringBuilder sb = new StringBuilder(); new JSONParser(DEFAULT_PERMISSIVE_MODE).parse(input, new CompessorMapper(defaultReader, sb, style)); return sb.toString(); } catch (Exception e) { return input; } }
[ "public", "static", "String", "compress", "(", "String", "input", ",", "JSONStyle", "style", ")", "{", "try", "{", "StringBuilder", "sb", "=", "new", "StringBuilder", "(", ")", ";", "new", "JSONParser", "(", "DEFAULT_PERMISSIVE_MODE", ")", ".", "parse", "(",...
Reformat Json input keeping element order @since 1.0.6.2 need to be rewrite in 2.0
[ "Reformat", "Json", "input", "keeping", "element", "order" ]
train
https://github.com/netplex/json-smart-v2/blob/bfb3daef039e22a7bbff5f76bf14ea23330cd70e/json-smart/src/main/java/net/minidev/json/JSONValue.java#L340-L348
voldemort/voldemort
src/java/voldemort/rest/coordinator/config/ClientConfigUtil.java
ClientConfigUtil.readMultipleClientConfigAvro
@SuppressWarnings("unchecked") public static Map<String, Properties> readMultipleClientConfigAvro(String configAvro) { """ Parses a string that contains multiple fat client configs in avro format @param configAvro Input string of avro format, that contains config for multiple stores @return Map of store n...
java
@SuppressWarnings("unchecked") public static Map<String, Properties> readMultipleClientConfigAvro(String configAvro) { Map<String, Properties> mapStoreToProps = Maps.newHashMap(); try { JsonDecoder decoder = new JsonDecoder(CLIENT_CONFIGS_AVRO_SCHEMA, configAvro); GenericDatu...
[ "@", "SuppressWarnings", "(", "\"unchecked\"", ")", "public", "static", "Map", "<", "String", ",", "Properties", ">", "readMultipleClientConfigAvro", "(", "String", "configAvro", ")", "{", "Map", "<", "String", ",", "Properties", ">", "mapStoreToProps", "=", "Ma...
Parses a string that contains multiple fat client configs in avro format @param configAvro Input string of avro format, that contains config for multiple stores @return Map of store names to store config properties
[ "Parses", "a", "string", "that", "contains", "multiple", "fat", "client", "configs", "in", "avro", "format" ]
train
https://github.com/voldemort/voldemort/blob/a7dbdea58032021361680faacf2782cf981c5332/src/java/voldemort/rest/coordinator/config/ClientConfigUtil.java#L57-L85
square/okio
samples/src/main/java/okio/samples/SocksProxyServer.java
SocksProxyServer.transfer
private void transfer(Socket sourceSocket, Source source, Sink sink) { """ Read data from {@code source} and write it to {@code sink}. This doesn't use {@link BufferedSink#writeAll} because that method doesn't flush aggressively and we need that. """ try { Buffer buffer = new Buffer(); for (lo...
java
private void transfer(Socket sourceSocket, Source source, Sink sink) { try { Buffer buffer = new Buffer(); for (long byteCount; (byteCount = source.read(buffer, 8192L)) != -1; ) { sink.write(buffer, byteCount); sink.flush(); } } catch (IOException e) { System.out.println(...
[ "private", "void", "transfer", "(", "Socket", "sourceSocket", ",", "Source", "source", ",", "Sink", "sink", ")", "{", "try", "{", "Buffer", "buffer", "=", "new", "Buffer", "(", ")", ";", "for", "(", "long", "byteCount", ";", "(", "byteCount", "=", "sou...
Read data from {@code source} and write it to {@code sink}. This doesn't use {@link BufferedSink#writeAll} because that method doesn't flush aggressively and we need that.
[ "Read", "data", "from", "{" ]
train
https://github.com/square/okio/blob/3e5824816a27434ebc1db5f3b7e45eb853e1d7da/samples/src/main/java/okio/samples/SocksProxyServer.java#L161-L176