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
jMotif/SAX
src/main/java/net/seninp/jmotif/sax/bitmap/Shingles.java
Shingles.addShingledSeries
public void addShingledSeries(String key, Map<String, Integer> shingledSeries) { """ Adds a shingled series assuring the proper index. @param key the timeseries key (i.e., label). @param shingledSeries a shingled timeseries in a map of &lt;shingle, index&gt; entries. """ // allocate the weights array c...
java
public void addShingledSeries(String key, Map<String, Integer> shingledSeries) { // allocate the weights array corresponding to the time series int[] counts = new int[this.indexTable.size()]; // fill in the counts for (String str : shingledSeries.keySet()) { Integer idx = this.indexTable.get(str);...
[ "public", "void", "addShingledSeries", "(", "String", "key", ",", "Map", "<", "String", ",", "Integer", ">", "shingledSeries", ")", "{", "// allocate the weights array corresponding to the time series", "int", "[", "]", "counts", "=", "new", "int", "[", "this", "....
Adds a shingled series assuring the proper index. @param key the timeseries key (i.e., label). @param shingledSeries a shingled timeseries in a map of &lt;shingle, index&gt; entries.
[ "Adds", "a", "shingled", "series", "assuring", "the", "proper", "index", "." ]
train
https://github.com/jMotif/SAX/blob/39ee07a69facaa330def5130b8790aeda85f1061/src/main/java/net/seninp/jmotif/sax/bitmap/Shingles.java#L75-L87
apache/incubator-gobblin
gobblin-utility/src/main/java/org/apache/gobblin/broker/SharedResourcesBrokerUtils.java
SharedResourcesBrokerUtils.isScopeTypeAncestor
public static <S extends ScopeType<S>> boolean isScopeTypeAncestor(S scopeType, S possibleAncestor) { """ Determine if a {@link ScopeType} is an ancestor of another {@link ScopeType}. """ Queue<S> ancestors = new LinkedList<>(); ancestors.add(scopeType); while (true) { if (ancestors.isEmpty()...
java
public static <S extends ScopeType<S>> boolean isScopeTypeAncestor(S scopeType, S possibleAncestor) { Queue<S> ancestors = new LinkedList<>(); ancestors.add(scopeType); while (true) { if (ancestors.isEmpty()) { return false; } if (ancestors.peek().equals(possibleAncestor)) { ...
[ "public", "static", "<", "S", "extends", "ScopeType", "<", "S", ">", ">", "boolean", "isScopeTypeAncestor", "(", "S", "scopeType", ",", "S", "possibleAncestor", ")", "{", "Queue", "<", "S", ">", "ancestors", "=", "new", "LinkedList", "<>", "(", ")", ";",...
Determine if a {@link ScopeType} is an ancestor of another {@link ScopeType}.
[ "Determine", "if", "a", "{" ]
train
https://github.com/apache/incubator-gobblin/blob/f029b4c0fea0fe4aa62f36dda2512344ff708bae/gobblin-utility/src/main/java/org/apache/gobblin/broker/SharedResourcesBrokerUtils.java#L41-L56
denisneuling/apitrary.jar
apitrary-orm/apitrary-orm-core/src/main/java/com/apitrary/orm/core/unmarshalling/JsonResponseConsumer.java
JsonResponseConsumer.onInt
protected void onInt(Integer val, String fieldName, JsonParser jp) { """ <p> onInt. </p> @param val a {@link java.lang.Integer} object. @param fieldName a {@link java.lang.String} object. @param jp a {@link org.codehaus.jackson.JsonParser} object. """ log.trace(fieldName + " " + val); }
java
protected void onInt(Integer val, String fieldName, JsonParser jp) { log.trace(fieldName + " " + val); }
[ "protected", "void", "onInt", "(", "Integer", "val", ",", "String", "fieldName", ",", "JsonParser", "jp", ")", "{", "log", ".", "trace", "(", "fieldName", "+", "\" \"", "+", "val", ")", ";", "}" ]
<p> onInt. </p> @param val a {@link java.lang.Integer} object. @param fieldName a {@link java.lang.String} object. @param jp a {@link org.codehaus.jackson.JsonParser} object.
[ "<p", ">", "onInt", ".", "<", "/", "p", ">" ]
train
https://github.com/denisneuling/apitrary.jar/blob/b7f639a1e735c60ba2b1b62851926757f5de8628/apitrary-orm/apitrary-orm-core/src/main/java/com/apitrary/orm/core/unmarshalling/JsonResponseConsumer.java#L234-L236
buschmais/extended-objects
impl/src/main/java/com/buschmais/xo/impl/AbstractInstanceManager.java
AbstractInstanceManager.createInstance
public <T> T createInstance(DatastoreType datastoreType, DynamicType<?> types) { """ Return the proxy instance which corresponds to the given datastore type for writing. @param datastoreType The datastore type. @param types The {@link DynamicType}. @param <T> The instance type. @return The instance. ...
java
public <T> T createInstance(DatastoreType datastoreType, DynamicType<?> types) { return newInstance(getDatastoreId(datastoreType), datastoreType, types, TransactionalCache.Mode.WRITE); }
[ "public", "<", "T", ">", "T", "createInstance", "(", "DatastoreType", "datastoreType", ",", "DynamicType", "<", "?", ">", "types", ")", "{", "return", "newInstance", "(", "getDatastoreId", "(", "datastoreType", ")", ",", "datastoreType", ",", "types", ",", "...
Return the proxy instance which corresponds to the given datastore type for writing. @param datastoreType The datastore type. @param types The {@link DynamicType}. @param <T> The instance type. @return The instance.
[ "Return", "the", "proxy", "instance", "which", "corresponds", "to", "the", "given", "datastore", "type", "for", "writing", "." ]
train
https://github.com/buschmais/extended-objects/blob/186431e81f3d8d26c511cfe1143dee59b03c2e7a/impl/src/main/java/com/buschmais/xo/impl/AbstractInstanceManager.java#L71-L73
PeterisP/LVTagger
src/main/java/edu/stanford/nlp/stats/Counters.java
Counters.toVerticalString
public static <E> String toVerticalString(Counter<E> c, int k, String fmt, boolean swap) { """ Returns a <code>String</code> representation of the <code>k</code> keys with the largest counts in the given {@link Counter}, using the given format string. @param c a Counter @param k how many keys to print @pa...
java
public static <E> String toVerticalString(Counter<E> c, int k, String fmt, boolean swap) { PriorityQueue<E> q = Counters.toPriorityQueue(c); List<E> sortedKeys = q.toSortedList(); StringBuilder sb = new StringBuilder(); int i = 0; for (Iterator<E> keyI = sortedKeys.iterator(); keyI.hasNext() &&...
[ "public", "static", "<", "E", ">", "String", "toVerticalString", "(", "Counter", "<", "E", ">", "c", ",", "int", "k", ",", "String", "fmt", ",", "boolean", "swap", ")", "{", "PriorityQueue", "<", "E", ">", "q", "=", "Counters", ".", "toPriorityQueue", ...
Returns a <code>String</code> representation of the <code>k</code> keys with the largest counts in the given {@link Counter}, using the given format string. @param c a Counter @param k how many keys to print @param fmt a format string, such as "%.0f\t%s" (do not include final "%n") @param swap whether the count should...
[ "Returns", "a", "<code", ">", "String<", "/", "code", ">", "representation", "of", "the", "<code", ">", "k<", "/", "code", ">", "keys", "with", "the", "largest", "counts", "in", "the", "given", "{", "@link", "Counter", "}", "using", "the", "given", "fo...
train
https://github.com/PeterisP/LVTagger/blob/b3d44bab9ec07ace0d13612c448a6b7298c1f681/src/main/java/edu/stanford/nlp/stats/Counters.java#L1942-L1960
aws/aws-sdk-java
aws-java-sdk-apigatewayv2/src/main/java/com/amazonaws/services/apigatewayv2/model/CreateIntegrationResult.java
CreateIntegrationResult.withRequestTemplates
public CreateIntegrationResult withRequestTemplates(java.util.Map<String, String> requestTemplates) { """ <p> Represents a map of Velocity templates that are applied on the request payload based on the value of the Content-Type header sent by the client. The content type value is the key in this map, and the tem...
java
public CreateIntegrationResult withRequestTemplates(java.util.Map<String, String> requestTemplates) { setRequestTemplates(requestTemplates); return this; }
[ "public", "CreateIntegrationResult", "withRequestTemplates", "(", "java", ".", "util", ".", "Map", "<", "String", ",", "String", ">", "requestTemplates", ")", "{", "setRequestTemplates", "(", "requestTemplates", ")", ";", "return", "this", ";", "}" ]
<p> Represents a map of Velocity templates that are applied on the request payload based on the value of the Content-Type header sent by the client. The content type value is the key in this map, and the template (as a String) is the value. </p> @param requestTemplates Represents a map of Velocity templates that are a...
[ "<p", ">", "Represents", "a", "map", "of", "Velocity", "templates", "that", "are", "applied", "on", "the", "request", "payload", "based", "on", "the", "value", "of", "the", "Content", "-", "Type", "header", "sent", "by", "the", "client", ".", "The", "con...
train
https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-apigatewayv2/src/main/java/com/amazonaws/services/apigatewayv2/model/CreateIntegrationResult.java#L1219-L1222
exoplatform/jcr
exo.jcr.ext.services/src/main/java/org/exoplatform/services/jcr/ext/artifact/CRCGenerator.java
CRCGenerator.getChecksum
public static String getChecksum(InputStream in, String algo) throws NoSuchAlgorithmException, IOException { """ Generates checksum for the InputStream. @param in stream to generate CheckSum @param algo algorithm name according to the {@literal ...
java
public static String getChecksum(InputStream in, String algo) throws NoSuchAlgorithmException, IOException { MessageDigest md = MessageDigest.getInstance(algo); DigestInputStream digestInputStream = new DigestInputStream(in, md); digestInputSt...
[ "public", "static", "String", "getChecksum", "(", "InputStream", "in", ",", "String", "algo", ")", "throws", "NoSuchAlgorithmException", ",", "IOException", "{", "MessageDigest", "md", "=", "MessageDigest", ".", "getInstance", "(", "algo", ")", ";", "DigestInputSt...
Generates checksum for the InputStream. @param in stream to generate CheckSum @param algo algorithm name according to the {@literal <a href= "http://java.sun.com/j2se/1.4.2/docs/guide/security/CryptoSpec.html#AppA"> Java Cryptography Architecture API Specification & Reference </a> } @return hexadecimal string checksun...
[ "Generates", "checksum", "for", "the", "InputStream", "." ]
train
https://github.com/exoplatform/jcr/blob/3e7f9ee1b5683640d73a4316fb4b0ad5eac5b8a2/exo.jcr.ext.services/src/main/java/org/exoplatform/services/jcr/ext/artifact/CRCGenerator.java#L52-L66
adorsys/hbci4java-adorsys
src/main/java/org/kapott/hbci/GV/parsers/ParseCamt05200103.java
ParseCamt05200103.checkDebit
private BigDecimal checkDebit(BigDecimal d, CreditDebitCode code) { """ Prueft, ob es sich um einen Soll-Betrag handelt und setzt in dem Fall ein negatives Vorzeichen vor den Wert. @param d die zu pruefende Zahl. @param code das Soll-/Haben-Kennzeichen. @return der ggf korrigierte Betrag. """ i...
java
private BigDecimal checkDebit(BigDecimal d, CreditDebitCode code) { if (d == null || code == null || code == CreditDebitCode.CRDT) return d; return BigDecimal.ZERO.subtract(d); }
[ "private", "BigDecimal", "checkDebit", "(", "BigDecimal", "d", ",", "CreditDebitCode", "code", ")", "{", "if", "(", "d", "==", "null", "||", "code", "==", "null", "||", "code", "==", "CreditDebitCode", ".", "CRDT", ")", "return", "d", ";", "return", "Big...
Prueft, ob es sich um einen Soll-Betrag handelt und setzt in dem Fall ein negatives Vorzeichen vor den Wert. @param d die zu pruefende Zahl. @param code das Soll-/Haben-Kennzeichen. @return der ggf korrigierte Betrag.
[ "Prueft", "ob", "es", "sich", "um", "einen", "Soll", "-", "Betrag", "handelt", "und", "setzt", "in", "dem", "Fall", "ein", "negatives", "Vorzeichen", "vor", "den", "Wert", "." ]
train
https://github.com/adorsys/hbci4java-adorsys/blob/5e24f7e429d6b555e1d993196b4cf1adda6433cf/src/main/java/org/kapott/hbci/GV/parsers/ParseCamt05200103.java#L299-L304
PeterisP/LVTagger
src/main/java/edu/stanford/nlp/util/StringUtils.java
StringUtils.stringToProperties
public static Properties stringToProperties(String str, Properties props) { """ This method updates a Properties object based on a comma-separated String (with whitespace optionally allowed after the comma) representing properties to a Properties object. Each property is "property=value". The value for prope...
java
public static Properties stringToProperties(String str, Properties props) { String[] propsStr = str.trim().split(",\\s*"); for (String term : propsStr) { int divLoc = term.indexOf('='); String key; String value; if (divLoc >= 0) { key = term.substring(0, divLoc).trim(); ...
[ "public", "static", "Properties", "stringToProperties", "(", "String", "str", ",", "Properties", "props", ")", "{", "String", "[", "]", "propsStr", "=", "str", ".", "trim", "(", ")", ".", "split", "(", "\",\\\\s*\"", ")", ";", "for", "(", "String", "term...
This method updates a Properties object based on a comma-separated String (with whitespace optionally allowed after the comma) representing properties to a Properties object. Each property is "property=value". The value for properties without an explicitly given value is set to "true".
[ "This", "method", "updates", "a", "Properties", "object", "based", "on", "a", "comma", "-", "separated", "String", "(", "with", "whitespace", "optionally", "allowed", "after", "the", "comma", ")", "representing", "properties", "to", "a", "Properties", "object", ...
train
https://github.com/PeterisP/LVTagger/blob/b3d44bab9ec07ace0d13612c448a6b7298c1f681/src/main/java/edu/stanford/nlp/util/StringUtils.java#L839-L855
box/box-java-sdk
src/main/java/com/box/sdk/BoxTrash.java
BoxTrash.deleteFolder
public void deleteFolder(String folderID) { """ Permanently deletes a trashed folder. @param folderID the ID of the trashed folder to permanently delete. """ URL url = FOLDER_INFO_URL_TEMPLATE.build(this.api.getBaseURL(), folderID); BoxAPIRequest request = new BoxAPIRequest(this.api, url, "DEL...
java
public void deleteFolder(String folderID) { URL url = FOLDER_INFO_URL_TEMPLATE.build(this.api.getBaseURL(), folderID); BoxAPIRequest request = new BoxAPIRequest(this.api, url, "DELETE"); BoxAPIResponse response = request.send(); response.disconnect(); }
[ "public", "void", "deleteFolder", "(", "String", "folderID", ")", "{", "URL", "url", "=", "FOLDER_INFO_URL_TEMPLATE", ".", "build", "(", "this", ".", "api", ".", "getBaseURL", "(", ")", ",", "folderID", ")", ";", "BoxAPIRequest", "request", "=", "new", "Bo...
Permanently deletes a trashed folder. @param folderID the ID of the trashed folder to permanently delete.
[ "Permanently", "deletes", "a", "trashed", "folder", "." ]
train
https://github.com/box/box-java-sdk/blob/35b4ba69417f9d6a002c19dfaab57527750ef349/src/main/java/com/box/sdk/BoxTrash.java#L53-L58
OpenLiberty/open-liberty
dev/com.ibm.ws.security.common/src/com/ibm/ws/security/common/config/CommonConfigUtils.java
CommonConfigUtils.getConfigAttribute
public String getConfigAttribute(Map<String, Object> props, String key) { """ Returns the value for the configuration attribute matching the key provided. If the value does not exist or is empty, the resulting value will be {@code null}. """ return getConfigAttributeWithDefaultValue(props, key, null);...
java
public String getConfigAttribute(Map<String, Object> props, String key) { return getConfigAttributeWithDefaultValue(props, key, null); }
[ "public", "String", "getConfigAttribute", "(", "Map", "<", "String", ",", "Object", ">", "props", ",", "String", "key", ")", "{", "return", "getConfigAttributeWithDefaultValue", "(", "props", ",", "key", ",", "null", ")", ";", "}" ]
Returns the value for the configuration attribute matching the key provided. If the value does not exist or is empty, the resulting value will be {@code null}.
[ "Returns", "the", "value", "for", "the", "configuration", "attribute", "matching", "the", "key", "provided", ".", "If", "the", "value", "does", "not", "exist", "or", "is", "empty", "the", "resulting", "value", "will", "be", "{" ]
train
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.security.common/src/com/ibm/ws/security/common/config/CommonConfigUtils.java#L30-L32
UrielCh/ovh-java-sdk
ovh-java-sdk-overTheBox/src/main/java/net/minidev/ovh/api/ApiOvhOverTheBox.java
ApiOvhOverTheBox.serviceName_migration_offers_GET
public ArrayList<OvhAvailableMigrationOffer> serviceName_migration_offers_GET(String serviceName) throws IOException { """ List all available offers one can migrate to REST: GET /overTheBox/{serviceName}/migration/offers @param serviceName [required] The internal name of your overTheBox offer API beta "...
java
public ArrayList<OvhAvailableMigrationOffer> serviceName_migration_offers_GET(String serviceName) throws IOException { String qPath = "/overTheBox/{serviceName}/migration/offers"; StringBuilder sb = path(qPath, serviceName); String resp = exec(qPath, "GET", sb.toString(), null); return convertTo(resp, t5); }
[ "public", "ArrayList", "<", "OvhAvailableMigrationOffer", ">", "serviceName_migration_offers_GET", "(", "String", "serviceName", ")", "throws", "IOException", "{", "String", "qPath", "=", "\"/overTheBox/{serviceName}/migration/offers\"", ";", "StringBuilder", "sb", "=", "pa...
List all available offers one can migrate to REST: GET /overTheBox/{serviceName}/migration/offers @param serviceName [required] The internal name of your overTheBox offer API beta
[ "List", "all", "available", "offers", "one", "can", "migrate", "to" ]
train
https://github.com/UrielCh/ovh-java-sdk/blob/6d531a40e56e09701943e334c25f90f640c55701/ovh-java-sdk-overTheBox/src/main/java/net/minidev/ovh/api/ApiOvhOverTheBox.java#L363-L368
google/closure-compiler
src/com/google/javascript/jscomp/RewritePolyfills.java
RewritePolyfills.removeUnneededPolyfills
private void removeUnneededPolyfills(Node parent, Node runtimeEnd) { """ that already contains the library) is the same or lower than languageOut. """ Node node = parent.getFirstChild(); while (node != null && node != runtimeEnd) { Node next = node.getNext(); if (NodeUtil.isExprCall(node)) ...
java
private void removeUnneededPolyfills(Node parent, Node runtimeEnd) { Node node = parent.getFirstChild(); while (node != null && node != runtimeEnd) { Node next = node.getNext(); if (NodeUtil.isExprCall(node)) { Node call = node.getFirstChild(); Node name = call.getFirstChild(); ...
[ "private", "void", "removeUnneededPolyfills", "(", "Node", "parent", ",", "Node", "runtimeEnd", ")", "{", "Node", "node", "=", "parent", ".", "getFirstChild", "(", ")", ";", "while", "(", "node", "!=", "null", "&&", "node", "!=", "runtimeEnd", ")", "{", ...
that already contains the library) is the same or lower than languageOut.
[ "that", "already", "contains", "the", "library", ")", "is", "the", "same", "or", "lower", "than", "languageOut", "." ]
train
https://github.com/google/closure-compiler/blob/d81e36740f6a9e8ac31a825ee8758182e1dc5aae/src/com/google/javascript/jscomp/RewritePolyfills.java#L188-L205
micronaut-projects/micronaut-core
aop/src/main/java/io/micronaut/aop/chain/InterceptorChain.java
InterceptorChain.resolveAroundInterceptors
@Internal public static Interceptor[] resolveAroundInterceptors(BeanContext beanContext, ExecutableMethod<?, ?> method, Interceptor... interceptors) { """ Resolves the {@link Around} interceptors for a method. @param beanContext bean context passed in @param method The method @param interceptors The array...
java
@Internal public static Interceptor[] resolveAroundInterceptors(BeanContext beanContext, ExecutableMethod<?, ?> method, Interceptor... interceptors) { instrumentAnnotationMetadata(beanContext, method); return resolveInterceptorsInternal(method, Around.class, interceptors); }
[ "@", "Internal", "public", "static", "Interceptor", "[", "]", "resolveAroundInterceptors", "(", "BeanContext", "beanContext", ",", "ExecutableMethod", "<", "?", ",", "?", ">", "method", ",", "Interceptor", "...", "interceptors", ")", "{", "instrumentAnnotationMetada...
Resolves the {@link Around} interceptors for a method. @param beanContext bean context passed in @param method The method @param interceptors The array of interceptors @return The filtered array of interceptors
[ "Resolves", "the", "{", "@link", "Around", "}", "interceptors", "for", "a", "method", "." ]
train
https://github.com/micronaut-projects/micronaut-core/blob/c31f5b03ce0eb88c2f6470710987db03b8967d5c/aop/src/main/java/io/micronaut/aop/chain/InterceptorChain.java#L170-L174
TheHortonMachine/hortonmachine
gears/src/main/java/org/hortonmachine/gears/io/grasslegacy/utils/Format.java
Format.atol
public static long atol( String s ) { """ Converts a string of digits (decimal, octal or hex) to a long integer @param s a string @return the numeric value of the prefix of s representing a base 10 integer """ int i = 0; while( i < s.length() && Character.isWhitespace(s.charAt(i)) ...
java
public static long atol( String s ) { int i = 0; while( i < s.length() && Character.isWhitespace(s.charAt(i)) ) { i++; } if (i < s.length() && s.charAt(i) == '0') { if (i + 1 < s.length() && (s.charAt(i + 1) == 'x' || s.charAt(i + 1) == 'X')) { re...
[ "public", "static", "long", "atol", "(", "String", "s", ")", "{", "int", "i", "=", "0", ";", "while", "(", "i", "<", "s", ".", "length", "(", ")", "&&", "Character", ".", "isWhitespace", "(", "s", ".", "charAt", "(", "i", ")", ")", ")", "{", ...
Converts a string of digits (decimal, octal or hex) to a long integer @param s a string @return the numeric value of the prefix of s representing a base 10 integer
[ "Converts", "a", "string", "of", "digits", "(", "decimal", "octal", "or", "hex", ")", "to", "a", "long", "integer" ]
train
https://github.com/TheHortonMachine/hortonmachine/blob/d2b436bbdf951dc1fda56096a42dbc0eae4d35a5/gears/src/main/java/org/hortonmachine/gears/io/grasslegacy/utils/Format.java#L699-L714
lievendoclo/Valkyrie-RCP
valkyrie-rcp-core/src/main/java/org/valkyriercp/layout/GridBagLayoutBuilder.java
GridBagLayoutBuilder.appendLabel
public GridBagLayoutBuilder appendLabel(JLabel label, int colSpan) { """ Appends the given label to the end of the current line. The label does not "grow." @param label the label to append @param colSpan the number of columns to span @return "this" to make it easier to string together append calls ""...
java
public GridBagLayoutBuilder appendLabel(JLabel label, int colSpan) { return append(label, colSpan, 1, false, false); }
[ "public", "GridBagLayoutBuilder", "appendLabel", "(", "JLabel", "label", ",", "int", "colSpan", ")", "{", "return", "append", "(", "label", ",", "colSpan", ",", "1", ",", "false", ",", "false", ")", ";", "}" ]
Appends the given label to the end of the current line. The label does not "grow." @param label the label to append @param colSpan the number of columns to span @return "this" to make it easier to string together append calls
[ "Appends", "the", "given", "label", "to", "the", "end", "of", "the", "current", "line", ".", "The", "label", "does", "not", "grow", "." ]
train
https://github.com/lievendoclo/Valkyrie-RCP/blob/6aad6e640b348cda8f3b0841f6e42025233f1eb8/valkyrie-rcp-core/src/main/java/org/valkyriercp/layout/GridBagLayoutBuilder.java#L471-L473
google/error-prone
core/src/main/java/com/google/errorprone/bugpatterns/ReturnValueIgnored.java
ReturnValueIgnored.methodReceiverHasType
private static Matcher<ExpressionTree> methodReceiverHasType(final Set<String> typeSet) { """ Matches method calls whose receiver objects are of a type included in the set. """ return new Matcher<ExpressionTree>() { @Override public boolean matches(ExpressionTree expressionTree, VisitorState st...
java
private static Matcher<ExpressionTree> methodReceiverHasType(final Set<String> typeSet) { return new Matcher<ExpressionTree>() { @Override public boolean matches(ExpressionTree expressionTree, VisitorState state) { Type receiverType = ASTHelpers.getReceiverType(expressionTree); return ty...
[ "private", "static", "Matcher", "<", "ExpressionTree", ">", "methodReceiverHasType", "(", "final", "Set", "<", "String", ">", "typeSet", ")", "{", "return", "new", "Matcher", "<", "ExpressionTree", ">", "(", ")", "{", "@", "Override", "public", "boolean", "m...
Matches method calls whose receiver objects are of a type included in the set.
[ "Matches", "method", "calls", "whose", "receiver", "objects", "are", "of", "a", "type", "included", "in", "the", "set", "." ]
train
https://github.com/google/error-prone/blob/fe2e3cc2cf1958cb7c487bfe89852bb4c225ba9d/core/src/main/java/com/google/errorprone/bugpatterns/ReturnValueIgnored.java#L174-L182
facebook/fresco
imagepipeline/src/main/java/com/facebook/imagepipeline/cache/BufferedDiskCache.java
BufferedDiskCache.get
public Task<EncodedImage> get(CacheKey key, AtomicBoolean isCancelled) { """ Performs key-value look up in disk cache. If value is not found in disk cache staging area then disk cache read is scheduled on background thread. Any error manifests itself as cache miss, i.e. the returned task resolves to null. @para...
java
public Task<EncodedImage> get(CacheKey key, AtomicBoolean isCancelled) { try { if (FrescoSystrace.isTracing()) { FrescoSystrace.beginSection("BufferedDiskCache#get"); } final EncodedImage pinnedImage = mStagingArea.get(key); if (pinnedImage != null) { return foundPinnedImage(...
[ "public", "Task", "<", "EncodedImage", ">", "get", "(", "CacheKey", "key", ",", "AtomicBoolean", "isCancelled", ")", "{", "try", "{", "if", "(", "FrescoSystrace", ".", "isTracing", "(", ")", ")", "{", "FrescoSystrace", ".", "beginSection", "(", "\"BufferedDi...
Performs key-value look up in disk cache. If value is not found in disk cache staging area then disk cache read is scheduled on background thread. Any error manifests itself as cache miss, i.e. the returned task resolves to null. @param key @return Task that resolves to cached element or null if one cannot be retrieved...
[ "Performs", "key", "-", "value", "look", "up", "in", "disk", "cache", ".", "If", "value", "is", "not", "found", "in", "disk", "cache", "staging", "area", "then", "disk", "cache", "read", "is", "scheduled", "on", "background", "thread", ".", "Any", "error...
train
https://github.com/facebook/fresco/blob/0b85879d51c5036d5e46e627a6651afefc0b971a/imagepipeline/src/main/java/com/facebook/imagepipeline/cache/BufferedDiskCache.java#L131-L146
jmapper-framework/jmapper-core
JMapper Framework/src/main/java/com/googlecode/jmapper/cache/JMapperCache.java
JMapperCache.getMapper
public static <D,S> IJMapper<D, S> getMapper(final Class<D> destination, final Class<S> source) { """ Returns an instance of JMapper from cache if exists, in alternative a new instance. @param destination the Destination Class @param source the Source Class @param <D> Destination class @param <S> Source Clas...
java
public static <D,S> IJMapper<D, S> getMapper(final Class<D> destination, final Class<S> source){ return getMapper(destination,source, undefinedConfig()); }
[ "public", "static", "<", "D", ",", "S", ">", "IJMapper", "<", "D", ",", "S", ">", "getMapper", "(", "final", "Class", "<", "D", ">", "destination", ",", "final", "Class", "<", "S", ">", "source", ")", "{", "return", "getMapper", "(", "destination", ...
Returns an instance of JMapper from cache if exists, in alternative a new instance. @param destination the Destination Class @param source the Source Class @param <D> Destination class @param <S> Source Class @return the mapper instance
[ "Returns", "an", "instance", "of", "JMapper", "from", "cache", "if", "exists", "in", "alternative", "a", "new", "instance", "." ]
train
https://github.com/jmapper-framework/jmapper-core/blob/b48fd3527f35055b8b4a30f53a51136f183acc90/JMapper Framework/src/main/java/com/googlecode/jmapper/cache/JMapperCache.java#L58-L60
vatbub/common
updater/src/main/java/com/github/vatbub/common/updater/UpdateChecker.java
UpdateChecker.downloadAndInstallUpdate
public static boolean downloadAndInstallUpdate(UpdateInfo updateToInstall, String... params) throws IllegalStateException, IOException { """ Downloads the specified update as a jar-file and launches it. The jar file will be saved at the same location as the currently executed file but will not replac...
java
public static boolean downloadAndInstallUpdate(UpdateInfo updateToInstall, String... params) throws IllegalStateException, IOException { return downloadAndInstallUpdate(updateToInstall, null, params); }
[ "public", "static", "boolean", "downloadAndInstallUpdate", "(", "UpdateInfo", "updateToInstall", ",", "String", "...", "params", ")", "throws", "IllegalStateException", ",", "IOException", "{", "return", "downloadAndInstallUpdate", "(", "updateToInstall", ",", "null", "...
Downloads the specified update as a jar-file and launches it. The jar file will be saved at the same location as the currently executed file but will not replace it (unless it has the same filename but this will never happen). The old app file will be deleted once the updated one is launched. <b>Please note</b> that th...
[ "Downloads", "the", "specified", "update", "as", "a", "jar", "-", "file", "and", "launches", "it", ".", "The", "jar", "file", "will", "be", "saved", "at", "the", "same", "location", "as", "the", "currently", "executed", "file", "but", "will", "not", "rep...
train
https://github.com/vatbub/common/blob/8b9fd2ece0a23d520ce53b66c84cbd094e378443/updater/src/main/java/com/github/vatbub/common/updater/UpdateChecker.java#L396-L399
lz4/lz4-java
src/java/net/jpountz/lz4/LZ4DecompressorWithLength.java
LZ4DecompressorWithLength.getDecompressedLength
public static int getDecompressedLength(ByteBuffer src, int srcOff) { """ Returns the decompressed length of compressed data in <code>src[srcOff:]</code>. @param src the compressed data @param srcOff the start offset in src @return the decompressed length """ return (src.get(srcOff) & 0xFF) | (src.get...
java
public static int getDecompressedLength(ByteBuffer src, int srcOff) { return (src.get(srcOff) & 0xFF) | (src.get(srcOff + 1) & 0xFF) << 8 | (src.get(srcOff + 2) & 0xFF) << 16 | src.get(srcOff + 3) << 24; }
[ "public", "static", "int", "getDecompressedLength", "(", "ByteBuffer", "src", ",", "int", "srcOff", ")", "{", "return", "(", "src", ".", "get", "(", "srcOff", ")", "&", "0xFF", ")", "|", "(", "src", ".", "get", "(", "srcOff", "+", "1", ")", "&", "0...
Returns the decompressed length of compressed data in <code>src[srcOff:]</code>. @param src the compressed data @param srcOff the start offset in src @return the decompressed length
[ "Returns", "the", "decompressed", "length", "of", "compressed", "data", "in", "<code", ">", "src", "[", "srcOff", ":", "]", "<", "/", "code", ">", "." ]
train
https://github.com/lz4/lz4-java/blob/c5ae694a3aa8b33ef87fd0486727a7d1e8f71367/src/java/net/jpountz/lz4/LZ4DecompressorWithLength.java#L70-L72
OpenLiberty/open-liberty
dev/com.ibm.ws.messaging.security.common/src/com/ibm/ws/messaging/security/beans/Permission.java
Permission.addAllUsersToRole
protected void addAllUsersToRole(Set<String> users, String role) { """ Add all the users to a particular role @param users @param role """ if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) { SibTr.entry(tc, CLASS_NAME + "addAllUsersToRole", new Object[] { users, role }); ...
java
protected void addAllUsersToRole(Set<String> users, String role) { if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) { SibTr.entry(tc, CLASS_NAME + "addAllUsersToRole", new Object[] { users, role }); } Set<String> usersForTheRole = roleToUserMap.get(role); if (...
[ "protected", "void", "addAllUsersToRole", "(", "Set", "<", "String", ">", "users", ",", "String", "role", ")", "{", "if", "(", "TraceComponent", ".", "isAnyTracingEnabled", "(", ")", "&&", "tc", ".", "isEntryEnabled", "(", ")", ")", "{", "SibTr", ".", "e...
Add all the users to a particular role @param users @param role
[ "Add", "all", "the", "users", "to", "a", "particular", "role" ]
train
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.messaging.security.common/src/com/ibm/ws/messaging/security/beans/Permission.java#L126-L140
yatechorg/jedis-utils
src/main/java/org/yatech/jedis/utils/lua/LuaScriptBuilder.java
LuaScriptBuilder.endScript
public LuaScript endScript(LuaScriptConfig config) { """ End building the script @param config the configuration for the script to build @return the new {@link LuaScript} instance """ if (!endsWithReturnStatement()) { add(new LuaAstReturnStatement()); } String scriptText =...
java
public LuaScript endScript(LuaScriptConfig config) { if (!endsWithReturnStatement()) { add(new LuaAstReturnStatement()); } String scriptText = buildScriptText(); return new BasicLuaScript(scriptText, config); }
[ "public", "LuaScript", "endScript", "(", "LuaScriptConfig", "config", ")", "{", "if", "(", "!", "endsWithReturnStatement", "(", ")", ")", "{", "add", "(", "new", "LuaAstReturnStatement", "(", ")", ")", ";", "}", "String", "scriptText", "=", "buildScriptText", ...
End building the script @param config the configuration for the script to build @return the new {@link LuaScript} instance
[ "End", "building", "the", "script" ]
train
https://github.com/yatechorg/jedis-utils/blob/1951609fa6697df4f69be76e7d66b9284924bd97/src/main/java/org/yatech/jedis/utils/lua/LuaScriptBuilder.java#L78-L84
alkacon/opencms-core
src-modules/org/opencms/workplace/commons/CmsPublishScheduled.java
CmsPublishScheduled.computeProjectName
protected String computeProjectName(String rootPath, Date date) { """ Creates the publish project's name for a given root path and publish date.<p> @param rootPath the publish resource's root path @param date the publish date @return the publish project name """ // create the temporary project,...
java
protected String computeProjectName(String rootPath, Date date) { // create the temporary project, which is deleted after publishing // the publish scheduled date in project name String dateTime = CmsDateUtil.getDateTime(date, DateFormat.SHORT, getLocale()); // the resource name to publ...
[ "protected", "String", "computeProjectName", "(", "String", "rootPath", ",", "Date", "date", ")", "{", "// create the temporary project, which is deleted after publishing", "// the publish scheduled date in project name", "String", "dateTime", "=", "CmsDateUtil", ".", "getDateTim...
Creates the publish project's name for a given root path and publish date.<p> @param rootPath the publish resource's root path @param date the publish date @return the publish project name
[ "Creates", "the", "publish", "project", "s", "name", "for", "a", "given", "root", "path", "and", "publish", "date", ".", "<p", ">" ]
train
https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src-modules/org/opencms/workplace/commons/CmsPublishScheduled.java#L187-L198
snowflakedb/snowflake-jdbc
src/main/java/net/snowflake/client/core/IncidentUtil.java
IncidentUtil.dumpVmMetrics
public static void dumpVmMetrics(String incidentId) { """ Dumps JVM metrics for this process. @param incidentId incident id """ PrintWriter writer = null; try { String dumpFile = EventUtil.getDumpPathPrefix() + "/" + INC_DUMP_FILE_NAME + incidentId + INC_DUMP_FILE_E...
java
public static void dumpVmMetrics(String incidentId) { PrintWriter writer = null; try { String dumpFile = EventUtil.getDumpPathPrefix() + "/" + INC_DUMP_FILE_NAME + incidentId + INC_DUMP_FILE_EXT; final OutputStream outStream = new GZIPOutputStream(new FileOut...
[ "public", "static", "void", "dumpVmMetrics", "(", "String", "incidentId", ")", "{", "PrintWriter", "writer", "=", "null", ";", "try", "{", "String", "dumpFile", "=", "EventUtil", ".", "getDumpPathPrefix", "(", ")", "+", "\"/\"", "+", "INC_DUMP_FILE_NAME", "+",...
Dumps JVM metrics for this process. @param incidentId incident id
[ "Dumps", "JVM", "metrics", "for", "this", "process", "." ]
train
https://github.com/snowflakedb/snowflake-jdbc/blob/98567b5a57753f29d51446809640b969a099658f/src/main/java/net/snowflake/client/core/IncidentUtil.java#L83-L151
alkacon/opencms-core
src/org/opencms/workplace/tools/A_CmsHtmlIconButton.java
A_CmsHtmlIconButton.defaultHelpHtml
public static String defaultHelpHtml(String helpId, String helpText) { """ Generates html for the helptext when having one helptext for several buttons.<p> @param helpId the id of the help text @param helpText the help text @return html code """ StringBuffer html = new StringBuffer(1024); ...
java
public static String defaultHelpHtml(String helpId, String helpText) { StringBuffer html = new StringBuffer(1024); if (CmsStringUtil.isNotEmptyOrWhitespaceOnly(helpText)) { html.append("<div class='help' id='help"); html.append(helpId); html.append("' onMouseOut=\"hM...
[ "public", "static", "String", "defaultHelpHtml", "(", "String", "helpId", ",", "String", "helpText", ")", "{", "StringBuffer", "html", "=", "new", "StringBuffer", "(", "1024", ")", ";", "if", "(", "CmsStringUtil", ".", "isNotEmptyOrWhitespaceOnly", "(", "helpTex...
Generates html for the helptext when having one helptext for several buttons.<p> @param helpId the id of the help text @param helpText the help text @return html code
[ "Generates", "html", "for", "the", "helptext", "when", "having", "one", "helptext", "for", "several", "buttons", ".", "<p", ">" ]
train
https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/workplace/tools/A_CmsHtmlIconButton.java#L299-L312
raydac/java-binary-block-parser
jbbp/src/main/java/com/igormaznitsa/jbbp/utils/JBBPDslBuilder.java
JBBPDslBuilder.BoolArray
public JBBPDslBuilder BoolArray(final String name, final String sizeExpression) { """ Add named boolean array which length calculated through expression. @param name name of the array, it can be null for anonymous one @param sizeExpression expression to calculate number of elements, must not be null ...
java
public JBBPDslBuilder BoolArray(final String name, final String sizeExpression) { final Item item = new Item(BinType.BOOL_ARRAY, name, this.byteOrder); item.sizeExpression = assertExpressionChars(sizeExpression); this.addItem(item); return this; }
[ "public", "JBBPDslBuilder", "BoolArray", "(", "final", "String", "name", ",", "final", "String", "sizeExpression", ")", "{", "final", "Item", "item", "=", "new", "Item", "(", "BinType", ".", "BOOL_ARRAY", ",", "name", ",", "this", ".", "byteOrder", ")", ";...
Add named boolean array which length calculated through expression. @param name name of the array, it can be null for anonymous one @param sizeExpression expression to calculate number of elements, must not be null @return the builder instance, must not be null
[ "Add", "named", "boolean", "array", "which", "length", "calculated", "through", "expression", "." ]
train
https://github.com/raydac/java-binary-block-parser/blob/6d98abcab01e0c72d525ebcc9e7b694f9ce49f5b/jbbp/src/main/java/com/igormaznitsa/jbbp/utils/JBBPDslBuilder.java#L784-L789
OpenLiberty/open-liberty
dev/com.ibm.ws.jdbc/src/com/ibm/ws/rsadapter/impl/WSConnectionRequestInfoImpl.java
WSConnectionRequestInfoImpl.matchCatalog
private final boolean matchCatalog(WSConnectionRequestInfoImpl cri) { """ Determine if the catalog property matches. It is considered to match if - Both catalog values are unspecified. - Both catalog values are the same value. - One of the catalog values is unspecified and the other CRI requested the default va...
java
private final boolean matchCatalog(WSConnectionRequestInfoImpl cri) { // At least one of the CRIs should know the default value. String defaultValue = defaultCatalog == null ? cri.defaultCatalog : defaultCatalog; return match(ivCatalog, cri.ivCatalog) || ivCatalog == null && matc...
[ "private", "final", "boolean", "matchCatalog", "(", "WSConnectionRequestInfoImpl", "cri", ")", "{", "// At least one of the CRIs should know the default value.", "String", "defaultValue", "=", "defaultCatalog", "==", "null", "?", "cri", ".", "defaultCatalog", ":", "defaultC...
Determine if the catalog property matches. It is considered to match if - Both catalog values are unspecified. - Both catalog values are the same value. - One of the catalog values is unspecified and the other CRI requested the default value. @return true if the catalogs match, otherwise false.
[ "Determine", "if", "the", "catalog", "property", "matches", ".", "It", "is", "considered", "to", "match", "if", "-", "Both", "catalog", "values", "are", "unspecified", ".", "-", "Both", "catalog", "values", "are", "the", "same", "value", ".", "-", "One", ...
train
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.jdbc/src/com/ibm/ws/rsadapter/impl/WSConnectionRequestInfoImpl.java#L574-L581
CenturyLinkCloud/mdw
mdw-common/src/com/centurylink/mdw/bpmn/BpmnExportHelper.java
BpmnExportHelper.addSubprocesses
private void addSubprocesses(TBaseElement process, Process processVO) { """ <p> This deals with creating and drawing subprocess elements like exception handler </p> @param process @param processVO @throws XmlException """ List<Process> subprocs = processVO.getSubprocesses(); if (subproc...
java
private void addSubprocesses(TBaseElement process, Process processVO) { List<Process> subprocs = processVO.getSubprocesses(); if (subprocs != null) { for (Process subproc : subprocs) { // Add for subprocesses XmlObject flow = getProcessFlowElement(process); ...
[ "private", "void", "addSubprocesses", "(", "TBaseElement", "process", ",", "Process", "processVO", ")", "{", "List", "<", "Process", ">", "subprocs", "=", "processVO", ".", "getSubprocesses", "(", ")", ";", "if", "(", "subprocs", "!=", "null", ")", "{", "f...
<p> This deals with creating and drawing subprocess elements like exception handler </p> @param process @param processVO @throws XmlException
[ "<p", ">", "This", "deals", "with", "creating", "and", "drawing", "subprocess", "elements", "like", "exception", "handler", "<", "/", "p", ">" ]
train
https://github.com/CenturyLinkCloud/mdw/blob/91167fe65a25a5d7022cdcf8b0fae8506f5b87ce/mdw-common/src/com/centurylink/mdw/bpmn/BpmnExportHelper.java#L183-L201
calrissian/mango
mango-core/src/main/java/org/calrissian/mango/net/MoreInetAddresses.java
MoreInetAddresses.getInet4Address
static Inet4Address getInet4Address(byte[] bytes) { """ Returns an {@link Inet4Address}, given a byte array representation of the IPv4 address. @param bytes byte array representing an IPv4 address (should be of length 4) @return {@link Inet4Address} corresponding to the supplied byte array @throws IllegalArgu...
java
static Inet4Address getInet4Address(byte[] bytes) { if (bytes.length != 4) throw new IllegalArgumentException(format("Byte array has invalid length for an IPv4 address: %s != 4.", bytes.length)); try { // Given a 4-byte array, this cast should always succeed. return ...
[ "static", "Inet4Address", "getInet4Address", "(", "byte", "[", "]", "bytes", ")", "{", "if", "(", "bytes", ".", "length", "!=", "4", ")", "throw", "new", "IllegalArgumentException", "(", "format", "(", "\"Byte array has invalid length for an IPv4 address: %s != 4.\"",...
Returns an {@link Inet4Address}, given a byte array representation of the IPv4 address. @param bytes byte array representing an IPv4 address (should be of length 4) @return {@link Inet4Address} corresponding to the supplied byte array @throws IllegalArgumentException if a valid {@link Inet4Address} can not be created
[ "Returns", "an", "{", "@link", "Inet4Address", "}", "given", "a", "byte", "array", "representation", "of", "the", "IPv4", "address", "." ]
train
https://github.com/calrissian/mango/blob/a95aa5e77af9aa0e629787228d80806560023452/mango-core/src/main/java/org/calrissian/mango/net/MoreInetAddresses.java#L56-L66
mapsforge/mapsforge
sqlite-android/src/main/java/org/sqlite/database/DatabaseUtils.java
DatabaseUtils.dumpCurrentRow
public static void dumpCurrentRow(Cursor cursor, PrintStream stream) { """ Prints the contents of a Cursor's current row to a PrintSteam. @param cursor the cursor to print @param stream the stream to print to """ String[] cols = cursor.getColumnNames(); stream.println("" + cursor.getPositio...
java
public static void dumpCurrentRow(Cursor cursor, PrintStream stream) { String[] cols = cursor.getColumnNames(); stream.println("" + cursor.getPosition() + " {"); int length = cols.length; for (int i = 0; i< length; i++) { String value; try { value ...
[ "public", "static", "void", "dumpCurrentRow", "(", "Cursor", "cursor", ",", "PrintStream", "stream", ")", "{", "String", "[", "]", "cols", "=", "cursor", ".", "getColumnNames", "(", ")", ";", "stream", ".", "println", "(", "\"\"", "+", "cursor", ".", "ge...
Prints the contents of a Cursor's current row to a PrintSteam. @param cursor the cursor to print @param stream the stream to print to
[ "Prints", "the", "contents", "of", "a", "Cursor", "s", "current", "row", "to", "a", "PrintSteam", "." ]
train
https://github.com/mapsforge/mapsforge/blob/c49c83f7f727552f793dff15cefa532ade030842/sqlite-android/src/main/java/org/sqlite/database/DatabaseUtils.java#L547-L563
Cleveroad/AdaptiveTableLayout
library/src/main/java/com/cleveroad/adaptivetablelayout/BaseDataAdaptiveTableLayoutAdapter.java
BaseDataAdaptiveTableLayoutAdapter.switchTwoColumns
void switchTwoColumns(int columnIndex, int columnToIndex) { """ Switch 2 columns with data @param columnIndex column from @param columnToIndex column to """ for (int i = 0; i < getRowCount() - 1; i++) { Object cellData = getItems()[i][columnToIndex]; getItems()[i][columnTo...
java
void switchTwoColumns(int columnIndex, int columnToIndex) { for (int i = 0; i < getRowCount() - 1; i++) { Object cellData = getItems()[i][columnToIndex]; getItems()[i][columnToIndex] = getItems()[i][columnIndex]; getItems()[i][columnIndex] = cellData; } }
[ "void", "switchTwoColumns", "(", "int", "columnIndex", ",", "int", "columnToIndex", ")", "{", "for", "(", "int", "i", "=", "0", ";", "i", "<", "getRowCount", "(", ")", "-", "1", ";", "i", "++", ")", "{", "Object", "cellData", "=", "getItems", "(", ...
Switch 2 columns with data @param columnIndex column from @param columnToIndex column to
[ "Switch", "2", "columns", "with", "data" ]
train
https://github.com/Cleveroad/AdaptiveTableLayout/blob/188213b35e05e635497b03fe741799782dde7208/library/src/main/java/com/cleveroad/adaptivetablelayout/BaseDataAdaptiveTableLayoutAdapter.java#L35-L41
molgenis/molgenis
molgenis-api-data/src/main/java/org/molgenis/api/data/v2/AttributeFilterToFetchConverter.java
AttributeFilterToFetchConverter.createDefaultEntityFetch
public static Fetch createDefaultEntityFetch(EntityType entityType, String languageCode) { """ Create default entity fetch that fetches all attributes. @return default entity fetch or null """ boolean hasRefAttr = false; Fetch fetch = new Fetch(); for (Attribute attr : entityType.getAtomicAttrib...
java
public static Fetch createDefaultEntityFetch(EntityType entityType, String languageCode) { boolean hasRefAttr = false; Fetch fetch = new Fetch(); for (Attribute attr : entityType.getAtomicAttributes()) { Fetch subFetch = createDefaultAttributeFetch(attr, languageCode); if (subFetch != null) { ...
[ "public", "static", "Fetch", "createDefaultEntityFetch", "(", "EntityType", "entityType", ",", "String", "languageCode", ")", "{", "boolean", "hasRefAttr", "=", "false", ";", "Fetch", "fetch", "=", "new", "Fetch", "(", ")", ";", "for", "(", "Attribute", "attr"...
Create default entity fetch that fetches all attributes. @return default entity fetch or null
[ "Create", "default", "entity", "fetch", "that", "fetches", "all", "attributes", "." ]
train
https://github.com/molgenis/molgenis/blob/b4d0d6b27e6f6c8d7505a3863dc03b589601f987/molgenis-api-data/src/main/java/org/molgenis/api/data/v2/AttributeFilterToFetchConverter.java#L157-L168
mozilla/rhino
toolsrc/org/mozilla/javascript/tools/debugger/Main.java
Main.mainEmbedded
public static Main mainEmbedded(String title) { """ Entry point for embedded applications. This method attaches to the global {@link ContextFactory} with a scope of a newly created {@link Global} object. No I/O redirection is performed as with {@link #main(String[])}. """ ContextFactory factory = ...
java
public static Main mainEmbedded(String title) { ContextFactory factory = ContextFactory.getGlobal(); Global global = new Global(); global.init(factory); return mainEmbedded(factory, global, title); }
[ "public", "static", "Main", "mainEmbedded", "(", "String", "title", ")", "{", "ContextFactory", "factory", "=", "ContextFactory", ".", "getGlobal", "(", ")", ";", "Global", "global", "=", "new", "Global", "(", ")", ";", "global", ".", "init", "(", "factory...
Entry point for embedded applications. This method attaches to the global {@link ContextFactory} with a scope of a newly created {@link Global} object. No I/O redirection is performed as with {@link #main(String[])}.
[ "Entry", "point", "for", "embedded", "applications", ".", "This", "method", "attaches", "to", "the", "global", "{" ]
train
https://github.com/mozilla/rhino/blob/fa8a86df11d37623f5faa8d445a5876612bc47b0/toolsrc/org/mozilla/javascript/tools/debugger/Main.java#L239-L244
google/j2objc
jre_emul/android/platform/libcore/ojluni/src/main/java/java/time/format/DateTimeFormatter.java
DateTimeFormatter.ofLocalizedDateTime
public static DateTimeFormatter ofLocalizedDateTime(FormatStyle dateStyle, FormatStyle timeStyle) { """ Returns a locale specific date and time format for the ISO chronology. <p> This returns a formatter that will format or parse a date-time. The exact format pattern used varies by locale. <p> The locale is d...
java
public static DateTimeFormatter ofLocalizedDateTime(FormatStyle dateStyle, FormatStyle timeStyle) { Objects.requireNonNull(dateStyle, "dateStyle"); Objects.requireNonNull(timeStyle, "timeStyle"); return new DateTimeFormatterBuilder().appendLocalized(dateStyle, timeStyle) .toForma...
[ "public", "static", "DateTimeFormatter", "ofLocalizedDateTime", "(", "FormatStyle", "dateStyle", ",", "FormatStyle", "timeStyle", ")", "{", "Objects", ".", "requireNonNull", "(", "dateStyle", ",", "\"dateStyle\"", ")", ";", "Objects", ".", "requireNonNull", "(", "ti...
Returns a locale specific date and time format for the ISO chronology. <p> This returns a formatter that will format or parse a date-time. The exact format pattern used varies by locale. <p> The locale is determined from the formatter. The formatter returned directly by this method will use the {@link Locale#getDefault...
[ "Returns", "a", "locale", "specific", "date", "and", "time", "format", "for", "the", "ISO", "chronology", ".", "<p", ">", "This", "returns", "a", "formatter", "that", "will", "format", "or", "parse", "a", "date", "-", "time", ".", "The", "exact", "format...
train
https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/libcore/ojluni/src/main/java/java/time/format/DateTimeFormatter.java#L671-L676
lessthanoptimal/BoofCV
main/boofcv-geo/src/main/java/boofcv/alg/geo/PerspectiveOps.java
PerspectiveOps.scaleIntrinsic
public static void scaleIntrinsic(CameraPinhole param , double scale ) { """ Multiplies each element of the intrinsic parameters by the provided scale factor. Useful if the image has been rescaled. @param param Intrinsic parameters @param scale Scale factor that input image is being scaled by. """ para...
java
public static void scaleIntrinsic(CameraPinhole param , double scale ) { param.width = (int)(param.width*scale); param.height = (int)(param.height*scale); param.cx *= scale; param.cy *= scale; param.fx *= scale; param.fy *= scale; param.skew *= scale; }
[ "public", "static", "void", "scaleIntrinsic", "(", "CameraPinhole", "param", ",", "double", "scale", ")", "{", "param", ".", "width", "=", "(", "int", ")", "(", "param", ".", "width", "*", "scale", ")", ";", "param", ".", "height", "=", "(", "int", "...
Multiplies each element of the intrinsic parameters by the provided scale factor. Useful if the image has been rescaled. @param param Intrinsic parameters @param scale Scale factor that input image is being scaled by.
[ "Multiplies", "each", "element", "of", "the", "intrinsic", "parameters", "by", "the", "provided", "scale", "factor", ".", "Useful", "if", "the", "image", "has", "been", "rescaled", "." ]
train
https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-geo/src/main/java/boofcv/alg/geo/PerspectiveOps.java#L137-L145
Bandwidth/java-bandwidth
src/main/java/com/bandwidth/sdk/model/Call.java
Call.getRecordings
public List<Recording> getRecordings() throws Exception { """ Retrieve all recordings related to the call. @return recordings the recordings @throws IOException unexpected error. """ final String recordingsPath = StringUtils.join(new String[]{ getUri(), "recordings" ...
java
public List<Recording> getRecordings() throws Exception { final String recordingsPath = StringUtils.join(new String[]{ getUri(), "recordings" }, '/'); final JSONArray array = toJSONArray(client.get(recordingsPath, null)); final List<Recording> list = new ...
[ "public", "List", "<", "Recording", ">", "getRecordings", "(", ")", "throws", "Exception", "{", "final", "String", "recordingsPath", "=", "StringUtils", ".", "join", "(", "new", "String", "[", "]", "{", "getUri", "(", ")", ",", "\"recordings\"", "}", ",", ...
Retrieve all recordings related to the call. @return recordings the recordings @throws IOException unexpected error.
[ "Retrieve", "all", "recordings", "related", "to", "the", "call", "." ]
train
https://github.com/Bandwidth/java-bandwidth/blob/2124c85148ad6a54d2f2949cb952eb3985830e2a/src/main/java/com/bandwidth/sdk/model/Call.java#L304-L316
wildfly/wildfly-core
protocol/src/main/java/org/jboss/as/protocol/mgmt/AbstractMessageHandler.java
AbstractMessageHandler.writeHeader
protected static FlushableDataOutput writeHeader(final ManagementProtocolHeader header, final OutputStream os) throws IOException { """ Write the management protocol header. @param header the mgmt protocol header @param os the output stream @throws IOException """ final FlushableDataOutput output ...
java
protected static FlushableDataOutput writeHeader(final ManagementProtocolHeader header, final OutputStream os) throws IOException { final FlushableDataOutput output = FlushableDataOutputImpl.create(os); header.write(output); return output; }
[ "protected", "static", "FlushableDataOutput", "writeHeader", "(", "final", "ManagementProtocolHeader", "header", ",", "final", "OutputStream", "os", ")", "throws", "IOException", "{", "final", "FlushableDataOutput", "output", "=", "FlushableDataOutputImpl", ".", "create",...
Write the management protocol header. @param header the mgmt protocol header @param os the output stream @throws IOException
[ "Write", "the", "management", "protocol", "header", "." ]
train
https://github.com/wildfly/wildfly-core/blob/cfaf0479dcbb2d320a44c5374b93b944ec39fade/protocol/src/main/java/org/jboss/as/protocol/mgmt/AbstractMessageHandler.java#L525-L529
jglobus/JGlobus
gram/src/main/java/org/globus/rsl/Value.java
Value.toRSL
public void toRSL(StringBuffer buf, boolean explicitConcat) { """ Produces a RSL representation of this value. @param buf buffer to add the RSL representation to. @param explicitConcat if true explicit concatination will be used in RSL strings. """ if ( explicitConcat ) { buf.append( quotify...
java
public void toRSL(StringBuffer buf, boolean explicitConcat) { if ( explicitConcat ) { buf.append( quotify( value ) ); } else { buf.append( value ); } if (concatValue == null) { return; } if (explicitConcat) { buf.append(" # "); } concatValue.toRSL(buf, explici...
[ "public", "void", "toRSL", "(", "StringBuffer", "buf", ",", "boolean", "explicitConcat", ")", "{", "if", "(", "explicitConcat", ")", "{", "buf", ".", "append", "(", "quotify", "(", "value", ")", ")", ";", "}", "else", "{", "buf", ".", "append", "(", ...
Produces a RSL representation of this value. @param buf buffer to add the RSL representation to. @param explicitConcat if true explicit concatination will be used in RSL strings.
[ "Produces", "a", "RSL", "representation", "of", "this", "value", "." ]
train
https://github.com/jglobus/JGlobus/blob/e14f6f6636544fd84298f9cec749d626ea971930/gram/src/main/java/org/globus/rsl/Value.java#L178-L195
ggrandes/kvstore
src/main/java/org/javastack/kvstore/structures/btree/BplusTree.java
BplusTree.getRoundKey
private final K getRoundKey(final K key, final boolean upORdown, final boolean acceptEqual) { """ Return ceilingKey, floorKey, higherKey or lowerKey @param key the key @param upORdown true returns ceilingKey, false floorKey @param acceptEqual true returns equal keys, otherwise, only higher or lower @return t...
java
private final K getRoundKey(final K key, final boolean upORdown, final boolean acceptEqual) { final TreeEntry<K, V> entry = getRoundEntry(key, upORdown, acceptEqual); if (entry == null) { return null; } return entry.getKey(); }
[ "private", "final", "K", "getRoundKey", "(", "final", "K", "key", ",", "final", "boolean", "upORdown", ",", "final", "boolean", "acceptEqual", ")", "{", "final", "TreeEntry", "<", "K", ",", "V", ">", "entry", "=", "getRoundEntry", "(", "key", ",", "upORd...
Return ceilingKey, floorKey, higherKey or lowerKey @param key the key @param upORdown true returns ceilingKey, false floorKey @param acceptEqual true returns equal keys, otherwise, only higher or lower @return the key found or null if not found
[ "Return", "ceilingKey", "floorKey", "higherKey", "or", "lowerKey" ]
train
https://github.com/ggrandes/kvstore/blob/c79277f79f4604e0fec8349a98519838e3de38f0/src/main/java/org/javastack/kvstore/structures/btree/BplusTree.java#L635-L641
google/j2objc
jre_emul/android/platform/external/icu/android_icu4j/src/main/java/android/icu/text/LocaleDisplayNames.java
LocaleDisplayNames.getUiList
public List<UiListItem> getUiList(Set<ULocale> localeSet, boolean inSelf, Comparator<Object> collator) { """ Return a list of information used to construct a UI list of locale names. @param collator how to collate—should normally be Collator.getInstance(getDisplayLocale()) @param inSelf if true, compares the nam...
java
public List<UiListItem> getUiList(Set<ULocale> localeSet, boolean inSelf, Comparator<Object> collator) { return getUiListCompareWholeItems(localeSet, UiListItem.getComparator(collator, inSelf)); }
[ "public", "List", "<", "UiListItem", ">", "getUiList", "(", "Set", "<", "ULocale", ">", "localeSet", ",", "boolean", "inSelf", ",", "Comparator", "<", "Object", ">", "collator", ")", "{", "return", "getUiListCompareWholeItems", "(", "localeSet", ",", "UiListIt...
Return a list of information used to construct a UI list of locale names. @param collator how to collate—should normally be Collator.getInstance(getDisplayLocale()) @param inSelf if true, compares the nameInSelf, otherwise the nameInDisplayLocale. Set depending on which field (displayLocale vs self) is to show up in th...
[ "Return", "a", "list", "of", "information", "used", "to", "construct", "a", "UI", "list", "of", "locale", "names", "." ]
train
https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/external/icu/android_icu4j/src/main/java/android/icu/text/LocaleDisplayNames.java#L264-L266
authlete/authlete-java-common
src/main/java/com/authlete/common/util/TypedProperties.java
TypedProperties.getBoolean
public boolean getBoolean(Enum<?> key, boolean defaultValue) { """ Equivalent to {@link #getBoolean(String, boolean) getBoolean}{@code (key.name(), defaultValue)}. If {@code key} is null, {@code defaultValue} is returned. """ if (key == null) { return defaultValue; } ...
java
public boolean getBoolean(Enum<?> key, boolean defaultValue) { if (key == null) { return defaultValue; } return getBoolean(key.name(), defaultValue); }
[ "public", "boolean", "getBoolean", "(", "Enum", "<", "?", ">", "key", ",", "boolean", "defaultValue", ")", "{", "if", "(", "key", "==", "null", ")", "{", "return", "defaultValue", ";", "}", "return", "getBoolean", "(", "key", ".", "name", "(", ")", "...
Equivalent to {@link #getBoolean(String, boolean) getBoolean}{@code (key.name(), defaultValue)}. If {@code key} is null, {@code defaultValue} is returned.
[ "Equivalent", "to", "{" ]
train
https://github.com/authlete/authlete-java-common/blob/49c94c483713cbf5a04d805ff7dbd83766c9c964/src/main/java/com/authlete/common/util/TypedProperties.java#L103-L111
b3log/latke
latke-core/src/main/java/org/b3log/latke/repository/Repositories.java
Repositories.getRepositoryDef
public static JSONObject getRepositoryDef(final String repositoryName) { """ Gets the repository definition of an repository specified by the given repository name. @param repositoryName the given repository name (maybe with table name prefix) @return repository definition, returns {@code null} if not found ...
java
public static JSONObject getRepositoryDef(final String repositoryName) { if (StringUtils.isBlank(repositoryName)) { return null; } if (null == repositoriesDescription) { return null; } final JSONArray repositories = repositoriesDescription.optJSONArray("...
[ "public", "static", "JSONObject", "getRepositoryDef", "(", "final", "String", "repositoryName", ")", "{", "if", "(", "StringUtils", ".", "isBlank", "(", "repositoryName", ")", ")", "{", "return", "null", ";", "}", "if", "(", "null", "==", "repositoriesDescript...
Gets the repository definition of an repository specified by the given repository name. @param repositoryName the given repository name (maybe with table name prefix) @return repository definition, returns {@code null} if not found
[ "Gets", "the", "repository", "definition", "of", "an", "repository", "specified", "by", "the", "given", "repository", "name", "." ]
train
https://github.com/b3log/latke/blob/f7e08a47eeecea5f7c94006382c24f353585de33/latke-core/src/main/java/org/b3log/latke/repository/Repositories.java#L230-L248
jcustenborder/connect-utils
connect-utils/src/main/java/com/github/jcustenborder/kafka/connect/utils/config/ConfigUtils.java
ConfigUtils.hostAndPort
public static HostAndPort hostAndPort(AbstractConfig config, String key) { """ Method is used to parse a string ConfigDef item to a HostAndPort @param config Config to read from @param key ConfigItem to get the host string from. @return HostAndPort based on the ConfigItem. """ return hostAndPort(co...
java
public static HostAndPort hostAndPort(AbstractConfig config, String key) { return hostAndPort(config, key, null); }
[ "public", "static", "HostAndPort", "hostAndPort", "(", "AbstractConfig", "config", ",", "String", "key", ")", "{", "return", "hostAndPort", "(", "config", ",", "key", ",", "null", ")", ";", "}" ]
Method is used to parse a string ConfigDef item to a HostAndPort @param config Config to read from @param key ConfigItem to get the host string from. @return HostAndPort based on the ConfigItem.
[ "Method", "is", "used", "to", "parse", "a", "string", "ConfigDef", "item", "to", "a", "HostAndPort" ]
train
https://github.com/jcustenborder/connect-utils/blob/19add138921f59ffcc85282d7aad551eeb582370/connect-utils/src/main/java/com/github/jcustenborder/kafka/connect/utils/config/ConfigUtils.java#L169-L171
jenkinsci/java-client-api
jenkins-client/src/main/java/com/offbytwo/jenkins/JenkinsServer.java
JenkinsServer.renameJob
public JenkinsServer renameJob(String oldJobName, String newJobName, Boolean crumbFlag) throws IOException { """ Rename a job @param oldJobName existing job name. @param newJobName The new job name. @param crumbFlag <code>true</code> to add <b>crumbIssuer</b> <code>false</code> otherwise. @throws IOExceptio...
java
public JenkinsServer renameJob(String oldJobName, String newJobName, Boolean crumbFlag) throws IOException { renameJob(null, oldJobName, newJobName, crumbFlag); return this; }
[ "public", "JenkinsServer", "renameJob", "(", "String", "oldJobName", ",", "String", "newJobName", ",", "Boolean", "crumbFlag", ")", "throws", "IOException", "{", "renameJob", "(", "null", ",", "oldJobName", ",", "newJobName", ",", "crumbFlag", ")", ";", "return"...
Rename a job @param oldJobName existing job name. @param newJobName The new job name. @param crumbFlag <code>true</code> to add <b>crumbIssuer</b> <code>false</code> otherwise. @throws IOException In case of a failure.
[ "Rename", "a", "job" ]
train
https://github.com/jenkinsci/java-client-api/blob/c4f5953d3d4dda92cd946ad3bf2b811524c32da9/jenkins-client/src/main/java/com/offbytwo/jenkins/JenkinsServer.java#L874-L877
unbescape/unbescape
src/main/java/org/unbescape/uri/UriEscape.java
UriEscape.escapeUriPath
public static void escapeUriPath(final Reader reader, final Writer writer, final String encoding) throws IOException { """ <p> Perform am URI path <strong>escape</strong> operation on a <tt>Reader</tt> input, writing results to a <tt>Writer</tt>. </p> <p> The following are the only allowed chars i...
java
public static void escapeUriPath(final Reader reader, final Writer writer, final String encoding) throws IOException { if (writer == null) { throw new IllegalArgumentException("Argument 'writer' cannot be null"); } if (encoding == null) { throw new IllegalAr...
[ "public", "static", "void", "escapeUriPath", "(", "final", "Reader", "reader", ",", "final", "Writer", "writer", ",", "final", "String", "encoding", ")", "throws", "IOException", "{", "if", "(", "writer", "==", "null", ")", "{", "throw", "new", "IllegalArgum...
<p> Perform am URI path <strong>escape</strong> operation on a <tt>Reader</tt> input, writing results to a <tt>Writer</tt>. </p> <p> The following are the only allowed chars in an URI path (will not be escaped): </p> <ul> <li><tt>A-Z a-z 0-9</tt></li> <li><tt>- . _ ~</tt></li> <li><tt>! $ &amp; ' ( ) * + , ; =</tt></li...
[ "<p", ">", "Perform", "am", "URI", "path", "<strong", ">", "escape<", "/", "strong", ">", "operation", "on", "a", "<tt", ">", "Reader<", "/", "tt", ">", "input", "writing", "results", "to", "a", "<tt", ">", "Writer<", "/", "tt", ">", ".", "<", "/",...
train
https://github.com/unbescape/unbescape/blob/ec5435fb3508c2eed25d8165dc27ded2602cae13/src/main/java/org/unbescape/uri/UriEscape.java#L835-L848
codegist/crest
core/src/main/java/org/codegist/crest/util/Pairs.java
Pairs.toPair
public static EncodedPair toPair(String nameToEncode, String valueToEncode, Charset charset) throws UnsupportedEncodingException { """ Returns a EncodedPair with the given name/value considered as not encoded @param nameToEncode name to encode @param valueToEncode value to encode @param charset charset to use w...
java
public static EncodedPair toPair(String nameToEncode, String valueToEncode, Charset charset) throws UnsupportedEncodingException { return toPair(nameToEncode, valueToEncode, charset, false); }
[ "public", "static", "EncodedPair", "toPair", "(", "String", "nameToEncode", ",", "String", "valueToEncode", ",", "Charset", "charset", ")", "throws", "UnsupportedEncodingException", "{", "return", "toPair", "(", "nameToEncode", ",", "valueToEncode", ",", "charset", ...
Returns a EncodedPair with the given name/value considered as not encoded @param nameToEncode name to encode @param valueToEncode value to encode @param charset charset to use while encoding the name/value @return the encoded pair object @throws UnsupportedEncodingException When the given charset is not supported
[ "Returns", "a", "EncodedPair", "with", "the", "given", "name", "/", "value", "considered", "as", "not", "encoded" ]
train
https://github.com/codegist/crest/blob/e99ba7728b27d2ddb2c247261350f1b6fa7a6698/core/src/main/java/org/codegist/crest/util/Pairs.java#L67-L69
deephacks/confit
provider-jpa20/src/main/java/org/deephacks/confit/internal/jpa/JpaProperty.java
JpaProperty.filterUnwantedReferences
static void filterUnwantedReferences(List<JpaProperty> result, Set<BeanId> query) { """ Beans with different schemaName may have same instance id. The IN search query is greedy, finding instances that match any combination of instance id and schemaName. Hence, the query may find references belonging to wrong ...
java
static void filterUnwantedReferences(List<JpaProperty> result, Set<BeanId> query) { ListIterator<JpaProperty> it = result.listIterator(); while (it.hasNext()) { // remove property from result that was not part of the query JpaProperty found = it.next(); if (!quer...
[ "static", "void", "filterUnwantedReferences", "(", "List", "<", "JpaProperty", ">", "result", ",", "Set", "<", "BeanId", ">", "query", ")", "{", "ListIterator", "<", "JpaProperty", ">", "it", "=", "result", ".", "listIterator", "(", ")", ";", "while", "(",...
Beans with different schemaName may have same instance id. The IN search query is greedy, finding instances that match any combination of instance id and schemaName. Hence, the query may find references belonging to wrong schema so filter those out.
[ "Beans", "with", "different", "schemaName", "may", "have", "same", "instance", "id", "." ]
train
https://github.com/deephacks/confit/blob/4e6d4ee5fed32cbc5104433e61de1bcf1b360832/provider-jpa20/src/main/java/org/deephacks/confit/internal/jpa/JpaProperty.java#L193-L202
apache/incubator-gobblin
gobblin-api/src/main/java/org/apache/gobblin/source/extractor/WatermarkSerializerHelper.java
WatermarkSerializerHelper.convertJsonToWatermark
public static <T extends Watermark> T convertJsonToWatermark(JsonElement jsonElement, Class<T> clazz) { """ Converts a {@link JsonElement} into the specified class type using the {@link Gson#fromJson(JsonElement, Class)} method. @param jsonElement is a {@link JsonElement} that will be converted into a {@link W...
java
public static <T extends Watermark> T convertJsonToWatermark(JsonElement jsonElement, Class<T> clazz) { return GSON.fromJson(jsonElement, clazz); }
[ "public", "static", "<", "T", "extends", "Watermark", ">", "T", "convertJsonToWatermark", "(", "JsonElement", "jsonElement", ",", "Class", "<", "T", ">", "clazz", ")", "{", "return", "GSON", ".", "fromJson", "(", "jsonElement", ",", "clazz", ")", ";", "}" ...
Converts a {@link JsonElement} into the specified class type using the {@link Gson#fromJson(JsonElement, Class)} method. @param jsonElement is a {@link JsonElement} that will be converted into a {@link Watermark}. @param clazz is the {@link Class} that the {@link JsonElement} will be converted into. @return an instanc...
[ "Converts", "a", "{", "@link", "JsonElement", "}", "into", "the", "specified", "class", "type", "using", "the", "{", "@link", "Gson#fromJson", "(", "JsonElement", "Class", ")", "}", "method", "." ]
train
https://github.com/apache/incubator-gobblin/blob/f029b4c0fea0fe4aa62f36dda2512344ff708bae/gobblin-api/src/main/java/org/apache/gobblin/source/extractor/WatermarkSerializerHelper.java#L51-L53
ModeShape/modeshape
web/modeshape-web-jcr-rest/src/main/java/org/modeshape/web/jcr/rest/model/RestWorkspaces.java
RestWorkspaces.addWorkspace
public Workspace addWorkspace( String name, String repositoryUrl ) { """ Adds a new workspace to the list of workspaces. @param name a {@code non-null} string, the name of a workspace. @param repositoryUrl a {@code non-null} string, the absolute url to the repository to which...
java
public Workspace addWorkspace( String name, String repositoryUrl ) { Workspace workspace = new Workspace(name, repositoryUrl); workspaces.add(workspace); return workspace; }
[ "public", "Workspace", "addWorkspace", "(", "String", "name", ",", "String", "repositoryUrl", ")", "{", "Workspace", "workspace", "=", "new", "Workspace", "(", "name", ",", "repositoryUrl", ")", ";", "workspaces", ".", "add", "(", "workspace", ")", ";", "ret...
Adds a new workspace to the list of workspaces. @param name a {@code non-null} string, the name of a workspace. @param repositoryUrl a {@code non-null} string, the absolute url to the repository to which the workspace belongs. @return a {@link Workspace} instance
[ "Adds", "a", "new", "workspace", "to", "the", "list", "of", "workspaces", "." ]
train
https://github.com/ModeShape/modeshape/blob/794cfdabb67a90f24629c4fff0424a6125f8f95b/web/modeshape-web-jcr-rest/src/main/java/org/modeshape/web/jcr/rest/model/RestWorkspaces.java#L49-L54
looly/hutool
hutool-crypto/src/main/java/cn/hutool/crypto/KeyUtil.java
KeyUtil.generatePublicKey
public static PublicKey generatePublicKey(String algorithm, KeySpec keySpec) { """ 生成公钥,仅用于非对称加密<br> 算法见:https://docs.oracle.com/javase/7/docs/technotes/guides/security/StandardNames.html#KeyFactory @param algorithm 算法 @param keySpec {@link KeySpec} @return 公钥 {@link PublicKey} @since 3.1.1 """ if (n...
java
public static PublicKey generatePublicKey(String algorithm, KeySpec keySpec) { if (null == keySpec) { return null; } algorithm = getAlgorithmAfterWith(algorithm); try { return getKeyFactory(algorithm).generatePublic(keySpec); } catch (Exception e) { throw new CryptoException(e); } }
[ "public", "static", "PublicKey", "generatePublicKey", "(", "String", "algorithm", ",", "KeySpec", "keySpec", ")", "{", "if", "(", "null", "==", "keySpec", ")", "{", "return", "null", ";", "}", "algorithm", "=", "getAlgorithmAfterWith", "(", "algorithm", ")", ...
生成公钥,仅用于非对称加密<br> 算法见:https://docs.oracle.com/javase/7/docs/technotes/guides/security/StandardNames.html#KeyFactory @param algorithm 算法 @param keySpec {@link KeySpec} @return 公钥 {@link PublicKey} @since 3.1.1
[ "生成公钥,仅用于非对称加密<br", ">", "算法见:https", ":", "//", "docs", ".", "oracle", ".", "com", "/", "javase", "/", "7", "/", "docs", "/", "technotes", "/", "guides", "/", "security", "/", "StandardNames", ".", "html#KeyFactory" ]
train
https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-crypto/src/main/java/cn/hutool/crypto/KeyUtil.java#L301-L311
to2mbn/JMCCC
jmccc/src/main/java/org/to2mbn/jmccc/internal/org/json/JSONArray.java
JSONArray.optBigDecimal
public BigDecimal optBigDecimal(int index, BigDecimal defaultValue) { """ Get the optional BigDecimal value associated with an index. The defaultValue is returned if there is no value for the index, or if the value is not a number and cannot be converted to a number. @param index The index must be between 0 a...
java
public BigDecimal optBigDecimal(int index, BigDecimal defaultValue) { try { return this.getBigDecimal(index); } catch (Exception e) { return defaultValue; } }
[ "public", "BigDecimal", "optBigDecimal", "(", "int", "index", ",", "BigDecimal", "defaultValue", ")", "{", "try", "{", "return", "this", ".", "getBigDecimal", "(", "index", ")", ";", "}", "catch", "(", "Exception", "e", ")", "{", "return", "defaultValue", ...
Get the optional BigDecimal value associated with an index. The defaultValue is returned if there is no value for the index, or if the value is not a number and cannot be converted to a number. @param index The index must be between 0 and length() - 1. @param defaultValue The default value. @return The value.
[ "Get", "the", "optional", "BigDecimal", "value", "associated", "with", "an", "index", ".", "The", "defaultValue", "is", "returned", "if", "there", "is", "no", "value", "for", "the", "index", "or", "if", "the", "value", "is", "not", "a", "number", "and", ...
train
https://github.com/to2mbn/JMCCC/blob/17e5b1b56ff18255cfd60976dca1a24598946647/jmccc/src/main/java/org/to2mbn/jmccc/internal/org/json/JSONArray.java#L592-L598
google/j2objc
jre_emul/android/platform/external/icu/android_icu4j/src/main/java/android/icu/util/Calendar.java
Calendar.validateField
protected final void validateField(int field, int min, int max) { """ Validate a single field of this calendar given its minimum and maximum allowed value. If the field is out of range, throw a descriptive <code>IllegalArgumentException</code>. Subclasses may use this method in their implementation of {@link ...
java
protected final void validateField(int field, int min, int max) { int value = fields[field]; if (value < min || value > max) { throw new IllegalArgumentException(fieldName(field) + '=' + value + ", valid range=" + min + ".." + max); } }
[ "protected", "final", "void", "validateField", "(", "int", "field", ",", "int", "min", ",", "int", "max", ")", "{", "int", "value", "=", "fields", "[", "field", "]", ";", "if", "(", "value", "<", "min", "||", "value", ">", "max", ")", "{", "throw",...
Validate a single field of this calendar given its minimum and maximum allowed value. If the field is out of range, throw a descriptive <code>IllegalArgumentException</code>. Subclasses may use this method in their implementation of {@link #validateField(int)}.
[ "Validate", "a", "single", "field", "of", "this", "calendar", "given", "its", "minimum", "and", "maximum", "allowed", "value", ".", "If", "the", "field", "is", "out", "of", "range", "throw", "a", "descriptive", "<code", ">", "IllegalArgumentException<", "/", ...
train
https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/external/icu/android_icu4j/src/main/java/android/icu/util/Calendar.java#L5257-L5264
AzureAD/azure-activedirectory-library-for-java
src/main/java/com/microsoft/aad/adal4j/AuthenticationContext.java
AuthenticationContext.acquireTokenByDeviceCode
public Future<AuthenticationResult> acquireTokenByDeviceCode( final DeviceCode deviceCode, final AuthenticationCallback callback) throws AuthenticationException { """ Acquires security token from the authority using an device code previously received. @param deviceCode The device code ...
java
public Future<AuthenticationResult> acquireTokenByDeviceCode( final DeviceCode deviceCode, final AuthenticationCallback callback) throws AuthenticationException { final ClientAuthentication clientAuth = new ClientAuthenticationPost( ClientAuthenticationMethod.NONE, ...
[ "public", "Future", "<", "AuthenticationResult", ">", "acquireTokenByDeviceCode", "(", "final", "DeviceCode", "deviceCode", ",", "final", "AuthenticationCallback", "callback", ")", "throws", "AuthenticationException", "{", "final", "ClientAuthentication", "clientAuth", "=",...
Acquires security token from the authority using an device code previously received. @param deviceCode The device code result received from calling acquireDeviceCode. @param callback optional callback object for non-blocking execution. @return A {@link Future} object representing the {@link AuthenticationResult} of ...
[ "Acquires", "security", "token", "from", "the", "authority", "using", "an", "device", "code", "previously", "received", "." ]
train
https://github.com/AzureAD/azure-activedirectory-library-for-java/blob/7f0004fee6faee5818e75623113993a267ceb1c4/src/main/java/com/microsoft/aad/adal4j/AuthenticationContext.java#L640-L652
Prototik/HoloEverywhere
library/src/android/support/v7/internal/view/menu/MenuBuilder.java
MenuBuilder.removeItemAtInt
private void removeItemAtInt(int index, boolean updateChildrenOnMenuViews) { """ Remove the item at the given index and optionally forces menu views to update. @param index The index of the item to be removed. If this index is invalid an exception is thrown. @param updateChildrenOnMenuView...
java
private void removeItemAtInt(int index, boolean updateChildrenOnMenuViews) { if ((index < 0) || (index >= mItems.size())) { return; } mItems.remove(index); if (updateChildrenOnMenuViews) { onItemsChanged(true); } }
[ "private", "void", "removeItemAtInt", "(", "int", "index", ",", "boolean", "updateChildrenOnMenuViews", ")", "{", "if", "(", "(", "index", "<", "0", ")", "||", "(", "index", ">=", "mItems", ".", "size", "(", ")", ")", ")", "{", "return", ";", "}", "m...
Remove the item at the given index and optionally forces menu views to update. @param index The index of the item to be removed. If this index is invalid an exception is thrown. @param updateChildrenOnMenuViews Whether to force update on menu views. Please make sure you eventually call this after y...
[ "Remove", "the", "item", "at", "the", "given", "index", "and", "optionally", "forces", "menu", "views", "to", "update", "." ]
train
https://github.com/Prototik/HoloEverywhere/blob/b870abb5ab009a5a6dbab3fb855ec2854e35e125/library/src/android/support/v7/internal/view/menu/MenuBuilder.java#L520-L530
kaazing/gateway
transport/ws/src/main/java/org/kaazing/gateway/transport/ws/bridge/filter/WsFrameUtils.java
WsFrameUtils.xor
public static void xor(ByteBuffer src, ByteBuffer dst, int mask) { """ Masks source buffer into destination buffer. @param src the buffer containing readable bytes to be masked @param dst the buffer where masked bytes are written @param mask the mask to apply """ int remainder = src.remaining() ...
java
public static void xor(ByteBuffer src, ByteBuffer dst, int mask) { int remainder = src.remaining() % 4; int remaining = src.remaining() - remainder; int end = remaining + src.position(); // xor a 32bit word at a time as long as possible while (src.position() < end) { int masked = src.get...
[ "public", "static", "void", "xor", "(", "ByteBuffer", "src", ",", "ByteBuffer", "dst", ",", "int", "mask", ")", "{", "int", "remainder", "=", "src", ".", "remaining", "(", ")", "%", "4", ";", "int", "remaining", "=", "src", ".", "remaining", "(", ")"...
Masks source buffer into destination buffer. @param src the buffer containing readable bytes to be masked @param dst the buffer where masked bytes are written @param mask the mask to apply
[ "Masks", "source", "buffer", "into", "destination", "buffer", "." ]
train
https://github.com/kaazing/gateway/blob/06017b19273109b3b992e528e702586446168d57/transport/ws/src/main/java/org/kaazing/gateway/transport/ws/bridge/filter/WsFrameUtils.java#L32-L68
ocelotds/ocelot
ocelot-processor/src/main/java/org/ocelotds/frameworks/angularjs/FunctionWriter.java
FunctionWriter.writeOpenFunctionWithDependencies
public void writeOpenFunctionWithDependencies(Writer writer, String object, String... dependencies) throws IOException { """ \tfunction object(dep1, dep2) {\n @param writer @param object @param dependencies @throws IOException """ writer.append(TAB).append("/* @ngInject */").append(CR); writer.append...
java
public void writeOpenFunctionWithDependencies(Writer writer, String object, String... dependencies) throws IOException { writer.append(TAB).append("/* @ngInject */").append(CR); writer.append(TAB).append(FUNCTION).append(SPACE).append(object).append(OPENPARENTHESIS); writeDependencies(writer, "", dependencies); ...
[ "public", "void", "writeOpenFunctionWithDependencies", "(", "Writer", "writer", ",", "String", "object", ",", "String", "...", "dependencies", ")", "throws", "IOException", "{", "writer", ".", "append", "(", "TAB", ")", ".", "append", "(", "\"/* @ngInject */\"", ...
\tfunction object(dep1, dep2) {\n @param writer @param object @param dependencies @throws IOException
[ "\\", "tfunction", "object", "(", "dep1", "dep2", ")", "{", "\\", "n" ]
train
https://github.com/ocelotds/ocelot/blob/5f0ac37afd8fa4dc9f7234a2aac8abbb522128e7/ocelot-processor/src/main/java/org/ocelotds/frameworks/angularjs/FunctionWriter.java#L58-L64
structr/structr
structr-ui/src/main/java/org/structr/web/resource/RegistrationResource.java
RegistrationResource.createUser
public Principal createUser(final SecurityContext securityContext, final PropertyKey credentialKey, final String credentialValue, final String confKey) { """ Create a new user. If a {@link Person} is found, convert that object to a {@link User} object. Do not auto-create a new user. @param securityContext ...
java
public Principal createUser(final SecurityContext securityContext, final PropertyKey credentialKey, final String credentialValue, final String confKey) { return createUser(securityContext, credentialKey, credentialValue, Collections.EMPTY_MAP, confKey); }
[ "public", "Principal", "createUser", "(", "final", "SecurityContext", "securityContext", ",", "final", "PropertyKey", "credentialKey", ",", "final", "String", "credentialValue", ",", "final", "String", "confKey", ")", "{", "return", "createUser", "(", "securityContext...
Create a new user. If a {@link Person} is found, convert that object to a {@link User} object. Do not auto-create a new user. @param securityContext @param credentialKey @param credentialValue @param confKey @return user
[ "Create", "a", "new", "user", "." ]
train
https://github.com/structr/structr/blob/c111a1d0c0201c7fea5574ed69aa5a5053185a97/structr-ui/src/main/java/org/structr/web/resource/RegistrationResource.java#L305-L309
Stratio/cassandra-lucene-index
plugin/src/main/java/com/stratio/cassandra/lucene/common/GeospatialUtils.java
GeospatialUtils.validateGeohashMaxLevels
public static int validateGeohashMaxLevels(Integer userMaxLevels, int defaultMaxLevels) { """ Checks if the specified max levels is correct. @param userMaxLevels the maximum number of levels in the tree @param defaultMaxLevels the default max number of levels @return the validated max levels """ i...
java
public static int validateGeohashMaxLevels(Integer userMaxLevels, int defaultMaxLevels) { int maxLevels = userMaxLevels == null ? defaultMaxLevels : userMaxLevels; if (maxLevels < 1 || maxLevels > GeohashPrefixTree.getMaxLevelsPossible()) { throw new IndexException("max_levels must be in ran...
[ "public", "static", "int", "validateGeohashMaxLevels", "(", "Integer", "userMaxLevels", ",", "int", "defaultMaxLevels", ")", "{", "int", "maxLevels", "=", "userMaxLevels", "==", "null", "?", "defaultMaxLevels", ":", "userMaxLevels", ";", "if", "(", "maxLevels", "<...
Checks if the specified max levels is correct. @param userMaxLevels the maximum number of levels in the tree @param defaultMaxLevels the default max number of levels @return the validated max levels
[ "Checks", "if", "the", "specified", "max", "levels", "is", "correct", "." ]
train
https://github.com/Stratio/cassandra-lucene-index/blob/a94a4d9af6c25d40e1108729974c35c27c54441c/plugin/src/main/java/com/stratio/cassandra/lucene/common/GeospatialUtils.java#L51-L59
looly/hutool
hutool-core/src/main/java/cn/hutool/core/io/IoUtil.java
IoUtil.copyByNIO
public static long copyByNIO(InputStream in, OutputStream out, int bufferSize, StreamProgress streamProgress) throws IORuntimeException { """ 拷贝流 thanks to: https://github.com/venusdrogon/feilong-io/blob/master/src/main/java/com/feilong/io/IOWriteUtil.java<br> 本方法不会关闭流 @param in 输入流 @param out 输出流 @param buf...
java
public static long copyByNIO(InputStream in, OutputStream out, int bufferSize, StreamProgress streamProgress) throws IORuntimeException { return copy(Channels.newChannel(in), Channels.newChannel(out), bufferSize, streamProgress); }
[ "public", "static", "long", "copyByNIO", "(", "InputStream", "in", ",", "OutputStream", "out", ",", "int", "bufferSize", ",", "StreamProgress", "streamProgress", ")", "throws", "IORuntimeException", "{", "return", "copy", "(", "Channels", ".", "newChannel", "(", ...
拷贝流 thanks to: https://github.com/venusdrogon/feilong-io/blob/master/src/main/java/com/feilong/io/IOWriteUtil.java<br> 本方法不会关闭流 @param in 输入流 @param out 输出流 @param bufferSize 缓存大小 @param streamProgress 进度条 @return 传输的byte数 @throws IORuntimeException IO异常
[ "拷贝流", "thanks", "to", ":", "https", ":", "//", "github", ".", "com", "/", "venusdrogon", "/", "feilong", "-", "io", "/", "blob", "/", "master", "/", "src", "/", "main", "/", "java", "/", "com", "/", "feilong", "/", "io", "/", "IOWriteUtil", ".", ...
train
https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-core/src/main/java/cn/hutool/core/io/IoUtil.java#L201-L203
OpenLiberty/open-liberty
dev/com.ibm.ws.session/src/com/ibm/ws/session/StoreCallback.java
StoreCallback.sessionAttributeSet
public void sessionAttributeSet(ISession session, Object name, Object oldValue, Boolean oldIsListener, Object newValue, Boolean newIsListener) { """ Method sessionAttributeSet <p> @param session @param name @param oldValue @param newValue @see com.ibm.wsspi.session.IStoreCallback#sessionAttributeSet(com.ib...
java
public void sessionAttributeSet(ISession session, Object name, Object oldValue, Boolean oldIsListener, Object newValue, Boolean newIsListener) { _sessionStateEventDispatcher.sessionAttributeSet(session, name, oldValue, oldIsListener, newValue, newIsListener); }
[ "public", "void", "sessionAttributeSet", "(", "ISession", "session", ",", "Object", "name", ",", "Object", "oldValue", ",", "Boolean", "oldIsListener", ",", "Object", "newValue", ",", "Boolean", "newIsListener", ")", "{", "_sessionStateEventDispatcher", ".", "sessio...
Method sessionAttributeSet <p> @param session @param name @param oldValue @param newValue @see com.ibm.wsspi.session.IStoreCallback#sessionAttributeSet(com.ibm.wsspi.session.ISession, java.lang.Object, java.lang.Object, java.lang.Object)
[ "Method", "sessionAttributeSet", "<p", ">" ]
train
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.session/src/com/ibm/ws/session/StoreCallback.java#L168-L171
QSFT/Doradus
doradus-client/src/main/java/com/dell/doradus/client/SSLTransportParameters.java
SSLTransportParameters.setKeyStore
public void setKeyStore(String keyStore, String keyPass) { """ Set the keystore and password @param keyStore Location of the Keystore on disk @param keyPass Keystore password """ setKeyStore(keyStore, keyPass, null, null); }
java
public void setKeyStore(String keyStore, String keyPass) { setKeyStore(keyStore, keyPass, null, null); }
[ "public", "void", "setKeyStore", "(", "String", "keyStore", ",", "String", "keyPass", ")", "{", "setKeyStore", "(", "keyStore", ",", "keyPass", ",", "null", ",", "null", ")", ";", "}" ]
Set the keystore and password @param keyStore Location of the Keystore on disk @param keyPass Keystore password
[ "Set", "the", "keystore", "and", "password" ]
train
https://github.com/QSFT/Doradus/blob/ad64d3c37922eefda68ec8869ef089c1ca604b70/doradus-client/src/main/java/com/dell/doradus/client/SSLTransportParameters.java#L213-L216
threerings/gwt-utils
src/main/java/com/threerings/gwt/ui/ItemListBox.java
ItemListBox.addItem
public void addItem (T item, String label) { """ Adds the supplied item to this list box at the end of the list, using the supplied label if not null. If no label is given, {@link #toLabel(Object)} is used to calculate it. """ addItem(label == null ? toLabel(item) : label); _items.add(item); ...
java
public void addItem (T item, String label) { addItem(label == null ? toLabel(item) : label); _items.add(item); }
[ "public", "void", "addItem", "(", "T", "item", ",", "String", "label", ")", "{", "addItem", "(", "label", "==", "null", "?", "toLabel", "(", "item", ")", ":", "label", ")", ";", "_items", ".", "add", "(", "item", ")", ";", "}" ]
Adds the supplied item to this list box at the end of the list, using the supplied label if not null. If no label is given, {@link #toLabel(Object)} is used to calculate it.
[ "Adds", "the", "supplied", "item", "to", "this", "list", "box", "at", "the", "end", "of", "the", "list", "using", "the", "supplied", "label", "if", "not", "null", ".", "If", "no", "label", "is", "given", "{" ]
train
https://github.com/threerings/gwt-utils/blob/31b31a23b667f2a9c683160d77646db259f2aae5/src/main/java/com/threerings/gwt/ui/ItemListBox.java#L122-L126
grails/grails-core
grails-bootstrap/src/main/groovy/org/grails/io/watch/DirectoryWatcher.java
DirectoryWatcher.addWatchDirectory
public void addWatchDirectory(File dir, List<String> fileExtensions) { """ Adds a directory to watch for the given file and extensions. @param dir The directory @param fileExtensions The extensions """ List<String> fileExtensionsWithoutDot = new ArrayList<String>(fileExtensions.size()); for(Strin...
java
public void addWatchDirectory(File dir, List<String> fileExtensions) { List<String> fileExtensionsWithoutDot = new ArrayList<String>(fileExtensions.size()); for(String fileExtension : fileExtensions){ fileExtensionsWithoutDot.add(removeStartingDotIfPresent(fileExtension)); } directoryWatcherDe...
[ "public", "void", "addWatchDirectory", "(", "File", "dir", ",", "List", "<", "String", ">", "fileExtensions", ")", "{", "List", "<", "String", ">", "fileExtensionsWithoutDot", "=", "new", "ArrayList", "<", "String", ">", "(", "fileExtensions", ".", "size", "...
Adds a directory to watch for the given file and extensions. @param dir The directory @param fileExtensions The extensions
[ "Adds", "a", "directory", "to", "watch", "for", "the", "given", "file", "and", "extensions", "." ]
train
https://github.com/grails/grails-core/blob/c0b08aa995b0297143b75d05642abba8cb7b4122/grails-bootstrap/src/main/groovy/org/grails/io/watch/DirectoryWatcher.java#L124-L130
zxing/zxing
core/src/main/java/com/google/zxing/common/detector/WhiteRectangleDetector.java
WhiteRectangleDetector.centerEdges
private ResultPoint[] centerEdges(ResultPoint y, ResultPoint z, ResultPoint x, ResultPoint t) { """ recenters the points of a constant distance towards the center @param y bottom most point @param z left most point @param x right most point @param t top most point @return...
java
private ResultPoint[] centerEdges(ResultPoint y, ResultPoint z, ResultPoint x, ResultPoint t) { // // t t // z x // x OR z // y y // float yi = y.getX(); float yj = y.getY(); ...
[ "private", "ResultPoint", "[", "]", "centerEdges", "(", "ResultPoint", "y", ",", "ResultPoint", "z", ",", "ResultPoint", "x", ",", "ResultPoint", "t", ")", "{", "//", "// t t", "// z x", "// x OR z", "// y ...
recenters the points of a constant distance towards the center @param y bottom most point @param z left most point @param x right most point @param t top most point @return {@link ResultPoint}[] describing the corners of the rectangular region. The first and last points are opposed on the diagonal, as are the second a...
[ "recenters", "the", "points", "of", "a", "constant", "distance", "towards", "the", "center" ]
train
https://github.com/zxing/zxing/blob/653ac2a3beb11481eff82e7d5f2bab8a745f7fac/core/src/main/java/com/google/zxing/common/detector/WhiteRectangleDetector.java#L263-L295
alkacon/opencms-core
src-setup/org/opencms/setup/db/update6to7/CmsUpdateDBContentTables.java
CmsUpdateDBContentTables.transferOnlineContents
protected void transferOnlineContents(CmsSetupDb dbCon, int pubTag) throws SQLException { """ Transfers the online content.<p> @param dbCon the db connection interface @param pubTag the publish tag to use @throws SQLException if something goes wrong """ String query = readQuery(QUERY_TRANSFER_O...
java
protected void transferOnlineContents(CmsSetupDb dbCon, int pubTag) throws SQLException { String query = readQuery(QUERY_TRANSFER_ONLINE_CONTENTS); Map<String, String> replacer = Collections.singletonMap("${pubTag}", "" + pubTag); dbCon.updateSqlStatement(query, replacer, null); }
[ "protected", "void", "transferOnlineContents", "(", "CmsSetupDb", "dbCon", ",", "int", "pubTag", ")", "throws", "SQLException", "{", "String", "query", "=", "readQuery", "(", "QUERY_TRANSFER_ONLINE_CONTENTS", ")", ";", "Map", "<", "String", ",", "String", ">", "...
Transfers the online content.<p> @param dbCon the db connection interface @param pubTag the publish tag to use @throws SQLException if something goes wrong
[ "Transfers", "the", "online", "content", ".", "<p", ">" ]
train
https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src-setup/org/opencms/setup/db/update6to7/CmsUpdateDBContentTables.java#L158-L163
micronaut-projects/micronaut-core
inject/src/main/java/io/micronaut/context/AbstractBeanDefinition.java
AbstractBeanDefinition.getBeansOfTypeForConstructorArgument
@SuppressWarnings("WeakerAccess") @Internal protected final Collection getBeansOfTypeForConstructorArgument(BeanResolutionContext resolutionContext, BeanContext context, @SuppressWarnings("unused") ConstructorInjectionPoint<T> constructorInjectionPoint, Argument argument) { """ Obtains all bean definitions...
java
@SuppressWarnings("WeakerAccess") @Internal protected final Collection getBeansOfTypeForConstructorArgument(BeanResolutionContext resolutionContext, BeanContext context, @SuppressWarnings("unused") ConstructorInjectionPoint<T> constructorInjectionPoint, Argument argument) { return resolveBeanWithGeneric...
[ "@", "SuppressWarnings", "(", "\"WeakerAccess\"", ")", "@", "Internal", "protected", "final", "Collection", "getBeansOfTypeForConstructorArgument", "(", "BeanResolutionContext", "resolutionContext", ",", "BeanContext", "context", ",", "@", "SuppressWarnings", "(", "\"unused...
Obtains all bean definitions for a constructor argument at the given index <p> Warning: this method is used by internal generated code and should not be called by user code. @param resolutionContext The resolution context @param context The context @param constructorInjectionPoint The constru...
[ "Obtains", "all", "bean", "definitions", "for", "a", "constructor", "argument", "at", "the", "given", "index", "<p", ">", "Warning", ":", "this", "method", "is", "used", "by", "internal", "generated", "code", "and", "should", "not", "be", "called", "by", "...
train
https://github.com/micronaut-projects/micronaut-core/blob/c31f5b03ce0eb88c2f6470710987db03b8967d5c/inject/src/main/java/io/micronaut/context/AbstractBeanDefinition.java#L1080-L1092
gallandarakhneorg/afc
advanced/bootique/bootique-printconfig/src/main/java/org/arakhne/afc/bootique/printconfig/commands/PrintConfigCommand.java
PrintConfigCommand.extractConfigValues
protected void extractConfigValues(Map<String, Object> yaml, List<ConfigMetadataNode> configs) { """ Extract the definition from the given configurations. @param yaml the to fill out. @param configs the configurations. """ for (final ConfigMetadataNode config : configs) { Configs.defineConfig(yaml, co...
java
protected void extractConfigValues(Map<String, Object> yaml, List<ConfigMetadataNode> configs) { for (final ConfigMetadataNode config : configs) { Configs.defineConfig(yaml, config, this.injector); } }
[ "protected", "void", "extractConfigValues", "(", "Map", "<", "String", ",", "Object", ">", "yaml", ",", "List", "<", "ConfigMetadataNode", ">", "configs", ")", "{", "for", "(", "final", "ConfigMetadataNode", "config", ":", "configs", ")", "{", "Configs", "."...
Extract the definition from the given configurations. @param yaml the to fill out. @param configs the configurations.
[ "Extract", "the", "definition", "from", "the", "given", "configurations", "." ]
train
https://github.com/gallandarakhneorg/afc/blob/0c7d2e1ddefd4167ef788416d970a6c1ef6f8bbb/advanced/bootique/bootique-printconfig/src/main/java/org/arakhne/afc/bootique/printconfig/commands/PrintConfigCommand.java#L137-L141
teatrove/teatrove
trove/src/main/java/org/teatrove/trove/io/TemporaryFile.java
TemporaryFile.createTemporaryFile
public static RandomAccessFile createTemporaryFile (String prefix, String suffix) throws IOException { """ Creates a new writable temporary file that is deleted when closed, finalized, or when the system exits. @see File#createTempFile """ return createTemporaryFile(prefix, suffix, null); ...
java
public static RandomAccessFile createTemporaryFile (String prefix, String suffix) throws IOException { return createTemporaryFile(prefix, suffix, null); }
[ "public", "static", "RandomAccessFile", "createTemporaryFile", "(", "String", "prefix", ",", "String", "suffix", ")", "throws", "IOException", "{", "return", "createTemporaryFile", "(", "prefix", ",", "suffix", ",", "null", ")", ";", "}" ]
Creates a new writable temporary file that is deleted when closed, finalized, or when the system exits. @see File#createTempFile
[ "Creates", "a", "new", "writable", "temporary", "file", "that", "is", "deleted", "when", "closed", "finalized", "or", "when", "the", "system", "exits", "." ]
train
https://github.com/teatrove/teatrove/blob/7039bdd4da6817ff8c737f7e4e07bac7e3ad8bea/trove/src/main/java/org/teatrove/trove/io/TemporaryFile.java#L50-L54
DataSketches/sketches-core
src/main/java/com/yahoo/sketches/theta/SingleItemSketch.java
SingleItemSketch.heapify
public static SingleItemSketch heapify(final Memory mem, final long seed) { """ Creates a SingleItemSketch on the heap given a Memory. Checks the seed hash of the given Memory against a hash of the given seed. @param mem the Memory to be heapified @param seed a given hash seed @return a SingleItemSketch ""...
java
public static SingleItemSketch heapify(final Memory mem, final long seed) { final long memPre0 = mem.getLong(0); checkDefaultBytes0to5(memPre0); final short seedHashIn = mem.getShort(6); final short seedHashCk = computeSeedHash(seed); checkSeedHashes(seedHashIn, seedHashCk); return new SingleIte...
[ "public", "static", "SingleItemSketch", "heapify", "(", "final", "Memory", "mem", ",", "final", "long", "seed", ")", "{", "final", "long", "memPre0", "=", "mem", ".", "getLong", "(", "0", ")", ";", "checkDefaultBytes0to5", "(", "memPre0", ")", ";", "final"...
Creates a SingleItemSketch on the heap given a Memory. Checks the seed hash of the given Memory against a hash of the given seed. @param mem the Memory to be heapified @param seed a given hash seed @return a SingleItemSketch
[ "Creates", "a", "SingleItemSketch", "on", "the", "heap", "given", "a", "Memory", ".", "Checks", "the", "seed", "hash", "of", "the", "given", "Memory", "against", "a", "hash", "of", "the", "given", "seed", "." ]
train
https://github.com/DataSketches/sketches-core/blob/900c8c9668a1e2f1d54d453e956caad54702e540/src/main/java/com/yahoo/sketches/theta/SingleItemSketch.java#L68-L75
umeding/fuzzer
src/main/java/com/uwemeding/fuzzer/Member.java
Member.applyHedge
public Member applyHedge(Hedge hedge) { """ Apply a hedge to the member. <p> @param hedge is the hedge @return the hedged member """ String newMemberName = hedge.getName() + "$" + name; Member member = new Member(newMemberName, functionCall, hedge); this.points.stream().forEach(point -> member.points....
java
public Member applyHedge(Hedge hedge) { String newMemberName = hedge.getName() + "$" + name; Member member = new Member(newMemberName, functionCall, hedge); this.points.stream().forEach(point -> member.points.add(point)); return member; }
[ "public", "Member", "applyHedge", "(", "Hedge", "hedge", ")", "{", "String", "newMemberName", "=", "hedge", ".", "getName", "(", ")", "+", "\"$\"", "+", "name", ";", "Member", "member", "=", "new", "Member", "(", "newMemberName", ",", "functionCall", ",", ...
Apply a hedge to the member. <p> @param hedge is the hedge @return the hedged member
[ "Apply", "a", "hedge", "to", "the", "member", ".", "<p", ">" ]
train
https://github.com/umeding/fuzzer/blob/e8aa46313bb1d1328865f26f99455124aede828c/src/main/java/com/uwemeding/fuzzer/Member.java#L70-L75
landawn/AbacusUtil
src/com/landawn/abacus/util/ExceptionalStream.java
ExceptionalStream.rows
public static <T> ExceptionalStream<T, SQLException> rows(final ResultSet resultSet, final String columnName) { """ It's user's responsibility to close the input <code>resultSet</code> after the stream is finished. @param resultSet @param columnName @return """ N.checkArgNotNull(resultSet, "resul...
java
public static <T> ExceptionalStream<T, SQLException> rows(final ResultSet resultSet, final String columnName) { N.checkArgNotNull(resultSet, "resultSet"); N.checkArgNotNull(columnName, "columnName"); return rows(resultSet, getColumnIndex(resultSet, columnName)); }
[ "public", "static", "<", "T", ">", "ExceptionalStream", "<", "T", ",", "SQLException", ">", "rows", "(", "final", "ResultSet", "resultSet", ",", "final", "String", "columnName", ")", "{", "N", ".", "checkArgNotNull", "(", "resultSet", ",", "\"resultSet\"", "...
It's user's responsibility to close the input <code>resultSet</code> after the stream is finished. @param resultSet @param columnName @return
[ "It", "s", "user", "s", "responsibility", "to", "close", "the", "input", "<code", ">", "resultSet<", "/", "code", ">", "after", "the", "stream", "is", "finished", "." ]
train
https://github.com/landawn/AbacusUtil/blob/544b7720175d15e9329f83dd22a8cc5fa4515e12/src/com/landawn/abacus/util/ExceptionalStream.java#L768-L773
Azure/azure-sdk-for-java
mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/implementation/AssetFiltersInner.java
AssetFiltersInner.getAsync
public Observable<AssetFilterInner> getAsync(String resourceGroupName, String accountName, String assetName, String filterName) { """ Get an Asset Filter. Get the details of an Asset Filter associated with the specified Asset. @param resourceGroupName The name of the resource group within the Azure subscriptio...
java
public Observable<AssetFilterInner> getAsync(String resourceGroupName, String accountName, String assetName, String filterName) { return getWithServiceResponseAsync(resourceGroupName, accountName, assetName, filterName).map(new Func1<ServiceResponse<AssetFilterInner>, AssetFilterInner>() { @Override...
[ "public", "Observable", "<", "AssetFilterInner", ">", "getAsync", "(", "String", "resourceGroupName", ",", "String", "accountName", ",", "String", "assetName", ",", "String", "filterName", ")", "{", "return", "getWithServiceResponseAsync", "(", "resourceGroupName", ",...
Get an Asset Filter. Get the details of an Asset Filter associated with the specified Asset. @param resourceGroupName The name of the resource group within the Azure subscription. @param accountName The Media Services account name. @param assetName The Asset name. @param filterName The Asset Filter name @throws Illega...
[ "Get", "an", "Asset", "Filter", ".", "Get", "the", "details", "of", "an", "Asset", "Filter", "associated", "with", "the", "specified", "Asset", "." ]
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/AssetFiltersInner.java#L271-L278
joniles/mpxj
src/main/java/net/sf/mpxj/asta/AstaReader.java
AstaReader.createTasks
private void createTasks(ChildTaskContainer parent, String parentName, List<Row> rows) { """ Recursively descend through the hierarchy creating tasks. @param parent parent task @param parentName parent name @param rows rows to add as tasks to this parent """ for (Row row : rows) { bo...
java
private void createTasks(ChildTaskContainer parent, String parentName, List<Row> rows) { for (Row row : rows) { boolean rowIsBar = (row.getInteger("BARID") != null); // // Don't export hammock tasks. // if (rowIsBar && row.getChildRows().isEmpty()) {...
[ "private", "void", "createTasks", "(", "ChildTaskContainer", "parent", ",", "String", "parentName", ",", "List", "<", "Row", ">", "rows", ")", "{", "for", "(", "Row", "row", ":", "rows", ")", "{", "boolean", "rowIsBar", "=", "(", "row", ".", "getInteger"...
Recursively descend through the hierarchy creating tasks. @param parent parent task @param parentName parent name @param rows rows to add as tasks to this parent
[ "Recursively", "descend", "through", "the", "hierarchy", "creating", "tasks", "." ]
train
https://github.com/joniles/mpxj/blob/143ea0e195da59cd108f13b3b06328e9542337e8/src/main/java/net/sf/mpxj/asta/AstaReader.java#L322-L363
gallandarakhneorg/afc
advanced/gis/gisinputoutput/src/main/java/org/arakhne/afc/gis/io/xml/XMLGISElementUtil.java
XMLGISElementUtil.writeMapElement
public static Element writeMapElement(MapElement primitive, XMLBuilder builder, XMLResources resources) throws IOException { """ Write the XML description for the given map element. @param primitive is the map element to output. @param builder is the tool to create XML nodes. @param resources is the tool that...
java
public static Element writeMapElement(MapElement primitive, XMLBuilder builder, XMLResources resources) throws IOException { return writeMapElement(primitive, null, builder, resources); }
[ "public", "static", "Element", "writeMapElement", "(", "MapElement", "primitive", ",", "XMLBuilder", "builder", ",", "XMLResources", "resources", ")", "throws", "IOException", "{", "return", "writeMapElement", "(", "primitive", ",", "null", ",", "builder", ",", "r...
Write the XML description for the given map element. @param primitive is the map element to output. @param builder is the tool to create XML nodes. @param resources is the tool that permits to gather the resources. @return the XML node of the map element. @throws IOException in case of error.
[ "Write", "the", "XML", "description", "for", "the", "given", "map", "element", "." ]
train
https://github.com/gallandarakhneorg/afc/blob/0c7d2e1ddefd4167ef788416d970a6c1ef6f8bbb/advanced/gis/gisinputoutput/src/main/java/org/arakhne/afc/gis/io/xml/XMLGISElementUtil.java#L140-L142
apache/reef
lang/java/reef-io/src/main/java/org/apache/reef/io/network/group/impl/task/OperatorTopologyImpl.java
OperatorTopologyImpl.updateBaseTopology
private void updateBaseTopology() throws ParentDeadException { """ Blocking method that waits till the base topology is updated Unblocks when. we receive a TopologySetup msg from driver <p> Will also update the effective topology when the base topology is updated so that creation of effective topology is limit...
java
private void updateBaseTopology() throws ParentDeadException { LOG.entering("OperatorTopologyImpl", "updateBaseTopology", getQualifiedName()); LOG.finest(getQualifiedName() + "Waiting to acquire topoLock"); synchronized (topologyLock) { LOG.finest(getQualifiedName() + "Acquired topoLock"); try {...
[ "private", "void", "updateBaseTopology", "(", ")", "throws", "ParentDeadException", "{", "LOG", ".", "entering", "(", "\"OperatorTopologyImpl\"", ",", "\"updateBaseTopology\"", ",", "getQualifiedName", "(", ")", ")", ";", "LOG", ".", "finest", "(", "getQualifiedName...
Blocking method that waits till the base topology is updated Unblocks when. we receive a TopologySetup msg from driver <p> Will also update the effective topology when the base topology is updated so that creation of effective topology is limited to just this method and refresh will only refresh the effective topology ...
[ "Blocking", "method", "that", "waits", "till", "the", "base", "topology", "is", "updated", "Unblocks", "when", ".", "we", "receive", "a", "TopologySetup", "msg", "from", "driver", "<p", ">", "Will", "also", "update", "the", "effective", "topology", "when", "...
train
https://github.com/apache/reef/blob/e2c47121cde21108a602c560cf76565a40d0e916/lang/java/reef-io/src/main/java/org/apache/reef/io/network/group/impl/task/OperatorTopologyImpl.java#L305-L345
tvesalainen/util
util/src/main/java/org/vesalainen/nio/file/attribute/UserAttrs.java
UserAttrs.getLongAttribute
public static final long getLongAttribute(Path path, String attribute, LinkOption... options) throws IOException { """ Returns user-defined-attribute -1 if not found. @param path @param attribute @param options @return @throws IOException """ return getLongAttribute(path, attribute, -1, options);...
java
public static final long getLongAttribute(Path path, String attribute, LinkOption... options) throws IOException { return getLongAttribute(path, attribute, -1, options); }
[ "public", "static", "final", "long", "getLongAttribute", "(", "Path", "path", ",", "String", "attribute", ",", "LinkOption", "...", "options", ")", "throws", "IOException", "{", "return", "getLongAttribute", "(", "path", ",", "attribute", ",", "-", "1", ",", ...
Returns user-defined-attribute -1 if not found. @param path @param attribute @param options @return @throws IOException
[ "Returns", "user", "-", "defined", "-", "attribute", "-", "1", "if", "not", "found", "." ]
train
https://github.com/tvesalainen/util/blob/bba7a44689f638ffabc8be40a75bdc9a33676433/util/src/main/java/org/vesalainen/nio/file/attribute/UserAttrs.java#L195-L198
google/error-prone-javac
src/jdk.compiler/share/classes/com/sun/tools/javac/parser/JavacParser.java
JavacParser.annotationValue
JCExpression annotationValue() { """ /* AnnotationValue = ConditionalExpression | Annotation | "{" [ AnnotationValue { "," AnnotationValue } ] [","] "}" """ int pos; switch (token.kind) { case MONKEYS_AT: pos = token.pos; nextToken(); retur...
java
JCExpression annotationValue() { int pos; switch (token.kind) { case MONKEYS_AT: pos = token.pos; nextToken(); return annotation(pos, Tag.ANNOTATION); case LBRACE: pos = token.pos; accept(LBRACE); ListBuffer<JCExpres...
[ "JCExpression", "annotationValue", "(", ")", "{", "int", "pos", ";", "switch", "(", "token", ".", "kind", ")", "{", "case", "MONKEYS_AT", ":", "pos", "=", "token", ".", "pos", ";", "nextToken", "(", ")", ";", "return", "annotation", "(", "pos", ",", ...
/* AnnotationValue = ConditionalExpression | Annotation | "{" [ AnnotationValue { "," AnnotationValue } ] [","] "}"
[ "/", "*", "AnnotationValue", "=", "ConditionalExpression", "|", "Annotation", "|", "{", "[", "AnnotationValue", "{", "AnnotationValue", "}", "]", "[", "]", "}" ]
train
https://github.com/google/error-prone-javac/blob/a53d069bbdb2c60232ed3811c19b65e41c3e60e0/src/jdk.compiler/share/classes/com/sun/tools/javac/parser/JavacParser.java#L2942-L2969
google/j2objc
jre_emul/android/platform/external/icu/android_icu4j/src/main/java/android/icu/impl/UnicodeRegex.java
UnicodeRegex.appendLines
public static List<String> appendLines(List<String> result, String file, String encoding) throws IOException { """ Utility for loading lines from a file. @param result The result of the appended lines. @param file The file to have an input stream. @param encoding if null, then UTF-8 @return filled list @throw...
java
public static List<String> appendLines(List<String> result, String file, String encoding) throws IOException { InputStream is = new FileInputStream(file); try { return appendLines(result, is, encoding); } finally { is.close(); } }
[ "public", "static", "List", "<", "String", ">", "appendLines", "(", "List", "<", "String", ">", "result", ",", "String", "file", ",", "String", "encoding", ")", "throws", "IOException", "{", "InputStream", "is", "=", "new", "FileInputStream", "(", "file", ...
Utility for loading lines from a file. @param result The result of the appended lines. @param file The file to have an input stream. @param encoding if null, then UTF-8 @return filled list @throws IOException If there were problems opening the file for input stream.
[ "Utility", "for", "loading", "lines", "from", "a", "file", "." ]
train
https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/external/icu/android_icu4j/src/main/java/android/icu/impl/UnicodeRegex.java#L279-L286
Carbonado/Carbonado
src/main/java/com/amazon/carbonado/raw/DataDecoder.java
DataDecoder.readFully
public static void readFully(InputStream in, byte[] b) throws IOException, EOFException { """ Reads as many bytes from the stream as is necessary to fill the given byte array. An EOFException is thrown if the stream end is encountered. @since 1.2 """ final int length = b.length; int total...
java
public static void readFully(InputStream in, byte[] b) throws IOException, EOFException { final int length = b.length; int total = 0; while (total < length) { int amt = in.read(b, total, length - total); if (amt < 0) { throw new EOFException(); ...
[ "public", "static", "void", "readFully", "(", "InputStream", "in", ",", "byte", "[", "]", "b", ")", "throws", "IOException", ",", "EOFException", "{", "final", "int", "length", "=", "b", ".", "length", ";", "int", "total", "=", "0", ";", "while", "(", ...
Reads as many bytes from the stream as is necessary to fill the given byte array. An EOFException is thrown if the stream end is encountered. @since 1.2
[ "Reads", "as", "many", "bytes", "from", "the", "stream", "as", "is", "necessary", "to", "fill", "the", "given", "byte", "array", ".", "An", "EOFException", "is", "thrown", "if", "the", "stream", "end", "is", "encountered", "." ]
train
https://github.com/Carbonado/Carbonado/blob/eee29b365a61c8f03e1a1dc6bed0692e6b04b1db/src/main/java/com/amazon/carbonado/raw/DataDecoder.java#L647-L657
radkovo/CSSBox
src/main/java/org/fit/cssbox/layout/Box.java
Box.getContainingBlock
public Rectangle getContainingBlock() { """ Obtains the containing block bounds. @return the containing block bounds. """ if (cbox instanceof Viewport) //initial containing block { Rectangle visible = ((Viewport) cbox).getVisibleRect(); return new Rectangle(0, 0, visibl...
java
public Rectangle getContainingBlock() { if (cbox instanceof Viewport) //initial containing block { Rectangle visible = ((Viewport) cbox).getVisibleRect(); return new Rectangle(0, 0, visible.width, visible.height); } else //static or relative position ...
[ "public", "Rectangle", "getContainingBlock", "(", ")", "{", "if", "(", "cbox", "instanceof", "Viewport", ")", "//initial containing block", "{", "Rectangle", "visible", "=", "(", "(", "Viewport", ")", "cbox", ")", ".", "getVisibleRect", "(", ")", ";", "return"...
Obtains the containing block bounds. @return the containing block bounds.
[ "Obtains", "the", "containing", "block", "bounds", "." ]
train
https://github.com/radkovo/CSSBox/blob/38aaf8f22d233d7b4dbc12a56cdbc72b447bc559/src/main/java/org/fit/cssbox/layout/Box.java#L523-L532
jcuda/jcuda
JCudaJava/src/main/java/jcuda/driver/JCudaDriver.java
JCudaDriver.cuModuleGetTexRef
public static int cuModuleGetTexRef(CUtexref pTexRef, CUmodule hmod, String name) { """ Returns a handle to a texture reference. <pre> CUresult cuModuleGetTexRef ( CUtexref* pTexRef, CUmodule hmod, const char* name ) </pre> <div> <p>Returns a handle to a texture reference. Returns in <tt>*pTexRef</tt> t...
java
public static int cuModuleGetTexRef(CUtexref pTexRef, CUmodule hmod, String name) { return checkResult(cuModuleGetTexRefNative(pTexRef, hmod, name)); }
[ "public", "static", "int", "cuModuleGetTexRef", "(", "CUtexref", "pTexRef", ",", "CUmodule", "hmod", ",", "String", "name", ")", "{", "return", "checkResult", "(", "cuModuleGetTexRefNative", "(", "pTexRef", ",", "hmod", ",", "name", ")", ")", ";", "}" ]
Returns a handle to a texture reference. <pre> CUresult cuModuleGetTexRef ( CUtexref* pTexRef, CUmodule hmod, const char* name ) </pre> <div> <p>Returns a handle to a texture reference. Returns in <tt>*pTexRef</tt> the handle of the texture reference of name <tt>name</tt> in the module <tt>hmod</tt>. If no texture ref...
[ "Returns", "a", "handle", "to", "a", "texture", "reference", "." ]
train
https://github.com/jcuda/jcuda/blob/468528b5b9b37dfceb6ed83fcfd889e9b359f984/JCudaJava/src/main/java/jcuda/driver/JCudaDriver.java#L2688-L2691
pebble/pebble-android-sdk
PebbleKit/PebbleKit/src/main/java/com/getpebble/android/kit/PebbleKit.java
PebbleKit.requestDataLogsForApp
public static void requestDataLogsForApp(final Context context, final UUID appUuid) { """ A convenience function to emit an intent to pebble.apk to request the data logs for a particular app. If data is available, pebble.apk will advertise the data via 'INTENT_DL_RECEIVE_DATA' intents. To avoid leaking memory,...
java
public static void requestDataLogsForApp(final Context context, final UUID appUuid) { final Intent requestIntent = new Intent(INTENT_DL_REQUEST_DATA); requestIntent.putExtra(APP_UUID, appUuid); context.sendBroadcast(requestIntent); }
[ "public", "static", "void", "requestDataLogsForApp", "(", "final", "Context", "context", ",", "final", "UUID", "appUuid", ")", "{", "final", "Intent", "requestIntent", "=", "new", "Intent", "(", "INTENT_DL_REQUEST_DATA", ")", ";", "requestIntent", ".", "putExtra",...
A convenience function to emit an intent to pebble.apk to request the data logs for a particular app. If data is available, pebble.apk will advertise the data via 'INTENT_DL_RECEIVE_DATA' intents. To avoid leaking memory, activities registering BroadcastReceivers <em>must</em> unregister them in the Activity's {@link ...
[ "A", "convenience", "function", "to", "emit", "an", "intent", "to", "pebble", ".", "apk", "to", "request", "the", "data", "logs", "for", "a", "particular", "app", ".", "If", "data", "is", "available", "pebble", ".", "apk", "will", "advertise", "the", "da...
train
https://github.com/pebble/pebble-android-sdk/blob/ddfc53ecf3950deebb62a1f205aa21fbe9bce45d/PebbleKit/PebbleKit/src/main/java/com/getpebble/android/kit/PebbleKit.java#L891-L895
actorapp/actor-platform
actor-sdk/sdk-core/core/core-shared/src/main/java/im/actor/core/modules/encryption/SessionManagerActor.java
SessionManagerActor.spawnSession
private PeerSession spawnSession(int uid, int ownKeyGroup, int theirKeyGroup, PrivateKey ownIdentity, PublicKey theirIdentity, PrivateK...
java
private PeerSession spawnSession(int uid, int ownKeyGroup, int theirKeyGroup, PrivateKey ownIdentity, PublicKey theirIdentity, PrivateK...
[ "private", "PeerSession", "spawnSession", "(", "int", "uid", ",", "int", "ownKeyGroup", ",", "int", "theirKeyGroup", ",", "PrivateKey", "ownIdentity", ",", "PublicKey", "theirIdentity", ",", "PrivateKey", "ownPreKey", ",", "PublicKey", "theirPreKey", ")", "{", "//...
Spawn new session @param uid user's id @param ownKeyGroup own key group id @param theirKeyGroup their key group Id @param ownIdentity own identity private key @param theirIdentity their identity public key @param ownPreKey own pre key @param theirPreKey their pre key @return spawned session
[ "Spawn", "new", "session" ]
train
https://github.com/actorapp/actor-platform/blob/5123c1584757c6eeea0ed2a0e7e043629871a0c6/actor-sdk/sdk-core/core/core-shared/src/main/java/im/actor/core/modules/encryption/SessionManagerActor.java#L173-L216
Swagger2Markup/swagger2markup
src/main/java/io/github/swagger2markup/internal/document/DefinitionsDocument.java
DefinitionsDocument.applyDefinitionComponent
private void applyDefinitionComponent(MarkupDocBuilder markupDocBuilder, String definitionName, Model model) { """ Builds a concrete definition @param markupDocBuilder the markupDocBuilder do use for output @param definitionName the name of the definition @param model the Swagger Model of the def...
java
private void applyDefinitionComponent(MarkupDocBuilder markupDocBuilder, String definitionName, Model model) { definitionComponent.apply(markupDocBuilder, DefinitionComponent.parameters( definitionName, model, 2)); }
[ "private", "void", "applyDefinitionComponent", "(", "MarkupDocBuilder", "markupDocBuilder", ",", "String", "definitionName", ",", "Model", "model", ")", "{", "definitionComponent", ".", "apply", "(", "markupDocBuilder", ",", "DefinitionComponent", ".", "parameters", "("...
Builds a concrete definition @param markupDocBuilder the markupDocBuilder do use for output @param definitionName the name of the definition @param model the Swagger Model of the definition
[ "Builds", "a", "concrete", "definition" ]
train
https://github.com/Swagger2Markup/swagger2markup/blob/da83465f19a2f8a0f1fba873b5762bca8587896b/src/main/java/io/github/swagger2markup/internal/document/DefinitionsDocument.java#L159-L164
PistoiaHELM/HELM2NotationToolkit
src/main/java/org/helm/notation2/tools/ChangeObjects.java
ChangeObjects.addCountToMonomerNotation
public final static void addCountToMonomerNotation(PolymerNotation polymer, int position, String count) { """ method to set the count of a MonomerNotation @param polymer PolymerNotation @param position position of the MonomerNotation @param count new count of the MonomerNotation """ polymer.getPolym...
java
public final static void addCountToMonomerNotation(PolymerNotation polymer, int position, String count) { polymer.getPolymerElements().getListOfElements().get(position).setCount(count); }
[ "public", "final", "static", "void", "addCountToMonomerNotation", "(", "PolymerNotation", "polymer", ",", "int", "position", ",", "String", "count", ")", "{", "polymer", ".", "getPolymerElements", "(", ")", ".", "getListOfElements", "(", ")", ".", "get", "(", ...
method to set the count of a MonomerNotation @param polymer PolymerNotation @param position position of the MonomerNotation @param count new count of the MonomerNotation
[ "method", "to", "set", "the", "count", "of", "a", "MonomerNotation" ]
train
https://github.com/PistoiaHELM/HELM2NotationToolkit/blob/ac5bb01fd5b4082134a8ef226bbe2ff0f60fcd38/src/main/java/org/helm/notation2/tools/ChangeObjects.java#L340-L342
amzn/ion-java
src/com/amazon/ion/impl/_Private_ScalarConversions.java
_Private_ScalarConversions.getConversionFnid
protected final static int getConversionFnid(int authoritative_type, int new_type) { """ from a values authoritative type (the type of the original data for the value) and the desired type this returns the conversion functions id, or throws a CantConvertException in the event the authoritative type cannot be ca...
java
protected final static int getConversionFnid(int authoritative_type, int new_type) { if (new_type == authoritative_type) return 0; switch (new_type) { case AS_TYPE.null_value: assert( authoritative_type == AS_TYPE.string_value ); return from_string_conversion[...
[ "protected", "final", "static", "int", "getConversionFnid", "(", "int", "authoritative_type", ",", "int", "new_type", ")", "{", "if", "(", "new_type", "==", "authoritative_type", ")", "return", "0", ";", "switch", "(", "new_type", ")", "{", "case", "AS_TYPE", ...
from a values authoritative type (the type of the original data for the value) and the desired type this returns the conversion functions id, or throws a CantConvertException in the event the authoritative type cannot be cast to the desired type. @param authoritative_type @param new_type @return id of the conversion fu...
[ "from", "a", "values", "authoritative", "type", "(", "the", "type", "of", "the", "original", "data", "for", "the", "value", ")", "and", "the", "desired", "type", "this", "returns", "the", "conversion", "functions", "id", "or", "throws", "a", "CantConvertExce...
train
https://github.com/amzn/ion-java/blob/4ce1f0f58c6a5a8e42d0425ccdb36e38be3e2270/src/com/amazon/ion/impl/_Private_ScalarConversions.java#L301-L334
sdaschner/jaxrs-analyzer
src/main/java/com/sebastian_daschner/jaxrs_analyzer/model/JavaUtils.java
JavaUtils.determineLeastSpecificType
public static String determineLeastSpecificType(final String... types) { """ Determines the type which is least "specific" (i. e. parametrized types are more "specific" than generic types, types which are not {@link Object} are less specific). If no exact statement can be made, the second type is chosen. @para...
java
public static String determineLeastSpecificType(final String... types) { switch (types.length) { case 0: throw new IllegalArgumentException("At least one type has to be provided"); case 1: return types[0]; case 2: return determi...
[ "public", "static", "String", "determineLeastSpecificType", "(", "final", "String", "...", "types", ")", "{", "switch", "(", "types", ".", "length", ")", "{", "case", "0", ":", "throw", "new", "IllegalArgumentException", "(", "\"At least one type has to be provided\...
Determines the type which is least "specific" (i. e. parametrized types are more "specific" than generic types, types which are not {@link Object} are less specific). If no exact statement can be made, the second type is chosen. @param types The types @return The most "specific" type @see #determineMostSpecificType(St...
[ "Determines", "the", "type", "which", "is", "least", "specific", "(", "i", ".", "e", ".", "parametrized", "types", "are", "more", "specific", "than", "generic", "types", "types", "which", "are", "not", "{", "@link", "Object", "}", "are", "less", "specific"...
train
https://github.com/sdaschner/jaxrs-analyzer/blob/4ac62942202d05632977d6c14d3cd7e2d27e2b9b/src/main/java/com/sebastian_daschner/jaxrs_analyzer/model/JavaUtils.java#L173-L188
line/armeria
core/src/main/java/com/linecorp/armeria/server/ServerBuilder.java
ServerBuilder.workerGroup
public ServerBuilder workerGroup(EventLoopGroup workerGroup, boolean shutdownOnStop) { """ Sets the worker {@link EventLoopGroup} which is responsible for performing socket I/O and running {@link Service#serve(ServiceRequestContext, Request)}. If not set, {@linkplain CommonPools#workerGroup() the common worker g...
java
public ServerBuilder workerGroup(EventLoopGroup workerGroup, boolean shutdownOnStop) { this.workerGroup = requireNonNull(workerGroup, "workerGroup"); shutdownWorkerGroupOnStop = shutdownOnStop; return this; }
[ "public", "ServerBuilder", "workerGroup", "(", "EventLoopGroup", "workerGroup", ",", "boolean", "shutdownOnStop", ")", "{", "this", ".", "workerGroup", "=", "requireNonNull", "(", "workerGroup", ",", "\"workerGroup\"", ")", ";", "shutdownWorkerGroupOnStop", "=", "shut...
Sets the worker {@link EventLoopGroup} which is responsible for performing socket I/O and running {@link Service#serve(ServiceRequestContext, Request)}. If not set, {@linkplain CommonPools#workerGroup() the common worker group} is used. @param shutdownOnStop whether to shut down the worker {@link EventLoopGroup} when ...
[ "Sets", "the", "worker", "{", "@link", "EventLoopGroup", "}", "which", "is", "responsible", "for", "performing", "socket", "I", "/", "O", "and", "running", "{", "@link", "Service#serve", "(", "ServiceRequestContext", "Request", ")", "}", ".", "If", "not", "s...
train
https://github.com/line/armeria/blob/67d29e019fd35a35f89c45cc8f9119ff9b12b44d/core/src/main/java/com/linecorp/armeria/server/ServerBuilder.java#L419-L423
apollographql/apollo-android
apollo-runtime/src/main/java/com/apollographql/apollo/internal/json/JsonUtf8Writer.java
JsonUtf8Writer.open
private JsonWriter open(int empty, String openBracket) throws IOException { """ Enters a new scope by appending any necessary whitespace and the given bracket. """ beforeValue(); pushScope(empty); pathIndices[stackSize - 1] = 0; sink.writeUtf8(openBracket); return this; }
java
private JsonWriter open(int empty, String openBracket) throws IOException { beforeValue(); pushScope(empty); pathIndices[stackSize - 1] = 0; sink.writeUtf8(openBracket); return this; }
[ "private", "JsonWriter", "open", "(", "int", "empty", ",", "String", "openBracket", ")", "throws", "IOException", "{", "beforeValue", "(", ")", ";", "pushScope", "(", "empty", ")", ";", "pathIndices", "[", "stackSize", "-", "1", "]", "=", "0", ";", "sink...
Enters a new scope by appending any necessary whitespace and the given bracket.
[ "Enters", "a", "new", "scope", "by", "appending", "any", "necessary", "whitespace", "and", "the", "given", "bracket", "." ]
train
https://github.com/apollographql/apollo-android/blob/a78869a76e17f77e42c7a88f0099914fe7ffa5b6/apollo-runtime/src/main/java/com/apollographql/apollo/internal/json/JsonUtf8Writer.java#L104-L110
kuali/ojb-1.0.4
src/java/org/apache/ojb/broker/accesslayer/sql/SqlSelectStatement.java
SqlSelectStatement.appendListOfColumns
protected List appendListOfColumns(String[] columns, StringBuffer buf) { """ Appends to the statement a comma separated list of column names. @param columns defines the columns to be selected (for reports) @return list of column names """ ArrayList columnList = new ArrayList(); for (int...
java
protected List appendListOfColumns(String[] columns, StringBuffer buf) { ArrayList columnList = new ArrayList(); for (int i = 0; i < columns.length; i++) { if (i > 0) { buf.append(","); } appendColName(columns[i], fal...
[ "protected", "List", "appendListOfColumns", "(", "String", "[", "]", "columns", ",", "StringBuffer", "buf", ")", "{", "ArrayList", "columnList", "=", "new", "ArrayList", "(", ")", ";", "for", "(", "int", "i", "=", "0", ";", "i", "<", "columns", ".", "l...
Appends to the statement a comma separated list of column names. @param columns defines the columns to be selected (for reports) @return list of column names
[ "Appends", "to", "the", "statement", "a", "comma", "separated", "list", "of", "column", "names", "." ]
train
https://github.com/kuali/ojb-1.0.4/blob/9a544372f67ce965f662cdc71609dd03683c8f04/src/java/org/apache/ojb/broker/accesslayer/sql/SqlSelectStatement.java#L248-L262
nominanuda/zen-project
zen-core/src/main/java/com/nominanuda/zen/xml/DOMBuilder.java
DOMBuilder.ignorableWhitespace
public void ignorableWhitespace(char ch[], int start, int length) throws SAXException { """ Receive notification of ignorable whitespace in element content. <p> Validating Parsers must use this method to report each chunk of ignorable whitespace (see the W3C XML 1.0 recommendation, section 2.10): non-vali...
java
public void ignorableWhitespace(char ch[], int start, int length) throws SAXException { if (isOutsideDocElem()) return; // avoid DOM006 Hierarchy request error String s = new String(ch, start, length); append(m_doc.createTextNode(s)); }
[ "public", "void", "ignorableWhitespace", "(", "char", "ch", "[", "]", ",", "int", "start", ",", "int", "length", ")", "throws", "SAXException", "{", "if", "(", "isOutsideDocElem", "(", ")", ")", "return", ";", "// avoid DOM006 Hierarchy request error", "String",...
Receive notification of ignorable whitespace in element content. <p> Validating Parsers must use this method to report each chunk of ignorable whitespace (see the W3C XML 1.0 recommendation, section 2.10): non-validating parsers may also use this method if they are capable of parsing and using content models. </p> <p...
[ "Receive", "notification", "of", "ignorable", "whitespace", "in", "element", "content", "." ]
train
https://github.com/nominanuda/zen-project/blob/fe48ae8da198eb7066c2b56bf2ffafe4cdfc451d/zen-core/src/main/java/com/nominanuda/zen/xml/DOMBuilder.java#L565-L573
diffplug/durian
src/com/diffplug/common/base/TreeQuery.java
TreeQuery.copyLeavesIn
public static <T, CopyType> CopyType copyLeavesIn(TreeDef<T> def, T root, BiFunction<T, List<CopyType>, CopyType> nodeMapper) { """ Copies the given tree of T to CopyType, starting at the leaf nodes of the tree and moving in to the root node, which allows CopyType to be immutable (but does not require it). @p...
java
public static <T, CopyType> CopyType copyLeavesIn(TreeDef<T> def, T root, BiFunction<T, List<CopyType>, CopyType> nodeMapper) { List<CopyType> childrenMapped = def.childrenOf(root).stream().map(child -> { return copyLeavesIn(def, child, nodeMapper); }).collect(Collectors.toList()); return nodeMapper.apply(root...
[ "public", "static", "<", "T", ",", "CopyType", ">", "CopyType", "copyLeavesIn", "(", "TreeDef", "<", "T", ">", "def", ",", "T", "root", ",", "BiFunction", "<", "T", ",", "List", "<", "CopyType", ">", ",", "CopyType", ">", "nodeMapper", ")", "{", "Lis...
Copies the given tree of T to CopyType, starting at the leaf nodes of the tree and moving in to the root node, which allows CopyType to be immutable (but does not require it). @param def defines the structure of the tree @param root root of the tree @param nodeMapper given an unmapped node, and a list of CopyType no...
[ "Copies", "the", "given", "tree", "of", "T", "to", "CopyType", "starting", "at", "the", "leaf", "nodes", "of", "the", "tree", "and", "moving", "in", "to", "the", "root", "node", "which", "allows", "CopyType", "to", "be", "immutable", "(", "but", "does", ...
train
https://github.com/diffplug/durian/blob/10631a3480e5491eb6eb6ee06e752d8596914232/src/com/diffplug/common/base/TreeQuery.java#L87-L92
authlete/authlete-java-common
src/main/java/com/authlete/common/api/AuthleteApiImpl.java
AuthleteApiImpl.callServiceOwnerPostApi
private <TResponse> TResponse callServiceOwnerPostApi( String path, Map<String, String> queryParams, Object requestBody, Class<TResponse> responseClass) throws AuthleteApiException { """ Call an API with HTTP POST method and Service Owner credentials. """ return callPostApi(mSer...
java
private <TResponse> TResponse callServiceOwnerPostApi( String path, Map<String, String> queryParams, Object requestBody, Class<TResponse> responseClass) throws AuthleteApiException { return callPostApi(mServiceOwnerCredentials, path, queryParams, requestBody, responseClass); }
[ "private", "<", "TResponse", ">", "TResponse", "callServiceOwnerPostApi", "(", "String", "path", ",", "Map", "<", "String", ",", "String", ">", "queryParams", ",", "Object", "requestBody", ",", "Class", "<", "TResponse", ">", "responseClass", ")", "throws", "A...
Call an API with HTTP POST method and Service Owner credentials.
[ "Call", "an", "API", "with", "HTTP", "POST", "method", "and", "Service", "Owner", "credentials", "." ]
train
https://github.com/authlete/authlete-java-common/blob/49c94c483713cbf5a04d805ff7dbd83766c9c964/src/main/java/com/authlete/common/api/AuthleteApiImpl.java#L315-L320
Azure/azure-sdk-for-java
network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/VirtualWANsInner.java
VirtualWANsInner.updateTagsAsync
public Observable<VirtualWANInner> updateTagsAsync(String resourceGroupName, String virtualWANName, Map<String, String> tags) { """ Updates a VirtualWAN tags. @param resourceGroupName The resource group name of the VirtualWan. @param virtualWANName The name of the VirtualWAN being updated. @param tags Resourc...
java
public Observable<VirtualWANInner> updateTagsAsync(String resourceGroupName, String virtualWANName, Map<String, String> tags) { return updateTagsWithServiceResponseAsync(resourceGroupName, virtualWANName, tags).map(new Func1<ServiceResponse<VirtualWANInner>, VirtualWANInner>() { @Override ...
[ "public", "Observable", "<", "VirtualWANInner", ">", "updateTagsAsync", "(", "String", "resourceGroupName", ",", "String", "virtualWANName", ",", "Map", "<", "String", ",", "String", ">", "tags", ")", "{", "return", "updateTagsWithServiceResponseAsync", "(", "resour...
Updates a VirtualWAN tags. @param resourceGroupName The resource group name of the VirtualWan. @param virtualWANName The name of the VirtualWAN being updated. @param tags Resource tags. @throws IllegalArgumentException thrown if parameters fail the validation @return the observable for the request
[ "Updates", "a", "VirtualWAN", "tags", "." ]
train
https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/VirtualWANsInner.java#L475-L482
zeroturnaround/zt-zip
src/main/java/org/zeroturnaround/zip/ZipUtil.java
ZipUtil.replaceEntries
public static boolean replaceEntries(final File zip, final ZipEntrySource[] entries) { """ Changes an existing ZIP file: replaces a given entry in it. @param zip an existing ZIP file. @param entries new ZIP entries to be replaced with. @return <code>true</code> if at least one entry was replaced. """ ...
java
public static boolean replaceEntries(final File zip, final ZipEntrySource[] entries) { return operateInPlace(zip, new InPlaceAction() { public boolean act(File tmpFile) { return replaceEntries(zip, entries, tmpFile); } }); }
[ "public", "static", "boolean", "replaceEntries", "(", "final", "File", "zip", ",", "final", "ZipEntrySource", "[", "]", "entries", ")", "{", "return", "operateInPlace", "(", "zip", ",", "new", "InPlaceAction", "(", ")", "{", "public", "boolean", "act", "(", ...
Changes an existing ZIP file: replaces a given entry in it. @param zip an existing ZIP file. @param entries new ZIP entries to be replaced with. @return <code>true</code> if at least one entry was replaced.
[ "Changes", "an", "existing", "ZIP", "file", ":", "replaces", "a", "given", "entry", "in", "it", "." ]
train
https://github.com/zeroturnaround/zt-zip/blob/abb4dc43583e4d19339c0c021035019798970a13/src/main/java/org/zeroturnaround/zip/ZipUtil.java#L2673-L2679
trellis-ldp/trellis
components/webdav/src/main/java/org/trellisldp/webdav/impl/WebDAVUtils.java
WebDAVUtils.recursiveCopy
public static CompletionStage<Void> recursiveCopy(final ServiceBundler services, final Session session, final Resource resource, final IRI destination, final String baseUrl) { """ Recursively copy the resources under the provided identifier. @param services the trellis service @param session the sess...
java
public static CompletionStage<Void> recursiveCopy(final ServiceBundler services, final Session session, final Resource resource, final IRI destination, final String baseUrl) { final List<IRI> resources = resource.stream(LDP.PreferContainment).map(Quad::getObject) .filter(IRI.class::isIns...
[ "public", "static", "CompletionStage", "<", "Void", ">", "recursiveCopy", "(", "final", "ServiceBundler", "services", ",", "final", "Session", "session", ",", "final", "Resource", "resource", ",", "final", "IRI", "destination", ",", "final", "String", "baseUrl", ...
Recursively copy the resources under the provided identifier. @param services the trellis service @param session the session @param resource the resource @param destination the destination identifier @param baseUrl the baseURL @return the next stage of completion
[ "Recursively", "copy", "the", "resources", "under", "the", "provided", "identifier", "." ]
train
https://github.com/trellis-ldp/trellis/blob/789fd7a3df86cab7ebba63e72bf4e58397e5f42d/components/webdav/src/main/java/org/trellisldp/webdav/impl/WebDAVUtils.java#L110-L118
UrielCh/ovh-java-sdk
ovh-java-sdk-sms/src/main/java/net/minidev/ovh/api/ApiOvhSms.java
ApiOvhSms.serviceName_document_GET
public String serviceName_document_GET(String serviceName, Date creationDatetime_from, Date creationDatetime_to, String tag, OvhDocumentWayTypeEnum wayType) throws IOException { """ Get the /me/document id generated REST: GET /sms/{serviceName}/document @param wayType [required] specify outgoing or incoming sm...
java
public String serviceName_document_GET(String serviceName, Date creationDatetime_from, Date creationDatetime_to, String tag, OvhDocumentWayTypeEnum wayType) throws IOException { String qPath = "/sms/{serviceName}/document"; StringBuilder sb = path(qPath, serviceName); query(sb, "creationDatetime.from", creationDa...
[ "public", "String", "serviceName_document_GET", "(", "String", "serviceName", ",", "Date", "creationDatetime_from", ",", "Date", "creationDatetime_to", ",", "String", "tag", ",", "OvhDocumentWayTypeEnum", "wayType", ")", "throws", "IOException", "{", "String", "qPath", ...
Get the /me/document id generated REST: GET /sms/{serviceName}/document @param wayType [required] specify outgoing or incoming sms @param tag [required] Select sms with a specific identifier group tag @param creationDatetime_to [required] Filter the value of creationDatetime property (<=) @param creationDatetime_from ...
[ "Get", "the", "/", "me", "/", "document", "id", "generated" ]
train
https://github.com/UrielCh/ovh-java-sdk/blob/6d531a40e56e09701943e334c25f90f640c55701/ovh-java-sdk-sms/src/main/java/net/minidev/ovh/api/ApiOvhSms.java#L1704-L1713
alkacon/opencms-core
src-setup/org/opencms/setup/xml/CmsSetupXmlHelper.java
CmsSetupXmlHelper.getValue
public String getValue(String xmlFilename, String xPath) throws CmsXmlException { """ Returns the value in the given xpath of the given xml file.<p> @param xmlFilename the xml config file (could be relative to the base path) @param xPath the xpath to read (should select a single node or attribute) @return t...
java
public String getValue(String xmlFilename, String xPath) throws CmsXmlException { return getValue(getDocument(xmlFilename), xPath); }
[ "public", "String", "getValue", "(", "String", "xmlFilename", ",", "String", "xPath", ")", "throws", "CmsXmlException", "{", "return", "getValue", "(", "getDocument", "(", "xmlFilename", ")", ",", "xPath", ")", ";", "}" ]
Returns the value in the given xpath of the given xml file.<p> @param xmlFilename the xml config file (could be relative to the base path) @param xPath the xpath to read (should select a single node or attribute) @return the value in the given xpath of the given xml file, or <code>null</code> if no matching node @th...
[ "Returns", "the", "value", "in", "the", "given", "xpath", "of", "the", "given", "xml", "file", ".", "<p", ">" ]
train
https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src-setup/org/opencms/setup/xml/CmsSetupXmlHelper.java#L425-L428
codegist/crest
core/src/main/java/org/codegist/crest/CRest.java
CRest.getBasicAuthInstance
public static CRest getBasicAuthInstance(String username, String password) { """ <p>Build a <b>CRest</b> instance that authenticate all request using Basic Auth.</p> @param username user name to authenticate the requests with @param password password to authenticate the requests with @return a <b>CRest</b> inst...
java
public static CRest getBasicAuthInstance(String username, String password){ return basicAuth(username, password).build(); }
[ "public", "static", "CRest", "getBasicAuthInstance", "(", "String", "username", ",", "String", "password", ")", "{", "return", "basicAuth", "(", "username", ",", "password", ")", ".", "build", "(", ")", ";", "}" ]
<p>Build a <b>CRest</b> instance that authenticate all request using Basic Auth.</p> @param username user name to authenticate the requests with @param password password to authenticate the requests with @return a <b>CRest</b> instance @see org.codegist.crest.CRestBuilder#basicAuth(String, String)
[ "<p", ">", "Build", "a", "<b", ">", "CRest<", "/", "b", ">", "instance", "that", "authenticate", "all", "request", "using", "Basic", "Auth", ".", "<", "/", "p", ">" ]
train
https://github.com/codegist/crest/blob/e99ba7728b27d2ddb2c247261350f1b6fa7a6698/core/src/main/java/org/codegist/crest/CRest.java#L126-L128