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
alkacon/opencms-core
src/org/opencms/notification/CmsContentNotification.java
CmsContentNotification.appendConfirmLink
private void appendConfirmLink(StringBuffer buf, CmsExtendedNotificationCause notificationCause) { """ Appends a link to confirm a resource, so that the responsible will not be notified any more.<p> @param buf the StringBuffer to append the html code to @param notificationCause the information for specific res...
java
private void appendConfirmLink(StringBuffer buf, CmsExtendedNotificationCause notificationCause) { Map<String, String[]> params = new HashMap<String, String[]>(); buf.append("<td>"); try { String resourcePath = notificationCause.getResource().getRootPath(); String siteRo...
[ "private", "void", "appendConfirmLink", "(", "StringBuffer", "buf", ",", "CmsExtendedNotificationCause", "notificationCause", ")", "{", "Map", "<", "String", ",", "String", "[", "]", ">", "params", "=", "new", "HashMap", "<", "String", ",", "String", "[", "]",...
Appends a link to confirm a resource, so that the responsible will not be notified any more.<p> @param buf the StringBuffer to append the html code to @param notificationCause the information for specific resource
[ "Appends", "a", "link", "to", "confirm", "a", "resource", "so", "that", "the", "responsible", "will", "not", "be", "notified", "any", "more", ".", "<p", ">" ]
train
https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/notification/CmsContentNotification.java#L223-L256
ManfredTremmel/gwt-commons-lang3
src/main/java/org/apache/commons/lang3/Validate.java
Validate.isAssignableFrom
@GwtIncompatible("incompatible method") public static void isAssignableFrom(final Class<?> superType, final Class<?> type, final String message, final Object... values) { """ Validates that the argument can be converted to the specified class, if not throws an exception. <p>This method is useful when valida...
java
@GwtIncompatible("incompatible method") public static void isAssignableFrom(final Class<?> superType, final Class<?> type, final String message, final Object... values) { // TODO when breaking BC, consider returning type if (!superType.isAssignableFrom(type)) { throw new IllegalArgumentE...
[ "@", "GwtIncompatible", "(", "\"incompatible method\"", ")", "public", "static", "void", "isAssignableFrom", "(", "final", "Class", "<", "?", ">", "superType", ",", "final", "Class", "<", "?", ">", "type", ",", "final", "String", "message", ",", "final", "Ob...
Validates that the argument can be converted to the specified class, if not throws an exception. <p>This method is useful when validating if there will be no casting errors.</p> <pre>Validate.isAssignableFrom(SuperClass.class, object.getClass());</pre> <p>The message of the exception is &quot;The validated object ca...
[ "Validates", "that", "the", "argument", "can", "be", "converted", "to", "the", "specified", "class", "if", "not", "throws", "an", "exception", "." ]
train
https://github.com/ManfredTremmel/gwt-commons-lang3/blob/9e2dfbbda3668cfa5d935fe76479d1426c294504/src/main/java/org/apache/commons/lang3/Validate.java#L1345-L1351
tvesalainen/util
util/src/main/java/org/vesalainen/util/CharSequences.java
CharSequences.startsWith
public static boolean startsWith(CharSequence seq, CharSequence pattern, IntUnaryOperator op) { """ Return true if seq start match pattern after both characters have been converted with op. @param seq @param pattern @param op @return """ if (pattern.length() > seq.length()) { ...
java
public static boolean startsWith(CharSequence seq, CharSequence pattern, IntUnaryOperator op) { if (pattern.length() > seq.length()) { return false; } int length = pattern.length(); for (int ii=0;ii<length;ii++) { if (op.applyAsInt(seq...
[ "public", "static", "boolean", "startsWith", "(", "CharSequence", "seq", ",", "CharSequence", "pattern", ",", "IntUnaryOperator", "op", ")", "{", "if", "(", "pattern", ".", "length", "(", ")", ">", "seq", ".", "length", "(", ")", ")", "{", "return", "fal...
Return true if seq start match pattern after both characters have been converted with op. @param seq @param pattern @param op @return
[ "Return", "true", "if", "seq", "start", "match", "pattern", "after", "both", "characters", "have", "been", "converted", "with", "op", "." ]
train
https://github.com/tvesalainen/util/blob/bba7a44689f638ffabc8be40a75bdc9a33676433/util/src/main/java/org/vesalainen/util/CharSequences.java#L81-L96
ocelotds/ocelot
ocelot-web/src/main/java/org/ocelotds/topic/topicAccess/TopicAccessManager.java
TopicAccessManager.checkAccessTopicFromController
boolean checkAccessTopicFromController(UserContext ctx, String topic, JsTopicAccessController jsTopicAccessController) throws IllegalAccessException { """ Check if specific access control is allowed from controller @param ctx @param topic @param controllers @return true if at least one specific topicAccessCont...
java
boolean checkAccessTopicFromController(UserContext ctx, String topic, JsTopicAccessController jsTopicAccessController) throws IllegalAccessException { logger.debug("Looking for accessController for topic '{}' from JsTopicAccessController {}", topic, jsTopicAccessController); JsTopicControls jsTopicControls = jsTopi...
[ "boolean", "checkAccessTopicFromController", "(", "UserContext", "ctx", ",", "String", "topic", ",", "JsTopicAccessController", "jsTopicAccessController", ")", "throws", "IllegalAccessException", "{", "logger", ".", "debug", "(", "\"Looking for accessController for topic '{}' f...
Check if specific access control is allowed from controller @param ctx @param topic @param controllers @return true if at least one specific topicAccessControl exist @throws IllegalAccessException
[ "Check", "if", "specific", "access", "control", "is", "allowed", "from", "controller" ]
train
https://github.com/ocelotds/ocelot/blob/5f0ac37afd8fa4dc9f7234a2aac8abbb522128e7/ocelot-web/src/main/java/org/ocelotds/topic/topicAccess/TopicAccessManager.java#L128-L143
Comcast/jrugged
jrugged-core/src/main/java/org/fishwife/jrugged/ConstantFlowRegulator.java
ConstantFlowRegulator.invoke
public <T> T invoke(Runnable r, T result) throws Exception { """ Wrap the given service call with the {@link ConstantFlowRegulator} protection logic. @param r the {@link Runnable} to attempt @param result what to return after <code>r</code> succeeds @return result @throws FlowRateExceededException if the ...
java
public <T> T invoke(Runnable r, T result) throws Exception { if (canProceed()) { r.run(); return result; } else { throw mapException(new FlowRateExceededException()); } }
[ "public", "<", "T", ">", "T", "invoke", "(", "Runnable", "r", ",", "T", "result", ")", "throws", "Exception", "{", "if", "(", "canProceed", "(", ")", ")", "{", "r", ".", "run", "(", ")", ";", "return", "result", ";", "}", "else", "{", "throw", ...
Wrap the given service call with the {@link ConstantFlowRegulator} protection logic. @param r the {@link Runnable} to attempt @param result what to return after <code>r</code> succeeds @return result @throws FlowRateExceededException if the total requests per second through the flow regulator exceeds the configured v...
[ "Wrap", "the", "given", "service", "call", "with", "the", "{", "@link", "ConstantFlowRegulator", "}", "protection", "logic", ".", "@param", "r", "the", "{", "@link", "Runnable", "}", "to", "attempt", "@param", "result", "what", "to", "return", "after", "<cod...
train
https://github.com/Comcast/jrugged/blob/b6a5147c68ee733faf5616d49800abcbba67afe9/jrugged-core/src/main/java/org/fishwife/jrugged/ConstantFlowRegulator.java#L107-L115
UrielCh/ovh-java-sdk
ovh-java-sdk-telephony/src/main/java/net/minidev/ovh/api/ApiOvhTelephony.java
ApiOvhTelephony.billingAccount_ovhPabx_serviceName_menu_menuId_entry_entryId_PUT
public void billingAccount_ovhPabx_serviceName_menu_menuId_entry_entryId_PUT(String billingAccount, String serviceName, Long menuId, Long entryId, OvhOvhPabxMenuEntry body) throws IOException { """ Alter this object properties REST: PUT /telephony/{billingAccount}/ovhPabx/{serviceName}/menu/{menuId}/entry/{entr...
java
public void billingAccount_ovhPabx_serviceName_menu_menuId_entry_entryId_PUT(String billingAccount, String serviceName, Long menuId, Long entryId, OvhOvhPabxMenuEntry body) throws IOException { String qPath = "/telephony/{billingAccount}/ovhPabx/{serviceName}/menu/{menuId}/entry/{entryId}"; StringBuilder sb = path(...
[ "public", "void", "billingAccount_ovhPabx_serviceName_menu_menuId_entry_entryId_PUT", "(", "String", "billingAccount", ",", "String", "serviceName", ",", "Long", "menuId", ",", "Long", "entryId", ",", "OvhOvhPabxMenuEntry", "body", ")", "throws", "IOException", "{", "Stri...
Alter this object properties REST: PUT /telephony/{billingAccount}/ovhPabx/{serviceName}/menu/{menuId}/entry/{entryId} @param body [required] New object properties @param billingAccount [required] The name of your billingAccount @param serviceName [required] @param menuId [required] @param entryId [required]
[ "Alter", "this", "object", "properties" ]
train
https://github.com/UrielCh/ovh-java-sdk/blob/6d531a40e56e09701943e334c25f90f640c55701/ovh-java-sdk-telephony/src/main/java/net/minidev/ovh/api/ApiOvhTelephony.java#L7509-L7513
apache/groovy
src/main/java/org/codehaus/groovy/antlr/AntlrParserPlugin.java
AntlrParserPlugin.buildName
protected ClassNode buildName(AST node) { """ Extracts an identifier from the Antlr AST and then performs a name resolution to see if the given name is a type from imports, aliases or newly created classes """ if (isType(TYPE, node)) { node = node.getFirstChild(); } ClassNo...
java
protected ClassNode buildName(AST node) { if (isType(TYPE, node)) { node = node.getFirstChild(); } ClassNode answer = null; if (isType(DOT, node) || isType(OPTIONAL_DOT, node)) { answer = ClassHelper.make(qualifiedName(node)); } else if (isPrimitiveTypeLit...
[ "protected", "ClassNode", "buildName", "(", "AST", "node", ")", "{", "if", "(", "isType", "(", "TYPE", ",", "node", ")", ")", "{", "node", "=", "node", ".", "getFirstChild", "(", ")", ";", "}", "ClassNode", "answer", "=", "null", ";", "if", "(", "i...
Extracts an identifier from the Antlr AST and then performs a name resolution to see if the given name is a type from imports, aliases or newly created classes
[ "Extracts", "an", "identifier", "from", "the", "Antlr", "AST", "and", "then", "performs", "a", "name", "resolution", "to", "see", "if", "the", "given", "name", "is", "a", "type", "from", "imports", "aliases", "or", "newly", "created", "classes" ]
train
https://github.com/apache/groovy/blob/71cf20addb611bb8d097a59e395fd20bc7f31772/src/main/java/org/codehaus/groovy/antlr/AntlrParserPlugin.java#L3125-L3152
ManfredTremmel/gwt-commons-lang3
src/main/java/org/apache/commons/lang3/StringUtils.java
StringUtils.containsOnly
public static boolean containsOnly(final CharSequence cs, final String validChars) { """ <p>Checks if the CharSequence contains only certain characters.</p> <p>A {@code null} CharSequence will return {@code false}. A {@code null} valid character String will return {@code false}. An empty String (length()=0) a...
java
public static boolean containsOnly(final CharSequence cs, final String validChars) { if (cs == null || validChars == null) { return false; } return containsOnly(cs, validChars.toCharArray()); }
[ "public", "static", "boolean", "containsOnly", "(", "final", "CharSequence", "cs", ",", "final", "String", "validChars", ")", "{", "if", "(", "cs", "==", "null", "||", "validChars", "==", "null", ")", "{", "return", "false", ";", "}", "return", "containsOn...
<p>Checks if the CharSequence contains only certain characters.</p> <p>A {@code null} CharSequence will return {@code false}. A {@code null} valid character String will return {@code false}. An empty String (length()=0) always returns {@code true}.</p> <pre> StringUtils.containsOnly(null, *) = false StringUtils...
[ "<p", ">", "Checks", "if", "the", "CharSequence", "contains", "only", "certain", "characters", ".", "<", "/", "p", ">" ]
train
https://github.com/ManfredTremmel/gwt-commons-lang3/blob/9e2dfbbda3668cfa5d935fe76479d1426c294504/src/main/java/org/apache/commons/lang3/StringUtils.java#L2420-L2425
deeplearning4j/deeplearning4j
deeplearning4j/deeplearning4j-nlp-parent/deeplearning4j-nlp-japanese/src/main/java/com/atilika/kuromoji/viterbi/ViterbiBuilder.java
ViterbiBuilder.processUserDictionary
private void processUserDictionary(final String text, ViterbiLattice lattice) { """ Find token(s) in input text and set found token(s) in arrays as normal tokens @param text @param lattice """ List<UserDictionary.UserDictionaryMatch> matches = userDictionary.findUserDictionaryMatches(text); ...
java
private void processUserDictionary(final String text, ViterbiLattice lattice) { List<UserDictionary.UserDictionaryMatch> matches = userDictionary.findUserDictionaryMatches(text); for (UserDictionary.UserDictionaryMatch match : matches) { int wordId = match.getWordId(); int index...
[ "private", "void", "processUserDictionary", "(", "final", "String", "text", ",", "ViterbiLattice", "lattice", ")", "{", "List", "<", "UserDictionary", ".", "UserDictionaryMatch", ">", "matches", "=", "userDictionary", ".", "findUserDictionaryMatches", "(", "text", "...
Find token(s) in input text and set found token(s) in arrays as normal tokens @param text @param lattice
[ "Find", "token", "(", "s", ")", "in", "input", "text", "and", "set", "found", "token", "(", "s", ")", "in", "arrays", "as", "normal", "tokens" ]
train
https://github.com/deeplearning4j/deeplearning4j/blob/effce52f2afd7eeb53c5bcca699fcd90bd06822f/deeplearning4j/deeplearning4j-nlp-parent/deeplearning4j-nlp-japanese/src/main/java/com/atilika/kuromoji/viterbi/ViterbiBuilder.java#L176-L200
IanGClifton/AndroidFloatLabel
FloatLabel/src/com/iangclifton/android/floatlabel/FloatLabel.java
FloatLabel.setTextWithoutAnimation
public void setTextWithoutAnimation(char[] text, int start, int len) { """ Sets the EditText's text without animating the label @param text char[] text @param start int start of char array to use @param len int characters to use from the array """ mSkipAnimation = true; mEditText.setText(t...
java
public void setTextWithoutAnimation(char[] text, int start, int len) { mSkipAnimation = true; mEditText.setText(text, start, len); }
[ "public", "void", "setTextWithoutAnimation", "(", "char", "[", "]", "text", ",", "int", "start", ",", "int", "len", ")", "{", "mSkipAnimation", "=", "true", ";", "mEditText", ".", "setText", "(", "text", ",", "start", ",", "len", ")", ";", "}" ]
Sets the EditText's text without animating the label @param text char[] text @param start int start of char array to use @param len int characters to use from the array
[ "Sets", "the", "EditText", "s", "text", "without", "animating", "the", "label" ]
train
https://github.com/IanGClifton/AndroidFloatLabel/blob/b0a39c26f010f17d5f3648331e9784a41e025c0d/FloatLabel/src/com/iangclifton/android/floatlabel/FloatLabel.java#L291-L294
landawn/AbacusUtil
src/com/landawn/abacus/util/JdbcUtil.java
JdbcUtil.importData
public static int importData(final DataSet dataset, final Collection<String> selectColumnNames, final Connection conn, final String insertSQL) throws UncheckedSQLException { """ Imports the data from <code>DataSet</code> to database. @param dataset @param selectColumnNames @param conn @param ins...
java
public static int importData(final DataSet dataset, final Collection<String> selectColumnNames, final Connection conn, final String insertSQL) throws UncheckedSQLException { return importData(dataset, selectColumnNames, 0, dataset.size(), conn, insertSQL); }
[ "public", "static", "int", "importData", "(", "final", "DataSet", "dataset", ",", "final", "Collection", "<", "String", ">", "selectColumnNames", ",", "final", "Connection", "conn", ",", "final", "String", "insertSQL", ")", "throws", "UncheckedSQLException", "{", ...
Imports the data from <code>DataSet</code> to database. @param dataset @param selectColumnNames @param conn @param insertSQL the column order in the sql must be consistent with the column order in the DataSet. Here is sample about how to create the sql: <pre><code> List<String> columnNameList = new ArrayList<>(dataset...
[ "Imports", "the", "data", "from", "<code", ">", "DataSet<", "/", "code", ">", "to", "database", "." ]
train
https://github.com/landawn/AbacusUtil/blob/544b7720175d15e9329f83dd22a8cc5fa4515e12/src/com/landawn/abacus/util/JdbcUtil.java#L1873-L1876
micronaut-projects/micronaut-core
tracing/src/main/java/io/micronaut/tracing/instrument/http/AbstractOpenTracingFilter.java
AbstractOpenTracingFilter.setResponseTags
protected void setResponseTags(HttpRequest<?> request, HttpResponse<?> response, Span span) { """ Sets the response tags. @param request The request @param response The response @param span The span """ HttpStatus status = response.getStatus(); int code = status.getCode(); if (code...
java
protected void setResponseTags(HttpRequest<?> request, HttpResponse<?> response, Span span) { HttpStatus status = response.getStatus(); int code = status.getCode(); if (code > HTTP_SUCCESS_CODE_UPPER_LIMIT) { span.setTag(TAG_HTTP_STATUS_CODE, code); span.setTag(TAG_ERROR,...
[ "protected", "void", "setResponseTags", "(", "HttpRequest", "<", "?", ">", "request", ",", "HttpResponse", "<", "?", ">", "response", ",", "Span", "span", ")", "{", "HttpStatus", "status", "=", "response", ".", "getStatus", "(", ")", ";", "int", "code", ...
Sets the response tags. @param request The request @param response The response @param span The span
[ "Sets", "the", "response", "tags", "." ]
train
https://github.com/micronaut-projects/micronaut-core/blob/c31f5b03ce0eb88c2f6470710987db03b8967d5c/tracing/src/main/java/io/micronaut/tracing/instrument/http/AbstractOpenTracingFilter.java#L62-L72
stevespringett/Alpine
alpine/src/main/java/alpine/auth/LdapConnectionWrapper.java
LdapConnectionWrapper.getAttribute
public String getAttribute(final DirContext ctx, final String dn, final String attributeName) throws NamingException { """ Retrieves an attribute by its name for the specified dn. @param ctx the DirContext to use @param dn the distinguished name of the entry to obtain the attribute value for @param attributeNam...
java
public String getAttribute(final DirContext ctx, final String dn, final String attributeName) throws NamingException { final Attributes attributes = ctx.getAttributes(dn); return getAttribute(attributes, attributeName); }
[ "public", "String", "getAttribute", "(", "final", "DirContext", "ctx", ",", "final", "String", "dn", ",", "final", "String", "attributeName", ")", "throws", "NamingException", "{", "final", "Attributes", "attributes", "=", "ctx", ".", "getAttributes", "(", "dn",...
Retrieves an attribute by its name for the specified dn. @param ctx the DirContext to use @param dn the distinguished name of the entry to obtain the attribute value for @param attributeName the name of the attribute to return @return the value of the attribute, or null if not found @throws NamingException if an except...
[ "Retrieves", "an", "attribute", "by", "its", "name", "for", "the", "specified", "dn", "." ]
train
https://github.com/stevespringett/Alpine/blob/6c5ef5e1ba4f38922096f1307d3950c09edb3093/alpine/src/main/java/alpine/auth/LdapConnectionWrapper.java#L225-L228
roboconf/roboconf-platform
core/roboconf-dm/src/main/java/net/roboconf/dm/internal/api/impl/ApplicationMngrImpl.java
ApplicationMngrImpl.checkErrors
static void checkErrors( Collection<RoboconfError> errors, Logger logger ) throws InvalidApplicationException { """ A method to check errors. @param errors a non-null list of errors @param logger a logger @throws InvalidApplicationException if there are critical errors """ if( RoboconfErrorHelpers.conta...
java
static void checkErrors( Collection<RoboconfError> errors, Logger logger ) throws InvalidApplicationException { if( RoboconfErrorHelpers.containsCriticalErrors( errors )) throw new InvalidApplicationException( errors ); // Null language => English (right language for logs) Collection<RoboconfError> warnings...
[ "static", "void", "checkErrors", "(", "Collection", "<", "RoboconfError", ">", "errors", ",", "Logger", "logger", ")", "throws", "InvalidApplicationException", "{", "if", "(", "RoboconfErrorHelpers", ".", "containsCriticalErrors", "(", "errors", ")", ")", "throw", ...
A method to check errors. @param errors a non-null list of errors @param logger a logger @throws InvalidApplicationException if there are critical errors
[ "A", "method", "to", "check", "errors", "." ]
train
https://github.com/roboconf/roboconf-platform/blob/add54eead479effb138d0ff53a2d637902b82702/core/roboconf-dm/src/main/java/net/roboconf/dm/internal/api/impl/ApplicationMngrImpl.java#L336-L346
liferay/com-liferay-commerce
commerce-product-api/src/main/java/com/liferay/commerce/product/model/CPTaxCategoryWrapper.java
CPTaxCategoryWrapper.getDescription
@Override public String getDescription(String languageId, boolean useDefault) { """ Returns the localized description of this cp tax category in the language, optionally using the default language if no localization exists for the requested language. @param languageId the ID of the language @param useDefault ...
java
@Override public String getDescription(String languageId, boolean useDefault) { return _cpTaxCategory.getDescription(languageId, useDefault); }
[ "@", "Override", "public", "String", "getDescription", "(", "String", "languageId", ",", "boolean", "useDefault", ")", "{", "return", "_cpTaxCategory", ".", "getDescription", "(", "languageId", ",", "useDefault", ")", ";", "}" ]
Returns the localized description of this cp tax category in the language, optionally using the default language if no localization exists for the requested language. @param languageId the ID of the language @param useDefault whether to use the default language if no localization exists for the requested language @ret...
[ "Returns", "the", "localized", "description", "of", "this", "cp", "tax", "category", "in", "the", "language", "optionally", "using", "the", "default", "language", "if", "no", "localization", "exists", "for", "the", "requested", "language", "." ]
train
https://github.com/liferay/com-liferay-commerce/blob/9e54362d7f59531fc684016ba49ee7cdc3a2f22b/commerce-product-api/src/main/java/com/liferay/commerce/product/model/CPTaxCategoryWrapper.java#L232-L235
mboudreau/Alternator
src/main/java/com/amazonaws/services/dynamodb/datamodeling/DynamoDBMapper.java
DynamoDBMapper.getAutoGeneratedKeyAttributeValue
private AttributeValue getAutoGeneratedKeyAttributeValue(Method getter, Object getterResult) { """ Returns an attribute value corresponding to the key method and value given. """ ArgumentMarshaller marshaller = reflector.getAutoGeneratedKeyArgumentMarshaller(getter); return marshaller.marshall(...
java
private AttributeValue getAutoGeneratedKeyAttributeValue(Method getter, Object getterResult) { ArgumentMarshaller marshaller = reflector.getAutoGeneratedKeyArgumentMarshaller(getter); return marshaller.marshall(getterResult); }
[ "private", "AttributeValue", "getAutoGeneratedKeyAttributeValue", "(", "Method", "getter", ",", "Object", "getterResult", ")", "{", "ArgumentMarshaller", "marshaller", "=", "reflector", ".", "getAutoGeneratedKeyArgumentMarshaller", "(", "getter", ")", ";", "return", "mars...
Returns an attribute value corresponding to the key method and value given.
[ "Returns", "an", "attribute", "value", "corresponding", "to", "the", "key", "method", "and", "value", "given", "." ]
train
https://github.com/mboudreau/Alternator/blob/4b230ac843494cb10e46ddc2848f5b5d377d7b72/src/main/java/com/amazonaws/services/dynamodb/datamodeling/DynamoDBMapper.java#L1028-L1031
couchbase/couchbase-java-client
src/main/java/com/couchbase/client/java/query/N1qlParams.java
N1qlParams.withCredentials
public N1qlParams withCredentials(String login, String password) { """ Allows to add a credential username/password pair to this request. If a credential for that username was previously set by a similar call, it is replaced. @param login the username/bucketname to add a credential for. @param password the as...
java
public N1qlParams withCredentials(String login, String password) { credentials.put(login, password); return this; }
[ "public", "N1qlParams", "withCredentials", "(", "String", "login", ",", "String", "password", ")", "{", "credentials", ".", "put", "(", "login", ",", "password", ")", ";", "return", "this", ";", "}" ]
Allows to add a credential username/password pair to this request. If a credential for that username was previously set by a similar call, it is replaced. @param login the username/bucketname to add a credential for. @param password the associated password. @return this {@link N1qlParams} for chaining.
[ "Allows", "to", "add", "a", "credential", "username", "/", "password", "pair", "to", "this", "request", ".", "If", "a", "credential", "for", "that", "username", "was", "previously", "set", "by", "a", "similar", "call", "it", "is", "replaced", "." ]
train
https://github.com/couchbase/couchbase-java-client/blob/f36a0ee0c66923bdde47838ca543e50cbaa99e14/src/main/java/com/couchbase/client/java/query/N1qlParams.java#L347-L350
GumTreeDiff/gumtree
core/src/main/java/com/github/gumtreediff/utils/SequenceAlgorithms.java
SequenceAlgorithms.longestCommonSequence
public static String longestCommonSequence(String s1, String s2) { """ Returns the longest common sequence between two strings as a string. """ int start = 0; int max = 0; for (int i = 0; i < s1.length(); i++) { for (int j = 0; j < s2.length(); j++) { int x =...
java
public static String longestCommonSequence(String s1, String s2) { int start = 0; int max = 0; for (int i = 0; i < s1.length(); i++) { for (int j = 0; j < s2.length(); j++) { int x = 0; while (s1.charAt(i + x) == s2.charAt(j + x)) { ...
[ "public", "static", "String", "longestCommonSequence", "(", "String", "s1", ",", "String", "s2", ")", "{", "int", "start", "=", "0", ";", "int", "max", "=", "0", ";", "for", "(", "int", "i", "=", "0", ";", "i", "<", "s1", ".", "length", "(", ")",...
Returns the longest common sequence between two strings as a string.
[ "Returns", "the", "longest", "common", "sequence", "between", "two", "strings", "as", "a", "string", "." ]
train
https://github.com/GumTreeDiff/gumtree/blob/a772d4d652af44bff22c38a234ddffbfbd365a37/core/src/main/java/com/github/gumtreediff/utils/SequenceAlgorithms.java#L84-L101
cternes/openkeepass
src/main/java/de/slackspace/openkeepass/KeePassDatabase.java
KeePassDatabase.openDatabase
public KeePassFile openDatabase(File keyFile) { """ Opens a KeePass database with the given keyfile and returns the KeePassFile for further processing. <p> If the database cannot be decrypted with the provided password an exception will be thrown. @param keyFile the password to open the database @return a...
java
public KeePassFile openDatabase(File keyFile) { if (keyFile == null) { throw new IllegalArgumentException("You must provide a valid KeePass keyfile."); } try { return openDatabase(new FileInputStream(keyFile)); } catch (FileNotFoundException e) { ...
[ "public", "KeePassFile", "openDatabase", "(", "File", "keyFile", ")", "{", "if", "(", "keyFile", "==", "null", ")", "{", "throw", "new", "IllegalArgumentException", "(", "\"You must provide a valid KeePass keyfile.\"", ")", ";", "}", "try", "{", "return", "openDat...
Opens a KeePass database with the given keyfile and returns the KeePassFile for further processing. <p> If the database cannot be decrypted with the provided password an exception will be thrown. @param keyFile the password to open the database @return a KeePassFile the keyfile to open the database @see KeePassFile
[ "Opens", "a", "KeePass", "database", "with", "the", "given", "keyfile", "and", "returns", "the", "KeePassFile", "for", "further", "processing", ".", "<p", ">", "If", "the", "database", "cannot", "be", "decrypted", "with", "the", "provided", "password", "an", ...
train
https://github.com/cternes/openkeepass/blob/4a354aecaea38af3c0dce5eb81b533f297e8d94f/src/main/java/de/slackspace/openkeepass/KeePassDatabase.java#L256-L266
inferred/FreeBuilder
src/main/java/org/inferred/freebuilder/processor/source/Type.java
Type.javadocMethodLink
public JavadocLink javadocMethodLink(String memberName, Type... types) { """ Returns a source excerpt of a JavaDoc link to a method on this type. """ return new JavadocLink("%s#%s(%s)", getQualifiedName(), memberName, (Excerpt) code -> { String separator = ""; fo...
java
public JavadocLink javadocMethodLink(String memberName, Type... types) { return new JavadocLink("%s#%s(%s)", getQualifiedName(), memberName, (Excerpt) code -> { String separator = ""; for (Type type : types) { code.add("%s%s", separator, type.getQualifiedName(...
[ "public", "JavadocLink", "javadocMethodLink", "(", "String", "memberName", ",", "Type", "...", "types", ")", "{", "return", "new", "JavadocLink", "(", "\"%s#%s(%s)\"", ",", "getQualifiedName", "(", ")", ",", "memberName", ",", "(", "Excerpt", ")", "code", "->"...
Returns a source excerpt of a JavaDoc link to a method on this type.
[ "Returns", "a", "source", "excerpt", "of", "a", "JavaDoc", "link", "to", "a", "method", "on", "this", "type", "." ]
train
https://github.com/inferred/FreeBuilder/blob/d5a222f90648aece135da4b971c55a60afe8649c/src/main/java/org/inferred/freebuilder/processor/source/Type.java#L117-L128
zxing/zxing
core/src/main/java/com/google/zxing/oned/OneDReader.java
OneDReader.decode
@Override public Result decode(BinaryBitmap image, Map<DecodeHintType,?> hints) throws NotFoundException, FormatException { """ Note that we don't try rotation without the try harder flag, even if rotation was supported. """ try { return doDecode(image, hints); } catch (N...
java
@Override public Result decode(BinaryBitmap image, Map<DecodeHintType,?> hints) throws NotFoundException, FormatException { try { return doDecode(image, hints); } catch (NotFoundException nfe) { boolean tryHarder = hints != null && hints.containsKey(DecodeHintType.TRY_HARDER...
[ "@", "Override", "public", "Result", "decode", "(", "BinaryBitmap", "image", ",", "Map", "<", "DecodeHintType", ",", "?", ">", "hints", ")", "throws", "NotFoundException", ",", "FormatException", "{", "try", "{", "return", "doDecode", "(", "image", ",", "hin...
Note that we don't try rotation without the try harder flag, even if rotation was supported.
[ "Note", "that", "we", "don", "t", "try", "rotation", "without", "the", "try", "harder", "flag", "even", "if", "rotation", "was", "supported", "." ]
train
https://github.com/zxing/zxing/blob/653ac2a3beb11481eff82e7d5f2bab8a745f7fac/core/src/main/java/com/google/zxing/oned/OneDReader.java#L50-L82
undertow-io/undertow
core/src/main/java/io/undertow/protocols/http2/Http2PriorityTree.java
Http2PriorityTree.registerStream
public void registerStream(int streamId, int dependency, int weighting, boolean exclusive) { """ Resisters a stream, with its dependency and dependent information @param streamId The stream id @param dependency The stream this stream depends on, if no stream is specified this should be zero @param weighting The...
java
public void registerStream(int streamId, int dependency, int weighting, boolean exclusive) { final Http2PriorityNode node = new Http2PriorityNode(streamId, weighting); if(exclusive) { Http2PriorityNode existing = nodesByID.get(dependency); if(existing != null) { e...
[ "public", "void", "registerStream", "(", "int", "streamId", ",", "int", "dependency", ",", "int", "weighting", ",", "boolean", "exclusive", ")", "{", "final", "Http2PriorityNode", "node", "=", "new", "Http2PriorityNode", "(", "streamId", ",", "weighting", ")", ...
Resisters a stream, with its dependency and dependent information @param streamId The stream id @param dependency The stream this stream depends on, if no stream is specified this should be zero @param weighting The weighting. If no weighting is specified this should be 16
[ "Resisters", "a", "stream", "with", "its", "dependency", "and", "dependent", "information" ]
train
https://github.com/undertow-io/undertow/blob/87de0b856a7a4ba8faf5b659537b9af07b763263/core/src/main/java/io/undertow/protocols/http2/Http2PriorityTree.java#L60-L74
sdl/Testy
src/main/java/com/sdl/selenium/extjs3/form/ComboBox.java
ComboBox.setValueWithJs
private boolean setValueWithJs(final String componentId, final String value) { """ this method is used in case normal flow for selection fails @param componentId ComboBox id so we can use directly js to force selection of that value @param value value @return true or false """ boolean selec...
java
private boolean setValueWithJs(final String componentId, final String value) { boolean selected; String script = "return (function(){var c = Ext.getCmp('" + componentId + "'); var record = c.findRecord(c.displayField, '" + value + "');" + "if(record){c.onSelect(record, c.store.indexO...
[ "private", "boolean", "setValueWithJs", "(", "final", "String", "componentId", ",", "final", "String", "value", ")", "{", "boolean", "selected", ";", "String", "script", "=", "\"return (function(){var c = Ext.getCmp('\"", "+", "componentId", "+", "\"'); var record = c....
this method is used in case normal flow for selection fails @param componentId ComboBox id so we can use directly js to force selection of that value @param value value @return true or false
[ "this", "method", "is", "used", "in", "case", "normal", "flow", "for", "selection", "fails" ]
train
https://github.com/sdl/Testy/blob/b3ae061554016f926f04694a39ff00dab7576609/src/main/java/com/sdl/selenium/extjs3/form/ComboBox.java#L118-L126
groundupworks/wings
wings-facebook/src/main/java/com/groundupworks/wings/facebook/FacebookPrivacyDialogFragment.java
FacebookPrivacyDialogFragment.newInstance
public static FacebookPrivacyDialogFragment newInstance(String albumName, String albumGraphPath) { """ Creates a new {@link FacebookPrivacyDialogFragment} instance. @param albumName the name of the album to share to. @param albumGraphPath the graph path of the album to share to. @return the new {@link Fa...
java
public static FacebookPrivacyDialogFragment newInstance(String albumName, String albumGraphPath) { FacebookPrivacyDialogFragment fragment = new FacebookPrivacyDialogFragment(); Bundle args = new Bundle(); args.putString(FRAGMENT_BUNDLE_KEY_ALBUM_NAME, albumName); args.putString(FRAGMENT...
[ "public", "static", "FacebookPrivacyDialogFragment", "newInstance", "(", "String", "albumName", ",", "String", "albumGraphPath", ")", "{", "FacebookPrivacyDialogFragment", "fragment", "=", "new", "FacebookPrivacyDialogFragment", "(", ")", ";", "Bundle", "args", "=", "ne...
Creates a new {@link FacebookPrivacyDialogFragment} instance. @param albumName the name of the album to share to. @param albumGraphPath the graph path of the album to share to. @return the new {@link FacebookPrivacyDialogFragment} instance.
[ "Creates", "a", "new", "{", "@link", "FacebookPrivacyDialogFragment", "}", "instance", "." ]
train
https://github.com/groundupworks/wings/blob/03d2827c30ef55f2db4e23f7500e016c7771fa39/wings-facebook/src/main/java/com/groundupworks/wings/facebook/FacebookPrivacyDialogFragment.java#L124-L133
kotcrab/vis-ui
ui/src/main/java/com/kotcrab/vis/ui/util/ColorUtils.java
ColorUtils.HSVtoRGB
public static Color HSVtoRGB (float h, float s, float v) { """ Converts HSV color system to RGB @param h hue 0-360 @param s saturation 0-100 @param v value 0-100 @return RGB values in LibGDX {@link Color} class """ Color c = new Color(1, 1, 1, 1); HSVtoRGB(h, s, v, c); return c; }
java
public static Color HSVtoRGB (float h, float s, float v) { Color c = new Color(1, 1, 1, 1); HSVtoRGB(h, s, v, c); return c; }
[ "public", "static", "Color", "HSVtoRGB", "(", "float", "h", ",", "float", "s", ",", "float", "v", ")", "{", "Color", "c", "=", "new", "Color", "(", "1", ",", "1", ",", "1", ",", "1", ")", ";", "HSVtoRGB", "(", "h", ",", "s", ",", "v", ",", ...
Converts HSV color system to RGB @param h hue 0-360 @param s saturation 0-100 @param v value 0-100 @return RGB values in LibGDX {@link Color} class
[ "Converts", "HSV", "color", "system", "to", "RGB" ]
train
https://github.com/kotcrab/vis-ui/blob/3b68f82d94ae32bffa2a3399c63f432e0f4908e0/ui/src/main/java/com/kotcrab/vis/ui/util/ColorUtils.java#L49-L53
OpenLiberty/open-liberty
dev/com.ibm.ws.transport.http/src/com/ibm/wsspi/http/channel/HttpChannelUtils.java
HttpChannelUtils.parseName
static private String parseName(char[] ch, int start, int end) { """ Parse a query parameter's name out of the input character array. This will undo any URLEncoding in the data (%20 is a space for example) and return the resulting string. Input must be in ASCII encoding. @param ch @param start @param end...
java
static private String parseName(char[] ch, int start, int end) { int len = 0; char[] name = new char[end - start]; for (int i = start; i < end; i++) { switch (ch[i]) { case '+': // translate plus symbols to spaces name[len++] =...
[ "static", "private", "String", "parseName", "(", "char", "[", "]", "ch", ",", "int", "start", ",", "int", "end", ")", "{", "int", "len", "=", "0", ";", "char", "[", "]", "name", "=", "new", "char", "[", "end", "-", "start", "]", ";", "for", "("...
Parse a query parameter's name out of the input character array. This will undo any URLEncoding in the data (%20 is a space for example) and return the resulting string. Input must be in ASCII encoding. @param ch @param start @param end @return String @throws IllegalArgumentException
[ "Parse", "a", "query", "parameter", "s", "name", "out", "of", "the", "input", "character", "array", ".", "This", "will", "undo", "any", "URLEncoding", "in", "the", "data", "(", "%20", "is", "a", "space", "for", "example", ")", "and", "return", "the", "...
train
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.transport.http/src/com/ibm/wsspi/http/channel/HttpChannelUtils.java#L241-L277
Azure/azure-sdk-for-java
cognitiveservices/data-plane/language/luis/runtime/src/main/java/com/microsoft/azure/cognitiveservices/language/luis/runtime/LuisRuntimeManager.java
LuisRuntimeManager.authenticate
public static LuisRuntimeAPI authenticate(EndpointAPI endpointAPI, ServiceClientCredentials credentials) { """ Initializes an instance of Language Understanding (LUIS) Runtime API client. @param endpointAPI the endpoint API @param credentials the management credentials for Azure @return the Language Understan...
java
public static LuisRuntimeAPI authenticate(EndpointAPI endpointAPI, ServiceClientCredentials credentials) { return authenticate(String.format("https://%s/luis/v2.0/", endpointAPI.toString()), credentials) .withEndpoint(endpointAPI.toString()); }
[ "public", "static", "LuisRuntimeAPI", "authenticate", "(", "EndpointAPI", "endpointAPI", ",", "ServiceClientCredentials", "credentials", ")", "{", "return", "authenticate", "(", "String", ".", "format", "(", "\"https://%s/luis/v2.0/\"", ",", "endpointAPI", ".", "toStrin...
Initializes an instance of Language Understanding (LUIS) Runtime API client. @param endpointAPI the endpoint API @param credentials the management credentials for Azure @return the Language Understanding (LUIS) Runtime API client
[ "Initializes", "an", "instance", "of", "Language", "Understanding", "(", "LUIS", ")", "Runtime", "API", "client", "." ]
train
https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/cognitiveservices/data-plane/language/luis/runtime/src/main/java/com/microsoft/azure/cognitiveservices/language/luis/runtime/LuisRuntimeManager.java#L80-L83
NordicSemiconductor/Android-DFU-Library
dfu/src/main/java/no/nordicsemi/android/dfu/DfuServiceListenerHelper.java
DfuServiceListenerHelper.registerProgressListener
public static void registerProgressListener(@NonNull final Context context, @NonNull final DfuProgressListener listener) { """ Registers the {@link DfuProgressListener}. Registered listener will receive the progress events from the DFU service. @param context the application context. @param listener the list...
java
public static void registerProgressListener(@NonNull final Context context, @NonNull final DfuProgressListener listener) { if (mProgressBroadcastReceiver == null) { mProgressBroadcastReceiver = new ProgressBroadcastsReceiver(); final IntentFilter filter = new IntentFilter(); filter.addAction(DfuBaseService....
[ "public", "static", "void", "registerProgressListener", "(", "@", "NonNull", "final", "Context", "context", ",", "@", "NonNull", "final", "DfuProgressListener", "listener", ")", "{", "if", "(", "mProgressBroadcastReceiver", "==", "null", ")", "{", "mProgressBroadcas...
Registers the {@link DfuProgressListener}. Registered listener will receive the progress events from the DFU service. @param context the application context. @param listener the listener to register.
[ "Registers", "the", "{", "@link", "DfuProgressListener", "}", ".", "Registered", "listener", "will", "receive", "the", "progress", "events", "from", "the", "DFU", "service", "." ]
train
https://github.com/NordicSemiconductor/Android-DFU-Library/blob/ec14c8c522bebe801a9a4c3dfbbeb1f53262c03f/dfu/src/main/java/no/nordicsemi/android/dfu/DfuServiceListenerHelper.java#L285-L295
mmazi/rescu
src/main/java/si/mazi/rescu/ResponseReader.java
ResponseReader.findCause
@SafeVarargs public static <T extends Throwable, C extends Class<? extends T>> T findCause(Throwable root, C... ofClasses) { """ Search the cause chain of <em>t</em> (starting from and including <em>t</em>) for a Throwable that is assignable to any of <em>ofClasses</em>, or null if not found. The chain is fir...
java
@SafeVarargs public static <T extends Throwable, C extends Class<? extends T>> T findCause(Throwable root, C... ofClasses) { for (C c : ofClasses) { Throwable t = root; while (t != null) { if (c.isInstance(t)) { return c.cast(t); } ...
[ "@", "SafeVarargs", "public", "static", "<", "T", "extends", "Throwable", ",", "C", "extends", "Class", "<", "?", "extends", "T", ">", ">", "T", "findCause", "(", "Throwable", "root", ",", "C", "...", "ofClasses", ")", "{", "for", "(", "C", "c", ":",...
Search the cause chain of <em>t</em> (starting from and including <em>t</em>) for a Throwable that is assignable to any of <em>ofClasses</em>, or null if not found. The chain is first fully searched for the first of <em>C</em>, then second, etc. @param ofClasses Throwable classes in order of priority to be searched fo...
[ "Search", "the", "cause", "chain", "of", "<em", ">", "t<", "/", "em", ">", "(", "starting", "from", "and", "including", "<em", ">", "t<", "/", "em", ">", ")", "for", "a", "Throwable", "that", "is", "assignable", "to", "any", "of", "<em", ">", "ofCl...
train
https://github.com/mmazi/rescu/blob/8a4f9367994da0a2617bd37acf0320c942e62de3/src/main/java/si/mazi/rescu/ResponseReader.java#L121-L133
google/j2objc
jre_emul/android/platform/external/icu/android_icu4j/src/main/java/android/icu/impl/ICUService.java
ICUService.getDisplayNames
public SortedMap<String, String> getDisplayNames(ULocale locale, String matchID) { """ Convenience override of getDisplayNames(ULocale, Comparator, String) that uses null for the comparator. """ return getDisplayNames(locale, null, matchID); }
java
public SortedMap<String, String> getDisplayNames(ULocale locale, String matchID) { return getDisplayNames(locale, null, matchID); }
[ "public", "SortedMap", "<", "String", ",", "String", ">", "getDisplayNames", "(", "ULocale", "locale", ",", "String", "matchID", ")", "{", "return", "getDisplayNames", "(", "locale", ",", "null", ",", "matchID", ")", ";", "}" ]
Convenience override of getDisplayNames(ULocale, Comparator, String) that uses null for the comparator.
[ "Convenience", "override", "of", "getDisplayNames", "(", "ULocale", "Comparator", "String", ")", "that", "uses", "null", "for", "the", "comparator", "." ]
train
https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/external/icu/android_icu4j/src/main/java/android/icu/impl/ICUService.java#L668-L670
apache/groovy
src/main/groovy/groovy/util/Node.java
Node.setMetaClass
protected static void setMetaClass(final MetaClass metaClass, Class nodeClass) { """ Extension point for subclasses to override the metaclass. The default one supports the property and @ attribute notations. @param metaClass the original metaclass @param nodeClass the class whose metaclass we wish to override...
java
protected static void setMetaClass(final MetaClass metaClass, Class nodeClass) { // TODO Is protected static a bit of a smell? // TODO perhaps set nodeClass to be Class<? extends Node> final MetaClass newMetaClass = new DelegatingMetaClass(metaClass) { @Override public Ob...
[ "protected", "static", "void", "setMetaClass", "(", "final", "MetaClass", "metaClass", ",", "Class", "nodeClass", ")", "{", "// TODO Is protected static a bit of a smell?", "// TODO perhaps set nodeClass to be Class<? extends Node>", "final", "MetaClass", "newMetaClass", "=", "...
Extension point for subclasses to override the metaclass. The default one supports the property and @ attribute notations. @param metaClass the original metaclass @param nodeClass the class whose metaclass we wish to override (this class or a subclass)
[ "Extension", "point", "for", "subclasses", "to", "override", "the", "metaclass", ".", "The", "default", "one", "supports", "the", "property", "and", "@", "attribute", "notations", "." ]
train
https://github.com/apache/groovy/blob/71cf20addb611bb8d097a59e395fd20bc7f31772/src/main/groovy/groovy/util/Node.java#L297-L333
Impetus/Kundera
src/kundera-cassandra/cassandra-core/src/main/java/com/impetus/client/cassandra/schemamanager/CassandraSchemaManager.java
CassandraSchemaManager.onSetKeyValidation
private void onSetKeyValidation(CfDef cfDef, Properties cfProperties, StringBuilder builder) { """ On set key validation. @param cfDef the cf def @param cfProperties the cf properties @param builder the builder """ String keyValidationClass = cfProperties.getProperty(CassandraConstants.KEY_VALI...
java
private void onSetKeyValidation(CfDef cfDef, Properties cfProperties, StringBuilder builder) { String keyValidationClass = cfProperties.getProperty(CassandraConstants.KEY_VALIDATION_CLASS); if (keyValidationClass != null) { if (builder != null) { // no...
[ "private", "void", "onSetKeyValidation", "(", "CfDef", "cfDef", ",", "Properties", "cfProperties", ",", "StringBuilder", "builder", ")", "{", "String", "keyValidationClass", "=", "cfProperties", ".", "getProperty", "(", "CassandraConstants", ".", "KEY_VALIDATION_CLASS",...
On set key validation. @param cfDef the cf def @param cfProperties the cf properties @param builder the builder
[ "On", "set", "key", "validation", "." ]
train
https://github.com/Impetus/Kundera/blob/268958ab1ec09d14ec4d9184f0c8ded7a9158908/src/kundera-cassandra/cassandra-core/src/main/java/com/impetus/client/cassandra/schemamanager/CassandraSchemaManager.java#L2771-L2785
phax/ph-oton
ph-oton-uictrls/src/main/java/com/helger/photon/uictrls/fineupload/FineUploaderBasic.java
FineUploaderBasic.setCustomHeaders
@Nonnull public FineUploaderBasic setCustomHeaders (@Nullable final Map <String, String> aCustomHeaders) { """ Additional headers sent along with the XHR POST request. Note that is option is only relevant to the ajax/XHR uploader. @param aCustomHeaders Custom headers to be set. @return this """ m_a...
java
@Nonnull public FineUploaderBasic setCustomHeaders (@Nullable final Map <String, String> aCustomHeaders) { m_aRequestCustomHeaders.setAll (aCustomHeaders); return this; }
[ "@", "Nonnull", "public", "FineUploaderBasic", "setCustomHeaders", "(", "@", "Nullable", "final", "Map", "<", "String", ",", "String", ">", "aCustomHeaders", ")", "{", "m_aRequestCustomHeaders", ".", "setAll", "(", "aCustomHeaders", ")", ";", "return", "this", "...
Additional headers sent along with the XHR POST request. Note that is option is only relevant to the ajax/XHR uploader. @param aCustomHeaders Custom headers to be set. @return this
[ "Additional", "headers", "sent", "along", "with", "the", "XHR", "POST", "request", ".", "Note", "that", "is", "option", "is", "only", "relevant", "to", "the", "ajax", "/", "XHR", "uploader", "." ]
train
https://github.com/phax/ph-oton/blob/f3aaacbbc02a9f3e4f32fe8db8e4adf7b9c1d3ef/ph-oton-uictrls/src/main/java/com/helger/photon/uictrls/fineupload/FineUploaderBasic.java#L248-L253
facebookarchive/hadoop-20
src/core/org/apache/hadoop/io/FastWritableRegister.java
FastWritableRegister.tryGetInstance
public static FastWritable tryGetInstance(String name, Configuration conf) { """ Tries to get an instance given the name of class. If the name is registered as FastWritable, the instance is obtained using the registry. """ if (name.length() != NAME_LEN) { // we use it to fast discard the request wit...
java
public static FastWritable tryGetInstance(String name, Configuration conf) { if (name.length() != NAME_LEN) { // we use it to fast discard the request without doing map lookup return null; } FastWritable fw = register.get(name); return fw == null ? null : fw.getFastWritableInstance(conf); ...
[ "public", "static", "FastWritable", "tryGetInstance", "(", "String", "name", ",", "Configuration", "conf", ")", "{", "if", "(", "name", ".", "length", "(", ")", "!=", "NAME_LEN", ")", "{", "// we use it to fast discard the request without doing map lookup", "return", ...
Tries to get an instance given the name of class. If the name is registered as FastWritable, the instance is obtained using the registry.
[ "Tries", "to", "get", "an", "instance", "given", "the", "name", "of", "class", ".", "If", "the", "name", "is", "registered", "as", "FastWritable", "the", "instance", "is", "obtained", "using", "the", "registry", "." ]
train
https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/core/org/apache/hadoop/io/FastWritableRegister.java#L98-L105
awslabs/amazon-sqs-java-messaging-lib
src/main/java/com/amazon/sqs/javamessaging/AmazonSQSMessagingClientWrapper.java
AmazonSQSMessagingClientWrapper.deleteMessageBatch
public DeleteMessageBatchResult deleteMessageBatch(DeleteMessageBatchRequest deleteMessageBatchRequest) throws JMSException { """ Calls <code>deleteMessageBatch</code> and wraps <code>AmazonClientException</code>. This is used to acknowledge multiple messages on client_acknowledge mode, so that they can be delet...
java
public DeleteMessageBatchResult deleteMessageBatch(DeleteMessageBatchRequest deleteMessageBatchRequest) throws JMSException { try { prepareRequest(deleteMessageBatchRequest); return amazonSQSClient.deleteMessageBatch(deleteMessageBatchRequest); } catch (AmazonClientException e) {...
[ "public", "DeleteMessageBatchResult", "deleteMessageBatch", "(", "DeleteMessageBatchRequest", "deleteMessageBatchRequest", ")", "throws", "JMSException", "{", "try", "{", "prepareRequest", "(", "deleteMessageBatchRequest", ")", ";", "return", "amazonSQSClient", ".", "deleteMe...
Calls <code>deleteMessageBatch</code> and wraps <code>AmazonClientException</code>. This is used to acknowledge multiple messages on client_acknowledge mode, so that they can be deleted from SQS queue. @param deleteMessageBatchRequest Container for the necessary parameters to execute the deleteMessageBatch service met...
[ "Calls", "<code", ">", "deleteMessageBatch<", "/", "code", ">", "and", "wraps", "<code", ">", "AmazonClientException<", "/", "code", ">", ".", "This", "is", "used", "to", "acknowledge", "multiple", "messages", "on", "client_acknowledge", "mode", "so", "that", ...
train
https://github.com/awslabs/amazon-sqs-java-messaging-lib/blob/efa716d34d51ef1c5572790626cdb795419cb342/src/main/java/com/amazon/sqs/javamessaging/AmazonSQSMessagingClientWrapper.java#L179-L186
infinispan/infinispan
core/src/main/java/org/infinispan/persistence/support/SingletonCacheWriter.java
SingletonCacheWriter.doPushState
private void doPushState() throws PushStateException { """ Called when the SingletonStore discovers that the cache has become the coordinator and push in memory state has been enabled. It might not actually push the state if there's an ongoing push task running, in which case will wait for the push task to finis...
java
private void doPushState() throws PushStateException { if (pushStateFuture == null || pushStateFuture.isDone()) { Callable<?> task = createPushStateTask(); pushStateFuture = executor.submit(task); try { waitForTaskToFinish(pushStateFuture, singletonConfiguration.pushStateTim...
[ "private", "void", "doPushState", "(", ")", "throws", "PushStateException", "{", "if", "(", "pushStateFuture", "==", "null", "||", "pushStateFuture", ".", "isDone", "(", ")", ")", "{", "Callable", "<", "?", ">", "task", "=", "createPushStateTask", "(", ")", ...
Called when the SingletonStore discovers that the cache has become the coordinator and push in memory state has been enabled. It might not actually push the state if there's an ongoing push task running, in which case will wait for the push task to finish.
[ "Called", "when", "the", "SingletonStore", "discovers", "that", "the", "cache", "has", "become", "the", "coordinator", "and", "push", "in", "memory", "state", "has", "been", "enabled", ".", "It", "might", "not", "actually", "push", "the", "state", "if", "the...
train
https://github.com/infinispan/infinispan/blob/7c62b94886c3febb4774ae8376acf2baa0265ab5/core/src/main/java/org/infinispan/persistence/support/SingletonCacheWriter.java#L193-L207
sebastiangraf/treetank
interfacemodules/jax-rx/src/main/java/org/treetank/service/jaxrx/implementation/DatabaseRepresentation.java
DatabaseRepresentation.getResource
public StreamingOutput getResource(final String resourceName, final Map<QueryParameter, String> queryParams) throws JaxRxException { """ This method is responsible to deliver the whole database. Additional parameters can be set (wrap, revision, output) which change the response view. @param resourceNa...
java
public StreamingOutput getResource(final String resourceName, final Map<QueryParameter, String> queryParams) throws JaxRxException { final StreamingOutput streamingOutput = new StreamingOutput() { @Override public void write(final OutputStream output) throws IOException, JaxRxExc...
[ "public", "StreamingOutput", "getResource", "(", "final", "String", "resourceName", ",", "final", "Map", "<", "QueryParameter", ",", "String", ">", "queryParams", ")", "throws", "JaxRxException", "{", "final", "StreamingOutput", "streamingOutput", "=", "new", "Strea...
This method is responsible to deliver the whole database. Additional parameters can be set (wrap, revision, output) which change the response view. @param resourceName The name of the requested database. @param queryParams The optional query parameters. @return The XML database resource, depending on the query paramet...
[ "This", "method", "is", "responsible", "to", "deliver", "the", "whole", "database", ".", "Additional", "parameters", "can", "be", "set", "(", "wrap", "revision", "output", ")", "which", "change", "the", "response", "view", "." ]
train
https://github.com/sebastiangraf/treetank/blob/9b96d631b6c2a8502a0cc958dcb02bd6a6fd8b60/interfacemodules/jax-rx/src/main/java/org/treetank/service/jaxrx/implementation/DatabaseRepresentation.java#L164-L197
GoSimpleLLC/nbvcxz
src/main/java/me/gosimple/nbvcxz/scoring/TimeEstimate.java
TimeEstimate.getTimeToCrack
public static BigDecimal getTimeToCrack(final Result result, final String guess_type) { """ Gets the estimated time to crack in seconds. @param result a {@code Result} object to estimate time to crack for. @param guess_type a {@code String} representing the estimate type to get time to crack for (defined i...
java
public static BigDecimal getTimeToCrack(final Result result, final String guess_type) { BigDecimal guess_per_second = BigDecimal.valueOf(result.getConfiguration().getGuessTypes().get(guess_type)); return result.getGuesses().divide(guess_per_second, 0, BigDecimal.ROUND_FLOOR); }
[ "public", "static", "BigDecimal", "getTimeToCrack", "(", "final", "Result", "result", ",", "final", "String", "guess_type", ")", "{", "BigDecimal", "guess_per_second", "=", "BigDecimal", ".", "valueOf", "(", "result", ".", "getConfiguration", "(", ")", ".", "get...
Gets the estimated time to crack in seconds. @param result a {@code Result} object to estimate time to crack for. @param guess_type a {@code String} representing the estimate type to get time to crack for (defined in {@code Configuration}. @return time in seconds estimated to crack as a {@code BigDecimal}.
[ "Gets", "the", "estimated", "time", "to", "crack", "in", "seconds", "." ]
train
https://github.com/GoSimpleLLC/nbvcxz/blob/a86fb24680e646efdf78d6fda9d68a5410145f56/src/main/java/me/gosimple/nbvcxz/scoring/TimeEstimate.java#L19-L24
tvesalainen/util
util/src/main/java/org/vesalainen/nio/file/attribute/UserAttrs.java
UserAttrs.getLongAttribute
public static final long getLongAttribute(Path path, String attribute, long def, LinkOption... options) throws IOException { """ Returns user-defined-attribute @param path @param attribute user:attribute name. user: can be omitted. @param def Default value if attribute doesn't exist @param options @return @t...
java
public static final long getLongAttribute(Path path, String attribute, long def, LinkOption... options) throws IOException { attribute = attribute.startsWith("user:") ? attribute : "user:"+attribute; byte[] attr = (byte[]) Files.getAttribute(path, attribute, options); if (attr == null) ...
[ "public", "static", "final", "long", "getLongAttribute", "(", "Path", "path", ",", "String", "attribute", ",", "long", "def", ",", "LinkOption", "...", "options", ")", "throws", "IOException", "{", "attribute", "=", "attribute", ".", "startsWith", "(", "\"user...
Returns user-defined-attribute @param path @param attribute user:attribute name. user: can be omitted. @param def Default value if attribute doesn't exist @param options @return @throws IOException
[ "Returns", "user", "-", "defined", "-", "attribute" ]
train
https://github.com/tvesalainen/util/blob/bba7a44689f638ffabc8be40a75bdc9a33676433/util/src/main/java/org/vesalainen/nio/file/attribute/UserAttrs.java#L208-L221
brettwooldridge/HikariCP
src/main/java/com/zaxxer/hikari/HikariConfig.java
HikariConfig.addDataSourceProperty
public void addDataSourceProperty(String propertyName, Object value) { """ Add a property (name/value pair) that will be used to configure the {@link DataSource}/{@link java.sql.Driver}. In the case of a {@link DataSource}, the property names will be translated to Java setters following the Java Bean naming co...
java
public void addDataSourceProperty(String propertyName, Object value) { checkIfSealed(); dataSourceProperties.put(propertyName, value); }
[ "public", "void", "addDataSourceProperty", "(", "String", "propertyName", ",", "Object", "value", ")", "{", "checkIfSealed", "(", ")", ";", "dataSourceProperties", ".", "put", "(", "propertyName", ",", "value", ")", ";", "}" ]
Add a property (name/value pair) that will be used to configure the {@link DataSource}/{@link java.sql.Driver}. In the case of a {@link DataSource}, the property names will be translated to Java setters following the Java Bean naming convention. For example, the property {@code cachePrepStmts} will translate into {@c...
[ "Add", "a", "property", "(", "name", "/", "value", "pair", ")", "that", "will", "be", "used", "to", "configure", "the", "{", "@link", "DataSource", "}", "/", "{", "@link", "java", ".", "sql", ".", "Driver", "}", "." ]
train
https://github.com/brettwooldridge/HikariCP/blob/c509ec1a3f1e19769ee69323972f339cf098ff4b/src/main/java/com/zaxxer/hikari/HikariConfig.java#L437-L441
dspinellis/UMLGraph
src/main/java/org/umlgraph/doclet/RelationPattern.java
RelationPattern.addRelation
public void addRelation(RelationType relationType, RelationDirection direction) { """ Adds, eventually merging, a direction for the specified relation type @param relationType @param direction """ int idx = relationType.ordinal(); directions[idx] = directions[idx].sum(direction); }
java
public void addRelation(RelationType relationType, RelationDirection direction) { int idx = relationType.ordinal(); directions[idx] = directions[idx].sum(direction); }
[ "public", "void", "addRelation", "(", "RelationType", "relationType", ",", "RelationDirection", "direction", ")", "{", "int", "idx", "=", "relationType", ".", "ordinal", "(", ")", ";", "directions", "[", "idx", "]", "=", "directions", "[", "idx", "]", ".", ...
Adds, eventually merging, a direction for the specified relation type @param relationType @param direction
[ "Adds", "eventually", "merging", "a", "direction", "for", "the", "specified", "relation", "type" ]
train
https://github.com/dspinellis/UMLGraph/blob/09576db5ae0ea63bfe30ef9fce88a513f9a8d843/src/main/java/org/umlgraph/doclet/RelationPattern.java#L30-L33
sirthias/parboiled
parboiled-core/src/main/java/org/parboiled/support/ParseTreeUtils.java
ParseTreeUtils.getNodeText
public static String getNodeText(Node<?> node, InputBuffer inputBuffer) { """ Returns the input text matched by the given node, with error correction. @param node the node @param inputBuffer the underlying inputBuffer @return null if node is null otherwise a string with the matched input text (which ca...
java
public static String getNodeText(Node<?> node, InputBuffer inputBuffer) { checkArgNotNull(node, "node"); checkArgNotNull(inputBuffer, "inputBuffer"); if (node.hasError()) { // if the node has a parse error we cannot simply cut a string out of the underlying input buffer, since we ...
[ "public", "static", "String", "getNodeText", "(", "Node", "<", "?", ">", "node", ",", "InputBuffer", "inputBuffer", ")", "{", "checkArgNotNull", "(", "node", ",", "\"node\"", ")", ";", "checkArgNotNull", "(", "inputBuffer", ",", "\"inputBuffer\"", ")", ";", ...
Returns the input text matched by the given node, with error correction. @param node the node @param inputBuffer the underlying inputBuffer @return null if node is null otherwise a string with the matched input text (which can be empty)
[ "Returns", "the", "input", "text", "matched", "by", "the", "given", "node", "with", "error", "correction", "." ]
train
https://github.com/sirthias/parboiled/blob/84f3ed43e3e171b4c6ab5e6ca6297d264a9d686a/parboiled-core/src/main/java/org/parboiled/support/ParseTreeUtils.java#L262-L294
d-sauer/JCalcAPI
src/main/java/org/jdice/calc/Num.java
Num.toObject
public <T> T toObject(Class<T> toClass, NumConverter numConverter) { """ Convert <tt>Num</tt> to defined custom object @param customObject @return """ return (T) toObject(toClass, numConverter, null); }
java
public <T> T toObject(Class<T> toClass, NumConverter numConverter) { return (T) toObject(toClass, numConverter, null); }
[ "public", "<", "T", ">", "T", "toObject", "(", "Class", "<", "T", ">", "toClass", ",", "NumConverter", "numConverter", ")", "{", "return", "(", "T", ")", "toObject", "(", "toClass", ",", "numConverter", ",", "null", ")", ";", "}" ]
Convert <tt>Num</tt> to defined custom object @param customObject @return
[ "Convert", "<tt", ">", "Num<", "/", "tt", ">", "to", "defined", "custom", "object" ]
train
https://github.com/d-sauer/JCalcAPI/blob/36ae1f9adfe611a6f1bd8ef87cf1dc0ec88ac035/src/main/java/org/jdice/calc/Num.java#L511-L513
sshtools/j2ssh-maverick
j2ssh-maverick/src/main/java/com/sshtools/sftp/SftpClient.java
SftpClient.get
public SftpFileAttributes get(String path, FileTransferProgress progress, boolean resume) throws FileNotFoundException, SftpStatusException, SshException, TransferCancelledException { """ <p> Download the remote file to the local computer. </p> @param path the path to the remote file @param progress ...
java
public SftpFileAttributes get(String path, FileTransferProgress progress, boolean resume) throws FileNotFoundException, SftpStatusException, SshException, TransferCancelledException { String localfile; if (path.lastIndexOf("/") > -1) { localfile = path.substring(path.lastIndexOf("/") + 1); } else { l...
[ "public", "SftpFileAttributes", "get", "(", "String", "path", ",", "FileTransferProgress", "progress", ",", "boolean", "resume", ")", "throws", "FileNotFoundException", ",", "SftpStatusException", ",", "SshException", ",", "TransferCancelledException", "{", "String", "l...
<p> Download the remote file to the local computer. </p> @param path the path to the remote file @param progress @param resume attempt to resume a interrupted download @return the downloaded file's attributes @throws FileNotFoundException @throws SftpStatusException @throws SshException @throws TransferCancelledExce...
[ "<p", ">", "Download", "the", "remote", "file", "to", "the", "local", "computer", ".", "<", "/", "p", ">" ]
train
https://github.com/sshtools/j2ssh-maverick/blob/ce11ceaf0aa0b129b54327a6891973e1e34689f7/j2ssh-maverick/src/main/java/com/sshtools/sftp/SftpClient.java#L824-L836
cybazeitalia/emaze-dysfunctional
src/main/java/net/emaze/dysfunctional/Spies.java
Spies.spy1st
public static <T1, T2> BiPredicate<T1, T2> spy1st(BiPredicate<T1, T2> predicate, Box<T1> param1) { """ Proxies a binary predicate spying for first parameter @param <T1> the predicate first parameter type @param <T2> the predicate second parameter type @param predicate the predicate that will be spied @param ...
java
public static <T1, T2> BiPredicate<T1, T2> spy1st(BiPredicate<T1, T2> predicate, Box<T1> param1) { return spy(predicate, Box.<Boolean>empty(), param1, Box.<T2>empty()); }
[ "public", "static", "<", "T1", ",", "T2", ">", "BiPredicate", "<", "T1", ",", "T2", ">", "spy1st", "(", "BiPredicate", "<", "T1", ",", "T2", ">", "predicate", ",", "Box", "<", "T1", ">", "param1", ")", "{", "return", "spy", "(", "predicate", ",", ...
Proxies a binary predicate spying for first parameter @param <T1> the predicate first parameter type @param <T2> the predicate second parameter type @param predicate the predicate that will be spied @param param1 a box that will be containing the first spied parameter @return the proxied predicate
[ "Proxies", "a", "binary", "predicate", "spying", "for", "first", "parameter" ]
train
https://github.com/cybazeitalia/emaze-dysfunctional/blob/98115a436e35335c5e8831f9fdc12f6d93d524be/src/main/java/net/emaze/dysfunctional/Spies.java#L469-L471
steveash/jopenfst
src/main/java/com/github/steveash/jopenfst/operations/Determinize.java
Determinize.groupByInputLabel
private Collection<DetArcWork> groupByInputLabel(final DetStateTuple detStateTuple) { """ input states in the residset, and just create pending (possibly duplicate) input residuals for the target states """ Map<Integer, DetArcWork> inputLabelToWork = Maps.newHashMap(); for (DetElement detElement : detS...
java
private Collection<DetArcWork> groupByInputLabel(final DetStateTuple detStateTuple) { Map<Integer, DetArcWork> inputLabelToWork = Maps.newHashMap(); for (DetElement detElement : detStateTuple.getElements()) { State inputState = getInputStateForId(detElement.getInputStateId()); for (Arc inputArc : in...
[ "private", "Collection", "<", "DetArcWork", ">", "groupByInputLabel", "(", "final", "DetStateTuple", "detStateTuple", ")", "{", "Map", "<", "Integer", ",", "DetArcWork", ">", "inputLabelToWork", "=", "Maps", ".", "newHashMap", "(", ")", ";", "for", "(", "DetEl...
input states in the residset, and just create pending (possibly duplicate) input residuals for the target states
[ "input", "states", "in", "the", "residset", "and", "just", "create", "pending", "(", "possibly", "duplicate", ")", "input", "residuals", "for", "the", "target", "states" ]
train
https://github.com/steveash/jopenfst/blob/4c675203015c1cfad2072556cb532b6edc73261d/src/main/java/com/github/steveash/jopenfst/operations/Determinize.java#L222-L240
landawn/AbacusUtil
src/com/landawn/abacus/util/Triple.java
Triple.setRightIf
public <E extends Exception> boolean setRightIf(final R newRight, Try.BiPredicate<? super Triple<L, M, R>, ? super R, E> predicate) throws E { """ Set to the specified <code>newRight</code> and returns <code>true</code> if <code>predicate</code> returns true. Otherwise returns <code>false</code> without setting ...
java
public <E extends Exception> boolean setRightIf(final R newRight, Try.BiPredicate<? super Triple<L, M, R>, ? super R, E> predicate) throws E { if (predicate.test(this, newRight)) { this.right = newRight; return true; } return false; }
[ "public", "<", "E", "extends", "Exception", ">", "boolean", "setRightIf", "(", "final", "R", "newRight", ",", "Try", ".", "BiPredicate", "<", "?", "super", "Triple", "<", "L", ",", "M", ",", "R", ">", ",", "?", "super", "R", ",", "E", ">", "predica...
Set to the specified <code>newRight</code> and returns <code>true</code> if <code>predicate</code> returns true. Otherwise returns <code>false</code> without setting the value to new value. @param newRight @param predicate - the first parameter is current pair, the second parameter is the <code>newRight</code> @return
[ "Set", "to", "the", "specified", "<code", ">", "newRight<", "/", "code", ">", "and", "returns", "<code", ">", "true<", "/", "code", ">", "if", "<code", ">", "predicate<", "/", "code", ">", "returns", "true", ".", "Otherwise", "returns", "<code", ">", "...
train
https://github.com/landawn/AbacusUtil/blob/544b7720175d15e9329f83dd22a8cc5fa4515e12/src/com/landawn/abacus/util/Triple.java#L175-L182
alkacon/opencms-core
src/org/opencms/gwt/CmsVfsService.java
CmsVfsService.createHistoryResourceBean
private CmsHistoryResourceBean createHistoryResourceBean( CmsObject cms, CmsResource historyRes, boolean offline, int maxVersion) throws CmsException { """ Creates a bean representing a historical resource version.<p> @param cms the current CMS context @param historyRes the ...
java
private CmsHistoryResourceBean createHistoryResourceBean( CmsObject cms, CmsResource historyRes, boolean offline, int maxVersion) throws CmsException { CmsHistoryResourceBean result = new CmsHistoryResourceBean(); Locale locale = OpenCms.getWorkplaceManager().getWor...
[ "private", "CmsHistoryResourceBean", "createHistoryResourceBean", "(", "CmsObject", "cms", ",", "CmsResource", "historyRes", ",", "boolean", "offline", ",", "int", "maxVersion", ")", "throws", "CmsException", "{", "CmsHistoryResourceBean", "result", "=", "new", "CmsHist...
Creates a bean representing a historical resource version.<p> @param cms the current CMS context @param historyRes the historical resource @param offline true if this resource was read from the offline project @param maxVersion the largest version number found @return the bean representing the historical resource @th...
[ "Creates", "a", "bean", "representing", "a", "historical", "resource", "version", ".", "<p", ">" ]
train
https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/gwt/CmsVfsService.java#L1313-L1363
apache/flink
flink-runtime/src/main/java/org/apache/flink/runtime/metrics/groups/AbstractMetricGroup.java
AbstractMetricGroup.getLogicalScope
String getLogicalScope(CharacterFilter filter, char delimiter, int reporterIndex) { """ Returns the logical scope of this group, for example {@code "taskmanager.job.task"}. @param filter character filter which is applied to the scope components @param delimiter delimiter to use for concatenating scope compone...
java
String getLogicalScope(CharacterFilter filter, char delimiter, int reporterIndex) { if (logicalScopeStrings.length == 0 || (reporterIndex < 0 || reporterIndex >= logicalScopeStrings.length)) { return createLogicalScope(filter, delimiter); } else { if (logicalScopeStrings[reporterIndex] == null) { logicalS...
[ "String", "getLogicalScope", "(", "CharacterFilter", "filter", ",", "char", "delimiter", ",", "int", "reporterIndex", ")", "{", "if", "(", "logicalScopeStrings", ".", "length", "==", "0", "||", "(", "reporterIndex", "<", "0", "||", "reporterIndex", ">=", "logi...
Returns the logical scope of this group, for example {@code "taskmanager.job.task"}. @param filter character filter which is applied to the scope components @param delimiter delimiter to use for concatenating scope components @param reporterIndex index of the reporter @return logical scope
[ "Returns", "the", "logical", "scope", "of", "this", "group", "for", "example", "{", "@code", "taskmanager", ".", "job", ".", "task", "}", "." ]
train
https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-runtime/src/main/java/org/apache/flink/runtime/metrics/groups/AbstractMetricGroup.java#L164-L173
orhanobut/dialogplus
dialogplus/src/main/java/com/orhanobut/dialogplus/DialogPlus.java
DialogPlus.createView
private View createView(LayoutInflater inflater, @Nullable View headerView, boolean fixedHeader, @Nullable View footerView, boolean fixedFooter, BaseAdapter adapter) { """ it is called when the content view is created @param inflater used to inflate the content of the dialog @return a...
java
private View createView(LayoutInflater inflater, @Nullable View headerView, boolean fixedHeader, @Nullable View footerView, boolean fixedFooter, BaseAdapter adapter) { View view = holder.getView(inflater, rootView); if (holder instanceof ViewHolder) { assignClickListenerRecursiv...
[ "private", "View", "createView", "(", "LayoutInflater", "inflater", ",", "@", "Nullable", "View", "headerView", ",", "boolean", "fixedHeader", ",", "@", "Nullable", "View", "footerView", ",", "boolean", "fixedFooter", ",", "BaseAdapter", "adapter", ")", "{", "Vi...
it is called when the content view is created @param inflater used to inflate the content of the dialog @return any view which is passed
[ "it", "is", "called", "when", "the", "content", "view", "is", "created" ]
train
https://github.com/orhanobut/dialogplus/blob/291bf4daaa3c81bf5537125f547913beb8ee2c17/dialogplus/src/main/java/com/orhanobut/dialogplus/DialogPlus.java#L264-L295
super-csv/super-csv
super-csv/src/main/java/org/supercsv/cellprocessor/constraint/Unique.java
Unique.execute
public Object execute(final Object value, final CsvContext context) { """ {@inheritDoc} @throws SuperCsvCellProcessorException if value is null @throws SuperCsvConstraintViolationException if a non-unique value is encountered """ validateInputNotNull(value, context); if( !encounteredElements.add(v...
java
public Object execute(final Object value, final CsvContext context) { validateInputNotNull(value, context); if( !encounteredElements.add(value) ) { throw new SuperCsvConstraintViolationException(String.format("duplicate value '%s' encountered", value), context, this); } return next.execute(value, conte...
[ "public", "Object", "execute", "(", "final", "Object", "value", ",", "final", "CsvContext", "context", ")", "{", "validateInputNotNull", "(", "value", ",", "context", ")", ";", "if", "(", "!", "encounteredElements", ".", "add", "(", "value", ")", ")", "{",...
{@inheritDoc} @throws SuperCsvCellProcessorException if value is null @throws SuperCsvConstraintViolationException if a non-unique value is encountered
[ "{", "@inheritDoc", "}" ]
train
https://github.com/super-csv/super-csv/blob/f18db724674dc1c4116e25142c1b5403ebf43e96/super-csv/src/main/java/org/supercsv/cellprocessor/constraint/Unique.java#L72-L80
pushbit/sprockets
src/main/java/net/sf/sprockets/sql/Statements.java
Statements.setStrings
public static PreparedStatement setStrings(PreparedStatement stmt, String... params) throws SQLException { """ Set the statement parameters, starting at 1, in the order of the params. @since 3.0.0 """ return setStrings(1, stmt, params); }
java
public static PreparedStatement setStrings(PreparedStatement stmt, String... params) throws SQLException { return setStrings(1, stmt, params); }
[ "public", "static", "PreparedStatement", "setStrings", "(", "PreparedStatement", "stmt", ",", "String", "...", "params", ")", "throws", "SQLException", "{", "return", "setStrings", "(", "1", ",", "stmt", ",", "params", ")", ";", "}" ]
Set the statement parameters, starting at 1, in the order of the params. @since 3.0.0
[ "Set", "the", "statement", "parameters", "starting", "at", "1", "in", "the", "order", "of", "the", "params", "." ]
train
https://github.com/pushbit/sprockets/blob/5d967317cbb2374c69d33271d3c7b7311e1ea4ac/src/main/java/net/sf/sprockets/sql/Statements.java#L90-L93
junit-team/junit4
src/main/java/org/junit/runners/model/RunnerBuilder.java
RunnerBuilder.safeRunnerForClass
public Runner safeRunnerForClass(Class<?> testClass) { """ Always returns a runner for the given test class. <p>In case of an exception a runner will be returned that prints an error instead of running tests. <p>Note that some of the internal JUnit implementations of RunnerBuilder will return {@code null} ...
java
public Runner safeRunnerForClass(Class<?> testClass) { try { Runner runner = runnerForClass(testClass); if (runner != null) { configureRunner(runner); } return runner; } catch (Throwable e) { return new ErrorReportingRunner(test...
[ "public", "Runner", "safeRunnerForClass", "(", "Class", "<", "?", ">", "testClass", ")", "{", "try", "{", "Runner", "runner", "=", "runnerForClass", "(", "testClass", ")", ";", "if", "(", "runner", "!=", "null", ")", "{", "configureRunner", "(", "runner", ...
Always returns a runner for the given test class. <p>In case of an exception a runner will be returned that prints an error instead of running tests. <p>Note that some of the internal JUnit implementations of RunnerBuilder will return {@code null} from this method, but no RunnerBuilder passed to a Runner constructor ...
[ "Always", "returns", "a", "runner", "for", "the", "given", "test", "class", "." ]
train
https://github.com/junit-team/junit4/blob/d9861ecdb6e487f6c352437ee823879aca3b81d4/src/main/java/org/junit/runners/model/RunnerBuilder.java#L68-L78
looly/hutool
hutool-core/src/main/java/cn/hutool/core/io/FileUtil.java
FileUtil.subPath
public static String subPath(String rootDir, File file) { """ 获得相对子路径 栗子: <pre> dirPath: d:/aaa/bbb filePath: d:/aaa/bbb/ccc =》 ccc dirPath: d:/Aaa/bbb filePath: d:/aaa/bbb/ccc.txt =》 ccc.txt </pre> @param rootDir 绝对父路径 @param file 文件 @return 相对子路径 """ try { return subP...
java
public static String subPath(String rootDir, File file) { try { return subPath(rootDir, file.getCanonicalPath()); } catch (IOException e) { throw new IORuntimeException(e); } }
[ "public", "static", "String", "subPath", "(", "String", "rootDir", ",", "File", "file", ")", "{", "try", "{", "return", "subPath", "(", "rootDir", ",", "file", ".", "getCanonicalPath", "(", ")", ")", ";", "}", "catch", "(", "IOException", "e", ")", "{"...
获得相对子路径 栗子: <pre> dirPath: d:/aaa/bbb filePath: d:/aaa/bbb/ccc =》 ccc dirPath: d:/Aaa/bbb filePath: d:/aaa/bbb/ccc.txt =》 ccc.txt </pre> @param rootDir 绝对父路径 @param file 文件 @return 相对子路径
[ "获得相对子路径" ]
train
https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-core/src/main/java/cn/hutool/core/io/FileUtil.java#L1599-L1605
Alluxio/alluxio
core/common/src/main/java/alluxio/concurrent/jsr/CountedCompleter.java
CountedCompleter.propagateCompletion
public final void propagateCompletion() { """ Equivalent to {@link #tryComplete} but does not invoke {@link #onCompletion(CountedCompleter)} along the completion path: If the pending count is nonzero, decrements the count; otherwise, similarly tries to complete this task's completer, if one exists, else marks th...
java
public final void propagateCompletion() { CountedCompleter<?> a = this, s; for (int c;;) { if ((c = a.pending) == 0) { if ((a = (s = a).completer) == null) { s.quietlyComplete(); return; } } else if (U.compareAndSwapInt(a, PENDING, c, c - 1)) return; }...
[ "public", "final", "void", "propagateCompletion", "(", ")", "{", "CountedCompleter", "<", "?", ">", "a", "=", "this", ",", "s", ";", "for", "(", "int", "c", ";", ";", ")", "{", "if", "(", "(", "c", "=", "a", ".", "pending", ")", "==", "0", ")",...
Equivalent to {@link #tryComplete} but does not invoke {@link #onCompletion(CountedCompleter)} along the completion path: If the pending count is nonzero, decrements the count; otherwise, similarly tries to complete this task's completer, if one exists, else marks this task as complete. This method may be useful in cas...
[ "Equivalent", "to", "{" ]
train
https://github.com/Alluxio/alluxio/blob/af38cf3ab44613355b18217a3a4d961f8fec3a10/core/common/src/main/java/alluxio/concurrent/jsr/CountedCompleter.java#L567-L578
jeremylong/DependencyCheck
core/src/main/java/org/owasp/dependencycheck/dependency/EvidenceCollection.java
EvidenceCollection.addEvidence
public synchronized void addEvidence(EvidenceType type, Evidence e) { """ Adds evidence to the collection. @param type the type of evidence (vendor, product, version) @param e Evidence """ if (null != type) { switch (type) { case VENDOR: vendors.add(e...
java
public synchronized void addEvidence(EvidenceType type, Evidence e) { if (null != type) { switch (type) { case VENDOR: vendors.add(e); break; case PRODUCT: products.add(e); break; ...
[ "public", "synchronized", "void", "addEvidence", "(", "EvidenceType", "type", ",", "Evidence", "e", ")", "{", "if", "(", "null", "!=", "type", ")", "{", "switch", "(", "type", ")", "{", "case", "VENDOR", ":", "vendors", ".", "add", "(", "e", ")", ";"...
Adds evidence to the collection. @param type the type of evidence (vendor, product, version) @param e Evidence
[ "Adds", "evidence", "to", "the", "collection", "." ]
train
https://github.com/jeremylong/DependencyCheck/blob/6cc7690ea12e4ca1454210ceaa2e9a5523f0926c/core/src/main/java/org/owasp/dependencycheck/dependency/EvidenceCollection.java#L148-L164
phax/ph-commons
ph-commons/src/main/java/com/helger/commons/string/StringHelper.java
StringHelper.getWithLeading
@Nonnull public static String getWithLeading (final int nValue, @Nonnegative final int nMinLen, final char cFront) { """ Get a string that is filled at the beginning with the passed character until the minimum length is reached. If the input String is longer than the provided length, it is returned unchanged. ...
java
@Nonnull public static String getWithLeading (final int nValue, @Nonnegative final int nMinLen, final char cFront) { return _getWithLeadingOrTrailing (Integer.toString (nValue), nMinLen, cFront, true); }
[ "@", "Nonnull", "public", "static", "String", "getWithLeading", "(", "final", "int", "nValue", ",", "@", "Nonnegative", "final", "int", "nMinLen", ",", "final", "char", "cFront", ")", "{", "return", "_getWithLeadingOrTrailing", "(", "Integer", ".", "toString", ...
Get a string that is filled at the beginning with the passed character until the minimum length is reached. If the input String is longer than the provided length, it is returned unchanged. @param nValue Source string. May be <code>null</code>. @param nMinLen Minimum length. Should be &gt; 0. @param cFront The charact...
[ "Get", "a", "string", "that", "is", "filled", "at", "the", "beginning", "with", "the", "passed", "character", "until", "the", "minimum", "length", "is", "reached", ".", "If", "the", "input", "String", "is", "longer", "than", "the", "provided", "length", "i...
train
https://github.com/phax/ph-commons/blob/d28c03565f44a0b804d96028d0969f9bb38c4313/ph-commons/src/main/java/com/helger/commons/string/StringHelper.java#L520-L524
OpenLiberty/open-liberty
dev/com.ibm.ws.webcontainer/src/com/ibm/websphere/servlet/response/StoredResponse.java
StoredResponse.getOutputBufferAsString
public String getOutputBufferAsString() throws IOException { """ Get the output from the response outputstream as a String. This method should only be used to retrieve content that is known to be text based. Using this method to retrieve binary data will corrupt the response data. """ byte[] buffer = g...
java
public String getOutputBufferAsString() throws IOException { byte[] buffer = getOutputBuffer(); if (buffer != null) return new String(buffer, this.getCharacterEncoding()); else return null; }
[ "public", "String", "getOutputBufferAsString", "(", ")", "throws", "IOException", "{", "byte", "[", "]", "buffer", "=", "getOutputBuffer", "(", ")", ";", "if", "(", "buffer", "!=", "null", ")", "return", "new", "String", "(", "buffer", ",", "this", ".", ...
Get the output from the response outputstream as a String. This method should only be used to retrieve content that is known to be text based. Using this method to retrieve binary data will corrupt the response data.
[ "Get", "the", "output", "from", "the", "response", "outputstream", "as", "a", "String", ".", "This", "method", "should", "only", "be", "used", "to", "retrieve", "content", "that", "is", "known", "to", "be", "text", "based", ".", "Using", "this", "method", ...
train
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.webcontainer/src/com/ibm/websphere/servlet/response/StoredResponse.java#L727-L734
jeremylong/DependencyCheck
core/src/main/java/org/owasp/dependencycheck/analyzer/FileNameAnalyzer.java
FileNameAnalyzer.analyzeDependency
@Override protected void analyzeDependency(Dependency dependency, Engine engine) throws AnalysisException { """ Collects information about the file name. @param dependency the dependency to analyze. @param engine the engine that is scanning the dependencies @throws AnalysisException is thrown if there is ...
java
@Override protected void analyzeDependency(Dependency dependency, Engine engine) throws AnalysisException { //strip any path information that may get added by ArchiveAnalyzer, etc. final File f = dependency.getActualFile(); final String fileName = FilenameUtils.removeExtension(f.getName()); ...
[ "@", "Override", "protected", "void", "analyzeDependency", "(", "Dependency", "dependency", ",", "Engine", "engine", ")", "throws", "AnalysisException", "{", "//strip any path information that may get added by ArchiveAnalyzer, etc.", "final", "File", "f", "=", "dependency", ...
Collects information about the file name. @param dependency the dependency to analyze. @param engine the engine that is scanning the dependencies @throws AnalysisException is thrown if there is an error reading the JAR file.
[ "Collects", "information", "about", "the", "file", "name", "." ]
train
https://github.com/jeremylong/DependencyCheck/blob/6cc7690ea12e4ca1454210ceaa2e9a5523f0926c/core/src/main/java/org/owasp/dependencycheck/analyzer/FileNameAnalyzer.java#L114-L140
BorderTech/wcomponents
wcomponents-core/src/main/java/com/github/bordertech/wcomponents/util/visitor/FindComponentsByClassVisitor.java
FindComponentsByClassVisitor.classNamesMatch
protected boolean classNamesMatch(final String name1, final String name2) { """ Tests two class names for equality, taking partical class names (no package given) into account. @param name1 the first class name to compare. @param name2 the second class name to compare. @return true if the class names match, f...
java
protected boolean classNamesMatch(final String name1, final String name2) { if (name1 == null || name2 == null) { return false; } int index1 = name1.lastIndexOf('.'); int index2 = name2.lastIndexOf('.'); if (index1 == -1 && index2 != -1) { return Util.equals(name1, name2.substring(index2 + 1)); } else...
[ "protected", "boolean", "classNamesMatch", "(", "final", "String", "name1", ",", "final", "String", "name2", ")", "{", "if", "(", "name1", "==", "null", "||", "name2", "==", "null", ")", "{", "return", "false", ";", "}", "int", "index1", "=", "name1", ...
Tests two class names for equality, taking partical class names (no package given) into account. @param name1 the first class name to compare. @param name2 the second class name to compare. @return true if the class names match, false otherwise.
[ "Tests", "two", "class", "names", "for", "equality", "taking", "partical", "class", "names", "(", "no", "package", "given", ")", "into", "account", "." ]
train
https://github.com/BorderTech/wcomponents/blob/d1a2b2243270067db030feb36ca74255aaa94436/wcomponents-core/src/main/java/com/github/bordertech/wcomponents/util/visitor/FindComponentsByClassVisitor.java#L120-L133
google/closure-templates
java/src/com/google/template/soy/jbcsrc/AppendableExpression.java
AppendableExpression.appendChar
AppendableExpression appendChar(Expression exp) { """ Returns a similar {@link AppendableExpression} but with the given (char valued) expression appended to it. """ return withNewDelegate(delegate.invoke(APPEND_CHAR, exp), true); }
java
AppendableExpression appendChar(Expression exp) { return withNewDelegate(delegate.invoke(APPEND_CHAR, exp), true); }
[ "AppendableExpression", "appendChar", "(", "Expression", "exp", ")", "{", "return", "withNewDelegate", "(", "delegate", ".", "invoke", "(", "APPEND_CHAR", ",", "exp", ")", ",", "true", ")", ";", "}" ]
Returns a similar {@link AppendableExpression} but with the given (char valued) expression appended to it.
[ "Returns", "a", "similar", "{" ]
train
https://github.com/google/closure-templates/blob/cc61e1dff70ae97f24f417a57410081bc498bd56/java/src/com/google/template/soy/jbcsrc/AppendableExpression.java#L149-L151
BioPAX/Paxtools
sbgn-converter/src/main/java/org/biopax/paxtools/io/sbgn/SBGNLayoutManager.java
SBGNLayoutManager.connectArcToPort
private void connectArcToPort(SbgnPDNode lPort, Port vPort) { """ This method connects the existing arcs to the newly created ports which are created by ChiLay and SBGNPD Layout. @param lPort l level port object. @param vPort v level port object. """ //Iterate over the edges of l level port ...
java
private void connectArcToPort(SbgnPDNode lPort, Port vPort) { //Iterate over the edges of l level port for (Object e: (lPort.getEdges())) { //Ignore rigid edges if(((LEdge)e).type.equals("rigid edge")) continue; //Determine the if vPort i...
[ "private", "void", "connectArcToPort", "(", "SbgnPDNode", "lPort", ",", "Port", "vPort", ")", "{", "//Iterate over the edges of l level port", "for", "(", "Object", "e", ":", "(", "lPort", ".", "getEdges", "(", ")", ")", ")", "{", "//Ignore rigid edges", "if", ...
This method connects the existing arcs to the newly created ports which are created by ChiLay and SBGNPD Layout. @param lPort l level port object. @param vPort v level port object.
[ "This", "method", "connects", "the", "existing", "arcs", "to", "the", "newly", "created", "ports", "which", "are", "created", "by", "ChiLay", "and", "SBGNPD", "Layout", "." ]
train
https://github.com/BioPAX/Paxtools/blob/2f93afa94426bf8b5afc2e0e61cd4b269a83288d/sbgn-converter/src/main/java/org/biopax/paxtools/io/sbgn/SBGNLayoutManager.java#L185-L205
OpenLiberty/open-liberty
dev/com.ibm.ws.ejbcontainer.core/src/com/ibm/ejs/container/EJBFactoryHome.java
EJBFactoryHome.createBeanO
@Override public BeanO createBeanO(EJBThreadData threadData, ContainerTx tx, BeanId id) throws RemoteException { """ This method creates and returns a new <code>BeanO</code> instance appropriate for this home. <p> The returned <code>BeanO</code> has a newly created enterprise bean inst...
java
@Override public BeanO createBeanO(EJBThreadData threadData, ContainerTx tx, BeanId id) throws RemoteException { throw new ContainerEJBException("EJBContainer internal error"); }
[ "@", "Override", "public", "BeanO", "createBeanO", "(", "EJBThreadData", "threadData", ",", "ContainerTx", "tx", ",", "BeanId", "id", ")", "throws", "RemoteException", "{", "throw", "new", "ContainerEJBException", "(", "\"EJBContainer internal error\"", ")", ";", "}...
This method creates and returns a new <code>BeanO</code> instance appropriate for this home. <p> The returned <code>BeanO</code> has a newly created enterprise bean instance associated with it, and the enterprise bean instance has had its set...Context() method called on it to set its context to the returned <code>Bea...
[ "This", "method", "creates", "and", "returns", "a", "new", "<code", ">", "BeanO<", "/", "code", ">", "instance", "appropriate", "for", "this", "home", ".", "<p", ">" ]
train
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.ejbcontainer.core/src/com/ibm/ejs/container/EJBFactoryHome.java#L152-L157
Alluxio/alluxio
core/base/src/main/java/alluxio/util/URIUtils.java
URIUtils.hashIgnoreCase
public static int hashIgnoreCase(int hash, String s) { """ Hashes a string for a URI hash, while ignoring the case. @param hash the input hash @param s the string to hash and combine with the input hash @return the resulting hash """ if (s == null) { return hash; } int length = s.length(...
java
public static int hashIgnoreCase(int hash, String s) { if (s == null) { return hash; } int length = s.length(); for (int i = 0; i < length; i++) { hash = 31 * hash + URIUtils.toLower(s.charAt(i)); } return hash; }
[ "public", "static", "int", "hashIgnoreCase", "(", "int", "hash", ",", "String", "s", ")", "{", "if", "(", "s", "==", "null", ")", "{", "return", "hash", ";", "}", "int", "length", "=", "s", ".", "length", "(", ")", ";", "for", "(", "int", "i", ...
Hashes a string for a URI hash, while ignoring the case. @param hash the input hash @param s the string to hash and combine with the input hash @return the resulting hash
[ "Hashes", "a", "string", "for", "a", "URI", "hash", "while", "ignoring", "the", "case", "." ]
train
https://github.com/Alluxio/alluxio/blob/af38cf3ab44613355b18217a3a4d961f8fec3a10/core/base/src/main/java/alluxio/util/URIUtils.java#L291-L300
OpenLiberty/open-liberty
dev/com.ibm.ws.dynacache.monitor/src/com/ibm/ws/cache/stat/internal/CacheStatsModule.java
CacheStatsModule.onInvalidate
public void onInvalidate(String template, int cause, int locality, int source) { """ /* Updates statistics for all types of invalidations - timeout, LRU, explicit invalidations @param template the template of the cache entry. The template cannot be null for Servlet cache. @param cause the cause of invalidat...
java
public void onInvalidate(String template, int cause, int locality, int source) { final String methodName = "onInvalidate()"; if (tc.isDebugEnabled()) Tr.debug(tc, methodName + " cacheName=" + _sCacheName + " template=" + template + " cause=" + cause + " locality=" + locality ...
[ "public", "void", "onInvalidate", "(", "String", "template", ",", "int", "cause", ",", "int", "locality", ",", "int", "source", ")", "{", "final", "String", "methodName", "=", "\"onInvalidate()\"", ";", "if", "(", "tc", ".", "isDebugEnabled", "(", ")", ")"...
/* Updates statistics for all types of invalidations - timeout, LRU, explicit invalidations @param template the template of the cache entry. The template cannot be null for Servlet cache. @param cause the cause of invalidation @param locality whether the invalidation occurred on disk, in memory, or neither @param s...
[ "/", "*", "Updates", "statistics", "for", "all", "types", "of", "invalidations", "-", "timeout", "LRU", "explicit", "invalidations" ]
train
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.dynacache.monitor/src/com/ibm/ws/cache/stat/internal/CacheStatsModule.java#L1002-L1009
lastaflute/lastaflute
src/main/java/org/lastaflute/core/mail/LaTypicalPostcard.java
LaTypicalPostcard.pushLogging
public void pushLogging(String key, Object value) { """ Push element of mail logging. @param key The key of the element. (NotNull) @param value The value of the element. (NotNull) """ assertArgumentNotNull("key", key); assertArgumentNotNull("value", value); postcard.pushLogging(key, v...
java
public void pushLogging(String key, Object value) { assertArgumentNotNull("key", key); assertArgumentNotNull("value", value); postcard.pushLogging(key, value); }
[ "public", "void", "pushLogging", "(", "String", "key", ",", "Object", "value", ")", "{", "assertArgumentNotNull", "(", "\"key\"", ",", "key", ")", ";", "assertArgumentNotNull", "(", "\"value\"", ",", "value", ")", ";", "postcard", ".", "pushLogging", "(", "k...
Push element of mail logging. @param key The key of the element. (NotNull) @param value The value of the element. (NotNull)
[ "Push", "element", "of", "mail", "logging", "." ]
train
https://github.com/lastaflute/lastaflute/blob/17b56dda8322e4c6d79043532c1dda917d6b60a8/src/main/java/org/lastaflute/core/mail/LaTypicalPostcard.java#L272-L276
ops4j/org.ops4j.pax.web
pax-web-resources/pax-web-resources-jsf/src/main/java/org/ops4j/pax/web/resources/jsf/OsgiResourceHandler.java
OsgiResourceHandler.createResourceIdentifier
private String createResourceIdentifier(final String localePrefix, final String resourceName, final String resourceVersion, final String libraryName, final String libraryVersion) { """ Creates an ResourceIdentifier according to chapter 2.6.1.3 from the JSF 2.2 specification @param localePrefix locale to use ...
java
private String createResourceIdentifier(final String localePrefix, final String resourceName, final String resourceVersion, final String libraryName, final String libraryVersion) { final StringBuilder sb = new StringBuilder(); if (StringUtils.isNotBlank(localePrefix)) { sb.append(localePrefix).append(PATH_SEPAR...
[ "private", "String", "createResourceIdentifier", "(", "final", "String", "localePrefix", ",", "final", "String", "resourceName", ",", "final", "String", "resourceVersion", ",", "final", "String", "libraryName", ",", "final", "String", "libraryVersion", ")", "{", "fi...
Creates an ResourceIdentifier according to chapter 2.6.1.3 from the JSF 2.2 specification @param localePrefix locale to use for the resource, optional @param resourceName name of the resource @param resourceVersion resource-version, optional @param libraryName library-name, optional @param libraryVersion li...
[ "Creates", "an", "ResourceIdentifier", "according", "to", "chapter", "2", ".", "6", ".", "1", ".", "3", "from", "the", "JSF", "2", ".", "2", "specification" ]
train
https://github.com/ops4j/org.ops4j.pax.web/blob/9ecf3676c1d316be0d43ea7fcfdc8f0defffc2a2/pax-web-resources/pax-web-resources-jsf/src/main/java/org/ops4j/pax/web/resources/jsf/OsgiResourceHandler.java#L421-L438
google/j2objc
xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/serializer/SerializerBase.java
SerializerBase.getNamespaceURI
public String getNamespaceURI(String qname, boolean isElement) { """ Returns the URI of an element or attribute. Note that default namespaces do not apply directly to attributes. @param qname a qualified name @param isElement true if the qualified name is the name of an element. @return returns the namespace ...
java
public String getNamespaceURI(String qname, boolean isElement) { String uri = EMPTYSTRING; int col = qname.lastIndexOf(':'); final String prefix = (col > 0) ? qname.substring(0, col) : EMPTYSTRING; if (!EMPTYSTRING.equals(prefix) || isElement) { if (m_prefixMap !...
[ "public", "String", "getNamespaceURI", "(", "String", "qname", ",", "boolean", "isElement", ")", "{", "String", "uri", "=", "EMPTYSTRING", ";", "int", "col", "=", "qname", ".", "lastIndexOf", "(", "'", "'", ")", ";", "final", "String", "prefix", "=", "("...
Returns the URI of an element or attribute. Note that default namespaces do not apply directly to attributes. @param qname a qualified name @param isElement true if the qualified name is the name of an element. @return returns the namespace URI associated with the qualified name.
[ "Returns", "the", "URI", "of", "an", "element", "or", "attribute", ".", "Note", "that", "default", "namespaces", "do", "not", "apply", "directly", "to", "attributes", "." ]
train
https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/serializer/SerializerBase.java#L856-L877
jbundle/jbundle
base/base/src/main/java/org/jbundle/base/util/BaseApplication.java
BaseApplication.getResourceClassName
public String getResourceClassName(String strBasePackage, String resourceName) { """ Given a class name in the program package, get this resource's class name in the res package. @param strBasePackage A class name in the same program directory as the res class. @param resourceName The base resource class name. ...
java
public String getResourceClassName(String strBasePackage, String resourceName) { if (resourceName == null) resourceName = strBasePackage.substring(strBasePackage.lastIndexOf('.') + 1); strBasePackage = strBasePackage.substring(0, strBasePackage.lastIndexOf('.') + 1); resourceName = Uti...
[ "public", "String", "getResourceClassName", "(", "String", "strBasePackage", ",", "String", "resourceName", ")", "{", "if", "(", "resourceName", "==", "null", ")", "resourceName", "=", "strBasePackage", ".", "substring", "(", "strBasePackage", ".", "lastIndexOf", ...
Given a class name in the program package, get this resource's class name in the res package. @param strBasePackage A class name in the same program directory as the res class. @param resourceName The base resource class name. @return The full resource class name.
[ "Given", "a", "class", "name", "in", "the", "program", "package", "get", "this", "resource", "s", "class", "name", "in", "the", "res", "package", "." ]
train
https://github.com/jbundle/jbundle/blob/4037fcfa85f60c7d0096c453c1a3cd573c2b0abc/base/base/src/main/java/org/jbundle/base/util/BaseApplication.java#L153-L161
phax/ph-css
ph-css/src/main/java/com/helger/css/utils/CSSColorHelper.java
CSSColorHelper.getHSLColorValue
@Nonnull @Nonempty public static String getHSLColorValue (final int nHue, final int nSaturation, final int nLightness) { """ Get the passed values as CSS HSL color value @param nHue Hue - is scaled to 0-359 @param nSaturation Saturation - is scaled to 0-100 @param nLightness Lightness - is scaled to 0-...
java
@Nonnull @Nonempty public static String getHSLColorValue (final int nHue, final int nSaturation, final int nLightness) { return new StringBuilder (18).append (CCSSValue.PREFIX_HSL_OPEN) .append (getHSLHueValue (nHue)) .append (',') ...
[ "@", "Nonnull", "@", "Nonempty", "public", "static", "String", "getHSLColorValue", "(", "final", "int", "nHue", ",", "final", "int", "nSaturation", ",", "final", "int", "nLightness", ")", "{", "return", "new", "StringBuilder", "(", "18", ")", ".", "append", ...
Get the passed values as CSS HSL color value @param nHue Hue - is scaled to 0-359 @param nSaturation Saturation - is scaled to 0-100 @param nLightness Lightness - is scaled to 0-100 @return The CSS string to use
[ "Get", "the", "passed", "values", "as", "CSS", "HSL", "color", "value" ]
train
https://github.com/phax/ph-css/blob/c9da5bb4decc681de6e27ce31712aad4c00adafa/ph-css/src/main/java/com/helger/css/utils/CSSColorHelper.java#L477-L490
alkacon/opencms-core
src/org/opencms/db/CmsAliasManager.java
CmsAliasManager.messageImportInvalidAliasPath
private String messageImportInvalidAliasPath(Locale locale, String path) { """ Message accessor.<p> @param locale the message locale @param path a path @return the message string """ return Messages.get().getBundle(locale).key(Messages.ERR_ALIAS_IMPORT_INVALID_ALIAS_PATH_0); }
java
private String messageImportInvalidAliasPath(Locale locale, String path) { return Messages.get().getBundle(locale).key(Messages.ERR_ALIAS_IMPORT_INVALID_ALIAS_PATH_0); }
[ "private", "String", "messageImportInvalidAliasPath", "(", "Locale", "locale", ",", "String", "path", ")", "{", "return", "Messages", ".", "get", "(", ")", ".", "getBundle", "(", "locale", ")", ".", "key", "(", "Messages", ".", "ERR_ALIAS_IMPORT_INVALID_ALIAS_PA...
Message accessor.<p> @param locale the message locale @param path a path @return the message string
[ "Message", "accessor", ".", "<p", ">" ]
train
https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/db/CmsAliasManager.java#L545-L549
davidmoten/rxjava-jdbc
src/main/java/com/github/davidmoten/rx/jdbc/Util.java
Util.autoMap
@SuppressWarnings("unchecked") static <T> T autoMap(ResultSet rs, Class<T> cls) { """ Converts the ResultSet column values into parameters to the constructor (with number of parameters equals the number of columns) of type <code>T</code> then returns an instance of type <code>T</code>. See See {@link Builde...
java
@SuppressWarnings("unchecked") static <T> T autoMap(ResultSet rs, Class<T> cls) { try { if (cls.isInterface()) { return autoMapInterface(rs, cls); } else { int n = rs.getMetaData().getColumnCount(); for (Constructor<?> c : cls.getDeclar...
[ "@", "SuppressWarnings", "(", "\"unchecked\"", ")", "static", "<", "T", ">", "T", "autoMap", "(", "ResultSet", "rs", ",", "Class", "<", "T", ">", "cls", ")", "{", "try", "{", "if", "(", "cls", ".", "isInterface", "(", ")", ")", "{", "return", "auto...
Converts the ResultSet column values into parameters to the constructor (with number of parameters equals the number of columns) of type <code>T</code> then returns an instance of type <code>T</code>. See See {@link Builder#autoMap(Class)}. @param cls the class of the resultant instance @return an automapped instance
[ "Converts", "the", "ResultSet", "column", "values", "into", "parameters", "to", "the", "constructor", "(", "with", "number", "of", "parameters", "equals", "the", "number", "of", "columns", ")", "of", "type", "<code", ">", "T<", "/", "code", ">", "then", "r...
train
https://github.com/davidmoten/rxjava-jdbc/blob/81e157d7071a825086bde81107b8694684cdff14/src/main/java/com/github/davidmoten/rx/jdbc/Util.java#L275-L293
hazelcast/hazelcast
hazelcast-client/src/main/java/com/hazelcast/client/spi/impl/ClientPartitionServiceImpl.java
ClientPartitionServiceImpl.processPartitionResponse
private void processPartitionResponse(Connection connection, Collection<Map.Entry<Address, List<Integer>>> partitions, int partitionStateVersion, boolean partitionStateVersionExist) { """ The partitions can be empty on the response...
java
private void processPartitionResponse(Connection connection, Collection<Map.Entry<Address, List<Integer>>> partitions, int partitionStateVersion, boolean partitionStateVersionExist) { while (true) { PartitionTable c...
[ "private", "void", "processPartitionResponse", "(", "Connection", "connection", ",", "Collection", "<", "Map", ".", "Entry", "<", "Address", ",", "List", "<", "Integer", ">", ">", ">", "partitions", ",", "int", "partitionStateVersion", ",", "boolean", "partition...
The partitions can be empty on the response, client will not apply the empty partition table, see {@link ClientPartitionListenerService#getPartitions(PartitionTableView)}
[ "The", "partitions", "can", "be", "empty", "on", "the", "response", "client", "will", "not", "apply", "the", "empty", "partition", "table", "see", "{" ]
train
https://github.com/hazelcast/hazelcast/blob/8c4bc10515dbbfb41a33e0302c0caedf3cda1baf/hazelcast-client/src/main/java/com/hazelcast/client/spi/impl/ClientPartitionServiceImpl.java#L171-L197
finmath/finmath-lib
src/main/java6/net/finmath/marketdata/model/curves/ForwardCurve.java
ForwardCurve.createForwardCurveFromForwards
public static ForwardCurve createForwardCurveFromForwards(String name, LocalDate referenceDate, String paymentOffsetCode, String interpolationEntityForward, String discountCurveName, AnalyticModelInterface model, double[] times, double[] givenForwards) { """ Create a forward curve from given times and given forwar...
java
public static ForwardCurve createForwardCurveFromForwards(String name, LocalDate referenceDate, String paymentOffsetCode, String interpolationEntityForward, String discountCurveName, AnalyticModelInterface model, double[] times, double[] givenForwards) { return createForwardCurveFromForwards(name, referenceDate, paym...
[ "public", "static", "ForwardCurve", "createForwardCurveFromForwards", "(", "String", "name", ",", "LocalDate", "referenceDate", ",", "String", "paymentOffsetCode", ",", "String", "interpolationEntityForward", ",", "String", "discountCurveName", ",", "AnalyticModelInterface", ...
Create a forward curve from given times and given forwards. @param name The name of this curve. @param referenceDate The reference date for this code, i.e., the date which defines t=0. @param paymentOffsetCode The maturity of the index modeled by this curve. @param interpolationEntityForward Interpolation entity used ...
[ "Create", "a", "forward", "curve", "from", "given", "times", "and", "given", "forwards", "." ]
train
https://github.com/finmath/finmath-lib/blob/a3c067d52dd33feb97d851df6cab130e4116759f/src/main/java6/net/finmath/marketdata/model/curves/ForwardCurve.java#L191-L193
deeplearning4j/deeplearning4j
nd4j/nd4j-backends/nd4j-api-parent/nd4j-api/src/main/java/org/nd4j/autodiff/samediff/transform/SubGraphPredicate.java
SubGraphPredicate.getSubGraph
public SubGraph getSubGraph(SameDiff sd, DifferentialFunction rootFn) { """ Get the SubGraph that matches the predicate @param sd SameDiff instance the function belongs to @param rootFn Function that defines the root of the subgraph @return The subgraph that matches the predicate """ Preconditio...
java
public SubGraph getSubGraph(SameDiff sd, DifferentialFunction rootFn){ Preconditions.checkState(matches(sd, rootFn), "Root function does not match predicate"); List<DifferentialFunction> childNodes = new ArrayList<>(); //Need to work out child nodes if(!opInputSubgraphPredicates.isEmpty...
[ "public", "SubGraph", "getSubGraph", "(", "SameDiff", "sd", ",", "DifferentialFunction", "rootFn", ")", "{", "Preconditions", ".", "checkState", "(", "matches", "(", "sd", ",", "rootFn", ")", ",", "\"Root function does not match predicate\"", ")", ";", "List", "<"...
Get the SubGraph that matches the predicate @param sd SameDiff instance the function belongs to @param rootFn Function that defines the root of the subgraph @return The subgraph that matches the predicate
[ "Get", "the", "SubGraph", "that", "matches", "the", "predicate" ]
train
https://github.com/deeplearning4j/deeplearning4j/blob/effce52f2afd7eeb53c5bcca699fcd90bd06822f/nd4j/nd4j-backends/nd4j-api-parent/nd4j-api/src/main/java/org/nd4j/autodiff/samediff/transform/SubGraphPredicate.java#L97-L125
igniterealtime/Smack
smack-extensions/src/main/java/org/jivesoftware/smackx/pubsub/util/NodeUtils.java
NodeUtils.getFormFromPacket
public static ConfigureForm getFormFromPacket(Stanza packet, PubSubElementType elem) { """ Get a {@link ConfigureForm} from a packet. @param packet @param elem @return The configuration form """ FormNode config = packet.getExtension(elem.getElementName(), elem.getNamespace().getXmlns()); F...
java
public static ConfigureForm getFormFromPacket(Stanza packet, PubSubElementType elem) { FormNode config = packet.getExtension(elem.getElementName(), elem.getNamespace().getXmlns()); Form formReply = config.getForm(); return new ConfigureForm(formReply); }
[ "public", "static", "ConfigureForm", "getFormFromPacket", "(", "Stanza", "packet", ",", "PubSubElementType", "elem", ")", "{", "FormNode", "config", "=", "packet", ".", "getExtension", "(", "elem", ".", "getElementName", "(", ")", ",", "elem", ".", "getNamespace...
Get a {@link ConfigureForm} from a packet. @param packet @param elem @return The configuration form
[ "Get", "a", "{", "@link", "ConfigureForm", "}", "from", "a", "packet", "." ]
train
https://github.com/igniterealtime/Smack/blob/870756997faec1e1bfabfac0cd6c2395b04da873/smack-extensions/src/main/java/org/jivesoftware/smackx/pubsub/util/NodeUtils.java#L39-L43
ManfredTremmel/gwt-commons-lang3
src/main/java/org/apache/commons/lang3/reflect/FieldUtils.java
FieldUtils.writeStaticField
public static void writeStaticField(final Field field, final Object value, final boolean forceAccess) throws IllegalAccessException { """ Writes a static {@link Field}. @param field to write @param value to set @param forceAccess whether to break scope restrictions using the {@link java.lang.reflect.Acces...
java
public static void writeStaticField(final Field field, final Object value, final boolean forceAccess) throws IllegalAccessException { Validate.isTrue(field != null, "The field must not be null"); Validate.isTrue(Modifier.isStatic(field.getModifiers()), "The field %s.%s is not static", field.getDeclaring...
[ "public", "static", "void", "writeStaticField", "(", "final", "Field", "field", ",", "final", "Object", "value", ",", "final", "boolean", "forceAccess", ")", "throws", "IllegalAccessException", "{", "Validate", ".", "isTrue", "(", "field", "!=", "null", ",", "...
Writes a static {@link Field}. @param field to write @param value to set @param forceAccess whether to break scope restrictions using the {@link java.lang.reflect.AccessibleObject#setAccessible(boolean)} method. {@code false} will only match {@code public} fields. @throws IllegalArgumentException if the field is {@cod...
[ "Writes", "a", "static", "{", "@link", "Field", "}", "." ]
train
https://github.com/ManfredTremmel/gwt-commons-lang3/blob/9e2dfbbda3668cfa5d935fe76479d1426c294504/src/main/java/org/apache/commons/lang3/reflect/FieldUtils.java#L550-L555
geomajas/geomajas-project-client-gwt
client/src/main/java/org/geomajas/gwt/client/widget/attribute/DefaultFeatureForm.java
DefaultFeatureForm.getValue
@Api public void getValue(String name, FloatAttribute attribute) { """ Get a float value from the form, and place it in <code>attribute</code>. @param name attribute name @param attribute attribute to put value @since 1.11.1 """ attribute.setValue(toFloat(formWidget.getValue(name))); }
java
@Api public void getValue(String name, FloatAttribute attribute) { attribute.setValue(toFloat(formWidget.getValue(name))); }
[ "@", "Api", "public", "void", "getValue", "(", "String", "name", ",", "FloatAttribute", "attribute", ")", "{", "attribute", ".", "setValue", "(", "toFloat", "(", "formWidget", ".", "getValue", "(", "name", ")", ")", ")", ";", "}" ]
Get a float value from the form, and place it in <code>attribute</code>. @param name attribute name @param attribute attribute to put value @since 1.11.1
[ "Get", "a", "float", "value", "from", "the", "form", "and", "place", "it", "in", "<code", ">", "attribute<", "/", "code", ">", "." ]
train
https://github.com/geomajas/geomajas-project-client-gwt/blob/1c1adc48deb192ed825265eebcc74d70bbf45670/client/src/main/java/org/geomajas/gwt/client/widget/attribute/DefaultFeatureForm.java#L694-L697
OpenLiberty/open-liberty
dev/com.ibm.ws.jdbc/src/com/ibm/ws/jdbc/internal/JDBCDrivers.java
JDBCDrivers.contains
private static final boolean contains(Collection<String> list, String value) { """ Utility method that determines if some text is found as a substring within the contents of a list. @param list items through which to search. @param value text for which to search. @return true if found, otherwise false. ""...
java
private static final boolean contains(Collection<String> list, String value) { for (String item : list) if (item.contains(value)) return true; return false; }
[ "private", "static", "final", "boolean", "contains", "(", "Collection", "<", "String", ">", "list", ",", "String", "value", ")", "{", "for", "(", "String", "item", ":", "list", ")", "if", "(", "item", ".", "contains", "(", "value", ")", ")", "return", ...
Utility method that determines if some text is found as a substring within the contents of a list. @param list items through which to search. @param value text for which to search. @return true if found, otherwise false.
[ "Utility", "method", "that", "determines", "if", "some", "text", "is", "found", "as", "a", "substring", "within", "the", "contents", "of", "a", "list", "." ]
train
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.jdbc/src/com/ibm/ws/jdbc/internal/JDBCDrivers.java#L255-L260
apache/incubator-gobblin
gobblin-utility/src/main/java/org/apache/gobblin/util/WriterUtils.java
WriterUtils.getWriterStagingDir
public static Path getWriterStagingDir(State state, int numBranches, int branchId, String attemptId) { """ Get the staging {@link Path} for {@link org.apache.gobblin.writer.DataWriter} that has attemptId in the path. """ Preconditions.checkArgument(attemptId != null && !attemptId.isEmpty(), "AttemptId cann...
java
public static Path getWriterStagingDir(State state, int numBranches, int branchId, String attemptId) { Preconditions.checkArgument(attemptId != null && !attemptId.isEmpty(), "AttemptId cannot be null or empty: " + attemptId); return new Path(getWriterStagingDir(state, numBranches, branchId), attemptId); }
[ "public", "static", "Path", "getWriterStagingDir", "(", "State", "state", ",", "int", "numBranches", ",", "int", "branchId", ",", "String", "attemptId", ")", "{", "Preconditions", ".", "checkArgument", "(", "attemptId", "!=", "null", "&&", "!", "attemptId", "....
Get the staging {@link Path} for {@link org.apache.gobblin.writer.DataWriter} that has attemptId in the path.
[ "Get", "the", "staging", "{" ]
train
https://github.com/apache/incubator-gobblin/blob/f029b4c0fea0fe4aa62f36dda2512344ff708bae/gobblin-utility/src/main/java/org/apache/gobblin/util/WriterUtils.java#L97-L100
Deep-Symmetry/beat-link
src/main/java/org/deepsymmetry/beatlink/data/WaveformDetail.java
WaveformDetail.getColorWaveformBits
private int getColorWaveformBits(final ByteBuffer waveBytes, final int segment) { """ Color waveforms are represented by a series of sixteen bit integers into which color and height information are packed. This function returns the integer corresponding to a particular half-frame in the waveform. @param waveBy...
java
private int getColorWaveformBits(final ByteBuffer waveBytes, final int segment) { final int base = (segment * 2); final int big = Util.unsign(waveBytes.get(base)); final int small = Util.unsign(waveBytes.get(base + 1)); return big * 256 + small; }
[ "private", "int", "getColorWaveformBits", "(", "final", "ByteBuffer", "waveBytes", ",", "final", "int", "segment", ")", "{", "final", "int", "base", "=", "(", "segment", "*", "2", ")", ";", "final", "int", "big", "=", "Util", ".", "unsign", "(", "waveByt...
Color waveforms are represented by a series of sixteen bit integers into which color and height information are packed. This function returns the integer corresponding to a particular half-frame in the waveform. @param waveBytes the raw data making up the waveform @param segment the index of hte half-frame of interest...
[ "Color", "waveforms", "are", "represented", "by", "a", "series", "of", "sixteen", "bit", "integers", "into", "which", "color", "and", "height", "information", "are", "packed", ".", "This", "function", "returns", "the", "integer", "corresponding", "to", "a", "p...
train
https://github.com/Deep-Symmetry/beat-link/blob/f958a2a70e8a87a31a75326d7b4db77c2f0b4212/src/main/java/org/deepsymmetry/beatlink/data/WaveformDetail.java#L208-L213
Erudika/para
para-client/src/main/java/com/erudika/para/client/ParaClient.java
ParaClient.formatDate
public String formatDate(String format, Locale loc) { """ Formats a date in a specific format. @param format the date format @param loc the locale instance @return a formatted date """ MultivaluedMap<String, String> params = new MultivaluedHashMap<>(); params.putSingle("format", format); params.putSin...
java
public String formatDate(String format, Locale loc) { MultivaluedMap<String, String> params = new MultivaluedHashMap<>(); params.putSingle("format", format); params.putSingle("locale", loc == null ? null : loc.toString()); return getEntity(invokeGet("utils/formatdate", params), String.class); }
[ "public", "String", "formatDate", "(", "String", "format", ",", "Locale", "loc", ")", "{", "MultivaluedMap", "<", "String", ",", "String", ">", "params", "=", "new", "MultivaluedHashMap", "<>", "(", ")", ";", "params", ".", "putSingle", "(", "\"format\"", ...
Formats a date in a specific format. @param format the date format @param loc the locale instance @return a formatted date
[ "Formats", "a", "date", "in", "a", "specific", "format", "." ]
train
https://github.com/Erudika/para/blob/5ba096c477042ea7b18e9a0e8b5b1ee0f5bd6ce9/para-client/src/main/java/com/erudika/para/client/ParaClient.java#L1196-L1201
projectodd/stilts
stomp-server-core/src/main/java/org/projectodd/stilts/stomp/server/protocol/websockets/ServerHandshakeHandler.java
ServerHandshakeHandler.handleHttpRequest
protected void handleHttpRequest(final ChannelHandlerContext channelContext, final HttpRequest request) throws Exception { """ Handle initial HTTP portion of the handshake. @param channelContext @param request @throws Exception """ if (isWebSocketsUpgradeRequest( request )) { final Ha...
java
protected void handleHttpRequest(final ChannelHandlerContext channelContext, final HttpRequest request) throws Exception { if (isWebSocketsUpgradeRequest( request )) { final Handshake handshake = findHandshake( request ); if (handshake != null) { HttpResponse response ...
[ "protected", "void", "handleHttpRequest", "(", "final", "ChannelHandlerContext", "channelContext", ",", "final", "HttpRequest", "request", ")", "throws", "Exception", "{", "if", "(", "isWebSocketsUpgradeRequest", "(", "request", ")", ")", "{", "final", "Handshake", ...
Handle initial HTTP portion of the handshake. @param channelContext @param request @throws Exception
[ "Handle", "initial", "HTTP", "portion", "of", "the", "handshake", "." ]
train
https://github.com/projectodd/stilts/blob/6ba81d4162325b98f591c206520476cf575d0567/stomp-server-core/src/main/java/org/projectodd/stilts/stomp/server/protocol/websockets/ServerHandshakeHandler.java#L101-L134
meertensinstituut/mtas
src/main/java/mtas/search/spans/util/MtasIgnoreItem.java
MtasIgnoreItem.removeBefore
public void removeBefore(int docId, int position) { """ Removes the before. @param docId the doc id @param position the position """ if (ignoreSpans != null && docId == currentDocId) { baseStartPositionList.entrySet() .removeIf(entry -> entry.getKey() < position); baseEndPositionL...
java
public void removeBefore(int docId, int position) { if (ignoreSpans != null && docId == currentDocId) { baseStartPositionList.entrySet() .removeIf(entry -> entry.getKey() < position); baseEndPositionList.entrySet() .removeIf(entry -> entry.getKey() < position); fullEndPositionL...
[ "public", "void", "removeBefore", "(", "int", "docId", ",", "int", "position", ")", "{", "if", "(", "ignoreSpans", "!=", "null", "&&", "docId", "==", "currentDocId", ")", "{", "baseStartPositionList", ".", "entrySet", "(", ")", ".", "removeIf", "(", "entry...
Removes the before. @param docId the doc id @param position the position
[ "Removes", "the", "before", "." ]
train
https://github.com/meertensinstituut/mtas/blob/f02ae730848616bd88b553efa7f9eddc32818e64/src/main/java/mtas/search/spans/util/MtasIgnoreItem.java#L321-L344
davetcc/tcMenu
tcMenuCodePluginApi/src/main/java/com/thecoderscorner/menu/pluginapi/PluginFileDependency.java
PluginFileDependency.fileInTcMenu
public static PluginFileDependency fileInTcMenu(String file) { """ Creates an instance of the class that indicates the file is within tcMenu itself. Don't use for new plugins, prefer to package arduino code in the plugin or a new library. @param file the file name @return a new instance """ return...
java
public static PluginFileDependency fileInTcMenu(String file) { return new PluginFileDependency(file, PackagingType.WITHIN_TCMENU, Map.of()); }
[ "public", "static", "PluginFileDependency", "fileInTcMenu", "(", "String", "file", ")", "{", "return", "new", "PluginFileDependency", "(", "file", ",", "PackagingType", ".", "WITHIN_TCMENU", ",", "Map", ".", "of", "(", ")", ")", ";", "}" ]
Creates an instance of the class that indicates the file is within tcMenu itself. Don't use for new plugins, prefer to package arduino code in the plugin or a new library. @param file the file name @return a new instance
[ "Creates", "an", "instance", "of", "the", "class", "that", "indicates", "the", "file", "is", "within", "tcMenu", "itself", ".", "Don", "t", "use", "for", "new", "plugins", "prefer", "to", "package", "arduino", "code", "in", "the", "plugin", "or", "a", "n...
train
https://github.com/davetcc/tcMenu/blob/61546e4b982b25ceaff384073fe9ec1fff55e64a/tcMenuCodePluginApi/src/main/java/com/thecoderscorner/menu/pluginapi/PluginFileDependency.java#L89-L91
ngageoint/geopackage-android-map
geopackage-map/src/main/java/mil/nga/geopackage/map/features/StyleUtils.java
StyleUtils.setFeatureStyle
public static boolean setFeatureStyle(PolylineOptions polylineOptions, GeoPackage geoPackage, FeatureRow featureRow, float density) { """ Set the feature row style into the polyline options @param polylineOptions polyline options @param geoPackage GeoPackage @param featureRow feature row @param den...
java
public static boolean setFeatureStyle(PolylineOptions polylineOptions, GeoPackage geoPackage, FeatureRow featureRow, float density) { FeatureStyleExtension featureStyleExtension = new FeatureStyleExtension(geoPackage); return setFeatureStyle(polylineOptions, featureStyleExtension, featureRow, density)...
[ "public", "static", "boolean", "setFeatureStyle", "(", "PolylineOptions", "polylineOptions", ",", "GeoPackage", "geoPackage", ",", "FeatureRow", "featureRow", ",", "float", "density", ")", "{", "FeatureStyleExtension", "featureStyleExtension", "=", "new", "FeatureStyleExt...
Set the feature row style into the polyline options @param polylineOptions polyline options @param geoPackage GeoPackage @param featureRow feature row @param density display density: {@link android.util.DisplayMetrics#density} @return true if style was set into the polyline options
[ "Set", "the", "feature", "row", "style", "into", "the", "polyline", "options" ]
train
https://github.com/ngageoint/geopackage-android-map/blob/634d78468a5c52d2bc98791cc7ff03981ebf573b/geopackage-map/src/main/java/mil/nga/geopackage/map/features/StyleUtils.java#L367-L372
apereo/cas
core/cas-server-core-web-api/src/main/java/org/apereo/cas/web/support/WebUtils.java
WebUtils.getServiceUserInterfaceMetadata
public static <T> T getServiceUserInterfaceMetadata(final RequestContext requestContext, final Class<T> clz) { """ Gets service user interface metadata. @param <T> the type parameter @param requestContext the request context @param clz the clz @return the service user interface metadata...
java
public static <T> T getServiceUserInterfaceMetadata(final RequestContext requestContext, final Class<T> clz) { if (requestContext.getFlowScope().contains(PARAMETER_SERVICE_UI_METADATA)) { return requestContext.getFlowScope().get(PARAMETER_SERVICE_UI_METADATA, clz); } return null; ...
[ "public", "static", "<", "T", ">", "T", "getServiceUserInterfaceMetadata", "(", "final", "RequestContext", "requestContext", ",", "final", "Class", "<", "T", ">", "clz", ")", "{", "if", "(", "requestContext", ".", "getFlowScope", "(", ")", ".", "contains", "...
Gets service user interface metadata. @param <T> the type parameter @param requestContext the request context @param clz the clz @return the service user interface metadata
[ "Gets", "service", "user", "interface", "metadata", "." ]
train
https://github.com/apereo/cas/blob/b4b306433a8782cef803a39bea5b1f96740e0e9b/core/cas-server-core-web-api/src/main/java/org/apereo/cas/web/support/WebUtils.java#L739-L744
pebble/pebble-android-sdk
PebbleKit/PebbleKit/src/main/java/com/getpebble/android/kit/PebbleKit.java
PebbleKit.sendAckToPebble
public static void sendAckToPebble(final Context context, final int transactionId) throws IllegalArgumentException { """ Send a message to the connected watch acknowledging the receipt of a PebbleDictionary. To avoid protocol timeouts on the watch, applications <em>must</em> ACK or NACK all received m...
java
public static void sendAckToPebble(final Context context, final int transactionId) throws IllegalArgumentException { if ((transactionId & ~0xff) != 0) { throw new IllegalArgumentException(String.format( "transaction id must be between (0, 255); got '%d'", transaction...
[ "public", "static", "void", "sendAckToPebble", "(", "final", "Context", "context", ",", "final", "int", "transactionId", ")", "throws", "IllegalArgumentException", "{", "if", "(", "(", "transactionId", "&", "~", "0xff", ")", "!=", "0", ")", "{", "throw", "ne...
Send a message to the connected watch acknowledging the receipt of a PebbleDictionary. To avoid protocol timeouts on the watch, applications <em>must</em> ACK or NACK all received messages. @param context The context used to send the broadcast. @param transactionId The transaction id of the message in which the data w...
[ "Send", "a", "message", "to", "the", "connected", "watch", "acknowledging", "the", "receipt", "of", "a", "PebbleDictionary", ".", "To", "avoid", "protocol", "timeouts", "on", "the", "watch", "applications", "<em", ">", "must<", "/", "em", ">", "ACK", "or", ...
train
https://github.com/pebble/pebble-android-sdk/blob/ddfc53ecf3950deebb62a1f205aa21fbe9bce45d/PebbleKit/PebbleKit/src/main/java/com/getpebble/android/kit/PebbleKit.java#L331-L342
liyiorg/weixin-popular
src/main/java/weixin/popular/util/WxaUtil.java
WxaUtil.decryptUserInfo
public static WxaDUserInfo decryptUserInfo(String session_key, String encryptedData, String iv) { """ 解密用户数据 @param session_key session key @param encryptedData 包括敏感数据在内的完整用户信息的加密数据,详细见<a href= "https://mp.weixin.qq.com/debug/wxadoc/dev/api/signature.html"> 加密数据解密算法</a> @param iv 加密算法的初始向量 @return WxaDU...
java
public static WxaDUserInfo decryptUserInfo(String session_key, String encryptedData, String iv) { try { Cipher cipher = Cipher.getInstance("AES/CBC/NoPadding"); Key sKeySpec = new SecretKeySpec(Base64.decodeBase64(session_key), "AES"); cipher.init(Cipher.DECRYPT_MODE, sKeySpec, new IvParameterSpec(Base64...
[ "public", "static", "WxaDUserInfo", "decryptUserInfo", "(", "String", "session_key", ",", "String", "encryptedData", ",", "String", "iv", ")", "{", "try", "{", "Cipher", "cipher", "=", "Cipher", ".", "getInstance", "(", "\"AES/CBC/NoPadding\"", ")", ";", "Key", ...
解密用户数据 @param session_key session key @param encryptedData 包括敏感数据在内的完整用户信息的加密数据,详细见<a href= "https://mp.weixin.qq.com/debug/wxadoc/dev/api/signature.html"> 加密数据解密算法</a> @param iv 加密算法的初始向量 @return WxaDUserInfo 解密失败 返回null
[ "解密用户数据" ]
train
https://github.com/liyiorg/weixin-popular/blob/c64255292d41463bdb671938feaabf42a335d82c/src/main/java/weixin/popular/util/WxaUtil.java#L42-L54
geomajas/geomajas-project-server
plugin/layer-geotools/geotools/src/main/java/org/geomajas/layer/shapeinmem/FeatureSourceRetriever.java
FeatureSourceRetriever.setAttributes
public void setAttributes(Object feature, Map<String, Attribute> attributes) throws LayerException { """ Set the attributes of a feature. @param feature the feature @param attributes the attributes @throws LayerException oops """ for (Map.Entry<String, Attribute> entry : attributes.entrySet()) { Stri...
java
public void setAttributes(Object feature, Map<String, Attribute> attributes) throws LayerException { for (Map.Entry<String, Attribute> entry : attributes.entrySet()) { String name = entry.getKey(); if (!name.equals(getGeometryAttributeName())) { asFeature(feature).setAttribute(name, entry.getValue()); } ...
[ "public", "void", "setAttributes", "(", "Object", "feature", ",", "Map", "<", "String", ",", "Attribute", ">", "attributes", ")", "throws", "LayerException", "{", "for", "(", "Map", ".", "Entry", "<", "String", ",", "Attribute", ">", "entry", ":", "attribu...
Set the attributes of a feature. @param feature the feature @param attributes the attributes @throws LayerException oops
[ "Set", "the", "attributes", "of", "a", "feature", "." ]
train
https://github.com/geomajas/geomajas-project-server/blob/904b7d7deed1350d28955589098dd1e0a786d76e/plugin/layer-geotools/geotools/src/main/java/org/geomajas/layer/shapeinmem/FeatureSourceRetriever.java#L155-L162
b3dgs/lionengine
lionengine-game/src/main/java/com/b3dgs/lionengine/game/Force.java
Force.fromVector
public static Force fromVector(double ox, double oy, double x, double y) { """ Create a force from a vector movement. <p> The created force will describe the following values: </p> <ul> <li>horizontal normalized speed ({@link #getDirectionHorizontal()}),</li> <li>vertical normalized speed ({@link #getDirec...
java
public static Force fromVector(double ox, double oy, double x, double y) { // Distance calculation final double dh = x - ox; final double dv = y - oy; // Search vector and number of search steps final double norm; if (dh > dv) { norm = Math.abs(dh...
[ "public", "static", "Force", "fromVector", "(", "double", "ox", ",", "double", "oy", ",", "double", "x", ",", "double", "y", ")", "{", "// Distance calculation", "final", "double", "dh", "=", "x", "-", "ox", ";", "final", "double", "dv", "=", "y", "-",...
Create a force from a vector movement. <p> The created force will describe the following values: </p> <ul> <li>horizontal normalized speed ({@link #getDirectionHorizontal()}),</li> <li>vertical normalized speed ({@link #getDirectionVertical()}),</li> <li>normal value ({@link #getVelocity()}).</li> </ul> @param ox The...
[ "Create", "a", "force", "from", "a", "vector", "movement", "." ]
train
https://github.com/b3dgs/lionengine/blob/cac3d5578532cf11724a737b9f09e71bf9995ab2/lionengine-game/src/main/java/com/b3dgs/lionengine/game/Force.java#L50-L83
googleapis/google-cloud-java
google-cloud-clients/google-cloud-container/src/main/java/com/google/cloud/container/v1/ClusterManagerClient.java
ClusterManagerClient.getCluster
public final Cluster getCluster(String projectId, String zone, String clusterId) { """ Gets the details of a specific cluster. <p>Sample code: <pre><code> try (ClusterManagerClient clusterManagerClient = ClusterManagerClient.create()) { String projectId = ""; String zone = ""; String clusterId = ""; Clu...
java
public final Cluster getCluster(String projectId, String zone, String clusterId) { GetClusterRequest request = GetClusterRequest.newBuilder() .setProjectId(projectId) .setZone(zone) .setClusterId(clusterId) .build(); return getCluster(request); }
[ "public", "final", "Cluster", "getCluster", "(", "String", "projectId", ",", "String", "zone", ",", "String", "clusterId", ")", "{", "GetClusterRequest", "request", "=", "GetClusterRequest", ".", "newBuilder", "(", ")", ".", "setProjectId", "(", "projectId", ")"...
Gets the details of a specific cluster. <p>Sample code: <pre><code> try (ClusterManagerClient clusterManagerClient = ClusterManagerClient.create()) { String projectId = ""; String zone = ""; String clusterId = ""; Cluster response = clusterManagerClient.getCluster(projectId, zone, clusterId); } </code></pre> @param ...
[ "Gets", "the", "details", "of", "a", "specific", "cluster", "." ]
train
https://github.com/googleapis/google-cloud-java/blob/d2f0bc64a53049040fe9c9d338b12fab3dd1ad6a/google-cloud-clients/google-cloud-container/src/main/java/com/google/cloud/container/v1/ClusterManagerClient.java#L294-L303
Stratio/cassandra-lucene-index
plugin/src/main/java/com/stratio/cassandra/lucene/schema/mapping/SingleColumnMapper.java
SingleColumnMapper.base
public final T base(String field, Object value) { """ Returns the {@link Column} query value resulting from the mapping of the specified object. @param field the field name @param value the object to be mapped, never is {@code null} @return the {@link Column} index value resulting from the mapping of the spec...
java
public final T base(String field, Object value) { return value == null ? null : doBase(field, value); }
[ "public", "final", "T", "base", "(", "String", "field", ",", "Object", "value", ")", "{", "return", "value", "==", "null", "?", "null", ":", "doBase", "(", "field", ",", "value", ")", ";", "}" ]
Returns the {@link Column} query value resulting from the mapping of the specified object. @param field the field name @param value the object to be mapped, never is {@code null} @return the {@link Column} index value resulting from the mapping of the specified object
[ "Returns", "the", "{", "@link", "Column", "}", "query", "value", "resulting", "from", "the", "mapping", "of", "the", "specified", "object", "." ]
train
https://github.com/Stratio/cassandra-lucene-index/blob/a94a4d9af6c25d40e1108729974c35c27c54441c/plugin/src/main/java/com/stratio/cassandra/lucene/schema/mapping/SingleColumnMapper.java#L146-L148
mapsforge/mapsforge
mapsforge-map-reader/src/main/java/org/mapsforge/map/reader/MapFile.java
MapFile.readMapData
@Override public MapReadResult readMapData(Tile upperLeft, Tile lowerRight) { """ Reads data for an area defined by the tile in the upper left and the tile in the lower right corner. Precondition: upperLeft.tileX <= lowerRight.tileX && upperLeft.tileY <= lowerRight.tileY @param upperLeft tile that define...
java
@Override public MapReadResult readMapData(Tile upperLeft, Tile lowerRight) { return readMapData(upperLeft, lowerRight, Selector.ALL); }
[ "@", "Override", "public", "MapReadResult", "readMapData", "(", "Tile", "upperLeft", ",", "Tile", "lowerRight", ")", "{", "return", "readMapData", "(", "upperLeft", ",", "lowerRight", ",", "Selector", ".", "ALL", ")", ";", "}" ]
Reads data for an area defined by the tile in the upper left and the tile in the lower right corner. Precondition: upperLeft.tileX <= lowerRight.tileX && upperLeft.tileY <= lowerRight.tileY @param upperLeft tile that defines the upper left corner of the requested area. @param lowerRight tile that defines the lower ri...
[ "Reads", "data", "for", "an", "area", "defined", "by", "the", "tile", "in", "the", "upper", "left", "and", "the", "tile", "in", "the", "lower", "right", "corner", ".", "Precondition", ":", "upperLeft", ".", "tileX", "<", "=", "lowerRight", ".", "tileX", ...
train
https://github.com/mapsforge/mapsforge/blob/c49c83f7f727552f793dff15cefa532ade030842/mapsforge-map-reader/src/main/java/org/mapsforge/map/reader/MapFile.java#L876-L879
mapbox/mapbox-java
services-core/src/main/java/com/mapbox/core/utils/ApiCallHelper.java
ApiCallHelper.getHeaderUserAgent
public static String getHeaderUserAgent(@Nullable String clientAppName) { """ Computes a full user agent header of the form: {@code MapboxJava/1.2.0 Mac OS X/10.11.5 (x86_64)}. @param clientAppName Application Name @return {@link String} representing the header user agent @since 1.0.0 """ String osNa...
java
public static String getHeaderUserAgent(@Nullable String clientAppName) { String osName = System.getProperty("os.name"); String osVersion = System.getProperty("os.version"); String osArch = System.getProperty("os.arch"); if (TextUtils.isEmpty(osName) || TextUtils.isEmpty(osVersion) || TextUtils.isEmpty...
[ "public", "static", "String", "getHeaderUserAgent", "(", "@", "Nullable", "String", "clientAppName", ")", "{", "String", "osName", "=", "System", ".", "getProperty", "(", "\"os.name\"", ")", ";", "String", "osVersion", "=", "System", ".", "getProperty", "(", "...
Computes a full user agent header of the form: {@code MapboxJava/1.2.0 Mac OS X/10.11.5 (x86_64)}. @param clientAppName Application Name @return {@link String} representing the header user agent @since 1.0.0
[ "Computes", "a", "full", "user", "agent", "header", "of", "the", "form", ":", "{", "@code", "MapboxJava", "/", "1", ".", "2", ".", "0", "Mac", "OS", "X", "/", "10", ".", "11", ".", "5", "(", "x86_64", ")", "}", "." ]
train
https://github.com/mapbox/mapbox-java/blob/c0be138f462f91441388584c668f3760ba0e18e2/services-core/src/main/java/com/mapbox/core/utils/ApiCallHelper.java#L30-L40
cdk/cdk
display/renderbasic/src/main/java/org/openscience/cdk/renderer/generators/BasicAtomGenerator.java
BasicAtomGenerator.generateCompactElement
public IRenderingElement generateCompactElement(IAtom atom, RendererModel model) { """ Generate a compact element for an atom, such as a circle or a square, rather than text element. @param atom the atom to generate the compact element for @param model the renderer model @return a compact rendering element ...
java
public IRenderingElement generateCompactElement(IAtom atom, RendererModel model) { Point2d point = atom.getPoint2d(); double radius = (Double) model.get(AtomRadius.class) / model.getParameter(Scale.class).getValue(); double distance = 2 * radius; if (model.get(CompactShape.class) == Shap...
[ "public", "IRenderingElement", "generateCompactElement", "(", "IAtom", "atom", ",", "RendererModel", "model", ")", "{", "Point2d", "point", "=", "atom", ".", "getPoint2d", "(", ")", ";", "double", "radius", "=", "(", "Double", ")", "model", ".", "get", "(", ...
Generate a compact element for an atom, such as a circle or a square, rather than text element. @param atom the atom to generate the compact element for @param model the renderer model @return a compact rendering element
[ "Generate", "a", "compact", "element", "for", "an", "atom", "such", "as", "a", "circle", "or", "a", "square", "rather", "than", "text", "element", "." ]
train
https://github.com/cdk/cdk/blob/c3d0f16502bf08df50365fee392e11d7c9856657/display/renderbasic/src/main/java/org/openscience/cdk/renderer/generators/BasicAtomGenerator.java#L341-L351
lucee/Lucee
core/src/main/java/lucee/runtime/type/util/ListUtil.java
ListUtil.listToArrayTrim
public static Array listToArrayTrim(String list, char delimiter) { """ casts a list to Array object, remove all empty items at start and end of the list @param list list to cast @param delimiter delimter of the list @return Array Object """ if (list.length() == 0) return new ArrayImpl(); // remove at st...
java
public static Array listToArrayTrim(String list, char delimiter) { if (list.length() == 0) return new ArrayImpl(); // remove at start while (list.indexOf(delimiter) == 0) { list = list.substring(1); } int len = list.length(); if (len == 0) return new ArrayImpl(); while (list.lastIndexOf(delimiter) == len - ...
[ "public", "static", "Array", "listToArrayTrim", "(", "String", "list", ",", "char", "delimiter", ")", "{", "if", "(", "list", ".", "length", "(", ")", "==", "0", ")", "return", "new", "ArrayImpl", "(", ")", ";", "// remove at start", "while", "(", "list"...
casts a list to Array object, remove all empty items at start and end of the list @param list list to cast @param delimiter delimter of the list @return Array Object
[ "casts", "a", "list", "to", "Array", "object", "remove", "all", "empty", "items", "at", "start", "and", "end", "of", "the", "list" ]
train
https://github.com/lucee/Lucee/blob/29b153fc4e126e5edb97da937f2ee2e231b87593/core/src/main/java/lucee/runtime/type/util/ListUtil.java#L486-L499
VoltDB/voltdb
src/frontend/org/voltdb/utils/VoltFile.java
VoltFile.getNewSubroot
public static File getNewSubroot() throws IOException { """ /* Create a "root filesystem" complete with its very own /tmp/${username} to fool a process into thinking it has a private filesystem """ ensureUserRootExists(); File tempFile = File.createTempFile("foo", "", m_root); if (!te...
java
public static File getNewSubroot() throws IOException { ensureUserRootExists(); File tempFile = File.createTempFile("foo", "", m_root); if (!tempFile.delete()) { throw new IOException(); } tempFile = new File(tempFile.getPath() + m_magic); if (!tempFile.mkdir(...
[ "public", "static", "File", "getNewSubroot", "(", ")", "throws", "IOException", "{", "ensureUserRootExists", "(", ")", ";", "File", "tempFile", "=", "File", ".", "createTempFile", "(", "\"foo\"", ",", "\"\"", ",", "m_root", ")", ";", "if", "(", "!", "tempF...
/* Create a "root filesystem" complete with its very own /tmp/${username} to fool a process into thinking it has a private filesystem
[ "/", "*", "Create", "a", "root", "filesystem", "complete", "with", "its", "very", "own", "/", "tmp", "/", "$", "{", "username", "}", "to", "fool", "a", "process", "into", "thinking", "it", "has", "a", "private", "filesystem" ]
train
https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/src/frontend/org/voltdb/utils/VoltFile.java#L96-L115
igniterealtime/Smack
smack-extensions/src/main/java/org/jivesoftware/smackx/ping/PingManager.java
PingManager.pingMyServer
public boolean pingMyServer(boolean notifyListeners, long pingTimeout) throws NotConnectedException, InterruptedException { """ Pings the server. This method will return true if the server is reachable. It is the equivalent of calling <code>ping</code> with the XMPP domain. <p> Unlike the {@link #ping(Jid)} ca...
java
public boolean pingMyServer(boolean notifyListeners, long pingTimeout) throws NotConnectedException, InterruptedException { boolean res; try { res = ping(connection().getXMPPServiceDomain(), pingTimeout); } catch (NoResponseException e) { res = false; } ...
[ "public", "boolean", "pingMyServer", "(", "boolean", "notifyListeners", ",", "long", "pingTimeout", ")", "throws", "NotConnectedException", ",", "InterruptedException", "{", "boolean", "res", ";", "try", "{", "res", "=", "ping", "(", "connection", "(", ")", ".",...
Pings the server. This method will return true if the server is reachable. It is the equivalent of calling <code>ping</code> with the XMPP domain. <p> Unlike the {@link #ping(Jid)} case, this method will return true even if {@link #isPingSupported(Jid)} is false. @param notifyListeners Notify the PingFailedListener i...
[ "Pings", "the", "server", ".", "This", "method", "will", "return", "true", "if", "the", "server", "is", "reachable", ".", "It", "is", "the", "equivalent", "of", "calling", "<code", ">", "ping<", "/", "code", ">", "with", "the", "XMPP", "domain", ".", "...
train
https://github.com/igniterealtime/Smack/blob/870756997faec1e1bfabfac0cd6c2395b04da873/smack-extensions/src/main/java/org/jivesoftware/smackx/ping/PingManager.java#L318-L331
apache/incubator-gobblin
gobblin-utility/src/main/java/org/apache/gobblin/util/AvroUtils.java
AvroUtils.convertRecordSchema
public static GenericRecord convertRecordSchema(GenericRecord record, Schema newSchema) throws IOException { """ Change the schema of an Avro record. @param record The Avro record whose schema is to be changed. @param newSchema The target schema. It must be compatible as reader schema with record.getSchema() as ...
java
public static GenericRecord convertRecordSchema(GenericRecord record, Schema newSchema) throws IOException { if (record.getSchema().equals(newSchema)) { return record; } try { BinaryDecoder decoder = new DecoderFactory().binaryDecoder(recordToByteArray(record), null); DatumReader<GenericR...
[ "public", "static", "GenericRecord", "convertRecordSchema", "(", "GenericRecord", "record", ",", "Schema", "newSchema", ")", "throws", "IOException", "{", "if", "(", "record", ".", "getSchema", "(", ")", ".", "equals", "(", "newSchema", ")", ")", "{", "return"...
Change the schema of an Avro record. @param record The Avro record whose schema is to be changed. @param newSchema The target schema. It must be compatible as reader schema with record.getSchema() as writer schema. @return a new Avro record with the new schema. @throws IOException if conversion failed.
[ "Change", "the", "schema", "of", "an", "Avro", "record", "." ]
train
https://github.com/apache/incubator-gobblin/blob/f029b4c0fea0fe4aa62f36dda2512344ff708bae/gobblin-utility/src/main/java/org/apache/gobblin/util/AvroUtils.java#L372-L387