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
easymock/objenesis
tck/src/main/java/org/objenesis/tck/search/ClassEnumerator.java
ClassEnumerator.getClassesForPackage
public static SortedSet<String> getClassesForPackage(Package pkg, ClassLoader classLoader) { """ Return all the classes in this package recursively. @param pkg the searched package @param classLoader class loader where to look for classes @return list of full class names """ SortedSet<String> clas...
java
public static SortedSet<String> getClassesForPackage(Package pkg, ClassLoader classLoader) { SortedSet<String> classes = new TreeSet<>(new Comparator<String>() { public int compare(String o1, String o2) { String simpleName1 = getSimpleName(o1); String simpleName2 = getSimp...
[ "public", "static", "SortedSet", "<", "String", ">", "getClassesForPackage", "(", "Package", "pkg", ",", "ClassLoader", "classLoader", ")", "{", "SortedSet", "<", "String", ">", "classes", "=", "new", "TreeSet", "<>", "(", "new", "Comparator", "<", "String", ...
Return all the classes in this package recursively. @param pkg the searched package @param classLoader class loader where to look for classes @return list of full class names
[ "Return", "all", "the", "classes", "in", "this", "package", "recursively", "." ]
train
https://github.com/easymock/objenesis/blob/8f601c8ba1aa20bbc640e2c2bc48d55df52c489f/tck/src/main/java/org/objenesis/tck/search/ClassEnumerator.java#L97-L131
jtablesaw/tablesaw
core/src/main/java/tech/tablesaw/table/TableSliceGroup.java
TableSliceGroup.aggregate
public Table aggregate(String colName1, AggregateFunction<?,?>... functions) { """ Applies the given aggregation to the given column. The apply and combine steps of a split-apply-combine. """ ArrayListMultimap<String, AggregateFunction<?,?>> columnFunctionMap = ArrayListMultimap.create(); colu...
java
public Table aggregate(String colName1, AggregateFunction<?,?>... functions) { ArrayListMultimap<String, AggregateFunction<?,?>> columnFunctionMap = ArrayListMultimap.create(); columnFunctionMap.putAll(colName1, Lists.newArrayList(functions)); return aggregate(columnFunctionMap); }
[ "public", "Table", "aggregate", "(", "String", "colName1", ",", "AggregateFunction", "<", "?", ",", "?", ">", "...", "functions", ")", "{", "ArrayListMultimap", "<", "String", ",", "AggregateFunction", "<", "?", ",", "?", ">", ">", "columnFunctionMap", "=", ...
Applies the given aggregation to the given column. The apply and combine steps of a split-apply-combine.
[ "Applies", "the", "given", "aggregation", "to", "the", "given", "column", ".", "The", "apply", "and", "combine", "steps", "of", "a", "split", "-", "apply", "-", "combine", "." ]
train
https://github.com/jtablesaw/tablesaw/blob/68a75b4098ac677e9486df5572cf13ec39f9f701/core/src/main/java/tech/tablesaw/table/TableSliceGroup.java#L138-L142
iipc/openwayback
wayback-core/src/main/java/org/archive/wayback/util/ByteOp.java
ByteOp.discardStreamCount
public static long discardStreamCount(InputStream is,int size) throws IOException { """ throw away all bytes from stream argument, and count how many bytes were discarded before reaching the end of the stream. @param is InputStream to read and discard @param size number of bytes to read at once from the stream ...
java
public static long discardStreamCount(InputStream is,int size) throws IOException { long count = 0; byte[] buffer = new byte[size]; int amt = 0; while((amt = is.read(buffer, 0, size)) != -1) { count += amt; } return count; }
[ "public", "static", "long", "discardStreamCount", "(", "InputStream", "is", ",", "int", "size", ")", "throws", "IOException", "{", "long", "count", "=", "0", ";", "byte", "[", "]", "buffer", "=", "new", "byte", "[", "size", "]", ";", "int", "amt", "=",...
throw away all bytes from stream argument, and count how many bytes were discarded before reaching the end of the stream. @param is InputStream to read and discard @param size number of bytes to read at once from the stream @return the number of bytes discarded @throws IOException when is throws one
[ "throw", "away", "all", "bytes", "from", "stream", "argument", "and", "count", "how", "many", "bytes", "were", "discarded", "before", "reaching", "the", "end", "of", "the", "stream", "." ]
train
https://github.com/iipc/openwayback/blob/da74c3a59a5b5a5c365bd4702dcb45d263535794/wayback-core/src/main/java/org/archive/wayback/util/ByteOp.java#L113-L121
Wadpam/guja
guja-core/src/main/java/com/wadpam/guja/i18n/dao/GeneratedDi18nDaoImpl.java
GeneratedDi18nDaoImpl.queryByLocalizedMessage
public Iterable<Di18n> queryByLocalizedMessage(java.lang.String localizedMessage) { """ query-by method for field localizedMessage @param localizedMessage the specified attribute @return an Iterable of Di18ns for the specified localizedMessage """ return queryByField(null, Di18nMapper.Field.LOCALIZEDMESS...
java
public Iterable<Di18n> queryByLocalizedMessage(java.lang.String localizedMessage) { return queryByField(null, Di18nMapper.Field.LOCALIZEDMESSAGE.getFieldName(), localizedMessage); }
[ "public", "Iterable", "<", "Di18n", ">", "queryByLocalizedMessage", "(", "java", ".", "lang", ".", "String", "localizedMessage", ")", "{", "return", "queryByField", "(", "null", ",", "Di18nMapper", ".", "Field", ".", "LOCALIZEDMESSAGE", ".", "getFieldName", "(",...
query-by method for field localizedMessage @param localizedMessage the specified attribute @return an Iterable of Di18ns for the specified localizedMessage
[ "query", "-", "by", "method", "for", "field", "localizedMessage" ]
train
https://github.com/Wadpam/guja/blob/eb8ba8e6794a96ea0dd9744cada4f9ad9618f114/guja-core/src/main/java/com/wadpam/guja/i18n/dao/GeneratedDi18nDaoImpl.java#L88-L90
hypfvieh/java-utils
src/main/java/com/github/hypfvieh/util/FileIoUtil.java
FileIoUtil.readTextFileFromStream
public static List<String> readTextFileFromStream(InputStream _input, Charset _charset, boolean _silent) { """ Reads a text file from given {@link InputStream} using the given {@link Charset}. @param _input stream to read @param _charset charset to use @param _silent true to disable exception logging, false oth...
java
public static List<String> readTextFileFromStream(InputStream _input, Charset _charset, boolean _silent) { if (_input == null) { return null; } try { List<String> fileContent; try (BufferedReader dis = new BufferedReader(new InputStreamReader(_input, _charset)...
[ "public", "static", "List", "<", "String", ">", "readTextFileFromStream", "(", "InputStream", "_input", ",", "Charset", "_charset", ",", "boolean", "_silent", ")", "{", "if", "(", "_input", "==", "null", ")", "{", "return", "null", ";", "}", "try", "{", ...
Reads a text file from given {@link InputStream} using the given {@link Charset}. @param _input stream to read @param _charset charset to use @param _silent true to disable exception logging, false otherwise @return List of string or null on error
[ "Reads", "a", "text", "file", "from", "given", "{" ]
train
https://github.com/hypfvieh/java-utils/blob/407c32d6b485596d4d2b644f5f7fc7a02d0169c6/src/main/java/com/github/hypfvieh/util/FileIoUtil.java#L210-L232
ManfredTremmel/gwt-commons-lang3
src/main/java/org/apache/commons/lang3/math/NumberUtils.java
NumberUtils.toFloat
public static float toFloat(final String str, final float defaultValue) { """ <p>Convert a <code>String</code> to a <code>float</code>, returning a default value if the conversion fails.</p> <p>If the string <code>str</code> is <code>null</code>, the default value is returned.</p> <pre> NumberUtils.toFloa...
java
public static float toFloat(final String str, final float defaultValue) { if (str == null) { return defaultValue; } try { return Float.parseFloat(str); } catch (final NumberFormatException nfe) { return defaultValue; } }
[ "public", "static", "float", "toFloat", "(", "final", "String", "str", ",", "final", "float", "defaultValue", ")", "{", "if", "(", "str", "==", "null", ")", "{", "return", "defaultValue", ";", "}", "try", "{", "return", "Float", ".", "parseFloat", "(", ...
<p>Convert a <code>String</code> to a <code>float</code>, returning a default value if the conversion fails.</p> <p>If the string <code>str</code> is <code>null</code>, the default value is returned.</p> <pre> NumberUtils.toFloat(null, 1.1f) = 1.0f NumberUtils.toFloat("", 1.1f) = 1.1f NumberUtils.toFloat("1.5",...
[ "<p", ">", "Convert", "a", "<code", ">", "String<", "/", "code", ">", "to", "a", "<code", ">", "float<", "/", "code", ">", "returning", "a", "default", "value", "if", "the", "conversion", "fails", ".", "<", "/", "p", ">" ]
train
https://github.com/ManfredTremmel/gwt-commons-lang3/blob/9e2dfbbda3668cfa5d935fe76479d1426c294504/src/main/java/org/apache/commons/lang3/math/NumberUtils.java#L221-L230
vladmihalcea/flexy-pool
flexy-pool-core/src/main/java/com/vladmihalcea/flexypool/util/ReflectionUtils.java
ReflectionUtils.setFieldValue
public static void setFieldValue(Object target, String fieldName, Object value) { """ Set target object field value @param target target object @param fieldName field name @param value field value """ try { Field field = target.getClass().getDeclaredField(fieldName); ...
java
public static void setFieldValue(Object target, String fieldName, Object value) { try { Field field = target.getClass().getDeclaredField(fieldName); field.setAccessible(true); field.set(target, value); } catch (NoSuchFieldException e) { throw handleExcepti...
[ "public", "static", "void", "setFieldValue", "(", "Object", "target", ",", "String", "fieldName", ",", "Object", "value", ")", "{", "try", "{", "Field", "field", "=", "target", ".", "getClass", "(", ")", ".", "getDeclaredField", "(", "fieldName", ")", ";",...
Set target object field value @param target target object @param fieldName field name @param value field value
[ "Set", "target", "object", "field", "value" ]
train
https://github.com/vladmihalcea/flexy-pool/blob/d763d359e68299c2b4e28e4b67770581ae083431/flexy-pool-core/src/main/java/com/vladmihalcea/flexypool/util/ReflectionUtils.java#L56-L66
unbescape/unbescape
src/main/java/org/unbescape/uri/UriEscape.java
UriEscape.escapeUriFragmentId
public static void escapeUriFragmentId(final String text, final Writer writer, final String encoding) throws IOException { """ <p> Perform am URI fragment identifier <strong>escape</strong> operation on a <tt>String</tt> input, writing results to a <tt>Writer</tt>. </p> <p> The following are the o...
java
public static void escapeUriFragmentId(final String text, final Writer writer, final String encoding) throws IOException { if (writer == null) { throw new IllegalArgumentException("Argument 'writer' cannot be null"); } if (encoding == null) { throw new Illeg...
[ "public", "static", "void", "escapeUriFragmentId", "(", "final", "String", "text", ",", "final", "Writer", "writer", ",", "final", "String", "encoding", ")", "throws", "IOException", "{", "if", "(", "writer", "==", "null", ")", "{", "throw", "new", "IllegalA...
<p> Perform am URI fragment identifier <strong>escape</strong> operation on a <tt>String</tt> input, writing results to a <tt>Writer</tt>. </p> <p> The following are the only allowed chars in an URI fragment identifier (will not be escaped): </p> <ul> <li><tt>A-Z a-z 0-9</tt></li> <li><tt>- . _ ~</tt></li> <li><tt>! $ ...
[ "<p", ">", "Perform", "am", "URI", "fragment", "identifier", "<strong", ">", "escape<", "/", "strong", ">", "operation", "on", "a", "<tt", ">", "String<", "/", "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#L744-L757
casmi/casmi
src/main/java/casmi/graphics/element/Curve.java
Curve.curvePoint
public double curvePoint(XYZ vec, float t) { """ Evaluates the curve at point t. @param vec The coordinate to get the location of a curve at t. @param t value between 0 and 1 """ double tmp = 0; switch (vec) { case X: tmp = catmullRom(points[0], points[3], points[6], poi...
java
public double curvePoint(XYZ vec, float t) { double tmp = 0; switch (vec) { case X: tmp = catmullRom(points[0], points[3], points[6], points[9], t); break; case Y: tmp = catmullRom(points[1], points[4], points[7], points[10], t); break; ...
[ "public", "double", "curvePoint", "(", "XYZ", "vec", ",", "float", "t", ")", "{", "double", "tmp", "=", "0", ";", "switch", "(", "vec", ")", "{", "case", "X", ":", "tmp", "=", "catmullRom", "(", "points", "[", "0", "]", ",", "points", "[", "3", ...
Evaluates the curve at point t. @param vec The coordinate to get the location of a curve at t. @param t value between 0 and 1
[ "Evaluates", "the", "curve", "at", "point", "t", "." ]
train
https://github.com/casmi/casmi/blob/90f6514a9cbce0685186e7a92beb69e22a3b11c4/src/main/java/casmi/graphics/element/Curve.java#L466-L479
looly/hutool
hutool-crypto/src/main/java/cn/hutool/crypto/KeyUtil.java
KeyUtil.generateKeyPair
public static KeyPair generateKeyPair(String algorithm, AlgorithmParameterSpec params) { """ 生成用于非对称加密的公钥和私钥<br> 密钥对生成算法见:https://docs.oracle.com/javase/7/docs/technotes/guides/security/StandardNames.html#KeyPairGenerator @param algorithm 非对称加密算法 @param params {@link AlgorithmParameterSpec} @return {@link Ke...
java
public static KeyPair generateKeyPair(String algorithm, AlgorithmParameterSpec params) { return generateKeyPair(algorithm, null, params); }
[ "public", "static", "KeyPair", "generateKeyPair", "(", "String", "algorithm", ",", "AlgorithmParameterSpec", "params", ")", "{", "return", "generateKeyPair", "(", "algorithm", ",", "null", ",", "params", ")", ";", "}" ]
生成用于非对称加密的公钥和私钥<br> 密钥对生成算法见:https://docs.oracle.com/javase/7/docs/technotes/guides/security/StandardNames.html#KeyPairGenerator @param algorithm 非对称加密算法 @param params {@link AlgorithmParameterSpec} @return {@link KeyPair} @since 4.3.3
[ "生成用于非对称加密的公钥和私钥<br", ">", "密钥对生成算法见:https", ":", "//", "docs", ".", "oracle", ".", "com", "/", "javase", "/", "7", "/", "docs", "/", "technotes", "/", "guides", "/", "security", "/", "StandardNames", ".", "html#KeyPairGenerator" ]
train
https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-crypto/src/main/java/cn/hutool/crypto/KeyUtil.java#L364-L366
sshtools/j2ssh-maverick
j2ssh-maverick/src/main/java/com/sshtools/ssh2/TransportProtocol.java
TransportProtocol.startService
public void startService(String servicename) throws SshException { """ Request that the remote server starts a transport protocol service. This is only available in CLIENT_MODE. @param servicename @throws IOException """ ByteArrayWriter baw = new ByteArrayWriter(); try { baw.write(SSH_MSG_SERVICE...
java
public void startService(String servicename) throws SshException { ByteArrayWriter baw = new ByteArrayWriter(); try { baw.write(SSH_MSG_SERVICE_REQUEST); baw.writeString(servicename); if (Log.isDebugEnabled()) { Log.debug(this, "Sending SSH_MSG_SERVICE_REQUEST"); } sendMessage(baw.toByteArray...
[ "public", "void", "startService", "(", "String", "servicename", ")", "throws", "SshException", "{", "ByteArrayWriter", "baw", "=", "new", "ByteArrayWriter", "(", ")", ";", "try", "{", "baw", ".", "write", "(", "SSH_MSG_SERVICE_REQUEST", ")", ";", "baw", ".", ...
Request that the remote server starts a transport protocol service. This is only available in CLIENT_MODE. @param servicename @throws IOException
[ "Request", "that", "the", "remote", "server", "starts", "a", "transport", "protocol", "service", ".", "This", "is", "only", "available", "in", "CLIENT_MODE", "." ]
train
https://github.com/sshtools/j2ssh-maverick/blob/ce11ceaf0aa0b129b54327a6891973e1e34689f7/j2ssh-maverick/src/main/java/com/sshtools/ssh2/TransportProtocol.java#L1383-L1415
OpenLiberty/open-liberty
dev/com.ibm.ws.jmx.connector.server.rest/src/com/ibm/ws/jmx/connector/server/rest/notification/ClientNotificationArea.java
ClientNotificationArea.toNotificationTargetInformation
private NotificationTargetInformation toNotificationTargetInformation(RESTRequest request, String objectName) { """ Builds an instance of NotificationTargetInformation from the headers of an RESTRequest and a JMX ObjectName (as a string). """ //Handle incoming routing context (if applicable) St...
java
private NotificationTargetInformation toNotificationTargetInformation(RESTRequest request, String objectName) { //Handle incoming routing context (if applicable) String[] routingContext = RESTHelper.getRoutingContext(request, false); if (routingContext != null) { return new Notifica...
[ "private", "NotificationTargetInformation", "toNotificationTargetInformation", "(", "RESTRequest", "request", ",", "String", "objectName", ")", "{", "//Handle incoming routing context (if applicable)", "String", "[", "]", "routingContext", "=", "RESTHelper", ".", "getRoutingCon...
Builds an instance of NotificationTargetInformation from the headers of an RESTRequest and a JMX ObjectName (as a string).
[ "Builds", "an", "instance", "of", "NotificationTargetInformation", "from", "the", "headers", "of", "an", "RESTRequest", "and", "a", "JMX", "ObjectName", "(", "as", "a", "string", ")", "." ]
train
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.jmx.connector.server.rest/src/com/ibm/ws/jmx/connector/server/rest/notification/ClientNotificationArea.java#L211-L220
CloudSlang/cs-actions
cs-utilities/src/main/java/io/cloudslang/content/utilities/actions/FindTextInPdf.java
FindTextInPdf.execute
@Action(name = "Find Text in PDF", description = FIND_TEXT_IN_PDF_OPERATION_DESC, outputs = { """ This operation checks if a text input is found in a PDF file. @param text The text to be searched for in the PDF file. @param ignoreCase Whether to ignore if characters of the text ar...
java
@Action(name = "Find Text in PDF", description = FIND_TEXT_IN_PDF_OPERATION_DESC, outputs = { @Output(value = RETURN_CODE, description = RETURN_CODE_DESC), @Output(value = RETURN_RESULT, description = FIND_TEXT_IN_PDF_RETURN_RESULT_DESC), ...
[ "@", "Action", "(", "name", "=", "\"Find Text in PDF\"", ",", "description", "=", "FIND_TEXT_IN_PDF_OPERATION_DESC", ",", "outputs", "=", "{", "@", "Output", "(", "value", "=", "RETURN_CODE", ",", "description", "=", "RETURN_CODE_DESC", ")", ",", "@", "Output", ...
This operation checks if a text input is found in a PDF file. @param text The text to be searched for in the PDF file. @param ignoreCase Whether to ignore if characters of the text are lowercase or uppercase. Valid values: "true", "false". Default Value: "false" @param pathToFile The full path to the PDF file. @...
[ "This", "operation", "checks", "if", "a", "text", "input", "is", "found", "in", "a", "PDF", "file", "." ]
train
https://github.com/CloudSlang/cs-actions/blob/9a1be1e99ad88286a6c153d5f2275df6ae1a57a1/cs-utilities/src/main/java/io/cloudslang/content/utilities/actions/FindTextInPdf.java#L72-L102
apache/flink
flink-core/src/main/java/org/apache/flink/api/java/typeutils/runtime/PojoFieldUtils.java
PojoFieldUtils.readField
static Field readField(DataInputView in, ClassLoader userCodeClassLoader) throws IOException { """ Reads a field from the given {@link DataInputView}. <p>This read methods avoids Java serialization, by reading the classname of the field's declaring class and dynamically loading it. The field is also read by fi...
java
static Field readField(DataInputView in, ClassLoader userCodeClassLoader) throws IOException { Class<?> declaringClass = InstantiationUtil.resolveClassByName(in, userCodeClassLoader); String fieldName = in.readUTF(); return getField(fieldName, declaringClass); }
[ "static", "Field", "readField", "(", "DataInputView", "in", ",", "ClassLoader", "userCodeClassLoader", ")", "throws", "IOException", "{", "Class", "<", "?", ">", "declaringClass", "=", "InstantiationUtil", ".", "resolveClassByName", "(", "in", ",", "userCodeClassLoa...
Reads a field from the given {@link DataInputView}. <p>This read methods avoids Java serialization, by reading the classname of the field's declaring class and dynamically loading it. The field is also read by field name and obtained via reflection. @param in the input view to read from. @param userCodeClassLoader th...
[ "Reads", "a", "field", "from", "the", "given", "{", "@link", "DataInputView", "}", "." ]
train
https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-core/src/main/java/org/apache/flink/api/java/typeutils/runtime/PojoFieldUtils.java#L62-L66
hypercube1024/firefly
firefly-common/src/main/java/com/firefly/utils/codec/HexUtils.java
HexUtils.readBigInteger
public static BigInteger readBigInteger(DataInputStream dis) throws IOException { """ Read a (reasonably short) BigInteger from a DataInputStream @param dis the stream to read from @return a BigInteger @throws IOException I/O exception """ short i = dis.readShort(); if (i < 0) ...
java
public static BigInteger readBigInteger(DataInputStream dis) throws IOException { short i = dis.readShort(); if (i < 0) throw new IOException("Invalid BigInteger length: " + i); byte[] buf = new byte[i]; dis.readFully(buf); return new BigInteger(1, buf); ...
[ "public", "static", "BigInteger", "readBigInteger", "(", "DataInputStream", "dis", ")", "throws", "IOException", "{", "short", "i", "=", "dis", ".", "readShort", "(", ")", ";", "if", "(", "i", "<", "0", ")", "throw", "new", "IOException", "(", "\"Invalid B...
Read a (reasonably short) BigInteger from a DataInputStream @param dis the stream to read from @return a BigInteger @throws IOException I/O exception
[ "Read", "a", "(", "reasonably", "short", ")", "BigInteger", "from", "a", "DataInputStream" ]
train
https://github.com/hypercube1024/firefly/blob/ed3fc75b7c54a65b1e7d8141d01b49144bb423a3/firefly-common/src/main/java/com/firefly/utils/codec/HexUtils.java#L165-L173
xvik/dropwizard-guicey
src/main/java/ru/vyarus/dropwizard/guice/module/yaml/ConfigTreeBuilder.java
ConfigTreeBuilder.build
public static ConfigurationTree build(final Bootstrap bootstrap, final Configuration configuration, final boolean introspect) { """ Analyze configuration object to extract bindable parts. @param bootstrap bootstrap instance ...
java
public static ConfigurationTree build(final Bootstrap bootstrap, final Configuration configuration, final boolean introspect) { final List<Class> roots = resolveRootTypes(new ArrayList<>(), configuration.getClass()); if ...
[ "public", "static", "ConfigurationTree", "build", "(", "final", "Bootstrap", "bootstrap", ",", "final", "Configuration", "configuration", ",", "final", "boolean", "introspect", ")", "{", "final", "List", "<", "Class", ">", "roots", "=", "resolveRootTypes", "(", ...
Analyze configuration object to extract bindable parts. @param bootstrap bootstrap instance @param configuration configuration instance @param introspect true to introspect configuration object and extract values by path and unique sub configurations @return parsed configuration info
[ "Analyze", "configuration", "object", "to", "extract", "bindable", "parts", "." ]
train
https://github.com/xvik/dropwizard-guicey/blob/dd39ad77283555be21f606d5ebf0f11207a733d4/src/main/java/ru/vyarus/dropwizard/guice/module/yaml/ConfigTreeBuilder.java#L98-L115
ozimov/cirneco
hamcrest/hamcrest-matchers/src/main/java/it/ozimov/cirneco/hamcrest/HamcrestMatchers.java
HamcrestMatchers.containsInAnyOrder
public static <T> Matcher<Iterable<? extends T>> containsInAnyOrder(final Iterable<T> items) { """ <p>Creates an order agnostic matcher for {@linkplain Iterable}s that matches when a single pass over the examined {@linkplain Iterable} yields a series of items, each logically equal to one item anywhere in the spec...
java
public static <T> Matcher<Iterable<? extends T>> containsInAnyOrder(final Iterable<T> items) { return IsIterableContainingInAnyOrder.containsInAnyOrder(items); }
[ "public", "static", "<", "T", ">", "Matcher", "<", "Iterable", "<", "?", "extends", "T", ">", ">", "containsInAnyOrder", "(", "final", "Iterable", "<", "T", ">", "items", ")", "{", "return", "IsIterableContainingInAnyOrder", ".", "containsInAnyOrder", "(", "...
<p>Creates an order agnostic matcher for {@linkplain Iterable}s that matches when a single pass over the examined {@linkplain Iterable} yields a series of items, each logically equal to one item anywhere in the specified items. For a positive match, the examined iterable must be of the same length as the number of spec...
[ "<p", ">", "Creates", "an", "order", "agnostic", "matcher", "for", "{", "@linkplain", "Iterable", "}", "s", "that", "matches", "when", "a", "single", "pass", "over", "the", "examined", "{", "@linkplain", "Iterable", "}", "yields", "a", "series", "of", "ite...
train
https://github.com/ozimov/cirneco/blob/78ad782da0a2256634cfbebb2f97ed78c993b999/hamcrest/hamcrest-matchers/src/main/java/it/ozimov/cirneco/hamcrest/HamcrestMatchers.java#L515-L517
xmlunit/xmlunit
xmlunit-core/src/main/java/org/xmlunit/diff/DefaultComparisonFormatter.java
DefaultComparisonFormatter.getValue
protected Object getValue(Object value, ComparisonType type) { """ May alter the display of a comparison value for {@link #getShortString} based on the comparison type. <p>This implementation returns {@code value} unless it is a comparison of node types in which case the numeric value (one of the constants def...
java
protected Object getValue(Object value, ComparisonType type) { return type == ComparisonType.NODE_TYPE ? nodeType((Short) value) : value; }
[ "protected", "Object", "getValue", "(", "Object", "value", ",", "ComparisonType", "type", ")", "{", "return", "type", "==", "ComparisonType", ".", "NODE_TYPE", "?", "nodeType", "(", "(", "Short", ")", "value", ")", ":", "value", ";", "}" ]
May alter the display of a comparison value for {@link #getShortString} based on the comparison type. <p>This implementation returns {@code value} unless it is a comparison of node types in which case the numeric value (one of the constants defined in the {@link Node} class) is mapped to a more useful String.</p> @pa...
[ "May", "alter", "the", "display", "of", "a", "comparison", "value", "for", "{", "@link", "#getShortString", "}", "based", "on", "the", "comparison", "type", "." ]
train
https://github.com/xmlunit/xmlunit/blob/fe3d701d43f57ee83dcba336e4c1555619d3084b/xmlunit-core/src/main/java/org/xmlunit/diff/DefaultComparisonFormatter.java#L96-L98
skuzzle/TinyPlugz
tiny-plugz/src/main/java/de/skuzzle/tinyplugz/util/Require.java
Require.nonNull
@NonNull public static <T> T nonNull(@Nullable T obj, String paramName) { """ Asserts that the given object is non null. @param <T> Type of the object to test. @param obj The object to test. @param paramName The name of the parameter (used for exception message). @return The object. @throws IllegalArgum...
java
@NonNull public static <T> T nonNull(@Nullable T obj, String paramName) { if (obj == null) { throw new IllegalArgumentException(String.format( "'%s' must not be null", paramName)); } return obj; }
[ "@", "NonNull", "public", "static", "<", "T", ">", "T", "nonNull", "(", "@", "Nullable", "T", "obj", ",", "String", "paramName", ")", "{", "if", "(", "obj", "==", "null", ")", "{", "throw", "new", "IllegalArgumentException", "(", "String", ".", "format...
Asserts that the given object is non null. @param <T> Type of the object to test. @param obj The object to test. @param paramName The name of the parameter (used for exception message). @return The object. @throws IllegalArgumentException If {@code obj} is null.
[ "Asserts", "that", "the", "given", "object", "is", "non", "null", "." ]
train
https://github.com/skuzzle/TinyPlugz/blob/739858ed0ba5a0c75b6ccf18df9a4d5612374a4b/tiny-plugz/src/main/java/de/skuzzle/tinyplugz/util/Require.java#L28-L35
RestComm/media-core
ice/src/main/java/org/restcomm/media/core/ice/IceComponent.java
IceComponent.addLocalCandidate
private void addLocalCandidate(LocalCandidateWrapper candidateWrapper, boolean sort) { """ Attempts to registers a local candidate. @param candidateWrapper The wrapper that contains the local ICE candidate @param sort Decides whether the candidates list should be ordered after insert """ IceCandidate ...
java
private void addLocalCandidate(LocalCandidateWrapper candidateWrapper, boolean sort) { IceCandidate candidate = candidateWrapper.getCandidate(); // Configure the candidate before registration candidate.setPriority(calculatePriority(candidate)); synchronized (this.localCandidates) { if (!this.localCandidate...
[ "private", "void", "addLocalCandidate", "(", "LocalCandidateWrapper", "candidateWrapper", ",", "boolean", "sort", ")", "{", "IceCandidate", "candidate", "=", "candidateWrapper", ".", "getCandidate", "(", ")", ";", "// Configure the candidate before registration", "candidate...
Attempts to registers a local candidate. @param candidateWrapper The wrapper that contains the local ICE candidate @param sort Decides whether the candidates list should be ordered after insert
[ "Attempts", "to", "registers", "a", "local", "candidate", "." ]
train
https://github.com/RestComm/media-core/blob/07b8703343708599f60af66bae62aded77ee81b5/ice/src/main/java/org/restcomm/media/core/ice/IceComponent.java#L117-L129
denisneuling/cctrl.jar
cctrl-api-client/src/main/java/com/cloudcontrolled/api/client/util/RequestUtil.java
RequestUtil.resolveAndSetQueryPart
public static <T> WebClient resolveAndSetQueryPart(Request<T> request, WebClient webClient) { """ <p>resolveAndSetQueryPart.</p> @param request a {@link com.cloudcontrolled.api.request.Request} object. @param webClient a {@link org.apache.cxf.jaxrs.client.WebClient} object. @param <T> a T object. @return a {...
java
public static <T> WebClient resolveAndSetQueryPart(Request<T> request, WebClient webClient) { HashMap<String, String> queryParts = resolveQueryPart(request); Iterator<String> iterator = queryParts.keySet().iterator(); if (!iterator.hasNext()) { return webClient; } else { while (iterator.hasNext()) { S...
[ "public", "static", "<", "T", ">", "WebClient", "resolveAndSetQueryPart", "(", "Request", "<", "T", ">", "request", ",", "WebClient", "webClient", ")", "{", "HashMap", "<", "String", ",", "String", ">", "queryParts", "=", "resolveQueryPart", "(", "request", ...
<p>resolveAndSetQueryPart.</p> @param request a {@link com.cloudcontrolled.api.request.Request} object. @param webClient a {@link org.apache.cxf.jaxrs.client.WebClient} object. @param <T> a T object. @return a {@link org.apache.cxf.jaxrs.client.WebClient} object. @since 0.1.1
[ "<p", ">", "resolveAndSetQueryPart", ".", "<", "/", "p", ">" ]
train
https://github.com/denisneuling/cctrl.jar/blob/37450d824f4dc5ecbcc81c61e48f1ec876ca2de8/cctrl-api-client/src/main/java/com/cloudcontrolled/api/client/util/RequestUtil.java#L114-L127
aws/aws-sdk-java
aws-java-sdk-api-gateway/src/main/java/com/amazonaws/services/apigateway/model/PutIntegrationResult.java
PutIntegrationResult.withRequestParameters
public PutIntegrationResult withRequestParameters(java.util.Map<String, String> requestParameters) { """ <p> A key-value map specifying request parameters that are passed from the method request to the back end. The key is an integration request parameter name and the associated value is a method request paramet...
java
public PutIntegrationResult withRequestParameters(java.util.Map<String, String> requestParameters) { setRequestParameters(requestParameters); return this; }
[ "public", "PutIntegrationResult", "withRequestParameters", "(", "java", ".", "util", ".", "Map", "<", "String", ",", "String", ">", "requestParameters", ")", "{", "setRequestParameters", "(", "requestParameters", ")", ";", "return", "this", ";", "}" ]
<p> A key-value map specifying request parameters that are passed from the method request to the back end. The key is an integration request parameter name and the associated value is a method request parameter value or static value that must be enclosed within single quotes and pre-encoded as required by the back end....
[ "<p", ">", "A", "key", "-", "value", "map", "specifying", "request", "parameters", "that", "are", "passed", "from", "the", "method", "request", "to", "the", "back", "end", ".", "The", "key", "is", "an", "integration", "request", "parameter", "name", "and",...
train
https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-api-gateway/src/main/java/com/amazonaws/services/apigateway/model/PutIntegrationResult.java#L1034-L1037
Shusshu/Android-RecurrencePicker
library/src/main/java/be/billington/calendar/recurrencepicker/Utils.java
Utils.convertAlldayUtcToLocal
public static long convertAlldayUtcToLocal(Time recycle, long utcTime, String tz) { """ Convert given UTC time into current local time. This assumes it is for an allday event and will adjust the time to be on a midnight boundary. @param recycle Time object to recycle, otherwise null. @param utcTime Time to co...
java
public static long convertAlldayUtcToLocal(Time recycle, long utcTime, String tz) { if (recycle == null) { recycle = new Time(); } recycle.timezone = Time.TIMEZONE_UTC; recycle.set(utcTime); recycle.timezone = tz; return recycle.normalize(true); }
[ "public", "static", "long", "convertAlldayUtcToLocal", "(", "Time", "recycle", ",", "long", "utcTime", ",", "String", "tz", ")", "{", "if", "(", "recycle", "==", "null", ")", "{", "recycle", "=", "new", "Time", "(", ")", ";", "}", "recycle", ".", "time...
Convert given UTC time into current local time. This assumes it is for an allday event and will adjust the time to be on a midnight boundary. @param recycle Time object to recycle, otherwise null. @param utcTime Time to convert, in UTC. @param tz The time zone to convert this time to.
[ "Convert", "given", "UTC", "time", "into", "current", "local", "time", ".", "This", "assumes", "it", "is", "for", "an", "allday", "event", "and", "will", "adjust", "the", "time", "to", "be", "on", "a", "midnight", "boundary", "." ]
train
https://github.com/Shusshu/Android-RecurrencePicker/blob/4f0ae74482e4d46d57a8fb13b4b7980a8613f4af/library/src/main/java/be/billington/calendar/recurrencepicker/Utils.java#L461-L469
UrielCh/ovh-java-sdk
ovh-java-sdk-dedicatedCloud/src/main/java/net/minidev/ovh/api/ApiOvhDedicatedCloud.java
ApiOvhDedicatedCloud.serviceName_federation_activeDirectory_POST
public OvhTask serviceName_federation_activeDirectory_POST(String serviceName, String baseDnForGroups, String baseDnForUsers, String description, String domainAlias, String domainName, String ip, String password, String username) throws IOException { """ Add a new option user access REST: POST /dedicatedCloud/{...
java
public OvhTask serviceName_federation_activeDirectory_POST(String serviceName, String baseDnForGroups, String baseDnForUsers, String description, String domainAlias, String domainName, String ip, String password, String username) throws IOException { String qPath = "/dedicatedCloud/{serviceName}/federation/activeDire...
[ "public", "OvhTask", "serviceName_federation_activeDirectory_POST", "(", "String", "serviceName", ",", "String", "baseDnForGroups", ",", "String", "baseDnForUsers", ",", "String", "description", ",", "String", "domainAlias", ",", "String", "domainName", ",", "String", "...
Add a new option user access REST: POST /dedicatedCloud/{serviceName}/federation/activeDirectory @param domainAlias [required] Active Directory NetBIOS name, e.g. example @param username [required] Active Directory username, e.g. jdoe@example.com @param description [required] Description of your option access network ...
[ "Add", "a", "new", "option", "user", "access" ]
train
https://github.com/UrielCh/ovh-java-sdk/blob/6d531a40e56e09701943e334c25f90f640c55701/ovh-java-sdk-dedicatedCloud/src/main/java/net/minidev/ovh/api/ApiOvhDedicatedCloud.java#L1075-L1089
ThreeTen/threeten-extra
src/main/java/org/threeten/extra/chrono/InternationalFixedDate.java
InternationalFixedDate.create
static InternationalFixedDate create(int prolepticYear, int month, int dayOfMonth) { """ Factory method, validates the given triplet year, month and dayOfMonth. @param prolepticYear the International fixed proleptic-year @param month the International fixed month, from 1 to 13 @param dayOfMonth the Interna...
java
static InternationalFixedDate create(int prolepticYear, int month, int dayOfMonth) { YEAR_RANGE.checkValidValue(prolepticYear, ChronoField.YEAR_OF_ERA); MONTH_OF_YEAR_RANGE.checkValidValue(month, ChronoField.MONTH_OF_YEAR); DAY_OF_MONTH_RANGE.checkValidValue(dayOfMonth, ChronoField.DAY_OF_MONTH)...
[ "static", "InternationalFixedDate", "create", "(", "int", "prolepticYear", ",", "int", "month", ",", "int", "dayOfMonth", ")", "{", "YEAR_RANGE", ".", "checkValidValue", "(", "prolepticYear", ",", "ChronoField", ".", "YEAR_OF_ERA", ")", ";", "MONTH_OF_YEAR_RANGE", ...
Factory method, validates the given triplet year, month and dayOfMonth. @param prolepticYear the International fixed proleptic-year @param month the International fixed month, from 1 to 13 @param dayOfMonth the International fixed day-of-month, from 1 to 28 (29 for Leap Day or Year Day) @return the International fi...
[ "Factory", "method", "validates", "the", "given", "triplet", "year", "month", "and", "dayOfMonth", "." ]
train
https://github.com/ThreeTen/threeten-extra/blob/e94ecd3592ef70e54d6eea21095239ea9ffbab78/src/main/java/org/threeten/extra/chrono/InternationalFixedDate.java#L335-L347
febit/wit
wit-core/src/main/java/org/febit/wit_shaded/asm/ClassWriter.java
ClassWriter.put122
private void put122(final int b, final int s1, final int s2) { """ Puts one byte and two shorts into the constant pool. @param b a byte. @param s1 a short. @param s2 another short. """ pool.putBS(b, s1).putShort(s2); }
java
private void put122(final int b, final int s1, final int s2) { pool.putBS(b, s1).putShort(s2); }
[ "private", "void", "put122", "(", "final", "int", "b", ",", "final", "int", "s1", ",", "final", "int", "s2", ")", "{", "pool", ".", "putBS", "(", "b", ",", "s1", ")", ".", "putShort", "(", "s2", ")", ";", "}" ]
Puts one byte and two shorts into the constant pool. @param b a byte. @param s1 a short. @param s2 another short.
[ "Puts", "one", "byte", "and", "two", "shorts", "into", "the", "constant", "pool", "." ]
train
https://github.com/febit/wit/blob/89ee29efbc5633b79c30c3c7b953c9f4130575af/wit-core/src/main/java/org/febit/wit_shaded/asm/ClassWriter.java#L741-L743
jmapper-framework/jmapper-core
JMapper Framework/src/main/java/com/googlecode/jmapper/xml/XML.java
XML.addGlobal
public XML addGlobal(Class<?> aClass,Global global) { """ This method adds the global to an existing Class. @param aClass class to edit @param global global to add @return this instance of XML """ checksGlobalAbsence(aClass); findXmlClass(aClass).global = Converter.toXmlGlobal(global); return this;...
java
public XML addGlobal(Class<?> aClass,Global global){ checksGlobalAbsence(aClass); findXmlClass(aClass).global = Converter.toXmlGlobal(global); return this; }
[ "public", "XML", "addGlobal", "(", "Class", "<", "?", ">", "aClass", ",", "Global", "global", ")", "{", "checksGlobalAbsence", "(", "aClass", ")", ";", "findXmlClass", "(", "aClass", ")", ".", "global", "=", "Converter", ".", "toXmlGlobal", "(", "global", ...
This method adds the global to an existing Class. @param aClass class to edit @param global global to add @return this instance of XML
[ "This", "method", "adds", "the", "global", "to", "an", "existing", "Class", "." ]
train
https://github.com/jmapper-framework/jmapper-core/blob/b48fd3527f35055b8b4a30f53a51136f183acc90/JMapper Framework/src/main/java/com/googlecode/jmapper/xml/XML.java#L307-L311
apache/flink
flink-runtime/src/main/java/org/apache/flink/runtime/webmonitor/WebMonitorUtils.java
WebMonitorUtils.loadWebSubmissionExtension
public static WebMonitorExtension loadWebSubmissionExtension( GatewayRetriever<? extends DispatcherGateway> leaderRetriever, Time timeout, Map<String, String> responseHeaders, CompletableFuture<String> localAddressFuture, java.nio.file.Path uploadDir, Executor executor, Configuration configuration)...
java
public static WebMonitorExtension loadWebSubmissionExtension( GatewayRetriever<? extends DispatcherGateway> leaderRetriever, Time timeout, Map<String, String> responseHeaders, CompletableFuture<String> localAddressFuture, java.nio.file.Path uploadDir, Executor executor, Configuration configuration)...
[ "public", "static", "WebMonitorExtension", "loadWebSubmissionExtension", "(", "GatewayRetriever", "<", "?", "extends", "DispatcherGateway", ">", "leaderRetriever", ",", "Time", "timeout", ",", "Map", "<", "String", ",", "String", ">", "responseHeaders", ",", "Completa...
Loads the {@link WebMonitorExtension} which enables web submission. @param leaderRetriever to retrieve the leader @param timeout for asynchronous requests @param responseHeaders for the web submission handlers @param localAddressFuture of the underlying REST server endpoint @param uploadDir where the web submission ha...
[ "Loads", "the", "{", "@link", "WebMonitorExtension", "}", "which", "enables", "web", "submission", "." ]
train
https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-runtime/src/main/java/org/apache/flink/runtime/webmonitor/WebMonitorUtils.java#L158-L195
Omertron/api-themoviedb
src/main/java/com/omertron/themoviedbapi/methods/TmdbMovies.java
TmdbMovies.getMovieInfo
public MovieInfo getMovieInfo(int movieId, String language, String... appendToResponse) throws MovieDbException { """ This method is used to retrieve all of the basic movie information. It will return the single highest rated poster and backdrop. ApiExceptionType.MOVIE_ID_NOT_FOUND will be thrown if there ar...
java
public MovieInfo getMovieInfo(int movieId, String language, String... appendToResponse) throws MovieDbException { TmdbParameters parameters = new TmdbParameters(); parameters.add(Param.ID, movieId); parameters.add(Param.LANGUAGE, language); parameters.add(Param.APPEND, appendToResponse);...
[ "public", "MovieInfo", "getMovieInfo", "(", "int", "movieId", ",", "String", "language", ",", "String", "...", "appendToResponse", ")", "throws", "MovieDbException", "{", "TmdbParameters", "parameters", "=", "new", "TmdbParameters", "(", ")", ";", "parameters", "....
This method is used to retrieve all of the basic movie information. It will return the single highest rated poster and backdrop. ApiExceptionType.MOVIE_ID_NOT_FOUND will be thrown if there are no movies found. @param movieId @param language @param appendToResponse @return @throws MovieDbException
[ "This", "method", "is", "used", "to", "retrieve", "all", "of", "the", "basic", "movie", "information", "." ]
train
https://github.com/Omertron/api-themoviedb/blob/bf132d7c7271734e13b58ba3bc92bba46f220118/src/main/java/com/omertron/themoviedbapi/methods/TmdbMovies.java#L90-L107
netty/netty
common/src/main/java/io/netty/util/internal/NativeLibraryLoader.java
NativeLibraryLoader.loadLibrary
private static void loadLibrary(final ClassLoader loader, final String name, final boolean absolute) { """ Loading the native library into the specified {@link ClassLoader}. @param loader - The {@link ClassLoader} where the native library will be loaded into @param name - The native library path or name @param ...
java
private static void loadLibrary(final ClassLoader loader, final String name, final boolean absolute) { Throwable suppressed = null; try { try { // Make sure the helper is belong to the target ClassLoader. final Class<?> newHelper = tryToLoadClass(loader, Nativ...
[ "private", "static", "void", "loadLibrary", "(", "final", "ClassLoader", "loader", ",", "final", "String", "name", ",", "final", "boolean", "absolute", ")", "{", "Throwable", "suppressed", "=", "null", ";", "try", "{", "try", "{", "// Make sure the helper is bel...
Loading the native library into the specified {@link ClassLoader}. @param loader - The {@link ClassLoader} where the native library will be loaded into @param name - The native library path or name @param absolute - Whether the native library will be loaded by path or by name
[ "Loading", "the", "native", "library", "into", "the", "specified", "{" ]
train
https://github.com/netty/netty/blob/ba06eafa1c1824bd154f1a380019e7ea2edf3c4c/common/src/main/java/io/netty/util/internal/NativeLibraryLoader.java#L333-L357
wildfly-extras/wildfly-camel
subsystem/core/src/main/java/org/wildfly/extension/camel/SpringCamelContextFactory.java
SpringCamelContextFactory.createCamelContextList
public static List<SpringCamelContext> createCamelContextList(byte[] bytes, ClassLoader classsLoader) throws Exception { """ Create a {@link SpringCamelContext} list from the given bytes """ SpringCamelContextBootstrap bootstrap = new SpringCamelContextBootstrap(bytes, classsLoader); return boo...
java
public static List<SpringCamelContext> createCamelContextList(byte[] bytes, ClassLoader classsLoader) throws Exception { SpringCamelContextBootstrap bootstrap = new SpringCamelContextBootstrap(bytes, classsLoader); return bootstrap.createSpringCamelContexts(); }
[ "public", "static", "List", "<", "SpringCamelContext", ">", "createCamelContextList", "(", "byte", "[", "]", "bytes", ",", "ClassLoader", "classsLoader", ")", "throws", "Exception", "{", "SpringCamelContextBootstrap", "bootstrap", "=", "new", "SpringCamelContextBootstra...
Create a {@link SpringCamelContext} list from the given bytes
[ "Create", "a", "{" ]
train
https://github.com/wildfly-extras/wildfly-camel/blob/9ebd7e28574f277a6d5b583e8a4c357e1538c370/subsystem/core/src/main/java/org/wildfly/extension/camel/SpringCamelContextFactory.java#L64-L67
Alluxio/alluxio
minicluster/src/main/java/alluxio/multi/process/MultiProcessCluster.java
MultiProcessCluster.writeConfToFile
private void writeConfToFile(File dir, Map<PropertyKey, String> properties) throws IOException { """ Creates the conf directory and file. Writes the properties to the generated file. @param dir the conf directory to create @param properties the specific properties of the current node """ // Generates ...
java
private void writeConfToFile(File dir, Map<PropertyKey, String> properties) throws IOException { // Generates the full set of properties to write Map<PropertyKey, String> map = new HashMap<>(mProperties); for (Map.Entry<PropertyKey, String> entry : properties.entrySet()) { map.put(entry.getKey(), entr...
[ "private", "void", "writeConfToFile", "(", "File", "dir", ",", "Map", "<", "PropertyKey", ",", "String", ">", "properties", ")", "throws", "IOException", "{", "// Generates the full set of properties to write", "Map", "<", "PropertyKey", ",", "String", ">", "map", ...
Creates the conf directory and file. Writes the properties to the generated file. @param dir the conf directory to create @param properties the specific properties of the current node
[ "Creates", "the", "conf", "directory", "and", "file", ".", "Writes", "the", "properties", "to", "the", "generated", "file", "." ]
train
https://github.com/Alluxio/alluxio/blob/af38cf3ab44613355b18217a3a4d961f8fec3a10/minicluster/src/main/java/alluxio/multi/process/MultiProcessCluster.java#L686-L703
google/error-prone
check_api/src/main/java/com/google/errorprone/matchers/Matchers.java
Matchers.methodWithClassAndName
public static Matcher<MethodTree> methodWithClassAndName( final String className, final String methodName) { """ Match a method declaration with a specific enclosing class and method name. @param className The fully-qualified name of the enclosing class, e.g. "com.google.common.base.Preconditions" @para...
java
public static Matcher<MethodTree> methodWithClassAndName( final String className, final String methodName) { return new Matcher<MethodTree>() { @Override public boolean matches(MethodTree methodTree, VisitorState state) { return ASTHelpers.getSymbol(methodTree) .getEnclosin...
[ "public", "static", "Matcher", "<", "MethodTree", ">", "methodWithClassAndName", "(", "final", "String", "className", ",", "final", "String", "methodName", ")", "{", "return", "new", "Matcher", "<", "MethodTree", ">", "(", ")", "{", "@", "Override", "public", ...
Match a method declaration with a specific enclosing class and method name. @param className The fully-qualified name of the enclosing class, e.g. "com.google.common.base.Preconditions" @param methodName The name of the method to match, e.g., "checkNotNull"
[ "Match", "a", "method", "declaration", "with", "a", "specific", "enclosing", "class", "and", "method", "name", "." ]
train
https://github.com/google/error-prone/blob/fe2e3cc2cf1958cb7c487bfe89852bb4c225ba9d/check_api/src/main/java/com/google/errorprone/matchers/Matchers.java#L948-L960
JodaOrg/joda-time
src/main/java/org/joda/time/LocalDateTime.java
LocalDateTime.withDate
public LocalDateTime withDate(int year, int monthOfYear, int dayOfMonth) { """ Returns a copy of this datetime with the specified date, retaining the time fields. <p> If the date is already the date passed in, then <code>this</code> is returned. <p> To set a single field use the properties, for example: <pre...
java
public LocalDateTime withDate(int year, int monthOfYear, int dayOfMonth) { Chronology chrono = getChronology(); long instant = getLocalMillis(); instant = chrono.year().set(instant, year); instant = chrono.monthOfYear().set(instant, monthOfYear); instant = chrono.dayOfMonth().set...
[ "public", "LocalDateTime", "withDate", "(", "int", "year", ",", "int", "monthOfYear", ",", "int", "dayOfMonth", ")", "{", "Chronology", "chrono", "=", "getChronology", "(", ")", ";", "long", "instant", "=", "getLocalMillis", "(", ")", ";", "instant", "=", ...
Returns a copy of this datetime with the specified date, retaining the time fields. <p> If the date is already the date passed in, then <code>this</code> is returned. <p> To set a single field use the properties, for example: <pre> DateTime set = dt.monthOfYear().setCopy(6); </pre> @param year the new year value @par...
[ "Returns", "a", "copy", "of", "this", "datetime", "with", "the", "specified", "date", "retaining", "the", "time", "fields", ".", "<p", ">", "If", "the", "date", "is", "already", "the", "date", "passed", "in", "then", "<code", ">", "this<", "/", "code", ...
train
https://github.com/JodaOrg/joda-time/blob/bd79f1c4245e79b3c2c56d7b04fde2a6e191fa42/src/main/java/org/joda/time/LocalDateTime.java#L910-L917
census-instrumentation/opencensus-java
api/src/main/java/io/opencensus/common/Timestamp.java
Timestamp.fromMillis
public static Timestamp fromMillis(long epochMilli) { """ Creates a new timestamp from the given milliseconds. @param epochMilli the timestamp represented in milliseconds since epoch. @return new {@code Timestamp} with specified fields. @throws IllegalArgumentException if the number of milliseconds is out of ...
java
public static Timestamp fromMillis(long epochMilli) { long secs = floorDiv(epochMilli, MILLIS_PER_SECOND); int mos = (int) floorMod(epochMilli, MILLIS_PER_SECOND); return create(secs, (int) (mos * NANOS_PER_MILLI)); // Safe int * NANOS_PER_MILLI }
[ "public", "static", "Timestamp", "fromMillis", "(", "long", "epochMilli", ")", "{", "long", "secs", "=", "floorDiv", "(", "epochMilli", ",", "MILLIS_PER_SECOND", ")", ";", "int", "mos", "=", "(", "int", ")", "floorMod", "(", "epochMilli", ",", "MILLIS_PER_SE...
Creates a new timestamp from the given milliseconds. @param epochMilli the timestamp represented in milliseconds since epoch. @return new {@code Timestamp} with specified fields. @throws IllegalArgumentException if the number of milliseconds is out of the range that can be represented by {@code Timestamp}. @since 0.5
[ "Creates", "a", "new", "timestamp", "from", "the", "given", "milliseconds", "." ]
train
https://github.com/census-instrumentation/opencensus-java/blob/deefac9bed77e40a2297bff1ca5ec5aa48a5f755/api/src/main/java/io/opencensus/common/Timestamp.java#L85-L89
languagetool-org/languagetool
languagetool-core/src/main/java/org/languagetool/rules/spelling/symspell/implementation/EditDistance.java
EditDistance.compare
public int compare(String string2, int maxDistance) { """ / <returns>The edit distance (or -1 if maxDistance exceeded).</returns> """ switch (algorithm) { case Damerau: return DamerauLevenshteinDistance(string2, maxDistance); } throw new IllegalArgumentException("unknown Dis...
java
public int compare(String string2, int maxDistance) { switch (algorithm) { case Damerau: return DamerauLevenshteinDistance(string2, maxDistance); } throw new IllegalArgumentException("unknown DistanceAlgorithm"); }
[ "public", "int", "compare", "(", "String", "string2", ",", "int", "maxDistance", ")", "{", "switch", "(", "algorithm", ")", "{", "case", "Damerau", ":", "return", "DamerauLevenshteinDistance", "(", "string2", ",", "maxDistance", ")", ";", "}", "throw", "new"...
/ <returns>The edit distance (or -1 if maxDistance exceeded).</returns>
[ "/", "<returns", ">", "The", "edit", "distance", "(", "or", "-", "1", "if", "maxDistance", "exceeded", ")", ".", "<", "/", "returns", ">" ]
train
https://github.com/languagetool-org/languagetool/blob/b7a3d63883d242fb2525877c6382681c57a0a142/languagetool-core/src/main/java/org/languagetool/rules/spelling/symspell/implementation/EditDistance.java#L53-L58
firebase/geofire-java
common/src/main/java/com/firebase/geofire/GeoFire.java
GeoFire.removeLocation
public void removeLocation(final String key, final CompletionListener completionListener) { """ Removes the location for a key from this GeoFire. @param key The key to remove from this GeoFire @param completionListener A completion listener that is called once the location is successfully remove...
java
public void removeLocation(final String key, final CompletionListener completionListener) { if (key == null) { throw new NullPointerException(); } DatabaseReference keyRef = this.getDatabaseRefForKey(key); if (completionListener != null) { keyRef.setValue(null, ne...
[ "public", "void", "removeLocation", "(", "final", "String", "key", ",", "final", "CompletionListener", "completionListener", ")", "{", "if", "(", "key", "==", "null", ")", "{", "throw", "new", "NullPointerException", "(", ")", ";", "}", "DatabaseReference", "k...
Removes the location for a key from this GeoFire. @param key The key to remove from this GeoFire @param completionListener A completion listener that is called once the location is successfully removed from the server or an error occurred
[ "Removes", "the", "location", "for", "a", "key", "from", "this", "GeoFire", "." ]
train
https://github.com/firebase/geofire-java/blob/c46ff339060d150741a8d0d40c8e73b78edca6c3/common/src/main/java/com/firebase/geofire/GeoFire.java#L202-L217
fuinorg/units4j
src/main/java/org/fuin/units4j/AssertDependencies.java
AssertDependencies.assertRules
public static final void assertRules(final Class<?> clasz, final String dependenciesFilePathAndName, final File classesDir) { """ Asserts that a set of dependency rules is kept. @param clasz Class to use for loading the resource - Cannot be <code>null</code>. @param dependenciesFilePathAndName XML resource (...
java
public static final void assertRules(final Class<?> clasz, final String dependenciesFilePathAndName, final File classesDir) { Utils4J.checkNotNull("clasz", clasz); Utils4J.checkNotNull("dependenciesFilePathAndName", dependenciesFilePathAndName); Utils4J.checkNotNull("classesDir", classesDir);...
[ "public", "static", "final", "void", "assertRules", "(", "final", "Class", "<", "?", ">", "clasz", ",", "final", "String", "dependenciesFilePathAndName", ",", "final", "File", "classesDir", ")", "{", "Utils4J", ".", "checkNotNull", "(", "\"clasz\"", ",", "clas...
Asserts that a set of dependency rules is kept. @param clasz Class to use for loading the resource - Cannot be <code>null</code>. @param dependenciesFilePathAndName XML resource (path/name) with allowed or forbidden dependencies - Cannot be <code>null</code>. @param classesDir Directory with the ".class" files to chec...
[ "Asserts", "that", "a", "set", "of", "dependency", "rules", "is", "kept", "." ]
train
https://github.com/fuinorg/units4j/blob/29383e30b0f9c246b309e734df9cc63dc5d5499e/src/main/java/org/fuin/units4j/AssertDependencies.java#L106-L116
meltmedia/cadmium
cli/src/main/java/com/meltmedia/cadmium/cli/UpdateCommand.java
UpdateCommand.sendUpdateMessage
public static boolean sendUpdateMessage(String site2, String repo, String branch, String revision, String comment, String token, String endpoint) throws Exception { """ Sends a update message to a Cadmium site. This method will block until the update is complete. @param site2 The uri to a Cadmium site. @param ...
java
public static boolean sendUpdateMessage(String site2, String repo, String branch, String revision, String comment, String token, String endpoint) throws Exception { return sendUpdateMessage(site2, repo, branch, revision, comment, token, endpoint, UpdateRequest.CONTENT_BRANCH_PREFIX); }
[ "public", "static", "boolean", "sendUpdateMessage", "(", "String", "site2", ",", "String", "repo", ",", "String", "branch", ",", "String", "revision", ",", "String", "comment", ",", "String", "token", ",", "String", "endpoint", ")", "throws", "Exception", "{",...
Sends a update message to a Cadmium site. This method will block until the update is complete. @param site2 The uri to a Cadmium site. @param repo The git repository to tell the site to change to. @param branch The branch to switch to. @param revision The revision to reset to. @param comment The message to record with...
[ "Sends", "a", "update", "message", "to", "a", "Cadmium", "site", ".", "This", "method", "will", "block", "until", "the", "update", "is", "complete", "." ]
train
https://github.com/meltmedia/cadmium/blob/bca585030e141803a73b58abb128d130157b6ddf/cli/src/main/java/com/meltmedia/cadmium/cli/UpdateCommand.java#L183-L185
Samsung/GearVRf
GVRf/Extensions/widgetLib/src/org/gearvrf/widgetlib/widget/NodeEntry.java
NodeEntry.getProperty
@SuppressWarnings("WeakerAccess") public String getProperty(Enum<?> key, boolean lowerCase) { """ Gets the property by key converted to lowercase if requested @param key property key @param lowerCase convert property to lowercase if it is true, keep the original one if it is false @return node property ...
java
@SuppressWarnings("WeakerAccess") public String getProperty(Enum<?> key, boolean lowerCase) { final String keyName; if (lowerCase) { keyName = key.name().toLowerCase(Locale.ENGLISH); } else { keyName = key.name(); } return getProperty(keyName); }
[ "@", "SuppressWarnings", "(", "\"WeakerAccess\"", ")", "public", "String", "getProperty", "(", "Enum", "<", "?", ">", "key", ",", "boolean", "lowerCase", ")", "{", "final", "String", "keyName", ";", "if", "(", "lowerCase", ")", "{", "keyName", "=", "key", ...
Gets the property by key converted to lowercase if requested @param key property key @param lowerCase convert property to lowercase if it is true, keep the original one if it is false @return node property
[ "Gets", "the", "property", "by", "key", "converted", "to", "lowercase", "if", "requested" ]
train
https://github.com/Samsung/GearVRf/blob/05034d465a7b0a494fabb9e9f2971ac19392f32d/GVRf/Extensions/widgetLib/src/org/gearvrf/widgetlib/widget/NodeEntry.java#L123-L132
couchbase/couchbase-lite-java-core
src/main/java/com/couchbase/lite/Manager.java
Manager.getExistingDatabase
@InterfaceAudience.Public public Database getExistingDatabase(String name) throws CouchbaseLiteException { """ <p> Returns the database with the given name, or null if it doesn't exist. Multiple calls with the same name will return the same {@link Database} instance. <p/> <p> This is equivalent to calling...
java
@InterfaceAudience.Public public Database getExistingDatabase(String name) throws CouchbaseLiteException { DatabaseOptions options = getDefaultOptions(name); return openDatabase(name, options); }
[ "@", "InterfaceAudience", ".", "Public", "public", "Database", "getExistingDatabase", "(", "String", "name", ")", "throws", "CouchbaseLiteException", "{", "DatabaseOptions", "options", "=", "getDefaultOptions", "(", "name", ")", ";", "return", "openDatabase", "(", "...
<p> Returns the database with the given name, or null if it doesn't exist. Multiple calls with the same name will return the same {@link Database} instance. <p/> <p> This is equivalent to calling {@link #openDatabase(String, DatabaseOptions)} with a default set of options. </p>
[ "<p", ">", "Returns", "the", "database", "with", "the", "given", "name", "or", "null", "if", "it", "doesn", "t", "exist", ".", "Multiple", "calls", "with", "the", "same", "name", "will", "return", "the", "same", "{" ]
train
https://github.com/couchbase/couchbase-lite-java-core/blob/3b275642e2d2f231fd155ad9def9c5e9eff3118e/src/main/java/com/couchbase/lite/Manager.java#L318-L322
osglworks/java-tool
src/main/java/org/osgl/Lang.java
F2.lift
public F2<P1, P2, Option<R>> lift() { """ Turns this partial function into a plain function returning an Option result. @return a function that takes an argument x to Some(this.apply(x)) if this can be applied, and to None otherwise. """ final F2<P1, P2, R> me = this; return new F2<P...
java
public F2<P1, P2, Option<R>> lift() { final F2<P1, P2, R> me = this; return new F2<P1, P2, Option<R>>() { @Override public Option<R> apply(P1 p1, P2 p2) { try { return some(me.apply(p1, p2)); } catch ...
[ "public", "F2", "<", "P1", ",", "P2", ",", "Option", "<", "R", ">", ">", "lift", "(", ")", "{", "final", "F2", "<", "P1", ",", "P2", ",", "R", ">", "me", "=", "this", ";", "return", "new", "F2", "<", "P1", ",", "P2", ",", "Option", "<", "...
Turns this partial function into a plain function returning an Option result. @return a function that takes an argument x to Some(this.apply(x)) if this can be applied, and to None otherwise.
[ "Turns", "this", "partial", "function", "into", "a", "plain", "function", "returning", "an", "Option", "result", "." ]
train
https://github.com/osglworks/java-tool/blob/8b6eee2bccb067eb32e6a7bc4a4dfef7a7d9008b/src/main/java/org/osgl/Lang.java#L1057-L1069
jronrun/benayn
benayn-ustyle/src/main/java/com/benayn/ustyle/string/Levenshtein.java
Levenshtein.longestCommonSubsequence
@SuppressWarnings("unchecked") public static <T extends Levenshtein> T longestCommonSubsequence(String baseTarget, String compareTarget) { """ Returns a new Longest Common Subsequence edit distance instance with compare target string @see LongestCommonSubsequence @param baseTarget @param compareTarget @retu...
java
@SuppressWarnings("unchecked") public static <T extends Levenshtein> T longestCommonSubsequence(String baseTarget, String compareTarget) { return (T) new LongestCommonSubsequence(baseTarget).update(compareTarget); }
[ "@", "SuppressWarnings", "(", "\"unchecked\"", ")", "public", "static", "<", "T", "extends", "Levenshtein", ">", "T", "longestCommonSubsequence", "(", "String", "baseTarget", ",", "String", "compareTarget", ")", "{", "return", "(", "T", ")", "new", "LongestCommo...
Returns a new Longest Common Subsequence edit distance instance with compare target string @see LongestCommonSubsequence @param baseTarget @param compareTarget @return
[ "Returns", "a", "new", "Longest", "Common", "Subsequence", "edit", "distance", "instance", "with", "compare", "target", "string" ]
train
https://github.com/jronrun/benayn/blob/7585152e10e4cac07b4274c65f1c72ad7061ae69/benayn-ustyle/src/main/java/com/benayn/ustyle/string/Levenshtein.java#L160-L163
alkacon/opencms-core
src/org/opencms/xml/content/CmsXmlContentPropertyHelper.java
CmsXmlContentPropertyHelper.getPropertyInfo
public static Map<String, CmsXmlContentProperty> getPropertyInfo( CmsObject cms, CmsResource page, CmsResource resource) throws CmsException { """ Returns the property information for the given resource (type) AND the current user.<p> @param cms the current CMS context @param page t...
java
public static Map<String, CmsXmlContentProperty> getPropertyInfo( CmsObject cms, CmsResource page, CmsResource resource) throws CmsException { if (CmsResourceTypeXmlContent.isXmlContent(resource)) { I_CmsXmlContentHandler contentHandler = CmsXmlContentDefinition.getConte...
[ "public", "static", "Map", "<", "String", ",", "CmsXmlContentProperty", ">", "getPropertyInfo", "(", "CmsObject", "cms", ",", "CmsResource", "page", ",", "CmsResource", "resource", ")", "throws", "CmsException", "{", "if", "(", "CmsResourceTypeXmlContent", ".", "i...
Returns the property information for the given resource (type) AND the current user.<p> @param cms the current CMS context @param page the current container page @param resource the resource @return the property information @throws CmsException if something goes wrong
[ "Returns", "the", "property", "information", "for", "the", "given", "resource", "(", "type", ")", "AND", "the", "current", "user", ".", "<p", ">" ]
train
https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/xml/content/CmsXmlContentPropertyHelper.java#L281-L295
apiman/apiman
common/servlet/src/main/java/io/apiman/common/servlet/AuthenticationFilter.java
AuthenticationFilter.wrapTheRequest
private HttpServletRequest wrapTheRequest(final ServletRequest request, final AuthPrincipal principal) { """ Wrap the request to provide the principal. @param request the request @param principal the principal """ HttpServletRequestWrapper wrapper = new HttpServletRequestWrapper((HttpServletRequest) ...
java
private HttpServletRequest wrapTheRequest(final ServletRequest request, final AuthPrincipal principal) { HttpServletRequestWrapper wrapper = new HttpServletRequestWrapper((HttpServletRequest) request) { @Override public Principal getUserPrincipal() { return principal; ...
[ "private", "HttpServletRequest", "wrapTheRequest", "(", "final", "ServletRequest", "request", ",", "final", "AuthPrincipal", "principal", ")", "{", "HttpServletRequestWrapper", "wrapper", "=", "new", "HttpServletRequestWrapper", "(", "(", "HttpServletRequest", ")", "reque...
Wrap the request to provide the principal. @param request the request @param principal the principal
[ "Wrap", "the", "request", "to", "provide", "the", "principal", "." ]
train
https://github.com/apiman/apiman/blob/8c049c2a2f2e4a69bbb6125686a15edd26f29c21/common/servlet/src/main/java/io/apiman/common/servlet/AuthenticationFilter.java#L285-L303
OpenLiberty/open-liberty
dev/com.ibm.ws.ssl/src/com/ibm/ws/ssl/provider/AbstractJSSEProvider.java
AbstractJSSEProvider.getKeyManagerFactoryInstance
public KeyManagerFactory getKeyManagerFactoryInstance(String keyMgr, String ctxtProvider) throws NoSuchAlgorithmException, NoSuchProviderException { """ Get the key manager factory instance using the provided information. @see com.ibm.websphere.ssl.JSSEProvider#getKeyManagerFactoryInstance() @param keyMgr @pa...
java
public KeyManagerFactory getKeyManagerFactoryInstance(String keyMgr, String ctxtProvider) throws NoSuchAlgorithmException, NoSuchProviderException { String mgr = keyMgr; String provider = ctxtProvider; if (mgr.indexOf('|') != -1) { String[] keyManagerArray = mgr.split("\\|"); ...
[ "public", "KeyManagerFactory", "getKeyManagerFactoryInstance", "(", "String", "keyMgr", ",", "String", "ctxtProvider", ")", "throws", "NoSuchAlgorithmException", ",", "NoSuchProviderException", "{", "String", "mgr", "=", "keyMgr", ";", "String", "provider", "=", "ctxtPr...
Get the key manager factory instance using the provided information. @see com.ibm.websphere.ssl.JSSEProvider#getKeyManagerFactoryInstance() @param keyMgr @param ctxtProvider @return KeyManagerFactory @throws NoSuchAlgorithmException @throws NoSuchProviderException
[ "Get", "the", "key", "manager", "factory", "instance", "using", "the", "provided", "information", "." ]
train
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.ssl/src/com/ibm/ws/ssl/provider/AbstractJSSEProvider.java#L717-L732
Blazebit/blaze-utils
blaze-common-utils/src/main/java/com/blazebit/comparator/BaseComparator.java
BaseComparator.compareNullObjects
protected Integer compareNullObjects(Object object1, Object object2) { """ Checks for null objects and returns the proper result depedning on which object is null @param object1 @param object2 @return <ol> <li>0 = field null or both objects null</li> <li>1 = object1 is null</li> <li>-1 = object2 is null</li...
java
protected Integer compareNullObjects(Object object1, Object object2) { if ((object1 == null) && (object2 == null)) { return 0; } if (object1 == null) { return 1; } if (object2 == null) { return -1; } return null; ...
[ "protected", "Integer", "compareNullObjects", "(", "Object", "object1", ",", "Object", "object2", ")", "{", "if", "(", "(", "object1", "==", "null", ")", "&&", "(", "object2", "==", "null", ")", ")", "{", "return", "0", ";", "}", "if", "(", "object1", ...
Checks for null objects and returns the proper result depedning on which object is null @param object1 @param object2 @return <ol> <li>0 = field null or both objects null</li> <li>1 = object1 is null</li> <li>-1 = object2 is null</li> <li>null = both objects are not null</li> </ol>
[ "Checks", "for", "null", "objects", "and", "returns", "the", "proper", "result", "depedning", "on", "which", "object", "is", "null" ]
train
https://github.com/Blazebit/blaze-utils/blob/3e35a694a8f71d515aad066196acd523994d6aaa/blaze-common-utils/src/main/java/com/blazebit/comparator/BaseComparator.java#L38-L49
sporniket/core
sporniket-core-io/src/main/java/com/sporniket/libre/io/FileTools.java
FileTools.createReaderForFile
public static Reader createReaderForFile(File source, Encoding encoding) throws FileNotFoundException, UnsupportedEncodingException { """ Instanciate a Reader for a file using the given encoding. @param source source file. @param encoding can be <code>null</code> @return the reader. @throws FileNotFound...
java
public static Reader createReaderForFile(File source, Encoding encoding) throws FileNotFoundException, UnsupportedEncodingException { return createReaderForInputStream(new FileInputStream(source), encoding); }
[ "public", "static", "Reader", "createReaderForFile", "(", "File", "source", ",", "Encoding", "encoding", ")", "throws", "FileNotFoundException", ",", "UnsupportedEncodingException", "{", "return", "createReaderForInputStream", "(", "new", "FileInputStream", "(", "source",...
Instanciate a Reader for a file using the given encoding. @param source source file. @param encoding can be <code>null</code> @return the reader. @throws FileNotFoundException if there is a problem to deal with. @throws UnsupportedEncodingException if there is a problem to deal with. @since 12.06.01
[ "Instanciate", "a", "Reader", "for", "a", "file", "using", "the", "given", "encoding", "." ]
train
https://github.com/sporniket/core/blob/3480ebd72a07422fcc09971be2607ee25efb2c26/sporniket-core-io/src/main/java/com/sporniket/libre/io/FileTools.java#L131-L135
Esri/geometry-api-java
src/main/java/com/esri/core/geometry/MultiPath.java
MultiPath.addPath
public void addPath(MultiPath src, int srcPathIndex, boolean bForward) { """ Copies a path from another multipath. @param src The multipath to copy from. @param srcPathIndex The index of the path in the the source MultiPath. @param bForward When FALSE, the points are inserted in reverse order. """ m_...
java
public void addPath(MultiPath src, int srcPathIndex, boolean bForward) { m_impl.addPath((MultiPathImpl) src._getImpl(), srcPathIndex, bForward); }
[ "public", "void", "addPath", "(", "MultiPath", "src", ",", "int", "srcPathIndex", ",", "boolean", "bForward", ")", "{", "m_impl", ".", "addPath", "(", "(", "MultiPathImpl", ")", "src", ".", "_getImpl", "(", ")", ",", "srcPathIndex", ",", "bForward", ")", ...
Copies a path from another multipath. @param src The multipath to copy from. @param srcPathIndex The index of the path in the the source MultiPath. @param bForward When FALSE, the points are inserted in reverse order.
[ "Copies", "a", "path", "from", "another", "multipath", "." ]
train
https://github.com/Esri/geometry-api-java/blob/494da8ec953d76e7c6072afbc081abfe48ff07cf/src/main/java/com/esri/core/geometry/MultiPath.java#L262-L264
alkacon/opencms-core
src/org/opencms/ui/apps/sitemanager/CmsSiteManager.java
CmsSiteManager.openDialog
protected void openDialog(CmsBasicDialog dialog, String windowCaption) { """ Opens a given dialog.<p> @param dialog to be shown @param windowCaption caption of window """ if (m_dialogWindow != null) { m_dialogWindow.close(); } m_dialogWindow = CmsBasicDialog.prepareWin...
java
protected void openDialog(CmsBasicDialog dialog, String windowCaption) { if (m_dialogWindow != null) { m_dialogWindow.close(); } m_dialogWindow = CmsBasicDialog.prepareWindow(DialogWidth.wide); m_dialogWindow.setContent(dialog); m_dialogWindow.setCaption(windowCapti...
[ "protected", "void", "openDialog", "(", "CmsBasicDialog", "dialog", ",", "String", "windowCaption", ")", "{", "if", "(", "m_dialogWindow", "!=", "null", ")", "{", "m_dialogWindow", ".", "close", "(", ")", ";", "}", "m_dialogWindow", "=", "CmsBasicDialog", ".",...
Opens a given dialog.<p> @param dialog to be shown @param windowCaption caption of window
[ "Opens", "a", "given", "dialog", ".", "<p", ">" ]
train
https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/ui/apps/sitemanager/CmsSiteManager.java#L434-L446
Credntia/MVBarcodeReader
mvbarcodereader/src/main/java/devliving/online/mvbarcodereader/BarcodeGraphicTracker.java
BarcodeGraphicTracker.onUpdate
@Override public void onUpdate(Detector.Detections<Barcode> detectionResults, Barcode item) { """ Update the position/characteristics of the item within the overlay. """ mOverlay.add(mGraphic); mGraphic.updateItem(item); }
java
@Override public void onUpdate(Detector.Detections<Barcode> detectionResults, Barcode item) { mOverlay.add(mGraphic); mGraphic.updateItem(item); }
[ "@", "Override", "public", "void", "onUpdate", "(", "Detector", ".", "Detections", "<", "Barcode", ">", "detectionResults", ",", "Barcode", "item", ")", "{", "mOverlay", ".", "add", "(", "mGraphic", ")", ";", "mGraphic", ".", "updateItem", "(", "item", ")"...
Update the position/characteristics of the item within the overlay.
[ "Update", "the", "position", "/", "characteristics", "of", "the", "item", "within", "the", "overlay", "." ]
train
https://github.com/Credntia/MVBarcodeReader/blob/2a2561f1c3b4d4e3c046a341fbf23a31eabfda8d/mvbarcodereader/src/main/java/devliving/online/mvbarcodereader/BarcodeGraphicTracker.java#L59-L63
thorntail/thorntail
core/bootstrap/src/main/java/org/wildfly/swarm/bootstrap/modules/GradleResolver.java
GradleResolver.toGradleArtifactFileName
String toGradleArtifactFileName(ArtifactCoordinates artifactCoordinates, String packaging) { """ Build file name for artifact. @param artifactCoordinates @param packaging @return """ StringBuilder sbFileFilter = new StringBuilder(); sbFileFilter .append(artifactCoordinates....
java
String toGradleArtifactFileName(ArtifactCoordinates artifactCoordinates, String packaging) { StringBuilder sbFileFilter = new StringBuilder(); sbFileFilter .append(artifactCoordinates.getArtifactId()) .append("-") .append(artifactCoordinates.getVersion());...
[ "String", "toGradleArtifactFileName", "(", "ArtifactCoordinates", "artifactCoordinates", ",", "String", "packaging", ")", "{", "StringBuilder", "sbFileFilter", "=", "new", "StringBuilder", "(", ")", ";", "sbFileFilter", ".", "append", "(", "artifactCoordinates", ".", ...
Build file name for artifact. @param artifactCoordinates @param packaging @return
[ "Build", "file", "name", "for", "artifact", "." ]
train
https://github.com/thorntail/thorntail/blob/4a391b68ffae98c6e66d30a3bfb99dadc9509f14/core/bootstrap/src/main/java/org/wildfly/swarm/bootstrap/modules/GradleResolver.java#L179-L194
enioka/jqm
jqm-all/jqm-engine/src/main/java/com/enioka/jqm/tools/Helpers.java
Helpers.createDeliverable
static int createDeliverable(String path, String originalFileName, String fileFamily, Integer jobId, DbConn cnx) { """ Create a Deliverable inside the database that will track a file created by a JobInstance Must be called from inside a transaction @param path FilePath (relative to a root directory - cf. Node)...
java
static int createDeliverable(String path, String originalFileName, String fileFamily, Integer jobId, DbConn cnx) { QueryResult qr = cnx.runUpdate("deliverable_insert", fileFamily, path, jobId, originalFileName, UUID.randomUUID().toString()); return qr.getGeneratedId(); }
[ "static", "int", "createDeliverable", "(", "String", "path", ",", "String", "originalFileName", ",", "String", "fileFamily", ",", "Integer", "jobId", ",", "DbConn", "cnx", ")", "{", "QueryResult", "qr", "=", "cnx", ".", "runUpdate", "(", "\"deliverable_insert\""...
Create a Deliverable inside the database that will track a file created by a JobInstance Must be called from inside a transaction @param path FilePath (relative to a root directory - cf. Node) @param originalFileName FileName @param fileFamily File family (may be null). E.g.: "daily report" @param jobId Job Instance I...
[ "Create", "a", "Deliverable", "inside", "the", "database", "that", "will", "track", "a", "file", "created", "by", "a", "JobInstance", "Must", "be", "called", "from", "inside", "a", "transaction" ]
train
https://github.com/enioka/jqm/blob/391733b8e291404b97c714c3727a241c4a861f98/jqm-all/jqm-engine/src/main/java/com/enioka/jqm/tools/Helpers.java#L209-L213
nyla-solutions/nyla
nyla.solutions.core/src/main/java/nyla/solutions/core/util/SettingsInMemory.java
SettingsInMemory.getText
public String getText(Class<?> aClass, String key) { """ Retrieves a Settings property as a String object. <p/>Loads the file if not already initialized. @param aClass the calling class @param key property key @return Value of the property as a string or null if no property found. """ return getTex...
java
public String getText(Class<?> aClass, String key) { return getText(aClass.getName()+"."+key); }
[ "public", "String", "getText", "(", "Class", "<", "?", ">", "aClass", ",", "String", "key", ")", "{", "return", "getText", "(", "aClass", ".", "getName", "(", ")", "+", "\".\"", "+", "key", ")", ";", "}" ]
Retrieves a Settings property as a String object. <p/>Loads the file if not already initialized. @param aClass the calling class @param key property key @return Value of the property as a string or null if no property found.
[ "Retrieves", "a", "Settings", "property", "as", "a", "String", "object", ".", "<p", "/", ">", "Loads", "the", "file", "if", "not", "already", "initialized", ".", "@param", "aClass", "the", "calling", "class", "@param", "key", "property", "key" ]
train
https://github.com/nyla-solutions/nyla/blob/38d5b843c76eae9762bbca20453ed0f0ad8412a9/nyla.solutions.core/src/main/java/nyla/solutions/core/util/SettingsInMemory.java#L112-L115
lievendoclo/Valkyrie-RCP
valkyrie-rcp-core/src/main/java/org/valkyriercp/widget/table/PropertyColumnTableDescription.java
PropertyColumnTableDescription.addPropertyColumn
public void addPropertyColumn(String propertyName, Class propertyType, int minWidth, int maxWidth) { """ WARNING: propertyType is discarded, it should be fetched from the entityType through introspection. @deprecated @see #addPropertyColumn(String) @see PropertyColumn#withMinWidth(int) @see PropertyColumn#wi...
java
public void addPropertyColumn(String propertyName, Class propertyType, int minWidth, int maxWidth) { addPropertyColumn(propertyName).withMinWidth(minWidth).withMaxWidth(maxWidth); }
[ "public", "void", "addPropertyColumn", "(", "String", "propertyName", ",", "Class", "propertyType", ",", "int", "minWidth", ",", "int", "maxWidth", ")", "{", "addPropertyColumn", "(", "propertyName", ")", ".", "withMinWidth", "(", "minWidth", ")", ".", "withMaxW...
WARNING: propertyType is discarded, it should be fetched from the entityType through introspection. @deprecated @see #addPropertyColumn(String) @see PropertyColumn#withMinWidth(int) @see PropertyColumn#withMaxWidth(int)
[ "WARNING", ":", "propertyType", "is", "discarded", "it", "should", "be", "fetched", "from", "the", "entityType", "through", "introspection", "." ]
train
https://github.com/lievendoclo/Valkyrie-RCP/blob/6aad6e640b348cda8f3b0841f6e42025233f1eb8/valkyrie-rcp-core/src/main/java/org/valkyriercp/widget/table/PropertyColumnTableDescription.java#L265-L268
Syncleus/aparapi
src/main/java/com/aparapi/internal/kernel/KernelRunner.java
KernelRunner.getClassModelFromArg
private ClassModel getClassModelFromArg(KernelArg arg, final Class<?> arrayClass) { """ Helper method to retrieve the class model from a kernel argument. @param arg the kernel argument @param arrayClass the array Java class for the argument @return the Aparapi ClassModel instance. """ ClassModel c = null...
java
private ClassModel getClassModelFromArg(KernelArg arg, final Class<?> arrayClass) { ClassModel c = null; if (arg.getObjArrayElementModel() == null) { final String tmp = arrayClass.getName().substring(2).replace('/', '.'); final String arrayClassInDotForm = tmp.substring(0, tmp.length() - 1)...
[ "private", "ClassModel", "getClassModelFromArg", "(", "KernelArg", "arg", ",", "final", "Class", "<", "?", ">", "arrayClass", ")", "{", "ClassModel", "c", "=", "null", ";", "if", "(", "arg", ".", "getObjArrayElementModel", "(", ")", "==", "null", ")", "{",...
Helper method to retrieve the class model from a kernel argument. @param arg the kernel argument @param arrayClass the array Java class for the argument @return the Aparapi ClassModel instance.
[ "Helper", "method", "to", "retrieve", "the", "class", "model", "from", "a", "kernel", "argument", "." ]
train
https://github.com/Syncleus/aparapi/blob/6d5892c8e69854b3968c541023de37cf4762bd24/src/main/java/com/aparapi/internal/kernel/KernelRunner.java#L763-L782
qos-ch/slf4j
slf4j-ext/src/main/java/org/slf4j/ext/XLogger.java
XLogger.catching
public void catching(Level level, Throwable throwable) { """ Log an exception being caught allowing the log level to be specified. @param level the logging level to use. @param throwable the exception being caught. """ if (instanceofLAL) { ((LocationAwareLogger) logger).log(CATCHING_M...
java
public void catching(Level level, Throwable throwable) { if (instanceofLAL) { ((LocationAwareLogger) logger).log(CATCHING_MARKER, FQCN, level.level, "catching", null, throwable); } }
[ "public", "void", "catching", "(", "Level", "level", ",", "Throwable", "throwable", ")", "{", "if", "(", "instanceofLAL", ")", "{", "(", "(", "LocationAwareLogger", ")", "logger", ")", ".", "log", "(", "CATCHING_MARKER", ",", "FQCN", ",", "level", ".", "...
Log an exception being caught allowing the log level to be specified. @param level the logging level to use. @param throwable the exception being caught.
[ "Log", "an", "exception", "being", "caught", "allowing", "the", "log", "level", "to", "be", "specified", "." ]
train
https://github.com/qos-ch/slf4j/blob/905443f39fadd88a8dd2c467e44affd8cb072a4d/slf4j-ext/src/main/java/org/slf4j/ext/XLogger.java#L199-L203
alkacon/opencms-core
src/org/opencms/workplace/tools/CmsToolManager.java
CmsToolManager.getParent
public String getParent(CmsWorkplace wp, String toolPath) { """ Returns the path to the parent of the tool identified by the given tool path.<p> The parent of the root is the same root.<p> @param wp the workplace object @param toolPath the abstract tool path @return his parent """ if (toolPa...
java
public String getParent(CmsWorkplace wp, String toolPath) { if (toolPath.equals(getBaseToolPath(wp))) { return toolPath; } int pos = toolPath.lastIndexOf(TOOLPATH_SEPARATOR); return pos <= 0 ? TOOLPATH_SEPARATOR : toolPath.substring(0, pos); }
[ "public", "String", "getParent", "(", "CmsWorkplace", "wp", ",", "String", "toolPath", ")", "{", "if", "(", "toolPath", ".", "equals", "(", "getBaseToolPath", "(", "wp", ")", ")", ")", "{", "return", "toolPath", ";", "}", "int", "pos", "=", "toolPath", ...
Returns the path to the parent of the tool identified by the given tool path.<p> The parent of the root is the same root.<p> @param wp the workplace object @param toolPath the abstract tool path @return his parent
[ "Returns", "the", "path", "to", "the", "parent", "of", "the", "tool", "identified", "by", "the", "given", "tool", "path", ".", "<p", ">" ]
train
https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/workplace/tools/CmsToolManager.java#L341-L348
graphql-java/graphql-java
src/main/java/graphql/execution/ExecutionStrategy.java
ExecutionStrategy.completeValueForEnum
protected CompletableFuture<ExecutionResult> completeValueForEnum(ExecutionContext executionContext, ExecutionStrategyParameters parameters, GraphQLEnumType enumType, Object result) { """ Called to turn an object into a enum value according to the {@link GraphQLEnumType} by asking that enum type to coerce the obje...
java
protected CompletableFuture<ExecutionResult> completeValueForEnum(ExecutionContext executionContext, ExecutionStrategyParameters parameters, GraphQLEnumType enumType, Object result) { Object serialized; try { serialized = enumType.getCoercing().serialize(result); } catch (CoercingSer...
[ "protected", "CompletableFuture", "<", "ExecutionResult", ">", "completeValueForEnum", "(", "ExecutionContext", "executionContext", ",", "ExecutionStrategyParameters", "parameters", ",", "GraphQLEnumType", "enumType", ",", "Object", "result", ")", "{", "Object", "serialized...
Called to turn an object into a enum value according to the {@link GraphQLEnumType} by asking that enum type to coerce the object into a valid value @param executionContext contains the top level execution parameters @param parameters contains the parameters holding the fields to be executed and source object @p...
[ "Called", "to", "turn", "an", "object", "into", "a", "enum", "value", "according", "to", "the", "{", "@link", "GraphQLEnumType", "}", "by", "asking", "that", "enum", "type", "to", "coerce", "the", "object", "into", "a", "valid", "value" ]
train
https://github.com/graphql-java/graphql-java/blob/9214b6044317849388bd88a14b54fc1c18c9f29f/src/main/java/graphql/execution/ExecutionStrategy.java#L589-L602
m-m-m/util
pojopath/src/main/java/net/sf/mmm/util/pojo/path/base/DefaultPojoPathFunctionManager.java
DefaultPojoPathFunctionManager.registerFunction
public PojoPathFunction registerFunction(PojoPathFunction function, String functionName) { """ This method registers the given {@code function} for the given {@code functionName} so it is available via {@link #getFunction(String)}. @see #getFunction(String) @param function is the {@link PojoPathFunction} to...
java
public PojoPathFunction registerFunction(PojoPathFunction function, String functionName) { if (function instanceof AbstractComponent) { // make things easier for users, duplicate initialization will do nothing ((AbstractComponent) function).initialize(); } return this.functionMap.put(functionNa...
[ "public", "PojoPathFunction", "registerFunction", "(", "PojoPathFunction", "function", ",", "String", "functionName", ")", "{", "if", "(", "function", "instanceof", "AbstractComponent", ")", "{", "// make things easier for users, duplicate initialization will do nothing", "(", ...
This method registers the given {@code function} for the given {@code functionName} so it is available via {@link #getFunction(String)}. @see #getFunction(String) @param function is the {@link PojoPathFunction} to register. @param functionName is the {@link #getFunction(String) associated name}. @return the {@link Po...
[ "This", "method", "registers", "the", "given", "{", "@code", "function", "}", "for", "the", "given", "{", "@code", "functionName", "}", "so", "it", "is", "available", "via", "{", "@link", "#getFunction", "(", "String", ")", "}", "." ]
train
https://github.com/m-m-m/util/blob/f0e4e084448f8dfc83ca682a9e1618034a094ce6/pojopath/src/main/java/net/sf/mmm/util/pojo/path/base/DefaultPojoPathFunctionManager.java#L59-L66
airlift/slice
src/main/java/io/airlift/slice/Slices.java
Slices.wrappedBooleanArray
public static Slice wrappedBooleanArray(boolean[] array, int offset, int length) { """ Creates a slice over the specified array range. @param offset the array position at which the slice begins @param length the number of array positions to include in the slice """ if (length == 0) { re...
java
public static Slice wrappedBooleanArray(boolean[] array, int offset, int length) { if (length == 0) { return EMPTY_SLICE; } return new Slice(array, offset, length); }
[ "public", "static", "Slice", "wrappedBooleanArray", "(", "boolean", "[", "]", "array", ",", "int", "offset", ",", "int", "length", ")", "{", "if", "(", "length", "==", "0", ")", "{", "return", "EMPTY_SLICE", ";", "}", "return", "new", "Slice", "(", "ar...
Creates a slice over the specified array range. @param offset the array position at which the slice begins @param length the number of array positions to include in the slice
[ "Creates", "a", "slice", "over", "the", "specified", "array", "range", "." ]
train
https://github.com/airlift/slice/blob/7166cb0319e3655f8ba15f5a7ccf3d2f721c1242/src/main/java/io/airlift/slice/Slices.java#L171-L177
landawn/AbacusUtil
src/com/landawn/abacus/util/MongoDB.java
MongoDB.fromJSON
public static <T> T fromJSON(final Class<T> targetClass, final String json) { """ Returns an instance of the specified target class with the property values from the specified JSON String. @param targetClass <code>Bson.class</code>, <code>Document.class</code>, <code>BasicBSONObject.class</code>, <code>BasicDBO...
java
public static <T> T fromJSON(final Class<T> targetClass, final String json) { if (targetClass.equals(Bson.class) || targetClass.equals(Document.class)) { final Document doc = new Document(); jsonParser.readString(doc, json); return (T) doc; } else if (targetClass...
[ "public", "static", "<", "T", ">", "T", "fromJSON", "(", "final", "Class", "<", "T", ">", "targetClass", ",", "final", "String", "json", ")", "{", "if", "(", "targetClass", ".", "equals", "(", "Bson", ".", "class", ")", "||", "targetClass", ".", "equ...
Returns an instance of the specified target class with the property values from the specified JSON String. @param targetClass <code>Bson.class</code>, <code>Document.class</code>, <code>BasicBSONObject.class</code>, <code>BasicDBObject.class</code> @param json @return
[ "Returns", "an", "instance", "of", "the", "specified", "target", "class", "with", "the", "property", "values", "from", "the", "specified", "JSON", "String", "." ]
train
https://github.com/landawn/AbacusUtil/blob/544b7720175d15e9329f83dd22a8cc5fa4515e12/src/com/landawn/abacus/util/MongoDB.java#L412-L428
threerings/narya
core/src/main/java/com/threerings/presents/server/net/PresentsConnectionManager.java
PresentsConnectionManager.postDatagram
protected boolean postDatagram (PresentsConnection conn, Message msg) throws Exception { """ Helper function for {@link #postMessage}; handles posting the message as a datagram. @return true if the datagram was successfully posted, false if it was too big. """ _flattener.reset(); //...
java
protected boolean postDatagram (PresentsConnection conn, Message msg) throws Exception { _flattener.reset(); // flatten the message using the connection's sequencer DatagramSequencer sequencer = conn.getDatagramSequencer(); sequencer.writeDatagram(msg); // if the me...
[ "protected", "boolean", "postDatagram", "(", "PresentsConnection", "conn", ",", "Message", "msg", ")", "throws", "Exception", "{", "_flattener", ".", "reset", "(", ")", ";", "// flatten the message using the connection's sequencer", "DatagramSequencer", "sequencer", "=", ...
Helper function for {@link #postMessage}; handles posting the message as a datagram. @return true if the datagram was successfully posted, false if it was too big.
[ "Helper", "function", "for", "{", "@link", "#postMessage", "}", ";", "handles", "posting", "the", "message", "as", "a", "datagram", "." ]
train
https://github.com/threerings/narya/blob/5b01edc8850ed0c32d004b4049e1ac4a02027ede/core/src/main/java/com/threerings/presents/server/net/PresentsConnectionManager.java#L318-L342
igniterealtime/Smack
smack-extensions/src/main/java/org/jivesoftware/smackx/search/UserSearch.java
UserSearch.sendSearchForm
public ReportedData sendSearchForm(XMPPConnection con, Form searchForm, DomainBareJid searchService) throws NoResponseException, XMPPErrorException, NotConnectedException, InterruptedException { """ Sends the filled out answer form to be sent and queried by the search service. @param con the current X...
java
public ReportedData sendSearchForm(XMPPConnection con, Form searchForm, DomainBareJid searchService) throws NoResponseException, XMPPErrorException, NotConnectedException, InterruptedException { UserSearch search = new UserSearch(); search.setType(IQ.Type.set); search.setTo(searchService); ...
[ "public", "ReportedData", "sendSearchForm", "(", "XMPPConnection", "con", ",", "Form", "searchForm", ",", "DomainBareJid", "searchService", ")", "throws", "NoResponseException", ",", "XMPPErrorException", ",", "NotConnectedException", ",", "InterruptedException", "{", "Us...
Sends the filled out answer form to be sent and queried by the search service. @param con the current XMPPConnection. @param searchForm the <code>Form</code> to send for querying. @param searchService the search service to use. (ex. search.jivesoftware.com) @return ReportedData the data found from the que...
[ "Sends", "the", "filled", "out", "answer", "form", "to", "be", "sent", "and", "queried", "by", "the", "search", "service", "." ]
train
https://github.com/igniterealtime/Smack/blob/870756997faec1e1bfabfac0cd6c2395b04da873/smack-extensions/src/main/java/org/jivesoftware/smackx/search/UserSearch.java#L94-L102
Azure/azure-sdk-for-java
batch/data-plane/src/main/java/com/microsoft/azure/batch/ComputeNodeOperations.java
ComputeNodeOperations.getComputeNodeRemoteDesktop
public String getComputeNodeRemoteDesktop(String poolId, String nodeId, Iterable<BatchClientBehavior> additionalBehaviors) throws BatchErrorException, IOException { """ Gets a Remote Desktop Protocol (RDP) file for the specified node. @param poolId The ID of the pool that contains the compute node. @param node...
java
public String getComputeNodeRemoteDesktop(String poolId, String nodeId, Iterable<BatchClientBehavior> additionalBehaviors) throws BatchErrorException, IOException { ComputeNodeGetRemoteDesktopOptions options = new ComputeNodeGetRemoteDesktopOptions(); BehaviorManager bhMgr = new BehaviorManager(this.cus...
[ "public", "String", "getComputeNodeRemoteDesktop", "(", "String", "poolId", ",", "String", "nodeId", ",", "Iterable", "<", "BatchClientBehavior", ">", "additionalBehaviors", ")", "throws", "BatchErrorException", ",", "IOException", "{", "ComputeNodeGetRemoteDesktopOptions",...
Gets a Remote Desktop Protocol (RDP) file for the specified node. @param poolId The ID of the pool that contains the compute node. @param nodeId The ID of the compute node for which to get a Remote Desktop file. @param additionalBehaviors A collection of {@link BatchClientBehavior} instances that are applied to the Ba...
[ "Gets", "a", "Remote", "Desktop", "Protocol", "(", "RDP", ")", "file", "for", "the", "specified", "node", "." ]
train
https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/batch/data-plane/src/main/java/com/microsoft/azure/batch/ComputeNodeOperations.java#L455-L465
nguillaumin/slick2d-maven
slick2d-hiero/src/main/java/org/newdawn/slick/tools/hiero/HieroConfig.java
HieroConfig.listFiles
public static File[] listFiles(final String ext) { """ List the files with a given extension in the configuration directory @param ext The extension to search for @return The list of files from the configuration directory """ init(); return config.listFiles(new FilenameFilter() { public boo...
java
public static File[] listFiles(final String ext) { init(); return config.listFiles(new FilenameFilter() { public boolean accept(File dir, String name) { return name.endsWith(ext); } }); }
[ "public", "static", "File", "[", "]", "listFiles", "(", "final", "String", "ext", ")", "{", "init", "(", ")", ";", "return", "config", ".", "listFiles", "(", "new", "FilenameFilter", "(", ")", "{", "public", "boolean", "accept", "(", "File", "dir", ","...
List the files with a given extension in the configuration directory @param ext The extension to search for @return The list of files from the configuration directory
[ "List", "the", "files", "with", "a", "given", "extension", "in", "the", "configuration", "directory" ]
train
https://github.com/nguillaumin/slick2d-maven/blob/8251f88a0ed6a70e726d2468842455cd1f80893f/slick2d-hiero/src/main/java/org/newdawn/slick/tools/hiero/HieroConfig.java#L50-L59
looly/hutool
hutool-core/src/main/java/cn/hutool/core/img/ImgUtil.java
ImgUtil.pressText
public static void pressText(Image srcImage, OutputStream to, String pressText, Color color, Font font, int x, int y, float alpha) throws IORuntimeException { """ 给图片添加文字水印<br> 此方法并不关闭流 @param srcImage 源图像 @param to 目标流 @param pressText 水印文字 @param color 水印的字体颜色 @param font {@link Font} 字体相关信息,如果默认则为{@code...
java
public static void pressText(Image srcImage, OutputStream to, String pressText, Color color, Font font, int x, int y, float alpha) throws IORuntimeException { pressText(srcImage, getImageOutputStream(to), pressText, color, font, x, y, alpha); }
[ "public", "static", "void", "pressText", "(", "Image", "srcImage", ",", "OutputStream", "to", ",", "String", "pressText", ",", "Color", "color", ",", "Font", "font", ",", "int", "x", ",", "int", "y", ",", "float", "alpha", ")", "throws", "IORuntimeExceptio...
给图片添加文字水印<br> 此方法并不关闭流 @param srcImage 源图像 @param to 目标流 @param pressText 水印文字 @param color 水印的字体颜色 @param font {@link Font} 字体相关信息,如果默认则为{@code null} @param x 修正值。 默认在中间,偏移量相对于中间偏移 @param y 修正值。 默认在中间,偏移量相对于中间偏移 @param alpha 透明度:alpha 必须是范围 [0.0, 1.0] 之内(包含边界值)的一个浮点数字 @throws IORuntimeException IO异常 @since 3.2.2
[ "给图片添加文字水印<br", ">", "此方法并不关闭流" ]
train
https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-core/src/main/java/cn/hutool/core/img/ImgUtil.java#L826-L828
FasterXML/woodstox
src/main/java/com/ctc/wstx/sw/BaseNsStreamWriter.java
BaseNsStreamWriter.writeAttribute
@Override public void writeAttribute(String localName, String value) throws XMLStreamException { """ It's assumed calling this method implies caller just wants to add an attribute that does not belong to any namespace; as such no namespace checking or prefix generation is needed. """ // N...
java
@Override public void writeAttribute(String localName, String value) throws XMLStreamException { // No need to set mAnyOutput, nor close the element if (!mStartElementOpen && mCheckStructure) { reportNwfStructure(ErrorConsts.WERR_ATTR_NO_ELEM); } doWriteAttr(l...
[ "@", "Override", "public", "void", "writeAttribute", "(", "String", "localName", ",", "String", "value", ")", "throws", "XMLStreamException", "{", "// No need to set mAnyOutput, nor close the element", "if", "(", "!", "mStartElementOpen", "&&", "mCheckStructure", ")", "...
It's assumed calling this method implies caller just wants to add an attribute that does not belong to any namespace; as such no namespace checking or prefix generation is needed.
[ "It", "s", "assumed", "calling", "this", "method", "implies", "caller", "just", "wants", "to", "add", "an", "attribute", "that", "does", "not", "belong", "to", "any", "namespace", ";", "as", "such", "no", "namespace", "checking", "or", "prefix", "generation"...
train
https://github.com/FasterXML/woodstox/blob/ffcaabdc06672d9564c48c25d601d029b7fd6548/src/main/java/com/ctc/wstx/sw/BaseNsStreamWriter.java#L219-L228
ModeShape/modeshape
web/modeshape-webdav/src/main/java/org/modeshape/webdav/locking/ResourceLocks.java
ResourceLocks.generateLockedObjects
private LockedObject generateLockedObjects( String path ) { """ generates real LockedObjects for the resource at path and its parent folders. does not create new LockedObjects if they already exist @param path path to the (new) LockedObject @return the LockedObject for path. """ if (!locks.contain...
java
private LockedObject generateLockedObjects( String path ) { if (!locks.containsKey(path)) { LockedObject returnObject = new LockedObject(this, path, !temporary); String parentPath = getParentPath(path); if (parentPath != null) { LockedObject parentLockedObject...
[ "private", "LockedObject", "generateLockedObjects", "(", "String", "path", ")", "{", "if", "(", "!", "locks", ".", "containsKey", "(", "path", ")", ")", "{", "LockedObject", "returnObject", "=", "new", "LockedObject", "(", "this", ",", "path", ",", "!", "t...
generates real LockedObjects for the resource at path and its parent folders. does not create new LockedObjects if they already exist @param path path to the (new) LockedObject @return the LockedObject for path.
[ "generates", "real", "LockedObjects", "for", "the", "resource", "at", "path", "and", "its", "parent", "folders", ".", "does", "not", "create", "new", "LockedObjects", "if", "they", "already", "exist" ]
train
https://github.com/ModeShape/modeshape/blob/794cfdabb67a90f24629c4fff0424a6125f8f95b/web/modeshape-webdav/src/main/java/org/modeshape/webdav/locking/ResourceLocks.java#L262-L275
lucee/Lucee
core/src/main/java/lucee/runtime/type/util/StructSupport.java
StructSupport.invalidKey
public static ExpressionException invalidKey(Config config, Struct sct, Key key, String in) { """ throw exception for invalid key @param key Invalid key @return returns an invalid key Exception """ String appendix = StringUtil.isEmpty(in, true) ? "" : " in the " + in; Iterator<Key> it = sct.keyIterator()...
java
public static ExpressionException invalidKey(Config config, Struct sct, Key key, String in) { String appendix = StringUtil.isEmpty(in, true) ? "" : " in the " + in; Iterator<Key> it = sct.keyIterator(); Key k; while (it.hasNext()) { k = it.next(); if (k.equals(key)) return new ExpressionException("the va...
[ "public", "static", "ExpressionException", "invalidKey", "(", "Config", "config", ",", "Struct", "sct", ",", "Key", "key", ",", "String", "in", ")", "{", "String", "appendix", "=", "StringUtil", ".", "isEmpty", "(", "in", ",", "true", ")", "?", "\"\"", "...
throw exception for invalid key @param key Invalid key @return returns an invalid key Exception
[ "throw", "exception", "for", "invalid", "key" ]
train
https://github.com/lucee/Lucee/blob/29b153fc4e126e5edb97da937f2ee2e231b87593/core/src/main/java/lucee/runtime/type/util/StructSupport.java#L55-L68
UrielCh/ovh-java-sdk
ovh-java-sdk-dedicatedserver/src/main/java/net/minidev/ovh/api/ApiOvhDedicatedserver.java
ApiOvhDedicatedserver.serviceName_serviceMonitoring_monitoringId_alert_email_alertId_PUT
public void serviceName_serviceMonitoring_monitoringId_alert_email_alertId_PUT(String serviceName, Long monitoringId, Long alertId, OvhEmailAlert body) throws IOException { """ Alter this object properties REST: PUT /dedicated/server/{serviceName}/serviceMonitoring/{monitoringId}/alert/email/{alertId} @param b...
java
public void serviceName_serviceMonitoring_monitoringId_alert_email_alertId_PUT(String serviceName, Long monitoringId, Long alertId, OvhEmailAlert body) throws IOException { String qPath = "/dedicated/server/{serviceName}/serviceMonitoring/{monitoringId}/alert/email/{alertId}"; StringBuilder sb = path(qPath, service...
[ "public", "void", "serviceName_serviceMonitoring_monitoringId_alert_email_alertId_PUT", "(", "String", "serviceName", ",", "Long", "monitoringId", ",", "Long", "alertId", ",", "OvhEmailAlert", "body", ")", "throws", "IOException", "{", "String", "qPath", "=", "\"/dedicate...
Alter this object properties REST: PUT /dedicated/server/{serviceName}/serviceMonitoring/{monitoringId}/alert/email/{alertId} @param body [required] New object properties @param serviceName [required] The internal name of your dedicated server @param monitoringId [required] This monitoring id @param alertId [required]...
[ "Alter", "this", "object", "properties" ]
train
https://github.com/UrielCh/ovh-java-sdk/blob/6d531a40e56e09701943e334c25f90f640c55701/ovh-java-sdk-dedicatedserver/src/main/java/net/minidev/ovh/api/ApiOvhDedicatedserver.java#L2208-L2212
groupon/monsoon
collectors/jmx/src/main/java/com/groupon/lex/metrics/jmx/MBeanGroup.java
MBeanGroup.nameFromObjectName
private static GroupName nameFromObjectName(ObjectName obj_name, NamedResolverMap resolvedMap) { """ Extract a metric group name from a JMX ObjectName. @param obj_name a JMX object name from which to derive a metric name. @param resolvedMap a resolver map to use when generating the group name. @return A metri...
java
private static GroupName nameFromObjectName(ObjectName obj_name, NamedResolverMap resolvedMap) { String name = obj_name.getKeyProperty("name"); String type = obj_name.getKeyProperty("type"); String domain = obj_name.getDomain(); Map<String, MetricValue> tags = obj_name.getKeyPropertyLis...
[ "private", "static", "GroupName", "nameFromObjectName", "(", "ObjectName", "obj_name", ",", "NamedResolverMap", "resolvedMap", ")", "{", "String", "name", "=", "obj_name", ".", "getKeyProperty", "(", "\"name\"", ")", ";", "String", "type", "=", "obj_name", ".", ...
Extract a metric group name from a JMX ObjectName. @param obj_name a JMX object name from which to derive a metric name. @param resolvedMap a resolver map to use when generating the group name. @return A metric name for the given ObjectName, with tags.
[ "Extract", "a", "metric", "group", "name", "from", "a", "JMX", "ObjectName", "." ]
train
https://github.com/groupon/monsoon/blob/eb68d72ba4c01fe018dc981097dbee033908f5c7/collectors/jmx/src/main/java/com/groupon/lex/metrics/jmx/MBeanGroup.java#L131-L152
b3dgs/lionengine
lionengine-core/src/main/java/com/b3dgs/lionengine/UtilMath.java
UtilMath.getDistance
public static double getDistance(double x1, double y1, double x2, double y2) { """ Get distance of two points. @param x1 The point 1 x. @param y1 The point 1 y. @param x2 The point 2 x. @param y2 The point 2 y. @return The distance between them. """ final double x = x2 - x1; final double...
java
public static double getDistance(double x1, double y1, double x2, double y2) { final double x = x2 - x1; final double y = y2 - y1; return StrictMath.sqrt(x * x + y * y); }
[ "public", "static", "double", "getDistance", "(", "double", "x1", ",", "double", "y1", ",", "double", "x2", ",", "double", "y2", ")", "{", "final", "double", "x", "=", "x2", "-", "x1", ";", "final", "double", "y", "=", "y2", "-", "y1", ";", "return...
Get distance of two points. @param x1 The point 1 x. @param y1 The point 1 y. @param x2 The point 2 x. @param y2 The point 2 y. @return The distance between them.
[ "Get", "distance", "of", "two", "points", "." ]
train
https://github.com/b3dgs/lionengine/blob/cac3d5578532cf11724a737b9f09e71bf9995ab2/lionengine-core/src/main/java/com/b3dgs/lionengine/UtilMath.java#L176-L182
spring-projects/spring-social
spring-social-web/src/main/java/org/springframework/social/connect/web/ConnectSupport.java
ConnectSupport.buildOAuthUrl
public String buildOAuthUrl(ConnectionFactory<?> connectionFactory, NativeWebRequest request, MultiValueMap<String, String> additionalParameters) { """ Builds the provider URL to redirect the user to for connection authorization. @param connectionFactory the service provider's connection factory e.g. FacebookConn...
java
public String buildOAuthUrl(ConnectionFactory<?> connectionFactory, NativeWebRequest request, MultiValueMap<String, String> additionalParameters) { if (connectionFactory instanceof OAuth1ConnectionFactory) { return buildOAuth1Url((OAuth1ConnectionFactory<?>) connectionFactory, request, additionalParameters); } e...
[ "public", "String", "buildOAuthUrl", "(", "ConnectionFactory", "<", "?", ">", "connectionFactory", ",", "NativeWebRequest", "request", ",", "MultiValueMap", "<", "String", ",", "String", ">", "additionalParameters", ")", "{", "if", "(", "connectionFactory", "instanc...
Builds the provider URL to redirect the user to for connection authorization. @param connectionFactory the service provider's connection factory e.g. FacebookConnectionFactory @param request the current web request @param additionalParameters parameters to add to the authorization URL. @return the URL to redirect the u...
[ "Builds", "the", "provider", "URL", "to", "redirect", "the", "user", "to", "for", "connection", "authorization", "." ]
train
https://github.com/spring-projects/spring-social/blob/e41cfecb288022b83c79413b58f52511c3c9d4fc/spring-social-web/src/main/java/org/springframework/social/connect/web/ConnectSupport.java#L124-L132
netscaler/sdx_nitro
src/main/java/com/citrix/sdx/nitro/resource/config/ns/ns_doc_image.java
ns_doc_image.get_nitro_bulk_response
protected base_resource[] get_nitro_bulk_response(nitro_service service, String response) throws Exception { """ <pre> Converts API response of bulk operation into object and returns the object array in case of get request. </pre> """ ns_doc_image_responses result = (ns_doc_image_responses) service.get_pa...
java
protected base_resource[] get_nitro_bulk_response(nitro_service service, String response) throws Exception { ns_doc_image_responses result = (ns_doc_image_responses) service.get_payload_formatter().string_to_resource(ns_doc_image_responses.class, response); if(result.errorcode != 0) { if (result.errorcod...
[ "protected", "base_resource", "[", "]", "get_nitro_bulk_response", "(", "nitro_service", "service", ",", "String", "response", ")", "throws", "Exception", "{", "ns_doc_image_responses", "result", "=", "(", "ns_doc_image_responses", ")", "service", ".", "get_payload_form...
<pre> Converts API response of bulk operation into object and returns the object array in case of get request. </pre>
[ "<pre", ">", "Converts", "API", "response", "of", "bulk", "operation", "into", "object", "and", "returns", "the", "object", "array", "in", "case", "of", "get", "request", ".", "<", "/", "pre", ">" ]
train
https://github.com/netscaler/sdx_nitro/blob/c840919f1a8f7c0a5634c0f23d34fa14d1765ff1/src/main/java/com/citrix/sdx/nitro/resource/config/ns/ns_doc_image.java#L265-L282
OrienteerBAP/wicket-orientdb
wicket-orientdb/src/main/java/ru/ydn/wicket/wicketorientdb/utils/OSchemaHelper.java
OSchemaHelper.oClass
private OSchemaHelper oClass(String className, boolean abstractClass, String... superClasses) { """ Create if required {@link OClass} @param className name of a class to create @param abstractClass is this class abstract @param superClasses list of superclasses @return this helper """ lastClass = schema....
java
private OSchemaHelper oClass(String className, boolean abstractClass, String... superClasses) { lastClass = schema.getClass(className); if(lastClass==null) { OClass[] superClassesArray = new OClass[superClasses.length]; for (int i = 0; i < superClasses.length; i++) { String superClassName = superClasse...
[ "private", "OSchemaHelper", "oClass", "(", "String", "className", ",", "boolean", "abstractClass", ",", "String", "...", "superClasses", ")", "{", "lastClass", "=", "schema", ".", "getClass", "(", "className", ")", ";", "if", "(", "lastClass", "==", "null", ...
Create if required {@link OClass} @param className name of a class to create @param abstractClass is this class abstract @param superClasses list of superclasses @return this helper
[ "Create", "if", "required", "{" ]
train
https://github.com/OrienteerBAP/wicket-orientdb/blob/eb1d94f00a6bff9e266c5c032baa6043afc1db92/wicket-orientdb/src/main/java/ru/ydn/wicket/wicketorientdb/utils/OSchemaHelper.java#L88-L107
italiangrid/voms-api-java
src/main/java/org/italiangrid/voms/util/CredentialsUtils.java
CredentialsUtils.savePrivateKeyPKCS1
private static void savePrivateKeyPKCS1(OutputStream os, PrivateKey key) throws IllegalArgumentException, IOException { """ Serializes a private key to an output stream following the pkcs1 encoding. This method just delegates to canl, but provides a much more understandable signature. @param os @param ...
java
private static void savePrivateKeyPKCS1(OutputStream os, PrivateKey key) throws IllegalArgumentException, IOException { CertificateUtils.savePrivateKey(os, key, Encoding.PEM, null, new char[0], true); }
[ "private", "static", "void", "savePrivateKeyPKCS1", "(", "OutputStream", "os", ",", "PrivateKey", "key", ")", "throws", "IllegalArgumentException", ",", "IOException", "{", "CertificateUtils", ".", "savePrivateKey", "(", "os", ",", "key", ",", "Encoding", ".", "PE...
Serializes a private key to an output stream following the pkcs1 encoding. This method just delegates to canl, but provides a much more understandable signature. @param os @param key @throws IllegalArgumentException @throws IOException
[ "Serializes", "a", "private", "key", "to", "an", "output", "stream", "following", "the", "pkcs1", "encoding", "." ]
train
https://github.com/italiangrid/voms-api-java/blob/b33d6cf98ca9449bed87b1cc307d411514589deb/src/main/java/org/italiangrid/voms/util/CredentialsUtils.java#L117-L123
incodehq-legacy/incode-module-document
dom/src/main/java/org/incode/module/document/dom/impl/docs/DocumentTemplateRepository.java
DocumentTemplateRepository.findByTypeAndAtPathAndDate
@Programmatic public DocumentTemplate findByTypeAndAtPathAndDate(final DocumentType documentType, final String atPath, final LocalDate date) { """ Returns the document template, if any for the specified {@link DocumentType} and exact application tenancy, and exact date. """ return repositoryService...
java
@Programmatic public DocumentTemplate findByTypeAndAtPathAndDate(final DocumentType documentType, final String atPath, final LocalDate date) { return repositoryService.firstMatch( new QueryDefault<>(DocumentTemplate.class, "findByTypeAndAtPathAndDate", ...
[ "@", "Programmatic", "public", "DocumentTemplate", "findByTypeAndAtPathAndDate", "(", "final", "DocumentType", "documentType", ",", "final", "String", "atPath", ",", "final", "LocalDate", "date", ")", "{", "return", "repositoryService", ".", "firstMatch", "(", "new", ...
Returns the document template, if any for the specified {@link DocumentType} and exact application tenancy, and exact date.
[ "Returns", "the", "document", "template", "if", "any", "for", "the", "specified", "{" ]
train
https://github.com/incodehq-legacy/incode-module-document/blob/c62f064e96d6e6007f7fd6a4bc06e03b78b1816c/dom/src/main/java/org/incode/module/document/dom/impl/docs/DocumentTemplateRepository.java#L193-L201
rzwitserloot/lombok
src/core/lombok/javac/handlers/JavacHandlerUtil.java
JavacHandlerUtil.typeMatches
public static boolean typeMatches(String type, JavacNode node, JCTree typeNode) { """ Checks if the given TypeReference node is likely to be a reference to the provided class. @param type An actual type. This method checks if {@code typeNode} is likely to be a reference to this type. @param node A Lombok AST n...
java
public static boolean typeMatches(String type, JavacNode node, JCTree typeNode) { String typeName = typeNode == null ? null : typeNode.toString(); if (typeName == null || typeName.length() == 0) return false; int lastIndexA = typeName.lastIndexOf('.') + 1; int lastIndexB = Math.max(type.lastIndexOf('.'), type.l...
[ "public", "static", "boolean", "typeMatches", "(", "String", "type", ",", "JavacNode", "node", ",", "JCTree", "typeNode", ")", "{", "String", "typeName", "=", "typeNode", "==", "null", "?", "null", ":", "typeNode", ".", "toString", "(", ")", ";", "if", "...
Checks if the given TypeReference node is likely to be a reference to the provided class. @param type An actual type. This method checks if {@code typeNode} is likely to be a reference to this type. @param node A Lombok AST node. Any node in the appropriate compilation unit will do (used to get access to import statem...
[ "Checks", "if", "the", "given", "TypeReference", "node", "is", "likely", "to", "be", "a", "reference", "to", "the", "provided", "class", "." ]
train
https://github.com/rzwitserloot/lombok/blob/75601240760bd81ff95fcde7a1b8185769ce64e8/src/core/lombok/javac/handlers/JavacHandlerUtil.java#L302-L312
f2prateek/dart
henson/src/main/java/dart/henson/Bundler.java
Bundler.putSparseParcelableArray
public Bundler putSparseParcelableArray(String key, SparseArray<? extends Parcelable> value) { """ Inserts a SparceArray of Parcelable values into the mapping of this Bundle, replacing any existing value for the given key. Either key or value may be null. @param key a String, or null @param value a SparseArra...
java
public Bundler putSparseParcelableArray(String key, SparseArray<? extends Parcelable> value) { delegate.putSparseParcelableArray(key, value); return this; }
[ "public", "Bundler", "putSparseParcelableArray", "(", "String", "key", ",", "SparseArray", "<", "?", "extends", "Parcelable", ">", "value", ")", "{", "delegate", ".", "putSparseParcelableArray", "(", "key", ",", "value", ")", ";", "return", "this", ";", "}" ]
Inserts a SparceArray of Parcelable values into the mapping of this Bundle, replacing any existing value for the given key. Either key or value may be null. @param key a String, or null @param value a SparseArray of Parcelable objects, or null @return this bundler instance to chain method calls
[ "Inserts", "a", "SparceArray", "of", "Parcelable", "values", "into", "the", "mapping", "of", "this", "Bundle", "replacing", "any", "existing", "value", "for", "the", "given", "key", ".", "Either", "key", "or", "value", "may", "be", "null", "." ]
train
https://github.com/f2prateek/dart/blob/7163b1b148e5141817975ae7dad99d58a8589aeb/henson/src/main/java/dart/henson/Bundler.java#L387-L390
infinispan/infinispan
server/core/src/main/java/org/infinispan/server/core/transport/ExtendedByteBuf.java
ExtendedByteBuf.readString
public static String readString(ByteBuf bf) { """ Reads length of String and then returns an UTF-8 formatted String of such length. If the length is 0, an empty String is returned. """ byte[] bytes = readRangedBytes(bf); return bytes.length > 0 ? new String(bytes, CharsetUtil.UTF_8) : ""; }
java
public static String readString(ByteBuf bf) { byte[] bytes = readRangedBytes(bf); return bytes.length > 0 ? new String(bytes, CharsetUtil.UTF_8) : ""; }
[ "public", "static", "String", "readString", "(", "ByteBuf", "bf", ")", "{", "byte", "[", "]", "bytes", "=", "readRangedBytes", "(", "bf", ")", ";", "return", "bytes", ".", "length", ">", "0", "?", "new", "String", "(", "bytes", ",", "CharsetUtil", ".",...
Reads length of String and then returns an UTF-8 formatted String of such length. If the length is 0, an empty String is returned.
[ "Reads", "length", "of", "String", "and", "then", "returns", "an", "UTF", "-", "8", "formatted", "String", "of", "such", "length", ".", "If", "the", "length", "is", "0", "an", "empty", "String", "is", "returned", "." ]
train
https://github.com/infinispan/infinispan/blob/7c62b94886c3febb4774ae8376acf2baa0265ab5/server/core/src/main/java/org/infinispan/server/core/transport/ExtendedByteBuf.java#L58-L61
phax/ph-commons
ph-dao/src/main/java/com/helger/dao/wal/AbstractMapBasedWALDAO.java
AbstractMapBasedWALDAO.internalCreateItem
@MustBeLocked (ELockType.WRITE) @Nonnull protected final IMPLTYPE internalCreateItem (@Nonnull final IMPLTYPE aNewItem) { """ Add an item including invoking the callback. Must only be invoked inside a write-lock. @param aNewItem The item to be added. May not be <code>null</code>. @return The passed param...
java
@MustBeLocked (ELockType.WRITE) @Nonnull protected final IMPLTYPE internalCreateItem (@Nonnull final IMPLTYPE aNewItem) { return internalCreateItem (aNewItem, true); }
[ "@", "MustBeLocked", "(", "ELockType", ".", "WRITE", ")", "@", "Nonnull", "protected", "final", "IMPLTYPE", "internalCreateItem", "(", "@", "Nonnull", "final", "IMPLTYPE", "aNewItem", ")", "{", "return", "internalCreateItem", "(", "aNewItem", ",", "true", ")", ...
Add an item including invoking the callback. Must only be invoked inside a write-lock. @param aNewItem The item to be added. May not be <code>null</code>. @return The passed parameter as-is. Never <code>null</code>. @throws IllegalArgumentException If an item with the same ID is already contained
[ "Add", "an", "item", "including", "invoking", "the", "callback", ".", "Must", "only", "be", "invoked", "inside", "a", "write", "-", "lock", "." ]
train
https://github.com/phax/ph-commons/blob/d28c03565f44a0b804d96028d0969f9bb38c4313/ph-dao/src/main/java/com/helger/dao/wal/AbstractMapBasedWALDAO.java#L294-L299
sniggle/simple-pgp
simple-pgp-java/src/main/java/me/sniggle/pgp/crypt/internal/BasePGPCommon.java
BasePGPCommon.findPrivateKey
protected PGPPrivateKey findPrivateKey(InputStream secretKey, String password, KeyFilter<PGPSecretKey> keyFilter) throws IOException, PGPException { """ read a private key and unlock it with the given password @param secretKey the secret key stream @param password the password to use to unlock the private ke...
java
protected PGPPrivateKey findPrivateKey(InputStream secretKey, String password, KeyFilter<PGPSecretKey> keyFilter) throws IOException, PGPException { LOGGER.trace("findPrivateKey(InputStream, String, KeyFilter<PGPSecretKey>)"); LOGGER.trace("Secret Key: {}, Password: {}, KeyFilter: {}", secretKey == null ? "not ...
[ "protected", "PGPPrivateKey", "findPrivateKey", "(", "InputStream", "secretKey", ",", "String", "password", ",", "KeyFilter", "<", "PGPSecretKey", ">", "keyFilter", ")", "throws", "IOException", ",", "PGPException", "{", "LOGGER", ".", "trace", "(", "\"findPrivateKe...
read a private key and unlock it with the given password @param secretKey the secret key stream @param password the password to use to unlock the private key @param keyFilter the filter ot find the appropriate key @return the appropriate private key or null if none matches the filter @throws IOException @throws PGPEx...
[ "read", "a", "private", "key", "and", "unlock", "it", "with", "the", "given", "password" ]
train
https://github.com/sniggle/simple-pgp/blob/2ab83e4d370b8189f767d8e4e4c7e6020e60fbe3/simple-pgp-java/src/main/java/me/sniggle/pgp/crypt/internal/BasePGPCommon.java#L245-L249
googleapis/google-cloud-java
google-cloud-clients/google-cloud-firestore/src/main/java/com/google/cloud/firestore/Query.java
Query.whereLessThan
@Nonnull public Query whereLessThan(@Nonnull FieldPath fieldPath, @Nonnull Object value) { """ Creates and returns a new Query with the additional filter that documents must contain the specified field and the value should be less than the specified value. @param fieldPath The path of the field to compare. ...
java
@Nonnull public Query whereLessThan(@Nonnull FieldPath fieldPath, @Nonnull Object value) { Preconditions.checkState( options.startCursor == null && options.endCursor == null, "Cannot call whereLessThan() after defining a boundary with startAt(), " + "startAfter(), endBefore() or endAt(...
[ "@", "Nonnull", "public", "Query", "whereLessThan", "(", "@", "Nonnull", "FieldPath", "fieldPath", ",", "@", "Nonnull", "Object", "value", ")", "{", "Preconditions", ".", "checkState", "(", "options", ".", "startCursor", "==", "null", "&&", "options", ".", "...
Creates and returns a new Query with the additional filter that documents must contain the specified field and the value should be less than the specified value. @param fieldPath The path of the field to compare. @param value The value for comparison. @return The created Query.
[ "Creates", "and", "returns", "a", "new", "Query", "with", "the", "additional", "filter", "that", "documents", "must", "contain", "the", "specified", "field", "and", "the", "value", "should", "be", "less", "than", "the", "specified", "value", "." ]
train
https://github.com/googleapis/google-cloud-java/blob/d2f0bc64a53049040fe9c9d338b12fab3dd1ad6a/google-cloud-clients/google-cloud-firestore/src/main/java/com/google/cloud/firestore/Query.java#L470-L479
rundeck/rundeck
core/src/main/java/com/dtolabs/rundeck/core/common/UpdateUtils.java
UpdateUtils.updateFileFromInputStream
public static void updateFileFromInputStream(final InputStream input, final String destinationFilePath) throws UpdateException { """ Get the source URL and store it to a destination file path @param input input stream @param destinationFilePath destination @throws UpdateException on error """ ...
java
public static void updateFileFromInputStream(final InputStream input, final String destinationFilePath) throws UpdateException { update(new FileStreamUpdater(input), new File(destinationFilePath)); }
[ "public", "static", "void", "updateFileFromInputStream", "(", "final", "InputStream", "input", ",", "final", "String", "destinationFilePath", ")", "throws", "UpdateException", "{", "update", "(", "new", "FileStreamUpdater", "(", "input", ")", ",", "new", "File", "...
Get the source URL and store it to a destination file path @param input input stream @param destinationFilePath destination @throws UpdateException on error
[ "Get", "the", "source", "URL", "and", "store", "it", "to", "a", "destination", "file", "path" ]
train
https://github.com/rundeck/rundeck/blob/8070f774f55bffaa1118ff0c03aea319d40a9668/core/src/main/java/com/dtolabs/rundeck/core/common/UpdateUtils.java#L96-L99
netscaler/sdx_nitro
src/main/java/com/citrix/sdx/nitro/resource/config/mps/mpssession.java
mpssession.get_nitro_bulk_response
protected base_resource[] get_nitro_bulk_response(nitro_service service, String response) throws Exception { """ <pre> Converts API response of bulk operation into object and returns the object array in case of get request. </pre> """ mpssession_responses result = (mpssession_responses) service.get_payloa...
java
protected base_resource[] get_nitro_bulk_response(nitro_service service, String response) throws Exception { mpssession_responses result = (mpssession_responses) service.get_payload_formatter().string_to_resource(mpssession_responses.class, response); if(result.errorcode != 0) { if (result.errorcode == S...
[ "protected", "base_resource", "[", "]", "get_nitro_bulk_response", "(", "nitro_service", "service", ",", "String", "response", ")", "throws", "Exception", "{", "mpssession_responses", "result", "=", "(", "mpssession_responses", ")", "service", ".", "get_payload_formatte...
<pre> Converts API response of bulk operation into object and returns the object array in case of get request. </pre>
[ "<pre", ">", "Converts", "API", "response", "of", "bulk", "operation", "into", "object", "and", "returns", "the", "object", "array", "in", "case", "of", "get", "request", ".", "<", "/", "pre", ">" ]
train
https://github.com/netscaler/sdx_nitro/blob/c840919f1a8f7c0a5634c0f23d34fa14d1765ff1/src/main/java/com/citrix/sdx/nitro/resource/config/mps/mpssession.java#L358-L375
elki-project/elki
elki-core-math/src/main/java/de/lmu/ifi/dbs/elki/math/statistics/distribution/GeneralizedLogisticDistribution.java
GeneralizedLogisticDistribution.logpdf
public static double logpdf(double val, double loc, double scale, double shape) { """ log Probability density function. @param val Value @param loc Location @param scale Scale @param shape Shape @return log PDF """ val = (val - loc) / scale; double e = FastMath.exp(-val); return -(val + (sha...
java
public static double logpdf(double val, double loc, double scale, double shape) { val = (val - loc) / scale; double e = FastMath.exp(-val); return -(val + (shape + 1.0) * FastMath.log1p(e)) + FastMath.log(shape); }
[ "public", "static", "double", "logpdf", "(", "double", "val", ",", "double", "loc", ",", "double", "scale", ",", "double", "shape", ")", "{", "val", "=", "(", "val", "-", "loc", ")", "/", "scale", ";", "double", "e", "=", "FastMath", ".", "exp", "(...
log Probability density function. @param val Value @param loc Location @param scale Scale @param shape Shape @return log PDF
[ "log", "Probability", "density", "function", "." ]
train
https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-core-math/src/main/java/de/lmu/ifi/dbs/elki/math/statistics/distribution/GeneralizedLogisticDistribution.java#L134-L138
exoplatform/jcr
exo.jcr.component.webdav/src/main/java/org/exoplatform/services/jcr/webdav/command/PutCommand.java
PutCommand.updateVersion
private void updateVersion(Node fileNode, InputStream inputStream, String autoVersion, List<String> mixins) throws RepositoryException { """ Updates the content of the versionable file according to auto-version value. @param fileNode Node to update @param inputStream input stream that contains the conte...
java
private void updateVersion(Node fileNode, InputStream inputStream, String autoVersion, List<String> mixins) throws RepositoryException { if (!fileNode.isCheckedOut()) { fileNode.checkout(); fileNode.getSession().save(); } if (CHECKOUT.equals(autoVersion)) ...
[ "private", "void", "updateVersion", "(", "Node", "fileNode", ",", "InputStream", "inputStream", ",", "String", "autoVersion", ",", "List", "<", "String", ">", "mixins", ")", "throws", "RepositoryException", "{", "if", "(", "!", "fileNode", ".", "isCheckedOut", ...
Updates the content of the versionable file according to auto-version value. @param fileNode Node to update @param inputStream input stream that contains the content of file @param autoVersion auto-version value @param mixins list of mixins @throws RepositoryException {@link RepositoryException}
[ "Updates", "the", "content", "of", "the", "versionable", "file", "according", "to", "auto", "-", "version", "value", "." ]
train
https://github.com/exoplatform/jcr/blob/3e7f9ee1b5683640d73a4316fb4b0ad5eac5b8a2/exo.jcr.component.webdav/src/main/java/org/exoplatform/services/jcr/webdav/command/PutCommand.java#L420-L439
jronrun/benayn
benayn-ustyle/src/main/java/com/benayn/ustyle/logger/Loggers.java
Loggers.journalize
private Loggers journalize(Object message, Character level) { """ 'T': trace, 'D': debug, 'I': info, 'W': warn, 'E': error, 'F': fatal """ this.parasitifer.journalize(level, message); return this; }
java
private Loggers journalize(Object message, Character level) { this.parasitifer.journalize(level, message); return this; }
[ "private", "Loggers", "journalize", "(", "Object", "message", ",", "Character", "level", ")", "{", "this", ".", "parasitifer", ".", "journalize", "(", "level", ",", "message", ")", ";", "return", "this", ";", "}" ]
'T': trace, 'D': debug, 'I': info, 'W': warn, 'E': error, 'F': fatal
[ "T", ":", "trace", "D", ":", "debug", "I", ":", "info", "W", ":", "warn", "E", ":", "error", "F", ":", "fatal" ]
train
https://github.com/jronrun/benayn/blob/7585152e10e4cac07b4274c65f1c72ad7061ae69/benayn-ustyle/src/main/java/com/benayn/ustyle/logger/Loggers.java#L250-L253
belaban/JGroups
src/org/jgroups/util/Bits.java
Bits.readLong
public static long readLong(ByteBuffer buf) { """ Reads a long from a buffer. @param buf the buffer @return the long read from the buffer """ byte len=buf.get(); if(len == 0) return 0; return makeLong(buf, len); }
java
public static long readLong(ByteBuffer buf) { byte len=buf.get(); if(len == 0) return 0; return makeLong(buf, len); }
[ "public", "static", "long", "readLong", "(", "ByteBuffer", "buf", ")", "{", "byte", "len", "=", "buf", ".", "get", "(", ")", ";", "if", "(", "len", "==", "0", ")", "return", "0", ";", "return", "makeLong", "(", "buf", ",", "len", ")", ";", "}" ]
Reads a long from a buffer. @param buf the buffer @return the long read from the buffer
[ "Reads", "a", "long", "from", "a", "buffer", "." ]
train
https://github.com/belaban/JGroups/blob/bd3ca786aa57fed41dfbc10a94b1281e388be03b/src/org/jgroups/util/Bits.java#L248-L253
eFaps/eFaps-Kernel
src/main/java/org/efaps/init/StartupDatabaseConnection.java
StartupDatabaseConnection.configureDataSource
protected static void configureDataSource(final Context _compCtx, final String _classDSFactory, final Map<String, String> _propConnection) throws StartupException { """ The class defined with parameter <code>_classD...
java
protected static void configureDataSource(final Context _compCtx, final String _classDSFactory, final Map<String, String> _propConnection) throws StartupException { final Reference ref = new Reference(DataSou...
[ "protected", "static", "void", "configureDataSource", "(", "final", "Context", "_compCtx", ",", "final", "String", "_classDSFactory", ",", "final", "Map", "<", "String", ",", "String", ">", "_propConnection", ")", "throws", "StartupException", "{", "final", "Refer...
The class defined with parameter <code>_classDSFactory</code> initialized and bind to {@link #RESOURCE_DATASOURCE}. The initialized class must implement interface {@link DataSource}. As JDBC connection properties the map <code>_propConneciton</code> is used. @param _compCtx Java root naming context @param _classDSFact...
[ "The", "class", "defined", "with", "parameter", "<code", ">", "_classDSFactory<", "/", "code", ">", "initialized", "and", "bind", "to", "{", "@link", "#RESOURCE_DATASOURCE", "}", ".", "The", "initialized", "class", "must", "implement", "interface", "{", "@link",...
train
https://github.com/eFaps/eFaps-Kernel/blob/04b96548f518c2386a93f5ec2b9349f9b9063859/src/main/java/org/efaps/init/StartupDatabaseConnection.java#L374-L393
Azure/azure-sdk-for-java
mediaservices/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_06_01_preview/implementation/LocationsInner.java
LocationsInner.checkNameAvailability
public EntityNameAvailabilityCheckOutputInner checkNameAvailability(String locationName, CheckNameAvailabilityInput parameters) { """ Check Name Availability. Checks whether the Media Service resource name is available. @param locationName the String value @param parameters The request parameters @throws Ill...
java
public EntityNameAvailabilityCheckOutputInner checkNameAvailability(String locationName, CheckNameAvailabilityInput parameters) { return checkNameAvailabilityWithServiceResponseAsync(locationName, parameters).toBlocking().single().body(); }
[ "public", "EntityNameAvailabilityCheckOutputInner", "checkNameAvailability", "(", "String", "locationName", ",", "CheckNameAvailabilityInput", "parameters", ")", "{", "return", "checkNameAvailabilityWithServiceResponseAsync", "(", "locationName", ",", "parameters", ")", ".", "t...
Check Name Availability. Checks whether the Media Service resource name is available. @param locationName the String value @param parameters The request parameters @throws IllegalArgumentException thrown if parameters fail the validation @throws ApiErrorException thrown if the request is rejected by server @throws Run...
[ "Check", "Name", "Availability", ".", "Checks", "whether", "the", "Media", "Service", "resource", "name", "is", "available", "." ]
train
https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/mediaservices/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_06_01_preview/implementation/LocationsInner.java#L74-L76
querydsl/querydsl
querydsl-core/src/main/java/com/querydsl/core/types/dsl/Expressions.java
Expressions.comparableTemplate
public static <T extends Comparable<?>> ComparableTemplate<T> comparableTemplate(Class<? extends T> cl, String template, Object... args) { """ Create a new Template expression @param cl type of expression @param template template @param args template parameters @return template expression """...
java
public static <T extends Comparable<?>> ComparableTemplate<T> comparableTemplate(Class<? extends T> cl, String template, Object... args) { return comparableTemplate(cl, createTemplate(template), ImmutableList.copyOf(args)); }
[ "public", "static", "<", "T", "extends", "Comparable", "<", "?", ">", ">", "ComparableTemplate", "<", "T", ">", "comparableTemplate", "(", "Class", "<", "?", "extends", "T", ">", "cl", ",", "String", "template", ",", "Object", "...", "args", ")", "{", ...
Create a new Template expression @param cl type of expression @param template template @param args template parameters @return template expression
[ "Create", "a", "new", "Template", "expression" ]
train
https://github.com/querydsl/querydsl/blob/2bf234caf78549813a1e0f44d9c30ecc5ef734e3/querydsl-core/src/main/java/com/querydsl/core/types/dsl/Expressions.java#L398-L401
op4j/op4j
src/main/java/org/op4j/functions/FnNumber.java
FnNumber.toPercentStr
public static final Function<Number,String> toPercentStr(Locale locale) { """ <p> A {@link String} representing a percentage is created from the target number in the given {@link Locale} </p> @param locale the {@link Locale} to be used @return the string representation of the input number as a percentage ...
java
public static final Function<Number,String> toPercentStr(Locale locale) { return new ToString(NumberFormatType.PERCENT, locale); }
[ "public", "static", "final", "Function", "<", "Number", ",", "String", ">", "toPercentStr", "(", "Locale", "locale", ")", "{", "return", "new", "ToString", "(", "NumberFormatType", ".", "PERCENT", ",", "locale", ")", ";", "}" ]
<p> A {@link String} representing a percentage is created from the target number in the given {@link Locale} </p> @param locale the {@link Locale} to be used @return the string representation of the input number as a percentage
[ "<p", ">", "A", "{", "@link", "String", "}", "representing", "a", "percentage", "is", "created", "from", "the", "target", "number", "in", "the", "given", "{", "@link", "Locale", "}", "<", "/", "p", ">" ]
train
https://github.com/op4j/op4j/blob/b577596dfe462089d3dd169666defc6de7ad289a/src/main/java/org/op4j/functions/FnNumber.java#L886-L888
lessthanoptimal/BoofCV
main/boofcv-geo/src/main/java/boofcv/alg/geo/PerspectiveOps.java
PerspectiveOps.invertPinhole
public static void invertPinhole( DMatrix3x3 K , DMatrix3x3 Kinv) { """ Analytic matrix inversion to 3x3 camera calibration matrix. Input and output can be the same matrix. Zeros are not set. @param K (Input) Calibration matrix @param Kinv (Output) inverse. """ double fx = K.a11; double skew = K.a12; ...
java
public static void invertPinhole( DMatrix3x3 K , DMatrix3x3 Kinv) { double fx = K.a11; double skew = K.a12; double cx = K.a13; double fy = K.a22; double cy = K.a23; Kinv.a11 = 1.0/fx; Kinv.a12 = -skew/(fx*fy); Kinv.a13 = (skew*cy - cx*fy)/(fx*fy); Kinv.a22 = 1.0/fy; Kinv.a23 = -cy/fy; Kinv.a33 = 1...
[ "public", "static", "void", "invertPinhole", "(", "DMatrix3x3", "K", ",", "DMatrix3x3", "Kinv", ")", "{", "double", "fx", "=", "K", ".", "a11", ";", "double", "skew", "=", "K", ".", "a12", ";", "double", "cx", "=", "K", ".", "a13", ";", "double", "...
Analytic matrix inversion to 3x3 camera calibration matrix. Input and output can be the same matrix. Zeros are not set. @param K (Input) Calibration matrix @param Kinv (Output) inverse.
[ "Analytic", "matrix", "inversion", "to", "3x3", "camera", "calibration", "matrix", ".", "Input", "and", "output", "can", "be", "the", "same", "matrix", ".", "Zeros", "are", "not", "set", "." ]
train
https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-geo/src/main/java/boofcv/alg/geo/PerspectiveOps.java#L223-L235
imsweb/naaccr-xml
src/main/java/com/imsweb/naaccrxml/NaaccrXmlDictionaryUtils.java
NaaccrXmlDictionaryUtils.getDefaultUserDictionaryByVersion
@SuppressWarnings("ConstantConditions") public static NaaccrDictionary getDefaultUserDictionaryByVersion(String naaccrVersion) { """ Returns the default user dictionary for the requested NAACCR version. @param naaccrVersion NAACCR version, required (see constants in NaaccrFormat) @return the corresponding de...
java
@SuppressWarnings("ConstantConditions") public static NaaccrDictionary getDefaultUserDictionaryByVersion(String naaccrVersion) { if (naaccrVersion == null) throw new RuntimeException("Version is required for getting the default user dictionary."); if (!NaaccrFormat.isVersionSupported(naa...
[ "@", "SuppressWarnings", "(", "\"ConstantConditions\"", ")", "public", "static", "NaaccrDictionary", "getDefaultUserDictionaryByVersion", "(", "String", "naaccrVersion", ")", "{", "if", "(", "naaccrVersion", "==", "null", ")", "throw", "new", "RuntimeException", "(", ...
Returns the default user dictionary for the requested NAACCR version. @param naaccrVersion NAACCR version, required (see constants in NaaccrFormat) @return the corresponding default user dictionary, throws a runtime exception if not found
[ "Returns", "the", "default", "user", "dictionary", "for", "the", "requested", "NAACCR", "version", "." ]
train
https://github.com/imsweb/naaccr-xml/blob/a3a501faa2a0c3411dd5248b2c1379f279131696/src/main/java/com/imsweb/naaccrxml/NaaccrXmlDictionaryUtils.java#L215-L233
symphonyoss/messageml-utils
src/main/java/org/symphonyoss/symphony/messageml/util/XmlPrintStream.java
XmlPrintStream.openElement
public void openElement(String name, Map<String, String> attributes) { """ Open an XML element with the given name, and attributes. A call to closeElement() will output the appropriate XML closing tag. This class remembers the tag names. @param name Name of the XML element to open. @param attributes A map of na...
java
public void openElement(String name, Map<String, String> attributes) { elementStack.push(name); print("<" + name); for (Entry<String, String> entry : attributes.entrySet()) { print(" " + entry.getKey() + "=\"" + escape(entry.getValue()) + "\""); } if (this.isNoNl()) { print(">"); } ...
[ "public", "void", "openElement", "(", "String", "name", ",", "Map", "<", "String", ",", "String", ">", "attributes", ")", "{", "elementStack", ".", "push", "(", "name", ")", ";", "print", "(", "\"<\"", "+", "name", ")", ";", "for", "(", "Entry", "<",...
Open an XML element with the given name, and attributes. A call to closeElement() will output the appropriate XML closing tag. This class remembers the tag names. @param name Name of the XML element to open. @param attributes A map of name value pairs which will be used to add attributes to the element.
[ "Open", "an", "XML", "element", "with", "the", "given", "name", "and", "attributes", ".", "A", "call", "to", "closeElement", "()", "will", "output", "the", "appropriate", "XML", "closing", "tag", ".", "This", "class", "remembers", "the", "tag", "names", "....
train
https://github.com/symphonyoss/messageml-utils/blob/68daed66267062d144a05b3ee9a9bf4b715e3f95/src/main/java/org/symphonyoss/symphony/messageml/util/XmlPrintStream.java#L61-L74
albfernandez/itext2
src/main/java/com/lowagie/text/Annotation.java
Annotation.setDimensions
public void setDimensions(float llx, float lly, float urx, float ury) { """ Sets the dimensions of this annotation. @param llx the lower left x-value @param lly the lower left y-value @param urx the upper right x-value @param ury the upper right y-value """ this.llx = llx; this.lly = lly; this....
java
public void setDimensions(float llx, float lly, float urx, float ury) { this.llx = llx; this.lly = lly; this.urx = urx; this.ury = ury; }
[ "public", "void", "setDimensions", "(", "float", "llx", ",", "float", "lly", ",", "float", "urx", ",", "float", "ury", ")", "{", "this", ".", "llx", "=", "llx", ";", "this", ".", "lly", "=", "lly", ";", "this", ".", "urx", "=", "urx", ";", "this"...
Sets the dimensions of this annotation. @param llx the lower left x-value @param lly the lower left y-value @param urx the upper right x-value @param ury the upper right y-value
[ "Sets", "the", "dimensions", "of", "this", "annotation", "." ]
train
https://github.com/albfernandez/itext2/blob/438fc1899367fd13dfdfa8dfdca9a3c1a7783b84/src/main/java/com/lowagie/text/Annotation.java#L446-L451
steveohara/j2mod
src/main/java/com/ghgande/j2mod/modbus/util/ModbusUtil.java
ModbusUtil.toHex
public static String toHex(byte[] data, int off, int end) { """ Returns a <tt>String</tt> containing unsigned hexadecimal numbers as digits. The <tt>String</tt> will coontain two hex digit characters for each byte from the passed in <tt>byte[]</tt>.<br> The bytes will be separated by a space character. @par...
java
public static String toHex(byte[] data, int off, int end) { //double size, two bytes (hex range) for one byte StringBuilder buf = new StringBuilder(data.length * 2); if (end > data.length) { end = data.length; } for (int i = off; i < end; i++) { //don't fo...
[ "public", "static", "String", "toHex", "(", "byte", "[", "]", "data", ",", "int", "off", ",", "int", "end", ")", "{", "//double size, two bytes (hex range) for one byte", "StringBuilder", "buf", "=", "new", "StringBuilder", "(", "data", ".", "length", "*", "2"...
Returns a <tt>String</tt> containing unsigned hexadecimal numbers as digits. The <tt>String</tt> will coontain two hex digit characters for each byte from the passed in <tt>byte[]</tt>.<br> The bytes will be separated by a space character. @param data the array of bytes to be converted into a hex-string. @param off ...
[ "Returns", "a", "<tt", ">", "String<", "/", "tt", ">", "containing", "unsigned", "hexadecimal", "numbers", "as", "digits", ".", "The", "<tt", ">", "String<", "/", "tt", ">", "will", "coontain", "two", "hex", "digit", "characters", "for", "each", "byte", ...
train
https://github.com/steveohara/j2mod/blob/67162c55d7c02564e50211a9df06b8314953b5f2/src/main/java/com/ghgande/j2mod/modbus/util/ModbusUtil.java#L143-L160
osglworks/java-mvc
src/main/java/org/osgl/mvc/result/GatewayTimeout.java
GatewayTimeout.of
public static GatewayTimeout of(int errorCode, Throwable cause) { """ Returns a static GatewayTimeout instance and set the {@link #payload} thread local with error code and cause specified. When calling the instance on {@link #getMessage()} method, it will return whatever stored in the {@link #payload} thread...
java
public static GatewayTimeout of(int errorCode, Throwable cause) { if (_localizedErrorMsg()) { return of(errorCode, cause, defaultMessage(GATEWAY_TIMEOUT)); } else { touchPayload().errorCode(errorCode).cause(cause); return _INSTANCE; } }
[ "public", "static", "GatewayTimeout", "of", "(", "int", "errorCode", ",", "Throwable", "cause", ")", "{", "if", "(", "_localizedErrorMsg", "(", ")", ")", "{", "return", "of", "(", "errorCode", ",", "cause", ",", "defaultMessage", "(", "GATEWAY_TIMEOUT", ")",...
Returns a static GatewayTimeout instance and set the {@link #payload} thread local with error code and cause specified. When calling the instance on {@link #getMessage()} method, it will return whatever stored in the {@link #payload} thread local @param cause the cause @param errorCode app defined error code @return...
[ "Returns", "a", "static", "GatewayTimeout", "instance", "and", "set", "the", "{", "@link", "#payload", "}", "thread", "local", "with", "error", "code", "and", "cause", "specified", "." ]
train
https://github.com/osglworks/java-mvc/blob/4d2b2ec40498ac6ee7040c0424377cbeacab124b/src/main/java/org/osgl/mvc/result/GatewayTimeout.java#L196-L203