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
phax/ph-commons
ph-security/src/main/java/com/helger/security/password/hash/PasswordHashCreatorBCrypt.java
PasswordHashCreatorBCrypt.createPasswordHash
@Nonnull public String createPasswordHash (@Nonnull final IPasswordSalt aSalt, @Nonnull final String sPlainTextPassword) { """ {@inheritDoc} The password salt must be of type {@link PasswordSaltBCrypt}. """ ValueEnforcer.notNull (aSalt, "Salt"); ValueEnforcer.isInstanceOf (aSalt, PasswordSaltBCrypt.c...
java
@Nonnull public String createPasswordHash (@Nonnull final IPasswordSalt aSalt, @Nonnull final String sPlainTextPassword) { ValueEnforcer.notNull (aSalt, "Salt"); ValueEnforcer.isInstanceOf (aSalt, PasswordSaltBCrypt.class, "Salt"); ValueEnforcer.notNull (sPlainTextPassword, "PlainTextPassword"); re...
[ "@", "Nonnull", "public", "String", "createPasswordHash", "(", "@", "Nonnull", "final", "IPasswordSalt", "aSalt", ",", "@", "Nonnull", "final", "String", "sPlainTextPassword", ")", "{", "ValueEnforcer", ".", "notNull", "(", "aSalt", ",", "\"Salt\"", ")", ";", ...
{@inheritDoc} The password salt must be of type {@link PasswordSaltBCrypt}.
[ "{" ]
train
https://github.com/phax/ph-commons/blob/d28c03565f44a0b804d96028d0969f9bb38c4313/ph-security/src/main/java/com/helger/security/password/hash/PasswordHashCreatorBCrypt.java#L49-L57
jmrozanec/cron-utils
src/main/java/com/cronutils/descriptor/DescriptionStrategyFactory.java
DescriptionStrategyFactory.daysOfWeekInstance
public static DescriptionStrategy daysOfWeekInstance(final ResourceBundle bundle, final FieldExpression expression, final FieldDefinition definition) { """ Creates description strategy for days of week. @param bundle - locale @param expression - CronFieldExpression @return - DescriptionStrategy instance, ...
java
public static DescriptionStrategy daysOfWeekInstance(final ResourceBundle bundle, final FieldExpression expression, final FieldDefinition definition) { final Function<Integer, String> nominal = integer -> { final int diff = definition instanceof DayOfWeekFieldDefinition ? DayOfW...
[ "public", "static", "DescriptionStrategy", "daysOfWeekInstance", "(", "final", "ResourceBundle", "bundle", ",", "final", "FieldExpression", "expression", ",", "final", "FieldDefinition", "definition", ")", "{", "final", "Function", "<", "Integer", ",", "String", ">", ...
Creates description strategy for days of week. @param bundle - locale @param expression - CronFieldExpression @return - DescriptionStrategy instance, never null
[ "Creates", "description", "strategy", "for", "days", "of", "week", "." ]
train
https://github.com/jmrozanec/cron-utils/blob/adac5ec8fd9160b082f9762a6eedea0715731170/src/main/java/com/cronutils/descriptor/DescriptionStrategyFactory.java#L39-L65
czyzby/gdx-lml
lml-uedi/src/main/java/com/github/czyzby/lml/uedi/i18n/LocalePreference.java
LocalePreference.fromString
public static Locale fromString(final String locale) { """ A safe, cross-platform way of converting serialized locale string to {@link Locale} instance. Matches {@link #toString(Locale)} serialization implementation. @param locale locale converted to string. @return {@link Locale} stored the deserialized data...
java
public static Locale fromString(final String locale) { final String[] data = Strings.split(locale, '_'); if (data.length == 1) { return new Locale(data[0]); } else if (data.length == 2) { return new Locale(data[0], data[1]); } else if (data.length == 3) { ...
[ "public", "static", "Locale", "fromString", "(", "final", "String", "locale", ")", "{", "final", "String", "[", "]", "data", "=", "Strings", ".", "split", "(", "locale", ",", "'", "'", ")", ";", "if", "(", "data", ".", "length", "==", "1", ")", "{"...
A safe, cross-platform way of converting serialized locale string to {@link Locale} instance. Matches {@link #toString(Locale)} serialization implementation. @param locale locale converted to string. @return {@link Locale} stored the deserialized data.
[ "A", "safe", "cross", "-", "platform", "way", "of", "converting", "serialized", "locale", "string", "to", "{", "@link", "Locale", "}", "instance", ".", "Matches", "{", "@link", "#toString", "(", "Locale", ")", "}", "serialization", "implementation", "." ]
train
https://github.com/czyzby/gdx-lml/blob/7623b322e6afe49ad4dd636c80c230150a1cfa4e/lml-uedi/src/main/java/com/github/czyzby/lml/uedi/i18n/LocalePreference.java#L83-L93
linkedin/dexmaker
dexmaker/src/main/java/com/android/dx/Code.java
Code.newArray
public <T> void newArray(Local<T> target, Local<Integer> length) { """ Assigns {@code target} to a newly allocated array of length {@code length}. The array's type is the same as {@code target}'s type. """ addInstruction(new ThrowingCstInsn(Rops.opNewArray(target.type.ropType), sourcePosition, ...
java
public <T> void newArray(Local<T> target, Local<Integer> length) { addInstruction(new ThrowingCstInsn(Rops.opNewArray(target.type.ropType), sourcePosition, RegisterSpecList.make(length.spec()), catches, target.type.constant)); moveResult(target, true); }
[ "public", "<", "T", ">", "void", "newArray", "(", "Local", "<", "T", ">", "target", ",", "Local", "<", "Integer", ">", "length", ")", "{", "addInstruction", "(", "new", "ThrowingCstInsn", "(", "Rops", ".", "opNewArray", "(", "target", ".", "type", ".",...
Assigns {@code target} to a newly allocated array of length {@code length}. The array's type is the same as {@code target}'s type.
[ "Assigns", "{" ]
train
https://github.com/linkedin/dexmaker/blob/c58ffebcbb2564c7d1fa6fb58b48f351c330296d/dexmaker/src/main/java/com/android/dx/Code.java#L794-L798
kiegroup/jbpm
jbpm-bpmn2-emfextmodel/src/main/java/org/jboss/drools/util/DroolsSwitch.java
DroolsSwitch.doSwitch
protected T doSwitch(EClass theEClass, EObject theEObject) { """ Calls <code>caseXXX</code> for each class of the model until one returns a non null result; it yields that result. <!-- begin-user-doc --> <!-- end-user-doc --> @return the first non-null result returned by a <code>caseXXX</code> call. @generated...
java
protected T doSwitch(EClass theEClass, EObject theEObject) { if (theEClass.eContainer() == modelPackage) { return doSwitch(theEClass.getClassifierID(), theEObject); } else { List<EClass> eSuperTypes = theEClass.getESuperTypes(); return eSuperTypes.isEmpty() ? defaultCase(theEObject) : doSwi...
[ "protected", "T", "doSwitch", "(", "EClass", "theEClass", ",", "EObject", "theEObject", ")", "{", "if", "(", "theEClass", ".", "eContainer", "(", ")", "==", "modelPackage", ")", "{", "return", "doSwitch", "(", "theEClass", ".", "getClassifierID", "(", ")", ...
Calls <code>caseXXX</code> for each class of the model until one returns a non null result; it yields that result. <!-- begin-user-doc --> <!-- end-user-doc --> @return the first non-null result returned by a <code>caseXXX</code> call. @generated
[ "Calls", "<code", ">", "caseXXX<", "/", "code", ">", "for", "each", "class", "of", "the", "model", "until", "one", "returns", "a", "non", "null", "result", ";", "it", "yields", "that", "result", ".", "<!", "--", "begin", "-", "user", "-", "doc", "--"...
train
https://github.com/kiegroup/jbpm/blob/c3473c728aa382ebbea01e380c5e754a96647b82/jbpm-bpmn2-emfextmodel/src/main/java/org/jboss/drools/util/DroolsSwitch.java#L80-L91
apache/incubator-gobblin
gobblin-data-management/src/main/java/org/apache/gobblin/data/management/copy/hive/HiveDataset.java
HiveDataset.getFileSetIterator
@Override public Iterator<FileSet<CopyEntity>> getFileSetIterator(FileSystem targetFs, CopyConfiguration configuration, Comparator<FileSet<CopyEntity>> prioritizer, PushDownRequestor<FileSet<CopyEntity>> requestor) throws IOException { """ Finds all files read by the table and generates CopyableFiles...
java
@Override public Iterator<FileSet<CopyEntity>> getFileSetIterator(FileSystem targetFs, CopyConfiguration configuration, Comparator<FileSet<CopyEntity>> prioritizer, PushDownRequestor<FileSet<CopyEntity>> requestor) throws IOException { if (!canCopyTable()) { return Iterators.emptyIterator(); ...
[ "@", "Override", "public", "Iterator", "<", "FileSet", "<", "CopyEntity", ">", ">", "getFileSetIterator", "(", "FileSystem", "targetFs", ",", "CopyConfiguration", "configuration", ",", "Comparator", "<", "FileSet", "<", "CopyEntity", ">", ">", "prioritizer", ",", ...
Finds all files read by the table and generates CopyableFiles. For the specific semantics see {@link HiveCopyEntityHelper#getCopyEntities}.
[ "Finds", "all", "files", "read", "by", "the", "table", "and", "generates", "CopyableFiles", ".", "For", "the", "specific", "semantics", "see", "{" ]
train
https://github.com/apache/incubator-gobblin/blob/f029b4c0fea0fe4aa62f36dda2512344ff708bae/gobblin-data-management/src/main/java/org/apache/gobblin/data/management/copy/hive/HiveDataset.java#L158-L174
GerdHolz/TOVAL
src/de/invation/code/toval/graphic/diagrams/models/ScatterChartModel.java
ScatterChartModel.getValue
@Override public Number getValue(ValueDimension dim, int index) { """ Returns the value with the given index of the given dimension. @param dim Reference dimension for value extraction @param index Index of the desired value @return Value with the given index of the given dimension """ return values.ge...
java
@Override public Number getValue(ValueDimension dim, int index) { return values.get(dim).get(index); }
[ "@", "Override", "public", "Number", "getValue", "(", "ValueDimension", "dim", ",", "int", "index", ")", "{", "return", "values", ".", "get", "(", "dim", ")", ".", "get", "(", "index", ")", ";", "}" ]
Returns the value with the given index of the given dimension. @param dim Reference dimension for value extraction @param index Index of the desired value @return Value with the given index of the given dimension
[ "Returns", "the", "value", "with", "the", "given", "index", "of", "the", "given", "dimension", "." ]
train
https://github.com/GerdHolz/TOVAL/blob/036922cdfd710fa53b18e5dbe1e07f226f731fde/src/de/invation/code/toval/graphic/diagrams/models/ScatterChartModel.java#L72-L75
spotbugs/spotbugs
spotbugs/src/main/java/edu/umd/cs/findbugs/xml/XMLOutputUtil.java
XMLOutputUtil.writeFileList
public static void writeFileList(XMLOutput xmlOutput, String tagName, Iterable<File> listValues) throws IOException { """ Write a list of Strings to document as elements with given tag name. @param xmlOutput the XMLOutput object to write to @param tagName the tag name @param listValues Collection of String...
java
public static void writeFileList(XMLOutput xmlOutput, String tagName, Iterable<File> listValues) throws IOException { if (listValues != null) { writeFileList(xmlOutput, tagName, listValues.iterator()); } }
[ "public", "static", "void", "writeFileList", "(", "XMLOutput", "xmlOutput", ",", "String", "tagName", ",", "Iterable", "<", "File", ">", "listValues", ")", "throws", "IOException", "{", "if", "(", "listValues", "!=", "null", ")", "{", "writeFileList", "(", "...
Write a list of Strings to document as elements with given tag name. @param xmlOutput the XMLOutput object to write to @param tagName the tag name @param listValues Collection of String values to write
[ "Write", "a", "list", "of", "Strings", "to", "document", "as", "elements", "with", "given", "tag", "name", "." ]
train
https://github.com/spotbugs/spotbugs/blob/f6365c6eea6515035bded38efa4a7c8b46ccf28c/spotbugs/src/main/java/edu/umd/cs/findbugs/xml/XMLOutputUtil.java#L77-L81
algolia/algoliasearch-client-java
src/main/java/com/algolia/search/saas/APIClient.java
APIClient.addApiKey
public JSONObject addApiKey(JSONObject params, RequestOptions requestOptions) throws AlgoliaException { """ Create a new api key @param params the list of parameters for this key. Defined by a JSONObject that can contains the following values: - acl: array of string - indices: array of string - vali...
java
public JSONObject addApiKey(JSONObject params, RequestOptions requestOptions) throws AlgoliaException { return postRequest("/1/keys", params.toString(), true, false, requestOptions); }
[ "public", "JSONObject", "addApiKey", "(", "JSONObject", "params", ",", "RequestOptions", "requestOptions", ")", "throws", "AlgoliaException", "{", "return", "postRequest", "(", "\"/1/keys\"", ",", "params", ".", "toString", "(", ")", ",", "true", ",", "false", "...
Create a new api key @param params the list of parameters for this key. Defined by a JSONObject that can contains the following values: - acl: array of string - indices: array of string - validity: int - referers: array of string - description: string - maxHitsPerQuery: integer - queryParameters: string - maxQ...
[ "Create", "a", "new", "api", "key" ]
train
https://github.com/algolia/algoliasearch-client-java/blob/a05da2f66c099fe6f77295c7b6a8a12c24e95f9b/src/main/java/com/algolia/search/saas/APIClient.java#L625-L627
apache/groovy
src/main/java/org/codehaus/groovy/ast/expr/BinaryExpression.java
BinaryExpression.newInitializationExpression
public static BinaryExpression newInitializationExpression(String variable, ClassNode type, Expression rhs) { """ Creates variable initialization expression in which the specified expression is written into the specified variable name. """ VariableExpression lhs = new VariableExpression(variable); ...
java
public static BinaryExpression newInitializationExpression(String variable, ClassNode type, Expression rhs) { VariableExpression lhs = new VariableExpression(variable); if (type != null) { lhs.setType(type); } Token operator = Token.newPlaceholder(Types.ASSIGN); re...
[ "public", "static", "BinaryExpression", "newInitializationExpression", "(", "String", "variable", ",", "ClassNode", "type", ",", "Expression", "rhs", ")", "{", "VariableExpression", "lhs", "=", "new", "VariableExpression", "(", "variable", ")", ";", "if", "(", "ty...
Creates variable initialization expression in which the specified expression is written into the specified variable name.
[ "Creates", "variable", "initialization", "expression", "in", "which", "the", "specified", "expression", "is", "written", "into", "the", "specified", "variable", "name", "." ]
train
https://github.com/apache/groovy/blob/71cf20addb611bb8d097a59e395fd20bc7f31772/src/main/java/org/codehaus/groovy/ast/expr/BinaryExpression.java#L121-L131
OpenLiberty/open-liberty
dev/com.ibm.ws.jdbc/src/com/ibm/ws/rsadapter/impl/DB2iNativeHelper.java
DB2iNativeHelper.generateVersionNumber
protected static final int generateVersionNumber(String s) { """ 274538 -- internal utility method added. This internal utility method is used to convert the os.version string to a integer value so that DB2 support can be determined based on version and release level. @return int : The numeric value of the os...
java
protected static final int generateVersionNumber(String s) { int i = -1; StringTokenizer stringtokenizer = new StringTokenizer(s, "VRM", false); if (stringtokenizer.countTokens() == 3) { String s1 = stringtokenizer.nextToken(); s1 = s1 + stringtokenizer.nextToken(); ...
[ "protected", "static", "final", "int", "generateVersionNumber", "(", "String", "s", ")", "{", "int", "i", "=", "-", "1", ";", "StringTokenizer", "stringtokenizer", "=", "new", "StringTokenizer", "(", "s", ",", "\"VRM\"", ",", "false", ")", ";", "if", "(", ...
274538 -- internal utility method added. This internal utility method is used to convert the os.version string to a integer value so that DB2 support can be determined based on version and release level. @return int : The numeric value of the os400 VRM such as 530 for the string "V5R3M0"
[ "274538", "--", "internal", "utility", "method", "added", ".", "This", "internal", "utility", "method", "is", "used", "to", "convert", "the", "os", ".", "version", "string", "to", "a", "integer", "value", "so", "that", "DB2", "support", "can", "be", "deter...
train
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.jdbc/src/com/ibm/ws/rsadapter/impl/DB2iNativeHelper.java#L208-L218
codescape/bitvunit
bitvunit-core/src/main/java/de/codescape/bitvunit/BitvUnit.java
BitvUnit.assertAccessibility
public static void assertAccessibility(String htmlString, Testable testable) { """ JUnit Assertion to verify a {@link java.lang.String} containing the HTML page for accessibility. @param htmlString {@link java.lang.String} containing the HTML page @param testable rule(s) to apply """ assertThat(h...
java
public static void assertAccessibility(String htmlString, Testable testable) { assertThat(htmlString, is(compliantTo(testable))); }
[ "public", "static", "void", "assertAccessibility", "(", "String", "htmlString", ",", "Testable", "testable", ")", "{", "assertThat", "(", "htmlString", ",", "is", "(", "compliantTo", "(", "testable", ")", ")", ")", ";", "}" ]
JUnit Assertion to verify a {@link java.lang.String} containing the HTML page for accessibility. @param htmlString {@link java.lang.String} containing the HTML page @param testable rule(s) to apply
[ "JUnit", "Assertion", "to", "verify", "a", "{", "@link", "java", ".", "lang", ".", "String", "}", "containing", "the", "HTML", "page", "for", "accessibility", "." ]
train
https://github.com/codescape/bitvunit/blob/cef6d9af60d684e41294981c10b6d92c8f063a4e/bitvunit-core/src/main/java/de/codescape/bitvunit/BitvUnit.java#L48-L50
netscaler/sdx_nitro
src/main/java/com/citrix/sdx/nitro/resource/config/mps/sdx_license.java
sdx_license.get_nitro_bulk_response
protected base_resource[] get_nitro_bulk_response(nitro_service service, String response) throws Exception { """ <pre> Converts API response of bulk operation into object and returns the object array in case of get request. </pre> """ sdx_license_responses result = (sdx_license_responses) service.get_payl...
java
protected base_resource[] get_nitro_bulk_response(nitro_service service, String response) throws Exception { sdx_license_responses result = (sdx_license_responses) service.get_payload_formatter().string_to_resource(sdx_license_responses.class, response); if(result.errorcode != 0) { if (result.errorcode =...
[ "protected", "base_resource", "[", "]", "get_nitro_bulk_response", "(", "nitro_service", "service", ",", "String", "response", ")", "throws", "Exception", "{", "sdx_license_responses", "result", "=", "(", "sdx_license_responses", ")", "service", ".", "get_payload_format...
<pre> Converts API response of bulk operation into object and returns the object array in case of get request. </pre>
[ "<pre", ">", "Converts", "API", "response", "of", "bulk", "operation", "into", "object", "and", "returns", "the", "object", "array", "in", "case", "of", "get", "request", ".", "<", "/", "pre", ">" ]
train
https://github.com/netscaler/sdx_nitro/blob/c840919f1a8f7c0a5634c0f23d34fa14d1765ff1/src/main/java/com/citrix/sdx/nitro/resource/config/mps/sdx_license.java#L311-L328
lessthanoptimal/ejml
main/ejml-ddense/src/org/ejml/dense/row/decomposition/svd/implicitqr/SvdImplicitQrAlgorithm_DDRM.java
SvdImplicitQrAlgorithm_DDRM.updateRotator
protected void updateRotator(DMatrixRMaj Q , int m, int n, double c, double s) { """ Multiplied a transpose orthogonal matrix Q by the specified rotator. This is used to update the U and V matrices. Updating the transpose of the matrix is faster since it only modifies the rows. @param Q Orthogonal matrix ...
java
protected void updateRotator(DMatrixRMaj Q , int m, int n, double c, double s) { int rowA = m*Q.numCols; int rowB = n*Q.numCols; // for( int i = 0; i < Q.numCols; i++ ) { // double a = Q.get(rowA+i); // double b = Q.get(rowB+i); // Q.set( rowA+i, c*a + s*b); // ...
[ "protected", "void", "updateRotator", "(", "DMatrixRMaj", "Q", ",", "int", "m", ",", "int", "n", ",", "double", "c", ",", "double", "s", ")", "{", "int", "rowA", "=", "m", "*", "Q", ".", "numCols", ";", "int", "rowB", "=", "n", "*", "Q", ".", "...
Multiplied a transpose orthogonal matrix Q by the specified rotator. This is used to update the U and V matrices. Updating the transpose of the matrix is faster since it only modifies the rows. @param Q Orthogonal matrix @param m Coordinate of rotator. @param n Coordinate of rotator. @param c cosine of rotator. @pa...
[ "Multiplied", "a", "transpose", "orthogonal", "matrix", "Q", "by", "the", "specified", "rotator", ".", "This", "is", "used", "to", "update", "the", "U", "and", "V", "matrices", ".", "Updating", "the", "transpose", "of", "the", "matrix", "is", "faster", "si...
train
https://github.com/lessthanoptimal/ejml/blob/1444680cc487af5e866730e62f48f5f9636850d9/main/ejml-ddense/src/org/ejml/dense/row/decomposition/svd/implicitqr/SvdImplicitQrAlgorithm_DDRM.java#L384-L404
couchbase/couchbase-java-client
src/main/java/com/couchbase/client/java/query/dsl/functions/ConditionalFunctions.java
ConditionalFunctions.missingIf
public static Expression missingIf(Expression expression1, Expression expression2) { """ Returned expression results in MISSING if expression1 = expression2, otherwise returns expression1. Returns MISSING or NULL if either input is MISSING or NULL.. """ return x("MISSINGIF(" + expression1.toString() +...
java
public static Expression missingIf(Expression expression1, Expression expression2) { return x("MISSINGIF(" + expression1.toString() + ", " + expression2.toString() + ")"); }
[ "public", "static", "Expression", "missingIf", "(", "Expression", "expression1", ",", "Expression", "expression2", ")", "{", "return", "x", "(", "\"MISSINGIF(\"", "+", "expression1", ".", "toString", "(", ")", "+", "\", \"", "+", "expression2", ".", "toString", ...
Returned expression results in MISSING if expression1 = expression2, otherwise returns expression1. Returns MISSING or NULL if either input is MISSING or NULL..
[ "Returned", "expression", "results", "in", "MISSING", "if", "expression1", "=", "expression2", "otherwise", "returns", "expression1", ".", "Returns", "MISSING", "or", "NULL", "if", "either", "input", "is", "MISSING", "or", "NULL", ".." ]
train
https://github.com/couchbase/couchbase-java-client/blob/f36a0ee0c66923bdde47838ca543e50cbaa99e14/src/main/java/com/couchbase/client/java/query/dsl/functions/ConditionalFunctions.java#L83-L85
elki-project/elki
elki-clustering/src/main/java/de/lmu/ifi/dbs/elki/algorithm/clustering/kmeans/AbstractKMeans.java
AbstractKMeans.incrementalUpdateMean
protected static void incrementalUpdateMean(double[] mean, NumberVector vec, int newsize, double op) { """ Compute an incremental update for the mean. @param mean Mean to update @param vec Object vector @param newsize (New) size of cluster @param op Cluster size change / Weight change """ if(newsize ...
java
protected static void incrementalUpdateMean(double[] mean, NumberVector vec, int newsize, double op) { if(newsize == 0) { return; // Keep old mean } // Note: numerically stabilized version: VMath.plusTimesEquals(mean, VMath.minusEquals(vec.toArray(), mean), op / newsize); }
[ "protected", "static", "void", "incrementalUpdateMean", "(", "double", "[", "]", "mean", ",", "NumberVector", "vec", ",", "int", "newsize", ",", "double", "op", ")", "{", "if", "(", "newsize", "==", "0", ")", "{", "return", ";", "// Keep old mean", "}", ...
Compute an incremental update for the mean. @param mean Mean to update @param vec Object vector @param newsize (New) size of cluster @param op Cluster size change / Weight change
[ "Compute", "an", "incremental", "update", "for", "the", "mean", "." ]
train
https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-clustering/src/main/java/de/lmu/ifi/dbs/elki/algorithm/clustering/kmeans/AbstractKMeans.java#L278-L284
mqlight/java-mqlight
mqlight/src/main/java/com/ibm/mqlight/api/impl/engine/Engine.java
Engine.writeToNetwork
private void writeToNetwork(EngineConnection engineConnection) { """ Drains any pending data from a Proton transport object onto the network """ final String methodName = "writeToNetwork"; logger.entry(this, methodName, engineConnection); if (engineConnection.transport.pending() > 0) { ...
java
private void writeToNetwork(EngineConnection engineConnection) { final String methodName = "writeToNetwork"; logger.entry(this, methodName, engineConnection); if (engineConnection.transport.pending() > 0) { ByteBuffer head = engineConnection.transport.head(); int amount = he...
[ "private", "void", "writeToNetwork", "(", "EngineConnection", "engineConnection", ")", "{", "final", "String", "methodName", "=", "\"writeToNetwork\"", ";", "logger", ".", "entry", "(", "this", ",", "methodName", ",", "engineConnection", ")", ";", "if", "(", "en...
Drains any pending data from a Proton transport object onto the network
[ "Drains", "any", "pending", "data", "from", "a", "Proton", "transport", "object", "onto", "the", "network" ]
train
https://github.com/mqlight/java-mqlight/blob/a565dfa6044050826d1221697da9e3268b557aeb/mqlight/src/main/java/com/ibm/mqlight/api/impl/engine/Engine.java#L440-L453
duracloud/duracloud
s3storageprovider/src/main/java/org/duracloud/s3task/streaminghls/EnableHlsTaskRunner.java
EnableHlsTaskRunner.setCorsPolicy
private void setCorsPolicy(String bucketName, List<String> allowedOrigins, String dcHost) { """ /* Sets CORS policy on the bucket. This policy will be served through CloudFront (based on forwarding rules) to allow cross-region requests to be made by JavaScript wanting to stream content from CloudFront """ ...
java
private void setCorsPolicy(String bucketName, List<String> allowedOrigins, String dcHost) { // If list is null or empty, add a default value if (null == allowedOrigins || allowedOrigins.isEmpty()) { allowedOrigins = new ArrayList<>(); allowedOrigins.add("https://*"); } el...
[ "private", "void", "setCorsPolicy", "(", "String", "bucketName", ",", "List", "<", "String", ">", "allowedOrigins", ",", "String", "dcHost", ")", "{", "// If list is null or empty, add a default value", "if", "(", "null", "==", "allowedOrigins", "||", "allowedOrigins"...
/* Sets CORS policy on the bucket. This policy will be served through CloudFront (based on forwarding rules) to allow cross-region requests to be made by JavaScript wanting to stream content from CloudFront
[ "/", "*", "Sets", "CORS", "policy", "on", "the", "bucket", ".", "This", "policy", "will", "be", "served", "through", "CloudFront", "(", "based", "on", "forwarding", "rules", ")", "to", "allow", "cross", "-", "region", "requests", "to", "be", "made", "by"...
train
https://github.com/duracloud/duracloud/blob/dc4f3a1716d43543cc3b2e1880605f9389849b66/s3storageprovider/src/main/java/org/duracloud/s3task/streaminghls/EnableHlsTaskRunner.java#L303-L327
google/closure-compiler
src/com/google/javascript/rhino/jstype/JSTypeRegistry.java
JSTypeRegistry.overwriteDeclaredType
public void overwriteDeclaredType(StaticScope scope, String name, JSType type) { """ Overrides a declared global type name. Throws an exception if this type name hasn't been declared yet. """ checkState(isDeclaredForScope(scope, name), "missing name %s", name); reregister(scope, type, name); }
java
public void overwriteDeclaredType(StaticScope scope, String name, JSType type) { checkState(isDeclaredForScope(scope, name), "missing name %s", name); reregister(scope, type, name); }
[ "public", "void", "overwriteDeclaredType", "(", "StaticScope", "scope", ",", "String", "name", ",", "JSType", "type", ")", "{", "checkState", "(", "isDeclaredForScope", "(", "scope", ",", "name", ")", ",", "\"missing name %s\"", ",", "name", ")", ";", "reregis...
Overrides a declared global type name. Throws an exception if this type name hasn't been declared yet.
[ "Overrides", "a", "declared", "global", "type", "name", ".", "Throws", "an", "exception", "if", "this", "type", "name", "hasn", "t", "been", "declared", "yet", "." ]
train
https://github.com/google/closure-compiler/blob/d81e36740f6a9e8ac31a825ee8758182e1dc5aae/src/com/google/javascript/rhino/jstype/JSTypeRegistry.java#L1179-L1182
actorapp/actor-platform
actor-sdk/sdk-core/core/core-shared/src/main/java/im/actor/core/modules/calls/peers/PeerNodeInt.java
PeerNodeInt.onCandidate
public void onCandidate(long sessionId, int index, String id, String sdp) { """ Call this method when new candidate is received @param index candidate index @param id candidate id @param sdp candidate sdp """ send(new RTCCandidate(deviceId, sessionId, index, id, sdp)); }
java
public void onCandidate(long sessionId, int index, String id, String sdp) { send(new RTCCandidate(deviceId, sessionId, index, id, sdp)); }
[ "public", "void", "onCandidate", "(", "long", "sessionId", ",", "int", "index", ",", "String", "id", ",", "String", "sdp", ")", "{", "send", "(", "new", "RTCCandidate", "(", "deviceId", ",", "sessionId", ",", "index", ",", "id", ",", "sdp", ")", ")", ...
Call this method when new candidate is received @param index candidate index @param id candidate id @param sdp candidate sdp
[ "Call", "this", "method", "when", "new", "candidate", "is", "received" ]
train
https://github.com/actorapp/actor-platform/blob/5123c1584757c6eeea0ed2a0e7e043629871a0c6/actor-sdk/sdk-core/core/core-shared/src/main/java/im/actor/core/modules/calls/peers/PeerNodeInt.java#L120-L122
looly/hutool
hutool-core/src/main/java/cn/hutool/core/img/ImgUtil.java
ImgUtil.toBase64
public static String toBase64(Image image, String imageType) { """ 将图片对象转换为Base64形式 @param image 图片对象 @param imageType 图片类型 @return Base64的字符串表现形式 @since 4.1.8 """ final ByteArrayOutputStream out = new ByteArrayOutputStream(); write(image, imageType, out); return Base64.encode(out.toByteArray())...
java
public static String toBase64(Image image, String imageType) { final ByteArrayOutputStream out = new ByteArrayOutputStream(); write(image, imageType, out); return Base64.encode(out.toByteArray()); }
[ "public", "static", "String", "toBase64", "(", "Image", "image", ",", "String", "imageType", ")", "{", "final", "ByteArrayOutputStream", "out", "=", "new", "ByteArrayOutputStream", "(", ")", ";", "write", "(", "image", ",", "imageType", ",", "out", ")", ";",...
将图片对象转换为Base64形式 @param image 图片对象 @param imageType 图片类型 @return Base64的字符串表现形式 @since 4.1.8
[ "将图片对象转换为Base64形式" ]
train
https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-core/src/main/java/cn/hutool/core/img/ImgUtil.java#L1253-L1257
Stratio/deep-spark
deep-commons/src/main/java/com/stratio/deep/commons/entity/Cells.java
Cells.getBytes
public Byte[] getBytes(String nameSpace, String cellName) { """ Returns the {@code Byte[]} value of the {@link Cell} (associated to {@code table}) whose name iscellName, or null if this Cells object contains no cell whose name is cellName. @param nameSpace the name of the owning table @param cellName the nam...
java
public Byte[] getBytes(String nameSpace, String cellName) { return getValue(nameSpace, cellName, Byte[].class); }
[ "public", "Byte", "[", "]", "getBytes", "(", "String", "nameSpace", ",", "String", "cellName", ")", "{", "return", "getValue", "(", "nameSpace", ",", "cellName", ",", "Byte", "[", "]", ".", "class", ")", ";", "}" ]
Returns the {@code Byte[]} value of the {@link Cell} (associated to {@code table}) whose name iscellName, or null if this Cells object contains no cell whose name is cellName. @param nameSpace the name of the owning table @param cellName the name of the Cell we want to retrieve from this Cells object. @return the {@c...
[ "Returns", "the", "{", "@code", "Byte", "[]", "}", "value", "of", "the", "{", "@link", "Cell", "}", "(", "associated", "to", "{", "@code", "table", "}", ")", "whose", "name", "iscellName", "or", "null", "if", "this", "Cells", "object", "contains", "no"...
train
https://github.com/Stratio/deep-spark/blob/b9621c9b7a6d996f80fce1d073d696a157bed095/deep-commons/src/main/java/com/stratio/deep/commons/entity/Cells.java#L1459-L1461
ocelotds/ocelot
ocelot-web/src/main/java/org/ocelotds/core/services/ArgumentConvertor.java
ArgumentConvertor.convertJsonToJava
@Override public Object convertJsonToJava(String jsonArg, Type paramType, Annotation[] parameterAnnotations) throws JsonUnmarshallingException, JsonMarshallerException { """ Convert json to Java @param jsonArg @param paramType @param parameterAnnotations @return @throws org.ocelotds.marshalling.exceptions...
java
@Override public Object convertJsonToJava(String jsonArg, Type paramType, Annotation[] parameterAnnotations) throws JsonUnmarshallingException, JsonMarshallerException { if ("null".equals(jsonArg)) { return null; } JsonUnmarshaller juma = getJsonUnmarshallerAnnotation(parameterAnnotations); if (null !...
[ "@", "Override", "public", "Object", "convertJsonToJava", "(", "String", "jsonArg", ",", "Type", "paramType", ",", "Annotation", "[", "]", "parameterAnnotations", ")", "throws", "JsonUnmarshallingException", ",", "JsonMarshallerException", "{", "if", "(", "\"null\"", ...
Convert json to Java @param jsonArg @param paramType @param parameterAnnotations @return @throws org.ocelotds.marshalling.exceptions.JsonUnmarshallingException @throws org.ocelotds.marshalling.exceptions.JsonMarshallerException
[ "Convert", "json", "to", "Java" ]
train
https://github.com/ocelotds/ocelot/blob/5f0ac37afd8fa4dc9f7234a2aac8abbb522128e7/ocelot-web/src/main/java/org/ocelotds/core/services/ArgumentConvertor.java#L57-L70
GenesysPureEngage/workspace-client-java
src/main/java/com/genesys/internal/workspace/api/VoiceApi.java
VoiceApi.completeCall
public ApiSuccessResponse completeCall(String id, UserData userData) throws ApiException { """ Complete a call Complete the specified call by adding information to its user data after it has been released. You should make this request on released calls if you set automatic complete to false in [/activate-channels...
java
public ApiSuccessResponse completeCall(String id, UserData userData) throws ApiException { ApiResponse<ApiSuccessResponse> resp = completeCallWithHttpInfo(id, userData); return resp.getData(); }
[ "public", "ApiSuccessResponse", "completeCall", "(", "String", "id", ",", "UserData", "userData", ")", "throws", "ApiException", "{", "ApiResponse", "<", "ApiSuccessResponse", ">", "resp", "=", "completeCallWithHttpInfo", "(", "id", ",", "userData", ")", ";", "ret...
Complete a call Complete the specified call by adding information to its user data after it has been released. You should make this request on released calls if you set automatic complete to false in [/activate-channels](/reference/workspace/Session/index.html#activateChannels). @param id The connection ID of the call....
[ "Complete", "a", "call", "Complete", "the", "specified", "call", "by", "adding", "information", "to", "its", "user", "data", "after", "it", "has", "been", "released", ".", "You", "should", "make", "this", "request", "on", "released", "calls", "if", "you", ...
train
https://github.com/GenesysPureEngage/workspace-client-java/blob/509fdd9e89b9359d012f9a72be95037a3cef53e6/src/main/java/com/genesys/internal/workspace/api/VoiceApi.java#L815-L818
jtmelton/appsensor
analysis-engines/appsensor-analysis-rules/src/main/java/org/owasp/appsensor/analysis/AggregateEventAnalysisEngine.java
AggregateEventAnalysisEngine.generateAttack
public void generateAttack(Event triggerEvent, Rule rule) { """ Generates an attack from the given {@link Rule} and triggered {@link Event} @param triggerEvent the {@link Event} that triggered the {@link Rule} @param rule the {@link Rule} being evaluated """ logger.info("Attack generated on rule: " + rul...
java
public void generateAttack(Event triggerEvent, Rule rule) { logger.info("Attack generated on rule: " + rule.getGuid() + ", by user: " + triggerEvent.getUser().getUsername()); Attack attack = new Attack(). setUser(new User(triggerEvent.getUser().getUsername())). setRule(rule). setTimestamp(triggerEvent.get...
[ "public", "void", "generateAttack", "(", "Event", "triggerEvent", ",", "Rule", "rule", ")", "{", "logger", ".", "info", "(", "\"Attack generated on rule: \"", "+", "rule", ".", "getGuid", "(", ")", "+", "\", by user: \"", "+", "triggerEvent", ".", "getUser", "...
Generates an attack from the given {@link Rule} and triggered {@link Event} @param triggerEvent the {@link Event} that triggered the {@link Rule} @param rule the {@link Rule} being evaluated
[ "Generates", "an", "attack", "from", "the", "given", "{", "@link", "Rule", "}", "and", "triggered", "{", "@link", "Event", "}" ]
train
https://github.com/jtmelton/appsensor/blob/c3b4e9ada50fdee974e0d618ec4bdfabc2163798/analysis-engines/appsensor-analysis-rules/src/main/java/org/owasp/appsensor/analysis/AggregateEventAnalysisEngine.java#L254-L265
googleapis/google-cloud-java
google-cloud-clients/google-cloud-spanner/src/main/java/com/google/cloud/spanner/Value.java
Value.boolArray
public static Value boolArray(@Nullable boolean[] v, int pos, int length) { """ Returns an {@code ARRAY<BOOL>} value that takes its elements from a region of an array. @param v the source of element values, which may be null to produce a value for which {@code isNull()} is {@code true} @param pos the start po...
java
public static Value boolArray(@Nullable boolean[] v, int pos, int length) { return boolArrayFactory.create(v, pos, length); }
[ "public", "static", "Value", "boolArray", "(", "@", "Nullable", "boolean", "[", "]", "v", ",", "int", "pos", ",", "int", "length", ")", "{", "return", "boolArrayFactory", ".", "create", "(", "v", ",", "pos", ",", "length", ")", ";", "}" ]
Returns an {@code ARRAY<BOOL>} value that takes its elements from a region of an array. @param v the source of element values, which may be null to produce a value for which {@code isNull()} is {@code true} @param pos the start position of {@code v} to copy values from. Ignored if {@code v} is {@code null}. @param len...
[ "Returns", "an", "{", "@code", "ARRAY<BOOL", ">", "}", "value", "that", "takes", "its", "elements", "from", "a", "region", "of", "an", "array", "." ]
train
https://github.com/googleapis/google-cloud-java/blob/d2f0bc64a53049040fe9c9d338b12fab3dd1ad6a/google-cloud-clients/google-cloud-spanner/src/main/java/com/google/cloud/spanner/Value.java#L203-L205
eclipse/xtext-lib
org.eclipse.xtext.xbase.lib/src/org/eclipse/xtext/xbase/lib/ObjectExtensions.java
ObjectExtensions.operator_notEquals
@Pure @Inline(value="(!$3.equal($1, $2))", imported=Objects.class) public static boolean operator_notEquals(Object a, Object b) { """ The <code>equals not</code> operator. This is the equivalent to a negated, null-safe {@link Object#equals(Object)} method. @param a an object. @param b another object. @re...
java
@Pure @Inline(value="(!$3.equal($1, $2))", imported=Objects.class) public static boolean operator_notEquals(Object a, Object b) { return !Objects.equal(a, b); }
[ "@", "Pure", "@", "Inline", "(", "value", "=", "\"(!$3.equal($1, $2))\"", ",", "imported", "=", "Objects", ".", "class", ")", "public", "static", "boolean", "operator_notEquals", "(", "Object", "a", ",", "Object", "b", ")", "{", "return", "!", "Objects", "...
The <code>equals not</code> operator. This is the equivalent to a negated, null-safe {@link Object#equals(Object)} method. @param a an object. @param b another object. @return <code>true</code> if {@code a} and {@code b} are not equal.
[ "The", "<code", ">", "equals", "not<", "/", "code", ">", "operator", ".", "This", "is", "the", "equivalent", "to", "a", "negated", "null", "-", "safe", "{", "@link", "Object#equals", "(", "Object", ")", "}", "method", "." ]
train
https://github.com/eclipse/xtext-lib/blob/7063572e1f1bd713a3aa53bdf3a8dc60e25c169a/org.eclipse.xtext.xbase.lib/src/org/eclipse/xtext/xbase/lib/ObjectExtensions.java#L30-L34
wcm-io/wcm-io-tooling
commons/content-package-builder/src/main/java/io/wcm/tooling/commons/contentpackagebuilder/ContentPackage.java
ContentPackage.addFile
public void addFile(String path, File file) throws IOException { """ Adds a binary file. @param path Full content path and file name of file @param file File with binary data @throws IOException I/O exception """ addFile(path, file, null); }
java
public void addFile(String path, File file) throws IOException { addFile(path, file, null); }
[ "public", "void", "addFile", "(", "String", "path", ",", "File", "file", ")", "throws", "IOException", "{", "addFile", "(", "path", ",", "file", ",", "null", ")", ";", "}" ]
Adds a binary file. @param path Full content path and file name of file @param file File with binary data @throws IOException I/O exception
[ "Adds", "a", "binary", "file", "." ]
train
https://github.com/wcm-io/wcm-io-tooling/blob/1abcd01dd3ad4cc248f03b431f929573d84fa9b4/commons/content-package-builder/src/main/java/io/wcm/tooling/commons/contentpackagebuilder/ContentPackage.java#L223-L225
eyp/serfj
src/main/java/net/sf/serfj/serializers/FileSerializer.java
FileSerializer.sendFile
public void sendFile(File file, OutputStream os) throws IOException { """ Write a file to an OuputStream. @param file File that will be written. @param os The target OutputStream. @throws IOException if any error happens. """ FileInputStream is = null; BufferedInputStream buf = null;; ...
java
public void sendFile(File file, OutputStream os) throws IOException { FileInputStream is = null; BufferedInputStream buf = null;; try { is = new FileInputStream(file); buf = new BufferedInputStream(is); int readBytes = 0; if (LOGGER.isDebugEnabled(...
[ "public", "void", "sendFile", "(", "File", "file", ",", "OutputStream", "os", ")", "throws", "IOException", "{", "FileInputStream", "is", "=", "null", ";", "BufferedInputStream", "buf", "=", "null", ";", ";", "try", "{", "is", "=", "new", "FileInputStream", ...
Write a file to an OuputStream. @param file File that will be written. @param os The target OutputStream. @throws IOException if any error happens.
[ "Write", "a", "file", "to", "an", "OuputStream", "." ]
train
https://github.com/eyp/serfj/blob/e617592af6f24e59ea58443f2785c44aa2312189/src/main/java/net/sf/serfj/serializers/FileSerializer.java#L54-L79
jmeetsma/Iglu-Http
src/main/java/org/ijsberg/iglu/util/http/ServletSupport.java
ServletSupport.getUserByBasicAuthentication
public static User getUserByBasicAuthentication(Request applicationRequest, HttpServletRequest request, HttpServletResponse response, String realmDescription) throws IOException, ServletRequestAlreadyRedirectedException { """ Does one of the following things: <ul <li>retrieves current logged in user</li> <li>pe...
java
public static User getUserByBasicAuthentication(Request applicationRequest, HttpServletRequest request, HttpServletResponse response, String realmDescription) throws IOException, ServletRequestAlreadyRedirectedException { // Request applicationRequest = application.getCurrentRequest(); // String realmId = applica...
[ "public", "static", "User", "getUserByBasicAuthentication", "(", "Request", "applicationRequest", ",", "HttpServletRequest", "request", ",", "HttpServletResponse", "response", ",", "String", "realmDescription", ")", "throws", "IOException", ",", "ServletRequestAlreadyRedirect...
Does one of the following things: <ul <li>retrieves current logged in user</li> <li>performs authentication based on the credentials provided</li> <li>asks the client to provide credentials if no one is logged in to current session, followed by throwing a ServletRequestAlreadyRedirectedException</li> </ul> @param requ...
[ "Does", "one", "of", "the", "following", "things", ":", "<ul", "<li", ">", "retrieves", "current", "logged", "in", "user<", "/", "li", ">", "<li", ">", "performs", "authentication", "based", "on", "the", "credentials", "provided<", "/", "li", ">", "<li", ...
train
https://github.com/jmeetsma/Iglu-Http/blob/5b5ed3b417285dc79b7aa013bf2340bb5ba1ffbe/src/main/java/org/ijsberg/iglu/util/http/ServletSupport.java#L372-L410
ttddyy/datasource-proxy
src/main/java/net/ttddyy/dsproxy/support/ProxyDataSourceBuilder.java
ProxyDataSourceBuilder.logQueryByJUL
public ProxyDataSourceBuilder logQueryByJUL(Level logLevel, String julLoggerName) { """ Register {@link JULQueryLoggingListener}. @param logLevel log level for JUL @param julLoggerName JUL logger name @return builder @since 1.4 """ this.createJulQueryListener = true; this.julLogLevel...
java
public ProxyDataSourceBuilder logQueryByJUL(Level logLevel, String julLoggerName) { this.createJulQueryListener = true; this.julLogLevel = logLevel; this.julLoggerName = julLoggerName; return this; }
[ "public", "ProxyDataSourceBuilder", "logQueryByJUL", "(", "Level", "logLevel", ",", "String", "julLoggerName", ")", "{", "this", ".", "createJulQueryListener", "=", "true", ";", "this", ".", "julLogLevel", "=", "logLevel", ";", "this", ".", "julLoggerName", "=", ...
Register {@link JULQueryLoggingListener}. @param logLevel log level for JUL @param julLoggerName JUL logger name @return builder @since 1.4
[ "Register", "{", "@link", "JULQueryLoggingListener", "}", "." ]
train
https://github.com/ttddyy/datasource-proxy/blob/62163ccf9a569a99aa3ad9f9151a32567447a62e/src/main/java/net/ttddyy/dsproxy/support/ProxyDataSourceBuilder.java#L424-L429
UrielCh/ovh-java-sdk
ovh-java-sdk-cloud/src/main/java/net/minidev/ovh/api/ApiOvhCloud.java
ApiOvhCloud.project_serviceName_instance_instanceId_monitoring_GET
public OvhInstanceMetrics project_serviceName_instance_instanceId_monitoring_GET(String serviceName, String instanceId, OvhMetricsPeriod period, OvhMetricsType type) throws IOException { """ Return many statistics about the virtual machine for a given period REST: GET /cloud/project/{serviceName}/instance/{inst...
java
public OvhInstanceMetrics project_serviceName_instance_instanceId_monitoring_GET(String serviceName, String instanceId, OvhMetricsPeriod period, OvhMetricsType type) throws IOException { String qPath = "/cloud/project/{serviceName}/instance/{instanceId}/monitoring"; StringBuilder sb = path(qPath, serviceName, insta...
[ "public", "OvhInstanceMetrics", "project_serviceName_instance_instanceId_monitoring_GET", "(", "String", "serviceName", ",", "String", "instanceId", ",", "OvhMetricsPeriod", "period", ",", "OvhMetricsType", "type", ")", "throws", "IOException", "{", "String", "qPath", "=", ...
Return many statistics about the virtual machine for a given period REST: GET /cloud/project/{serviceName}/instance/{instanceId}/monitoring @param instanceId [required] Instance id @param period [required] The period the statistics are fetched for @param serviceName [required] Project id @param type [required] The typ...
[ "Return", "many", "statistics", "about", "the", "virtual", "machine", "for", "a", "given", "period" ]
train
https://github.com/UrielCh/ovh-java-sdk/blob/6d531a40e56e09701943e334c25f90f640c55701/ovh-java-sdk-cloud/src/main/java/net/minidev/ovh/api/ApiOvhCloud.java#L2033-L2040
kiswanij/jk-util
src/main/java/com/jk/util/mime/MagicMimeEntry.java
MagicMimeEntry.matchLong
private boolean matchLong(final ByteBuffer bbuf, final ByteOrder bo, final boolean needMask, final long lMask) throws IOException { """ Match long. @param bbuf the bbuf @param bo the bo @param needMask the need mask @param lMask the l mask @return true, if successful @throws IOException Signal...
java
private boolean matchLong(final ByteBuffer bbuf, final ByteOrder bo, final boolean needMask, final long lMask) throws IOException { bbuf.order(bo); long got; final String testContent = getContent(); if (testContent.startsWith("0x")) { got = Long.parseLong(testContent.substring(2), 16); } else if (testConte...
[ "private", "boolean", "matchLong", "(", "final", "ByteBuffer", "bbuf", ",", "final", "ByteOrder", "bo", ",", "final", "boolean", "needMask", ",", "final", "long", "lMask", ")", "throws", "IOException", "{", "bbuf", ".", "order", "(", "bo", ")", ";", "long"...
Match long. @param bbuf the bbuf @param bo the bo @param needMask the need mask @param lMask the l mask @return true, if successful @throws IOException Signals that an I/O exception has occurred.
[ "Match", "long", "." ]
train
https://github.com/kiswanij/jk-util/blob/8e0c85818423406f769444c76194a748e0a0fc0a/src/main/java/com/jk/util/mime/MagicMimeEntry.java#L556-L579
spotbugs/spotbugs
eclipsePlugin/src/de/tobject/findbugs/util/ProjectUtilities.java
ProjectUtilities.removeFindBugsNature
public static void removeFindBugsNature(IProject project, IProgressMonitor monitor) throws CoreException { """ Removes the FindBugs nature from a project. @param project The project the nature will be removed from. @param monitor A progress monitor. Must not be null. @throws CoreException """ if...
java
public static void removeFindBugsNature(IProject project, IProgressMonitor monitor) throws CoreException { if (!hasFindBugsNature(project)) { return; } IProjectDescription description = project.getDescription(); String[] prevNatures = description.getNatureIds(); Array...
[ "public", "static", "void", "removeFindBugsNature", "(", "IProject", "project", ",", "IProgressMonitor", "monitor", ")", "throws", "CoreException", "{", "if", "(", "!", "hasFindBugsNature", "(", "project", ")", ")", "{", "return", ";", "}", "IProjectDescription", ...
Removes the FindBugs nature from a project. @param project The project the nature will be removed from. @param monitor A progress monitor. Must not be null. @throws CoreException
[ "Removes", "the", "FindBugs", "nature", "from", "a", "project", "." ]
train
https://github.com/spotbugs/spotbugs/blob/f6365c6eea6515035bded38efa4a7c8b46ccf28c/eclipsePlugin/src/de/tobject/findbugs/util/ProjectUtilities.java#L121-L136
ThreeTen/threetenbp
src/main/java/org/threeten/bp/LocalTime.java
LocalTime.plus
@Override public LocalTime plus(long amountToAdd, TemporalUnit unit) { """ Returns a copy of this time with the specified period added. <p> This method returns a new time based on this time with the specified period added. This can be used to add any period that is defined by a unit, for example to add hour...
java
@Override public LocalTime plus(long amountToAdd, TemporalUnit unit) { if (unit instanceof ChronoUnit) { ChronoUnit f = (ChronoUnit) unit; switch (f) { case NANOS: return plusNanos(amountToAdd); case MICROS: return plusNanos((amountToAdd % MICROS_PER_D...
[ "@", "Override", "public", "LocalTime", "plus", "(", "long", "amountToAdd", ",", "TemporalUnit", "unit", ")", "{", "if", "(", "unit", "instanceof", "ChronoUnit", ")", "{", "ChronoUnit", "f", "=", "(", "ChronoUnit", ")", "unit", ";", "switch", "(", "f", "...
Returns a copy of this time with the specified period added. <p> This method returns a new time based on this time with the specified period added. This can be used to add any period that is defined by a unit, for example to add hours, minutes or seconds. The unit is responsible for the details of the calculation, incl...
[ "Returns", "a", "copy", "of", "this", "time", "with", "the", "specified", "period", "added", ".", "<p", ">", "This", "method", "returns", "a", "new", "time", "based", "on", "this", "time", "with", "the", "specified", "period", "added", ".", "This", "can"...
train
https://github.com/ThreeTen/threetenbp/blob/5f05b649f89f205aabd96b2f83c36796ec616fe6/src/main/java/org/threeten/bp/LocalTime.java#L961-L977
SonarSource/sonarqube
sonar-plugin-api/src/main/java/org/sonar/api/utils/AnnotationUtils.java
AnnotationUtils.getAnnotation
public static <A extends Annotation> A getAnnotation(Object objectOrClass, Class<A> annotationClass) { """ Searches for a class annotation. All inheritance tree is analysed. @since 3.1 """ Class<?> initialClass = objectOrClass instanceof Class<?> ? (Class<?>) objectOrClass : objectOrClass.getClass(); ...
java
public static <A extends Annotation> A getAnnotation(Object objectOrClass, Class<A> annotationClass) { Class<?> initialClass = objectOrClass instanceof Class<?> ? (Class<?>) objectOrClass : objectOrClass.getClass(); for (Class<?> aClass = initialClass; aClass != null; aClass = aClass.getSuperclass()) { ...
[ "public", "static", "<", "A", "extends", "Annotation", ">", "A", "getAnnotation", "(", "Object", "objectOrClass", ",", "Class", "<", "A", ">", "annotationClass", ")", "{", "Class", "<", "?", ">", "initialClass", "=", "objectOrClass", "instanceof", "Class", "...
Searches for a class annotation. All inheritance tree is analysed. @since 3.1
[ "Searches", "for", "a", "class", "annotation", ".", "All", "inheritance", "tree", "is", "analysed", "." ]
train
https://github.com/SonarSource/sonarqube/blob/2fffa4c2f79ae3714844d7742796e82822b6a98a/sonar-plugin-api/src/main/java/org/sonar/api/utils/AnnotationUtils.java#L42-L60
m-m-m/util
nls/src/main/java/net/sf/mmm/util/nls/base/NlsCachingLocalizer.java
NlsCachingLocalizer.parseTemplate
protected NlsTemplate parseTemplate(String internationalizedMessage) { """ This method parses the given {@code internationalizedMessage} as {@link NlsTemplate} in case it is given in the form {{@literal <BUNDLE>#<KEY>}}. @param internationalizedMessage is the template specified in the form described above or t...
java
protected NlsTemplate parseTemplate(String internationalizedMessage) { Matcher matcher = TEMPLATE_PATTERN.matcher(internationalizedMessage); if (matcher.matches()) { String name = matcher.group(2); if (name == null) { name = this.bundleName; } String key = matcher.group(...
[ "protected", "NlsTemplate", "parseTemplate", "(", "String", "internationalizedMessage", ")", "{", "Matcher", "matcher", "=", "TEMPLATE_PATTERN", ".", "matcher", "(", "internationalizedMessage", ")", ";", "if", "(", "matcher", ".", "matches", "(", ")", ")", "{", ...
This method parses the given {@code internationalizedMessage} as {@link NlsTemplate} in case it is given in the form {{@literal <BUNDLE>#<KEY>}}. @param internationalizedMessage is the template specified in the form described above or the {@link NlsMessage#getInternationalizedMessage() internationalized message}. @ret...
[ "This", "method", "parses", "the", "given", "{", "@code", "internationalizedMessage", "}", "as", "{", "@link", "NlsTemplate", "}", "in", "case", "it", "is", "given", "in", "the", "form", "{{", "@literal", "<BUNDLE", ">", "#<KEY", ">", "}}", "." ]
train
https://github.com/m-m-m/util/blob/f0e4e084448f8dfc83ca682a9e1618034a094ce6/nls/src/main/java/net/sf/mmm/util/nls/base/NlsCachingLocalizer.java#L103-L115
alipay/sofa-rpc
extension-impl/registry-local/src/main/java/com/alipay/sofa/rpc/registry/local/LocalRegistry.java
LocalRegistry.doRegister
protected void doRegister(String appName, String serviceName, ProviderInfo providerInfo) { """ 注册单条服务信息 @param appName 应用名 @param serviceName 服务关键字 @param providerInfo 服务提供者数据 """ if (LOGGER.isInfoEnabled(appName)) { LOGGER.infoWithApp(appName, LogCodes.getLog(LogCodes.INFO_ROUTE...
java
protected void doRegister(String appName, String serviceName, ProviderInfo providerInfo) { if (LOGGER.isInfoEnabled(appName)) { LOGGER.infoWithApp(appName, LogCodes.getLog(LogCodes.INFO_ROUTE_REGISTRY_PUB, serviceName)); } //{service : [provider...]} ProviderGroup oldGroup = ...
[ "protected", "void", "doRegister", "(", "String", "appName", ",", "String", "serviceName", ",", "ProviderInfo", "providerInfo", ")", "{", "if", "(", "LOGGER", ".", "isInfoEnabled", "(", "appName", ")", ")", "{", "LOGGER", ".", "infoWithApp", "(", "appName", ...
注册单条服务信息 @param appName 应用名 @param serviceName 服务关键字 @param providerInfo 服务提供者数据
[ "注册单条服务信息" ]
train
https://github.com/alipay/sofa-rpc/blob/a31406410291e56696185a29c3ba4bd1f54488fd/extension-impl/registry-local/src/main/java/com/alipay/sofa/rpc/registry/local/LocalRegistry.java#L225-L245
albfernandez/itext2
src/main/java/com/lowagie/text/pdf/PdfSigGenericPKCS.java
PdfSigGenericPKCS.setSignInfo
public void setSignInfo(PrivateKey privKey, Certificate[] certChain, CRL[] crlList) { """ Sets the crypto information to sign. @param privKey the private key @param certChain the certificate chain @param crlList the certificate revocation list. It can be <CODE>null</CODE> """ try { pkcs ...
java
public void setSignInfo(PrivateKey privKey, Certificate[] certChain, CRL[] crlList) { try { pkcs = new PdfPKCS7(privKey, certChain, crlList, hashAlgorithm, provider, PdfName.ADBE_PKCS7_SHA1.equals(get(PdfName.SUBFILTER))); pkcs.setExternalDigest(externalDigest, externalRSAdata, digestEnc...
[ "public", "void", "setSignInfo", "(", "PrivateKey", "privKey", ",", "Certificate", "[", "]", "certChain", ",", "CRL", "[", "]", "crlList", ")", "{", "try", "{", "pkcs", "=", "new", "PdfPKCS7", "(", "privKey", ",", "certChain", ",", "crlList", ",", "hashA...
Sets the crypto information to sign. @param privKey the private key @param certChain the certificate chain @param crlList the certificate revocation list. It can be <CODE>null</CODE>
[ "Sets", "the", "crypto", "information", "to", "sign", "." ]
train
https://github.com/albfernandez/itext2/blob/438fc1899367fd13dfdfa8dfdca9a3c1a7783b84/src/main/java/com/lowagie/text/pdf/PdfSigGenericPKCS.java#L96-L120
recommenders/rival
rival-core/src/main/java/net/recommenders/rival/core/DataModel.java
DataModel.addPreference
@Override public void addPreference(final U u, final I i, final Double d) { """ Method that adds a preference to the model between a user and an item. @param u the user. @param i the item. @param d the preference. """ // update direct map Map<I, Double> userPreferences = userItemPrefer...
java
@Override public void addPreference(final U u, final I i, final Double d) { // update direct map Map<I, Double> userPreferences = userItemPreferences.get(u); if (userPreferences == null) { userPreferences = new HashMap<>(); userItemPreferences.put(u, userPreferences);...
[ "@", "Override", "public", "void", "addPreference", "(", "final", "U", "u", ",", "final", "I", "i", ",", "final", "Double", "d", ")", "{", "// update direct map", "Map", "<", "I", ",", "Double", ">", "userPreferences", "=", "userItemPreferences", ".", "get...
Method that adds a preference to the model between a user and an item. @param u the user. @param i the item. @param d the preference.
[ "Method", "that", "adds", "a", "preference", "to", "the", "model", "between", "a", "user", "and", "an", "item", "." ]
train
https://github.com/recommenders/rival/blob/6ee8223e91810ae1c6052899595af3906e0c34c6/rival-core/src/main/java/net/recommenders/rival/core/DataModel.java#L117-L138
TinkoffCreditSystems/decoro
library/src/main/java/ru/tinkoff/decoro/MaskImpl.java
MaskImpl.insertAt
@Override public int insertAt(final int position, @Nullable final CharSequence input) { """ Convenience method for {@link MaskImpl#insertAt(int, CharSequence, boolean)} that always places cursor after trailing hardcoded sequence. @param position from which position to begin input @param input string t...
java
@Override public int insertAt(final int position, @Nullable final CharSequence input) { return insertAt(position, input, true); }
[ "@", "Override", "public", "int", "insertAt", "(", "final", "int", "position", ",", "@", "Nullable", "final", "CharSequence", "input", ")", "{", "return", "insertAt", "(", "position", ",", "input", ",", "true", ")", ";", "}" ]
Convenience method for {@link MaskImpl#insertAt(int, CharSequence, boolean)} that always places cursor after trailing hardcoded sequence. @param position from which position to begin input @param input string to insert @return cursor position after insert
[ "Convenience", "method", "for", "{", "@link", "MaskImpl#insertAt", "(", "int", "CharSequence", "boolean", ")", "}", "that", "always", "places", "cursor", "after", "trailing", "hardcoded", "sequence", "." ]
train
https://github.com/TinkoffCreditSystems/decoro/blob/f2693d0b3def13aabf59cf642fc0b6f5c8c94f63/library/src/main/java/ru/tinkoff/decoro/MaskImpl.java#L309-L312
eurekaclinical/eurekaclinical-common
src/main/java/org/eurekaclinical/common/comm/clients/EurekaClinicalClient.java
EurekaClinicalClient.doGetForProxy
protected ClientResponse doGetForProxy(String path, MultivaluedMap<String, String> parameterMap, MultivaluedMap<String, String> headers) throws ClientException { """ Gets a resource from a proxied server. @param path the path to the resource. Cannot be <code>null</code>. @param parameterMap query parameters. M...
java
protected ClientResponse doGetForProxy(String path, MultivaluedMap<String, String> parameterMap, MultivaluedMap<String, String> headers) throws ClientException { this.readLock.lock(); try { WebResource.Builder requestBuilder = getResourceWrapper().rewritten(path, HttpMethod.GET, parameterMap...
[ "protected", "ClientResponse", "doGetForProxy", "(", "String", "path", ",", "MultivaluedMap", "<", "String", ",", "String", ">", "parameterMap", ",", "MultivaluedMap", "<", "String", ",", "String", ">", "headers", ")", "throws", "ClientException", "{", "this", "...
Gets a resource from a proxied server. @param path the path to the resource. Cannot be <code>null</code>. @param parameterMap query parameters. May be <code>null</code>. @param headers any request headers to add. @return ClientResponse the proxied server's response information. @throws ClientException if the proxied...
[ "Gets", "a", "resource", "from", "a", "proxied", "server", "." ]
train
https://github.com/eurekaclinical/eurekaclinical-common/blob/1867102ff43fe94e519f76a074d5f5923e9be61c/src/main/java/org/eurekaclinical/common/comm/clients/EurekaClinicalClient.java#L978-L989
ManfredTremmel/gwt-commons-lang3
src/main/java/org/apache/commons/lang3/reflect/MethodUtils.java
MethodUtils.invokeStaticMethod
public static Object invokeStaticMethod(final Class<?> cls, final String methodName, Object... args) throws NoSuchMethodException, IllegalAccessException, InvocationTargetException { """ <p>Invokes a named {@code static} method whose parameter type matches the object type.</p> <p>This me...
java
public static Object invokeStaticMethod(final Class<?> cls, final String methodName, Object... args) throws NoSuchMethodException, IllegalAccessException, InvocationTargetException { args = ArrayUtils.nullToEmpty(args); final Class<?>[] parameterTypes = ClassUtils.toClass(args); ...
[ "public", "static", "Object", "invokeStaticMethod", "(", "final", "Class", "<", "?", ">", "cls", ",", "final", "String", "methodName", ",", "Object", "...", "args", ")", "throws", "NoSuchMethodException", ",", "IllegalAccessException", ",", "InvocationTargetExceptio...
<p>Invokes a named {@code static} method whose parameter type matches the object type.</p> <p>This method delegates the method search to {@link #getMatchingAccessibleMethod(Class, String, Class[])}.</p> <p>This method supports calls to methods taking primitive parameters via passing in wrapping classes. So, for examp...
[ "<p", ">", "Invokes", "a", "named", "{", "@code", "static", "}", "method", "whose", "parameter", "type", "matches", "the", "object", "type", ".", "<", "/", "p", ">" ]
train
https://github.com/ManfredTremmel/gwt-commons-lang3/blob/9e2dfbbda3668cfa5d935fe76479d1426c294504/src/main/java/org/apache/commons/lang3/reflect/MethodUtils.java#L403-L409
audit4j/audit4j-core
src/main/java/org/audit4j/core/annotation/DeIdentifyUtil.java
DeIdentifyUtil.deidentifyMiddle
public static String deidentifyMiddle(String str, int start, int end) { """ Deidentify middle. @param str the str @param start the start @param end the end @return the string @since 2.0.0 """ int repeat; if (end - start > str.length()) { repeat = str.length(); } else { repeat = (str.lengt...
java
public static String deidentifyMiddle(String str, int start, int end) { int repeat; if (end - start > str.length()) { repeat = str.length(); } else { repeat = (str.length()- end) - start; } return StringUtils.overlay(str, StringUtils.repeat('*', repeat), start, str.length()-end); }
[ "public", "static", "String", "deidentifyMiddle", "(", "String", "str", ",", "int", "start", ",", "int", "end", ")", "{", "int", "repeat", ";", "if", "(", "end", "-", "start", ">", "str", ".", "length", "(", ")", ")", "{", "repeat", "=", "str", "."...
Deidentify middle. @param str the str @param start the start @param end the end @return the string @since 2.0.0
[ "Deidentify", "middle", "." ]
train
https://github.com/audit4j/audit4j-core/blob/dc8569108851e64cb0ecc7a39048db0ad070fba2/src/main/java/org/audit4j/core/annotation/DeIdentifyUtil.java#L129-L138
mygreen/xlsmapper
src/main/java/com/gh/mygreen/xlsmapper/xml/bind/AnnotationInfo.java
AnnotationInfo.addAttribute
public void addAttribute(final String name, final String value) { """ アノテーションの属性を追加する。 <p>ただし、既に同じ属性名が存在する場合は、それと入れ替えされます。</p> @param name 属性名。必須です。 @param value 値。 <a href="http://s2container.seasar.org/2.4/ja/ognl.html" target="_blank">OGNL形式</a>で指定します。 @throws IllegalArgumentException name is empty. ""...
java
public void addAttribute(final String name, final String value) { ArgUtils.notEmpty(name, "name"); removeAttribute(name); this.attributes.add(AttributeInfo.create(name, value)); }
[ "public", "void", "addAttribute", "(", "final", "String", "name", ",", "final", "String", "value", ")", "{", "ArgUtils", ".", "notEmpty", "(", "name", ",", "\"name\"", ")", ";", "removeAttribute", "(", "name", ")", ";", "this", ".", "attributes", ".", "a...
アノテーションの属性を追加する。 <p>ただし、既に同じ属性名が存在する場合は、それと入れ替えされます。</p> @param name 属性名。必須です。 @param value 値。 <a href="http://s2container.seasar.org/2.4/ja/ognl.html" target="_blank">OGNL形式</a>で指定します。 @throws IllegalArgumentException name is empty.
[ "アノテーションの属性を追加する。", "<p", ">", "ただし、既に同じ属性名が存在する場合は、それと入れ替えされます。<", "/", "p", ">" ]
train
https://github.com/mygreen/xlsmapper/blob/a0c6b25c622e5f3a50b199ef685d2ee46ad5483c/src/main/java/com/gh/mygreen/xlsmapper/xml/bind/AnnotationInfo.java#L120-L124
YahooArchive/samoa
samoa-api/src/main/java/com/yahoo/labs/samoa/learners/clusterers/LocalClustererProcessor.java
LocalClustererProcessor.process
@Override public boolean process(ContentEvent event) { """ On event. @param event the event @return true, if successful """ if (event.isLastEvent() || (instancesCount > 0 && instancesCount% this.sampleFrequency == 0)) { if (model.implementsMicroClusterer()) ...
java
@Override public boolean process(ContentEvent event) { if (event.isLastEvent() || (instancesCount > 0 && instancesCount% this.sampleFrequency == 0)) { if (model.implementsMicroClusterer()) { Clustering clustering = model.getMicroClusteringResult(); ...
[ "@", "Override", "public", "boolean", "process", "(", "ContentEvent", "event", ")", "{", "if", "(", "event", ".", "isLastEvent", "(", ")", "||", "(", "instancesCount", ">", "0", "&&", "instancesCount", "%", "this", ".", "sampleFrequency", "==", "0", ")", ...
On event. @param event the event @return true, if successful
[ "On", "event", "." ]
train
https://github.com/YahooArchive/samoa/blob/540a2c30167ac85c432b593baabd5ca97e7e8a0f/samoa-api/src/main/java/com/yahoo/labs/samoa/learners/clusterers/LocalClustererProcessor.java#L150-L167
j-a-w-r/jawr-main-repo
jawr/jawr-core/src/main/java/net/jawr/web/resource/bundle/handler/ClientSideHandlerGeneratorImpl.java
ClientSideHandlerGeneratorImpl.getPathPrefix
private String getPathPrefix(HttpServletRequest request, JawrConfig config) { """ Determines which prefix should be used for the links, according to the context path override if present, or using the context path and possibly the jawr mapping. @param request the request @return the path prefix """ if...
java
private String getPathPrefix(HttpServletRequest request, JawrConfig config) { if (request.isSecure()) { if (null != config.getContextPathSslOverride()) { return config.getContextPathSslOverride(); } } else { if (null != config.getContextPathOverride()) { return config.getContextPathOverride(); ...
[ "private", "String", "getPathPrefix", "(", "HttpServletRequest", "request", ",", "JawrConfig", "config", ")", "{", "if", "(", "request", ".", "isSecure", "(", ")", ")", "{", "if", "(", "null", "!=", "config", ".", "getContextPathSslOverride", "(", ")", ")", ...
Determines which prefix should be used for the links, according to the context path override if present, or using the context path and possibly the jawr mapping. @param request the request @return the path prefix
[ "Determines", "which", "prefix", "should", "be", "used", "for", "the", "links", "according", "to", "the", "context", "path", "override", "if", "present", "or", "using", "the", "context", "path", "and", "possibly", "the", "jawr", "mapping", "." ]
train
https://github.com/j-a-w-r/jawr-main-repo/blob/5381f6acf461cd2502593c67a77bd6ef9eab848d/jawr/jawr-core/src/main/java/net/jawr/web/resource/bundle/handler/ClientSideHandlerGeneratorImpl.java#L217-L233
RobotiumTech/robotium
robotium-solo/src/main/java/com/robotium/solo/Solo.java
Solo.clickOnMenuItem
public void clickOnMenuItem(String text, boolean subMenu) { """ Clicks a MenuItem displaying the specified text. @param text the text displayed by the MenuItem. The parameter will be interpreted as a regular expression @param subMenu {@code true} if the menu item could be located in a sub menu """ if(con...
java
public void clickOnMenuItem(String text, boolean subMenu) { if(config.commandLogging){ Log.d(config.commandLoggingTag, "clickOnMenuItem(\""+text+"\", "+subMenu+")"); } clicker.clickOnMenuItem(text, subMenu); }
[ "public", "void", "clickOnMenuItem", "(", "String", "text", ",", "boolean", "subMenu", ")", "{", "if", "(", "config", ".", "commandLogging", ")", "{", "Log", ".", "d", "(", "config", ".", "commandLoggingTag", ",", "\"clickOnMenuItem(\\\"\"", "+", "text", "+"...
Clicks a MenuItem displaying the specified text. @param text the text displayed by the MenuItem. The parameter will be interpreted as a regular expression @param subMenu {@code true} if the menu item could be located in a sub menu
[ "Clicks", "a", "MenuItem", "displaying", "the", "specified", "text", "." ]
train
https://github.com/RobotiumTech/robotium/blob/75e567c38f26a6a87dc8bef90b3886a20e28d291/robotium-solo/src/main/java/com/robotium/solo/Solo.java#L1260-L1267
javagl/ND
nd-distance/src/main/java/de/javagl/nd/distance/tuples/j/LongTupleDistanceFunctions.java
LongTupleDistanceFunctions.computeEuclidean
static double computeEuclidean(LongTuple t0, LongTuple t1) { """ Computes the Euclidean distance between the given arrays @param t0 The first array @param t1 The second array @return The distance @throws IllegalArgumentException If the given array do not have the same length """ return Math.sqr...
java
static double computeEuclidean(LongTuple t0, LongTuple t1) { return Math.sqrt(computeEuclideanSquared(t0, t1)); }
[ "static", "double", "computeEuclidean", "(", "LongTuple", "t0", ",", "LongTuple", "t1", ")", "{", "return", "Math", ".", "sqrt", "(", "computeEuclideanSquared", "(", "t0", ",", "t1", ")", ")", ";", "}" ]
Computes the Euclidean distance between the given arrays @param t0 The first array @param t1 The second array @return The distance @throws IllegalArgumentException If the given array do not have the same length
[ "Computes", "the", "Euclidean", "distance", "between", "the", "given", "arrays" ]
train
https://github.com/javagl/ND/blob/bcb655aaf5fc88af6194f73a27cca079186ff559/nd-distance/src/main/java/de/javagl/nd/distance/tuples/j/LongTupleDistanceFunctions.java#L183-L186
apache/flink
flink-runtime/src/main/java/org/apache/flink/runtime/state/filesystem/AbstractFsCheckpointStorage.java
AbstractFsCheckpointStorage.decodePathFromReference
public static Path decodePathFromReference(CheckpointStorageLocationReference reference) { """ Decodes the given reference into a path. This method validates that the reference bytes start with the correct magic number (as written by {@link #encodePathAsReference(Path)}) and converts the remaining bytes back to ...
java
public static Path decodePathFromReference(CheckpointStorageLocationReference reference) { if (reference.isDefaultReference()) { throw new IllegalArgumentException("Cannot decode default reference"); } final byte[] bytes = reference.getReferenceBytes(); final int headerLen = REFERENCE_MAGIC_NUMBER.length; ...
[ "public", "static", "Path", "decodePathFromReference", "(", "CheckpointStorageLocationReference", "reference", ")", "{", "if", "(", "reference", ".", "isDefaultReference", "(", ")", ")", "{", "throw", "new", "IllegalArgumentException", "(", "\"Cannot decode default refere...
Decodes the given reference into a path. This method validates that the reference bytes start with the correct magic number (as written by {@link #encodePathAsReference(Path)}) and converts the remaining bytes back to a proper path. @param reference The bytes representing the reference. @return The path decoded from t...
[ "Decodes", "the", "given", "reference", "into", "a", "path", ".", "This", "method", "validates", "that", "the", "reference", "bytes", "start", "with", "the", "correct", "magic", "number", "(", "as", "written", "by", "{", "@link", "#encodePathAsReference", "(",...
train
https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-runtime/src/main/java/org/apache/flink/runtime/state/filesystem/AbstractFsCheckpointStorage.java#L311-L338
alkacon/opencms-core
src/org/opencms/ui/components/CmsResourceIcon.java
CmsResourceIcon.getOverlaySpan
private static String getOverlaySpan(String cssClass, String title) { """ Generates an overlay icon span.<p> @param title the span title @param cssClass the CSS class @return the span element string """ StringBuffer result = new StringBuffer(); result.append("<span class=\"").append(css...
java
private static String getOverlaySpan(String cssClass, String title) { StringBuffer result = new StringBuffer(); result.append("<span class=\"").append(cssClass).append("\""); if (title != null) { result.append(" title=\"").append(title).append("\""); } result.append(...
[ "private", "static", "String", "getOverlaySpan", "(", "String", "cssClass", ",", "String", "title", ")", "{", "StringBuffer", "result", "=", "new", "StringBuffer", "(", ")", ";", "result", ".", "append", "(", "\"<span class=\\\"\"", ")", ".", "append", "(", ...
Generates an overlay icon span.<p> @param title the span title @param cssClass the CSS class @return the span element string
[ "Generates", "an", "overlay", "icon", "span", ".", "<p", ">" ]
train
https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/ui/components/CmsResourceIcon.java#L424-L433
BioPAX/Paxtools
paxtools-query/src/main/java/org/biopax/paxtools/query/algorithm/BFS.java
BFS.isEquivalentInTheSet
protected boolean isEquivalentInTheSet(Node node, Set<Node> set) { """ Checks if an equivalent of the given node is in the set. @param node Node to check equivalents @param set Node set @return true if an equivalent is in the set """ return set.contains(node) || isEquivalentInTheSet(node, UPWARD, set...
java
protected boolean isEquivalentInTheSet(Node node, Set<Node> set) { return set.contains(node) || isEquivalentInTheSet(node, UPWARD, set) || isEquivalentInTheSet(node, DOWNWARD, set); }
[ "protected", "boolean", "isEquivalentInTheSet", "(", "Node", "node", ",", "Set", "<", "Node", ">", "set", ")", "{", "return", "set", ".", "contains", "(", "node", ")", "||", "isEquivalentInTheSet", "(", "node", ",", "UPWARD", ",", "set", ")", "||", "isEq...
Checks if an equivalent of the given node is in the set. @param node Node to check equivalents @param set Node set @return true if an equivalent is in the set
[ "Checks", "if", "an", "equivalent", "of", "the", "given", "node", "is", "in", "the", "set", "." ]
train
https://github.com/BioPAX/Paxtools/blob/2f93afa94426bf8b5afc2e0e61cd4b269a83288d/paxtools-query/src/main/java/org/biopax/paxtools/query/algorithm/BFS.java#L267-L271
JOML-CI/JOML
src/org/joml/Matrix3x2f.java
Matrix3x2f.translateLocal
public Matrix3x2f translateLocal(float x, float y, Matrix3x2f dest) { """ Pre-multiply a translation to this matrix by translating by the given number of units in x and y and store the result in <code>dest</code>. <p> If <code>M</code> is <code>this</code> matrix and <code>T</code> the translation matrix, then...
java
public Matrix3x2f translateLocal(float x, float y, Matrix3x2f dest) { dest.m00 = m00; dest.m01 = m01; dest.m10 = m10; dest.m11 = m11; dest.m20 = m20 + x; dest.m21 = m21 + y; return dest; }
[ "public", "Matrix3x2f", "translateLocal", "(", "float", "x", ",", "float", "y", ",", "Matrix3x2f", "dest", ")", "{", "dest", ".", "m00", "=", "m00", ";", "dest", ".", "m01", "=", "m01", ";", "dest", ".", "m10", "=", "m10", ";", "dest", ".", "m11", ...
Pre-multiply a translation to this matrix by translating by the given number of units in x and y and store the result in <code>dest</code>. <p> If <code>M</code> is <code>this</code> matrix and <code>T</code> the translation matrix, then the new matrix will be <code>T * M</code>. So when transforming a vector <code>v</...
[ "Pre", "-", "multiply", "a", "translation", "to", "this", "matrix", "by", "translating", "by", "the", "given", "number", "of", "units", "in", "x", "and", "y", "and", "store", "the", "result", "in", "<code", ">", "dest<", "/", "code", ">", ".", "<p", ...
train
https://github.com/JOML-CI/JOML/blob/ce2652fc236b42bda3875c591f8e6645048a678f/src/org/joml/Matrix3x2f.java#L686-L694
lettuce-io/lettuce-core
src/main/java/io/lettuce/core/internal/TimeoutProvider.java
TimeoutProvider.getTimeoutNs
public long getTimeoutNs(RedisCommand<?, ?, ?> command) { """ Returns the timeout in {@link TimeUnit#NANOSECONDS} for {@link RedisCommand}. @param command the command. @return timeout in {@link TimeUnit#NANOSECONDS}. """ long timeoutNs = -1; State state = this.state; if (state == ...
java
public long getTimeoutNs(RedisCommand<?, ?, ?> command) { long timeoutNs = -1; State state = this.state; if (state == null) { state = this.state = new State(timeoutOptionsSupplier.get()); } if (!state.applyDefaultTimeout) { timeoutNs = state.timeoutSour...
[ "public", "long", "getTimeoutNs", "(", "RedisCommand", "<", "?", ",", "?", ",", "?", ">", "command", ")", "{", "long", "timeoutNs", "=", "-", "1", ";", "State", "state", "=", "this", ".", "state", ";", "if", "(", "state", "==", "null", ")", "{", ...
Returns the timeout in {@link TimeUnit#NANOSECONDS} for {@link RedisCommand}. @param command the command. @return timeout in {@link TimeUnit#NANOSECONDS}.
[ "Returns", "the", "timeout", "in", "{", "@link", "TimeUnit#NANOSECONDS", "}", "for", "{", "@link", "RedisCommand", "}", "." ]
train
https://github.com/lettuce-io/lettuce-core/blob/b6de74e384dea112e3656684ca3f50cdfd6c8e0d/src/main/java/io/lettuce/core/internal/TimeoutProvider.java#L62-L76
Azure/azure-sdk-for-java
mixedreality/resource-manager/v2019_02_28_preview/src/main/java/com/microsoft/azure/management/mixedreality/v2019_02_28_preview/implementation/SpatialAnchorsAccountsInner.java
SpatialAnchorsAccountsInner.create
public SpatialAnchorsAccountInner create(String resourceGroupName, String spatialAnchorsAccountName, SpatialAnchorsAccountInner spatialAnchorsAccount) { """ Creating or Updating a Spatial Anchors Account. @param resourceGroupName Name of an Azure resource group. @param spatialAnchorsAccountName Name of an Mixe...
java
public SpatialAnchorsAccountInner create(String resourceGroupName, String spatialAnchorsAccountName, SpatialAnchorsAccountInner spatialAnchorsAccount) { return createWithServiceResponseAsync(resourceGroupName, spatialAnchorsAccountName, spatialAnchorsAccount).toBlocking().single().body(); }
[ "public", "SpatialAnchorsAccountInner", "create", "(", "String", "resourceGroupName", ",", "String", "spatialAnchorsAccountName", ",", "SpatialAnchorsAccountInner", "spatialAnchorsAccount", ")", "{", "return", "createWithServiceResponseAsync", "(", "resourceGroupName", ",", "sp...
Creating or Updating a Spatial Anchors Account. @param resourceGroupName Name of an Azure resource group. @param spatialAnchorsAccountName Name of an Mixed Reality Spatial Anchors Account. @param spatialAnchorsAccount Spatial Anchors Account parameter. @throws IllegalArgumentException thrown if parameters fail the val...
[ "Creating", "or", "Updating", "a", "Spatial", "Anchors", "Account", "." ]
train
https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/mixedreality/resource-manager/v2019_02_28_preview/src/main/java/com/microsoft/azure/management/mixedreality/v2019_02_28_preview/implementation/SpatialAnchorsAccountsInner.java#L611-L613
alkacon/opencms-core
src-gwt/org/opencms/acacia/client/widgets/complex/CmsDataViewClientWidget.java
CmsDataViewClientWidget.createWidget
Widget createWidget() { """ Creates the correct widget based on the configuration.<p> @return the new widget """ if (isTrue(m_jsonConfig, CmsDataViewConstants.CONFIG_PREVIEW)) { return new CmsDataViewPreviewWidget( m_config, m_valueAccessor, ...
java
Widget createWidget() { if (isTrue(m_jsonConfig, CmsDataViewConstants.CONFIG_PREVIEW)) { return new CmsDataViewPreviewWidget( m_config, m_valueAccessor, new CmsDataViewPreviewWidget.ContentImageLoader()); } else { I_ImageProvider p...
[ "Widget", "createWidget", "(", ")", "{", "if", "(", "isTrue", "(", "m_jsonConfig", ",", "CmsDataViewConstants", ".", "CONFIG_PREVIEW", ")", ")", "{", "return", "new", "CmsDataViewPreviewWidget", "(", "m_config", ",", "m_valueAccessor", ",", "new", "CmsDataViewPrev...
Creates the correct widget based on the configuration.<p> @return the new widget
[ "Creates", "the", "correct", "widget", "based", "on", "the", "configuration", ".", "<p", ">" ]
train
https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src-gwt/org/opencms/acacia/client/widgets/complex/CmsDataViewClientWidget.java#L172-L189
OpenLiberty/open-liberty
dev/com.ibm.ws.webcontainer.security/src/com/ibm/ws/webcontainer/security/internal/SRTServletRequestUtils.java
SRTServletRequestUtils.getPrivateAttribute
public static Object getPrivateAttribute(HttpServletRequest req, String key) { """ Get private attribute value from the request (if applicable). If the request object is of an unexpected type, a {@code null} is returned. @param req @param key @return The attribute value, or {@code null} if the object type is...
java
public static Object getPrivateAttribute(HttpServletRequest req, String key) { HttpServletRequest sr = getWrappedServletRequestObject(req); if (sr instanceof IPrivateRequestAttributes) { return ((IPrivateRequestAttributes) sr).getPrivateAttribute(key); } else { if (tc.isD...
[ "public", "static", "Object", "getPrivateAttribute", "(", "HttpServletRequest", "req", ",", "String", "key", ")", "{", "HttpServletRequest", "sr", "=", "getWrappedServletRequestObject", "(", "req", ")", ";", "if", "(", "sr", "instanceof", "IPrivateRequestAttributes", ...
Get private attribute value from the request (if applicable). If the request object is of an unexpected type, a {@code null} is returned. @param req @param key @return The attribute value, or {@code null} if the object type is unexpected @see IPrivateRequestAttributes#getPrivateAttribute(String)
[ "Get", "private", "attribute", "value", "from", "the", "request", "(", "if", "applicable", ")", ".", "If", "the", "request", "object", "is", "of", "an", "unexpected", "type", "a", "{", "@code", "null", "}", "is", "returned", "." ]
train
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.webcontainer.security/src/com/ibm/ws/webcontainer/security/internal/SRTServletRequestUtils.java#L36-L46
Omertron/api-themoviedb
src/main/java/com/omertron/themoviedbapi/methods/TmdbLists.java
TmdbLists.removeItem
public StatusCode removeItem(String sessionId, String listId, int mediaId) throws MovieDbException { """ This method lets users delete items from a list that they created. A valid session id is required. @param sessionId @param listId @param mediaId @return @throws MovieDbException """ return...
java
public StatusCode removeItem(String sessionId, String listId, int mediaId) throws MovieDbException { return modifyMovieList(sessionId, listId, mediaId, MethodSub.REMOVE_ITEM); }
[ "public", "StatusCode", "removeItem", "(", "String", "sessionId", ",", "String", "listId", ",", "int", "mediaId", ")", "throws", "MovieDbException", "{", "return", "modifyMovieList", "(", "sessionId", ",", "listId", ",", "mediaId", ",", "MethodSub", ".", "REMOVE...
This method lets users delete items from a list that they created. A valid session id is required. @param sessionId @param listId @param mediaId @return @throws MovieDbException
[ "This", "method", "lets", "users", "delete", "items", "from", "a", "list", "that", "they", "created", "." ]
train
https://github.com/Omertron/api-themoviedb/blob/bf132d7c7271734e13b58ba3bc92bba46f220118/src/main/java/com/omertron/themoviedbapi/methods/TmdbLists.java#L212-L214
zaproxy/zaproxy
src/org/parosproxy/paros/db/AbstractDatabase.java
AbstractDatabase.notifyListenersDatabaseOpen
protected void notifyListenersDatabaseOpen(Collection<DatabaseListener> listeners, DatabaseServer databaseServer) throws DatabaseException { """ Notifies the given listeners that the given database server was opened. @param listeners the listeners that will be notified @param databaseServer the dat...
java
protected void notifyListenersDatabaseOpen(Collection<DatabaseListener> listeners, DatabaseServer databaseServer) throws DatabaseException { for (DatabaseListener databaseListener : listeners) { try { databaseListener.databaseOpen(databaseServer); } catch (Dat...
[ "protected", "void", "notifyListenersDatabaseOpen", "(", "Collection", "<", "DatabaseListener", ">", "listeners", ",", "DatabaseServer", "databaseServer", ")", "throws", "DatabaseException", "{", "for", "(", "DatabaseListener", "databaseListener", ":", "listeners", ")", ...
Notifies the given listeners that the given database server was opened. @param listeners the listeners that will be notified @param databaseServer the database server that was opened @throws DatabaseException if an error occurred while notifying the database listeners.
[ "Notifies", "the", "given", "listeners", "that", "the", "given", "database", "server", "was", "opened", "." ]
train
https://github.com/zaproxy/zaproxy/blob/0cbe5121f2ae1ecca222513d182759210c569bec/src/org/parosproxy/paros/db/AbstractDatabase.java#L94-L103
Azure/azure-sdk-for-java
cognitiveservices/data-plane/vision/customvision/training/src/main/java/com/microsoft/azure/cognitiveservices/vision/customvision/training/implementation/TrainingsImpl.java
TrainingsImpl.createImagesFromFiles
public ImageCreateSummary createImagesFromFiles(UUID projectId, ImageFileCreateBatch batch) { """ Add the provided batch of images to the set of training images. This API accepts a batch of files, and optionally tags, to create images. There is a limit of 64 images and 20 tags. @param projectId The project id ...
java
public ImageCreateSummary createImagesFromFiles(UUID projectId, ImageFileCreateBatch batch) { return createImagesFromFilesWithServiceResponseAsync(projectId, batch).toBlocking().single().body(); }
[ "public", "ImageCreateSummary", "createImagesFromFiles", "(", "UUID", "projectId", ",", "ImageFileCreateBatch", "batch", ")", "{", "return", "createImagesFromFilesWithServiceResponseAsync", "(", "projectId", ",", "batch", ")", ".", "toBlocking", "(", ")", ".", "single",...
Add the provided batch of images to the set of training images. This API accepts a batch of files, and optionally tags, to create images. There is a limit of 64 images and 20 tags. @param projectId The project id @param batch The batch of image files to add. Limited to 64 images and 20 tags per batch @throws IllegalAr...
[ "Add", "the", "provided", "batch", "of", "images", "to", "the", "set", "of", "training", "images", ".", "This", "API", "accepts", "a", "batch", "of", "files", "and", "optionally", "tags", "to", "create", "images", ".", "There", "is", "a", "limit", "of", ...
train
https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/cognitiveservices/data-plane/vision/customvision/training/src/main/java/com/microsoft/azure/cognitiveservices/vision/customvision/training/implementation/TrainingsImpl.java#L3928-L3930
ManfredTremmel/gwt-commons-lang3
src/main/java/org/apache/commons/lang3/ClassUtils.java
ClassUtils.isAssignable
@GwtIncompatible("incompatible method") public static boolean isAssignable(Class<?>[] classArray, Class<?>[] toClassArray, final boolean autoboxing) { """ <p>Checks if an array of Classes can be assigned to another array of Classes.</p> <p>This method calls {@link #isAssignable(Class, Class) isAssignable} f...
java
@GwtIncompatible("incompatible method") public static boolean isAssignable(Class<?>[] classArray, Class<?>[] toClassArray, final boolean autoboxing) { if (!ArrayUtils.isSameLength(classArray, toClassArray)) { return false; } if (classArray == null) { classArray = Arra...
[ "@", "GwtIncompatible", "(", "\"incompatible method\"", ")", "public", "static", "boolean", "isAssignable", "(", "Class", "<", "?", ">", "[", "]", "classArray", ",", "Class", "<", "?", ">", "[", "]", "toClassArray", ",", "final", "boolean", "autoboxing", ")"...
<p>Checks if an array of Classes can be assigned to another array of Classes.</p> <p>This method calls {@link #isAssignable(Class, Class) isAssignable} for each Class pair in the input arrays. It can be used to check if a set of arguments (the first parameter) are suitably compatible with a set of method parameter typ...
[ "<p", ">", "Checks", "if", "an", "array", "of", "Classes", "can", "be", "assigned", "to", "another", "array", "of", "Classes", ".", "<", "/", "p", ">" ]
train
https://github.com/ManfredTremmel/gwt-commons-lang3/blob/9e2dfbbda3668cfa5d935fe76479d1426c294504/src/main/java/org/apache/commons/lang3/ClassUtils.java#L685-L702
web3j/web3j
core/src/main/java/org/web3j/crypto/WalletUtils.java
WalletUtils.generateBip39Wallet
public static Bip39Wallet generateBip39Wallet(String password, File destinationDirectory) throws CipherException, IOException { """ Generates a BIP-39 compatible Ethereum wallet. The private key for the wallet can be calculated using following algorithm: <pre> Key = SHA-256(BIP_39_SEED(mnemonic, pas...
java
public static Bip39Wallet generateBip39Wallet(String password, File destinationDirectory) throws CipherException, IOException { byte[] initialEntropy = new byte[16]; secureRandom.nextBytes(initialEntropy); String mnemonic = MnemonicUtils.generateMnemonic(initialEntropy); byt...
[ "public", "static", "Bip39Wallet", "generateBip39Wallet", "(", "String", "password", ",", "File", "destinationDirectory", ")", "throws", "CipherException", ",", "IOException", "{", "byte", "[", "]", "initialEntropy", "=", "new", "byte", "[", "16", "]", ";", "sec...
Generates a BIP-39 compatible Ethereum wallet. The private key for the wallet can be calculated using following algorithm: <pre> Key = SHA-256(BIP_39_SEED(mnemonic, password)) </pre> @param password Will be used for both wallet encryption and passphrase for BIP-39 seed @param destinationDirectory The directory contain...
[ "Generates", "a", "BIP", "-", "39", "compatible", "Ethereum", "wallet", ".", "The", "private", "key", "for", "the", "wallet", "can", "be", "calculated", "using", "following", "algorithm", ":", "<pre", ">", "Key", "=", "SHA", "-", "256", "(", "BIP_39_SEED",...
train
https://github.com/web3j/web3j/blob/f99ceb19cdd65895c18e0a565034767ca18ea9fc/core/src/main/java/org/web3j/crypto/WalletUtils.java#L97-L109
bazaarvoice/emodb
sor-api/src/main/java/com/bazaarvoice/emodb/sor/delta/impl/LiteralImpl.java
LiteralImpl.areClassesEqual
private boolean areClassesEqual(Class<?> c1, Class<?> c2) { """ When comparing literals allow subclasses of Maps and Lists to be directly compared even if they have different implementations. """ if (isMap(c1)) { return isMap(c2); } else if (isList(c1)) { return isList(...
java
private boolean areClassesEqual(Class<?> c1, Class<?> c2) { if (isMap(c1)) { return isMap(c2); } else if (isList(c1)) { return isList(c2); } else { return c1.equals(c2); } }
[ "private", "boolean", "areClassesEqual", "(", "Class", "<", "?", ">", "c1", ",", "Class", "<", "?", ">", "c2", ")", "{", "if", "(", "isMap", "(", "c1", ")", ")", "{", "return", "isMap", "(", "c2", ")", ";", "}", "else", "if", "(", "isList", "("...
When comparing literals allow subclasses of Maps and Lists to be directly compared even if they have different implementations.
[ "When", "comparing", "literals", "allow", "subclasses", "of", "Maps", "and", "Lists", "to", "be", "directly", "compared", "even", "if", "they", "have", "different", "implementations", "." ]
train
https://github.com/bazaarvoice/emodb/blob/97ec7671bc78b47fc2a1c11298c0c872bd5ec7fb/sor-api/src/main/java/com/bazaarvoice/emodb/sor/delta/impl/LiteralImpl.java#L139-L147
brianwhu/xillium
data/src/main/java/org/xillium/data/persistence/ParametricStatement.java
ParametricStatement.executeUpdate
public int executeUpdate(Connection conn, DataObject object) throws SQLException { """ Executes an UPDATE or DELETE statement. @return the number of rows affected """ PreparedStatement statement = conn.prepareStatement(_sql); try { load(statement, object); return stat...
java
public int executeUpdate(Connection conn, DataObject object) throws SQLException { PreparedStatement statement = conn.prepareStatement(_sql); try { load(statement, object); return statement.executeUpdate(); } finally { statement.close(); } }
[ "public", "int", "executeUpdate", "(", "Connection", "conn", ",", "DataObject", "object", ")", "throws", "SQLException", "{", "PreparedStatement", "statement", "=", "conn", ".", "prepareStatement", "(", "_sql", ")", ";", "try", "{", "load", "(", "statement", "...
Executes an UPDATE or DELETE statement. @return the number of rows affected
[ "Executes", "an", "UPDATE", "or", "DELETE", "statement", "." ]
train
https://github.com/brianwhu/xillium/blob/e8dbf8cb6589fa1031a0bfcdcb58cb03d2ba7799/data/src/main/java/org/xillium/data/persistence/ParametricStatement.java#L271-L279
apereo/cas
core/cas-server-core-services-api/src/main/java/org/apereo/cas/services/DefaultRegisteredServiceAccessStrategy.java
DefaultRegisteredServiceAccessStrategy.enoughAttributesAvailableToProcess
protected boolean enoughAttributesAvailableToProcess(final String principal, final Map<String, Object> principalAttributes) { """ Enough attributes available to process? Check collection sizes and determine if we have enough data to move on. @param principal the principal @param principalAttributes ...
java
protected boolean enoughAttributesAvailableToProcess(final String principal, final Map<String, Object> principalAttributes) { if (!enoughRequiredAttributesAvailableToProcess(principalAttributes, this.requiredAttributes)) { return false; } if (principalAttributes.size() < this.rejecte...
[ "protected", "boolean", "enoughAttributesAvailableToProcess", "(", "final", "String", "principal", ",", "final", "Map", "<", "String", ",", "Object", ">", "principalAttributes", ")", "{", "if", "(", "!", "enoughRequiredAttributesAvailableToProcess", "(", "principalAttri...
Enough attributes available to process? Check collection sizes and determine if we have enough data to move on. @param principal the principal @param principalAttributes the principal attributes @return true /false
[ "Enough", "attributes", "available", "to", "process?", "Check", "collection", "sizes", "and", "determine", "if", "we", "have", "enough", "data", "to", "move", "on", "." ]
train
https://github.com/apereo/cas/blob/b4b306433a8782cef803a39bea5b1f96740e0e9b/core/cas-server-core-services-api/src/main/java/org/apereo/cas/services/DefaultRegisteredServiceAccessStrategy.java#L222-L232
sachin-handiekar/jMusixMatch
src/main/java/org/jmusixmatch/MusixMatch.java
MusixMatch.getMatchingTrack
public Track getMatchingTrack(String q_track, String q_artist) throws MusixMatchException { """ Get the most matching track which was retrieved using the search. @param q_track search for text string among track names @param q_artist search for text string among artist names @return the track @throws Mu...
java
public Track getMatchingTrack(String q_track, String q_artist) throws MusixMatchException { Track track = new Track(); Map<String, Object> params = new HashMap<String, Object>(); params.put(Constants.API_KEY, apiKey); params.put(Constants.QUERY_TRACK, q_track); params.put(Constants.QUERY_ARTIST, q_artist)...
[ "public", "Track", "getMatchingTrack", "(", "String", "q_track", ",", "String", "q_artist", ")", "throws", "MusixMatchException", "{", "Track", "track", "=", "new", "Track", "(", ")", ";", "Map", "<", "String", ",", "Object", ">", "params", "=", "new", "Ha...
Get the most matching track which was retrieved using the search. @param q_track search for text string among track names @param q_artist search for text string among artist names @return the track @throws MusixMatchException
[ "Get", "the", "most", "matching", "track", "which", "was", "retrieved", "using", "the", "search", "." ]
train
https://github.com/sachin-handiekar/jMusixMatch/blob/da909f7732053a801ea7282fe9a8bce385fa3763/src/main/java/org/jmusixmatch/MusixMatch.java#L238-L250
io7m/jaffirm
com.io7m.jaffirm.core/src/main/java/com/io7m/jaffirm/core/Invariants.java
Invariants.checkInvariantD
public static double checkInvariantD( final double value, final ContractDoubleConditionType condition) throws InvariantViolationException { """ A {@code double} specialized version of {@link #checkInvariant(Object, ContractConditionType)}. @param value The value @param condition The predicate ...
java
public static double checkInvariantD( final double value, final ContractDoubleConditionType condition) throws InvariantViolationException { return checkInvariantD(value, condition.predicate(), condition.describer()); }
[ "public", "static", "double", "checkInvariantD", "(", "final", "double", "value", ",", "final", "ContractDoubleConditionType", "condition", ")", "throws", "InvariantViolationException", "{", "return", "checkInvariantD", "(", "value", ",", "condition", ".", "predicate", ...
A {@code double} specialized version of {@link #checkInvariant(Object, ContractConditionType)}. @param value The value @param condition The predicate @return value @throws InvariantViolationException If the predicate is false
[ "A", "{", "@code", "double", "}", "specialized", "version", "of", "{", "@link", "#checkInvariant", "(", "Object", "ContractConditionType", ")", "}", "." ]
train
https://github.com/io7m/jaffirm/blob/c97d246242d381e48832838737418cfe4cb57b4d/com.io7m.jaffirm.core/src/main/java/com/io7m/jaffirm/core/Invariants.java#L500-L506
Jasig/uPortal
uPortal-tools/src/main/java/org/apereo/portal/shell/PortalShellBuildHelperImpl.java
PortalShellBuildHelperImpl.updateScript
private void updateScript( String target, String databaseQualifier, String outputFile, boolean runIt) { """ This runs a database update or just generates the script @param target the database to target @param databaseQualifier The Spring database qualifier @param outputFile The output file to util...
java
private void updateScript( String target, String databaseQualifier, String outputFile, boolean runIt) { final ISchemaExport schemaExportBean = this.getSchemaExport(databaseQualifier); if (schemaExportBean == null) { throw new RuntimeException( target + " could...
[ "private", "void", "updateScript", "(", "String", "target", ",", "String", "databaseQualifier", ",", "String", "outputFile", ",", "boolean", "runIt", ")", "{", "final", "ISchemaExport", "schemaExportBean", "=", "this", ".", "getSchemaExport", "(", "databaseQualifier...
This runs a database update or just generates the script @param target the database to target @param databaseQualifier The Spring database qualifier @param outputFile The output file to utilize to generate the scripts @param runIt Do you want to run it, or just generate the script?
[ "This", "runs", "a", "database", "update", "or", "just", "generates", "the", "script" ]
train
https://github.com/Jasig/uPortal/blob/c1986542abb9acd214268f2df21c6305ad2f262b/uPortal-tools/src/main/java/org/apereo/portal/shell/PortalShellBuildHelperImpl.java#L189-L208
hazelcast/hazelcast
hazelcast/src/main/java/com/hazelcast/map/impl/recordstore/AbstractEvictableRecordStore.java
AbstractEvictableRecordStore.getOrNullIfExpired
protected Record getOrNullIfExpired(Record record, long now, boolean backup) { """ Check if record is reachable according to TTL or idle times. If not reachable return null. @param record {@link com.hazelcast.map.impl.record.Record} @return null if evictable. """ if (!isRecordStoreExpirable()) { ...
java
protected Record getOrNullIfExpired(Record record, long now, boolean backup) { if (!isRecordStoreExpirable()) { return record; } if (record == null) { return null; } Data key = record.getKey(); if (isLocked(key)) { return record; ...
[ "protected", "Record", "getOrNullIfExpired", "(", "Record", "record", ",", "long", "now", ",", "boolean", "backup", ")", "{", "if", "(", "!", "isRecordStoreExpirable", "(", ")", ")", "{", "return", "record", ";", "}", "if", "(", "record", "==", "null", "...
Check if record is reachable according to TTL or idle times. If not reachable return null. @param record {@link com.hazelcast.map.impl.record.Record} @return null if evictable.
[ "Check", "if", "record", "is", "reachable", "according", "to", "TTL", "or", "idle", "times", ".", "If", "not", "reachable", "return", "null", "." ]
train
https://github.com/hazelcast/hazelcast/blob/8c4bc10515dbbfb41a33e0302c0caedf3cda1baf/hazelcast/src/main/java/com/hazelcast/map/impl/recordstore/AbstractEvictableRecordStore.java#L220-L239
Blazebit/blaze-utils
blaze-common-utils/src/main/java/com/blazebit/reflection/ReflectionUtils.java
ReflectionUtils.getMethod
public static Method getMethod(Class<?> clazz, final String methodName, final Class<?>... parameterTypes) { """ Returns the method object found for the given method name in the given class. This method traverses through the super classes of the given class and tries to find the method as declared method within t...
java
public static Method getMethod(Class<?> clazz, final String methodName, final Class<?>... parameterTypes) { final String internedName = methodName.intern(); return traverseHierarchy(clazz, new TraverseTask<Method>() { @Override public Method run(Class<?> clazz) { ...
[ "public", "static", "Method", "getMethod", "(", "Class", "<", "?", ">", "clazz", ",", "final", "String", "methodName", ",", "final", "Class", "<", "?", ">", "...", "parameterTypes", ")", "{", "final", "String", "internedName", "=", "methodName", ".", "inte...
Returns the method object found for the given method name in the given class. This method traverses through the super classes of the given class and tries to find the method as declared method within these classes. When the object class is reached the traversing stops. If the method can not be found, null is returned. ...
[ "Returns", "the", "method", "object", "found", "for", "the", "given", "method", "name", "in", "the", "given", "class", ".", "This", "method", "traverses", "through", "the", "super", "classes", "of", "the", "given", "class", "and", "tries", "to", "find", "t...
train
https://github.com/Blazebit/blaze-utils/blob/3e35a694a8f71d515aad066196acd523994d6aaa/blaze-common-utils/src/main/java/com/blazebit/reflection/ReflectionUtils.java#L845-L867
google/error-prone-javac
src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/HtmlDocletWriter.java
HtmlDocletWriter.addAnnotationInfo
public boolean addAnnotationInfo(int indent, Element element, VariableElement param, Content tree) { """ Add the annotatation types for the given element and parameter. @param indent the number of spaces to indent the parameters. @param element the element to write annotations for. @param param th...
java
public boolean addAnnotationInfo(int indent, Element element, VariableElement param, Content tree) { return addAnnotationInfo(indent, element, param.getAnnotationMirrors(), false, tree); }
[ "public", "boolean", "addAnnotationInfo", "(", "int", "indent", ",", "Element", "element", ",", "VariableElement", "param", ",", "Content", "tree", ")", "{", "return", "addAnnotationInfo", "(", "indent", ",", "element", ",", "param", ".", "getAnnotationMirrors", ...
Add the annotatation types for the given element and parameter. @param indent the number of spaces to indent the parameters. @param element the element to write annotations for. @param param the parameter to write annotations for. @param tree the content tree to which the annotation types will be added
[ "Add", "the", "annotatation", "types", "for", "the", "given", "element", "and", "parameter", "." ]
train
https://github.com/google/error-prone-javac/blob/a53d069bbdb2c60232ed3811c19b65e41c3e60e0/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/HtmlDocletWriter.java#L2255-L2258
h2oai/h2o-3
h2o-core/src/main/java/hex/quantile/Quantile.java
Quantile.computeQuantile
static double computeQuantile( double lo, double hi, double row, double nrows, double prob, QuantileModel.CombineMethod method ) { """ Compute the correct final quantile from these 4 values. If the lo and hi elements are equal, use them. However if they differ, then there is no single value which exactly match...
java
static double computeQuantile( double lo, double hi, double row, double nrows, double prob, QuantileModel.CombineMethod method ) { if( lo==hi ) return lo; // Equal; pick either if( method == null ) method= QuantileModel.CombineMethod.INTERPOLATE; switch( method ) { case INTERPOLATE: return linearInt...
[ "static", "double", "computeQuantile", "(", "double", "lo", ",", "double", "hi", ",", "double", "row", ",", "double", "nrows", ",", "double", "prob", ",", "QuantileModel", ".", "CombineMethod", "method", ")", "{", "if", "(", "lo", "==", "hi", ")", "retur...
Compute the correct final quantile from these 4 values. If the lo and hi elements are equal, use them. However if they differ, then there is no single value which exactly matches the desired quantile. There are several well-accepted definitions in this case - including picking either the lo or the hi, or averaging t...
[ "Compute", "the", "correct", "final", "quantile", "from", "these", "4", "values", ".", "If", "the", "lo", "and", "hi", "elements", "are", "equal", "use", "them", ".", "However", "if", "they", "differ", "then", "there", "is", "no", "single", "value", "whi...
train
https://github.com/h2oai/h2o-3/blob/845eb49dfeaadf638b6e2f779d82fac996391fad/h2o-core/src/main/java/hex/quantile/Quantile.java#L330-L342
rometools/rome
rome/src/main/java/com/rometools/rome/io/impl/PropertiesLoader.java
PropertiesLoader.getTokenizedProperty
public String[] getTokenizedProperty(final String key, final String separator) { """ Returns an array of tokenized values stored under a property key in all properties files. If the master file has this property its tokens will be the first ones in the array. <p> @param key property key to retrieve values ...
java
public String[] getTokenizedProperty(final String key, final String separator) { final List<String> entriesList = new ArrayList<String>(); for (final Properties property : properties) { final String values = property.getProperty(key); if (values != null) { final StringTokenizer st = new StringTokenizer(va...
[ "public", "String", "[", "]", "getTokenizedProperty", "(", "final", "String", "key", ",", "final", "String", "separator", ")", "{", "final", "List", "<", "String", ">", "entriesList", "=", "new", "ArrayList", "<", "String", ">", "(", ")", ";", "for", "("...
Returns an array of tokenized values stored under a property key in all properties files. If the master file has this property its tokens will be the first ones in the array. <p> @param key property key to retrieve values @param separator String with all separator characters to tokenize from the values in all properti...
[ "Returns", "an", "array", "of", "tokenized", "values", "stored", "under", "a", "property", "key", "in", "all", "properties", "files", ".", "If", "the", "master", "file", "has", "this", "property", "its", "tokens", "will", "be", "the", "first", "ones", "in"...
train
https://github.com/rometools/rome/blob/5fcf0b1a9a6cdedbe253a45ad9468c54a0f97010/rome/src/main/java/com/rometools/rome/io/impl/PropertiesLoader.java#L138-L153
JodaOrg/joda-time
src/main/java/org/joda/time/DateTimeUtils.java
DateTimeUtils.getReadableInterval
public static final ReadableInterval getReadableInterval(ReadableInterval interval) { """ Gets the interval handling null. <p> If the interval is <code>null</code>, an interval representing now to now in the {@link ISOChronology#getInstance() ISOChronology} will be returned. Otherwise, the interval specified i...
java
public static final ReadableInterval getReadableInterval(ReadableInterval interval) { if (interval == null) { long now = DateTimeUtils.currentTimeMillis(); interval = new Interval(now, now); } return interval; }
[ "public", "static", "final", "ReadableInterval", "getReadableInterval", "(", "ReadableInterval", "interval", ")", "{", "if", "(", "interval", "==", "null", ")", "{", "long", "now", "=", "DateTimeUtils", ".", "currentTimeMillis", "(", ")", ";", "interval", "=", ...
Gets the interval handling null. <p> If the interval is <code>null</code>, an interval representing now to now in the {@link ISOChronology#getInstance() ISOChronology} will be returned. Otherwise, the interval specified is returned. @param interval the interval to use, null means now to now @return the interval, neve...
[ "Gets", "the", "interval", "handling", "null", ".", "<p", ">", "If", "the", "interval", "is", "<code", ">", "null<", "/", "code", ">", "an", "interval", "representing", "now", "to", "now", "in", "the", "{", "@link", "ISOChronology#getInstance", "()", "ISOC...
train
https://github.com/JodaOrg/joda-time/blob/bd79f1c4245e79b3c2c56d7b04fde2a6e191fa42/src/main/java/org/joda/time/DateTimeUtils.java#L249-L255
MariaDB/mariadb-connector-j
src/main/java/org/mariadb/jdbc/internal/util/Utils.java
Utils.standardSocket
public static Socket standardSocket(UrlParser urlParser, String host) throws IOException { """ Use standard socket implementation. @param urlParser url parser @param host host to connect @return socket @throws IOException in case of error establishing socket. """ SocketFactory socketFactory; ...
java
public static Socket standardSocket(UrlParser urlParser, String host) throws IOException { SocketFactory socketFactory; String socketFactoryName = urlParser.getOptions().socketFactory; if (socketFactoryName != null) { try { @SuppressWarnings("unchecked") Class<? extends SocketFactory> ...
[ "public", "static", "Socket", "standardSocket", "(", "UrlParser", "urlParser", ",", "String", "host", ")", "throws", "IOException", "{", "SocketFactory", "socketFactory", ";", "String", "socketFactoryName", "=", "urlParser", ".", "getOptions", "(", ")", ".", "sock...
Use standard socket implementation. @param urlParser url parser @param host host to connect @return socket @throws IOException in case of error establishing socket.
[ "Use", "standard", "socket", "implementation", "." ]
train
https://github.com/MariaDB/mariadb-connector-j/blob/d148c7cd347c4680617be65d9e511b289d38a30b/src/main/java/org/mariadb/jdbc/internal/util/Utils.java#L119-L140
classgraph/classgraph
src/main/java/nonapi/io/github/classgraph/utils/FastPathResolver.java
FastPathResolver.normalizePath
public static String normalizePath(final String path, final boolean isFileOrJarURL) { """ Parse percent encoding, e.g. "%20" -&gt; " "; convert '/' or '\\' to SEP; remove trailing separator char if present. @param path The path to normalize. @param isFileOrJarURL True if this is a "file:" or "jar:" URL. @r...
java
public static String normalizePath(final String path, final boolean isFileOrJarURL) { final boolean hasPercent = path.indexOf('%') >= 0; if (!hasPercent && path.indexOf('\\') < 0 && !path.endsWith("/")) { return path; } else { final int len = path.length(); fi...
[ "public", "static", "String", "normalizePath", "(", "final", "String", "path", ",", "final", "boolean", "isFileOrJarURL", ")", "{", "final", "boolean", "hasPercent", "=", "path", ".", "indexOf", "(", "'", "'", ")", ">=", "0", ";", "if", "(", "!", "hasPer...
Parse percent encoding, e.g. "%20" -&gt; " "; convert '/' or '\\' to SEP; remove trailing separator char if present. @param path The path to normalize. @param isFileOrJarURL True if this is a "file:" or "jar:" URL. @return The normalized path.
[ "Parse", "percent", "encoding", "e", ".", "g", ".", "%20", "-", "&gt", ";", ";", "convert", "/", "or", "\\\\", "to", "SEP", ";", "remove", "trailing", "separator", "char", "if", "present", "." ]
train
https://github.com/classgraph/classgraph/blob/c8c8b2ca1eb76339f69193fdac33d735c864215c/src/main/java/nonapi/io/github/classgraph/utils/FastPathResolver.java#L145-L173
wellner/jcarafe
jcarafe-core/src/main/java/cern/colt/list/BooleanArrayList.java
BooleanArrayList.countSortFromTo
public void countSortFromTo(int from, int to) { """ Sorts the specified range of the receiver into ascending numerical order (<tt>false &lt; true</tt>). The sorting algorithm is a count sort. This algorithm offers guaranteed O(n) performance without auxiliary memory. @param from the index of the first eleme...
java
public void countSortFromTo(int from, int to) { if (size==0) return; checkRangeFromTo(from, to, size); boolean[] theElements = elements; int trues = 0; for (int i=from; i<=to;) if (theElements[i++]) trues++; int falses = to-from+1-trues; if (falses>0) fillFromToWith(from,from+falses-1,false); if (t...
[ "public", "void", "countSortFromTo", "(", "int", "from", ",", "int", "to", ")", "{", "if", "(", "size", "==", "0", ")", "return", ";", "checkRangeFromTo", "(", "from", ",", "to", ",", "size", ")", ";", "boolean", "[", "]", "theElements", "=", "elemen...
Sorts the specified range of the receiver into ascending numerical order (<tt>false &lt; true</tt>). The sorting algorithm is a count sort. This algorithm offers guaranteed O(n) performance without auxiliary memory. @param from the index of the first element (inclusive) to be sorted. @param to the index of the last e...
[ "Sorts", "the", "specified", "range", "of", "the", "receiver", "into", "ascending", "numerical", "order", "(", "<tt", ">", "false", "&lt", ";", "true<", "/", "tt", ">", ")", "." ]
train
https://github.com/wellner/jcarafe/blob/ab8b0a83dbf600fe80c27711815c90bd3055b217/jcarafe-core/src/main/java/cern/colt/list/BooleanArrayList.java#L108-L119
albfernandez/itext2
src/main/java/com/lowagie/text/rtf/parser/properties/RtfProperty.java
RtfProperty.setToDefault
public void setToDefault(String propertyGroup) { """ Set individual property group to default values. @param propertyGroup <code>String</code> name of the property group to set to default. @since 2.0.8 """ if(COLOR.equals(propertyGroup)) { setProperty(COLOR_FG, new Color(0,0,0)); setProperty(COLOR...
java
public void setToDefault(String propertyGroup) { if(COLOR.equals(propertyGroup)) { setProperty(COLOR_FG, new Color(0,0,0)); setProperty(COLOR_BG, new Color(255,255,255)); return; } if(CHARACTER.equals(propertyGroup)) { setProperty(CHARACTER_BOLD, 0); setProperty(CHARACTER_UNDERLINE, 0); ...
[ "public", "void", "setToDefault", "(", "String", "propertyGroup", ")", "{", "if", "(", "COLOR", ".", "equals", "(", "propertyGroup", ")", ")", "{", "setProperty", "(", "COLOR_FG", ",", "new", "Color", "(", "0", ",", "0", ",", "0", ")", ")", ";", "set...
Set individual property group to default values. @param propertyGroup <code>String</code> name of the property group to set to default. @since 2.0.8
[ "Set", "individual", "property", "group", "to", "default", "values", "." ]
train
https://github.com/albfernandez/itext2/blob/438fc1899367fd13dfdfa8dfdca9a3c1a7783b84/src/main/java/com/lowagie/text/rtf/parser/properties/RtfProperty.java#L196-L240
azkaban/azkaban
azkaban-web-server/src/main/java/azkaban/webapp/servlet/LoginAbstractAzkabanServlet.java
LoginAbstractAzkabanServlet.filterProjectByPermission
protected Project filterProjectByPermission(final Project project, final User user, final Permission.Type type) { """ Filter Project based on user authorization @param project project @param user user @param type permission allowance @return authorized project itself or null if the project is not autho...
java
protected Project filterProjectByPermission(final Project project, final User user, final Permission.Type type) { return filterProjectByPermission(project, user, type, null); }
[ "protected", "Project", "filterProjectByPermission", "(", "final", "Project", "project", ",", "final", "User", "user", ",", "final", "Permission", ".", "Type", "type", ")", "{", "return", "filterProjectByPermission", "(", "project", ",", "user", ",", "type", ","...
Filter Project based on user authorization @param project project @param user user @param type permission allowance @return authorized project itself or null if the project is not authorized
[ "Filter", "Project", "based", "on", "user", "authorization" ]
train
https://github.com/azkaban/azkaban/blob/d258ea7d6e66807c6eff79c5325d6d3443618dff/azkaban-web-server/src/main/java/azkaban/webapp/servlet/LoginAbstractAzkabanServlet.java#L406-L409
GoogleCloudPlatform/appengine-mapreduce
java/src/main/java/com/google/appengine/tools/mapreduce/inputs/LevelDbInputReader.java
LevelDbInputReader.isValidCrc
private static boolean isValidCrc(int checksum, ByteBuffer data, byte type) { """ Validates that the {@link Crc32c} validates. @param checksum the checksum in the record. @param data the {@link ByteBuffer} of the data in the record. @param type the byte representing the {@link RecordType} of the record. @ret...
java
private static boolean isValidCrc(int checksum, ByteBuffer data, byte type) { if (checksum == 0 && type == 0) { return true; } Crc32c crc = new Crc32c(); crc.update(type); crc.update(data.array(), 0, data.limit()); return LevelDbConstants.unmaskCrc(checksum) == crc.getValue(); }
[ "private", "static", "boolean", "isValidCrc", "(", "int", "checksum", ",", "ByteBuffer", "data", ",", "byte", "type", ")", "{", "if", "(", "checksum", "==", "0", "&&", "type", "==", "0", ")", "{", "return", "true", ";", "}", "Crc32c", "crc", "=", "ne...
Validates that the {@link Crc32c} validates. @param checksum the checksum in the record. @param data the {@link ByteBuffer} of the data in the record. @param type the byte representing the {@link RecordType} of the record. @return true if the {@link Crc32c} validates.
[ "Validates", "that", "the", "{", "@link", "Crc32c", "}", "validates", "." ]
train
https://github.com/GoogleCloudPlatform/appengine-mapreduce/blob/2045eb3605b6ecb40c83d11dd5442a89fe5c5dd6/java/src/main/java/com/google/appengine/tools/mapreduce/inputs/LevelDbInputReader.java#L254-L263
facebook/fresco
drawee/src/main/java/com/facebook/drawee/view/SimpleDraweeView.java
SimpleDraweeView.setImageURI
public void setImageURI(@Nullable String uriString, @Nullable Object callerContext) { """ Displays an image given by the uri string. @param uriString uri string of the image @param callerContext caller context """ Uri uri = (uriString != null) ? Uri.parse(uriString) : null; setImageURI(uri, callerC...
java
public void setImageURI(@Nullable String uriString, @Nullable Object callerContext) { Uri uri = (uriString != null) ? Uri.parse(uriString) : null; setImageURI(uri, callerContext); }
[ "public", "void", "setImageURI", "(", "@", "Nullable", "String", "uriString", ",", "@", "Nullable", "Object", "callerContext", ")", "{", "Uri", "uri", "=", "(", "uriString", "!=", "null", ")", "?", "Uri", ".", "parse", "(", "uriString", ")", ":", "null",...
Displays an image given by the uri string. @param uriString uri string of the image @param callerContext caller context
[ "Displays", "an", "image", "given", "by", "the", "uri", "string", "." ]
train
https://github.com/facebook/fresco/blob/0b85879d51c5036d5e46e627a6651afefc0b971a/drawee/src/main/java/com/facebook/drawee/view/SimpleDraweeView.java#L178-L181
windup/windup
reporting/api/src/main/java/org/jboss/windup/reporting/freemarker/problemsummary/ProblemSummaryService.java
ProblemSummaryService.getProblemSummaries
public static Map<IssueCategoryModel, List<ProblemSummary>> getProblemSummaries( GraphContext graphContext, Set<ProjectModel> projectModels, Set<String> includeTags, Set<String> excludeTags) { """ Gets lists of {@link ProblemSummary} objects organized by {@link Issue...
java
public static Map<IssueCategoryModel, List<ProblemSummary>> getProblemSummaries( GraphContext graphContext, Set<ProjectModel> projectModels, Set<String> includeTags, Set<String> excludeTags) { return getProblemSummaries(graphContext, projectModels, includeTags...
[ "public", "static", "Map", "<", "IssueCategoryModel", ",", "List", "<", "ProblemSummary", ">", ">", "getProblemSummaries", "(", "GraphContext", "graphContext", ",", "Set", "<", "ProjectModel", ">", "projectModels", ",", "Set", "<", "String", ">", "includeTags", ...
Gets lists of {@link ProblemSummary} objects organized by {@link IssueCategoryModel}.
[ "Gets", "lists", "of", "{" ]
train
https://github.com/windup/windup/blob/6668f09e7f012d24a0b4212ada8809417225b2ad/reporting/api/src/main/java/org/jboss/windup/reporting/freemarker/problemsummary/ProblemSummaryService.java#L35-L42
looly/hutool
hutool-core/src/main/java/cn/hutool/core/util/NumberUtil.java
NumberUtil.div
public static BigDecimal div(Number v1, Number v2) { """ 提供(相对)精确的除法运算,当发生除不尽的情况的时候,精确到小数点后10位,后面的四舍五入 @param v1 被除数 @param v2 除数 @return 两个参数的商 @since 3.1.0 """ return div(v1, v2, DEFAUT_DIV_SCALE); }
java
public static BigDecimal div(Number v1, Number v2) { return div(v1, v2, DEFAUT_DIV_SCALE); }
[ "public", "static", "BigDecimal", "div", "(", "Number", "v1", ",", "Number", "v2", ")", "{", "return", "div", "(", "v1", ",", "v2", ",", "DEFAUT_DIV_SCALE", ")", ";", "}" ]
提供(相对)精确的除法运算,当发生除不尽的情况的时候,精确到小数点后10位,后面的四舍五入 @param v1 被除数 @param v2 除数 @return 两个参数的商 @since 3.1.0
[ "提供", "(", "相对", ")", "精确的除法运算", "当发生除不尽的情况的时候", "精确到小数点后10位", "后面的四舍五入" ]
train
https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-core/src/main/java/cn/hutool/core/util/NumberUtil.java#L539-L541
blinkfox/zealot
src/main/java/com/blinkfox/zealot/core/builder/SqlInfoBuilder.java
SqlInfoBuilder.buildNormalSql
public SqlInfo buildNormalSql(String fieldText, Object value, String suffix) { """ 构建普通查询需要的SqlInfo信息. @param fieldText 数据库字段的文本 @param value 参数值 @param suffix 后缀,如:大于、等于、小于等 @return sqlInfo """ join.append(prefix).append(fieldText).append(suffix); params.add(value); return sqlInfo....
java
public SqlInfo buildNormalSql(String fieldText, Object value, String suffix) { join.append(prefix).append(fieldText).append(suffix); params.add(value); return sqlInfo.setJoin(join).setParams(params); }
[ "public", "SqlInfo", "buildNormalSql", "(", "String", "fieldText", ",", "Object", "value", ",", "String", "suffix", ")", "{", "join", ".", "append", "(", "prefix", ")", ".", "append", "(", "fieldText", ")", ".", "append", "(", "suffix", ")", ";", "params...
构建普通查询需要的SqlInfo信息. @param fieldText 数据库字段的文本 @param value 参数值 @param suffix 后缀,如:大于、等于、小于等 @return sqlInfo
[ "构建普通查询需要的SqlInfo信息", "." ]
train
https://github.com/blinkfox/zealot/blob/21b00fa3e4ed42188eef3116d494e112e7a4194c/src/main/java/com/blinkfox/zealot/core/builder/SqlInfoBuilder.java#L72-L76
gosu-lang/gosu-lang
gosu-core-api/src/main/java/gw/util/GosuStringUtil.java
GosuStringUtil.indexOf
public static int indexOf(String str, String searchStr) { """ <p>Finds the first index within a String, handling <code>null</code>. This method uses {@link String#indexOf(String)}.</p> <p>A <code>null</code> String will return <code>-1</code>.</p> <pre> GosuStringUtil.indexOf(null, *) = -1 GosuSt...
java
public static int indexOf(String str, String searchStr) { if (str == null || searchStr == null) { return -1; } return str.indexOf(searchStr); }
[ "public", "static", "int", "indexOf", "(", "String", "str", ",", "String", "searchStr", ")", "{", "if", "(", "str", "==", "null", "||", "searchStr", "==", "null", ")", "{", "return", "-", "1", ";", "}", "return", "str", ".", "indexOf", "(", "searchSt...
<p>Finds the first index within a String, handling <code>null</code>. This method uses {@link String#indexOf(String)}.</p> <p>A <code>null</code> String will return <code>-1</code>.</p> <pre> GosuStringUtil.indexOf(null, *) = -1 GosuStringUtil.indexOf(*, null) = -1 GosuStringUtil.indexOf("", "") ...
[ "<p", ">", "Finds", "the", "first", "index", "within", "a", "String", "handling", "<code", ">", "null<", "/", "code", ">", ".", "This", "method", "uses", "{", "@link", "String#indexOf", "(", "String", ")", "}", ".", "<", "/", "p", ">" ]
train
https://github.com/gosu-lang/gosu-lang/blob/d6e9261b137ce66fef3726cabe7826d4a1f946b7/gosu-core-api/src/main/java/gw/util/GosuStringUtil.java#L736-L741
beanshell/beanshell
src/main/java/bsh/classpath/ClassManagerImpl.java
ClassManagerImpl.doSuperImport
@Override public void doSuperImport() throws UtilEvalError { """ Support for "import *;" Hide details in here as opposed to NameSpace. """ // Should we prevent it from happening twice? try { getClassPath().insureInitialized(); // prime the lookup table ...
java
@Override public void doSuperImport() throws UtilEvalError { // Should we prevent it from happening twice? try { getClassPath().insureInitialized(); // prime the lookup table getClassNameByUnqName( "" ) ; // always true now //...
[ "@", "Override", "public", "void", "doSuperImport", "(", ")", "throws", "UtilEvalError", "{", "// Should we prevent it from happening twice?", "try", "{", "getClassPath", "(", ")", ".", "insureInitialized", "(", ")", ";", "// prime the lookup table", "getClassNameByUnqNam...
Support for "import *;" Hide details in here as opposed to NameSpace.
[ "Support", "for", "import", "*", ";", "Hide", "details", "in", "here", "as", "opposed", "to", "NameSpace", "." ]
train
https://github.com/beanshell/beanshell/blob/fdddee3de948c9e6babb2d1337028f6fd0a2ba5c/src/main/java/bsh/classpath/ClassManagerImpl.java#L483-L502
lessthanoptimal/BoofCV
main/boofcv-ip/src/main/java/boofcv/alg/misc/ImageMiscOps.java
ImageMiscOps.rotateCCW
public static void rotateCCW( GrayS64 input , GrayS64 output ) { """ Rotates the image 90 degrees in the counter-clockwise direction. """ if( input.width != output.height || input.height != output.width ) throw new IllegalArgumentException("Incompatible shapes"); int w = input.width-1; for( int y = ...
java
public static void rotateCCW( GrayS64 input , GrayS64 output ) { if( input.width != output.height || input.height != output.width ) throw new IllegalArgumentException("Incompatible shapes"); int w = input.width-1; for( int y = 0; y < input.height; y++ ) { int indexIn = input.startIndex + y*input.stride; ...
[ "public", "static", "void", "rotateCCW", "(", "GrayS64", "input", ",", "GrayS64", "output", ")", "{", "if", "(", "input", ".", "width", "!=", "output", ".", "height", "||", "input", ".", "height", "!=", "output", ".", "width", ")", "throw", "new", "Ill...
Rotates the image 90 degrees in the counter-clockwise direction.
[ "Rotates", "the", "image", "90", "degrees", "in", "the", "counter", "-", "clockwise", "direction", "." ]
train
https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-ip/src/main/java/boofcv/alg/misc/ImageMiscOps.java#L2152-L2164
google/error-prone
core/src/main/java/com/google/errorprone/bugpatterns/threadsafety/ImmutableChecker.java
ImmutableChecker.immutableSupertype
private Type immutableSupertype(Symbol sym, VisitorState state) { """ Returns the type of the first superclass or superinterface in the hierarchy annotated with {@code @Immutable}, or {@code null} if no such super type exists. """ for (Type superType : state.getTypes().closure(sym.type)) { if (super...
java
private Type immutableSupertype(Symbol sym, VisitorState state) { for (Type superType : state.getTypes().closure(sym.type)) { if (superType.tsym.equals(sym.type.tsym)) { continue; } // Don't use getImmutableAnnotation here: subtypes of trusted types are // also trusted, only check fo...
[ "private", "Type", "immutableSupertype", "(", "Symbol", "sym", ",", "VisitorState", "state", ")", "{", "for", "(", "Type", "superType", ":", "state", ".", "getTypes", "(", ")", ".", "closure", "(", "sym", ".", "type", ")", ")", "{", "if", "(", "superTy...
Returns the type of the first superclass or superinterface in the hierarchy annotated with {@code @Immutable}, or {@code null} if no such super type exists.
[ "Returns", "the", "type", "of", "the", "first", "superclass", "or", "superinterface", "in", "the", "hierarchy", "annotated", "with", "{" ]
train
https://github.com/google/error-prone/blob/fe2e3cc2cf1958cb7c487bfe89852bb4c225ba9d/core/src/main/java/com/google/errorprone/bugpatterns/threadsafety/ImmutableChecker.java#L333-L356
apache/incubator-heron
heron/api/src/java/org/apache/heron/streamlet/impl/streamlets/LogStreamlet.java
LogStreamlet.doBuild
@Override public boolean doBuild(TopologyBuilder bldr, Set<String> stageNames) { """ Connect this streamlet to TopologyBuilder. @param bldr The TopologyBuilder for the topology @param stageNames The existing stage names @return True if successful """ setDefaultNameIfNone(StreamletNamePrefix.LOGGER, st...
java
@Override public boolean doBuild(TopologyBuilder bldr, Set<String> stageNames) { setDefaultNameIfNone(StreamletNamePrefix.LOGGER, stageNames); bldr.setBolt(getName(), new LogSink<R>(), getNumPartitions()).shuffleGrouping(parent.getName(), parent.getStreamId()); return true; }
[ "@", "Override", "public", "boolean", "doBuild", "(", "TopologyBuilder", "bldr", ",", "Set", "<", "String", ">", "stageNames", ")", "{", "setDefaultNameIfNone", "(", "StreamletNamePrefix", ".", "LOGGER", ",", "stageNames", ")", ";", "bldr", ".", "setBolt", "("...
Connect this streamlet to TopologyBuilder. @param bldr The TopologyBuilder for the topology @param stageNames The existing stage names @return True if successful
[ "Connect", "this", "streamlet", "to", "TopologyBuilder", "." ]
train
https://github.com/apache/incubator-heron/blob/776abe2b5a45b93a0eb957fd65cbc149d901a92a/heron/api/src/java/org/apache/heron/streamlet/impl/streamlets/LogStreamlet.java#L47-L53
greenmail-mail-test/greenmail
greenmail-core/src/main/java/com/icegreen/greenmail/imap/ImapRequestHandler.java
ImapRequestHandler.handleRequest
public boolean handleRequest(InputStream input, OutputStream output, ImapSession session) throws ProtocolException { """ This method parses POP3 commands read off the wire in handleConnection. Actual processing of the command (possib...
java
public boolean handleRequest(InputStream input, OutputStream output, ImapSession session) throws ProtocolException { ImapRequestLineReader request = new ImapRequestLineReader(input, output); try { request.nex...
[ "public", "boolean", "handleRequest", "(", "InputStream", "input", ",", "OutputStream", "output", ",", "ImapSession", "session", ")", "throws", "ProtocolException", "{", "ImapRequestLineReader", "request", "=", "new", "ImapRequestLineReader", "(", "input", ",", "outpu...
This method parses POP3 commands read off the wire in handleConnection. Actual processing of the command (possibly including additional back and forth communication with the client) is delegated to one of a number of command specific handler methods. The primary purpose of this method is to parse the raw command strin...
[ "This", "method", "parses", "POP3", "commands", "read", "off", "the", "wire", "in", "handleConnection", ".", "Actual", "processing", "of", "the", "command", "(", "possibly", "including", "additional", "back", "and", "forth", "communication", "with", "the", "clie...
train
https://github.com/greenmail-mail-test/greenmail/blob/6d19a62233d1ef6fedbbd1f6fdde2d28e713834a/greenmail-core/src/main/java/com/icegreen/greenmail/imap/ImapRequestHandler.java#L38-L58
SonarSource/sonarqube
server/sonar-server/src/main/java/org/sonar/server/qualityprofile/ws/QProfileWsSupport.java
QProfileWsSupport.getProfile
public QProfileDto getProfile(DbSession dbSession, QProfileReference ref) { """ Get the Quality profile specified by the reference {@code ref}. @throws org.sonar.server.exceptions.NotFoundException if the specified organization or profile do not exist """ QProfileDto profile; if (ref.hasKey()) { ...
java
public QProfileDto getProfile(DbSession dbSession, QProfileReference ref) { QProfileDto profile; if (ref.hasKey()) { profile = dbClient.qualityProfileDao().selectByUuid(dbSession, ref.getKey()); checkFound(profile, "Quality Profile with key '%s' does not exist", ref.getKey()); // Load organiza...
[ "public", "QProfileDto", "getProfile", "(", "DbSession", "dbSession", ",", "QProfileReference", "ref", ")", "{", "QProfileDto", "profile", ";", "if", "(", "ref", ".", "hasKey", "(", ")", ")", "{", "profile", "=", "dbClient", ".", "qualityProfileDao", "(", ")...
Get the Quality profile specified by the reference {@code ref}. @throws org.sonar.server.exceptions.NotFoundException if the specified organization or profile do not exist
[ "Get", "the", "Quality", "profile", "specified", "by", "the", "reference", "{", "@code", "ref", "}", "." ]
train
https://github.com/SonarSource/sonarqube/blob/2fffa4c2f79ae3714844d7742796e82822b6a98a/server/sonar-server/src/main/java/org/sonar/server/qualityprofile/ws/QProfileWsSupport.java#L102-L116
OpenLiberty/open-liberty
dev/com.ibm.ws.messaging.runtime/src/com/ibm/ws/sib/processor/impl/DurableInputHandler.java
DurableInputHandler.wakeupWaiter
protected static void wakeupWaiter(long reqID, Object result) { """ Attempt to wake up a blocked thread waiting for a request reply. @param reqID The ID of the request for which a reply was received. @param result The reply message. """ if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) ...
java
protected static void wakeupWaiter(long reqID, Object result) { if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.entry(tc, "wakeupWaiter", new Object[] {new Long(reqID), result}); synchronized (_requestMap) { Long key = new Long(reqID); Object[] waiter...
[ "protected", "static", "void", "wakeupWaiter", "(", "long", "reqID", ",", "Object", "result", ")", "{", "if", "(", "TraceComponent", ".", "isAnyTracingEnabled", "(", ")", "&&", "tc", ".", "isEntryEnabled", "(", ")", ")", "SibTr", ".", "entry", "(", "tc", ...
Attempt to wake up a blocked thread waiting for a request reply. @param reqID The ID of the request for which a reply was received. @param result The reply message.
[ "Attempt", "to", "wake", "up", "a", "blocked", "thread", "waiting", "for", "a", "request", "reply", "." ]
train
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.messaging.runtime/src/com/ibm/ws/sib/processor/impl/DurableInputHandler.java#L251-L275
dropwizard/dropwizard
dropwizard-jetty/src/main/java/io/dropwizard/jetty/setup/ServletEnvironment.java
ServletEnvironment.addMimeMapping
public void addMimeMapping(String extension, String type) { """ Set a mime mapping. @param extension Extension @param type Mime type """ handler.getMimeTypes().addMimeMapping(extension, type); }
java
public void addMimeMapping(String extension, String type) { handler.getMimeTypes().addMimeMapping(extension, type); }
[ "public", "void", "addMimeMapping", "(", "String", "extension", ",", "String", "type", ")", "{", "handler", ".", "getMimeTypes", "(", ")", ".", "addMimeMapping", "(", "extension", ",", "type", ")", ";", "}" ]
Set a mime mapping. @param extension Extension @param type Mime type
[ "Set", "a", "mime", "mapping", "." ]
train
https://github.com/dropwizard/dropwizard/blob/7ee09a410476b9681e8072ab684788bb440877bd/dropwizard-jetty/src/main/java/io/dropwizard/jetty/setup/ServletEnvironment.java#L207-L209
badamowicz/sonar-hla
sonar-hla-maven-plugin/src/main/java/com/github/badamowicz/sonar/hla/plugin/helper/LogHelper.java
LogHelper.logMeasures
public static void logMeasures(HLAMeasure[] measures, final Logger log) { """ Log the given array of measure objects in some readable way. @param measures The array of measures. @param log A {@link Logger} which will be used for output. """ log.info("\nAvailable measures are:"); log.info("...
java
public static void logMeasures(HLAMeasure[] measures, final Logger log) { log.info("\nAvailable measures are:"); log.info("======================"); for (HLAMeasure currMeasure : measures) { log.info(" - " + currMeasure.getSonarName()); } LogHelper.moo(log); }
[ "public", "static", "void", "logMeasures", "(", "HLAMeasure", "[", "]", "measures", ",", "final", "Logger", "log", ")", "{", "log", ".", "info", "(", "\"\\nAvailable measures are:\"", ")", ";", "log", ".", "info", "(", "\"======================\"", ")", ";", ...
Log the given array of measure objects in some readable way. @param measures The array of measures. @param log A {@link Logger} which will be used for output.
[ "Log", "the", "given", "array", "of", "measure", "objects", "in", "some", "readable", "way", "." ]
train
https://github.com/badamowicz/sonar-hla/blob/21bd8a853d81966b47e96b518430abbc07ccd5f3/sonar-hla-maven-plugin/src/main/java/com/github/badamowicz/sonar/hla/plugin/helper/LogHelper.java#L54-L65
ngageoint/geopackage-android-map
geopackage-map/src/main/java/mil/nga/geopackage/map/tiles/overlay/BoundedOverlay.java
BoundedOverlay.setBoundingBox
public void setBoundingBox(BoundingBox boundingBox, Projection projection) { """ Set the bounding box, provided as the indicated projection @param boundingBox bounding box @param projection projection """ ProjectionTransform projectionToWebMercator = projection .getTransformation(P...
java
public void setBoundingBox(BoundingBox boundingBox, Projection projection) { ProjectionTransform projectionToWebMercator = projection .getTransformation(ProjectionConstants.EPSG_WEB_MERCATOR); webMercatorBoundingBox = boundingBox .transform(projectionToWebMercator); }
[ "public", "void", "setBoundingBox", "(", "BoundingBox", "boundingBox", ",", "Projection", "projection", ")", "{", "ProjectionTransform", "projectionToWebMercator", "=", "projection", ".", "getTransformation", "(", "ProjectionConstants", ".", "EPSG_WEB_MERCATOR", ")", ";",...
Set the bounding box, provided as the indicated projection @param boundingBox bounding box @param projection projection
[ "Set", "the", "bounding", "box", "provided", "as", "the", "indicated", "projection" ]
train
https://github.com/ngageoint/geopackage-android-map/blob/634d78468a5c52d2bc98791cc7ff03981ebf573b/geopackage-map/src/main/java/mil/nga/geopackage/map/tiles/overlay/BoundedOverlay.java#L85-L90
JetBrains/xodus
environment/src/main/java/jetbrains/exodus/env/ReentrantTransactionDispatcher.java
ReentrantTransactionDispatcher.tryAcquireExclusiveTransaction
private int tryAcquireExclusiveTransaction(@NotNull final Thread thread, final int timeout) { """ Wait for exclusive permit during a timeout in milliseconds. @return number of acquired permits if > 0 """ long nanos = TimeUnit.MILLISECONDS.toNanos(timeout); try (CriticalSection ignored = crit...
java
private int tryAcquireExclusiveTransaction(@NotNull final Thread thread, final int timeout) { long nanos = TimeUnit.MILLISECONDS.toNanos(timeout); try (CriticalSection ignored = criticalSection.enter()) { if (getThreadPermits(thread) > 0) { throw new ExodusException("Exclusiv...
[ "private", "int", "tryAcquireExclusiveTransaction", "(", "@", "NotNull", "final", "Thread", "thread", ",", "final", "int", "timeout", ")", "{", "long", "nanos", "=", "TimeUnit", ".", "MILLISECONDS", ".", "toNanos", "(", "timeout", ")", ";", "try", "(", "Crit...
Wait for exclusive permit during a timeout in milliseconds. @return number of acquired permits if > 0
[ "Wait", "for", "exclusive", "permit", "during", "a", "timeout", "in", "milliseconds", "." ]
train
https://github.com/JetBrains/xodus/blob/7b3476c4e81db66f9c7529148c761605cc8eea6d/environment/src/main/java/jetbrains/exodus/env/ReentrantTransactionDispatcher.java#L193-L223
BorderTech/wcomponents
wcomponents-examples/src/main/java/com/github/bordertech/wcomponents/examples/datatable/TreeTableHierarchyExample.java
TreeTableHierarchyExample.createTable
private WDataTable createTable() { """ Creates and configures the table to be used by the example. The table is configured with global rather than user data. Although this is not a realistic scenario, it will suffice for this example. @return a new configured table. """ WDataTable tbl = new WDataTable();...
java
private WDataTable createTable() { WDataTable tbl = new WDataTable(); tbl.setType(WDataTable.Type.HIERARCHIC); tbl.addColumn(new WTableColumn("First name", new WText())); tbl.addColumn(new WTableColumn("Last name", new WText())); tbl.addColumn(new WTableColumn("DOB", new WDateField())); tbl.setExpandMode(Ex...
[ "private", "WDataTable", "createTable", "(", ")", "{", "WDataTable", "tbl", "=", "new", "WDataTable", "(", ")", ";", "tbl", ".", "setType", "(", "WDataTable", ".", "Type", ".", "HIERARCHIC", ")", ";", "tbl", ".", "addColumn", "(", "new", "WTableColumn", ...
Creates and configures the table to be used by the example. The table is configured with global rather than user data. Although this is not a realistic scenario, it will suffice for this example. @return a new configured table.
[ "Creates", "and", "configures", "the", "table", "to", "be", "used", "by", "the", "example", ".", "The", "table", "is", "configured", "with", "global", "rather", "than", "user", "data", ".", "Although", "this", "is", "not", "a", "realistic", "scenario", "it...
train
https://github.com/BorderTech/wcomponents/blob/d1a2b2243270067db030feb36ca74255aaa94436/wcomponents-examples/src/main/java/com/github/bordertech/wcomponents/examples/datatable/TreeTableHierarchyExample.java#L44-L57
xwiki/xwiki-commons
xwiki-commons-core/xwiki-commons-crypto/xwiki-commons-crypto-pkix/src/main/java/org/xwiki/crypto/signer/internal/cms/BcCMSUtils.java
BcCMSUtils.getSignedData
public static CMSSignedData getSignedData(byte[] signature, byte[] data) throws GeneralSecurityException { """ Build a Bouncy Castle {@link CMSSignedData} from bytes. @param signature the signature. @param data the data signed. @return a CMS signed data. @throws GeneralSecurityException if the signature coul...
java
public static CMSSignedData getSignedData(byte[] signature, byte[] data) throws GeneralSecurityException { CMSSignedData signedData; try { if (data != null) { signedData = new CMSSignedData(new CMSProcessableByteArray(data), signature); } else { ...
[ "public", "static", "CMSSignedData", "getSignedData", "(", "byte", "[", "]", "signature", ",", "byte", "[", "]", "data", ")", "throws", "GeneralSecurityException", "{", "CMSSignedData", "signedData", ";", "try", "{", "if", "(", "data", "!=", "null", ")", "{"...
Build a Bouncy Castle {@link CMSSignedData} from bytes. @param signature the signature. @param data the data signed. @return a CMS signed data. @throws GeneralSecurityException if the signature could not be decoded.
[ "Build", "a", "Bouncy", "Castle", "{", "@link", "CMSSignedData", "}", "from", "bytes", "." ]
train
https://github.com/xwiki/xwiki-commons/blob/5374d8c6d966588c1eac7392c83da610dfb9f129/xwiki-commons-core/xwiki-commons-crypto/xwiki-commons-crypto-pkix/src/main/java/org/xwiki/crypto/signer/internal/cms/BcCMSUtils.java#L86-L99
pravega/pravega
common/src/main/java/io/pravega/common/concurrent/ExecutorServiceHelpers.java
ExecutorServiceHelpers.shutdown
public static void shutdown(Duration timeout, ExecutorService... pools) { """ Shuts down the given ExecutorServices in two phases: 1. Prevents new tasks from being submitted. 2. Awaits for currently running tasks to terminate. If they don't terminate within the given timeout, they will be forcibly cancelled. ...
java
public static void shutdown(Duration timeout, ExecutorService... pools) { // Prevent new tasks from being submitted. for (ExecutorService pool : pools) { pool.shutdown(); } TimeoutTimer timer = new TimeoutTimer(timeout); for (ExecutorService pool : pools) { ...
[ "public", "static", "void", "shutdown", "(", "Duration", "timeout", ",", "ExecutorService", "...", "pools", ")", "{", "// Prevent new tasks from being submitted.", "for", "(", "ExecutorService", "pool", ":", "pools", ")", "{", "pool", ".", "shutdown", "(", ")", ...
Shuts down the given ExecutorServices in two phases: 1. Prevents new tasks from being submitted. 2. Awaits for currently running tasks to terminate. If they don't terminate within the given timeout, they will be forcibly cancelled. This is implemented as per the guidelines in the ExecutorService Javadoc: https://docs....
[ "Shuts", "down", "the", "given", "ExecutorServices", "in", "two", "phases", ":", "1", ".", "Prevents", "new", "tasks", "from", "being", "submitted", ".", "2", ".", "Awaits", "for", "currently", "running", "tasks", "to", "terminate", ".", "If", "they", "don...
train
https://github.com/pravega/pravega/blob/6e24df7470669b3956a07018f52b2c6b3c2a3503/common/src/main/java/io/pravega/common/concurrent/ExecutorServiceHelpers.java#L183-L204
google/error-prone-javac
src/jdk.compiler/share/classes/com/sun/source/util/TreeScanner.java
TreeScanner.visitLambdaExpression
@Override public R visitLambdaExpression(LambdaExpressionTree node, P p) { """ {@inheritDoc} This implementation scans the children in left to right order. @param node {@inheritDoc} @param p {@inheritDoc} @return the result of scanning """ R r = scan(node.getParameters(), p); r = sca...
java
@Override public R visitLambdaExpression(LambdaExpressionTree node, P p) { R r = scan(node.getParameters(), p); r = scanAndReduce(node.getBody(), p, r); return r; }
[ "@", "Override", "public", "R", "visitLambdaExpression", "(", "LambdaExpressionTree", "node", ",", "P", "p", ")", "{", "R", "r", "=", "scan", "(", "node", ".", "getParameters", "(", ")", ",", "p", ")", ";", "r", "=", "scanAndReduce", "(", "node", ".", ...
{@inheritDoc} This implementation scans the children in left to right order. @param node {@inheritDoc} @param p {@inheritDoc} @return the result of scanning
[ "{", "@inheritDoc", "}", "This", "implementation", "scans", "the", "children", "in", "left", "to", "right", "order", "." ]
train
https://github.com/google/error-prone-javac/blob/a53d069bbdb2c60232ed3811c19b65e41c3e60e0/src/jdk.compiler/share/classes/com/sun/source/util/TreeScanner.java#L556-L561