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
couchbase/couchbase-java-client
src/main/java/com/couchbase/client/java/document/json/JsonObject.java
JsonObject.addValueEncryptionInfo
@InterfaceAudience.Private private void addValueEncryptionInfo(String path, String providerName, boolean escape) { """ Adds to the encryption info with optional escape for json pointer syntax @param path Name of the key @param providerName Value encryption configuration """ if (escape) { ...
java
@InterfaceAudience.Private private void addValueEncryptionInfo(String path, String providerName, boolean escape) { if (escape) { path = path.replaceAll("~", "~0").replaceAll("/", "~1"); } if (this.encryptionPathInfo == null) { this.encryptionPathInfo = new HashMap<Str...
[ "@", "InterfaceAudience", ".", "Private", "private", "void", "addValueEncryptionInfo", "(", "String", "path", ",", "String", "providerName", ",", "boolean", "escape", ")", "{", "if", "(", "escape", ")", "{", "path", "=", "path", ".", "replaceAll", "(", "\"~\...
Adds to the encryption info with optional escape for json pointer syntax @param path Name of the key @param providerName Value encryption configuration
[ "Adds", "to", "the", "encryption", "info", "with", "optional", "escape", "for", "json", "pointer", "syntax" ]
train
https://github.com/couchbase/couchbase-java-client/blob/f36a0ee0c66923bdde47838ca543e50cbaa99e14/src/main/java/com/couchbase/client/java/document/json/JsonObject.java#L1219-L1228
revelytix/spark
spark-http-client/src/main/java/spark/protocol/parser/XMLResultsParser.java
XMLResultsParser.getBase
static private String getBase(String oldBase, XMLStreamReader rdr) { """ Returns the new base URI, based on the old base URI and the xml:base value in the current element. """ String newBase = resolve(oldBase, rdr.getAttributeValue(XML_NS, BASE)); if (newBase != oldBase) { logger.debug("xml:base...
java
static private String getBase(String oldBase, XMLStreamReader rdr) { String newBase = resolve(oldBase, rdr.getAttributeValue(XML_NS, BASE)); if (newBase != oldBase) { logger.debug("xml:base is now {}", newBase); } return newBase; }
[ "static", "private", "String", "getBase", "(", "String", "oldBase", ",", "XMLStreamReader", "rdr", ")", "{", "String", "newBase", "=", "resolve", "(", "oldBase", ",", "rdr", ".", "getAttributeValue", "(", "XML_NS", ",", "BASE", ")", ")", ";", "if", "(", ...
Returns the new base URI, based on the old base URI and the xml:base value in the current element.
[ "Returns", "the", "new", "base", "URI", "based", "on", "the", "old", "base", "URI", "and", "the", "xml", ":", "base", "value", "in", "the", "current", "element", "." ]
train
https://github.com/revelytix/spark/blob/d777d40c962bc66fdc04b7c3a66d20b777ff6fb4/spark-http-client/src/main/java/spark/protocol/parser/XMLResultsParser.java#L222-L228
nohana/Amalgam
amalgam/src/main/java/com/amalgam/os/BundleUtils.java
BundleUtils.optByte
public static byte optByte(@Nullable Bundle bundle, @Nullable String key) { """ Returns a optional byte value. In other words, returns the value mapped by key if it exists and is a byte. The bundle argument is allowed to be {@code null}. If the bundle is null, this method returns (byte) 0. @param bundle a bundle...
java
public static byte optByte(@Nullable Bundle bundle, @Nullable String key) { return optByte(bundle, key, (byte) 0); }
[ "public", "static", "byte", "optByte", "(", "@", "Nullable", "Bundle", "bundle", ",", "@", "Nullable", "String", "key", ")", "{", "return", "optByte", "(", "bundle", ",", "key", ",", "(", "byte", ")", "0", ")", ";", "}" ]
Returns a optional byte value. In other words, returns the value mapped by key if it exists and is a byte. The bundle argument is allowed to be {@code null}. If the bundle is null, this method returns (byte) 0. @param bundle a bundle. If the bundle is null, this method will return a fallback value. @param key a key for...
[ "Returns", "a", "optional", "byte", "value", ".", "In", "other", "words", "returns", "the", "value", "mapped", "by", "key", "if", "it", "exists", "and", "is", "a", "byte", ".", "The", "bundle", "argument", "is", "allowed", "to", "be", "{" ]
train
https://github.com/nohana/Amalgam/blob/57809ddbfe7897e979cf507982ce0b3aa5e0ed8a/amalgam/src/main/java/com/amalgam/os/BundleUtils.java#L213-L215
hibernate/hibernate-ogm
neo4j/src/main/java/org/hibernate/ogm/datastore/neo4j/BaseNeo4jDialect.java
BaseNeo4jDialect.getEntityKey
protected EntityKey getEntityKey(Tuple tuple, AssociatedEntityKeyMetadata associatedEntityKeyMetadata) { """ Returns the key of the entity targeted by the represented association, retrieved from the given tuple. @param tuple the tuple from which to retrieve the referenced entity key @return the key of the enti...
java
protected EntityKey getEntityKey(Tuple tuple, AssociatedEntityKeyMetadata associatedEntityKeyMetadata) { Object[] columnValues = new Object[ associatedEntityKeyMetadata.getAssociationKeyColumns().length]; int i = 0; for ( String associationKeyColumn : associatedEntityKeyMetadata.getAssociationKeyColumns() ) { ...
[ "protected", "EntityKey", "getEntityKey", "(", "Tuple", "tuple", ",", "AssociatedEntityKeyMetadata", "associatedEntityKeyMetadata", ")", "{", "Object", "[", "]", "columnValues", "=", "new", "Object", "[", "associatedEntityKeyMetadata", ".", "getAssociationKeyColumns", "("...
Returns the key of the entity targeted by the represented association, retrieved from the given tuple. @param tuple the tuple from which to retrieve the referenced entity key @return the key of the entity targeted by the represented association
[ "Returns", "the", "key", "of", "the", "entity", "targeted", "by", "the", "represented", "association", "retrieved", "from", "the", "given", "tuple", "." ]
train
https://github.com/hibernate/hibernate-ogm/blob/9ea971df7c27277029006a6f748d8272fb1d69d2/neo4j/src/main/java/org/hibernate/ogm/datastore/neo4j/BaseNeo4jDialect.java#L191-L201
meltmedia/cadmium
servlets/src/main/java/com/meltmedia/cadmium/servlets/AbstractSecureRedirectStrategy.java
AbstractSecureRedirectStrategy.changeProtocolAndPort
public static URI changeProtocolAndPort(String protocol, int port, URI template) throws URISyntaxException { """ Returns a new URI object, based on the specified URI template, with an updated port (scheme) and port. If the port number is -1, then the default port is used in the resulting URI. @param protocol ...
java
public static URI changeProtocolAndPort(String protocol, int port, URI template) throws URISyntaxException { return new URI(protocol, template.getUserInfo(), template.getHost(), port, template.getPath(), template.getQuery(), null); }
[ "public", "static", "URI", "changeProtocolAndPort", "(", "String", "protocol", ",", "int", "port", ",", "URI", "template", ")", "throws", "URISyntaxException", "{", "return", "new", "URI", "(", "protocol", ",", "template", ".", "getUserInfo", "(", ")", ",", ...
Returns a new URI object, based on the specified URI template, with an updated port (scheme) and port. If the port number is -1, then the default port is used in the resulting URI. @param protocol the new protocol (scheme) in the resulting URI. @param port the new port in the resulting URI, or the default port if -1 ...
[ "Returns", "a", "new", "URI", "object", "based", "on", "the", "specified", "URI", "template", "with", "an", "updated", "port", "(", "scheme", ")", "and", "port", ".", "If", "the", "port", "number", "is", "-", "1", "then", "the", "default", "port", "is"...
train
https://github.com/meltmedia/cadmium/blob/bca585030e141803a73b58abb128d130157b6ddf/servlets/src/main/java/com/meltmedia/cadmium/servlets/AbstractSecureRedirectStrategy.java#L207-L209
UrielCh/ovh-java-sdk
ovh-java-sdk-dedicatednasha/src/main/java/net/minidev/ovh/api/ApiOvhDedicatednasha.java
ApiOvhDedicatednasha.serviceName_partition_partitionName_options_GET
public OvhOptions serviceName_partition_partitionName_options_GET(String serviceName, String partitionName) throws IOException { """ Get this object properties REST: GET /dedicated/nasha/{serviceName}/partition/{partitionName}/options @param serviceName [required] The internal name of your storage @param part...
java
public OvhOptions serviceName_partition_partitionName_options_GET(String serviceName, String partitionName) throws IOException { String qPath = "/dedicated/nasha/{serviceName}/partition/{partitionName}/options"; StringBuilder sb = path(qPath, serviceName, partitionName); String resp = exec(qPath, "GET", sb.toStri...
[ "public", "OvhOptions", "serviceName_partition_partitionName_options_GET", "(", "String", "serviceName", ",", "String", "partitionName", ")", "throws", "IOException", "{", "String", "qPath", "=", "\"/dedicated/nasha/{serviceName}/partition/{partitionName}/options\"", ";", "String...
Get this object properties REST: GET /dedicated/nasha/{serviceName}/partition/{partitionName}/options @param serviceName [required] The internal name of your storage @param partitionName [required] the given name of partition
[ "Get", "this", "object", "properties" ]
train
https://github.com/UrielCh/ovh-java-sdk/blob/6d531a40e56e09701943e334c25f90f640c55701/ovh-java-sdk-dedicatednasha/src/main/java/net/minidev/ovh/api/ApiOvhDedicatednasha.java#L111-L116
hazelcast/hazelcast
hazelcast/src/main/java/com/hazelcast/util/FutureUtil.java
FutureUtil.logAllExceptions
@PrivateApi public static ExceptionHandler logAllExceptions(final ILogger logger, final Level level) { """ This ExceptionHandler rethrows {@link java.util.concurrent.ExecutionException}s and logs {@link com.hazelcast.core.MemberLeftException}s to the log. @param logger the ILogger instance to be used for l...
java
@PrivateApi public static ExceptionHandler logAllExceptions(final ILogger logger, final Level level) { if (logger.isLoggable(level)) { return new ExceptionHandler() { @Override public void handleException(Throwable throwable) { logger.log(level...
[ "@", "PrivateApi", "public", "static", "ExceptionHandler", "logAllExceptions", "(", "final", "ILogger", "logger", ",", "final", "Level", "level", ")", "{", "if", "(", "logger", ".", "isLoggable", "(", "level", ")", ")", "{", "return", "new", "ExceptionHandler"...
This ExceptionHandler rethrows {@link java.util.concurrent.ExecutionException}s and logs {@link com.hazelcast.core.MemberLeftException}s to the log. @param logger the ILogger instance to be used for logging @param level the log level to be used for logging
[ "This", "ExceptionHandler", "rethrows", "{", "@link", "java", ".", "util", ".", "concurrent", ".", "ExecutionException", "}", "s", "and", "logs", "{", "@link", "com", ".", "hazelcast", ".", "core", ".", "MemberLeftException", "}", "s", "to", "the", "log", ...
train
https://github.com/hazelcast/hazelcast/blob/8c4bc10515dbbfb41a33e0302c0caedf3cda1baf/hazelcast/src/main/java/com/hazelcast/util/FutureUtil.java#L198-L209
mfornos/humanize
humanize-slim/src/main/java/humanize/Humanize.java
Humanize.titleize
public static String titleize(final String text, final String[] intCaps) { """ <p> Converts the given text to title case smartly. </p> @param text Text to be converted @param intCaps An internal capitalized word list @return a nice styled title """ String str = text.toLowerCase(Locale.ENGLISH)...
java
public static String titleize(final String text, final String[] intCaps) { String str = text.toLowerCase(Locale.ENGLISH).replaceAll("[\\s_]+", SPACE).trim(); return titleize(str, SPACE, intCaps); }
[ "public", "static", "String", "titleize", "(", "final", "String", "text", ",", "final", "String", "[", "]", "intCaps", ")", "{", "String", "str", "=", "text", ".", "toLowerCase", "(", "Locale", ".", "ENGLISH", ")", ".", "replaceAll", "(", "\"[\\\\s_]+\"", ...
<p> Converts the given text to title case smartly. </p> @param text Text to be converted @param intCaps An internal capitalized word list @return a nice styled title
[ "<p", ">", "Converts", "the", "given", "text", "to", "title", "case", "smartly", ".", "<", "/", "p", ">" ]
train
https://github.com/mfornos/humanize/blob/59fc103045de9d217c9e77dbcb7621f992f46c63/humanize-slim/src/main/java/humanize/Humanize.java#L2832-L2836
Baidu-AIP/java-sdk
src/main/java/com/baidu/aip/kg/AipKnowledgeGraphic.java
AipKnowledgeGraphic.getUserTasks
public JSONObject getUserTasks(HashMap<String, String> options) { """ 以分页的方式查询当前用户所有的任务信息接口 该请求用于菜品识别。即对于输入的一张图片(可正常解码,且长宽比适宜),输出图片的菜品名称、卡路里信息、置信度。 @param options - 可选参数对象,key: value都为string类型 options - options列表: id 任务ID,精确匹配 name 中缀模糊匹配,abc可以匹配abc,aaabc,abcde等 status 要筛选的任务状态 page 页码 per_page 页码 @retu...
java
public JSONObject getUserTasks(HashMap<String, String> options) { AipRequest request = new AipRequest(); preOperation(request); if (options != null) { request.addBody(options); } request.setUri(KnowledgeGraphicConsts.TASK_QUERY); postOperation(request); ...
[ "public", "JSONObject", "getUserTasks", "(", "HashMap", "<", "String", ",", "String", ">", "options", ")", "{", "AipRequest", "request", "=", "new", "AipRequest", "(", ")", ";", "preOperation", "(", "request", ")", ";", "if", "(", "options", "!=", "null", ...
以分页的方式查询当前用户所有的任务信息接口 该请求用于菜品识别。即对于输入的一张图片(可正常解码,且长宽比适宜),输出图片的菜品名称、卡路里信息、置信度。 @param options - 可选参数对象,key: value都为string类型 options - options列表: id 任务ID,精确匹配 name 中缀模糊匹配,abc可以匹配abc,aaabc,abcde等 status 要筛选的任务状态 page 页码 per_page 页码 @return JSONObject
[ "以分页的方式查询当前用户所有的任务信息接口", "该请求用于菜品识别。即对于输入的一张图片(可正常解码,且长宽比适宜),输出图片的菜品名称、卡路里信息、置信度。" ]
train
https://github.com/Baidu-AIP/java-sdk/blob/16bb8b7bb8f9bbcb7c8af62d0a67a1e79eecad90/src/main/java/com/baidu/aip/kg/AipKnowledgeGraphic.java#L125-L134
aspectran/aspectran
shell/src/main/java/com/aspectran/shell/command/OutputRedirection.java
OutputRedirection.determineOutputWriter
public static PrintWriter determineOutputWriter(List<OutputRedirection> redirectionList, Console console) throws FileNotFoundException, UnsupportedEncodingException { """ Returns the {@code Writer} instances for translet output redirection. @param redirectionList a list of the output redirection @p...
java
public static PrintWriter determineOutputWriter(List<OutputRedirection> redirectionList, Console console) throws FileNotFoundException, UnsupportedEncodingException { Writer[] redirectionWriters = getRedirectionWriters(redirectionList, console); PrintWriter outputWriter = null; if (r...
[ "public", "static", "PrintWriter", "determineOutputWriter", "(", "List", "<", "OutputRedirection", ">", "redirectionList", ",", "Console", "console", ")", "throws", "FileNotFoundException", ",", "UnsupportedEncodingException", "{", "Writer", "[", "]", "redirectionWriters"...
Returns the {@code Writer} instances for translet output redirection. @param redirectionList a list of the output redirection @param console the Console instance @return the {@code Writer} instance @throws FileNotFoundException if the file has an invalid path @throws UnsupportedEncodingException if the named encoding ...
[ "Returns", "the", "{", "@code", "Writer", "}", "instances", "for", "translet", "output", "redirection", "." ]
train
https://github.com/aspectran/aspectran/blob/2d758a2a28b71ee85b42823c12dc44674d7f2c70/shell/src/main/java/com/aspectran/shell/command/OutputRedirection.java#L115-L127
elki-project/elki
elki-core-math/src/main/java/de/lmu/ifi/dbs/elki/math/geodesy/SphereUtil.java
SphereUtil.cosineOrHaversineRad
public static double cosineOrHaversineRad(double lat1, double lon1, double lat2, double lon2) { """ Use cosine or haversine dynamically. <p> Complexity: 4-5 trigonometric functions, 1 sqrt. @param lat1 Latitude of first point in degree @param lon1 Longitude of first point in degree @param lat2 Latitude of s...
java
public static double cosineOrHaversineRad(double lat1, double lon1, double lat2, double lon2) { if(lat1 == lat2 && lon1 == lon2) { return 0.; } final DoubleWrapper tmp = new DoubleWrapper(); // To return cosine final double slat1 = sinAndCos(lat1, tmp), clat1 = tmp.value; final double slat2 = ...
[ "public", "static", "double", "cosineOrHaversineRad", "(", "double", "lat1", ",", "double", "lon1", ",", "double", "lat2", ",", "double", "lon2", ")", "{", "if", "(", "lat1", "==", "lat2", "&&", "lon1", "==", "lon2", ")", "{", "return", "0.", ";", "}",...
Use cosine or haversine dynamically. <p> Complexity: 4-5 trigonometric functions, 1 sqrt. @param lat1 Latitude of first point in degree @param lon1 Longitude of first point in degree @param lat2 Latitude of second point in degree @param lon2 Longitude of second point in degree @return Distance on unit sphere
[ "Use", "cosine", "or", "haversine", "dynamically", ".", "<p", ">", "Complexity", ":", "4", "-", "5", "trigonometric", "functions", "1", "sqrt", "." ]
train
https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-core-math/src/main/java/de/lmu/ifi/dbs/elki/math/geodesy/SphereUtil.java#L215-L231
onepf/OpenIAB
library/src/main/java/org/onepf/oms/SkuManager.java
SkuManager.mapSku
@NotNull public SkuManager mapSku(String sku, @Nullable Map<String, String> storeSkus) { """ Maps a base internal SKU to a store-specific SKU. The best approach is to use SKU like <code>com.companyname.application.item</code>. Such SKU fits most of stores so it doesn't need to be mapped. If this approach is...
java
@NotNull public SkuManager mapSku(String sku, @Nullable Map<String, String> storeSkus) { if (storeSkus == null) { throw new SkuMappingException("Store skus map can't be null."); } for (Map.Entry<String, String> entry : storeSkus.entrySet()) { mapSku(sku, entry.getKey...
[ "@", "NotNull", "public", "SkuManager", "mapSku", "(", "String", "sku", ",", "@", "Nullable", "Map", "<", "String", ",", "String", ">", "storeSkus", ")", "{", "if", "(", "storeSkus", "==", "null", ")", "{", "throw", "new", "SkuMappingException", "(", "\"...
Maps a base internal SKU to a store-specific SKU. The best approach is to use SKU like <code>com.companyname.application.item</code>. Such SKU fits most of stores so it doesn't need to be mapped. If this approach is not applicable, use application internal SKU in the code (usually it is a SKU for Google Play) and map S...
[ "Maps", "a", "base", "internal", "SKU", "to", "a", "store", "-", "specific", "SKU", ".", "The", "best", "approach", "is", "to", "use", "SKU", "like", "<code", ">", "com", ".", "companyname", ".", "application", ".", "item<", "/", "code", ">", ".", "S...
train
https://github.com/onepf/OpenIAB/blob/90552d53c5303b322940d96a0c4b7cb797d78760/library/src/main/java/org/onepf/oms/SkuManager.java#L139-L149
pressgang-ccms/PressGangCCMSContentSpecProcessor
src/main/java/org/jboss/pressgang/ccms/contentspec/processor/ContentSpecParser.java
ContentSpecParser.parseTopic
protected SpecTopic parseTopic(final ParserData parserData, final String line, int lineNumber) throws ParsingException { """ Processes the input to create a new topic @param parserData @param line The line of input to be processed @return A topics object initialised with the data from the input line. @...
java
protected SpecTopic parseTopic(final ParserData parserData, final String line, int lineNumber) throws ParsingException { // Read in the variables inside of the brackets final HashMap<ParserType, String[]> variableMap = getLineVariables(parserData, line, lineNumber, '[', ']', ',', false); if (!va...
[ "protected", "SpecTopic", "parseTopic", "(", "final", "ParserData", "parserData", ",", "final", "String", "line", ",", "int", "lineNumber", ")", "throws", "ParsingException", "{", "// Read in the variables inside of the brackets", "final", "HashMap", "<", "ParserType", ...
Processes the input to create a new topic @param parserData @param line The line of input to be processed @return A topics object initialised with the data from the input line. @throws ParsingException Thrown if the line can't be parsed as a Topic, due to incorrect syntax.
[ "Processes", "the", "input", "to", "create", "a", "new", "topic" ]
train
https://github.com/pressgang-ccms/PressGangCCMSContentSpecProcessor/blob/85ffac047c4ede0f972364ab1f03f7d61a4de5f1/src/main/java/org/jboss/pressgang/ccms/contentspec/processor/ContentSpecParser.java#L996-L1022
mcxiaoke/Android-Next
recycler/src/main/java/com/mcxiaoke/next/recycler/HeaderFooterRecyclerAdapter.java
HeaderFooterRecyclerAdapter.notifyContentItemRangeRemoved
public final void notifyContentItemRangeRemoved(int positionStart, int itemCount) { """ Notifies that multiple content items are removed. @param positionStart the position. @param itemCount the item count. """ if (positionStart < 0 || itemCount < 0 || positionStart + itemCount > contentItemCoun...
java
public final void notifyContentItemRangeRemoved(int positionStart, int itemCount) { if (positionStart < 0 || itemCount < 0 || positionStart + itemCount > contentItemCount) { throw new IndexOutOfBoundsException("The given range [" + positionStart + " - " + (positionStart + itemCou...
[ "public", "final", "void", "notifyContentItemRangeRemoved", "(", "int", "positionStart", ",", "int", "itemCount", ")", "{", "if", "(", "positionStart", "<", "0", "||", "itemCount", "<", "0", "||", "positionStart", "+", "itemCount", ">", "contentItemCount", ")", ...
Notifies that multiple content items are removed. @param positionStart the position. @param itemCount the item count.
[ "Notifies", "that", "multiple", "content", "items", "are", "removed", "." ]
train
https://github.com/mcxiaoke/Android-Next/blob/1bfdf99d0b81a849aa0fa6697c53ed673151ca39/recycler/src/main/java/com/mcxiaoke/next/recycler/HeaderFooterRecyclerAdapter.java#L297-L304
matthewhorridge/binaryowl
src/main/java/org/semanticweb/binaryowl/BinaryOWLMetadata.java
BinaryOWLMetadata.getDoubleAttribute
public Double getDoubleAttribute(String name, Double defaultValue) { """ Gets the double value of an attribute. @param name The name of the attribute. Not null. @param defaultValue The default value for the attribute. May be null. This value will be returned if this metadata object does not contain a double ...
java
public Double getDoubleAttribute(String name, Double defaultValue) { return getValue(doubleAttributes, name, defaultValue); }
[ "public", "Double", "getDoubleAttribute", "(", "String", "name", ",", "Double", "defaultValue", ")", "{", "return", "getValue", "(", "doubleAttributes", ",", "name", ",", "defaultValue", ")", ";", "}" ]
Gets the double value of an attribute. @param name The name of the attribute. Not null. @param defaultValue The default value for the attribute. May be null. This value will be returned if this metadata object does not contain a double value for the specified attribute name. @return Either the double value of the at...
[ "Gets", "the", "double", "value", "of", "an", "attribute", "." ]
train
https://github.com/matthewhorridge/binaryowl/blob/7fccfe804120f86b38ca855ddbb569a81a042257/src/main/java/org/semanticweb/binaryowl/BinaryOWLMetadata.java#L390-L392
GoogleCloudPlatform/appengine-pipelines
java/src/main/java/com/google/appengine/tools/pipeline/impl/PipelineManager.java
PipelineManager.queryJobOrAbandonTask
private static JobRecord queryJobOrAbandonTask(Key key, JobRecord.InflationType inflationType) { """ Queries for the job with the given key from the data store and if the job is not found then throws an {@link AbandonTaskException}. @param key The key of the JobRecord to be fetched @param inflationType Specif...
java
private static JobRecord queryJobOrAbandonTask(Key key, JobRecord.InflationType inflationType) { try { return backEnd.queryJob(key, inflationType); } catch (NoSuchObjectException e) { logger.log( Level.WARNING, "Cannot find some part of the job: " + key + ". Ignoring the task.", e); ...
[ "private", "static", "JobRecord", "queryJobOrAbandonTask", "(", "Key", "key", ",", "JobRecord", ".", "InflationType", "inflationType", ")", "{", "try", "{", "return", "backEnd", ".", "queryJob", "(", "key", ",", "inflationType", ")", ";", "}", "catch", "(", ...
Queries for the job with the given key from the data store and if the job is not found then throws an {@link AbandonTaskException}. @param key The key of the JobRecord to be fetched @param inflationType Specifies the manner in which the returned JobRecord should be inflated. @return A {@code JobRecord}, possibly with ...
[ "Queries", "for", "the", "job", "with", "the", "given", "key", "from", "the", "data", "store", "and", "if", "the", "job", "is", "not", "found", "then", "throws", "an", "{", "@link", "AbandonTaskException", "}", "." ]
train
https://github.com/GoogleCloudPlatform/appengine-pipelines/blob/277394648dac3e8214677af898935d07399ac8e1/java/src/main/java/com/google/appengine/tools/pipeline/impl/PipelineManager.java#L1186-L1194
relayrides/pushy
pushy/src/main/java/com/turo/pushy/apns/util/ApnsPayloadBuilder.java
ApnsPayloadBuilder.setLocalizedAlertMessage
public ApnsPayloadBuilder setLocalizedAlertMessage(final String localizedAlertKey, final String... alertArguments) { """ <p>Sets the key of a message in the receiving app's localized string list to be shown for the push notification. The message in the app's string list may optionally have placeholders, which wil...
java
public ApnsPayloadBuilder setLocalizedAlertMessage(final String localizedAlertKey, final String... alertArguments) { this.localizedAlertKey = localizedAlertKey; this.localizedAlertArguments = (alertArguments != null && alertArguments.length > 0) ? alertArguments : null; this.alertBody = null; ...
[ "public", "ApnsPayloadBuilder", "setLocalizedAlertMessage", "(", "final", "String", "localizedAlertKey", ",", "final", "String", "...", "alertArguments", ")", "{", "this", ".", "localizedAlertKey", "=", "localizedAlertKey", ";", "this", ".", "localizedAlertArguments", "...
<p>Sets the key of a message in the receiving app's localized string list to be shown for the push notification. The message in the app's string list may optionally have placeholders, which will be populated by values from the given {@code alertArguments}. Clears any previously-set literal alert body.</p> <p>By defaul...
[ "<p", ">", "Sets", "the", "key", "of", "a", "message", "in", "the", "receiving", "app", "s", "localized", "string", "list", "to", "be", "shown", "for", "the", "push", "notification", ".", "The", "message", "in", "the", "app", "s", "string", "list", "ma...
train
https://github.com/relayrides/pushy/blob/1f6f9a0e07d785c815d74c2320a8d87c80231d36/pushy/src/main/java/com/turo/pushy/apns/util/ApnsPayloadBuilder.java#L192-L199
Stratio/bdt
src/main/java/com/stratio/qa/specs/CommonG.java
CommonG.matchJsonToSchema
public boolean matchJsonToSchema(JSONObject schema, JSONObject json) throws Exception { """ Check json matches schema @param schema schema obtained from deploy-api @param json json to be checked @return boolean whether the json matches the schema or not """ SchemaLoader.builder() ...
java
public boolean matchJsonToSchema(JSONObject schema, JSONObject json) throws Exception { SchemaLoader.builder() .useDefaults(true) .schemaJson(schema) .build() .load() .build() .validate(json); return tr...
[ "public", "boolean", "matchJsonToSchema", "(", "JSONObject", "schema", ",", "JSONObject", "json", ")", "throws", "Exception", "{", "SchemaLoader", ".", "builder", "(", ")", ".", "useDefaults", "(", "true", ")", ".", "schemaJson", "(", "schema", ")", ".", "bu...
Check json matches schema @param schema schema obtained from deploy-api @param json json to be checked @return boolean whether the json matches the schema or not
[ "Check", "json", "matches", "schema" ]
train
https://github.com/Stratio/bdt/blob/55324d19e7497764ad3dd7139923e13eb9841d75/src/main/java/com/stratio/qa/specs/CommonG.java#L2242-L2251
dropbox/dropbox-sdk-java
src/main/java/com/dropbox/core/v1/DbxClientV1.java
DbxClientV1.restoreFile
public DbxEntry./*@Nullable*/File restoreFile(String path, String rev) throws DbxException { """ Takes a copy of the file at the given revision and saves it over the current latest copy. This will create a new revision, but the file contents will match the revision you specified. @param path The Drop...
java
public DbxEntry./*@Nullable*/File restoreFile(String path, String rev) throws DbxException { DbxPathV1.checkArgNonRoot("path", path); if (rev == null) throw new IllegalArgumentException("'rev' can't be null"); if (rev.length() == 0) throw new IllegalArgumentException("'rev' can't be ...
[ "public", "DbxEntry", ".", "/*@Nullable*/", "File", "restoreFile", "(", "String", "path", ",", "String", "rev", ")", "throws", "DbxException", "{", "DbxPathV1", ".", "checkArgNonRoot", "(", "\"path\"", ",", "path", ")", ";", "if", "(", "rev", "==", "null", ...
Takes a copy of the file at the given revision and saves it over the current latest copy. This will create a new revision, but the file contents will match the revision you specified. @param path The Dropbox path of the file to restore. @param rev The revision of the file you want to use to overwrite the latest revis...
[ "Takes", "a", "copy", "of", "the", "file", "at", "the", "given", "revision", "and", "saves", "it", "over", "the", "current", "latest", "copy", ".", "This", "will", "create", "a", "new", "revision", "but", "the", "file", "contents", "will", "match", "the"...
train
https://github.com/dropbox/dropbox-sdk-java/blob/d86157005fad6233c18b4b0f10f00b8d9d56ae92/src/main/java/com/dropbox/core/v1/DbxClientV1.java#L1848-L1869
wanglinsong/thx-webservice
src/main/java/com/tascape/qa/th/ws/comm/WebServiceCommunication.java
WebServiceCommunication.setBasicUsernamePassword
public void setBasicUsernamePassword(String username, String password) { """ Calls this to provide username and password. This will use Basic authentication, with a header such as "Authorization: Basic QWxhZGRpbjpvcGVuIHNlc2FtZQ==" @param username user name @param password password """ this.userna...
java
public void setBasicUsernamePassword(String username, String password) { this.username = username; this.password = password; LOG.debug("use basic username/password {}/********", username); userPassCredentialsProvider = new BasicCredentialsProvider(); userPassCredentialsProvider....
[ "public", "void", "setBasicUsernamePassword", "(", "String", "username", ",", "String", "password", ")", "{", "this", ".", "username", "=", "username", ";", "this", ".", "password", "=", "password", ";", "LOG", ".", "debug", "(", "\"use basic username/password {...
Calls this to provide username and password. This will use Basic authentication, with a header such as "Authorization: Basic QWxhZGRpbjpvcGVuIHNlc2FtZQ==" @param username user name @param password password
[ "Calls", "this", "to", "provide", "username", "and", "password", ".", "This", "will", "use", "Basic", "authentication", "with", "a", "header", "such", "as", "Authorization", ":", "Basic", "QWxhZGRpbjpvcGVuIHNlc2FtZQ", "==" ]
train
https://github.com/wanglinsong/thx-webservice/blob/29bc084b09ad35b012eb7c6b5c9ee55337ddee28/src/main/java/com/tascape/qa/th/ws/comm/WebServiceCommunication.java#L372-L384
awslabs/jsii
packages/jsii-java-runtime/project/src/main/java/software/amazon/jsii/JsiiRuntime.java
JsiiRuntime.prepareBundledRuntime
private String prepareBundledRuntime() { """ Extracts all files needed for jsii-runtime.js from JAR into a temp directory. @return The full path for jsii-runtime.js """ try { String directory = Files.createTempDirectory("jsii-java-runtime").toString(); String entrypoint = extr...
java
private String prepareBundledRuntime() { try { String directory = Files.createTempDirectory("jsii-java-runtime").toString(); String entrypoint = extractResource(getClass(), "jsii-runtime.js", directory); extractResource(getClass(), "jsii-runtime.js.map", directory); ...
[ "private", "String", "prepareBundledRuntime", "(", ")", "{", "try", "{", "String", "directory", "=", "Files", ".", "createTempDirectory", "(", "\"jsii-java-runtime\"", ")", ".", "toString", "(", ")", ";", "String", "entrypoint", "=", "extractResource", "(", "get...
Extracts all files needed for jsii-runtime.js from JAR into a temp directory. @return The full path for jsii-runtime.js
[ "Extracts", "all", "files", "needed", "for", "jsii", "-", "runtime", ".", "js", "from", "JAR", "into", "a", "temp", "directory", "." ]
train
https://github.com/awslabs/jsii/blob/6bbf743f5f65e98e5199ad31c93961533ffc40e5/packages/jsii-java-runtime/project/src/main/java/software/amazon/jsii/JsiiRuntime.java#L344-L355
Azure/azure-sdk-for-java
cognitiveservices/data-plane/vision/faceapi/src/main/java/com/microsoft/azure/cognitiveservices/vision/faceapi/implementation/PersonGroupPersonsImpl.java
PersonGroupPersonsImpl.updateAsync
public Observable<Void> updateAsync(String personGroupId, UUID personId, UpdatePersonGroupPersonsOptionalParameter updateOptionalParameter) { """ Update name or userData of a person. @param personGroupId Id referencing a particular person group. @param personId Id referencing a particular person. @param updat...
java
public Observable<Void> updateAsync(String personGroupId, UUID personId, UpdatePersonGroupPersonsOptionalParameter updateOptionalParameter) { return updateWithServiceResponseAsync(personGroupId, personId, updateOptionalParameter).map(new Func1<ServiceResponse<Void>, Void>() { @Override p...
[ "public", "Observable", "<", "Void", ">", "updateAsync", "(", "String", "personGroupId", ",", "UUID", "personId", ",", "UpdatePersonGroupPersonsOptionalParameter", "updateOptionalParameter", ")", "{", "return", "updateWithServiceResponseAsync", "(", "personGroupId", ",", ...
Update name or userData of a person. @param personGroupId Id referencing a particular person group. @param personId Id referencing a particular person. @param updateOptionalParameter the object representing the optional parameters to be set before calling this API @throws IllegalArgumentException thrown if parameters ...
[ "Update", "name", "or", "userData", "of", "a", "person", "." ]
train
https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/cognitiveservices/data-plane/vision/faceapi/src/main/java/com/microsoft/azure/cognitiveservices/vision/faceapi/implementation/PersonGroupPersonsImpl.java#L647-L654
weld/core
environments/se/core/src/main/java/org/jboss/weld/environment/se/Weld.java
Weld.addPackage
public Weld addPackage(boolean scanRecursively, Class<?> packageClass) { """ A package of the specified class will be scanned and found classes will be added to the set of bean classes for the synthetic bean archive. @param scanRecursively @param packageClass @return self """ packages.add(new Pack...
java
public Weld addPackage(boolean scanRecursively, Class<?> packageClass) { packages.add(new PackInfo(packageClass, scanRecursively)); return this; }
[ "public", "Weld", "addPackage", "(", "boolean", "scanRecursively", ",", "Class", "<", "?", ">", "packageClass", ")", "{", "packages", ".", "add", "(", "new", "PackInfo", "(", "packageClass", ",", "scanRecursively", ")", ")", ";", "return", "this", ";", "}"...
A package of the specified class will be scanned and found classes will be added to the set of bean classes for the synthetic bean archive. @param scanRecursively @param packageClass @return self
[ "A", "package", "of", "the", "specified", "class", "will", "be", "scanned", "and", "found", "classes", "will", "be", "added", "to", "the", "set", "of", "bean", "classes", "for", "the", "synthetic", "bean", "archive", "." ]
train
https://github.com/weld/core/blob/567a2eaf95b168597d23a56be89bf05a7834b2aa/environments/se/core/src/main/java/org/jboss/weld/environment/se/Weld.java#L402-L405
apptik/jus
android/jus-android/src/main/java/io/apptik/comm/jus/ui/ImageLoader.java
ImageLoader.get
public ImageContainer get(String requestUrl, final ImageListener listener, final Object tag) { """ Returns an ImageContainer for the requested URL. The ImageContainer will contain either the specified default bitmap or the loaded bitmap. If the default was returned, the {@link ImageLoader} will be invoked when...
java
public ImageContainer get(String requestUrl, final ImageListener listener, final Object tag) { return get(requestUrl, listener, 0, 0, tag); }
[ "public", "ImageContainer", "get", "(", "String", "requestUrl", ",", "final", "ImageListener", "listener", ",", "final", "Object", "tag", ")", "{", "return", "get", "(", "requestUrl", ",", "listener", ",", "0", ",", "0", ",", "tag", ")", ";", "}" ]
Returns an ImageContainer for the requested URL. The ImageContainer will contain either the specified default bitmap or the loaded bitmap. If the default was returned, the {@link ImageLoader} will be invoked when the request is fulfilled. @param requestUrl The URL of the image to be loaded.
[ "Returns", "an", "ImageContainer", "for", "the", "requested", "URL", "." ]
train
https://github.com/apptik/jus/blob/8a37a21b41f897d68eaeaab07368ec22a1e5a60e/android/jus-android/src/main/java/io/apptik/comm/jus/ui/ImageLoader.java#L238-L240
tvesalainen/lpg
src/main/java/org/vesalainen/parser/util/Input.java
Input.getInstance
public static InputReader getInstance(Reader in, char[] shared) { """ Creates an InputReader @param in @param shared Shared ringbuffer. @return """ Set<ParserFeature> features = NO_FEATURES; return new ReadableInput(getFeaturedReader(in, shared.length, features), shared, features); }
java
public static InputReader getInstance(Reader in, char[] shared) { Set<ParserFeature> features = NO_FEATURES; return new ReadableInput(getFeaturedReader(in, shared.length, features), shared, features); }
[ "public", "static", "InputReader", "getInstance", "(", "Reader", "in", ",", "char", "[", "]", "shared", ")", "{", "Set", "<", "ParserFeature", ">", "features", "=", "NO_FEATURES", ";", "return", "new", "ReadableInput", "(", "getFeaturedReader", "(", "in", ",...
Creates an InputReader @param in @param shared Shared ringbuffer. @return
[ "Creates", "an", "InputReader" ]
train
https://github.com/tvesalainen/lpg/blob/0917b8d295e9772b9f8a0affc258a08530cd567a/src/main/java/org/vesalainen/parser/util/Input.java#L339-L343
j-a-w-r/jawr-main-repo
jawr/jawr-core/src/main/java/net/jawr/web/servlet/RendererRequestUtils.java
RendererRequestUtils.refreshConfigIfNeeded
public static boolean refreshConfigIfNeeded(HttpServletRequest request, JawrConfig jawrConfig) { """ Refresh the Jawr config if a manual reload has been ask using the refresh key parameter from the URL @param request the request @param jawrConfig the Jawr config @return true if the config has been refres...
java
public static boolean refreshConfigIfNeeded(HttpServletRequest request, JawrConfig jawrConfig) { boolean refreshed = false; if (request.getAttribute(JawrConstant.JAWR_BUNDLE_REFRESH_CHECK) == null) { request.setAttribute(JawrConstant.JAWR_BUNDLE_REFRESH_CHECK, Boolean.TRUE); if (jawrConfig.getRefreshKey()....
[ "public", "static", "boolean", "refreshConfigIfNeeded", "(", "HttpServletRequest", "request", ",", "JawrConfig", "jawrConfig", ")", "{", "boolean", "refreshed", "=", "false", ";", "if", "(", "request", ".", "getAttribute", "(", "JawrConstant", ".", "JAWR_BUNDLE_REFR...
Refresh the Jawr config if a manual reload has been ask using the refresh key parameter from the URL @param request the request @param jawrConfig the Jawr config @return true if the config has been refreshed
[ "Refresh", "the", "Jawr", "config", "if", "a", "manual", "reload", "has", "been", "ask", "using", "the", "refresh", "key", "parameter", "from", "the", "URL" ]
train
https://github.com/j-a-w-r/jawr-main-repo/blob/5381f6acf461cd2502593c67a77bd6ef9eab848d/jawr/jawr-core/src/main/java/net/jawr/web/servlet/RendererRequestUtils.java#L382-L403
jmapper-framework/jmapper-core
JMapper Framework/src/main/java/com/googlecode/jmapper/xml/XML.java
XML.checksAttributesExistence
private XML checksAttributesExistence(Class<?> aClass,Attribute[] attributes) { """ Verifies that the attributes exist in aClass. @param aClass Class to check @param attributes attributes to check @return this instance of XML """ String[] attributesNames = new String[attributes.length]; for (int i = a...
java
private XML checksAttributesExistence(Class<?> aClass,Attribute[] attributes){ String[] attributesNames = new String[attributes.length]; for (int i = attributes.length; i --> 0;) attributesNames[i] = attributes[i].getName(); checksAttributesExistence(aClass,attributesNames); return this; }
[ "private", "XML", "checksAttributesExistence", "(", "Class", "<", "?", ">", "aClass", ",", "Attribute", "[", "]", "attributes", ")", "{", "String", "[", "]", "attributesNames", "=", "new", "String", "[", "attributes", ".", "length", "]", ";", "for", "(", ...
Verifies that the attributes exist in aClass. @param aClass Class to check @param attributes attributes to check @return this instance of XML
[ "Verifies", "that", "the", "attributes", "exist", "in", "aClass", "." ]
train
https://github.com/jmapper-framework/jmapper-core/blob/b48fd3527f35055b8b4a30f53a51136f183acc90/JMapper Framework/src/main/java/com/googlecode/jmapper/xml/XML.java#L407-L414
Azure/azure-sdk-for-java
mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/implementation/StreamingEndpointsInner.java
StreamingEndpointsInner.createAsync
public Observable<StreamingEndpointInner> createAsync(String resourceGroupName, String accountName, String streamingEndpointName, StreamingEndpointInner parameters) { """ Create StreamingEndpoint. Creates a StreamingEndpoint. @param resourceGroupName The name of the resource group within the Azure subscription...
java
public Observable<StreamingEndpointInner> createAsync(String resourceGroupName, String accountName, String streamingEndpointName, StreamingEndpointInner parameters) { return createWithServiceResponseAsync(resourceGroupName, accountName, streamingEndpointName, parameters).map(new Func1<ServiceResponse<StreamingE...
[ "public", "Observable", "<", "StreamingEndpointInner", ">", "createAsync", "(", "String", "resourceGroupName", ",", "String", "accountName", ",", "String", "streamingEndpointName", ",", "StreamingEndpointInner", "parameters", ")", "{", "return", "createWithServiceResponseAs...
Create StreamingEndpoint. Creates a StreamingEndpoint. @param resourceGroupName The name of the resource group within the Azure subscription. @param accountName The Media Services account name. @param streamingEndpointName The name of the StreamingEndpoint. @param parameters StreamingEndpoint properties needed for cre...
[ "Create", "StreamingEndpoint", ".", "Creates", "a", "StreamingEndpoint", "." ]
train
https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/implementation/StreamingEndpointsInner.java#L399-L406
google/j2objc
jre_emul/android/platform/libcore/ojluni/src/main/java/java/time/LocalTime.java
LocalTime.ofNanoOfDay
public static LocalTime ofNanoOfDay(long nanoOfDay) { """ Obtains an instance of {@code LocalTime} from a nanos-of-day value. <p> This returns a {@code LocalTime} with the specified nanosecond-of-day. @param nanoOfDay the nano of day, from {@code 0} to {@code 24 * 60 * 60 * 1,000,000,000 - 1} @return the lo...
java
public static LocalTime ofNanoOfDay(long nanoOfDay) { NANO_OF_DAY.checkValidValue(nanoOfDay); int hours = (int) (nanoOfDay / NANOS_PER_HOUR); nanoOfDay -= hours * NANOS_PER_HOUR; int minutes = (int) (nanoOfDay / NANOS_PER_MINUTE); nanoOfDay -= minutes * NANOS_PER_MINUTE; ...
[ "public", "static", "LocalTime", "ofNanoOfDay", "(", "long", "nanoOfDay", ")", "{", "NANO_OF_DAY", ".", "checkValidValue", "(", "nanoOfDay", ")", ";", "int", "hours", "=", "(", "int", ")", "(", "nanoOfDay", "/", "NANOS_PER_HOUR", ")", ";", "nanoOfDay", "-=",...
Obtains an instance of {@code LocalTime} from a nanos-of-day value. <p> This returns a {@code LocalTime} with the specified nanosecond-of-day. @param nanoOfDay the nano of day, from {@code 0} to {@code 24 * 60 * 60 * 1,000,000,000 - 1} @return the local time, not null @throws DateTimeException if the nanos of day val...
[ "Obtains", "an", "instance", "of", "{", "@code", "LocalTime", "}", "from", "a", "nanos", "-", "of", "-", "day", "value", ".", "<p", ">", "This", "returns", "a", "{", "@code", "LocalTime", "}", "with", "the", "specified", "nanosecond", "-", "of", "-", ...
train
https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/libcore/ojluni/src/main/java/java/time/LocalTime.java#L369-L378
bbossgroups/bboss-elasticsearch
bboss-elasticsearch-rest/src/main/java/org/frameworkset/elasticsearch/client/ConfigRestClientUtil.java
ConfigRestClientUtil.addDateDocumentsNew
public String addDateDocumentsNew(String indexName, String addTemplate, List<?> beans, String refreshOption) throws ElasticSearchException { """ For Elasticsearch 7 and 7+ @param indexName @param addTemplate @param beans @param refreshOption refresh=wait_for refresh=false refresh=true refresh Empty s...
java
public String addDateDocumentsNew(String indexName, String addTemplate, List<?> beans, String refreshOption) throws ElasticSearchException{ return addDateDocuments( indexName, _doc, addTemplate, beans, refreshOption); }
[ "public", "String", "addDateDocumentsNew", "(", "String", "indexName", ",", "String", "addTemplate", ",", "List", "<", "?", ">", "beans", ",", "String", "refreshOption", ")", "throws", "ElasticSearchException", "{", "return", "addDateDocuments", "(", "indexName", ...
For Elasticsearch 7 and 7+ @param indexName @param addTemplate @param beans @param refreshOption refresh=wait_for refresh=false refresh=true refresh Empty string or true Refresh the relevant primary and replica shards (not the whole index) immediately after the operation occurs, so that the updated document appears in...
[ "For", "Elasticsearch", "7", "and", "7", "+" ]
train
https://github.com/bbossgroups/bboss-elasticsearch/blob/31717c8aa2c4c880987be53aeeb8a0cf5183c3a7/bboss-elasticsearch-rest/src/main/java/org/frameworkset/elasticsearch/client/ConfigRestClientUtil.java#L1452-L1454
aws/aws-sdk-java
aws-java-sdk-stepfunctions/src/main/java/com/amazonaws/services/stepfunctions/builder/StepFunctionBuilder.java
StepFunctionBuilder.gt
public static NumericGreaterThanCondition.Builder gt(String variable, long expectedValue) { """ Binary condition for Numeric greater than comparison. Supports both integral and floating point numeric types. @param variable The JSONPath expression that determines which piece of the input document is used fo...
java
public static NumericGreaterThanCondition.Builder gt(String variable, long expectedValue) { return NumericGreaterThanCondition.builder().variable(variable).expectedValue(expectedValue); }
[ "public", "static", "NumericGreaterThanCondition", ".", "Builder", "gt", "(", "String", "variable", ",", "long", "expectedValue", ")", "{", "return", "NumericGreaterThanCondition", ".", "builder", "(", ")", ".", "variable", "(", "variable", ")", ".", "expectedValu...
Binary condition for Numeric greater than comparison. Supports both integral and floating point numeric types. @param variable The JSONPath expression that determines which piece of the input document is used for the comparison. @param expectedValue The expected value for this condition. @see <a href="https://sta...
[ "Binary", "condition", "for", "Numeric", "greater", "than", "comparison", ".", "Supports", "both", "integral", "and", "floating", "point", "numeric", "types", "." ]
train
https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-stepfunctions/src/main/java/com/amazonaws/services/stepfunctions/builder/StepFunctionBuilder.java#L284-L286
wmdietl/jsr308-langtools
src/share/classes/com/sun/tools/doclets/internal/toolkit/builders/ConstantsSummaryBuilder.java
ConstantsSummaryBuilder.buildConstantSummaries
public void buildConstantSummaries(XMLNode node, Content contentTree) { """ Build the summary for each documented package. @param node the XML element that specifies which components to document @param contentTree the tree to which the summaries will be added """ PackageDoc[] packages = configurati...
java
public void buildConstantSummaries(XMLNode node, Content contentTree) { PackageDoc[] packages = configuration.packages; printedPackageHeaders = new HashSet<String>(); Content summariesTree = writer.getConstantSummaries(); for (int i = 0; i < packages.length; i++) { if (hasCon...
[ "public", "void", "buildConstantSummaries", "(", "XMLNode", "node", ",", "Content", "contentTree", ")", "{", "PackageDoc", "[", "]", "packages", "=", "configuration", ".", "packages", ";", "printedPackageHeaders", "=", "new", "HashSet", "<", "String", ">", "(", ...
Build the summary for each documented package. @param node the XML element that specifies which components to document @param contentTree the tree to which the summaries will be added
[ "Build", "the", "summary", "for", "each", "documented", "package", "." ]
train
https://github.com/wmdietl/jsr308-langtools/blob/8812d28c20f4de070a0dd6de1b45602431379834/src/share/classes/com/sun/tools/doclets/internal/toolkit/builders/ConstantsSummaryBuilder.java#L172-L184
algolia/instantsearch-android
ui/src/main/java/com/algolia/instantsearch/ui/utils/SearchViewFacade.java
SearchViewFacade.setQuery
public void setQuery(CharSequence query, boolean submit) { """ Sets a query string in the text field and optionally submits the query as well. @param query the query string. This replaces any query text already present in the text field. @param submit whether to submit the query right now or only update the ...
java
public void setQuery(CharSequence query, boolean submit) { if (searchView != null) { searchView.setQuery(query, submit); } else if (supportView != null) { supportView.setQuery(query, submit); } else { throw new IllegalStateException(ERROR_NO_SEARCHVIEW); ...
[ "public", "void", "setQuery", "(", "CharSequence", "query", ",", "boolean", "submit", ")", "{", "if", "(", "searchView", "!=", "null", ")", "{", "searchView", ".", "setQuery", "(", "query", ",", "submit", ")", ";", "}", "else", "if", "(", "supportView", ...
Sets a query string in the text field and optionally submits the query as well. @param query the query string. This replaces any query text already present in the text field. @param submit whether to submit the query right now or only update the contents of text field.
[ "Sets", "a", "query", "string", "in", "the", "text", "field", "and", "optionally", "submits", "the", "query", "as", "well", "." ]
train
https://github.com/algolia/instantsearch-android/blob/12092ec30140df9ffc2bf916339b433372034616/ui/src/main/java/com/algolia/instantsearch/ui/utils/SearchViewFacade.java#L134-L142
camunda/camunda-bpm-platform-osgi
camunda-bpm-osgi/src/main/java/org/camunda/bpm/extension/osgi/el/OSGiELResolver.java
OSGiELResolver.checkRegisteredOsgiServices
private <T> T checkRegisteredOsgiServices(Class<T> serviceClazz, String key) throws InvalidSyntaxException { """ Checks the OSGi ServiceRegistry if a service matching the class and key are present. The class name has to match the key where the first letter has to be lower case. <p> For example:<br/> <code> p...
java
private <T> T checkRegisteredOsgiServices(Class<T> serviceClazz, String key) throws InvalidSyntaxException { Collection<ServiceReference<T>> references = getBundleContext().getServiceReferences(serviceClazz, null); if (references == null || references.isEmpty()) { return null; } Collection<T> matc...
[ "private", "<", "T", ">", "T", "checkRegisteredOsgiServices", "(", "Class", "<", "T", ">", "serviceClazz", ",", "String", "key", ")", "throws", "InvalidSyntaxException", "{", "Collection", "<", "ServiceReference", "<", "T", ">>", "references", "=", "getBundleCon...
Checks the OSGi ServiceRegistry if a service matching the class and key are present. The class name has to match the key where the first letter has to be lower case. <p> For example:<br/> <code> public class MyServiceTask extends JavaDelegate</code> <br/> matches {@link JavaDelegate} with key "myServiceTask". @param s...
[ "Checks", "the", "OSGi", "ServiceRegistry", "if", "a", "service", "matching", "the", "class", "and", "key", "are", "present", ".", "The", "class", "name", "has", "to", "match", "the", "key", "where", "the", "first", "letter", "has", "to", "be", "lower", ...
train
https://github.com/camunda/camunda-bpm-platform-osgi/blob/b91c6a68895947b320a7a5edf0db7158e945c4bb/camunda-bpm-osgi/src/main/java/org/camunda/bpm/extension/osgi/el/OSGiELResolver.java#L103-L116
alibaba/jstorm
jstorm-core/src/main/java/com/alibaba/jstorm/blobstore/BlobStore.java
BlobStore.readBlobTo
public void readBlobTo(String key, OutputStream out) throws IOException, KeyNotFoundException { """ Reads the blob from the blob store and writes it into the output stream. @param key Key for the blob. @param out Output stream privilege for the blob. @throws IOException @throws KeyNotFoundException """ ...
java
public void readBlobTo(String key, OutputStream out) throws IOException, KeyNotFoundException { InputStreamWithMeta in = getBlob(key); if (in == null) { throw new IOException("Could not find " + key); } byte[] buffer = new byte[2048]; int len = 0; try{ ...
[ "public", "void", "readBlobTo", "(", "String", "key", ",", "OutputStream", "out", ")", "throws", "IOException", ",", "KeyNotFoundException", "{", "InputStreamWithMeta", "in", "=", "getBlob", "(", "key", ")", ";", "if", "(", "in", "==", "null", ")", "{", "t...
Reads the blob from the blob store and writes it into the output stream. @param key Key for the blob. @param out Output stream privilege for the blob. @throws IOException @throws KeyNotFoundException
[ "Reads", "the", "blob", "from", "the", "blob", "store", "and", "writes", "it", "into", "the", "output", "stream", "." ]
train
https://github.com/alibaba/jstorm/blob/5d6cde22dbca7df3d6e6830bf94f98a6639ab559/jstorm-core/src/main/java/com/alibaba/jstorm/blobstore/BlobStore.java#L217-L232
google/error-prone-javac
src/java.compiler/share/classes/javax/lang/model/util/ElementFilter.java
ElementFilter.packagesIn
public static List<PackageElement> packagesIn(Iterable<? extends Element> elements) { """ Returns a list of packages in {@code elements}. @return a list of packages in {@code elements} @param elements the elements to filter """ return listFilter(elements, PACKAGE_KIND, PackageElement.clas...
java
public static List<PackageElement> packagesIn(Iterable<? extends Element> elements) { return listFilter(elements, PACKAGE_KIND, PackageElement.class); }
[ "public", "static", "List", "<", "PackageElement", ">", "packagesIn", "(", "Iterable", "<", "?", "extends", "Element", ">", "elements", ")", "{", "return", "listFilter", "(", "elements", ",", "PACKAGE_KIND", ",", "PackageElement", ".", "class", ")", ";", "}"...
Returns a list of packages in {@code elements}. @return a list of packages in {@code elements} @param elements the elements to filter
[ "Returns", "a", "list", "of", "packages", "in", "{" ]
train
https://github.com/google/error-prone-javac/blob/a53d069bbdb2c60232ed3811c19b65e41c3e60e0/src/java.compiler/share/classes/javax/lang/model/util/ElementFilter.java#L172-L175
drinkjava2/jBeanBox
jbeanbox/src/main/java/com/github/drinkjava2/jbeanbox/BeanBoxUtils.java
BeanBoxUtils.getUniqueBeanBox
public static BeanBox getUniqueBeanBox(BeanBoxContext ctx, Class<?> clazz) { """ Translate a BeanBox class or normal class to a readOnly BeanBox instance """ BeanBoxException.assureNotNull(clazz, "Target class can not be null"); BeanBox box = ctx.beanBoxMetaCache.get(clazz); if (box != null) return bo...
java
public static BeanBox getUniqueBeanBox(BeanBoxContext ctx, Class<?> clazz) { BeanBoxException.assureNotNull(clazz, "Target class can not be null"); BeanBox box = ctx.beanBoxMetaCache.get(clazz); if (box != null) return box; if (BeanBox.class.isAssignableFrom(clazz)) try { box = (BeanBox) clazz.newInst...
[ "public", "static", "BeanBox", "getUniqueBeanBox", "(", "BeanBoxContext", "ctx", ",", "Class", "<", "?", ">", "clazz", ")", "{", "BeanBoxException", ".", "assureNotNull", "(", "clazz", ",", "\"Target class can not be null\"", ")", ";", "BeanBox", "box", "=", "ct...
Translate a BeanBox class or normal class to a readOnly BeanBox instance
[ "Translate", "a", "BeanBox", "class", "or", "normal", "class", "to", "a", "readOnly", "BeanBox", "instance" ]
train
https://github.com/drinkjava2/jBeanBox/blob/01c216599ffa2e5f2d9c01df2adaad0f45567c04/jbeanbox/src/main/java/com/github/drinkjava2/jbeanbox/BeanBoxUtils.java#L45-L62
nabedge/mixer2
src/main/java/org/mixer2/xhtml/AbstractJaxb.java
AbstractJaxb.replaceById
public <T extends AbstractJaxb> boolean replaceById(String id, T replacement) throws TagTypeUnmatchException { """ <p> replace element that has specified id attribute within descendant element of oneself. you can't replace oneself. It will be replaced by deep copy of "replacement" </p> @param id...
java
public <T extends AbstractJaxb> boolean replaceById(String id, T replacement) throws TagTypeUnmatchException { return ReplaceByIdUtil.replaceById(id, this, replacement); }
[ "public", "<", "T", "extends", "AbstractJaxb", ">", "boolean", "replaceById", "(", "String", "id", ",", "T", "replacement", ")", "throws", "TagTypeUnmatchException", "{", "return", "ReplaceByIdUtil", ".", "replaceById", "(", "id", ",", "this", ",", "replacement"...
<p> replace element that has specified id attribute within descendant element of oneself. you can't replace oneself. It will be replaced by deep copy of "replacement" </p> @param id @param replacement @return if success to replace, return true. if no hit, return false. @throws TagTypeUnmatchException
[ "<p", ">", "replace", "element", "that", "has", "specified", "id", "attribute", "within", "descendant", "element", "of", "oneself", ".", "you", "can", "t", "replace", "oneself", ".", "It", "will", "be", "replaced", "by", "deep", "copy", "of", "replacement", ...
train
https://github.com/nabedge/mixer2/blob/8c2db27cfcd65bf0b1e0242ef9362ebd8033777c/src/main/java/org/mixer2/xhtml/AbstractJaxb.java#L185-L188
tvbarthel/Cheerleader
library/src/main/java/fr/tvbarthel/cheerleader/library/media/MediaSessionReceiver.java
MediaSessionReceiver.sendAction
private void sendAction(Context context, String action) { """ Propagate lock screen event to the player. @param context context used to start service. @param action action to send. """ Intent intent = new Intent(context, PlaybackService.class); intent.setAction(action); LocalBroadc...
java
private void sendAction(Context context, String action) { Intent intent = new Intent(context, PlaybackService.class); intent.setAction(action); LocalBroadcastManager.getInstance(context).sendBroadcast(intent); }
[ "private", "void", "sendAction", "(", "Context", "context", ",", "String", "action", ")", "{", "Intent", "intent", "=", "new", "Intent", "(", "context", ",", "PlaybackService", ".", "class", ")", ";", "intent", ".", "setAction", "(", "action", ")", ";", ...
Propagate lock screen event to the player. @param context context used to start service. @param action action to send.
[ "Propagate", "lock", "screen", "event", "to", "the", "player", "." ]
train
https://github.com/tvbarthel/Cheerleader/blob/f61527e4cc44fcd0ed2e1e98aca285f8c236f24e/library/src/main/java/fr/tvbarthel/cheerleader/library/media/MediaSessionReceiver.java#L58-L62
facebookarchive/hadoop-20
src/core/org/apache/hadoop/net/NetUtils.java
NetUtils.addStaticResolution
public static void addStaticResolution(String host, String resolvedName) { """ Adds a static resolution for host. This can be used for setting up hostnames with names that are fake to point to a well known host. For e.g. in some testcases we require to have daemons with different hostnames running on the same m...
java
public static void addStaticResolution(String host, String resolvedName) { synchronized (hostToResolved) { hostToResolved.put(host, resolvedName); } }
[ "public", "static", "void", "addStaticResolution", "(", "String", "host", ",", "String", "resolvedName", ")", "{", "synchronized", "(", "hostToResolved", ")", "{", "hostToResolved", ".", "put", "(", "host", ",", "resolvedName", ")", ";", "}", "}" ]
Adds a static resolution for host. This can be used for setting up hostnames with names that are fake to point to a well known host. For e.g. in some testcases we require to have daemons with different hostnames running on the same machine. In order to create connections to these daemons, one can set up mappings from t...
[ "Adds", "a", "static", "resolution", "for", "host", ".", "This", "can", "be", "used", "for", "setting", "up", "hostnames", "with", "names", "that", "are", "fake", "to", "point", "to", "a", "well", "known", "host", ".", "For", "e", ".", "g", ".", "in"...
train
https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/core/org/apache/hadoop/net/NetUtils.java#L238-L242
katharsis-project/katharsis-framework
katharsis-core/src/main/java/io/katharsis/legacy/internal/ParametersFactory.java
ParametersFactory.buildParameters
public Object[] buildParameters(Object[] firstParameters, Method method, QueryAdapter queryAdapter, Class<? extends Annotation> annotationType) { """ Build a list of parameters that can be provided to a method. @param firstParameters parameters to be returned as the firsts el...
java
public Object[] buildParameters(Object[] firstParameters, Method method, QueryAdapter queryAdapter, Class<? extends Annotation> annotationType) { int parametersLength = method.getParameterTypes().length; if (firstParameters.length > 0 && parametersLength < 1) { ...
[ "public", "Object", "[", "]", "buildParameters", "(", "Object", "[", "]", "firstParameters", ",", "Method", "method", ",", "QueryAdapter", "queryAdapter", ",", "Class", "<", "?", "extends", "Annotation", ">", "annotationType", ")", "{", "int", "parametersLength"...
Build a list of parameters that can be provided to a method. @param firstParameters parameters to be returned as the firsts element in the return array @param method repository method @param annotationType method annotation @param queryAdapter Ask remmo @return array of resolved parameters
[ "Build", "a", "list", "of", "parameters", "that", "can", "be", "provided", "to", "a", "method", "." ]
train
https://github.com/katharsis-project/katharsis-framework/blob/73d1a8763c49c5cf4643d43e2dbfedb647630c46/katharsis-core/src/main/java/io/katharsis/legacy/internal/ParametersFactory.java#L31-L49
fuinorg/utils4swing
src/main/java/org/fuin/utils4swing/common/Utils4Swing.java
Utils4Swing.loadIcon
public static ImageIcon loadIcon(final Class clasz, final String name) { """ Load an icon located in the same package as a given class. @param clasz Class with the same package where the icon is located. @param name Filename of the icon. @return New icon instance. """ final URL url = Utils4J....
java
public static ImageIcon loadIcon(final Class clasz, final String name) { final URL url = Utils4J.getResource(clasz, name); return new ImageIcon(url); }
[ "public", "static", "ImageIcon", "loadIcon", "(", "final", "Class", "clasz", ",", "final", "String", "name", ")", "{", "final", "URL", "url", "=", "Utils4J", ".", "getResource", "(", "clasz", ",", "name", ")", ";", "return", "new", "ImageIcon", "(", "url...
Load an icon located in the same package as a given class. @param clasz Class with the same package where the icon is located. @param name Filename of the icon. @return New icon instance.
[ "Load", "an", "icon", "located", "in", "the", "same", "package", "as", "a", "given", "class", "." ]
train
https://github.com/fuinorg/utils4swing/blob/560fb69eac182e3473de9679c3c15433e524ef6b/src/main/java/org/fuin/utils4swing/common/Utils4Swing.java#L124-L127
sahan/RoboZombie
robozombie/src/main/java/org/apache/http42/client/utils/URIBuilder.java
URIBuilder.addParameter
public URIBuilder addParameter(final String param, final String value) { """ Adds parameter to URI query. The parameter name and value are expected to be unescaped and may contain non ASCII characters. """ if (this.queryParams == null) { this.queryParams = new ArrayList<NameValuePair>(); ...
java
public URIBuilder addParameter(final String param, final String value) { if (this.queryParams == null) { this.queryParams = new ArrayList<NameValuePair>(); } this.queryParams.add(new BasicNameValuePair(param, value)); this.encodedQuery = null; this.encodedSchemeSpecif...
[ "public", "URIBuilder", "addParameter", "(", "final", "String", "param", ",", "final", "String", "value", ")", "{", "if", "(", "this", ".", "queryParams", "==", "null", ")", "{", "this", ".", "queryParams", "=", "new", "ArrayList", "<", "NameValuePair", ">...
Adds parameter to URI query. The parameter name and value are expected to be unescaped and may contain non ASCII characters.
[ "Adds", "parameter", "to", "URI", "query", ".", "The", "parameter", "name", "and", "value", "are", "expected", "to", "be", "unescaped", "and", "may", "contain", "non", "ASCII", "characters", "." ]
train
https://github.com/sahan/RoboZombie/blob/2e02f0d41647612e9d89360c5c48811ea86b33c8/robozombie/src/main/java/org/apache/http42/client/utils/URIBuilder.java#L269-L277
google/j2objc
xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/dtm/DTMException.java
DTMException.initCause
public synchronized Throwable initCause(Throwable cause) { """ Initializes the <i>cause</i> of this throwable to the specified value. (The cause is the throwable that caused this throwable to get thrown.) <p>This method can be called at most once. It is generally called from within the constructor, or immedi...
java
public synchronized Throwable initCause(Throwable cause) { if ((this.containedException == null) && (cause != null)) { throw new IllegalStateException(XMLMessages.createXMLMessage(XMLErrorResources.ER_CANNOT_OVERWRITE_CAUSE, null)); //"Can't overwrite cause"); } if (cause == this) ...
[ "public", "synchronized", "Throwable", "initCause", "(", "Throwable", "cause", ")", "{", "if", "(", "(", "this", ".", "containedException", "==", "null", ")", "&&", "(", "cause", "!=", "null", ")", ")", "{", "throw", "new", "IllegalStateException", "(", "X...
Initializes the <i>cause</i> of this throwable to the specified value. (The cause is the throwable that caused this throwable to get thrown.) <p>This method can be called at most once. It is generally called from within the constructor, or immediately after creating the throwable. If this throwable was created with ...
[ "Initializes", "the", "<i", ">", "cause<", "/", "i", ">", "of", "this", "throwable", "to", "the", "specified", "value", ".", "(", "The", "cause", "is", "the", "throwable", "that", "caused", "this", "throwable", "to", "get", "thrown", ".", ")" ]
train
https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/dtm/DTMException.java#L114-L128
OpenLiberty/open-liberty
dev/com.ibm.ws.filetransfer.routing.archiveExpander/src/com/ibm/ws/filetransfer/routing/archiveExpander/ArchiveExpander.java
ArchiveExpander.expandArchive
public static boolean expandArchive(String sourcePath, String targetPath) { """ Expand the specified archive to the specified location <p> @param sourcePath path of the archive to be expanded. @param targetPath location to where the archive is to be expanded. <p> @returns true if the archive was successfull...
java
public static boolean expandArchive(String sourcePath, String targetPath) { try { return coreExpandArchive(sourcePath, targetPath); } catch (IOException e) { e.printStackTrace(System.err); return false; } }
[ "public", "static", "boolean", "expandArchive", "(", "String", "sourcePath", ",", "String", "targetPath", ")", "{", "try", "{", "return", "coreExpandArchive", "(", "sourcePath", ",", "targetPath", ")", ";", "}", "catch", "(", "IOException", "e", ")", "{", "e...
Expand the specified archive to the specified location <p> @param sourcePath path of the archive to be expanded. @param targetPath location to where the archive is to be expanded. <p> @returns true if the archive was successfully expanded, false otherwise.
[ "Expand", "the", "specified", "archive", "to", "the", "specified", "location", "<p", ">" ]
train
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.filetransfer.routing.archiveExpander/src/com/ibm/ws/filetransfer/routing/archiveExpander/ArchiveExpander.java#L71-L78
james-hu/jabb-core
src/main/java/net/sf/jabb/util/db/ConnectionUtility.java
ConnectionUtility.createDataSource
public static DataSource createDataSource(String source, String type, String... configs) { """ Create a data source @param source name of the data source, can be anything @param type type of the data source @param configs configurations, normally paths to configuration files @return the newly created data sou...
java
public static DataSource createDataSource(String source, String type, String... configs){ String config = StringUtils.join(configs, " "); return createDataSource(source, type, config); }
[ "public", "static", "DataSource", "createDataSource", "(", "String", "source", ",", "String", "type", ",", "String", "...", "configs", ")", "{", "String", "config", "=", "StringUtils", ".", "join", "(", "configs", ",", "\" \"", ")", ";", "return", "createDat...
Create a data source @param source name of the data source, can be anything @param type type of the data source @param configs configurations, normally paths to configuration files @return the newly created data source
[ "Create", "a", "data", "source" ]
train
https://github.com/james-hu/jabb-core/blob/bceed441595c5e5195a7418795f03b69fa7b61e4/src/main/java/net/sf/jabb/util/db/ConnectionUtility.java#L203-L206
jpush/jmessage-api-java-client
src/main/java/cn/jmessage/api/JMessageClient.java
JMessageClient.addChatRoomMember
public ResponseWrapper addChatRoomMember(long roomId, Members members) throws APIConnectionException, APIRequestException { """ Add members to chat room @param roomId chat room id @param members {@link Members} @return No content @throws APIConnectionException connect exception @throws APIReque...
java
public ResponseWrapper addChatRoomMember(long roomId, Members members) throws APIConnectionException, APIRequestException { return _chatRoomClient.addChatRoomMember(roomId, members); }
[ "public", "ResponseWrapper", "addChatRoomMember", "(", "long", "roomId", ",", "Members", "members", ")", "throws", "APIConnectionException", ",", "APIRequestException", "{", "return", "_chatRoomClient", ".", "addChatRoomMember", "(", "roomId", ",", "members", ")", ";"...
Add members to chat room @param roomId chat room id @param members {@link Members} @return No content @throws APIConnectionException connect exception @throws APIRequestException request exception
[ "Add", "members", "to", "chat", "room" ]
train
https://github.com/jpush/jmessage-api-java-client/blob/767f5fb15e9fe5a546c00f6e68b64f6dd53c617c/src/main/java/cn/jmessage/api/JMessageClient.java#L904-L907
beangle/beangle3
commons/core/src/main/java/org/beangle/commons/lang/Strings.java
Strings.insert
public static String insert(final String str, final String given, final int begin, final int end) { """ replace [bigen,end] [1...end] with givenStr 可以使用StringBuilder的replace方法替换该方法 @param str a {@link java.lang.String} object. @param begin a int. @param end a int. @param given a {@link java.lang.String} obj...
java
public static String insert(final String str, final String given, final int begin, final int end) { if (begin < 1 || end > str.length() || end < begin) { return str; } return str.substring(0, begin - 1) + given + str.substring(end); }
[ "public", "static", "String", "insert", "(", "final", "String", "str", ",", "final", "String", "given", ",", "final", "int", "begin", ",", "final", "int", "end", ")", "{", "if", "(", "begin", "<", "1", "||", "end", ">", "str", ".", "length", "(", "...
replace [bigen,end] [1...end] with givenStr 可以使用StringBuilder的replace方法替换该方法 @param str a {@link java.lang.String} object. @param begin a int. @param end a int. @param given a {@link java.lang.String} object. @return a {@link java.lang.String} object.
[ "replace", "[", "bigen", "end", "]", "[", "1", "...", "end", "]", "with", "givenStr", "可以使用StringBuilder的replace方法替换该方法" ]
train
https://github.com/beangle/beangle3/blob/33df2873a5f38e28ac174a1d3b8144eb2f808e64/commons/core/src/main/java/org/beangle/commons/lang/Strings.java#L256-L259
Netflix/spectator
spectator-api/src/main/java/com/netflix/spectator/impl/AtomicDouble.java
AtomicDouble.compareAndSet
public boolean compareAndSet(double expect, double update) { """ Set the value to {@code amount} if the current value is {@code expect}. Return true if the value was updated. """ long e = Double.doubleToLongBits(expect); long u = Double.doubleToLongBits(update); return value.compareAndSet(e, u); ...
java
public boolean compareAndSet(double expect, double update) { long e = Double.doubleToLongBits(expect); long u = Double.doubleToLongBits(update); return value.compareAndSet(e, u); }
[ "public", "boolean", "compareAndSet", "(", "double", "expect", ",", "double", "update", ")", "{", "long", "e", "=", "Double", ".", "doubleToLongBits", "(", "expect", ")", ";", "long", "u", "=", "Double", ".", "doubleToLongBits", "(", "update", ")", ";", ...
Set the value to {@code amount} if the current value is {@code expect}. Return true if the value was updated.
[ "Set", "the", "value", "to", "{" ]
train
https://github.com/Netflix/spectator/blob/259318252770de3bad581b85adff187d8f2c6537/spectator-api/src/main/java/com/netflix/spectator/impl/AtomicDouble.java#L87-L91
Azure/azure-sdk-for-java
batchai/resource-manager/v2018_03_01/src/main/java/com/microsoft/azure/management/batchai/v2018_03_01/implementation/JobsInner.java
JobsInner.beginDelete
public void beginDelete(String resourceGroupName, String jobName) { """ Deletes the specified Batch AI job. @param resourceGroupName Name of the resource group to which the resource belongs. @param jobName The name of the job within the specified resource group. Job names can only contain a combination of alph...
java
public void beginDelete(String resourceGroupName, String jobName) { beginDeleteWithServiceResponseAsync(resourceGroupName, jobName).toBlocking().single().body(); }
[ "public", "void", "beginDelete", "(", "String", "resourceGroupName", ",", "String", "jobName", ")", "{", "beginDeleteWithServiceResponseAsync", "(", "resourceGroupName", ",", "jobName", ")", ".", "toBlocking", "(", ")", ".", "single", "(", ")", ".", "body", "(",...
Deletes the specified Batch AI job. @param resourceGroupName Name of the resource group to which the resource belongs. @param jobName The name of the job within the specified resource group. Job names can only contain a combination of alphanumeric characters along with dash (-) and underscore (_). The name must be fro...
[ "Deletes", "the", "specified", "Batch", "AI", "job", "." ]
train
https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/batchai/resource-manager/v2018_03_01/src/main/java/com/microsoft/azure/management/batchai/v2018_03_01/implementation/JobsInner.java#L383-L385
aws/aws-sdk-java
aws-java-sdk-api-gateway/src/main/java/com/amazonaws/services/apigateway/model/GetStageResult.java
GetStageResult.withTags
public GetStageResult withTags(java.util.Map<String, String> tags) { """ <p> The collection of tags. Each tag element is associated with a given resource. </p> @param tags The collection of tags. Each tag element is associated with a given resource. @return Returns a reference to this object so that method ...
java
public GetStageResult withTags(java.util.Map<String, String> tags) { setTags(tags); return this; }
[ "public", "GetStageResult", "withTags", "(", "java", ".", "util", ".", "Map", "<", "String", ",", "String", ">", "tags", ")", "{", "setTags", "(", "tags", ")", ";", "return", "this", ";", "}" ]
<p> The collection of tags. Each tag element is associated with a given resource. </p> @param tags The collection of tags. Each tag element is associated with a given resource. @return Returns a reference to this object so that method calls can be chained together.
[ "<p", ">", "The", "collection", "of", "tags", ".", "Each", "tag", "element", "is", "associated", "with", "a", "given", "resource", ".", "<", "/", "p", ">" ]
train
https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-api-gateway/src/main/java/com/amazonaws/services/apigateway/model/GetStageResult.java#L856-L859
alkacon/opencms-core
src-gwt/org/opencms/gwt/client/ui/input/colorpicker/CmsSliderMap.java
CmsSliderMap.setSliderPosition
public void setSliderPosition(float x, float y) { """ Sets the slider's position along the x-axis and y-axis.<p> @param x position along the x-axis [0-256] @param y position along the y-axis [0-256] """ if (x > 255) { x = 255; } if (x < 0) { x = 0; ...
java
public void setSliderPosition(float x, float y) { if (x > 255) { x = 255; } if (x < 0) { x = 0; } if (y > 255) { y = 255; } if (y < 0) { y = 0; } x -= 7; y -= 7; m_sli...
[ "public", "void", "setSliderPosition", "(", "float", "x", ",", "float", "y", ")", "{", "if", "(", "x", ">", "255", ")", "{", "x", "=", "255", ";", "}", "if", "(", "x", "<", "0", ")", "{", "x", "=", "0", ";", "}", "if", "(", "y", ">", "255...
Sets the slider's position along the x-axis and y-axis.<p> @param x position along the x-axis [0-256] @param y position along the y-axis [0-256]
[ "Sets", "the", "slider", "s", "position", "along", "the", "x", "-", "axis", "and", "y", "-", "axis", ".", "<p", ">" ]
train
https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src-gwt/org/opencms/gwt/client/ui/input/colorpicker/CmsSliderMap.java#L229-L247
attribyte/acp
src/main/java/org/attribyte/sql/pool/ConnectionPoolConnection.java
ConnectionPoolConnection.resolveIncompleteTransactions
private void resolveIncompleteTransactions() throws SQLException { """ Attempt to deal with any transaction problems. @throws SQLException on invalid state. """ switch(transactionState) { case COMPLETED: //All we know for certain is that at least one commit/rollback was called. Do ...
java
private void resolveIncompleteTransactions() throws SQLException { switch(transactionState) { case COMPLETED: //All we know for certain is that at least one commit/rollback was called. Do nothing. break; case STARTED: //At least one statement was created with...
[ "private", "void", "resolveIncompleteTransactions", "(", ")", "throws", "SQLException", "{", "switch", "(", "transactionState", ")", "{", "case", "COMPLETED", ":", "//All we know for certain is that at least one commit/rollback was called. Do nothing.", "break", ";", "case", ...
Attempt to deal with any transaction problems. @throws SQLException on invalid state.
[ "Attempt", "to", "deal", "with", "any", "transaction", "problems", "." ]
train
https://github.com/attribyte/acp/blob/dbee6ebb83fda4f19fbbbcb9d0ac2b527e3cb659/src/main/java/org/attribyte/sql/pool/ConnectionPoolConnection.java#L720-L746
deeplearning4j/deeplearning4j
datavec/datavec-spark/src/main/java/org/datavec/spark/transform/AnalyzeSpark.java
AnalyzeSpark.sampleInvalidFromColumnSequence
public static List<Writable> sampleInvalidFromColumnSequence(int numToSample, String columnName, Schema schema, JavaRDD<List<List<Writable>>> data) { """ Randomly sample a set of invalid values from a specified column, for a sequence data set. Values are considered invalid according to the Sch...
java
public static List<Writable> sampleInvalidFromColumnSequence(int numToSample, String columnName, Schema schema, JavaRDD<List<List<Writable>>> data) { JavaRDD<List<Writable>> flattened = data.flatMap(new SequenceFlatMapFunction()); return sampleInvalidFromColumn(numToSample, columnNam...
[ "public", "static", "List", "<", "Writable", ">", "sampleInvalidFromColumnSequence", "(", "int", "numToSample", ",", "String", "columnName", ",", "Schema", "schema", ",", "JavaRDD", "<", "List", "<", "List", "<", "Writable", ">", ">", ">", "data", ")", "{", ...
Randomly sample a set of invalid values from a specified column, for a sequence data set. Values are considered invalid according to the Schema / ColumnMetaData @param numToSample Maximum number of invalid values to sample @param columnName Same of the column from which to sample invalid values @param schema ...
[ "Randomly", "sample", "a", "set", "of", "invalid", "values", "from", "a", "specified", "column", "for", "a", "sequence", "data", "set", ".", "Values", "are", "considered", "invalid", "according", "to", "the", "Schema", "/", "ColumnMetaData" ]
train
https://github.com/deeplearning4j/deeplearning4j/blob/effce52f2afd7eeb53c5bcca699fcd90bd06822f/datavec/datavec-spark/src/main/java/org/datavec/spark/transform/AnalyzeSpark.java#L351-L355
looly/hutool
hutool-core/src/main/java/cn/hutool/core/util/XmlUtil.java
XmlUtil.mapToXml
private static void mapToXml(Document doc, Element element, Map<?, ?> data) { """ 将Map转换为XML格式的字符串 @param doc {@link Document} @param element 节点 @param data Map类型数据 @since 4.0.8 """ Element filedEle; Object key; for (Entry<?, ?> entry : data.entrySet()) { key = entry.getKey(); if (null !...
java
private static void mapToXml(Document doc, Element element, Map<?, ?> data) { Element filedEle; Object key; for (Entry<?, ?> entry : data.entrySet()) { key = entry.getKey(); if (null != key) { // key作为标签名 filedEle = doc.createElement(key.toString()); element.appendChild(filedEle); f...
[ "private", "static", "void", "mapToXml", "(", "Document", "doc", ",", "Element", "element", ",", "Map", "<", "?", ",", "?", ">", "data", ")", "{", "Element", "filedEle", ";", "Object", "key", ";", "for", "(", "Entry", "<", "?", ",", "?", ">", "entr...
将Map转换为XML格式的字符串 @param doc {@link Document} @param element 节点 @param data Map类型数据 @since 4.0.8
[ "将Map转换为XML格式的字符串" ]
train
https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-core/src/main/java/cn/hutool/core/util/XmlUtil.java#L793-L815
nguillaumin/slick2d-maven
slick2d-core/src/main/java/org/newdawn/slick/opengl/ImageIOImageData.java
ImageIOImageData.copyArea
private void copyArea(BufferedImage image, int x, int y, int width, int height, int dx, int dy) { """ Implement of transform copy area for 1.4 @param image The image to copy @param x The x position to copy to @param y The y position to copy to @param width The width of the image @param height The height of ...
java
private void copyArea(BufferedImage image, int x, int y, int width, int height, int dx, int dy) { Graphics2D g = (Graphics2D) image.getGraphics(); g.drawImage(image.getSubimage(x, y, width, height),x+dx,y+dy,null); }
[ "private", "void", "copyArea", "(", "BufferedImage", "image", ",", "int", "x", ",", "int", "y", ",", "int", "width", ",", "int", "height", ",", "int", "dx", ",", "int", "dy", ")", "{", "Graphics2D", "g", "=", "(", "Graphics2D", ")", "image", ".", "...
Implement of transform copy area for 1.4 @param image The image to copy @param x The x position to copy to @param y The y position to copy to @param width The width of the image @param height The height of the image @param dx The transform on the x axis @param dy The transform on the y axis
[ "Implement", "of", "transform", "copy", "area", "for", "1", ".", "4" ]
train
https://github.com/nguillaumin/slick2d-maven/blob/8251f88a0ed6a70e726d2468842455cd1f80893f/slick2d-core/src/main/java/org/newdawn/slick/opengl/ImageIOImageData.java#L232-L236
landawn/AbacusUtil
src/com/landawn/abacus/util/Array.java
Array.bucketSort
static <T extends Comparable<T>> void bucketSort(final List<T> c, final int fromIndex, final int toIndex) { """ Note: All the objects with same value will be replaced with first element with the same value. @param c @param fromIndex @param toIndex """ bucketSort(c, fromIndex, toIndex, null); ...
java
static <T extends Comparable<T>> void bucketSort(final List<T> c, final int fromIndex, final int toIndex) { bucketSort(c, fromIndex, toIndex, null); }
[ "static", "<", "T", "extends", "Comparable", "<", "T", ">", ">", "void", "bucketSort", "(", "final", "List", "<", "T", ">", "c", ",", "final", "int", "fromIndex", ",", "final", "int", "toIndex", ")", "{", "bucketSort", "(", "c", ",", "fromIndex", ","...
Note: All the objects with same value will be replaced with first element with the same value. @param c @param fromIndex @param toIndex
[ "Note", ":", "All", "the", "objects", "with", "same", "value", "will", "be", "replaced", "with", "first", "element", "with", "the", "same", "value", "." ]
train
https://github.com/landawn/AbacusUtil/blob/544b7720175d15e9329f83dd22a8cc5fa4515e12/src/com/landawn/abacus/util/Array.java#L3161-L3163
FlyingHe/UtilsMaven
src/main/java/com/github/flyinghe/tools/MailUtils.java
MailUtils.getSession
public static Session getSession(String host, final String username, final String password) { """ 获取用户与邮件服务器的连接 @param host 邮件主机名 @param username 发件人的用户名 @param password 发件人的用户名密码 @return 返回指定用户与指定邮件服务器绑定的一个连接(会话) """ // 设置配置文件,邮件主机和是否认证 Properties...
java
public static Session getSession(String host, final String username, final String password) { // 设置配置文件,邮件主机和是否认证 Properties property = new Properties(); property.put("mail.host", host); property.put("mail.smtp.auth", "true"); // 设置用户名和密码 ...
[ "public", "static", "Session", "getSession", "(", "String", "host", ",", "final", "String", "username", ",", "final", "String", "password", ")", "{", "// 设置配置文件,邮件主机和是否认证", "Properties", "property", "=", "new", "Properties", "(", ")", ";", "property", ".", "pu...
获取用户与邮件服务器的连接 @param host 邮件主机名 @param username 发件人的用户名 @param password 发件人的用户名密码 @return 返回指定用户与指定邮件服务器绑定的一个连接(会话)
[ "获取用户与邮件服务器的连接" ]
train
https://github.com/FlyingHe/UtilsMaven/blob/d9605b7bfe0c28a05289252e12d163e114080b4a/src/main/java/com/github/flyinghe/tools/MailUtils.java#L34-L50
fhoeben/hsac-fitnesse-fixtures
src/main/java/nl/hsac/fitnesse/fixture/util/HttpClient.java
HttpClient.buildHttpClient
protected static org.apache.http.client.HttpClient buildHttpClient(boolean contentCompression, boolean sslVerification) { """ Builds an apache HttpClient instance @param contentCompression if true, the returned instance will support content compression @return an apache HttpClient instance """ Reques...
java
protected static org.apache.http.client.HttpClient buildHttpClient(boolean contentCompression, boolean sslVerification) { RequestConfig rc = RequestConfig.custom() .setCookieSpec(CookieSpecs.STANDARD) .build(); HttpClientBuilder builder = HttpClients.custom() ...
[ "protected", "static", "org", ".", "apache", ".", "http", ".", "client", ".", "HttpClient", "buildHttpClient", "(", "boolean", "contentCompression", ",", "boolean", "sslVerification", ")", "{", "RequestConfig", "rc", "=", "RequestConfig", ".", "custom", "(", ")"...
Builds an apache HttpClient instance @param contentCompression if true, the returned instance will support content compression @return an apache HttpClient instance
[ "Builds", "an", "apache", "HttpClient", "instance" ]
train
https://github.com/fhoeben/hsac-fitnesse-fixtures/blob/4e9018d7386a9aa65bfcbf07eb28ae064edd1732/src/main/java/nl/hsac/fitnesse/fixture/util/HttpClient.java#L242-L267
pravega/pravega
segmentstore/storage/impl/src/main/java/io/pravega/segmentstore/storage/impl/bookkeeper/Ledgers.java
Ledgers.openFence
static LedgerHandle openFence(long ledgerId, BookKeeper bookKeeper, BookKeeperConfig config) throws DurableDataLogException { """ Opens a ledger. This operation also fences out the ledger in case anyone else was writing to it. @param ledgerId The Id of the Ledger to open. @param bookKeeper A references to th...
java
static LedgerHandle openFence(long ledgerId, BookKeeper bookKeeper, BookKeeperConfig config) throws DurableDataLogException { try { return Exceptions.handleInterruptedCall( () -> bookKeeper.openLedger(ledgerId, LEDGER_DIGEST_TYPE, config.getBKPassword())); } catch (BKExce...
[ "static", "LedgerHandle", "openFence", "(", "long", "ledgerId", ",", "BookKeeper", "bookKeeper", ",", "BookKeeperConfig", "config", ")", "throws", "DurableDataLogException", "{", "try", "{", "return", "Exceptions", ".", "handleInterruptedCall", "(", "(", ")", "->", ...
Opens a ledger. This operation also fences out the ledger in case anyone else was writing to it. @param ledgerId The Id of the Ledger to open. @param bookKeeper A references to the BookKeeper client to use. @param config Configuration to use. @return A LedgerHandle for the newly opened ledger. @throws DurableDat...
[ "Opens", "a", "ledger", ".", "This", "operation", "also", "fences", "out", "the", "ledger", "in", "case", "anyone", "else", "was", "writing", "to", "it", "." ]
train
https://github.com/pravega/pravega/blob/6e24df7470669b3956a07018f52b2c6b3c2a3503/segmentstore/storage/impl/src/main/java/io/pravega/segmentstore/storage/impl/bookkeeper/Ledgers.java#L70-L77
google/j2objc
jre_emul/android/platform/libcore/ojluni/src/main/java/sun/nio/ch/ServerSocketChannelImpl.java
ServerSocketChannelImpl.translateAndSetInterestOps
public void translateAndSetInterestOps(int ops, SelectionKeyImpl sk) { """ Translates an interest operation set into a native poll event set """ int newOps = 0; // Translate ops if ((ops & SelectionKey.OP_ACCEPT) != 0) newOps |= PollArrayWrapper.POLLIN; // Place ops...
java
public void translateAndSetInterestOps(int ops, SelectionKeyImpl sk) { int newOps = 0; // Translate ops if ((ops & SelectionKey.OP_ACCEPT) != 0) newOps |= PollArrayWrapper.POLLIN; // Place ops into pollfd array sk.selector.putEventOps(sk, newOps); }
[ "public", "void", "translateAndSetInterestOps", "(", "int", "ops", ",", "SelectionKeyImpl", "sk", ")", "{", "int", "newOps", "=", "0", ";", "// Translate ops", "if", "(", "(", "ops", "&", "SelectionKey", ".", "OP_ACCEPT", ")", "!=", "0", ")", "newOps", "|=...
Translates an interest operation set into a native poll event set
[ "Translates", "an", "interest", "operation", "set", "into", "a", "native", "poll", "event", "set" ]
train
https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/libcore/ojluni/src/main/java/sun/nio/ch/ServerSocketChannelImpl.java#L347-L355
jamesagnew/hapi-fhir
hapi-fhir-base/src/main/java/ca/uhn/fhir/util/FhirTerser.java
FhirTerser.getValues
public <T> List<T> getValues(IBaseResource theResource, String thePath, Class<T> theWantedClass, boolean theCreate) { """ Returns values stored in an element identified by its path. The list of values is of type <code>theWantedClass</code>. @param theResource The resource instance to be accessed. Must not b...
java
public <T> List<T> getValues(IBaseResource theResource, String thePath, Class<T> theWantedClass, boolean theCreate) { RuntimeResourceDefinition def = myContext.getResourceDefinition(theResource); List<String> parts = parsePath(def, thePath); return getValues(def, theResource, parts, theWantedClass, theCreate, fal...
[ "public", "<", "T", ">", "List", "<", "T", ">", "getValues", "(", "IBaseResource", "theResource", ",", "String", "thePath", ",", "Class", "<", "T", ">", "theWantedClass", ",", "boolean", "theCreate", ")", "{", "RuntimeResourceDefinition", "def", "=", "myCont...
Returns values stored in an element identified by its path. The list of values is of type <code>theWantedClass</code>. @param theResource The resource instance to be accessed. Must not be null. @param thePath The path for the element to be accessed. @param theWantedClass The desired class to be returned in a...
[ "Returns", "values", "stored", "in", "an", "element", "identified", "by", "its", "path", ".", "The", "list", "of", "values", "is", "of", "type", "<code", ">", "theWantedClass<", "/", "code", ">", "." ]
train
https://github.com/jamesagnew/hapi-fhir/blob/150a84d52fe691b7f48fcb28247c4bddb7aec352/hapi-fhir-base/src/main/java/ca/uhn/fhir/util/FhirTerser.java#L549-L553
baidubce/bce-sdk-java
src/main/java/com/baidubce/services/lss/LssClient.java
LssClient.getStreamStatistics
public GetStreamStatisticsResponse getStreamStatistics(GetStreamStatisticsRequest request) { """ get a domain's all streams statistics in the live stream service. @param request The request object containing all options for getting a domain's all streams @return the response """ checkNotNull(reques...
java
public GetStreamStatisticsResponse getStreamStatistics(GetStreamStatisticsRequest request) { checkNotNull(request, "The parameter request should NOT be null."); checkStringNotEmpty(request.getDomain(), "Domain should NOT be null"); checkStringNotEmpty(request.getApp(), "App should NOT be null")...
[ "public", "GetStreamStatisticsResponse", "getStreamStatistics", "(", "GetStreamStatisticsRequest", "request", ")", "{", "checkNotNull", "(", "request", ",", "\"The parameter request should NOT be null.\"", ")", ";", "checkStringNotEmpty", "(", "request", ".", "getDomain", "("...
get a domain's all streams statistics in the live stream service. @param request The request object containing all options for getting a domain's all streams @return the response
[ "get", "a", "domain", "s", "all", "streams", "statistics", "in", "the", "live", "stream", "service", "." ]
train
https://github.com/baidubce/bce-sdk-java/blob/f7140f28dd82121515c88ded7bfe769a37d0ec4a/src/main/java/com/baidubce/services/lss/LssClient.java#L2057-L2077
Waikato/moa
moa/src/main/java/moa/classifiers/lazy/neighboursearch/NormalizableDistance.java
NormalizableDistance.inRanges
public boolean inRanges(Instance instance, double[][] ranges) { """ Test if an instance is within the given ranges. @param instance the instance @param ranges the ranges the instance is tested to be in @return true if instance is within the ranges """ boolean isIn = true; // updateRangesFi...
java
public boolean inRanges(Instance instance, double[][] ranges) { boolean isIn = true; // updateRangesFirst must have been called on ranges for (int j = 0; isIn && (j < ranges.length); j++) { if (!instance.isMissing(j)) { double value = instance.value(j); isIn = value <= ranges[j][R...
[ "public", "boolean", "inRanges", "(", "Instance", "instance", ",", "double", "[", "]", "[", "]", "ranges", ")", "{", "boolean", "isIn", "=", "true", ";", "// updateRangesFirst must have been called on ranges", "for", "(", "int", "j", "=", "0", ";", "isIn", "...
Test if an instance is within the given ranges. @param instance the instance @param ranges the ranges the instance is tested to be in @return true if instance is within the ranges
[ "Test", "if", "an", "instance", "is", "within", "the", "given", "ranges", "." ]
train
https://github.com/Waikato/moa/blob/395982e5100bfe75a3a4d26115462ce2cc74cbb0/moa/src/main/java/moa/classifiers/lazy/neighboursearch/NormalizableDistance.java#L665-L678
infinispan/infinispan
core/src/main/java/org/infinispan/interceptors/locking/AbstractTxLockingInterceptor.java
AbstractTxLockingInterceptor.checkPendingAndLockKey
private KeyAwareLockPromise checkPendingAndLockKey(InvocationContext ctx, Object key, long lockTimeout) throws InterruptedException { """ Besides acquiring a lock, this method also handles the following situation: 1. consistentHash("k") == {A, B}, tx1 prepared on A and B. Then node A crashed (A == single lock ow...
java
private KeyAwareLockPromise checkPendingAndLockKey(InvocationContext ctx, Object key, long lockTimeout) throws InterruptedException { final long remaining = pendingLockManager.awaitPendingTransactionsForKey((TxInvocationContext<?>) ctx, key, ...
[ "private", "KeyAwareLockPromise", "checkPendingAndLockKey", "(", "InvocationContext", "ctx", ",", "Object", "key", ",", "long", "lockTimeout", ")", "throws", "InterruptedException", "{", "final", "long", "remaining", "=", "pendingLockManager", ".", "awaitPendingTransactio...
Besides acquiring a lock, this method also handles the following situation: 1. consistentHash("k") == {A, B}, tx1 prepared on A and B. Then node A crashed (A == single lock owner) 2. at this point tx2 which also writes "k" tries to prepare on B. 3. tx2 has to determine that "k" is already locked by another tx (i.e. tx...
[ "Besides", "acquiring", "a", "lock", "this", "method", "also", "handles", "the", "following", "situation", ":", "1", ".", "consistentHash", "(", "k", ")", "==", "{", "A", "B", "}", "tx1", "prepared", "on", "A", "and", "B", ".", "Then", "node", "A", "...
train
https://github.com/infinispan/infinispan/blob/7c62b94886c3febb4774ae8376acf2baa0265ab5/core/src/main/java/org/infinispan/interceptors/locking/AbstractTxLockingInterceptor.java#L145-L149
google/j2objc
jre_emul/android/platform/external/icu/android_icu4j/src/main/java/android/icu/impl/ICUResourceBundle.java
ICUResourceBundle.getStringWithFallback
public String getStringWithFallback(String path) throws MissingResourceException { """ will throw type mismatch exception if the resource is not a string """ // Optimized form of getWithFallback(path).getString(); ICUResourceBundle actualBundle = this; String result = findStringWithFall...
java
public String getStringWithFallback(String path) throws MissingResourceException { // Optimized form of getWithFallback(path).getString(); ICUResourceBundle actualBundle = this; String result = findStringWithFallback(path, actualBundle, null); if (result == null) { throw new...
[ "public", "String", "getStringWithFallback", "(", "String", "path", ")", "throws", "MissingResourceException", "{", "// Optimized form of getWithFallback(path).getString();", "ICUResourceBundle", "actualBundle", "=", "this", ";", "String", "result", "=", "findStringWithFallback...
will throw type mismatch exception if the resource is not a string
[ "will", "throw", "type", "mismatch", "exception", "if", "the", "resource", "is", "not", "a", "string" ]
train
https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/external/icu/android_icu4j/src/main/java/android/icu/impl/ICUResourceBundle.java#L353-L369
mboudreau/Alternator
src/main/java/com/amazonaws/services/dynamodb/datamodeling/DynamoDBMapper.java
DynamoDBMapper.batchLoad
public Map<String, List<Object>> batchLoad(Map<Class<?>, List<KeyPair>> itemsToGet) { """ Retrieves the attributes for multiple items from multiple tables using their primary keys. {@link AmazonDynamoDB#batchGetItem(BatchGetItemRequest)} API. @see #batchLoad(Map, DynamoDBMapperConfig) """ return b...
java
public Map<String, List<Object>> batchLoad(Map<Class<?>, List<KeyPair>> itemsToGet) { return batchLoad(itemsToGet, this.config); }
[ "public", "Map", "<", "String", ",", "List", "<", "Object", ">", ">", "batchLoad", "(", "Map", "<", "Class", "<", "?", ">", ",", "List", "<", "KeyPair", ">", ">", "itemsToGet", ")", "{", "return", "batchLoad", "(", "itemsToGet", ",", "this", ".", "...
Retrieves the attributes for multiple items from multiple tables using their primary keys. {@link AmazonDynamoDB#batchGetItem(BatchGetItemRequest)} API. @see #batchLoad(Map, DynamoDBMapperConfig)
[ "Retrieves", "the", "attributes", "for", "multiple", "items", "from", "multiple", "tables", "using", "their", "primary", "keys", ".", "{", "@link", "AmazonDynamoDB#batchGetItem", "(", "BatchGetItemRequest", ")", "}", "API", "." ]
train
https://github.com/mboudreau/Alternator/blob/4b230ac843494cb10e46ddc2848f5b5d377d7b72/src/main/java/com/amazonaws/services/dynamodb/datamodeling/DynamoDBMapper.java#L827-L829
GenesysPureEngage/workspace-client-java
src/main/java/com/genesys/internal/workspace/api/ChatApi.java
ChatApi.inviteByQueue
public ApiSuccessResponse inviteByQueue(String id, InviteData1 inviteData) throws ApiException { """ Invite another agent to a chat via a queue Invite another agent to the chat conference by sending an invitation to the specified queue. The next available agent in the queue is then sent an invite to join the chat...
java
public ApiSuccessResponse inviteByQueue(String id, InviteData1 inviteData) throws ApiException { ApiResponse<ApiSuccessResponse> resp = inviteByQueueWithHttpInfo(id, inviteData); return resp.getData(); }
[ "public", "ApiSuccessResponse", "inviteByQueue", "(", "String", "id", ",", "InviteData1", "inviteData", ")", "throws", "ApiException", "{", "ApiResponse", "<", "ApiSuccessResponse", ">", "resp", "=", "inviteByQueueWithHttpInfo", "(", "id", ",", "inviteData", ")", ";...
Invite another agent to a chat via a queue Invite another agent to the chat conference by sending an invitation to the specified queue. The next available agent in the queue is then sent an invite to join the chat. The customer is notified when the invited agent joins the chat. The agents can communicate with the custo...
[ "Invite", "another", "agent", "to", "a", "chat", "via", "a", "queue", "Invite", "another", "agent", "to", "the", "chat", "conference", "by", "sending", "an", "invitation", "to", "the", "specified", "queue", ".", "The", "next", "available", "agent", "in", "...
train
https://github.com/GenesysPureEngage/workspace-client-java/blob/509fdd9e89b9359d012f9a72be95037a3cef53e6/src/main/java/com/genesys/internal/workspace/api/ChatApi.java#L1059-L1062
before/quality-check
modules/quality-check/src/main/java/net/sf/qualitycheck/ConditionalCheck.java
ConditionalCheck.notEmpty
@ArgumentsChecked @Throws( { """ Ensures that a passed map as a parameter of the calling method is not empty. <p> We recommend to use the overloaded method {@link Check#notEmpty(Collection, String)} and pass as second argument the name of the parameter to enhance the exception message. @param condition c...
java
@ArgumentsChecked @Throws({ IllegalNullArgumentException.class, IllegalEmptyArgumentException.class }) public static <T extends Map<?, ?>> void notEmpty(final boolean condition, @Nonnull final T map) { if (condition) { Check.notEmpty(map); } }
[ "@", "ArgumentsChecked", "@", "Throws", "(", "{", "IllegalNullArgumentException", ".", "class", ",", "IllegalEmptyArgumentException", ".", "class", "}", ")", "public", "static", "<", "T", "extends", "Map", "<", "?", ",", "?", ">", ">", "void", "notEmpty", "(...
Ensures that a passed map as a parameter of the calling method is not empty. <p> We recommend to use the overloaded method {@link Check#notEmpty(Collection, String)} and pass as second argument the name of the parameter to enhance the exception message. @param condition condition must be {@code true}^ so that the che...
[ "Ensures", "that", "a", "passed", "map", "as", "a", "parameter", "of", "the", "calling", "method", "is", "not", "empty", "." ]
train
https://github.com/before/quality-check/blob/a75c32c39434ddb1f89bece57acae0536724c15a/modules/quality-check/src/main/java/net/sf/qualitycheck/ConditionalCheck.java#L1258-L1264
jenkinsci/support-core-plugin
src/main/java/com/cloudbees/jenkins/support/util/WordReplacer.java
WordReplacer.replaceWord
public static void replaceWord(StringBuilder input, String word, String replace) { """ Replace all occurrences of word by replace in the input. The replacement happens only if the word to replace is separated from others words, that is, it's not part of a word. The implementation is that the previous and next ch...
java
public static void replaceWord(StringBuilder input, String word, String replace) { replaceWord(input, word, replace, false); }
[ "public", "static", "void", "replaceWord", "(", "StringBuilder", "input", ",", "String", "word", ",", "String", "replace", ")", "{", "replaceWord", "(", "input", ",", "word", ",", "replace", ",", "false", ")", ";", "}" ]
Replace all occurrences of word by replace in the input. The replacement happens only if the word to replace is separated from others words, that is, it's not part of a word. The implementation is that the previous and next characters of the word must be a {@link Character#isLetterOrDigit(char)} char. @param input text...
[ "Replace", "all", "occurrences", "of", "word", "by", "replace", "in", "the", "input", ".", "The", "replacement", "happens", "only", "if", "the", "word", "to", "replace", "is", "separated", "from", "others", "words", "that", "is", "it", "s", "not", "part", ...
train
https://github.com/jenkinsci/support-core-plugin/blob/bcbe1dfd5bf48ac89903645cd48ed897c1a04688/src/main/java/com/cloudbees/jenkins/support/util/WordReplacer.java#L107-L109
wildfly/wildfly-core
patching/src/main/java/org/jboss/as/patching/metadata/ModificationBuilderTarget.java
ModificationBuilderTarget.addModule
public T addModule(final String moduleName, final String slot, final byte[] newHash) { """ Add a module. @param moduleName the module name @param slot the module slot @param newHash the new hash of the added content @return the builder """ final ContentItem item = createModuleItem(moduleName, slo...
java
public T addModule(final String moduleName, final String slot, final byte[] newHash) { final ContentItem item = createModuleItem(moduleName, slot, newHash); addContentModification(createContentModification(item, ModificationType.ADD, NO_CONTENT)); return returnThis(); }
[ "public", "T", "addModule", "(", "final", "String", "moduleName", ",", "final", "String", "slot", ",", "final", "byte", "[", "]", "newHash", ")", "{", "final", "ContentItem", "item", "=", "createModuleItem", "(", "moduleName", ",", "slot", ",", "newHash", ...
Add a module. @param moduleName the module name @param slot the module slot @param newHash the new hash of the added content @return the builder
[ "Add", "a", "module", "." ]
train
https://github.com/wildfly/wildfly-core/blob/cfaf0479dcbb2d320a44c5374b93b944ec39fade/patching/src/main/java/org/jboss/as/patching/metadata/ModificationBuilderTarget.java#L174-L178
google/error-prone-javac
src/jdk.compiler/share/classes/com/sun/source/util/DocTreeScanner.java
DocTreeScanner.visitSerialData
@Override public R visitSerialData(SerialDataTree node, P p) { """ {@inheritDoc} This implementation scans the children in left to right order. @param node {@inheritDoc} @param p {@inheritDoc} @return the result of scanning """ return scan(node.getDescription(), p); }
java
@Override public R visitSerialData(SerialDataTree node, P p) { return scan(node.getDescription(), p); }
[ "@", "Override", "public", "R", "visitSerialData", "(", "SerialDataTree", "node", ",", "P", "p", ")", "{", "return", "scan", "(", "node", ".", "getDescription", "(", ")", ",", "p", ")", ";", "}" ]
{@inheritDoc} This implementation scans the children in left to right order. @param node {@inheritDoc} @param p {@inheritDoc} @return the result of scanning
[ "{", "@inheritDoc", "}", "This", "implementation", "scans", "the", "children", "in", "left", "to", "right", "order", "." ]
train
https://github.com/google/error-prone-javac/blob/a53d069bbdb2c60232ed3811c19b65e41c3e60e0/src/jdk.compiler/share/classes/com/sun/source/util/DocTreeScanner.java#L396-L399
Ordinastie/MalisisCore
src/main/java/net/malisis/core/renderer/icon/Icon.java
Icon.initSprite
@Override public void initSprite(int width, int height, int x, int y, boolean rotated) { """ Called when the part represented by this {@link Icon} is stiched to the texture. Sets most of the icon fields. @param width the width @param height the height @param x the x @param y the y @param rotated the rotate...
java
@Override public void initSprite(int width, int height, int x, int y, boolean rotated) { if (width == 0 || height == 0) { //assume block atlas width = BLOCK_TEXTURE_WIDTH; height = BLOCK_TEXTURE_HEIGHT; } this.sheetWidth = width; this.sheetHeight = height; super.initSprite(width, height, x, y, ro...
[ "@", "Override", "public", "void", "initSprite", "(", "int", "width", ",", "int", "height", ",", "int", "x", ",", "int", "y", ",", "boolean", "rotated", ")", "{", "if", "(", "width", "==", "0", "||", "height", "==", "0", ")", "{", "//assume block atl...
Called when the part represented by this {@link Icon} is stiched to the texture. Sets most of the icon fields. @param width the width @param height the height @param x the x @param y the y @param rotated the rotated
[ "Called", "when", "the", "part", "represented", "by", "this", "{", "@link", "Icon", "}", "is", "stiched", "to", "the", "texture", ".", "Sets", "most", "of", "the", "icon", "fields", "." ]
train
https://github.com/Ordinastie/MalisisCore/blob/4f8e1fa462d5c372fc23414482ba9f429881cc54/src/main/java/net/malisis/core/renderer/icon/Icon.java#L369-L388
Alluxio/alluxio
core/base/src/main/java/alluxio/collections/IndexedSet.java
IndexedSet.getFirstByField
public <V> T getFirstByField(IndexDefinition<T, V> indexDefinition, V value) { """ Gets the object from the set of objects with the specified field value. @param indexDefinition the field index definition @param value the field value @param <V> the field type @return the object or null if there is no such ob...
java
public <V> T getFirstByField(IndexDefinition<T, V> indexDefinition, V value) { FieldIndex<T, V> index = (FieldIndex<T, V>) mIndices.get(indexDefinition); if (index == null) { throw new IllegalStateException("the given index isn't defined for this IndexedSet"); } return index.getFirst(value); }
[ "public", "<", "V", ">", "T", "getFirstByField", "(", "IndexDefinition", "<", "T", ",", "V", ">", "indexDefinition", ",", "V", "value", ")", "{", "FieldIndex", "<", "T", ",", "V", ">", "index", "=", "(", "FieldIndex", "<", "T", ",", "V", ">", ")", ...
Gets the object from the set of objects with the specified field value. @param indexDefinition the field index definition @param value the field value @param <V> the field type @return the object or null if there is no such object
[ "Gets", "the", "object", "from", "the", "set", "of", "objects", "with", "the", "specified", "field", "value", "." ]
train
https://github.com/Alluxio/alluxio/blob/af38cf3ab44613355b18217a3a4d961f8fec3a10/core/base/src/main/java/alluxio/collections/IndexedSet.java#L280-L286
Jasig/uPortal
uPortal-utils/uPortal-utils-core/src/main/java/org/apereo/portal/spring/spel/PortalSpELServiceImpl.java
PortalSpELServiceImpl.getEvaluationContext
protected EvaluationContext getEvaluationContext(WebRequest request) { """ Return a SpEL evaluation context for the supplied web request. @param request @return """ final HttpServletRequest httpRequest = this.portalRequestUtils.getOriginalPortalRequest(request); final IUserI...
java
protected EvaluationContext getEvaluationContext(WebRequest request) { final HttpServletRequest httpRequest = this.portalRequestUtils.getOriginalPortalRequest(request); final IUserInstance userInstance = this.userInstanceManager.getUserInstance(httpRequest); final IPerson person ...
[ "protected", "EvaluationContext", "getEvaluationContext", "(", "WebRequest", "request", ")", "{", "final", "HttpServletRequest", "httpRequest", "=", "this", ".", "portalRequestUtils", ".", "getOriginalPortalRequest", "(", "request", ")", ";", "final", "IUserInstance", "...
Return a SpEL evaluation context for the supplied web request. @param request @return
[ "Return", "a", "SpEL", "evaluation", "context", "for", "the", "supplied", "web", "request", "." ]
train
https://github.com/Jasig/uPortal/blob/c1986542abb9acd214268f2df21c6305ad2f262b/uPortal-utils/uPortal-utils-core/src/main/java/org/apereo/portal/spring/spel/PortalSpELServiceImpl.java#L160-L170
Azure/azure-sdk-for-java
cognitiveservices/data-plane/vision/contentmoderator/src/main/java/com/microsoft/azure/cognitiveservices/vision/contentmoderator/implementation/ListManagementTermsImpl.java
ListManagementTermsImpl.deleteAllTermsAsync
public Observable<String> deleteAllTermsAsync(String listId, String language) { """ Deletes all terms from the list with list Id equal to the list Id passed. @param listId List Id of the image list. @param language Language of the terms. @throws IllegalArgumentException thrown if parameters fail the validatio...
java
public Observable<String> deleteAllTermsAsync(String listId, String language) { return deleteAllTermsWithServiceResponseAsync(listId, language).map(new Func1<ServiceResponse<String>, String>() { @Override public String call(ServiceResponse<String> response) { return respo...
[ "public", "Observable", "<", "String", ">", "deleteAllTermsAsync", "(", "String", "listId", ",", "String", "language", ")", "{", "return", "deleteAllTermsWithServiceResponseAsync", "(", "listId", ",", "language", ")", ".", "map", "(", "new", "Func1", "<", "Servi...
Deletes all terms from the list with list Id equal to the list Id passed. @param listId List Id of the image list. @param language Language of the terms. @throws IllegalArgumentException thrown if parameters fail the validation @return the observable to the String object
[ "Deletes", "all", "terms", "from", "the", "list", "with", "list", "Id", "equal", "to", "the", "list", "Id", "passed", "." ]
train
https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/cognitiveservices/data-plane/vision/contentmoderator/src/main/java/com/microsoft/azure/cognitiveservices/vision/contentmoderator/implementation/ListManagementTermsImpl.java#L473-L480
opendatatrentino/s-match
src/main/java/it/unitn/disi/common/utils/ClassFactory.java
ClassFactory.stringToClasses
public static List<Object> stringToClasses(String str, String separator) { """ Parses a string of class names separated by separator into a list of objects. @param str names of classes @param separator separator characters @return ArrayList of class instances """ ArrayList<Object> tmp = new...
java
public static List<Object> stringToClasses(String str, String separator) { ArrayList<Object> tmp = new ArrayList<Object>(); StringTokenizer stringTokenizer = new StringTokenizer(str, separator); while (stringTokenizer.hasMoreTokens()) { Object obj = getClassForName(stringTokenize...
[ "public", "static", "List", "<", "Object", ">", "stringToClasses", "(", "String", "str", ",", "String", "separator", ")", "{", "ArrayList", "<", "Object", ">", "tmp", "=", "new", "ArrayList", "<", "Object", ">", "(", ")", ";", "StringTokenizer", "stringTok...
Parses a string of class names separated by separator into a list of objects. @param str names of classes @param separator separator characters @return ArrayList of class instances
[ "Parses", "a", "string", "of", "class", "names", "separated", "by", "separator", "into", "a", "list", "of", "objects", "." ]
train
https://github.com/opendatatrentino/s-match/blob/ba5982ef406b7010c2f92592e43887a485935aa1/src/main/java/it/unitn/disi/common/utils/ClassFactory.java#L107-L117
tvesalainen/util
util/src/main/java/org/vesalainen/lang/Primitives.java
Primitives.readLong
public static final long readLong(byte[] array, int offset) { """ Read value from byte array @param array @param offset @return @see java.nio.ByteBuffer#getLong(long) """ if (array.length < offset + 8) { throw new IllegalArgumentException("no room in array"); } ...
java
public static final long readLong(byte[] array, int offset) { if (array.length < offset + 8) { throw new IllegalArgumentException("no room in array"); } return (((long)array[offset]<<56) & 0xff00000000000000L) + (((long)array[offset...
[ "public", "static", "final", "long", "readLong", "(", "byte", "[", "]", "array", ",", "int", "offset", ")", "{", "if", "(", "array", ".", "length", "<", "offset", "+", "8", ")", "{", "throw", "new", "IllegalArgumentException", "(", "\"no room in array\"", ...
Read value from byte array @param array @param offset @return @see java.nio.ByteBuffer#getLong(long)
[ "Read", "value", "from", "byte", "array" ]
train
https://github.com/tvesalainen/util/blob/bba7a44689f638ffabc8be40a75bdc9a33676433/util/src/main/java/org/vesalainen/lang/Primitives.java#L285-L300
kuujo/vertigo
core/src/main/java/net/kuujo/vertigo/Vertigo.java
Vertigo.deployCluster
public Vertigo deployCluster(final String cluster, final String group, int nodes, final Handler<AsyncResult<Cluster>> doneHandler) { """ Deploys multiple cluster nodes to a specific cluster group. @param cluster The cluster event bus address. @param group The cluster group to which to deploy the nodes. @param...
java
public Vertigo deployCluster(final String cluster, final String group, int nodes, final Handler<AsyncResult<Cluster>> doneHandler) { JsonObject config = new JsonObject() .putString("cluster", cluster) .putString("group", group); container.deployVerticle(getClusterMain(), config, nodes, new Handl...
[ "public", "Vertigo", "deployCluster", "(", "final", "String", "cluster", ",", "final", "String", "group", ",", "int", "nodes", ",", "final", "Handler", "<", "AsyncResult", "<", "Cluster", ">", ">", "doneHandler", ")", "{", "JsonObject", "config", "=", "new",...
Deploys multiple cluster nodes to a specific cluster group. @param cluster The cluster event bus address. @param group The cluster group to which to deploy the nodes. @param nodes The number of nodes to deploy. @param doneHandler An asynchronous handler to be called once the cluster has been deployed. The handler will...
[ "Deploys", "multiple", "cluster", "nodes", "to", "a", "specific", "cluster", "group", "." ]
train
https://github.com/kuujo/vertigo/blob/c5869dbc5fff89eb5262e83f7a81719b01a5ba6f/core/src/main/java/net/kuujo/vertigo/Vertigo.java#L275-L290
belaban/JGroups
src/org/jgroups/util/TimeScheduler3.java
TimeScheduler3.scheduleWithDynamicInterval
public Future<?> scheduleWithDynamicInterval(TimeScheduler.Task work, boolean can_block) { """ Schedule a task for execution at varying intervals. After execution, the task will get rescheduled after {@link org.jgroups.util.TimeScheduler.Task#nextInterval()} milliseconds. The task is never done until nextInterva...
java
public Future<?> scheduleWithDynamicInterval(TimeScheduler.Task work, boolean can_block) { return scheduleRecurring(work, TaskType.dynamic, work.nextInterval(), 0, TimeUnit.MILLISECONDS, can_block); }
[ "public", "Future", "<", "?", ">", "scheduleWithDynamicInterval", "(", "TimeScheduler", ".", "Task", "work", ",", "boolean", "can_block", ")", "{", "return", "scheduleRecurring", "(", "work", ",", "TaskType", ".", "dynamic", ",", "work", ".", "nextInterval", "...
Schedule a task for execution at varying intervals. After execution, the task will get rescheduled after {@link org.jgroups.util.TimeScheduler.Task#nextInterval()} milliseconds. The task is never done until nextInterval() returns a value <= 0 or the task is cancelled.<p/> Note that the task is rescheduled relative to t...
[ "Schedule", "a", "task", "for", "execution", "at", "varying", "intervals", ".", "After", "execution", "the", "task", "will", "get", "rescheduled", "after", "{" ]
train
https://github.com/belaban/JGroups/blob/bd3ca786aa57fed41dfbc10a94b1281e388be03b/src/org/jgroups/util/TimeScheduler3.java#L145-L147
undertow-io/undertow
core/src/main/java/io/undertow/server/handlers/proxy/mod_cluster/MCMPHandler.java
MCMPHandler.sendResponse
static void sendResponse(final HttpServerExchange exchange, final String response) { """ Send a simple response string. @param exchange the http server exchange @param response the response string """ exchange.setStatusCode(StatusCodes.OK); exchange.getResponseHeaders().add(Headers.CO...
java
static void sendResponse(final HttpServerExchange exchange, final String response) { exchange.setStatusCode(StatusCodes.OK); exchange.getResponseHeaders().add(Headers.CONTENT_TYPE, CONTENT_TYPE); final Sender sender = exchange.getResponseSender(); UndertowLogger.ROOT_LOGGER.mcmpSendingRe...
[ "static", "void", "sendResponse", "(", "final", "HttpServerExchange", "exchange", ",", "final", "String", "response", ")", "{", "exchange", ".", "setStatusCode", "(", "StatusCodes", ".", "OK", ")", ";", "exchange", ".", "getResponseHeaders", "(", ")", ".", "ad...
Send a simple response string. @param exchange the http server exchange @param response the response string
[ "Send", "a", "simple", "response", "string", "." ]
train
https://github.com/undertow-io/undertow/blob/87de0b856a7a4ba8faf5b659537b9af07b763263/core/src/main/java/io/undertow/server/handlers/proxy/mod_cluster/MCMPHandler.java#L709-L715
undertow-io/undertow
core/src/main/java/io/undertow/server/handlers/proxy/mod_cluster/NodePingUtil.java
NodePingUtil.pingNode
static void pingNode(final Node node, final HttpServerExchange exchange, final PingCallback callback) { """ Try to ping a node using it's connection pool. @param node the node @param exchange the http servers exchange @param callback the ping callback """ if (node == null) { ...
java
static void pingNode(final Node node, final HttpServerExchange exchange, final PingCallback callback) { if (node == null) { callback.failed(); return; } final int timeout = node.getNodeConfig().getPing(); exchange.dispatch(exchange.isInIoThread() ? SameThreadExec...
[ "static", "void", "pingNode", "(", "final", "Node", "node", ",", "final", "HttpServerExchange", "exchange", ",", "final", "PingCallback", "callback", ")", "{", "if", "(", "node", "==", "null", ")", "{", "callback", ".", "failed", "(", ")", ";", "return", ...
Try to ping a node using it's connection pool. @param node the node @param exchange the http servers exchange @param callback the ping callback
[ "Try", "to", "ping", "a", "node", "using", "it", "s", "connection", "pool", "." ]
train
https://github.com/undertow-io/undertow/blob/87de0b856a7a4ba8faf5b659537b9af07b763263/core/src/main/java/io/undertow/server/handlers/proxy/mod_cluster/NodePingUtil.java#L120-L157
lessthanoptimal/BoofCV
main/boofcv-geo/src/main/java/boofcv/alg/geo/PerspectiveOps.java
PerspectiveOps.approximatePinhole
public static CameraPinhole approximatePinhole( Point2Transform2_F64 p2n , int width , int height ) { """ Approximates a pinhole camera using the distoriton model @param p2n Distorted pixel to undistorted normalized image coordinates @return """ Point2D_F64 na = new Point2D_F64(); Point2D_F6...
java
public static CameraPinhole approximatePinhole( Point2Transform2_F64 p2n , int width , int height ) { Point2D_F64 na = new Point2D_F64(); Point2D_F64 nb = new Point2D_F64(); // determine horizontal FOV using dot product of (na.x, na.y, 1 ) and (nb.x, nb.y, 1) p2n.compute(0,height/2,na); p2n.com...
[ "public", "static", "CameraPinhole", "approximatePinhole", "(", "Point2Transform2_F64", "p2n", ",", "int", "width", ",", "int", "height", ")", "{", "Point2D_F64", "na", "=", "new", "Point2D_F64", "(", ")", ";", "Point2D_F64", "nb", "=", "new", "Point2D_F64", "...
Approximates a pinhole camera using the distoriton model @param p2n Distorted pixel to undistorted normalized image coordinates @return
[ "Approximates", "a", "pinhole", "camera", "using", "the", "distoriton", "model" ]
train
https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-geo/src/main/java/boofcv/alg/geo/PerspectiveOps.java#L59-L86
playn/playn
html/src/playn/super/java/nio/ByteBuffer.java
ByteBuffer.put
public ByteBuffer put (byte[] src, int off, int len) { """ Writes bytes in the given byte array, starting from the specified offset, to the current position and increases the position by the number of bytes written. @param src the source byte array. @param off the offset of byte array, must not be negative an...
java
public ByteBuffer put (byte[] src, int off, int len) { int length = src.length; if (off < 0 || len < 0 || off + len > length) { throw new IndexOutOfBoundsException(); } if (len > remaining()) { throw new BufferOverflowException(); } for (int i = 0...
[ "public", "ByteBuffer", "put", "(", "byte", "[", "]", "src", ",", "int", "off", ",", "int", "len", ")", "{", "int", "length", "=", "src", ".", "length", ";", "if", "(", "off", "<", "0", "||", "len", "<", "0", "||", "off", "+", "len", ">", "le...
Writes bytes in the given byte array, starting from the specified offset, to the current position and increases the position by the number of bytes written. @param src the source byte array. @param off the offset of byte array, must not be negative and not greater than {@code src.length}. @param len the number of byte...
[ "Writes", "bytes", "in", "the", "given", "byte", "array", "starting", "from", "the", "specified", "offset", "to", "the", "current", "position", "and", "increases", "the", "position", "by", "the", "number", "of", "bytes", "written", "." ]
train
https://github.com/playn/playn/blob/7e7a9d048ba6afe550dc0cdeaca3e1d5b0d01c66/html/src/playn/super/java/nio/ByteBuffer.java#L629-L643
spring-projects/spring-boot
spring-boot-project/spring-boot-tools/spring-boot-loader-tools/src/main/java/org/springframework/boot/loader/tools/JarWriter.java
JarWriter.writeNestedLibrary
public void writeNestedLibrary(String destination, Library library) throws IOException { """ Write a nested library. @param destination the destination of the library @param library the library @throws IOException if the write fails """ File file = library.getFile(); JarArchiveEntry entry = new JarAr...
java
public void writeNestedLibrary(String destination, Library library) throws IOException { File file = library.getFile(); JarArchiveEntry entry = new JarArchiveEntry(destination + library.getName()); entry.setTime(getNestedLibraryTime(file)); new CrcAndSize(file).setupStoredEntry(entry); writeEntry(entry, ne...
[ "public", "void", "writeNestedLibrary", "(", "String", "destination", ",", "Library", "library", ")", "throws", "IOException", "{", "File", "file", "=", "library", ".", "getFile", "(", ")", ";", "JarArchiveEntry", "entry", "=", "new", "JarArchiveEntry", "(", "...
Write a nested library. @param destination the destination of the library @param library the library @throws IOException if the write fails
[ "Write", "a", "nested", "library", "." ]
train
https://github.com/spring-projects/spring-boot/blob/0b27f7c70e164b2b1a96477f1d9c1acba56790c1/spring-boot-project/spring-boot-tools/spring-boot-loader-tools/src/main/java/org/springframework/boot/loader/tools/JarWriter.java#L179-L187
lucee/Lucee
core/src/main/java/lucee/runtime/type/util/CollectionUtil.java
CollectionUtil.getKeyList
public static String getKeyList(Iterator<Key> it, String delimiter) { """ /* public static String[] toStringArray(Key[] keys) { if(keys==null) return null; String[] arr=new String[keys.length]; for(int i=0;i<keys.length;i++){ arr[i]=keys[i].getString(); } return arr; } """ StringBuilder sb = new StringBuild...
java
public static String getKeyList(Iterator<Key> it, String delimiter) { StringBuilder sb = new StringBuilder(it.next().getString()); if (delimiter.length() == 1) { char c = delimiter.charAt(0); while (it.hasNext()) { sb.append(c); sb.append(it.next().getString()); } } else { while (it.hasNext(...
[ "public", "static", "String", "getKeyList", "(", "Iterator", "<", "Key", ">", "it", ",", "String", "delimiter", ")", "{", "StringBuilder", "sb", "=", "new", "StringBuilder", "(", "it", ".", "next", "(", ")", ".", "getString", "(", ")", ")", ";", "if", ...
/* public static String[] toStringArray(Key[] keys) { if(keys==null) return null; String[] arr=new String[keys.length]; for(int i=0;i<keys.length;i++){ arr[i]=keys[i].getString(); } return arr; }
[ "/", "*", "public", "static", "String", "[]", "toStringArray", "(", "Key", "[]", "keys", ")", "{", "if", "(", "keys", "==", "null", ")", "return", "null", ";", "String", "[]", "arr", "=", "new", "String", "[", "keys", ".", "length", "]", ";", "for"...
train
https://github.com/lucee/Lucee/blob/29b153fc4e126e5edb97da937f2ee2e231b87593/core/src/main/java/lucee/runtime/type/util/CollectionUtil.java#L57-L73
phax/ph-xmldsig
src/main/java/com/helger/xmldsig/keyselect/AbstractKeySelector.java
AbstractKeySelector.algorithmEquals
public static boolean algorithmEquals (@Nonnull final String sAlgURI, @Nonnull final String sAlgName) { """ Checks if a JCA/JCE public key algorithm name is compatible with the specified signature algorithm URI. @param sAlgURI The requested algorithm URI. @param sAlgName The provided algorithm name from a p...
java
public static boolean algorithmEquals (@Nonnull final String sAlgURI, @Nonnull final String sAlgName) { if (sAlgName.equalsIgnoreCase ("DSA")) { return sAlgURI.equalsIgnoreCase (XMLSignature.ALGO_ID_SIGNATURE_DSA) || sAlgURI.equalsIgnoreCase (XMLSignature.ALGO_ID_SIGNATURE_DSA_SHA256); ...
[ "public", "static", "boolean", "algorithmEquals", "(", "@", "Nonnull", "final", "String", "sAlgURI", ",", "@", "Nonnull", "final", "String", "sAlgName", ")", "{", "if", "(", "sAlgName", ".", "equalsIgnoreCase", "(", "\"DSA\"", ")", ")", "{", "return", "sAlgU...
Checks if a JCA/JCE public key algorithm name is compatible with the specified signature algorithm URI. @param sAlgURI The requested algorithm URI. @param sAlgName The provided algorithm name from a public key. @return <code>true</code> if the name matches the URI.
[ "Checks", "if", "a", "JCA", "/", "JCE", "public", "key", "algorithm", "name", "is", "compatible", "with", "the", "specified", "signature", "algorithm", "URI", "." ]
train
https://github.com/phax/ph-xmldsig/blob/c00677fe3dac5aef0f3039b08a03e90052473952/src/main/java/com/helger/xmldsig/keyselect/AbstractKeySelector.java#L47-L87
jmapper-framework/jmapper-core
JMapper Framework/src/main/java/com/googlecode/jmapper/RelationalJMapper.java
RelationalJMapper.oneToMany
public <D> D oneToMany(D destination,final T source) { """ This Method returns the destination given in input enriched with data contained in source given in input<br> with this setting: <table summary =""> <tr> <td><code>NullPointerControl</code></td><td><code>ALL</code></td> </tr><tr> <td><code>MappingType...
java
public <D> D oneToMany(D destination,final T source) { try{ return this.<D,T>getJMapper(relationalOneToManyMapper,destination.getClass()).getDestination(destination,source); } catch (Exception e) { return this.logAndReturnNull(e); } }
[ "public", "<", "D", ">", "D", "oneToMany", "(", "D", "destination", ",", "final", "T", "source", ")", "{", "try", "{", "return", "this", ".", "<", "D", ",", "T", ">", "getJMapper", "(", "relationalOneToManyMapper", ",", "destination", ".", "getClass", ...
This Method returns the destination given in input enriched with data contained in source given in input<br> with this setting: <table summary =""> <tr> <td><code>NullPointerControl</code></td><td><code>ALL</code></td> </tr><tr> <td><code>MappingType</code> of Destination</td><td><code>ALL_FIELDS</code></td> </tr><tr> ...
[ "This", "Method", "returns", "the", "destination", "given", "in", "input", "enriched", "with", "data", "contained", "in", "source", "given", "in", "input<br", ">", "with", "this", "setting", ":", "<table", "summary", "=", ">", "<tr", ">", "<td", ">", "<cod...
train
https://github.com/jmapper-framework/jmapper-core/blob/b48fd3527f35055b8b4a30f53a51136f183acc90/JMapper Framework/src/main/java/com/googlecode/jmapper/RelationalJMapper.java#L580-L583
google/error-prone-javac
src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/builders/SerializedFormBuilder.java
SerializedFormBuilder.buildClassContent
public void buildClassContent(XMLNode node, Content classTree) throws DocletException { """ Build the summaries for the methods and fields. @param node the XML element that specifies which components to document @param classTree content tree to which the documentation will be added @throws DocletException if ...
java
public void buildClassContent(XMLNode node, Content classTree) throws DocletException { Content classContentTree = writer.getClassContentHeader(); buildChildren(node, classContentTree); classTree.addContent(classContentTree); }
[ "public", "void", "buildClassContent", "(", "XMLNode", "node", ",", "Content", "classTree", ")", "throws", "DocletException", "{", "Content", "classContentTree", "=", "writer", ".", "getClassContentHeader", "(", ")", ";", "buildChildren", "(", "node", ",", "classC...
Build the summaries for the methods and fields. @param node the XML element that specifies which components to document @param classTree content tree to which the documentation will be added @throws DocletException if there is a problem while building the documentation
[ "Build", "the", "summaries", "for", "the", "methods", "and", "fields", "." ]
train
https://github.com/google/error-prone-javac/blob/a53d069bbdb2c60232ed3811c19b65e41c3e60e0/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/builders/SerializedFormBuilder.java#L274-L278
Baidu-AIP/java-sdk
src/main/java/com/baidu/aip/imagesearch/AipImageSearch.java
AipImageSearch.similarAddUrl
public JSONObject similarAddUrl(String url, HashMap<String, String> options) { """ 相似图检索—入库接口 **该接口实现单张图片入库,入库时需要同步提交图片及可关联至本地图库的摘要信息(具体变量为brief,具体可传入图片在本地标记id、图片url、图片名称等);同时可提交分类维度信息(具体变量为tags,最多可传入2个tag),方便对图库中的图片进行管理、分类检索。****注:重复添加完全相同的图片会返回错误。** @param url - 图片完整URL,URL长度不超过1024字节,URL对应的图片base64编码后大小不超过4...
java
public JSONObject similarAddUrl(String url, HashMap<String, String> options) { AipRequest request = new AipRequest(); preOperation(request); request.addBody("url", url); if (options != null) { request.addBody(options); } request.setUri(ImageSearchCons...
[ "public", "JSONObject", "similarAddUrl", "(", "String", "url", ",", "HashMap", "<", "String", ",", "String", ">", "options", ")", "{", "AipRequest", "request", "=", "new", "AipRequest", "(", ")", ";", "preOperation", "(", "request", ")", ";", "request", "....
相似图检索—入库接口 **该接口实现单张图片入库,入库时需要同步提交图片及可关联至本地图库的摘要信息(具体变量为brief,具体可传入图片在本地标记id、图片url、图片名称等);同时可提交分类维度信息(具体变量为tags,最多可传入2个tag),方便对图库中的图片进行管理、分类检索。****注:重复添加完全相同的图片会返回错误。** @param url - 图片完整URL,URL长度不超过1024字节,URL对应的图片base64编码后大小不超过4M,最短边至少15px,最长边最大4096px,支持jpg/png/bmp格式,当image字段存在时url字段失效 @param options - 可选参数对象,key: val...
[ "相似图检索—入库接口", "**", "该接口实现单张图片入库,入库时需要同步提交图片及可关联至本地图库的摘要信息(具体变量为brief,具体可传入图片在本地标记id、图片url、图片名称等);同时可提交分类维度信息(具体变量为tags,最多可传入2个tag),方便对图库中的图片进行管理、分类检索。", "****", "注:重复添加完全相同的图片会返回错误。", "**" ]
train
https://github.com/Baidu-AIP/java-sdk/blob/16bb8b7bb8f9bbcb7c8af62d0a67a1e79eecad90/src/main/java/com/baidu/aip/imagesearch/AipImageSearch.java#L415-L426
jbundle/jbundle
thin/base/db/base/src/main/java/org/jbundle/thin/base/db/FieldList.java
FieldList.getRecordResource
public ResourceBundle getRecordResource(Class<?> classResource, Locale locale) { """ Get the record resource bundle. @param classResource @param locale @return """ ClassLoader classLoader = this.getClass().getClassLoader(); ResourceBundle resourceBundle = null; String typicalResource...
java
public ResourceBundle getRecordResource(Class<?> classResource, Locale locale) { ClassLoader classLoader = this.getClass().getClassLoader(); ResourceBundle resourceBundle = null; String typicalResourceClassName = null; try { typicalResourceClassName = Util.convertClassN...
[ "public", "ResourceBundle", "getRecordResource", "(", "Class", "<", "?", ">", "classResource", ",", "Locale", "locale", ")", "{", "ClassLoader", "classLoader", "=", "this", ".", "getClass", "(", ")", ".", "getClassLoader", "(", ")", ";", "ResourceBundle", "res...
Get the record resource bundle. @param classResource @param locale @return
[ "Get", "the", "record", "resource", "bundle", "." ]
train
https://github.com/jbundle/jbundle/blob/4037fcfa85f60c7d0096c453c1a3cd573c2b0abc/thin/base/db/base/src/main/java/org/jbundle/thin/base/db/FieldList.java#L546-L574
landawn/AbacusUtil
src/com/landawn/abacus/util/N.java
N.deleteAll
@SafeVarargs public static <T> T[] deleteAll(final T[] a, int... indices) { """ <p> Removes the elements at the specified positions from the specified array. All remaining elements are shifted to the left. </p> <p> This method returns a new array with the same elements of the input array except those ...
java
@SafeVarargs public static <T> T[] deleteAll(final T[] a, int... indices) { N.checkArgNotNull(a, "a"); if (N.isNullOrEmpty(indices)) { return a.clone(); } else if (indices.length == 1) { return delete(a, indices[0]); } indices = indices.clo...
[ "@", "SafeVarargs", "public", "static", "<", "T", ">", "T", "[", "]", "deleteAll", "(", "final", "T", "[", "]", "a", ",", "int", "...", "indices", ")", "{", "N", ".", "checkArgNotNull", "(", "a", ",", "\"a\"", ")", ";", "if", "(", "N", ".", "is...
<p> Removes the elements at the specified positions from the specified array. All remaining elements are shifted to the left. </p> <p> This method returns a new array with the same elements of the input array except those at the specified positions. The component type of the returned array is always the same as that o...
[ "<p", ">", "Removes", "the", "elements", "at", "the", "specified", "positions", "from", "the", "specified", "array", ".", "All", "remaining", "elements", "are", "shifted", "to", "the", "left", ".", "<", "/", "p", ">" ]
train
https://github.com/landawn/AbacusUtil/blob/544b7720175d15e9329f83dd22a8cc5fa4515e12/src/com/landawn/abacus/util/N.java#L22367-L22380
aws/aws-sdk-java
aws-java-sdk-s3/src/main/java/com/amazonaws/services/s3/model/transform/XmlResponsesSaxParser.java
XmlResponsesSaxParser.parseListVersionsResponse
public ListVersionsHandler parseListVersionsResponse(InputStream inputStream, final boolean shouldSDKDecodeResponse) throws IOException { """ Parses a ListVersions response XML document from an input stream. @param inputStream XML data input stream. @return the XML handler object populated with da...
java
public ListVersionsHandler parseListVersionsResponse(InputStream inputStream, final boolean shouldSDKDecodeResponse) throws IOException { ListVersionsHandler handler = new ListVersionsHandler(shouldSDKDecodeResponse); parseXmlInputStream(handler, sanitizeXmlDocument(handler, inputStream)); ...
[ "public", "ListVersionsHandler", "parseListVersionsResponse", "(", "InputStream", "inputStream", ",", "final", "boolean", "shouldSDKDecodeResponse", ")", "throws", "IOException", "{", "ListVersionsHandler", "handler", "=", "new", "ListVersionsHandler", "(", "shouldSDKDecodeRe...
Parses a ListVersions response XML document from an input stream. @param inputStream XML data input stream. @return the XML handler object populated with data parsed from the XML stream. @throws SdkClientException
[ "Parses", "a", "ListVersions", "response", "XML", "document", "from", "an", "input", "stream", "." ]
train
https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-s3/src/main/java/com/amazonaws/services/s3/model/transform/XmlResponsesSaxParser.java#L353-L358
cubedtear/aritzh
aritzh-core/src/main/java/io/github/aritzhack/aritzh/config/Configuration.java
Configuration.loadConfig
public static Configuration loadConfig(File configFile, boolean compressSpaces) { """ Loads the configuration file, specifying if spaces should be compressed or not ({@code currentLine.replaceAll("\\s+", " ")}) If the config file did not exist, it will be created @param configFile File to read the configur...
java
public static Configuration loadConfig(File configFile, boolean compressSpaces) { if (!configFile.exists()) { return Configuration.newConfig(OneOrOther.<File, Path>ofOne(configFile)); } Configuration config = new Configuration(OneOrOther.<File, Path>ofOne(configFile), compressSpaces); try (BufferedReader r...
[ "public", "static", "Configuration", "loadConfig", "(", "File", "configFile", ",", "boolean", "compressSpaces", ")", "{", "if", "(", "!", "configFile", ".", "exists", "(", ")", ")", "{", "return", "Configuration", ".", "newConfig", "(", "OneOrOther", ".", "<...
Loads the configuration file, specifying if spaces should be compressed or not ({@code currentLine.replaceAll("\\s+", " ")}) If the config file did not exist, it will be created @param configFile File to read the configuration from @param compressSpaces If true subsequent whitespaces will be replaced with a single...
[ "Loads", "the", "configuration", "file", "specifying", "if", "spaces", "should", "be", "compressed", "or", "not", "(", "{", "@code", "currentLine", ".", "replaceAll", "(", "\\\\", "s", "+", ")", "}", ")", "If", "the", "config", "file", "did", "not", "exi...
train
https://github.com/cubedtear/aritzh/blob/bc7493447a1a6088c4a7306ca4d0f0c20278364f/aritzh-core/src/main/java/io/github/aritzhack/aritzh/config/Configuration.java#L80-L94
Azure/azure-sdk-for-java
containerservice/resource-manager/v2017_08_31/src/main/java/com/microsoft/azure/management/containerservice/v2017_08_31/implementation/ManagedClustersInner.java
ManagedClustersInner.getAccessProfiles
public ManagedClusterAccessProfileInner getAccessProfiles(String resourceGroupName, String resourceName, String roleName) { """ Gets access profile of a managed cluster. Gets the accessProfile for the specified role name of the managed cluster with a specified resource group and name. @param resourceGroupName ...
java
public ManagedClusterAccessProfileInner getAccessProfiles(String resourceGroupName, String resourceName, String roleName) { return getAccessProfilesWithServiceResponseAsync(resourceGroupName, resourceName, roleName).toBlocking().single().body(); }
[ "public", "ManagedClusterAccessProfileInner", "getAccessProfiles", "(", "String", "resourceGroupName", ",", "String", "resourceName", ",", "String", "roleName", ")", "{", "return", "getAccessProfilesWithServiceResponseAsync", "(", "resourceGroupName", ",", "resourceName", ","...
Gets access profile of a managed cluster. Gets the accessProfile for the specified role name of the managed cluster with a specified resource group and name. @param resourceGroupName The name of the resource group. @param resourceName The name of the managed cluster resource. @param roleName The name of the role for m...
[ "Gets", "access", "profile", "of", "a", "managed", "cluster", ".", "Gets", "the", "accessProfile", "for", "the", "specified", "role", "name", "of", "the", "managed", "cluster", "with", "a", "specified", "resource", "group", "and", "name", "." ]
train
https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/containerservice/resource-manager/v2017_08_31/src/main/java/com/microsoft/azure/management/containerservice/v2017_08_31/implementation/ManagedClustersInner.java#L447-L449
deeplearning4j/deeplearning4j
datavec/datavec-arrow/src/main/java/org/datavec/arrow/ArrowConverter.java
ArrowConverter.getFieldForColumn
public static Field getFieldForColumn(String name,ColumnType columnType) { """ Create a field given the input {@link ColumnType} and name @param name the name of the field @param columnType the column type to add @return """ switch(columnType) { case Long: return field(name,new ArrowTyp...
java
public static Field getFieldForColumn(String name,ColumnType columnType) { switch(columnType) { case Long: return field(name,new ArrowType.Int(64,false)); case Integer: return field(name,new ArrowType.Int(32,false)); case Double: return field(name,new ArrowType.FloatingPoint(...
[ "public", "static", "Field", "getFieldForColumn", "(", "String", "name", ",", "ColumnType", "columnType", ")", "{", "switch", "(", "columnType", ")", "{", "case", "Long", ":", "return", "field", "(", "name", ",", "new", "ArrowType", ".", "Int", "(", "64", ...
Create a field given the input {@link ColumnType} and name @param name the name of the field @param columnType the column type to add @return
[ "Create", "a", "field", "given", "the", "input", "{" ]
train
https://github.com/deeplearning4j/deeplearning4j/blob/effce52f2afd7eeb53c5bcca699fcd90bd06822f/datavec/datavec-arrow/src/main/java/org/datavec/arrow/ArrowConverter.java#L471-L486
landawn/AbacusUtil
src/com/landawn/abacus/util/N.java
N.copyOfRange
public static float[] copyOfRange(final float[] original, int from, final int to, final int step) { """ Copy all the elements in <code>original</code>, through <code>to</code>-<code>from</code>, by <code>step</code>. @param original @param from @param to @param step @return @see N#copyOfRange(int[], int, i...
java
public static float[] copyOfRange(final float[] original, int from, final int to, final int step) { N.checkFromToIndex(from < to ? from : (to == -1 ? 0 : to), from < to ? to : from, original.length); if (step == 0) { throw new IllegalArgumentException("The input parameter 'by' can not b...
[ "public", "static", "float", "[", "]", "copyOfRange", "(", "final", "float", "[", "]", "original", ",", "int", "from", ",", "final", "int", "to", ",", "final", "int", "step", ")", "{", "N", ".", "checkFromToIndex", "(", "from", "<", "to", "?", "from"...
Copy all the elements in <code>original</code>, through <code>to</code>-<code>from</code>, by <code>step</code>. @param original @param from @param to @param step @return @see N#copyOfRange(int[], int, int, int)
[ "Copy", "all", "the", "elements", "in", "<code", ">", "original<", "/", "code", ">", "through", "<code", ">", "to<", "/", "code", ">", "-", "<code", ">", "from<", "/", "code", ">", "by", "<code", ">", "step<", "/", "code", ">", "." ]
train
https://github.com/landawn/AbacusUtil/blob/544b7720175d15e9329f83dd22a8cc5fa4515e12/src/com/landawn/abacus/util/N.java#L10836-L10860
google/j2objc
jre_emul/android/platform/libcore/ojluni/src/main/java/java/time/chrono/AbstractChronology.java
AbstractChronology.addFieldValue
void addFieldValue(Map<TemporalField, Long> fieldValues, ChronoField field, long value) { """ Adds a field-value pair to the map, checking for conflicts. <p> If the field is not already present, then the field-value pair is added to the map. If the field is already present and it has the same value as that spec...
java
void addFieldValue(Map<TemporalField, Long> fieldValues, ChronoField field, long value) { Long old = fieldValues.get(field); // check first for better error message if (old != null && old.longValue() != value) { throw new DateTimeException("Conflict found: " + field + " " + old + " differs ...
[ "void", "addFieldValue", "(", "Map", "<", "TemporalField", ",", "Long", ">", "fieldValues", ",", "ChronoField", "field", ",", "long", "value", ")", "{", "Long", "old", "=", "fieldValues", ".", "get", "(", "field", ")", ";", "// check first for better error mes...
Adds a field-value pair to the map, checking for conflicts. <p> If the field is not already present, then the field-value pair is added to the map. If the field is already present and it has the same value as that specified, no action occurs. If the field is already present and it has a different value to that specifie...
[ "Adds", "a", "field", "-", "value", "pair", "to", "the", "map", "checking", "for", "conflicts", ".", "<p", ">", "If", "the", "field", "is", "not", "already", "present", "then", "the", "field", "-", "value", "pair", "is", "added", "to", "the", "map", ...
train
https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/libcore/ojluni/src/main/java/java/time/chrono/AbstractChronology.java#L674-L680
liferay/com-liferay-commerce
commerce-service/src/main/java/com/liferay/commerce/service/persistence/impl/CommerceRegionPersistenceImpl.java
CommerceRegionPersistenceImpl.findByCommerceCountryId
@Override public List<CommerceRegion> findByCommerceCountryId( long commerceCountryId, int start, int end) { """ Returns a range of all the commerce regions where commerceCountryId = &#63;. <p> Useful when paginating results. Returns a maximum of <code>end - start</code> instances. <code>start</code> and <c...
java
@Override public List<CommerceRegion> findByCommerceCountryId( long commerceCountryId, int start, int end) { return findByCommerceCountryId(commerceCountryId, start, end, null); }
[ "@", "Override", "public", "List", "<", "CommerceRegion", ">", "findByCommerceCountryId", "(", "long", "commerceCountryId", ",", "int", "start", ",", "int", "end", ")", "{", "return", "findByCommerceCountryId", "(", "commerceCountryId", ",", "start", ",", "end", ...
Returns a range of all the commerce regions where commerceCountryId = &#63;. <p> Useful when paginating results. Returns a maximum of <code>end - start</code> instances. <code>start</code> and <code>end</code> are not primary keys, they are indexes in the result set. Thus, <code>0</code> refers to the first result in ...
[ "Returns", "a", "range", "of", "all", "the", "commerce", "regions", "where", "commerceCountryId", "=", "&#63", ";", "." ]
train
https://github.com/liferay/com-liferay-commerce/blob/9e54362d7f59531fc684016ba49ee7cdc3a2f22b/commerce-service/src/main/java/com/liferay/commerce/service/persistence/impl/CommerceRegionPersistenceImpl.java#L1531-L1535
westnordost/osmapi
src/main/java/de/westnordost/osmapi/traces/GpsTracesDao.java
GpsTracesDao.getAll
public void getAll(BoundingBox bounds, Handler<GpsTrackpoint> handler, int page) { """ Get all the trackpoints in the given bounding box. As of April 2016, trackpoints returned by the method will only have a position and (sometimes) a time set. @param page since there are loads and loads of traces, the method ...
java
public void getAll(BoundingBox bounds, Handler<GpsTrackpoint> handler, int page) { if(page < 0) throw new IllegalArgumentException("Page number must be greater than or equal to 0"); String query = "trackpoints?bbox="+bounds.getAsLeftBottomRightTopString() + "&page=" + page; try { osm.makeReque...
[ "public", "void", "getAll", "(", "BoundingBox", "bounds", ",", "Handler", "<", "GpsTrackpoint", ">", "handler", ",", "int", "page", ")", "{", "if", "(", "page", "<", "0", ")", "throw", "new", "IllegalArgumentException", "(", "\"Page number must be greater than o...
Get all the trackpoints in the given bounding box. As of April 2016, trackpoints returned by the method will only have a position and (sometimes) a time set. @param page since there are loads and loads of traces, the method will only return a certain number of trackpoints per page (see Capabilities.maxPointsInGpsTrace...
[ "Get", "all", "the", "trackpoints", "in", "the", "given", "bounding", "box", ".", "As", "of", "April", "2016", "trackpoints", "returned", "by", "the", "method", "will", "only", "have", "a", "position", "and", "(", "sometimes", ")", "a", "time", "set", "....
train
https://github.com/westnordost/osmapi/blob/dda6978fd12e117d0cf17812bc22037f61e22c4b/src/main/java/de/westnordost/osmapi/traces/GpsTracesDao.java#L215-L231