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
stratosphere/stratosphere
stratosphere-core/src/main/java/eu/stratosphere/core/memory/MemorySegment.java
MemorySegment.putLong
@SuppressWarnings("restriction") public final void putLong(int index, long value) { """ Writes the given long value (64bit, 8 bytes) to the given position in the system's native byte order. This method offers the best speed for long integer writing and should be used unless a specific byte order is required. In...
java
@SuppressWarnings("restriction") public final void putLong(int index, long value) { if (CHECKED) { if (index >= 0 && index <= this.memory.length - 8) { UNSAFE.putLong(this.memory, BASE_OFFSET + index, value); } else { throw new IndexOutOfBoundsException(); } } else { UNSAFE.putLong(this.memory,...
[ "@", "SuppressWarnings", "(", "\"restriction\"", ")", "public", "final", "void", "putLong", "(", "int", "index", ",", "long", "value", ")", "{", "if", "(", "CHECKED", ")", "{", "if", "(", "index", ">=", "0", "&&", "index", "<=", "this", ".", "memory", ...
Writes the given long value (64bit, 8 bytes) to the given position in the system's native byte order. This method offers the best speed for long integer writing and should be used unless a specific byte order is required. In most cases, it suffices to know that the byte order in which the value is written is the same a...
[ "Writes", "the", "given", "long", "value", "(", "64bit", "8", "bytes", ")", "to", "the", "given", "position", "in", "the", "system", "s", "native", "byte", "order", ".", "This", "method", "offers", "the", "best", "speed", "for", "long", "integer", "writi...
train
https://github.com/stratosphere/stratosphere/blob/c543a08f9676c5b2b0a7088123bd6e795a8ae0c8/stratosphere-core/src/main/java/eu/stratosphere/core/memory/MemorySegment.java#L571-L582
gallandarakhneorg/afc
core/maths/mathgeom/src/main/java/org/arakhne/afc/math/geometry/d2/Transform2D.java
Transform2D.createInverse
@Pure public Transform2D createInverse() { """ Returns an <code>Transform2D</code> object representing the inverse transformation. The inverse transform Tx' of this transform Tx maps coordinates transformed by Tx back to their original coordinates. In other words, Tx'(Tx(p)) = p = Tx(Tx'(p)). <p>If this t...
java
@Pure public Transform2D createInverse() { final double det = this.m00 * this.m11 - this.m01 * this.m10; if (MathUtil.isEpsilonZero(det)) { throw new SingularMatrixException(Locale.getString("E1", det)); //$NON-NLS-1$ } return new Transform2D( this.m11 / det, -this.m01 / det, (this.m01 * this.m1...
[ "@", "Pure", "public", "Transform2D", "createInverse", "(", ")", "{", "final", "double", "det", "=", "this", ".", "m00", "*", "this", ".", "m11", "-", "this", ".", "m01", "*", "this", ".", "m10", ";", "if", "(", "MathUtil", ".", "isEpsilonZero", "(",...
Returns an <code>Transform2D</code> object representing the inverse transformation. The inverse transform Tx' of this transform Tx maps coordinates transformed by Tx back to their original coordinates. In other words, Tx'(Tx(p)) = p = Tx(Tx'(p)). <p>If this transform maps all coordinates onto a point or a line then it...
[ "Returns", "an", "<code", ">", "Transform2D<", "/", "code", ">", "object", "representing", "the", "inverse", "transformation", ".", "The", "inverse", "transform", "Tx", "of", "this", "transform", "Tx", "maps", "coordinates", "transformed", "by", "Tx", "back", ...
train
https://github.com/gallandarakhneorg/afc/blob/0c7d2e1ddefd4167ef788416d970a6c1ef6f8bbb/core/maths/mathgeom/src/main/java/org/arakhne/afc/math/geometry/d2/Transform2D.java#L711-L724
xebia-france/xebia-servlet-extras
src/main/java/fr/xebia/servlet/filter/SecuredRemoteAddressFilter.java
SecuredRemoteAddressFilter.matchesOne
protected static boolean matchesOne(String str, Pattern... patterns) { """ Return <code>true</code> if the given <code>str</code> matches at least one of the given <code>patterns</code>. """ for (Pattern pattern : patterns) { if (pattern.matcher(str).matches()) { return ...
java
protected static boolean matchesOne(String str, Pattern... patterns) { for (Pattern pattern : patterns) { if (pattern.matcher(str).matches()) { return true; } } return false; }
[ "protected", "static", "boolean", "matchesOne", "(", "String", "str", ",", "Pattern", "...", "patterns", ")", "{", "for", "(", "Pattern", "pattern", ":", "patterns", ")", "{", "if", "(", "pattern", ".", "matcher", "(", "str", ")", ".", "matches", "(", ...
Return <code>true</code> if the given <code>str</code> matches at least one of the given <code>patterns</code>.
[ "Return", "<code", ">", "true<", "/", "code", ">", "if", "the", "given", "<code", ">", "str<", "/", "code", ">", "matches", "at", "least", "one", "of", "the", "given", "<code", ">", "patterns<", "/", "code", ">", "." ]
train
https://github.com/xebia-france/xebia-servlet-extras/blob/b263636fc78f8794dde57d92b835edb5e95ce379/src/main/java/fr/xebia/servlet/filter/SecuredRemoteAddressFilter.java#L149-L156
knowm/XChart
xchart/src/main/java/org/knowm/xchart/XYChart.java
XYChart.addSeries
public XYSeries addSeries(String seriesName, int[] xData, int[] yData, int[] errorBars) { """ Add a series for a X-Y type chart using using int arrays with error bars @param seriesName @param xData the X-Axis data @param xData the Y-Axis data @param errorBars the error bar data @return A Series object that ...
java
public XYSeries addSeries(String seriesName, int[] xData, int[] yData, int[] errorBars) { return addSeries( seriesName, Utils.getDoubleArrayFromIntArray(xData), Utils.getDoubleArrayFromIntArray(yData), Utils.getDoubleArrayFromIntArray(errorBars), DataType.Number); }
[ "public", "XYSeries", "addSeries", "(", "String", "seriesName", ",", "int", "[", "]", "xData", ",", "int", "[", "]", "yData", ",", "int", "[", "]", "errorBars", ")", "{", "return", "addSeries", "(", "seriesName", ",", "Utils", ".", "getDoubleArrayFromIntAr...
Add a series for a X-Y type chart using using int arrays with error bars @param seriesName @param xData the X-Axis data @param xData the Y-Axis data @param errorBars the error bar data @return A Series object that you can set properties on
[ "Add", "a", "series", "for", "a", "X", "-", "Y", "type", "chart", "using", "using", "int", "arrays", "with", "error", "bars" ]
train
https://github.com/knowm/XChart/blob/677a105753a855edf24782fab1bf1f5aec3e642b/xchart/src/main/java/org/knowm/xchart/XYChart.java#L179-L187
schallee/alib4j
core/src/main/java/net/darkmist/alib/res/PkgRes.java
PkgRes.getStringFor
public static String getStringFor(String name, Class<?> cls) { """ Get a resource as a String. @param name The name of the resource @param cls the class to use for the package name @return The contents of the resource converted to a string with the default encoding. @throws NullPointerException if name or cls...
java
public static String getStringFor(String name, Class<?> cls) { InputStream in = null; try { if((in = getFor(name, cls))==null) throw new ResourceException("Unablet to find package resource for " + name + " and " + cls); return IOUtils.toString(in); } catch(IOException e) { throw new ResourceE...
[ "public", "static", "String", "getStringFor", "(", "String", "name", ",", "Class", "<", "?", ">", "cls", ")", "{", "InputStream", "in", "=", "null", ";", "try", "{", "if", "(", "(", "in", "=", "getFor", "(", "name", ",", "cls", ")", ")", "==", "n...
Get a resource as a String. @param name The name of the resource @param cls the class to use for the package name @return The contents of the resource converted to a string with the default encoding. @throws NullPointerException if name or cls are null. ResourceException if the resource cannot be found.
[ "Get", "a", "resource", "as", "a", "String", "." ]
train
https://github.com/schallee/alib4j/blob/0e0718aee574bbb62268e1cf58e99286529ce529/core/src/main/java/net/darkmist/alib/res/PkgRes.java#L284-L302
looly/hutool
hutool-core/src/main/java/cn/hutool/core/img/ImgUtil.java
ImgUtil.pressText
public static void pressText(Image srcImage, ImageOutputStream destImageStream, String pressText, Color color, Font font, int x, int y, float alpha) throws IORuntimeException { """ 给图片添加文字水印<br> 此方法并不关闭流 @param srcImage 源图像 @param destImageStream 目标图像流 @param pressText 水印文字 @param color 水印的字体颜色 @param font...
java
public static void pressText(Image srcImage, ImageOutputStream destImageStream, String pressText, Color color, Font font, int x, int y, float alpha) throws IORuntimeException { writeJpg(pressText(srcImage, pressText, color, font, x, y, alpha), destImageStream); }
[ "public", "static", "void", "pressText", "(", "Image", "srcImage", ",", "ImageOutputStream", "destImageStream", ",", "String", "pressText", ",", "Color", "color", ",", "Font", "font", ",", "int", "x", ",", "int", "y", ",", "float", "alpha", ")", "throws", ...
给图片添加文字水印<br> 此方法并不关闭流 @param srcImage 源图像 @param destImageStream 目标图像流 @param pressText 水印文字 @param color 水印的字体颜色 @param font {@link Font} 字体相关信息,如果默认则为{@code null} @param x 修正值。 默认在中间,偏移量相对于中间偏移 @param y 修正值。 默认在中间,偏移量相对于中间偏移 @param alpha 透明度:alpha 必须是范围 [0.0, 1.0] 之内(包含边界值)的一个浮点数字 @throws IORuntimeException IO异常
[ "给图片添加文字水印<br", ">", "此方法并不关闭流" ]
train
https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-core/src/main/java/cn/hutool/core/img/ImgUtil.java#L844-L846
datastax/java-driver
query-builder/src/main/java/com/datastax/oss/driver/api/querybuilder/SchemaBuilder.java
SchemaBuilder.dropIndex
@NonNull public static Drop dropIndex(@Nullable CqlIdentifier keyspace, @NonNull CqlIdentifier indexName) { """ Starts a DROP INDEX query for the given index for the given keyspace name. """ return new DefaultDrop(keyspace, indexName, "INDEX"); }
java
@NonNull public static Drop dropIndex(@Nullable CqlIdentifier keyspace, @NonNull CqlIdentifier indexName) { return new DefaultDrop(keyspace, indexName, "INDEX"); }
[ "@", "NonNull", "public", "static", "Drop", "dropIndex", "(", "@", "Nullable", "CqlIdentifier", "keyspace", ",", "@", "NonNull", "CqlIdentifier", "indexName", ")", "{", "return", "new", "DefaultDrop", "(", "keyspace", ",", "indexName", ",", "\"INDEX\"", ")", "...
Starts a DROP INDEX query for the given index for the given keyspace name.
[ "Starts", "a", "DROP", "INDEX", "query", "for", "the", "given", "index", "for", "the", "given", "keyspace", "name", "." ]
train
https://github.com/datastax/java-driver/blob/612a63f2525618e2020e86c9ad75ab37adba6132/query-builder/src/main/java/com/datastax/oss/driver/api/querybuilder/SchemaBuilder.java#L454-L457
apache/groovy
src/main/java/org/codehaus/groovy/runtime/DefaultGroovyMethods.java
DefaultGroovyMethods.getAt
public static <K,V> V getAt(Map<K,V> self, K key) { """ Support the subscript operator for a Map. <pre class="groovyTestCase">def map = [a:10] assert map["a"] == 10</pre> @param self a Map @param key an Object as a key for the map @return the value corresponding to the given key @since 1.0 """ ...
java
public static <K,V> V getAt(Map<K,V> self, K key) { return self.get(key); }
[ "public", "static", "<", "K", ",", "V", ">", "V", "getAt", "(", "Map", "<", "K", ",", "V", ">", "self", ",", "K", "key", ")", "{", "return", "self", ".", "get", "(", "key", ")", ";", "}" ]
Support the subscript operator for a Map. <pre class="groovyTestCase">def map = [a:10] assert map["a"] == 10</pre> @param self a Map @param key an Object as a key for the map @return the value corresponding to the given key @since 1.0
[ "Support", "the", "subscript", "operator", "for", "a", "Map", ".", "<pre", "class", "=", "groovyTestCase", ">", "def", "map", "=", "[", "a", ":", "10", "]", "assert", "map", "[", "a", "]", "==", "10<", "/", "pre", ">" ]
train
https://github.com/apache/groovy/blob/71cf20addb611bb8d097a59e395fd20bc7f31772/src/main/java/org/codehaus/groovy/runtime/DefaultGroovyMethods.java#L8167-L8169
nemerosa/ontrack
ontrack-extension-jira/src/main/java/net/nemerosa/ontrack/extension/jira/JIRAServiceExtension.java
JIRAServiceExtension.followLinks
public void followLinks(JIRAConfiguration configuration, JIRAIssue seed, Set<String> linkNames, Map<String, JIRAIssue> collectedIssues) { """ Given an issue seed, and a list of link names, follows the given links recursively and puts the associated issues into the {@code collectedIssues} map. @param configurat...
java
public void followLinks(JIRAConfiguration configuration, JIRAIssue seed, Set<String> linkNames, Map<String, JIRAIssue> collectedIssues) { try (Transaction tx = transactionService.start()) { JIRASession session = getJIRASession(tx, configuration); // Gets the client from the current sessi...
[ "public", "void", "followLinks", "(", "JIRAConfiguration", "configuration", ",", "JIRAIssue", "seed", ",", "Set", "<", "String", ">", "linkNames", ",", "Map", "<", "String", ",", "JIRAIssue", ">", "collectedIssues", ")", "{", "try", "(", "Transaction", "tx", ...
Given an issue seed, and a list of link names, follows the given links recursively and puts the associated issues into the {@code collectedIssues} map. @param configuration JIRA configuration to use to load the issues @param seed Issue to start from. @param linkNames Links to follow @param collected...
[ "Given", "an", "issue", "seed", "and", "a", "list", "of", "link", "names", "follows", "the", "given", "links", "recursively", "and", "puts", "the", "associated", "issues", "into", "the", "{", "@code", "collectedIssues", "}", "map", "." ]
train
https://github.com/nemerosa/ontrack/blob/37b0874cbf387b58aba95cd3c1bc3b15e11bc913/ontrack-extension-jira/src/main/java/net/nemerosa/ontrack/extension/jira/JIRAServiceExtension.java#L174-L188
Erudika/para
para-client/src/main/java/com/erudika/para/client/ParaClient.java
ParaClient.resourcePermissions
public Map<String, Map<String, List<String>>> resourcePermissions(String subjectid) { """ Returns only the permissions for a given subject (user) of the current app. @param subjectid the subject id (user id) @return a map of subject ids to resource names to a list of allowed methods """ return getEntity(in...
java
public Map<String, Map<String, List<String>>> resourcePermissions(String subjectid) { return getEntity(invokeGet(Utils.formatMessage("_permissions/{0}", subjectid), null), Map.class); }
[ "public", "Map", "<", "String", ",", "Map", "<", "String", ",", "List", "<", "String", ">", ">", ">", "resourcePermissions", "(", "String", "subjectid", ")", "{", "return", "getEntity", "(", "invokeGet", "(", "Utils", ".", "formatMessage", "(", "\"_permiss...
Returns only the permissions for a given subject (user) of the current app. @param subjectid the subject id (user id) @return a map of subject ids to resource names to a list of allowed methods
[ "Returns", "only", "the", "permissions", "for", "a", "given", "subject", "(", "user", ")", "of", "the", "current", "app", "." ]
train
https://github.com/Erudika/para/blob/5ba096c477042ea7b18e9a0e8b5b1ee0f5bd6ce9/para-client/src/main/java/com/erudika/para/client/ParaClient.java#L1420-L1422
Azure/azure-sdk-for-java
network/resource-manager/v2017_10_01/src/main/java/com/microsoft/azure/management/network/v2017_10_01/implementation/NetworkWatchersInner.java
NetworkWatchersInner.getAzureReachabilityReportAsync
public Observable<AzureReachabilityReportInner> getAzureReachabilityReportAsync(String resourceGroupName, String networkWatcherName, AzureReachabilityReportParameters parameters) { """ Gets the relative latency score for internet service providers from a specified location to Azure regions. @param resourceGroup...
java
public Observable<AzureReachabilityReportInner> getAzureReachabilityReportAsync(String resourceGroupName, String networkWatcherName, AzureReachabilityReportParameters parameters) { return getAzureReachabilityReportWithServiceResponseAsync(resourceGroupName, networkWatcherName, parameters).map(new Func1<ServiceR...
[ "public", "Observable", "<", "AzureReachabilityReportInner", ">", "getAzureReachabilityReportAsync", "(", "String", "resourceGroupName", ",", "String", "networkWatcherName", ",", "AzureReachabilityReportParameters", "parameters", ")", "{", "return", "getAzureReachabilityReportWit...
Gets the relative latency score for internet service providers from a specified location to Azure regions. @param resourceGroupName The name of the network watcher resource group. @param networkWatcherName The name of the network watcher resource. @param parameters Parameters that determine Azure reachability report c...
[ "Gets", "the", "relative", "latency", "score", "for", "internet", "service", "providers", "from", "a", "specified", "location", "to", "Azure", "regions", "." ]
train
https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/network/resource-manager/v2017_10_01/src/main/java/com/microsoft/azure/management/network/v2017_10_01/implementation/NetworkWatchersInner.java#L2335-L2342
google/j2objc
jre_emul/android/platform/external/mockwebserver/src/main/java/com/google/mockwebserver/MockResponse.java
MockResponse.setChunkedBody
public MockResponse setChunkedBody(String body, int maxChunkSize) { """ Sets the response body to the UTF-8 encoded bytes of {@code body}, chunked every {@code maxChunkSize} bytes. """ try { return setChunkedBody(body.getBytes("UTF-8"), maxChunkSize); } catch (UnsupportedEncodingEx...
java
public MockResponse setChunkedBody(String body, int maxChunkSize) { try { return setChunkedBody(body.getBytes("UTF-8"), maxChunkSize); } catch (UnsupportedEncodingException e) { throw new AssertionError(); } }
[ "public", "MockResponse", "setChunkedBody", "(", "String", "body", ",", "int", "maxChunkSize", ")", "{", "try", "{", "return", "setChunkedBody", "(", "body", ".", "getBytes", "(", "\"UTF-8\"", ")", ",", "maxChunkSize", ")", ";", "}", "catch", "(", "Unsupport...
Sets the response body to the UTF-8 encoded bytes of {@code body}, chunked every {@code maxChunkSize} bytes.
[ "Sets", "the", "response", "body", "to", "the", "UTF", "-", "8", "encoded", "bytes", "of", "{" ]
train
https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/external/mockwebserver/src/main/java/com/google/mockwebserver/MockResponse.java#L214-L220
spotbugs/spotbugs
spotbugs/src/main/java/edu/umd/cs/findbugs/BugInstance.java
BugInstance.addField
@Nonnull public BugInstance addField(String className, String fieldName, String fieldSig, boolean isStatic) { """ Add a field annotation. @param className name of the class containing the field @param fieldName the name of the field @param fieldSig type signature of the field @param isStatic whether ...
java
@Nonnull public BugInstance addField(String className, String fieldName, String fieldSig, boolean isStatic) { addField(new FieldAnnotation(className, fieldName, fieldSig, isStatic)); return this; }
[ "@", "Nonnull", "public", "BugInstance", "addField", "(", "String", "className", ",", "String", "fieldName", ",", "String", "fieldSig", ",", "boolean", "isStatic", ")", "{", "addField", "(", "new", "FieldAnnotation", "(", "className", ",", "fieldName", ",", "f...
Add a field annotation. @param className name of the class containing the field @param fieldName the name of the field @param fieldSig type signature of the field @param isStatic whether or not the field is static @return this object
[ "Add", "a", "field", "annotation", "." ]
train
https://github.com/spotbugs/spotbugs/blob/f6365c6eea6515035bded38efa4a7c8b46ccf28c/spotbugs/src/main/java/edu/umd/cs/findbugs/BugInstance.java#L1134-L1138
progolden/vraptor-boilerplate
vraptor-boilerplate-utils/src/main/java/br/com/caelum/vraptor/boilerplate/util/GeneralUtils.java
GeneralUtils.parseLocaleString
public static Locale parseLocaleString(String locale) { """ Transforma um string que representa um Locale. A lingua padr�o � pt universal. @param locale String que representa o locale, Ex: pt_BR @return """ String lang = GeneralUtils.isEmpty(locale) ? "pt" : locale.substring(0, 2); String country = G...
java
public static Locale parseLocaleString(String locale) { String lang = GeneralUtils.isEmpty(locale) ? "pt" : locale.substring(0, 2); String country = GeneralUtils.isEmpty(locale) ? "" : locale.substring(3, 5); return new Locale(lang, country); }
[ "public", "static", "Locale", "parseLocaleString", "(", "String", "locale", ")", "{", "String", "lang", "=", "GeneralUtils", ".", "isEmpty", "(", "locale", ")", "?", "\"pt\"", ":", "locale", ".", "substring", "(", "0", ",", "2", ")", ";", "String", "coun...
Transforma um string que representa um Locale. A lingua padr�o � pt universal. @param locale String que representa o locale, Ex: pt_BR @return
[ "Transforma", "um", "string", "que", "representa", "um", "Locale", ".", "A", "lingua", "padr�o", "�", "pt", "universal", "." ]
train
https://github.com/progolden/vraptor-boilerplate/blob/3edf45cc0dc5aec61b16ca326b4d72c82d1d3e07/vraptor-boilerplate-utils/src/main/java/br/com/caelum/vraptor/boilerplate/util/GeneralUtils.java#L154-L158
maestrano/maestrano-java
src/main/java/com/maestrano/saml/Response.java
Response.loadFromXML
public static Response loadFromXML(Sso ssoService, String xml) throws CertificateException, ParserConfigurationException, SAXException, IOException { """ Load the Response with the provided XML string (not base64 encoded) @param ssoService Maestrano ssOSsoService @param String xml response provided by the SA...
java
public static Response loadFromXML(Sso ssoService, String xml) throws CertificateException, ParserConfigurationException, SAXException, IOException { return new Response(ssoService.getSamlSettings().getIdpCertificate(), xml); }
[ "public", "static", "Response", "loadFromXML", "(", "Sso", "ssoService", ",", "String", "xml", ")", "throws", "CertificateException", ",", "ParserConfigurationException", ",", "SAXException", ",", "IOException", "{", "return", "new", "Response", "(", "ssoService", "...
Load the Response with the provided XML string (not base64 encoded) @param ssoService Maestrano ssOSsoService @param String xml response provided by the SAML idp
[ "Load", "the", "Response", "with", "the", "provided", "XML", "string", "(", "not", "base64", "encoded", ")" ]
train
https://github.com/maestrano/maestrano-java/blob/e71c6d3172d7645529d678d1cb3ea9e0a59de314/src/main/java/com/maestrano/saml/Response.java#L54-L56
JOML-CI/JOML
src/org/joml/Intersectionf.java
Intersectionf.intersectCircleCircle
public static boolean intersectCircleCircle(float aX, float aY, float radiusSquaredA, float bX, float bY, float radiusSquaredB, Vector3f intersectionCenterAndHL) { """ Test whether the one circle with center <code>(aX, aY)</code> and square radius <code>radiusSquaredA</code> intersects the other circle with cente...
java
public static boolean intersectCircleCircle(float aX, float aY, float radiusSquaredA, float bX, float bY, float radiusSquaredB, Vector3f intersectionCenterAndHL) { float dX = bX - aX, dY = bY - aY; float distSquared = dX * dX + dY * dY; float h = 0.5f + (radiusSquaredA - radiusSquaredB) / distSq...
[ "public", "static", "boolean", "intersectCircleCircle", "(", "float", "aX", ",", "float", "aY", ",", "float", "radiusSquaredA", ",", "float", "bX", ",", "float", "bY", ",", "float", "radiusSquaredB", ",", "Vector3f", "intersectionCenterAndHL", ")", "{", "float",...
Test whether the one circle with center <code>(aX, aY)</code> and square radius <code>radiusSquaredA</code> intersects the other circle with center <code>(bX, bY)</code> and square radius <code>radiusSquaredB</code>, and store the center of the line segment of intersection in the <code>(x, y)</code> components of the s...
[ "Test", "whether", "the", "one", "circle", "with", "center", "<code", ">", "(", "aX", "aY", ")", "<", "/", "code", ">", "and", "square", "radius", "<code", ">", "radiusSquaredA<", "/", "code", ">", "intersects", "the", "other", "circle", "with", "center"...
train
https://github.com/JOML-CI/JOML/blob/ce2652fc236b42bda3875c591f8e6645048a678f/src/org/joml/Intersectionf.java#L3721-L3733
padrig64/ValidationFramework
validationframework-swing/src/main/java/com/google/code/validationframework/swing/decoration/anchor/Anchor.java
Anchor.getAnchorPoint
public Point getAnchorPoint(int width, int height) { """ Retrieves a point on an object of the specified size. @param width Width of the object to get the anchor point for. @param height Height of the object to get the anchor point for. @return Anchor point. @see #getAnchorPoint(Dimension) """ ...
java
public Point getAnchorPoint(int width, int height) { return new Point((int) (relativeX * width + offsetX), (int) (relativeY * height + offsetY)); }
[ "public", "Point", "getAnchorPoint", "(", "int", "width", ",", "int", "height", ")", "{", "return", "new", "Point", "(", "(", "int", ")", "(", "relativeX", "*", "width", "+", "offsetX", ")", ",", "(", "int", ")", "(", "relativeY", "*", "height", "+",...
Retrieves a point on an object of the specified size. @param width Width of the object to get the anchor point for. @param height Height of the object to get the anchor point for. @return Anchor point. @see #getAnchorPoint(Dimension)
[ "Retrieves", "a", "point", "on", "an", "object", "of", "the", "specified", "size", "." ]
train
https://github.com/padrig64/ValidationFramework/blob/2dd3c7b3403993db366d24a927645f467ccd1dda/validationframework-swing/src/main/java/com/google/code/validationframework/swing/decoration/anchor/Anchor.java#L203-L205
hector-client/hector
core/src/main/java/me/prettyprint/cassandra/io/ChunkInputStream.java
ChunkInputStream.fetchChunk
private boolean fetchChunk() throws IOException { """ Fetch the next chunk. @return exists if there was a chunk to fetch. @throws IOException """ try { ColumnQuery<T, Long, byte[]> query = HFactory.createColumnQuery(keyspace, rowKeySerializer, LongSerializer.get(), BytesArraySerializer.get()); ...
java
private boolean fetchChunk() throws IOException { try { ColumnQuery<T, Long, byte[]> query = HFactory.createColumnQuery(keyspace, rowKeySerializer, LongSerializer.get(), BytesArraySerializer.get()); QueryResult<HColumn<Long, byte[]>> result = query.setColumnFamily(cf).setKey(key).setName(chunkPos).execu...
[ "private", "boolean", "fetchChunk", "(", ")", "throws", "IOException", "{", "try", "{", "ColumnQuery", "<", "T", ",", "Long", ",", "byte", "[", "]", ">", "query", "=", "HFactory", ".", "createColumnQuery", "(", "keyspace", ",", "rowKeySerializer", ",", "Lo...
Fetch the next chunk. @return exists if there was a chunk to fetch. @throws IOException
[ "Fetch", "the", "next", "chunk", "." ]
train
https://github.com/hector-client/hector/blob/a302e68ca8d91b45d332e8c9afd7d98030b54de1/core/src/main/java/me/prettyprint/cassandra/io/ChunkInputStream.java#L61-L78
casbin/jcasbin
src/main/java/org/casbin/jcasbin/persist/file_adapter/FileAdapter.java
FileAdapter.removeFilteredPolicy
@Override public void removeFilteredPolicy(String sec, String ptype, int fieldIndex, String... fieldValues) { """ removeFilteredPolicy removes policy rules that match the filter from the storage. """ throw new Error("not implemented"); }
java
@Override public void removeFilteredPolicy(String sec, String ptype, int fieldIndex, String... fieldValues) { throw new Error("not implemented"); }
[ "@", "Override", "public", "void", "removeFilteredPolicy", "(", "String", "sec", ",", "String", "ptype", ",", "int", "fieldIndex", ",", "String", "...", "fieldValues", ")", "{", "throw", "new", "Error", "(", "\"not implemented\"", ")", ";", "}" ]
removeFilteredPolicy removes policy rules that match the filter from the storage.
[ "removeFilteredPolicy", "removes", "policy", "rules", "that", "match", "the", "filter", "from", "the", "storage", "." ]
train
https://github.com/casbin/jcasbin/blob/b46d7a756b6c39cdb17e0600607e5fcdc66edd11/src/main/java/org/casbin/jcasbin/persist/file_adapter/FileAdapter.java#L148-L151
jbundle/jbundle
thin/base/thread/src/main/java/org/jbundle/thin/base/thread/PrivateTaskScheduler.java
PrivateTaskScheduler.addJobToRunLater
public void addJobToRunLater(Vector<AutoTask> vJobsToRunLater, AutoTask jobToAdd) { """ Add this job to this list (If there is a duplicate job, add the first to execute). @param vJobsToRunLater @param jobToAdd """ if (jobToAdd.getProperty(NO_DUPLICATE) != null) { Date timeJobToAdd...
java
public void addJobToRunLater(Vector<AutoTask> vJobsToRunLater, AutoTask jobToAdd) { if (jobToAdd.getProperty(NO_DUPLICATE) != null) { Date timeJobToAdd = (Date)jobToAdd.getProperties().get(TIME_TO_RUN); for (int iIndex = 0; iIndex < vJobsToRunLater.size(); iIndex++) ...
[ "public", "void", "addJobToRunLater", "(", "Vector", "<", "AutoTask", ">", "vJobsToRunLater", ",", "AutoTask", "jobToAdd", ")", "{", "if", "(", "jobToAdd", ".", "getProperty", "(", "NO_DUPLICATE", ")", "!=", "null", ")", "{", "Date", "timeJobToAdd", "=", "("...
Add this job to this list (If there is a duplicate job, add the first to execute). @param vJobsToRunLater @param jobToAdd
[ "Add", "this", "job", "to", "this", "list", "(", "If", "there", "is", "a", "duplicate", "job", "add", "the", "first", "to", "execute", ")", "." ]
train
https://github.com/jbundle/jbundle/blob/4037fcfa85f60c7d0096c453c1a3cd573c2b0abc/thin/base/thread/src/main/java/org/jbundle/thin/base/thread/PrivateTaskScheduler.java#L203-L228
wisdom-framework/wisdom
core/wisdom-ipojo-module/src/main/java/org/wisdom/bnd/plugins/ImportedPackageRangeFixer.java
ImportedPackageRangeFixer.analyzeJar
@Override public boolean analyzeJar(Analyzer analyzer) throws Exception { """ Analyzes the jar and update the version range. @param analyzer the analyzer @return {@code false} @throws Exception if the analaysis fails. """ loadInternalRangeFix(); loadExternalRangeFix(); if (ana...
java
@Override public boolean analyzeJar(Analyzer analyzer) throws Exception { loadInternalRangeFix(); loadExternalRangeFix(); if (analyzer.getReferred() == null) { return false; } // Data loaded, start analysis for (Map.Entry<Descriptors.PackageRef, Attrs> e...
[ "@", "Override", "public", "boolean", "analyzeJar", "(", "Analyzer", "analyzer", ")", "throws", "Exception", "{", "loadInternalRangeFix", "(", ")", ";", "loadExternalRangeFix", "(", ")", ";", "if", "(", "analyzer", ".", "getReferred", "(", ")", "==", "null", ...
Analyzes the jar and update the version range. @param analyzer the analyzer @return {@code false} @throws Exception if the analaysis fails.
[ "Analyzes", "the", "jar", "and", "update", "the", "version", "range", "." ]
train
https://github.com/wisdom-framework/wisdom/blob/a35b6431200fec56b178c0ff60837ed73fd7874d/core/wisdom-ipojo-module/src/main/java/org/wisdom/bnd/plugins/ImportedPackageRangeFixer.java#L97-L119
Netflix/spectator
spectator-api/src/main/java/com/netflix/spectator/api/histogram/PercentileDistributionSummary.java
PercentileDistributionSummary.get
public static PercentileDistributionSummary get(Registry registry, Id id) { """ Creates a distribution summary object that can be used for estimating percentiles. <b>Percentile distribution summaries are expensive compared to basic distribution summaries from the registry.</b> Be diligent with ensuring that any ...
java
public static PercentileDistributionSummary get(Registry registry, Id id) { return new PercentileDistributionSummary(registry, id, 0L, Long.MAX_VALUE); }
[ "public", "static", "PercentileDistributionSummary", "get", "(", "Registry", "registry", ",", "Id", "id", ")", "{", "return", "new", "PercentileDistributionSummary", "(", "registry", ",", "id", ",", "0L", ",", "Long", ".", "MAX_VALUE", ")", ";", "}" ]
Creates a distribution summary object that can be used for estimating percentiles. <b>Percentile distribution summaries are expensive compared to basic distribution summaries from the registry.</b> Be diligent with ensuring that any additional dimensions have a small bounded cardinality. It is also highly recommended t...
[ "Creates", "a", "distribution", "summary", "object", "that", "can", "be", "used", "for", "estimating", "percentiles", ".", "<b", ">", "Percentile", "distribution", "summaries", "are", "expensive", "compared", "to", "basic", "distribution", "summaries", "from", "th...
train
https://github.com/Netflix/spectator/blob/259318252770de3bad581b85adff187d8f2c6537/spectator-api/src/main/java/com/netflix/spectator/api/histogram/PercentileDistributionSummary.java#L91-L93
osglworks/java-tool
src/main/java/org/osgl/util/FastStr.java
FastStr.replaceFirst
@Override public FastStr replaceFirst(String regex, String replacement) { """ Wrapper of {@link String#replaceFirst(String, String)} but return FastStr inance @param regex the regular expression specifies the place to be replaced @param replacement the string to replace the found part @return a FastStr th...
java
@Override public FastStr replaceFirst(String regex, String replacement) { return unsafeOf(Pattern.compile(regex).matcher(this).replaceFirst(replacement)); }
[ "@", "Override", "public", "FastStr", "replaceFirst", "(", "String", "regex", ",", "String", "replacement", ")", "{", "return", "unsafeOf", "(", "Pattern", ".", "compile", "(", "regex", ")", ".", "matcher", "(", "this", ")", ".", "replaceFirst", "(", "repl...
Wrapper of {@link String#replaceFirst(String, String)} but return FastStr inance @param regex the regular expression specifies the place to be replaced @param replacement the string to replace the found part @return a FastStr that has the first found part replaced
[ "Wrapper", "of", "{", "@link", "String#replaceFirst", "(", "String", "String", ")", "}", "but", "return", "FastStr", "inance" ]
train
https://github.com/osglworks/java-tool/blob/8b6eee2bccb067eb32e6a7bc4a4dfef7a7d9008b/src/main/java/org/osgl/util/FastStr.java#L1168-L1171
ModeShape/modeshape
modeshape-jcr-api/src/main/java/org/modeshape/jcr/api/JcrTools.java
JcrTools.findOrCreateNode
public Node findOrCreateNode( Session session, String path ) throws RepositoryException { """ Get or create a node at the specified path. @param session the JCR session. may not be null @param path the path of the desired node to be found or created. may not be null @return t...
java
public Node findOrCreateNode( Session session, String path ) throws RepositoryException { return findOrCreateNode(session, path, null, null); }
[ "public", "Node", "findOrCreateNode", "(", "Session", "session", ",", "String", "path", ")", "throws", "RepositoryException", "{", "return", "findOrCreateNode", "(", "session", ",", "path", ",", "null", ",", "null", ")", ";", "}" ]
Get or create a node at the specified path. @param session the JCR session. may not be null @param path the path of the desired node to be found or created. may not be null @return the existing or newly created node @throws RepositoryException @throws IllegalArgumentException if either the session or path argument is ...
[ "Get", "or", "create", "a", "node", "at", "the", "specified", "path", "." ]
train
https://github.com/ModeShape/modeshape/blob/794cfdabb67a90f24629c4fff0424a6125f8f95b/modeshape-jcr-api/src/main/java/org/modeshape/jcr/api/JcrTools.java#L339-L342
lettuce-io/lettuce-core
src/main/java/io/lettuce/core/pubsub/PubSubCommandHandler.java
PubSubCommandHandler.isPubSubMessage
private static boolean isPubSubMessage(ResponseHeaderReplayOutput<?, ?> replay) { """ Check whether {@link ResponseHeaderReplayOutput} contains a Pub/Sub message that requires Pub/Sub dispatch instead of to be used as Command output. @param replay @return """ if (replay == null) { ret...
java
private static boolean isPubSubMessage(ResponseHeaderReplayOutput<?, ?> replay) { if (replay == null) { return false; } String firstElement = replay.firstElement; if (replay.multiCount != null && firstElement != null) { if (replay.multiCount == 3 && firstElemen...
[ "private", "static", "boolean", "isPubSubMessage", "(", "ResponseHeaderReplayOutput", "<", "?", ",", "?", ">", "replay", ")", "{", "if", "(", "replay", "==", "null", ")", "{", "return", "false", ";", "}", "String", "firstElement", "=", "replay", ".", "firs...
Check whether {@link ResponseHeaderReplayOutput} contains a Pub/Sub message that requires Pub/Sub dispatch instead of to be used as Command output. @param replay @return
[ "Check", "whether", "{", "@link", "ResponseHeaderReplayOutput", "}", "contains", "a", "Pub", "/", "Sub", "message", "that", "requires", "Pub", "/", "Sub", "dispatch", "instead", "of", "to", "be", "used", "as", "Command", "output", "." ]
train
https://github.com/lettuce-io/lettuce-core/blob/b6de74e384dea112e3656684ca3f50cdfd6c8e0d/src/main/java/io/lettuce/core/pubsub/PubSubCommandHandler.java#L168-L187
alkacon/opencms-core
src-gwt/org/opencms/ade/galleries/client/preview/CmsImagePreviewHandler.java
CmsImagePreviewHandler.getPreviewScaleParam
public String getPreviewScaleParam(int imageHeight, int imageWidth) { """ Returns the cropping parameter.<p> @param imageHeight the original image height @param imageWidth the original image width @return the cropping parameter """ int maxHeight = m_previewDialog.getPreviewHeight() - 4; ...
java
public String getPreviewScaleParam(int imageHeight, int imageWidth) { int maxHeight = m_previewDialog.getPreviewHeight() - 4; int maxWidth = m_previewDialog.getDialogWidth() - 10; if (m_croppingParam != null) { return m_croppingParam.getRestrictedSizeScaleParam(maxHeight, maxWidth);...
[ "public", "String", "getPreviewScaleParam", "(", "int", "imageHeight", ",", "int", "imageWidth", ")", "{", "int", "maxHeight", "=", "m_previewDialog", ".", "getPreviewHeight", "(", ")", "-", "4", ";", "int", "maxWidth", "=", "m_previewDialog", ".", "getDialogWid...
Returns the cropping parameter.<p> @param imageHeight the original image height @param imageWidth the original image width @return the cropping parameter
[ "Returns", "the", "cropping", "parameter", ".", "<p", ">" ]
train
https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src-gwt/org/opencms/ade/galleries/client/preview/CmsImagePreviewHandler.java#L240-L254
TheCoder4eu/BootsFaces-OSP
src/main/java/net/bootsfaces/component/tree/model/TreeModelUtils.java
TreeModelUtils.printNodeData
public static void printNodeData(Node rootNode, String tab) { """ Debug method to print tree node structure @param rootNode @param tab """ tab = tab == null ? "" : tab + " "; for (Node n : rootNode.getChilds()) { printNodeData(n, tab); } }
java
public static void printNodeData(Node rootNode, String tab) { tab = tab == null ? "" : tab + " "; for (Node n : rootNode.getChilds()) { printNodeData(n, tab); } }
[ "public", "static", "void", "printNodeData", "(", "Node", "rootNode", ",", "String", "tab", ")", "{", "tab", "=", "tab", "==", "null", "?", "\"\"", ":", "tab", "+", "\" \"", ";", "for", "(", "Node", "n", ":", "rootNode", ".", "getChilds", "(", ")", ...
Debug method to print tree node structure @param rootNode @param tab
[ "Debug", "method", "to", "print", "tree", "node", "structure" ]
train
https://github.com/TheCoder4eu/BootsFaces-OSP/blob/d1a70952bc240979b5272fa4fe1c7f100873add0/src/main/java/net/bootsfaces/component/tree/model/TreeModelUtils.java#L40-L47
before/quality-check
modules/quality-check/src/main/java/net/sf/qualitycheck/ConditionalCheck.java
ConditionalCheck.notNull
@Throws(IllegalNullArgumentException.class) public static <T> void notNull(final boolean condition, @Nonnull final T reference, @Nullable final String name) { """ Ensures that an object reference passed as a parameter to the calling method is not {@code null}. @param condition condition must be {@code true}^ ...
java
@Throws(IllegalNullArgumentException.class) public static <T> void notNull(final boolean condition, @Nonnull final T reference, @Nullable final String name) { if (condition) { Check.notNull(reference, name); } }
[ "@", "Throws", "(", "IllegalNullArgumentException", ".", "class", ")", "public", "static", "<", "T", ">", "void", "notNull", "(", "final", "boolean", "condition", ",", "@", "Nonnull", "final", "T", "reference", ",", "@", "Nullable", "final", "String", "name"...
Ensures that an object reference passed as a parameter to the calling method is not {@code null}. @param condition condition must be {@code true}^ so that the check will be performed @param reference an object reference @param name name of object reference (in source code) @throws IllegalNullArgumentException if the ...
[ "Ensures", "that", "an", "object", "reference", "passed", "as", "a", "parameter", "to", "the", "calling", "method", "is", "not", "{", "@code", "null", "}", "." ]
train
https://github.com/before/quality-check/blob/a75c32c39434ddb1f89bece57acae0536724c15a/modules/quality-check/src/main/java/net/sf/qualitycheck/ConditionalCheck.java#L2021-L2026
deeplearning4j/deeplearning4j
datavec/datavec-api/src/main/java/org/datavec/api/records/converter/RecordReaderConverter.java
RecordReaderConverter.convert
public static void convert(RecordReader reader, RecordWriter writer, boolean closeOnCompletion) throws IOException { """ Write all values from the specified record reader to the specified record writer. Optionally, close the record writer on completion @param reader Record reader (source of data) @param write...
java
public static void convert(RecordReader reader, RecordWriter writer, boolean closeOnCompletion) throws IOException { if(!reader.hasNext()){ throw new UnsupportedOperationException("Cannot convert RecordReader: reader has no next element"); } while(reader.hasNext()){ wri...
[ "public", "static", "void", "convert", "(", "RecordReader", "reader", ",", "RecordWriter", "writer", ",", "boolean", "closeOnCompletion", ")", "throws", "IOException", "{", "if", "(", "!", "reader", ".", "hasNext", "(", ")", ")", "{", "throw", "new", "Unsupp...
Write all values from the specified record reader to the specified record writer. Optionally, close the record writer on completion @param reader Record reader (source of data) @param writer Record writer (location to write data) @param closeOnCompletion if true: close the record writer once complete, via {@link Recor...
[ "Write", "all", "values", "from", "the", "specified", "record", "reader", "to", "the", "specified", "record", "writer", ".", "Optionally", "close", "the", "record", "writer", "on", "completion" ]
train
https://github.com/deeplearning4j/deeplearning4j/blob/effce52f2afd7eeb53c5bcca699fcd90bd06822f/datavec/datavec-api/src/main/java/org/datavec/api/records/converter/RecordReaderConverter.java#L57-L70
cdk/cdk
base/standard/src/main/java/org/openscience/cdk/math/RandomNumbersTool.java
RandomNumbersTool.randomInt
public static int randomInt(int lo, int hi) { """ Generates a random integer between the specified values. @param lo the lower bound for the generated integer. @param hi the upper bound for the generated integer. @return a random integer between <code>lo</code> and <code>hi</code>. """ return (M...
java
public static int randomInt(int lo, int hi) { return (Math.abs(random.nextInt()) % (hi - lo + 1)) + lo; }
[ "public", "static", "int", "randomInt", "(", "int", "lo", ",", "int", "hi", ")", "{", "return", "(", "Math", ".", "abs", "(", "random", ".", "nextInt", "(", ")", ")", "%", "(", "hi", "-", "lo", "+", "1", ")", ")", "+", "lo", ";", "}" ]
Generates a random integer between the specified values. @param lo the lower bound for the generated integer. @param hi the upper bound for the generated integer. @return a random integer between <code>lo</code> and <code>hi</code>.
[ "Generates", "a", "random", "integer", "between", "the", "specified", "values", "." ]
train
https://github.com/cdk/cdk/blob/c3d0f16502bf08df50365fee392e11d7c9856657/base/standard/src/main/java/org/openscience/cdk/math/RandomNumbersTool.java#L106-L108
UrielCh/ovh-java-sdk
ovh-java-sdk-hostingweb/src/main/java/net/minidev/ovh/api/ApiOvhHostingweb.java
ApiOvhHostingweb.serviceName_email_volumes_GET
public ArrayList<OvhVolumeHistory> serviceName_email_volumes_GET(String serviceName) throws IOException { """ Request the history volume of email sent REST: GET /hosting/web/{serviceName}/email/volumes @param serviceName [required] The internal name of your hosting """ String qPath = "/hosting/web/{servi...
java
public ArrayList<OvhVolumeHistory> serviceName_email_volumes_GET(String serviceName) throws IOException { String qPath = "/hosting/web/{serviceName}/email/volumes"; StringBuilder sb = path(qPath, serviceName); String resp = exec(qPath, "GET", sb.toString(), null); return convertTo(resp, t10); }
[ "public", "ArrayList", "<", "OvhVolumeHistory", ">", "serviceName_email_volumes_GET", "(", "String", "serviceName", ")", "throws", "IOException", "{", "String", "qPath", "=", "\"/hosting/web/{serviceName}/email/volumes\"", ";", "StringBuilder", "sb", "=", "path", "(", "...
Request the history volume of email sent REST: GET /hosting/web/{serviceName}/email/volumes @param serviceName [required] The internal name of your hosting
[ "Request", "the", "history", "volume", "of", "email", "sent" ]
train
https://github.com/UrielCh/ovh-java-sdk/blob/6d531a40e56e09701943e334c25f90f640c55701/ovh-java-sdk-hostingweb/src/main/java/net/minidev/ovh/api/ApiOvhHostingweb.java#L1848-L1853
hyperledger/fabric-sdk-java
src/main/java/org/hyperledger/fabric/sdk/Channel.java
Channel.queryBlockByTransactionID
public BlockInfo queryBlockByTransactionID(Peer peer, String txID) throws InvalidArgumentException, ProposalException { """ query a peer in this channel for a Block by a TransactionID contained in the block <STRONG>This method may not be thread safe if client context is changed!</STRONG> @param peer the peer...
java
public BlockInfo queryBlockByTransactionID(Peer peer, String txID) throws InvalidArgumentException, ProposalException { return queryBlockByTransactionID(Collections.singleton(peer), txID); }
[ "public", "BlockInfo", "queryBlockByTransactionID", "(", "Peer", "peer", ",", "String", "txID", ")", "throws", "InvalidArgumentException", ",", "ProposalException", "{", "return", "queryBlockByTransactionID", "(", "Collections", ".", "singleton", "(", "peer", ")", ","...
query a peer in this channel for a Block by a TransactionID contained in the block <STRONG>This method may not be thread safe if client context is changed!</STRONG> @param peer the peer to send the request to @param txID the transactionID to query on @return the {@link BlockInfo} for the Block containing the transact...
[ "query", "a", "peer", "in", "this", "channel", "for", "a", "Block", "by", "a", "TransactionID", "contained", "in", "the", "block" ]
train
https://github.com/hyperledger/fabric-sdk-java/blob/4a2d7b3408b8b0a1ed812aa36942c438159c37a0/src/main/java/org/hyperledger/fabric/sdk/Channel.java#L2990-L2992
lucee/Lucee
core/src/main/java/lucee/commons/lang/StringUtil.java
StringUtil.endsWithIgnoreCase
public static boolean endsWithIgnoreCase(final String base, final String end) { """ Helper functions to query a strings end portion. The comparison is case insensitive. @param base the base string. @param end the ending text. @return true, if the string ends with the given ending text. """ if (base.len...
java
public static boolean endsWithIgnoreCase(final String base, final String end) { if (base.length() < end.length()) { return false; } return base.regionMatches(true, base.length() - end.length(), end, 0, end.length()); }
[ "public", "static", "boolean", "endsWithIgnoreCase", "(", "final", "String", "base", ",", "final", "String", "end", ")", "{", "if", "(", "base", ".", "length", "(", ")", "<", "end", ".", "length", "(", ")", ")", "{", "return", "false", ";", "}", "ret...
Helper functions to query a strings end portion. The comparison is case insensitive. @param base the base string. @param end the ending text. @return true, if the string ends with the given ending text.
[ "Helper", "functions", "to", "query", "a", "strings", "end", "portion", ".", "The", "comparison", "is", "case", "insensitive", "." ]
train
https://github.com/lucee/Lucee/blob/29b153fc4e126e5edb97da937f2ee2e231b87593/core/src/main/java/lucee/commons/lang/StringUtil.java#L904-L909
RestComm/cluster
timers/src/main/java/org/restcomm/timers/FaultTolerantScheduler.java
FaultTolerantScheduler.getTimerTaskData
public TimerTaskData getTimerTaskData(Serializable taskID) { """ Retrieves the {@link TimerTaskData} associated with the specified taskID. @param taskID @return null if there is no such timer task data """ TimerTaskCacheData timerTaskCacheData = new TimerTaskCacheData(taskID, baseFqn, cluster); if (timer...
java
public TimerTaskData getTimerTaskData(Serializable taskID) { TimerTaskCacheData timerTaskCacheData = new TimerTaskCacheData(taskID, baseFqn, cluster); if (timerTaskCacheData.exists()) { return timerTaskCacheData.getTaskData(); } else { return null; } }
[ "public", "TimerTaskData", "getTimerTaskData", "(", "Serializable", "taskID", ")", "{", "TimerTaskCacheData", "timerTaskCacheData", "=", "new", "TimerTaskCacheData", "(", "taskID", ",", "baseFqn", ",", "cluster", ")", ";", "if", "(", "timerTaskCacheData", ".", "exis...
Retrieves the {@link TimerTaskData} associated with the specified taskID. @param taskID @return null if there is no such timer task data
[ "Retrieves", "the", "{" ]
train
https://github.com/RestComm/cluster/blob/46bff5e9ae89528ccc7b43ba50a0de5b96913e6f/timers/src/main/java/org/restcomm/timers/FaultTolerantScheduler.java#L187-L195
h2oai/h2o-3
h2o-core/src/main/java/jsr166y/ForkJoinPool.java
ForkJoinPool.tryPollForAndExec
private void tryPollForAndExec(WorkQueue joiner, ForkJoinTask<?> task) { """ If task is at base of some steal queue, steals and executes it. @param joiner the joining worker @param task the task """ WorkQueue[] ws; if ((ws = workQueues) != null) { for (int j = 1; j < ws.length &...
java
private void tryPollForAndExec(WorkQueue joiner, ForkJoinTask<?> task) { WorkQueue[] ws; if ((ws = workQueues) != null) { for (int j = 1; j < ws.length && task.status >= 0; j += 2) { WorkQueue q = ws[j]; if (q != null && q.pollFor(task)) { ...
[ "private", "void", "tryPollForAndExec", "(", "WorkQueue", "joiner", ",", "ForkJoinTask", "<", "?", ">", "task", ")", "{", "WorkQueue", "[", "]", "ws", ";", "if", "(", "(", "ws", "=", "workQueues", ")", "!=", "null", ")", "{", "for", "(", "int", "j", ...
If task is at base of some steal queue, steals and executes it. @param joiner the joining worker @param task the task
[ "If", "task", "is", "at", "base", "of", "some", "steal", "queue", "steals", "and", "executes", "it", "." ]
train
https://github.com/h2oai/h2o-3/blob/845eb49dfeaadf638b6e2f779d82fac996391fad/h2o-core/src/main/java/jsr166y/ForkJoinPool.java#L1733-L1744
yavijava/yavijava
src/main/java/com/vmware/vim25/mo/IoFilterManager.java
IoFilterManager.queryIoFilterIssues
public IoFilterQueryIssueResult queryIoFilterIssues(String filterId, ComputeResource compRes) throws RemoteException, RuntimeFault { """ Return the issues that occured during the last installation/uninstallation/upgrade operation of an IO Filter on a compute resource @param filterId - ID of the filter...
java
public IoFilterQueryIssueResult queryIoFilterIssues(String filterId, ComputeResource compRes) throws RemoteException, RuntimeFault { return getVimService().queryIoFilterIssues(getMOR(), filterId, compRes.getMOR()); }
[ "public", "IoFilterQueryIssueResult", "queryIoFilterIssues", "(", "String", "filterId", ",", "ComputeResource", "compRes", ")", "throws", "RemoteException", ",", "RuntimeFault", "{", "return", "getVimService", "(", ")", ".", "queryIoFilterIssues", "(", "getMOR", "(", ...
Return the issues that occured during the last installation/uninstallation/upgrade operation of an IO Filter on a compute resource @param filterId - ID of the filter. @param compRes - The compute resource. "compRes" must be a cluster. @return IoFilterQueryIssueResult - Result for QueryIoFilterIssues. Filters that are...
[ "Return", "the", "issues", "that", "occured", "during", "the", "last", "installation", "/", "uninstallation", "/", "upgrade", "operation", "of", "an", "IO", "Filter", "on", "a", "compute", "resource" ]
train
https://github.com/yavijava/yavijava/blob/27fd2c5826115782d5eeb934f86e3e39240179cd/src/main/java/com/vmware/vim25/mo/IoFilterManager.java#L124-L127
yangjm/winlet
utils/src/main/java/com/aggrepoint/utils/CollectionUtils.java
CollectionUtils.toHashtable
public static <T, K> Hashtable<K, T> toHashtable(Collection<T> entities, Function<T, K> keyMapper) { """ Convert a collection to Hashtable. The key is decided by keyMapper, value is the object in collection @param entities @param keyMapper @return """ return toMap(entities, keyMapper, Hashtable<K,...
java
public static <T, K> Hashtable<K, T> toHashtable(Collection<T> entities, Function<T, K> keyMapper) { return toMap(entities, keyMapper, Hashtable<K, T>::new); }
[ "public", "static", "<", "T", ",", "K", ">", "Hashtable", "<", "K", ",", "T", ">", "toHashtable", "(", "Collection", "<", "T", ">", "entities", ",", "Function", "<", "T", ",", "K", ">", "keyMapper", ")", "{", "return", "toMap", "(", "entities", ","...
Convert a collection to Hashtable. The key is decided by keyMapper, value is the object in collection @param entities @param keyMapper @return
[ "Convert", "a", "collection", "to", "Hashtable", ".", "The", "key", "is", "decided", "by", "keyMapper", "value", "is", "the", "object", "in", "collection" ]
train
https://github.com/yangjm/winlet/blob/2126236f56858e283fa6ad69fe9279ee30f47b67/utils/src/main/java/com/aggrepoint/utils/CollectionUtils.java#L126-L129
osmdroid/osmdroid
osmdroid-geopackage/src/main/java/org/osmdroid/gpkg/overlay/OsmMapShapeConverter.java
OsmMapShapeConverter.addPolylinesToMap
public static MultiPolyline addPolylinesToMap(MapView map, List<Polyline> polylines) { """ Add a list of Polylines to the map @param map @param polylines @return """ MultiPolyline multiPolyline = new MultiPolyline(); for (Polyline line : p...
java
public static MultiPolyline addPolylinesToMap(MapView map, List<Polyline> polylines) { MultiPolyline multiPolyline = new MultiPolyline(); for (Polyline line : polylines) { if (line.getInfoWindow()==null) line.setInfoWindow(new Ba...
[ "public", "static", "MultiPolyline", "addPolylinesToMap", "(", "MapView", "map", ",", "List", "<", "Polyline", ">", "polylines", ")", "{", "MultiPolyline", "multiPolyline", "=", "new", "MultiPolyline", "(", ")", ";", "for", "(", "Polyline", "line", ":", "polyl...
Add a list of Polylines to the map @param map @param polylines @return
[ "Add", "a", "list", "of", "Polylines", "to", "the", "map" ]
train
https://github.com/osmdroid/osmdroid/blob/3b178b2f078497dd88c137110e87aafe45ad2b16/osmdroid-geopackage/src/main/java/org/osmdroid/gpkg/overlay/OsmMapShapeConverter.java#L794-L805
zaproxy/zaproxy
src/org/zaproxy/zap/extension/httpsessions/HttpSession.java
HttpSession.setTokenValue
public void setTokenValue(String tokenName, Cookie value) { """ Sets a particular value for a session token. If the value is null, that token is deleted from the session. @param tokenName the token name @param value the new value of the token, or null, if the token has to be deleted """ if (value == nul...
java
public void setTokenValue(String tokenName, Cookie value) { if (value == null) { tokenValues.remove(tokenName); } else { tokenValues.put(tokenName, value); } }
[ "public", "void", "setTokenValue", "(", "String", "tokenName", ",", "Cookie", "value", ")", "{", "if", "(", "value", "==", "null", ")", "{", "tokenValues", ".", "remove", "(", "tokenName", ")", ";", "}", "else", "{", "tokenValues", ".", "put", "(", "to...
Sets a particular value for a session token. If the value is null, that token is deleted from the session. @param tokenName the token name @param value the new value of the token, or null, if the token has to be deleted
[ "Sets", "a", "particular", "value", "for", "a", "session", "token", ".", "If", "the", "value", "is", "null", "that", "token", "is", "deleted", "from", "the", "session", "." ]
train
https://github.com/zaproxy/zaproxy/blob/0cbe5121f2ae1ecca222513d182759210c569bec/src/org/zaproxy/zap/extension/httpsessions/HttpSession.java#L116-L122
jbundle/jbundle
base/base/src/main/java/org/jbundle/base/db/Record.java
Record.getSQLQuery
public String getSQLQuery(boolean bUseCurrentValues, Vector<BaseField> vParamList) { """ Get the SQL SELECT string. @param bUseCurrentValues If true, use the current field value, otherwise, use '?'. @param vParamList The parameter list. @return The SQL select string. """ String strRecordset = this.m...
java
public String getSQLQuery(boolean bUseCurrentValues, Vector<BaseField> vParamList) { String strRecordset = this.makeTableNames(false); String strFields = this.getSQLFields(DBConstants.SQL_SELECT_TYPE, bUseCurrentValues); boolean bIsQueryRecord = this.isQueryRecord(); String strSortPa...
[ "public", "String", "getSQLQuery", "(", "boolean", "bUseCurrentValues", ",", "Vector", "<", "BaseField", ">", "vParamList", ")", "{", "String", "strRecordset", "=", "this", ".", "makeTableNames", "(", "false", ")", ";", "String", "strFields", "=", "this", ".",...
Get the SQL SELECT string. @param bUseCurrentValues If true, use the current field value, otherwise, use '?'. @param vParamList The parameter list. @return The SQL select string.
[ "Get", "the", "SQL", "SELECT", "string", "." ]
train
https://github.com/jbundle/jbundle/blob/4037fcfa85f60c7d0096c453c1a3cd573c2b0abc/base/base/src/main/java/org/jbundle/base/db/Record.java#L1412-L1448
nohana/Amalgam
amalgam/src/main/java/com/amalgam/os/BundleUtils.java
BundleUtils.optSparseParcelableArray
@Nullable public static <T extends Parcelable> SparseArray<T> optSparseParcelableArray(@Nullable Bundle bundle, @Nullable String key) { """ Returns a optional {@link android.util.SparseArray} value. In other words, returns the value mapped by key if it exists and is a {@link android.util.SparseArray}. The bun...
java
@Nullable public static <T extends Parcelable> SparseArray<T> optSparseParcelableArray(@Nullable Bundle bundle, @Nullable String key) { return optSparseParcelableArray(bundle, key, new SparseArray<T>()); }
[ "@", "Nullable", "public", "static", "<", "T", "extends", "Parcelable", ">", "SparseArray", "<", "T", ">", "optSparseParcelableArray", "(", "@", "Nullable", "Bundle", "bundle", ",", "@", "Nullable", "String", "key", ")", "{", "return", "optSparseParcelableArray"...
Returns a optional {@link android.util.SparseArray} value. In other words, returns the value mapped by key if it exists and is a {@link android.util.SparseArray}. The bundle argument is allowed to be {@code null}. If the bundle is null, this method returns null. @param bundle a bundle. If the bundle is null, this metho...
[ "Returns", "a", "optional", "{" ]
train
https://github.com/nohana/Amalgam/blob/57809ddbfe7897e979cf507982ce0b3aa5e0ed8a/amalgam/src/main/java/com/amalgam/os/BundleUtils.java#L935-L938
jspringbot/jspringbot
src/main/java/org/jspringbot/spring/KeywordUtils.java
KeywordUtils.getDescription
public static String getDescription(String keyword, ApplicationContext context, Map<String, String> beanMap) { """ Retrieves the given keyword's description. @param keyword keyword name @param context Spring application context @param beanMap keyword name to bean name mapping @return the documentation string...
java
public static String getDescription(String keyword, ApplicationContext context, Map<String, String> beanMap) { KeywordInfo keywordInfo = getKeywordInfo(keyword, context, beanMap); if(keywordInfo == null) { return ""; } String desc = keywordInfo.description(); if(de...
[ "public", "static", "String", "getDescription", "(", "String", "keyword", ",", "ApplicationContext", "context", ",", "Map", "<", "String", ",", "String", ">", "beanMap", ")", "{", "KeywordInfo", "keywordInfo", "=", "getKeywordInfo", "(", "keyword", ",", "context...
Retrieves the given keyword's description. @param keyword keyword name @param context Spring application context @param beanMap keyword name to bean name mapping @return the documentation string of the given keyword, or empty string if unavailable.
[ "Retrieves", "the", "given", "keyword", "s", "description", "." ]
train
https://github.com/jspringbot/jspringbot/blob/03285a7013492fb793cb0c38a4625a5f5c5750e0/src/main/java/org/jspringbot/spring/KeywordUtils.java#L90-L111
datumbox/datumbox-framework
datumbox-framework-core/src/main/java/com/datumbox/framework/core/statistics/parametrics/independentsamples/FIndependentSamples.java
FIndependentSamples.checkCriticalValue
private static boolean checkCriticalValue(double score, int n, int m, boolean is_twoTailed, double aLevel) { """ Checks the Critical Value to determine if the Hypothesis should be rejected @param score @param n @param m @param is_twoTailed @param aLevel @return """ double probability=Continuous...
java
private static boolean checkCriticalValue(double score, int n, int m, boolean is_twoTailed, double aLevel) { double probability=ContinuousDistributions.fCdf(score,n-1,m-1); boolean rejectH0=false; double a=aLevel; if(is_twoTailed) { //if to tailed test then split the statistical signif...
[ "private", "static", "boolean", "checkCriticalValue", "(", "double", "score", ",", "int", "n", ",", "int", "m", ",", "boolean", "is_twoTailed", ",", "double", "aLevel", ")", "{", "double", "probability", "=", "ContinuousDistributions", ".", "fCdf", "(", "score...
Checks the Critical Value to determine if the Hypothesis should be rejected @param score @param n @param m @param is_twoTailed @param aLevel @return
[ "Checks", "the", "Critical", "Value", "to", "determine", "if", "the", "Hypothesis", "should", "be", "rejected" ]
train
https://github.com/datumbox/datumbox-framework/blob/909dff0476e80834f05ecdde0624dd2390e9b0ca/datumbox-framework-core/src/main/java/com/datumbox/framework/core/statistics/parametrics/independentsamples/FIndependentSamples.java#L62-L76
Azure/azure-sdk-for-java
containerservice/resource-manager/v2017_08_31/src/main/java/com/microsoft/azure/management/containerservice/v2017_08_31/implementation/ManagedClustersInner.java
ManagedClustersInner.getByResourceGroupAsync
public Observable<ManagedClusterInner> getByResourceGroupAsync(String resourceGroupName, String resourceName) { """ Gets a managed cluster. Gets the details of the managed cluster with a specified resource group and name. @param resourceGroupName The name of the resource group. @param resourceName The name of...
java
public Observable<ManagedClusterInner> getByResourceGroupAsync(String resourceGroupName, String resourceName) { return getByResourceGroupWithServiceResponseAsync(resourceGroupName, resourceName).map(new Func1<ServiceResponse<ManagedClusterInner>, ManagedClusterInner>() { @Override public...
[ "public", "Observable", "<", "ManagedClusterInner", ">", "getByResourceGroupAsync", "(", "String", "resourceGroupName", ",", "String", "resourceName", ")", "{", "return", "getByResourceGroupWithServiceResponseAsync", "(", "resourceGroupName", ",", "resourceName", ")", ".", ...
Gets a managed cluster. Gets the details of the managed cluster with a specified resource group and name. @param resourceGroupName The name of the resource group. @param resourceName The name of the managed cluster resource. @throws IllegalArgumentException thrown if parameters fail the validation @return the observab...
[ "Gets", "a", "managed", "cluster", ".", "Gets", "the", "details", "of", "the", "managed", "cluster", "with", "a", "specified", "resource", "group", "and", "name", "." ]
train
https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/containerservice/resource-manager/v2017_08_31/src/main/java/com/microsoft/azure/management/containerservice/v2017_08_31/implementation/ManagedClustersInner.java#L570-L577
OpenLiberty/open-liberty
dev/com.ibm.ws.opentracing.1.1/src/com/ibm/ws/opentracing/OpentracingService.java
OpentracingService.addSpanErrorInfo
public static void addSpanErrorInfo(Span span, Throwable exception) { """ "An Tags.ERROR tag SHOULD be added to a Span on failed operations. It means for any server error (5xx) codes. If there is an exception object available the implementation SHOULD also add logs event=error and error.object=<error object ins...
java
public static void addSpanErrorInfo(Span span, Throwable exception) { String methodName = "addSpanErrorInfo"; span.setTag(Tags.ERROR.getKey(), true); if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) { Tr.debug(tc, methodName + " error", Boolean.TRUE); } ...
[ "public", "static", "void", "addSpanErrorInfo", "(", "Span", "span", ",", "Throwable", "exception", ")", "{", "String", "methodName", "=", "\"addSpanErrorInfo\"", ";", "span", ".", "setTag", "(", "Tags", ".", "ERROR", ".", "getKey", "(", ")", ",", "true", ...
"An Tags.ERROR tag SHOULD be added to a Span on failed operations. It means for any server error (5xx) codes. If there is an exception object available the implementation SHOULD also add logs event=error and error.object=<error object instance> to the active span." https://github.com/eclipse/microprofile-opentracing/bl...
[ "An", "Tags", ".", "ERROR", "tag", "SHOULD", "be", "added", "to", "a", "Span", "on", "failed", "operations", ".", "It", "means", "for", "any", "server", "error", "(", "5xx", ")", "codes", ".", "If", "there", "is", "an", "exception", "object", "availabl...
train
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.opentracing.1.1/src/com/ibm/ws/opentracing/OpentracingService.java#L162-L184
netty/netty
codec/src/main/java/io/netty/handler/codec/compression/Snappy.java
Snappy.validateChecksum
static void validateChecksum(int expectedChecksum, ByteBuf data, int offset, int length) { """ Computes the CRC32C checksum of the supplied data, performs the "mask" operation on the computed checksum, and then compares the resulting masked checksum to the supplied checksum. @param expectedChecksum The checks...
java
static void validateChecksum(int expectedChecksum, ByteBuf data, int offset, int length) { final int actualChecksum = calculateChecksum(data, offset, length); if (actualChecksum != expectedChecksum) { throw new DecompressionException( "mismatching checksum: " + Integer.to...
[ "static", "void", "validateChecksum", "(", "int", "expectedChecksum", ",", "ByteBuf", "data", ",", "int", "offset", ",", "int", "length", ")", "{", "final", "int", "actualChecksum", "=", "calculateChecksum", "(", "data", ",", "offset", ",", "length", ")", ";...
Computes the CRC32C checksum of the supplied data, performs the "mask" operation on the computed checksum, and then compares the resulting masked checksum to the supplied checksum. @param expectedChecksum The checksum decoded from the stream to compare against @param data The input data to calculate the CRC32C checksu...
[ "Computes", "the", "CRC32C", "checksum", "of", "the", "supplied", "data", "performs", "the", "mask", "operation", "on", "the", "computed", "checksum", "and", "then", "compares", "the", "resulting", "masked", "checksum", "to", "the", "supplied", "checksum", "." ]
train
https://github.com/netty/netty/blob/ba06eafa1c1824bd154f1a380019e7ea2edf3c4c/codec/src/main/java/io/netty/handler/codec/compression/Snappy.java#L638-L645
defei/codelogger-utils
src/main/java/org/codelogger/utils/DateUtils.java
DateUtils.getDateFromString
public static Date getDateFromString(final String dateString, final String pattern) { """ Get data from data string using the given pattern and the default date format symbols for the default locale. @param dateString date string to be handled. @param pattern pattern to be formated. @return a new Date object...
java
public static Date getDateFromString(final String dateString, final String pattern) { try { SimpleDateFormat df = buildDateFormat(pattern); return df.parse(dateString); } catch (ParseException e) { throw new DateException(String.format("Could not parse %s with pattern %s.", dateString, ...
[ "public", "static", "Date", "getDateFromString", "(", "final", "String", "dateString", ",", "final", "String", "pattern", ")", "{", "try", "{", "SimpleDateFormat", "df", "=", "buildDateFormat", "(", "pattern", ")", ";", "return", "df", ".", "parse", "(", "da...
Get data from data string using the given pattern and the default date format symbols for the default locale. @param dateString date string to be handled. @param pattern pattern to be formated. @return a new Date object by given date string and pattern. @throws DateException
[ "Get", "data", "from", "data", "string", "using", "the", "given", "pattern", "and", "the", "default", "date", "format", "symbols", "for", "the", "default", "locale", "." ]
train
https://github.com/defei/codelogger-utils/blob/d906f5d217b783c7ae3e53442cd6fb87b20ecc0a/src/main/java/org/codelogger/utils/DateUtils.java#L93-L102
google/j2objc
jre_emul/android/platform/external/icu/android_icu4j/src/main/java/android/icu/util/Calendar.java
Calendar.internalSet
protected final void internalSet(int field, int value) { """ Set a field to a value. Subclasses should use this method when computing fields. It sets the time stamp in the <code>stamp[]</code> array to <code>INTERNALLY_SET</code>. If a field that may not be set by subclasses is passed in, an <code>IllegalAr...
java
protected final void internalSet(int field, int value) { if (((1 << field) & internalSetMask) == 0) { throw new IllegalStateException("Subclass cannot set " + fieldName(field)); } fields[field] = value; stamp[field] = INTERNALLY_SET; }
[ "protected", "final", "void", "internalSet", "(", "int", "field", ",", "int", "value", ")", "{", "if", "(", "(", "(", "1", "<<", "field", ")", "&", "internalSetMask", ")", "==", "0", ")", "{", "throw", "new", "IllegalStateException", "(", "\"Subclass can...
Set a field to a value. Subclasses should use this method when computing fields. It sets the time stamp in the <code>stamp[]</code> array to <code>INTERNALLY_SET</code>. If a field that may not be set by subclasses is passed in, an <code>IllegalArgumentException</code> is thrown. This prevents subclasses from modif...
[ "Set", "a", "field", "to", "a", "value", ".", "Subclasses", "should", "use", "this", "method", "when", "computing", "fields", ".", "It", "sets", "the", "time", "stamp", "in", "the", "<code", ">", "stamp", "[]", "<", "/", "code", ">", "array", "to", "...
train
https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/external/icu/android_icu4j/src/main/java/android/icu/util/Calendar.java#L5970-L5977
elki-project/elki
elki-core-util/src/main/java/de/lmu/ifi/dbs/elki/utilities/xml/DOMCloner.java
DOMCloner.copyAttributes
public void copyAttributes(Document doc, Element eold, Element enew) { """ Copy the attributes from an existing node to a new node. @param doc Target document @param eold Existing node @param enew Target node """ if(eold.hasAttributes()) { NamedNodeMap attr = eold.getAttributes(); int len ...
java
public void copyAttributes(Document doc, Element eold, Element enew) { if(eold.hasAttributes()) { NamedNodeMap attr = eold.getAttributes(); int len = attr.getLength(); for(int i = 0; i < len; i++) { enew.setAttributeNode((Attr) doc.importNode(attr.item(i), true)); } } }
[ "public", "void", "copyAttributes", "(", "Document", "doc", ",", "Element", "eold", ",", "Element", "enew", ")", "{", "if", "(", "eold", ".", "hasAttributes", "(", ")", ")", "{", "NamedNodeMap", "attr", "=", "eold", ".", "getAttributes", "(", ")", ";", ...
Copy the attributes from an existing node to a new node. @param doc Target document @param eold Existing node @param enew Target node
[ "Copy", "the", "attributes", "from", "an", "existing", "node", "to", "a", "new", "node", "." ]
train
https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-core-util/src/main/java/de/lmu/ifi/dbs/elki/utilities/xml/DOMCloner.java#L98-L106
Carbonado/Carbonado
src/main/java/com/amazon/carbonado/raw/KeyEncoder.java
KeyEncoder.encodeDesc
public static int encodeDesc(Short value, byte[] dst, int dstOffset) { """ Encodes the given signed Short object into exactly 1 or 3 bytes for descending order. If the Short object is never expected to be null, consider encoding as a short primitive. @param value optional signed Short value to encode @param ...
java
public static int encodeDesc(Short value, byte[] dst, int dstOffset) { if (value == null) { dst[dstOffset] = NULL_BYTE_LOW; return 1; } else { dst[dstOffset] = NOT_NULL_BYTE_LOW; DataEncoder.encode((short) ~value.shortValue(), dst, dstOffset + 1); ...
[ "public", "static", "int", "encodeDesc", "(", "Short", "value", ",", "byte", "[", "]", "dst", ",", "int", "dstOffset", ")", "{", "if", "(", "value", "==", "null", ")", "{", "dst", "[", "dstOffset", "]", "=", "NULL_BYTE_LOW", ";", "return", "1", ";", ...
Encodes the given signed Short object into exactly 1 or 3 bytes for descending order. If the Short object is never expected to be null, consider encoding as a short primitive. @param value optional signed Short value to encode @param dst destination for encoded bytes @param dstOffset offset into destination array @ret...
[ "Encodes", "the", "given", "signed", "Short", "object", "into", "exactly", "1", "or", "3", "bytes", "for", "descending", "order", ".", "If", "the", "Short", "object", "is", "never", "expected", "to", "be", "null", "consider", "encoding", "as", "a", "short"...
train
https://github.com/Carbonado/Carbonado/blob/eee29b365a61c8f03e1a1dc6bed0692e6b04b1db/src/main/java/com/amazon/carbonado/raw/KeyEncoder.java#L159-L168
pravega/pravega
segmentstore/server/src/main/java/io/pravega/segmentstore/server/logs/OperationProcessor.java
OperationProcessor.cancelIncompleteOperations
private void cancelIncompleteOperations(Iterable<CompletableOperation> operations, Throwable failException) { """ Cancels those Operations in the given list that have not yet completed with the given exception. """ assert failException != null : "no exception to set"; int cancelCount = 0; ...
java
private void cancelIncompleteOperations(Iterable<CompletableOperation> operations, Throwable failException) { assert failException != null : "no exception to set"; int cancelCount = 0; for (CompletableOperation o : operations) { if (!o.isDone()) { this.state.failOpera...
[ "private", "void", "cancelIncompleteOperations", "(", "Iterable", "<", "CompletableOperation", ">", "operations", ",", "Throwable", "failException", ")", "{", "assert", "failException", "!=", "null", ":", "\"no exception to set\"", ";", "int", "cancelCount", "=", "0",...
Cancels those Operations in the given list that have not yet completed with the given exception.
[ "Cancels", "those", "Operations", "in", "the", "given", "list", "that", "have", "not", "yet", "completed", "with", "the", "given", "exception", "." ]
train
https://github.com/pravega/pravega/blob/6e24df7470669b3956a07018f52b2c6b3c2a3503/segmentstore/server/src/main/java/io/pravega/segmentstore/server/logs/OperationProcessor.java#L392-L403
elki-project/elki
addons/uncertain/src/main/java/de/lmu/ifi/dbs/elki/algorithm/clustering/uncertain/RepresentativeUncertainClustering.java
RepresentativeUncertainClustering.computeConfidence
private double computeConfidence(int support, int samples) { """ Estimate the confidence probability of a clustering. @param support Number of supporting samples @param samples Total samples @return Probability """ final double z = NormalDistribution.standardNormalQuantile(alpha); final double epr...
java
private double computeConfidence(int support, int samples) { final double z = NormalDistribution.standardNormalQuantile(alpha); final double eprob = support / (double) samples; return Math.max(0., eprob - z * FastMath.sqrt((eprob * (1 - eprob)) / samples)); }
[ "private", "double", "computeConfidence", "(", "int", "support", ",", "int", "samples", ")", "{", "final", "double", "z", "=", "NormalDistribution", ".", "standardNormalQuantile", "(", "alpha", ")", ";", "final", "double", "eprob", "=", "support", "/", "(", ...
Estimate the confidence probability of a clustering. @param support Number of supporting samples @param samples Total samples @return Probability
[ "Estimate", "the", "confidence", "probability", "of", "a", "clustering", "." ]
train
https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/addons/uncertain/src/main/java/de/lmu/ifi/dbs/elki/algorithm/clustering/uncertain/RepresentativeUncertainClustering.java#L294-L298
ppicas/custom-typeface
library/src/main/java/cat/ppicas/customtypeface/CustomTypeface.java
CustomTypeface.applyTypeface
public void applyTypeface(View view, AttributeSet attrs) { """ Apply a custom {@literal Typeface} if it has a {@code customTypeface} attribute. This method will search for a {@code customTypeface} attribute looking in the following places: <ul> <li>Attributes of the tag defined in the layout</li> <li>Attrib...
java
public void applyTypeface(View view, AttributeSet attrs) { if (!(view instanceof TextView) || view.getContext() == null) { return; } TextView textView = (TextView) view; Resources.Theme theme = view.getContext().getTheme(); List<Integer> defStyleAttrs = getHierarchyD...
[ "public", "void", "applyTypeface", "(", "View", "view", ",", "AttributeSet", "attrs", ")", "{", "if", "(", "!", "(", "view", "instanceof", "TextView", ")", "||", "view", ".", "getContext", "(", ")", "==", "null", ")", "{", "return", ";", "}", "TextView...
Apply a custom {@literal Typeface} if it has a {@code customTypeface} attribute. This method will search for a {@code customTypeface} attribute looking in the following places: <ul> <li>Attributes of the tag defined in the layout</li> <li>Attributes of the style applied to the tag</li> <li>Attributes of the default st...
[ "Apply", "a", "custom", "{", "@literal", "Typeface", "}", "if", "it", "has", "a", "{", "@code", "customTypeface", "}", "attribute", ".", "This", "method", "will", "search", "for", "a", "{", "@code", "customTypeface", "}", "attribute", "looking", "in", "the...
train
https://github.com/ppicas/custom-typeface/blob/3a2a68cc8584a72076c545a8b7c9f741f6002241/library/src/main/java/cat/ppicas/customtypeface/CustomTypeface.java#L288-L302
deeplearning4j/deeplearning4j
datavec/datavec-spark/src/main/java/org/datavec/spark/transform/Normalization.java
Normalization.minMaxColumns
public static List<Row> minMaxColumns(DataRowsFacade data, String... columns) { """ Returns the min and max of the given columns. The list returned is a list of size 2 where each row @param data the data to get the max for @param columns the columns to get the @return """ return aggregate(data, col...
java
public static List<Row> minMaxColumns(DataRowsFacade data, String... columns) { return aggregate(data, columns, new String[] {"min", "max"}); }
[ "public", "static", "List", "<", "Row", ">", "minMaxColumns", "(", "DataRowsFacade", "data", ",", "String", "...", "columns", ")", "{", "return", "aggregate", "(", "data", ",", "columns", ",", "new", "String", "[", "]", "{", "\"min\"", ",", "\"max\"", "}...
Returns the min and max of the given columns. The list returned is a list of size 2 where each row @param data the data to get the max for @param columns the columns to get the @return
[ "Returns", "the", "min", "and", "max", "of", "the", "given", "columns", ".", "The", "list", "returned", "is", "a", "list", "of", "size", "2", "where", "each", "row" ]
train
https://github.com/deeplearning4j/deeplearning4j/blob/effce52f2afd7eeb53c5bcca699fcd90bd06822f/datavec/datavec-spark/src/main/java/org/datavec/spark/transform/Normalization.java#L213-L215
google/error-prone-javac
src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/HtmlDocletWriter.java
HtmlDocletWriter.getAllClassesLinkScript
public Content getAllClassesLinkScript(String id) { """ Get the script to show or hide the All classes link. @param id id of the element to show or hide @return a content tree for the script """ HtmlTree script = HtmlTree.SCRIPT(); String scriptCode = "<!--\n" + " allClasse...
java
public Content getAllClassesLinkScript(String id) { HtmlTree script = HtmlTree.SCRIPT(); String scriptCode = "<!--\n" + " allClassesLink = document.getElementById(\"" + id + "\");\n" + " if(window==top) {\n" + " allClassesLink.style.display = \"block\...
[ "public", "Content", "getAllClassesLinkScript", "(", "String", "id", ")", "{", "HtmlTree", "script", "=", "HtmlTree", ".", "SCRIPT", "(", ")", ";", "String", "scriptCode", "=", "\"<!--\\n\"", "+", "\" allClassesLink = document.getElementById(\\\"\"", "+", "id", "+"...
Get the script to show or hide the All classes link. @param id id of the element to show or hide @return a content tree for the script
[ "Get", "the", "script", "to", "show", "or", "hide", "the", "All", "classes", "link", "." ]
train
https://github.com/google/error-prone-javac/blob/a53d069bbdb2c60232ed3811c19b65e41c3e60e0/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/HtmlDocletWriter.java#L258-L276
pgjdbc/pgjdbc
pgjdbc/src/main/java/org/postgresql/jdbc/EscapedFunctions2.java
EscapedFunctions2.sqllcase
public static void sqllcase(StringBuilder buf, List<? extends CharSequence> parsedArgs) throws SQLException { """ lcase to lower translation @param buf The buffer to append into @param parsedArgs arguments @throws SQLException if something wrong happens """ singleArgumentFunctionCall(buf, "lower(", "l...
java
public static void sqllcase(StringBuilder buf, List<? extends CharSequence> parsedArgs) throws SQLException { singleArgumentFunctionCall(buf, "lower(", "lcase", parsedArgs); }
[ "public", "static", "void", "sqllcase", "(", "StringBuilder", "buf", ",", "List", "<", "?", "extends", "CharSequence", ">", "parsedArgs", ")", "throws", "SQLException", "{", "singleArgumentFunctionCall", "(", "buf", ",", "\"lower(\"", ",", "\"lcase\"", ",", "par...
lcase to lower translation @param buf The buffer to append into @param parsedArgs arguments @throws SQLException if something wrong happens
[ "lcase", "to", "lower", "translation" ]
train
https://github.com/pgjdbc/pgjdbc/blob/95ba7b261e39754674c5817695ae5ebf9a341fae/pgjdbc/src/main/java/org/postgresql/jdbc/EscapedFunctions2.java#L183-L185
aws/aws-sdk-java
aws-java-sdk-resourcegroups/src/main/java/com/amazonaws/services/resourcegroups/model/TagRequest.java
TagRequest.withTags
public TagRequest withTags(java.util.Map<String, String> tags) { """ <p> The tags to add to the specified resource. A tag is a string-to-string map of key-value pairs. Tag keys can have a maximum character length of 128 characters, and tag values can have a maximum length of 256 characters. </p> @param tags ...
java
public TagRequest withTags(java.util.Map<String, String> tags) { setTags(tags); return this; }
[ "public", "TagRequest", "withTags", "(", "java", ".", "util", ".", "Map", "<", "String", ",", "String", ">", "tags", ")", "{", "setTags", "(", "tags", ")", ";", "return", "this", ";", "}" ]
<p> The tags to add to the specified resource. A tag is a string-to-string map of key-value pairs. Tag keys can have a maximum character length of 128 characters, and tag values can have a maximum length of 256 characters. </p> @param tags The tags to add to the specified resource. A tag is a string-to-string map of k...
[ "<p", ">", "The", "tags", "to", "add", "to", "the", "specified", "resource", ".", "A", "tag", "is", "a", "string", "-", "to", "-", "string", "map", "of", "key", "-", "value", "pairs", ".", "Tag", "keys", "can", "have", "a", "maximum", "character", ...
train
https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-resourcegroups/src/main/java/com/amazonaws/services/resourcegroups/model/TagRequest.java#L126-L129
cdk/cdk
tool/formula/src/main/java/org/openscience/cdk/tools/manipulator/MolecularFormulaManipulator.java
MolecularFormulaManipulator.removeElement
public static IMolecularFormula removeElement(IMolecularFormula formula, IElement element) { """ Removes all isotopes from a given element in the MolecularFormula. @param formula IMolecularFormula molecularFormula @param element The IElement of the IIsotopes to be removed @return The molecular...
java
public static IMolecularFormula removeElement(IMolecularFormula formula, IElement element) { for (IIsotope isotope : getIsotopes(formula, element)) { formula.removeIsotope(isotope); } return formula; }
[ "public", "static", "IMolecularFormula", "removeElement", "(", "IMolecularFormula", "formula", ",", "IElement", "element", ")", "{", "for", "(", "IIsotope", "isotope", ":", "getIsotopes", "(", "formula", ",", "element", ")", ")", "{", "formula", ".", "removeIsot...
Removes all isotopes from a given element in the MolecularFormula. @param formula IMolecularFormula molecularFormula @param element The IElement of the IIsotopes to be removed @return The molecularFormula with the isotopes removed
[ "Removes", "all", "isotopes", "from", "a", "given", "element", "in", "the", "MolecularFormula", "." ]
train
https://github.com/cdk/cdk/blob/c3d0f16502bf08df50365fee392e11d7c9856657/tool/formula/src/main/java/org/openscience/cdk/tools/manipulator/MolecularFormulaManipulator.java#L222-L227
js-lib-com/commons
src/main/java/js/util/Strings.java
Strings.indexOneOf
public static int indexOneOf(CharSequence string, char... chars) { """ Search string index of the first character from a series. Traverse <code>string</code> and compare with character from <code>chars</code> series one by one, in sequence. If found return string index; if reach the end of the string return -1. ...
java
public static int indexOneOf(CharSequence string, char... chars) { for(int i = 0; i < string.length(); ++i) { for(int j = 0; j < chars.length; ++j) { if(string.charAt(i) == chars[j]) { return i; } } } return -1; }
[ "public", "static", "int", "indexOneOf", "(", "CharSequence", "string", ",", "char", "...", "chars", ")", "{", "for", "(", "int", "i", "=", "0", ";", "i", "<", "string", ".", "length", "(", ")", ";", "++", "i", ")", "{", "for", "(", "int", "j", ...
Search string index of the first character from a series. Traverse <code>string</code> and compare with character from <code>chars</code> series one by one, in sequence. If found return string index; if reach the end of the string return -1. @param string string builder to search on, @param chars characters series. @r...
[ "Search", "string", "index", "of", "the", "first", "character", "from", "a", "series", ".", "Traverse", "<code", ">", "string<", "/", "code", ">", "and", "compare", "with", "character", "from", "<code", ">", "chars<", "/", "code", ">", "series", "one", "...
train
https://github.com/js-lib-com/commons/blob/f8c64482142b163487745da74feb106f0765c16b/src/main/java/js/util/Strings.java#L1412-L1422
cesarferreira/AndroidQuickUtils
library/src/main/java/quickutils/core/categories/sdcard.java
sdcard.copyFile
public static void copyFile(FileInputStream fromFile, FileOutputStream toFile) throws IOException { """ Creates the specified <code>toFile</code> as a byte for byte copy of the <code>fromFile</code>. If <code>toFile</code> already exists, then it will be replaced with a copy of <code>fromFile</code>. The name an...
java
public static void copyFile(FileInputStream fromFile, FileOutputStream toFile) throws IOException { FileChannel fromChannel = null; FileChannel toChannel = null; try { fromChannel = fromFile.getChannel(); toChannel = toFile.getChannel(); fromChannel.tran...
[ "public", "static", "void", "copyFile", "(", "FileInputStream", "fromFile", ",", "FileOutputStream", "toFile", ")", "throws", "IOException", "{", "FileChannel", "fromChannel", "=", "null", ";", "FileChannel", "toChannel", "=", "null", ";", "try", "{", "fromChannel...
Creates the specified <code>toFile</code> as a byte for byte copy of the <code>fromFile</code>. If <code>toFile</code> already exists, then it will be replaced with a copy of <code>fromFile</code>. The name and path of <code>toFile</code> will be that of <code>toFile</code>.<br/> <br/> <i> Note: <code>fromFile</code> a...
[ "Creates", "the", "specified", "<code", ">", "toFile<", "/", "code", ">", "as", "a", "byte", "for", "byte", "copy", "of", "the", "<code", ">", "fromFile<", "/", "code", ">", ".", "If", "<code", ">", "toFile<", "/", "code", ">", "already", "exists", "...
train
https://github.com/cesarferreira/AndroidQuickUtils/blob/73a91daedbb9f7be7986ea786fbc441c9e5a881c/library/src/main/java/quickutils/core/categories/sdcard.java#L131-L149
qos-ch/slf4j
slf4j-api/src/main/java/org/slf4j/MDC.java
MDC.putCloseable
public static MDCCloseable putCloseable(String key, String val) throws IllegalArgumentException { """ Put a diagnostic context value (the <code>val</code> parameter) as identified with the <code>key</code> parameter into the current thread's diagnostic context map. The <code>key</code> parameter cannot be null. ...
java
public static MDCCloseable putCloseable(String key, String val) throws IllegalArgumentException { put(key, val); return new MDCCloseable(key); }
[ "public", "static", "MDCCloseable", "putCloseable", "(", "String", "key", ",", "String", "val", ")", "throws", "IllegalArgumentException", "{", "put", "(", "key", ",", "val", ")", ";", "return", "new", "MDCCloseable", "(", "key", ")", ";", "}" ]
Put a diagnostic context value (the <code>val</code> parameter) as identified with the <code>key</code> parameter into the current thread's diagnostic context map. The <code>key</code> parameter cannot be null. The <code>val</code> parameter can be null only if the underlying implementation supports it. <p> This metho...
[ "Put", "a", "diagnostic", "context", "value", "(", "the", "<code", ">", "val<", "/", "code", ">", "parameter", ")", "as", "identified", "with", "the", "<code", ">", "key<", "/", "code", ">", "parameter", "into", "the", "current", "thread", "s", "diagnost...
train
https://github.com/qos-ch/slf4j/blob/905443f39fadd88a8dd2c467e44affd8cb072a4d/slf4j-api/src/main/java/org/slf4j/MDC.java#L152-L155
junit-team/junit4
src/main/java/org/junit/runners/ParentRunner.java
ParentRunner.runLeaf
protected final void runLeaf(Statement statement, Description description, RunNotifier notifier) { """ Runs a {@link Statement} that represents a leaf (aka atomic) test. """ EachTestNotifier eachNotifier = new EachTestNotifier(notifier, description); eachNotifier.fireTestStarted(); ...
java
protected final void runLeaf(Statement statement, Description description, RunNotifier notifier) { EachTestNotifier eachNotifier = new EachTestNotifier(notifier, description); eachNotifier.fireTestStarted(); try { statement.evaluate(); } catch (AssumptionViolatedE...
[ "protected", "final", "void", "runLeaf", "(", "Statement", "statement", ",", "Description", "description", ",", "RunNotifier", "notifier", ")", "{", "EachTestNotifier", "eachNotifier", "=", "new", "EachTestNotifier", "(", "notifier", ",", "description", ")", ";", ...
Runs a {@link Statement} that represents a leaf (aka atomic) test.
[ "Runs", "a", "{" ]
train
https://github.com/junit-team/junit4/blob/d9861ecdb6e487f6c352437ee823879aca3b81d4/src/main/java/org/junit/runners/ParentRunner.java#L360-L373
Stratio/deep-spark
deep-mongodb/src/main/java/com/stratio/deep/mongodb/extractor/MongoNativeExtractor.java
MongoNativeExtractor.calculateSplits
private DeepPartition[] calculateSplits(DBCollection collection) { """ Calculate splits. @param collection the collection @return the deep partition [ ] """ BasicDBList splitData = getSplitData(collection); List<ServerAddress> serverAddressList = collection.getDB().getMongo().getServerAddr...
java
private DeepPartition[] calculateSplits(DBCollection collection) { BasicDBList splitData = getSplitData(collection); List<ServerAddress> serverAddressList = collection.getDB().getMongo().getServerAddressList(); if (splitData == null) { Pair<BasicDBList, List<ServerAddress>> pair = ...
[ "private", "DeepPartition", "[", "]", "calculateSplits", "(", "DBCollection", "collection", ")", "{", "BasicDBList", "splitData", "=", "getSplitData", "(", "collection", ")", ";", "List", "<", "ServerAddress", ">", "serverAddressList", "=", "collection", ".", "get...
Calculate splits. @param collection the collection @return the deep partition [ ]
[ "Calculate", "splits", "." ]
train
https://github.com/Stratio/deep-spark/blob/b9621c9b7a6d996f80fce1d073d696a157bed095/deep-mongodb/src/main/java/com/stratio/deep/mongodb/extractor/MongoNativeExtractor.java#L189-L229
Azure/azure-sdk-for-java
automation/resource-manager/v2015_10_31/src/main/java/com/microsoft/azure/management/automation/v2015_10_31/implementation/RunbooksInner.java
RunbooksInner.createOrUpdate
public RunbookInner createOrUpdate(String resourceGroupName, String automationAccountName, String runbookName, RunbookCreateOrUpdateParameters parameters) { """ Create the runbook identified by runbook name. @param resourceGroupName Name of an Azure Resource group. @param automationAccountName The name of the ...
java
public RunbookInner createOrUpdate(String resourceGroupName, String automationAccountName, String runbookName, RunbookCreateOrUpdateParameters parameters) { return createOrUpdateWithServiceResponseAsync(resourceGroupName, automationAccountName, runbookName, parameters).toBlocking().single().body(); }
[ "public", "RunbookInner", "createOrUpdate", "(", "String", "resourceGroupName", ",", "String", "automationAccountName", ",", "String", "runbookName", ",", "RunbookCreateOrUpdateParameters", "parameters", ")", "{", "return", "createOrUpdateWithServiceResponseAsync", "(", "reso...
Create the runbook identified by runbook name. @param resourceGroupName Name of an Azure Resource group. @param automationAccountName The name of the automation account. @param runbookName The runbook name. @param parameters The create or update parameters for runbook. Provide either content link for a published runbo...
[ "Create", "the", "runbook", "identified", "by", "runbook", "name", "." ]
train
https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/automation/resource-manager/v2015_10_31/src/main/java/com/microsoft/azure/management/automation/v2015_10_31/implementation/RunbooksInner.java#L292-L294
apache/spark
sql/hive-thriftserver/src/main/java/org/apache/hive/service/ServiceOperations.java
ServiceOperations.deploy
public static void deploy(Service service, HiveConf configuration) { """ Initialize then start a service. The service state is checked <i>before</i> the operation begins. This process is <i>not</i> thread safe. @param service a service that must be in the state {@link Service.STATE#NOTINITED} @param configu...
java
public static void deploy(Service service, HiveConf configuration) { init(service, configuration); start(service); }
[ "public", "static", "void", "deploy", "(", "Service", "service", ",", "HiveConf", "configuration", ")", "{", "init", "(", "service", ",", "configuration", ")", ";", "start", "(", "service", ")", ";", "}" ]
Initialize then start a service. The service state is checked <i>before</i> the operation begins. This process is <i>not</i> thread safe. @param service a service that must be in the state {@link Service.STATE#NOTINITED} @param configuration the configuration to initialize the service with @throws RuntimeException on ...
[ "Initialize", "then", "start", "a", "service", "." ]
train
https://github.com/apache/spark/blob/25ee0474f47d9c30d6f553a7892d9549f91071cf/sql/hive-thriftserver/src/main/java/org/apache/hive/service/ServiceOperations.java#L98-L101
vanilladb/vanillacore
src/main/java/org/vanilladb/core/storage/buffer/Buffer.java
Buffer.assignToNew
void assignToNew(String fileName, PageFormatter fmtr) { """ Initializes the buffer's page according to the specified formatter, and appends the page to the specified file. If the buffer was dirty, then the contents of the previous page are first written to disk. @param filename the name of the file @param f...
java
void assignToNew(String fileName, PageFormatter fmtr) { internalLock.writeLock().lock(); try { flush(); fmtr.format(this); blk = contents.append(fileName); pins = 0; isNew = true; lastLsn = LogSeqNum.DEFAULT_VALUE; } finally { internalLock.writeLock().unlock(); } }
[ "void", "assignToNew", "(", "String", "fileName", ",", "PageFormatter", "fmtr", ")", "{", "internalLock", ".", "writeLock", "(", ")", ".", "lock", "(", ")", ";", "try", "{", "flush", "(", ")", ";", "fmtr", ".", "format", "(", "this", ")", ";", "blk",...
Initializes the buffer's page according to the specified formatter, and appends the page to the specified file. If the buffer was dirty, then the contents of the previous page are first written to disk. @param filename the name of the file @param fmtr a page formatter, used to initialize the page
[ "Initializes", "the", "buffer", "s", "page", "according", "to", "the", "specified", "formatter", "and", "appends", "the", "page", "to", "the", "specified", "file", ".", "If", "the", "buffer", "was", "dirty", "then", "the", "contents", "of", "the", "previous"...
train
https://github.com/vanilladb/vanillacore/blob/d9a34e876b1b83226036d1fa982a614bbef59bd1/src/main/java/org/vanilladb/core/storage/buffer/Buffer.java#L309-L321
blinkfox/zealot
src/main/java/com/blinkfox/zealot/core/ZealotKhala.java
ZealotKhala.andBetween
public ZealotKhala andBetween(String field, Object startValue, Object endValue) { """ 生成带" AND "前缀的between区间查询的SQL片段(当某一个值为null时,会是大于等于或小于等于的情形). @param field 数据库字段 @param startValue 开始值 @param endValue 结束值 @return ZealotKhala实例 """ return this.doBetween(ZealotConst.AND_PREFIX, field, startValue, e...
java
public ZealotKhala andBetween(String field, Object startValue, Object endValue) { return this.doBetween(ZealotConst.AND_PREFIX, field, startValue, endValue, true); }
[ "public", "ZealotKhala", "andBetween", "(", "String", "field", ",", "Object", "startValue", ",", "Object", "endValue", ")", "{", "return", "this", ".", "doBetween", "(", "ZealotConst", ".", "AND_PREFIX", ",", "field", ",", "startValue", ",", "endValue", ",", ...
生成带" AND "前缀的between区间查询的SQL片段(当某一个值为null时,会是大于等于或小于等于的情形). @param field 数据库字段 @param startValue 开始值 @param endValue 结束值 @return ZealotKhala实例
[ "生成带", "AND", "前缀的between区间查询的SQL片段", "(", "当某一个值为null时,会是大于等于或小于等于的情形", ")", "." ]
train
https://github.com/blinkfox/zealot/blob/21b00fa3e4ed42188eef3116d494e112e7a4194c/src/main/java/com/blinkfox/zealot/core/ZealotKhala.java#L1218-L1220
khuxtable/seaglass
src/main/java/com/seaglasslookandfeel/painter/TabbedPaneTabCloseButtonPainter.java
TabbedPaneTabCloseButtonPainter.drawBorder
private void drawBorder(Graphics2D g, int width, int height, Color color, float size) { """ Draw a border around the graphic. @param g the Graphic context. @param width the width of the border. @param height the height of the border. @param color the color of the border. @param size the spread of t...
java
private void drawBorder(Graphics2D g, int width, int height, Color color, float size) { int max = (int) (Math.min((height - 2) * size, height / 2.0f) + 0.5); int alphaDelta = color.getAlpha() / max; for (int i = 0; i < max; i++) { Shape s = shapeGenerator.createRoundRe...
[ "private", "void", "drawBorder", "(", "Graphics2D", "g", ",", "int", "width", ",", "int", "height", ",", "Color", "color", ",", "float", "size", ")", "{", "int", "max", "=", "(", "int", ")", "(", "Math", ".", "min", "(", "(", "height", "-", "2", ...
Draw a border around the graphic. @param g the Graphic context. @param width the width of the border. @param height the height of the border. @param color the color of the border. @param size the spread of the border from outside in, expressed as a percentage of the height.
[ "Draw", "a", "border", "around", "the", "graphic", "." ]
train
https://github.com/khuxtable/seaglass/blob/f25ecba622923d7b29b64cb7d6068dd8005989b3/src/main/java/com/seaglasslookandfeel/painter/TabbedPaneTabCloseButtonPainter.java#L120-L131
moparisthebest/beehive
beehive-controls/src/main/java/org/apache/beehive/controls/runtime/generator/apt/TwoPhaseAnnotationProcessor.java
TwoPhaseAnnotationProcessor.printError
public void printError( Declaration d, String id, Object... args ) { """ Report an error detected during the "check" phase. The presence of errors will suppress execution of the "generate" phase. """ addError( d, id, args ); }
java
public void printError( Declaration d, String id, Object... args ) { addError( d, id, args ); }
[ "public", "void", "printError", "(", "Declaration", "d", ",", "String", "id", ",", "Object", "...", "args", ")", "{", "addError", "(", "d", ",", "id", ",", "args", ")", ";", "}" ]
Report an error detected during the "check" phase. The presence of errors will suppress execution of the "generate" phase.
[ "Report", "an", "error", "detected", "during", "the", "check", "phase", ".", "The", "presence", "of", "errors", "will", "suppress", "execution", "of", "the", "generate", "phase", "." ]
train
https://github.com/moparisthebest/beehive/blob/4246a0cc40ce3c05f1a02c2da2653ac622703d77/beehive-controls/src/main/java/org/apache/beehive/controls/runtime/generator/apt/TwoPhaseAnnotationProcessor.java#L157-L160
rometools/rome
rome/src/main/java/com/rometools/rome/io/SyndFeedOutput.java
SyndFeedOutput.outputString
public String outputString(final SyndFeed feed, final boolean prettyPrint) throws FeedException { """ Creates a String with the XML representation for the given SyndFeedImpl. <p> If the feed encoding is not NULL, it will be used in the XML prolog encoding attribute. It is the responsibility of the developer to ...
java
public String outputString(final SyndFeed feed, final boolean prettyPrint) throws FeedException { return feedOutput.outputString(feed.createWireFeed(), prettyPrint); }
[ "public", "String", "outputString", "(", "final", "SyndFeed", "feed", ",", "final", "boolean", "prettyPrint", ")", "throws", "FeedException", "{", "return", "feedOutput", ".", "outputString", "(", "feed", ".", "createWireFeed", "(", ")", ",", "prettyPrint", ")",...
Creates a String with the XML representation for the given SyndFeedImpl. <p> If the feed encoding is not NULL, it will be used in the XML prolog encoding attribute. It is the responsibility of the developer to ensure that if the String is written to a character stream the stream charset is the same as the feed encoding...
[ "Creates", "a", "String", "with", "the", "XML", "representation", "for", "the", "given", "SyndFeedImpl", ".", "<p", ">", "If", "the", "feed", "encoding", "is", "not", "NULL", "it", "will", "be", "used", "in", "the", "XML", "prolog", "encoding", "attribute"...
train
https://github.com/rometools/rome/blob/5fcf0b1a9a6cdedbe253a45ad9468c54a0f97010/rome/src/main/java/com/rometools/rome/io/SyndFeedOutput.java#L70-L72
versionone/VersionOne.SDK.Java.ObjectModel
src/main/java/com/versionone/om/V1InstanceGetter.java
V1InstanceGetter.baseAssets
public Collection<BaseAsset> baseAssets(BaseAssetFilter filter) { """ Get assets filtered by the criteria specified in the passed in filter. @param filter Limit the items returned. If null, then all items returned. @return Collection of items as specified in the filter. """ return get(BaseAsset.cla...
java
public Collection<BaseAsset> baseAssets(BaseAssetFilter filter) { return get(BaseAsset.class, (filter != null) ? filter : new BaseAssetFilter()); }
[ "public", "Collection", "<", "BaseAsset", ">", "baseAssets", "(", "BaseAssetFilter", "filter", ")", "{", "return", "get", "(", "BaseAsset", ".", "class", ",", "(", "filter", "!=", "null", ")", "?", "filter", ":", "new", "BaseAssetFilter", "(", ")", ")", ...
Get assets filtered by the criteria specified in the passed in filter. @param filter Limit the items returned. If null, then all items returned. @return Collection of items as specified in the filter.
[ "Get", "assets", "filtered", "by", "the", "criteria", "specified", "in", "the", "passed", "in", "filter", "." ]
train
https://github.com/versionone/VersionOne.SDK.Java.ObjectModel/blob/59d35b67c849299631bca45ee94143237eb2ae1a/src/main/java/com/versionone/om/V1InstanceGetter.java#L98-L100
spring-projects/spring-security-oauth
spring-security-oauth/src/main/java/org/springframework/security/oauth/common/signature/PlainTextSignatureMethod.java
PlainTextSignatureMethod.verify
public void verify(String signatureBaseString, String signature) throws InvalidSignatureException { """ Validates that the signature is the same as the secret. @param signatureBaseString The signature base string (unimportant, ignored). @param signature The signature. @throws InvalidSignatureExcepti...
java
public void verify(String signatureBaseString, String signature) throws InvalidSignatureException { if (this.encoder != null) { if (!this.encoder.isPasswordValid(this.secret, signature, this.salt)) { throw new InvalidSignatureException("Invalid signature for signature method " + getName()); } ...
[ "public", "void", "verify", "(", "String", "signatureBaseString", ",", "String", "signature", ")", "throws", "InvalidSignatureException", "{", "if", "(", "this", ".", "encoder", "!=", "null", ")", "{", "if", "(", "!", "this", ".", "encoder", ".", "isPassword...
Validates that the signature is the same as the secret. @param signatureBaseString The signature base string (unimportant, ignored). @param signature The signature. @throws InvalidSignatureException If the signature is not the same as the secret.
[ "Validates", "that", "the", "signature", "is", "the", "same", "as", "the", "secret", "." ]
train
https://github.com/spring-projects/spring-security-oauth/blob/bbae0027eceb2c74a21ac26bbc86142dc732ffbe/spring-security-oauth/src/main/java/org/springframework/security/oauth/common/signature/PlainTextSignatureMethod.java#L85-L94
pro-grade/pro-grade
src/main/java/net/sourceforge/prograde/policyparser/Parser.java
Parser.parsePrincipal
private ParsedPrincipal parsePrincipal() throws Exception { """ Private method for parsing principal part of policy entry. @return parsed principal part of policy entry @throws throws Exception when any problem occurred during parsing principal """ lookahead = st.nextToken(); switch (lookah...
java
private ParsedPrincipal parsePrincipal() throws Exception { lookahead = st.nextToken(); switch (lookahead) { case '*': lookahead = st.nextToken(); if (lookahead == '*') { return new ParsedPrincipal(null, null); } else { ...
[ "private", "ParsedPrincipal", "parsePrincipal", "(", ")", "throws", "Exception", "{", "lookahead", "=", "st", ".", "nextToken", "(", ")", ";", "switch", "(", "lookahead", ")", "{", "case", "'", "'", ":", "lookahead", "=", "st", ".", "nextToken", "(", ")"...
Private method for parsing principal part of policy entry. @return parsed principal part of policy entry @throws throws Exception when any problem occurred during parsing principal
[ "Private", "method", "for", "parsing", "principal", "part", "of", "policy", "entry", "." ]
train
https://github.com/pro-grade/pro-grade/blob/371b0d1349c37bd048a06206d3fa1b0c3c1cd9ab/src/main/java/net/sourceforge/prograde/policyparser/Parser.java#L281-L307
aws/aws-sdk-java
aws-java-sdk-core/src/main/java/com/amazonaws/AmazonWebServiceRequest.java
AmazonWebServiceRequest.putCustomRequestHeader
public String putCustomRequestHeader(String name, String value) { """ Put a new custom header to the map of custom header names to custom header values, and return the previous value if the header has already been set in this map. <p> Any custom headers that are defined are used in the HTTP request to the AWS s...
java
public String putCustomRequestHeader(String name, String value) { if (customRequestHeaders == null) { customRequestHeaders = new HashMap<String, String>(); } return customRequestHeaders.put(name, value); }
[ "public", "String", "putCustomRequestHeader", "(", "String", "name", ",", "String", "value", ")", "{", "if", "(", "customRequestHeaders", "==", "null", ")", "{", "customRequestHeaders", "=", "new", "HashMap", "<", "String", ",", "String", ">", "(", ")", ";",...
Put a new custom header to the map of custom header names to custom header values, and return the previous value if the header has already been set in this map. <p> Any custom headers that are defined are used in the HTTP request to the AWS service. These headers will be silently ignored in the event that AWS does not ...
[ "Put", "a", "new", "custom", "header", "to", "the", "map", "of", "custom", "header", "names", "to", "custom", "header", "values", "and", "return", "the", "previous", "value", "if", "the", "header", "has", "already", "been", "set", "in", "this", "map", "....
train
https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-core/src/main/java/com/amazonaws/AmazonWebServiceRequest.java#L251-L256
PuyallupFoursquare/ccb-api-client-java
src/main/java/com/p4square/ccbapi/model/GetIndividualProfilesRequest.java
GetIndividualProfilesRequest.withLoginPassword
public GetIndividualProfilesRequest withLoginPassword(final String login, final char[] password) { """ Request the IndividualProfile for the given login and password. This option is mutually exclusive with {@link #withIndividualId(int)} and {@link #withMICR(String, String)}. @param login The individual's lo...
java
public GetIndividualProfilesRequest withLoginPassword(final String login, final char[] password) { this.login = login; this.password = password; this.id = 0; this.accountNumber = this.routingNumber = null; return this; }
[ "public", "GetIndividualProfilesRequest", "withLoginPassword", "(", "final", "String", "login", ",", "final", "char", "[", "]", "password", ")", "{", "this", ".", "login", "=", "login", ";", "this", ".", "password", "=", "password", ";", "this", ".", "id", ...
Request the IndividualProfile for the given login and password. This option is mutually exclusive with {@link #withIndividualId(int)} and {@link #withMICR(String, String)}. @param login The individual's login. @param password The individual's password. @return this.
[ "Request", "the", "IndividualProfile", "for", "the", "given", "login", "and", "password", "." ]
train
https://github.com/PuyallupFoursquare/ccb-api-client-java/blob/54a7a3184dc565fe513aa520e1344b2303ea6834/src/main/java/com/p4square/ccbapi/model/GetIndividualProfilesRequest.java#L66-L72
fcrepo3/fcrepo
fcrepo-client/fcrepo-client-admin/src/main/java/org/fcrepo/client/utility/validate/remote/RemoteObjectSource.java
RemoteObjectSource.getContentModelInfo
@Override public ContentModelInfo getContentModelInfo(String pid) throws ObjectSourceException, InvalidContentModelException { """ A content model must exist as an object. If must have a (@link DS_COMPOSITE_MODEL} datastream. """ try { ObjectInfo object = getValidationObjec...
java
@Override public ContentModelInfo getContentModelInfo(String pid) throws ObjectSourceException, InvalidContentModelException { try { ObjectInfo object = getValidationObject(pid); if (object == null) { return null; } DatastreamInfo ...
[ "@", "Override", "public", "ContentModelInfo", "getContentModelInfo", "(", "String", "pid", ")", "throws", "ObjectSourceException", ",", "InvalidContentModelException", "{", "try", "{", "ObjectInfo", "object", "=", "getValidationObject", "(", "pid", ")", ";", "if", ...
A content model must exist as an object. If must have a (@link DS_COMPOSITE_MODEL} datastream.
[ "A", "content", "model", "must", "exist", "as", "an", "object", ".", "If", "must", "have", "a", "(" ]
train
https://github.com/fcrepo3/fcrepo/blob/37df51b9b857fd12c6ab8269820d406c3c4ad774/fcrepo-client/fcrepo-client-admin/src/main/java/org/fcrepo/client/utility/validate/remote/RemoteObjectSource.java#L108-L149
Alluxio/alluxio
core/server/worker/src/main/java/alluxio/worker/file/FileDataManager.java
FileDataManager.needPersistence
public boolean needPersistence(long fileId) { """ Checks if the given file needs persistence. @param fileId the file id @return false if the file is being persisted, or is already persisted; otherwise true """ if (isFilePersisting(fileId) || isFilePersisted(fileId)) { return false; } try...
java
public boolean needPersistence(long fileId) { if (isFilePersisting(fileId) || isFilePersisted(fileId)) { return false; } try { String ufsFingerprint = ufsFingerprint(fileId); if (ufsFingerprint != null) { // mark as persisted addPersistedFile(fileId, ufsFingerprint); ...
[ "public", "boolean", "needPersistence", "(", "long", "fileId", ")", "{", "if", "(", "isFilePersisting", "(", "fileId", ")", "||", "isFilePersisted", "(", "fileId", ")", ")", "{", "return", "false", ";", "}", "try", "{", "String", "ufsFingerprint", "=", "uf...
Checks if the given file needs persistence. @param fileId the file id @return false if the file is being persisted, or is already persisted; otherwise true
[ "Checks", "if", "the", "given", "file", "needs", "persistence", "." ]
train
https://github.com/Alluxio/alluxio/blob/af38cf3ab44613355b18217a3a4d961f8fec3a10/core/server/worker/src/main/java/alluxio/worker/file/FileDataManager.java#L144-L162
mongodb/stitch-android-sdk
core/services/mongodb-remote/src/main/java/com/mongodb/stitch/core/services/mongodb/remote/sync/internal/ChangeEvents.java
ChangeEvents.changeEventForLocalDelete
static ChangeEvent<BsonDocument> changeEventForLocalDelete( final MongoNamespace namespace, final BsonValue documentId, final boolean writePending ) { """ Generates a change event for a local deletion of a document in the given namespace referring to the given document _id. @param namespace...
java
static ChangeEvent<BsonDocument> changeEventForLocalDelete( final MongoNamespace namespace, final BsonValue documentId, final boolean writePending ) { return new ChangeEvent<>( new BsonDocument(), OperationType.DELETE, null, namespace, new BsonDocument("_i...
[ "static", "ChangeEvent", "<", "BsonDocument", ">", "changeEventForLocalDelete", "(", "final", "MongoNamespace", "namespace", ",", "final", "BsonValue", "documentId", ",", "final", "boolean", "writePending", ")", "{", "return", "new", "ChangeEvent", "<>", "(", "new",...
Generates a change event for a local deletion of a document in the given namespace referring to the given document _id. @param namespace the namespace where the document was inserted. @param documentId the _id of the document that was updated. @return a change event for a local deletion of a document in the given name...
[ "Generates", "a", "change", "event", "for", "a", "local", "deletion", "of", "a", "document", "in", "the", "given", "namespace", "referring", "to", "the", "given", "document", "_id", "." ]
train
https://github.com/mongodb/stitch-android-sdk/blob/159b9334b1f1a827285544be5ee20cdf7b04e4cc/core/services/mongodb-remote/src/main/java/com/mongodb/stitch/core/services/mongodb/remote/sync/internal/ChangeEvents.java#L118-L131
JM-Lab/utils-elasticsearch
src/main/java/kr/jm/utils/elasticsearch/JMElasticsearchIndex.java
JMElasticsearchIndex.sendData
public IndexResponse sendData(Map<String, ?> source, String index, String type, String id) { """ Send data index response. @param source the source @param index the index @param type the type @param id the id @return the index response """ return indexQuery(buildIndexRequest(s...
java
public IndexResponse sendData(Map<String, ?> source, String index, String type, String id) { return indexQuery(buildIndexRequest(source, index, type, id)); }
[ "public", "IndexResponse", "sendData", "(", "Map", "<", "String", ",", "?", ">", "source", ",", "String", "index", ",", "String", "type", ",", "String", "id", ")", "{", "return", "indexQuery", "(", "buildIndexRequest", "(", "source", ",", "index", ",", "...
Send data index response. @param source the source @param index the index @param type the type @param id the id @return the index response
[ "Send", "data", "index", "response", "." ]
train
https://github.com/JM-Lab/utils-elasticsearch/blob/6ccec90e1e51d65d2af5efbb6d7b9f9bad90e638/src/main/java/kr/jm/utils/elasticsearch/JMElasticsearchIndex.java#L208-L211
phax/ph-oton
ph-oton-html/src/main/java/com/helger/html/hc/html/tabular/HCColGroup.java
HCColGroup.addColumnAt
@Nonnull public final HCColGroup addColumnAt (@Nonnegative final int nIndex, @Nullable final IHCCol <?> aCol) { """ Add a new column. @param nIndex The index where the column should be added @param aCol the column to add @return this """ if (aCol != null) addChildAt (nIndex, aCol); retur...
java
@Nonnull public final HCColGroup addColumnAt (@Nonnegative final int nIndex, @Nullable final IHCCol <?> aCol) { if (aCol != null) addChildAt (nIndex, aCol); return this; }
[ "@", "Nonnull", "public", "final", "HCColGroup", "addColumnAt", "(", "@", "Nonnegative", "final", "int", "nIndex", ",", "@", "Nullable", "final", "IHCCol", "<", "?", ">", "aCol", ")", "{", "if", "(", "aCol", "!=", "null", ")", "addChildAt", "(", "nIndex"...
Add a new column. @param nIndex The index where the column should be added @param aCol the column to add @return this
[ "Add", "a", "new", "column", "." ]
train
https://github.com/phax/ph-oton/blob/f3aaacbbc02a9f3e4f32fe8db8e4adf7b9c1d3ef/ph-oton-html/src/main/java/com/helger/html/hc/html/tabular/HCColGroup.java#L82-L88
revapi/revapi
revapi-java-spi/src/main/java/org/revapi/java/spi/Util.java
Util.firstDotConstellation
private static void firstDotConstellation(int[] dollarPositions, int[] dotPositions, int nestingLevel) { """ This will set the last nestingLevel elements in the dotPositions to the values present in the dollarPositions. The rest will be set to -1. <p>In another words the dotPositions array will contain the rig...
java
private static void firstDotConstellation(int[] dollarPositions, int[] dotPositions, int nestingLevel) { int i = 0; int unassigned = dotPositions.length - nestingLevel; for (; i < unassigned; ++i) { dotPositions[i] = -1; } for (; i < dotPositions.length; ++i) { ...
[ "private", "static", "void", "firstDotConstellation", "(", "int", "[", "]", "dollarPositions", ",", "int", "[", "]", "dotPositions", ",", "int", "nestingLevel", ")", "{", "int", "i", "=", "0", ";", "int", "unassigned", "=", "dotPositions", ".", "length", "...
This will set the last nestingLevel elements in the dotPositions to the values present in the dollarPositions. The rest will be set to -1. <p>In another words the dotPositions array will contain the rightmost dollar positions. @param dollarPositions the positions of the $ in the binary class name @param dotPositions ...
[ "This", "will", "set", "the", "last", "nestingLevel", "elements", "in", "the", "dotPositions", "to", "the", "values", "present", "in", "the", "dollarPositions", ".", "The", "rest", "will", "be", "set", "to", "-", "1", "." ]
train
https://github.com/revapi/revapi/blob/e070b136d977441ab96fdce067a13e7e0423295b/revapi-java-spi/src/main/java/org/revapi/java/spi/Util.java#L1161-L1172
wellner/jcarafe
jcarafe-core/src/main/java/cern/colt/list/AbstractLongList.java
AbstractLongList.addAllOfFromTo
public void addAllOfFromTo(AbstractLongList other, int from, int to) { """ Appends the part of the specified list between <code>from</code> (inclusive) and <code>to</code> (inclusive) to the receiver. @param other the list to be added to the receiver. @param from the index of the first element to be appended (...
java
public void addAllOfFromTo(AbstractLongList other, int from, int to) { beforeInsertAllOfFromTo(size,other,from,to); }
[ "public", "void", "addAllOfFromTo", "(", "AbstractLongList", "other", ",", "int", "from", ",", "int", "to", ")", "{", "beforeInsertAllOfFromTo", "(", "size", ",", "other", ",", "from", ",", "to", ")", ";", "}" ]
Appends the part of the specified list between <code>from</code> (inclusive) and <code>to</code> (inclusive) to the receiver. @param other the list to be added to the receiver. @param from the index of the first element to be appended (inclusive). @param to the index of the last element to be appended (inclusive). @ex...
[ "Appends", "the", "part", "of", "the", "specified", "list", "between", "<code", ">", "from<", "/", "code", ">", "(", "inclusive", ")", "and", "<code", ">", "to<", "/", "code", ">", "(", "inclusive", ")", "to", "the", "receiver", "." ]
train
https://github.com/wellner/jcarafe/blob/ab8b0a83dbf600fe80c27711815c90bd3055b217/jcarafe-core/src/main/java/cern/colt/list/AbstractLongList.java#L45-L47
actorapp/actor-platform
actor-sdk/sdk-core-android/android-sdk/src/main/java/im/actor/sdk/util/images/ops/ImageDrawing.java
ImageDrawing.drawRoundedCorners
public static void drawRoundedCorners(Bitmap src, Bitmap dest, int radius, int clearColor) { """ Drawing src bitmap to dest bitmap with rounded corners @param src source bitmap @param dest destination bitmap @param radius radius in destination bitmap scale @param clearColor clear color "...
java
public static void drawRoundedCorners(Bitmap src, Bitmap dest, int radius, int clearColor) { clearBitmap(dest, clearColor); Canvas canvas = new Canvas(dest); Rect sourceRect = WorkCache.RECT1.get(); Rect destRect = WorkCache.RECT2.get(); sourceRect.set(0, 0, src.getWidth(), src....
[ "public", "static", "void", "drawRoundedCorners", "(", "Bitmap", "src", ",", "Bitmap", "dest", ",", "int", "radius", ",", "int", "clearColor", ")", "{", "clearBitmap", "(", "dest", ",", "clearColor", ")", ";", "Canvas", "canvas", "=", "new", "Canvas", "(",...
Drawing src bitmap to dest bitmap with rounded corners @param src source bitmap @param dest destination bitmap @param radius radius in destination bitmap scale @param clearColor clear color
[ "Drawing", "src", "bitmap", "to", "dest", "bitmap", "with", "rounded", "corners" ]
train
https://github.com/actorapp/actor-platform/blob/5123c1584757c6eeea0ed2a0e7e043629871a0c6/actor-sdk/sdk-core-android/android-sdk/src/main/java/im/actor/sdk/util/images/ops/ImageDrawing.java#L121-L146
vznet/mongo-jackson-mapper
src/main/java/net/vz/mongodb/jackson/JacksonDBCollection.java
JacksonDBCollection.findAndModify
public T findAndModify(DBObject query, DBObject sort, DBObject update) { """ calls {@link DBCollection#findAndModify(com.mongodb.DBObject, com.mongodb.DBObject, com.mongodb.DBObject, boolean, com.mongodb.DBObject, boolean, boolean)} with fields=null, remove=false, returnNew=false, upsert=false @param query Th...
java
public T findAndModify(DBObject query, DBObject sort, DBObject update) { return findAndModify(query, null, sort, false, update, false, false); }
[ "public", "T", "findAndModify", "(", "DBObject", "query", ",", "DBObject", "sort", ",", "DBObject", "update", ")", "{", "return", "findAndModify", "(", "query", ",", "null", ",", "sort", ",", "false", ",", "update", ",", "false", ",", "false", ")", ";", ...
calls {@link DBCollection#findAndModify(com.mongodb.DBObject, com.mongodb.DBObject, com.mongodb.DBObject, boolean, com.mongodb.DBObject, boolean, boolean)} with fields=null, remove=false, returnNew=false, upsert=false @param query The query @param sort The sort @param update The update to apply @return the old obje...
[ "calls", "{", "@link", "DBCollection#findAndModify", "(", "com", ".", "mongodb", ".", "DBObject", "com", ".", "mongodb", ".", "DBObject", "com", ".", "mongodb", ".", "DBObject", "boolean", "com", ".", "mongodb", ".", "DBObject", "boolean", "boolean", ")", "}...
train
https://github.com/vznet/mongo-jackson-mapper/blob/ecd189aefa89636cddf70fb383f5d676be347976/src/main/java/net/vz/mongodb/jackson/JacksonDBCollection.java#L611-L613
OpenLiberty/open-liberty
dev/com.ibm.websphere.javaee.jsf.2.2/src/javax/faces/view/facelets/TagHandler.java
TagHandler.getRequiredAttribute
protected final TagAttribute getRequiredAttribute(String localName) throws TagException { """ Utility method for fetching a required TagAttribute @param localName name of the attribute @return TagAttribute if found, otherwise error @throws TagException if the attribute was not found """ TagAttri...
java
protected final TagAttribute getRequiredAttribute(String localName) throws TagException { TagAttribute attr = this.getAttribute(localName); if (attr == null) { throw new TagException(this.tag, "Attribute '" + localName + "' is required"); } return attr; ...
[ "protected", "final", "TagAttribute", "getRequiredAttribute", "(", "String", "localName", ")", "throws", "TagException", "{", "TagAttribute", "attr", "=", "this", ".", "getAttribute", "(", "localName", ")", ";", "if", "(", "attr", "==", "null", ")", "{", "thro...
Utility method for fetching a required TagAttribute @param localName name of the attribute @return TagAttribute if found, otherwise error @throws TagException if the attribute was not found
[ "Utility", "method", "for", "fetching", "a", "required", "TagAttribute" ]
train
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.websphere.javaee.jsf.2.2/src/javax/faces/view/facelets/TagHandler.java#L60-L69
alkacon/opencms-core
src/org/opencms/db/CmsSelectQuery.java
CmsSelectQuery.setOrdering
public void setOrdering(String ordering) { """ Sets the SQL used for the ORDER BY clause.<p> @param ordering the SQL used for the ORDER BY clause """ if (ordering != null) { m_ordering = new CmsSimpleQueryFragment(ordering, Collections.<Object> emptyList()); } else { ...
java
public void setOrdering(String ordering) { if (ordering != null) { m_ordering = new CmsSimpleQueryFragment(ordering, Collections.<Object> emptyList()); } else { m_ordering = null; } }
[ "public", "void", "setOrdering", "(", "String", "ordering", ")", "{", "if", "(", "ordering", "!=", "null", ")", "{", "m_ordering", "=", "new", "CmsSimpleQueryFragment", "(", "ordering", ",", "Collections", ".", "<", "Object", ">", "emptyList", "(", ")", ")...
Sets the SQL used for the ORDER BY clause.<p> @param ordering the SQL used for the ORDER BY clause
[ "Sets", "the", "SQL", "used", "for", "the", "ORDER", "BY", "clause", ".", "<p", ">" ]
train
https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/db/CmsSelectQuery.java#L208-L215
gmessner/gitlab4j-api
src/main/java/org/gitlab4j/api/utils/HttpRequestUtils.java
HttpRequestUtils.getShortRequestDump
public static String getShortRequestDump(String fromMethod, HttpServletRequest request) { """ Build a String containing a very short multi-line dump of an HTTP request. @param fromMethod the method that this method was called from @param request the HTTP request build the request dump from @return a String co...
java
public static String getShortRequestDump(String fromMethod, HttpServletRequest request) { return (getShortRequestDump(fromMethod, false, request)); }
[ "public", "static", "String", "getShortRequestDump", "(", "String", "fromMethod", ",", "HttpServletRequest", "request", ")", "{", "return", "(", "getShortRequestDump", "(", "fromMethod", ",", "false", ",", "request", ")", ")", ";", "}" ]
Build a String containing a very short multi-line dump of an HTTP request. @param fromMethod the method that this method was called from @param request the HTTP request build the request dump from @return a String containing a very short multi-line dump of the HTTP request
[ "Build", "a", "String", "containing", "a", "very", "short", "multi", "-", "line", "dump", "of", "an", "HTTP", "request", "." ]
train
https://github.com/gmessner/gitlab4j-api/blob/ab045070abac0a8f4ccbf17b5ed9bfdef5723eed/src/main/java/org/gitlab4j/api/utils/HttpRequestUtils.java#L20-L22
jayantk/jklol
src/com/jayantkrish/jklol/ccg/lambda2/Expression2.java
Expression2.substitute
public Expression2 substitute(int index, Expression2 newExpression) { """ Replaces the expression at {@code index} in this expression with {@code newExpression}. @param index @param newExpression @return """ Preconditions.checkArgument(index < size); if (index == 0) { return newExpression; ...
java
public Expression2 substitute(int index, Expression2 newExpression) { Preconditions.checkArgument(index < size); if (index == 0) { return newExpression; } else { int[] parts = findSubexpression(index); Expression2 substituted = subexpressions.get(parts[0]).substitute(parts[1], newEx...
[ "public", "Expression2", "substitute", "(", "int", "index", ",", "Expression2", "newExpression", ")", "{", "Preconditions", ".", "checkArgument", "(", "index", "<", "size", ")", ";", "if", "(", "index", "==", "0", ")", "{", "return", "newExpression", ";", ...
Replaces the expression at {@code index} in this expression with {@code newExpression}. @param index @param newExpression @return
[ "Replaces", "the", "expression", "at", "{", "@code", "index", "}", "in", "this", "expression", "with", "{", "@code", "newExpression", "}", "." ]
train
https://github.com/jayantk/jklol/blob/d27532ca83e212d51066cf28f52621acc3fd44cc/src/com/jayantkrish/jklol/ccg/lambda2/Expression2.java#L229-L241
igniterealtime/Smack
smack-jingle-old/src/main/java/org/jivesoftware/smackx/jingleold/mediaimpl/jspeex/AudioMediaSession.java
AudioMediaSession.createSession
public static MediaSession createSession(String localhost, int localPort, String remoteHost, int remotePort, MediaSessionListener eventHandler, int quality, boolean secure, boolean micOn) throws NoProcessorException, UnsupportedFormatException, IOException, GeneralSecurityException { """ Create a Session using Spe...
java
public static MediaSession createSession(String localhost, int localPort, String remoteHost, int remotePort, MediaSessionListener eventHandler, int quality, boolean secure, boolean micOn) throws NoProcessorException, UnsupportedFormatException, IOException, GeneralSecurityException { SpeexFormat.setFramesPerPa...
[ "public", "static", "MediaSession", "createSession", "(", "String", "localhost", ",", "int", "localPort", ",", "String", "remoteHost", ",", "int", "remotePort", ",", "MediaSessionListener", "eventHandler", ",", "int", "quality", ",", "boolean", "secure", ",", "boo...
Create a Session using Speex Codec. @param localhost localHost @param localPort localPort @param remoteHost remoteHost @param remotePort remotePort @param eventHandler eventHandler @param quality quality @param secure secure @param micOn micOn @return MediaSession @throws NoProcessorExcepti...
[ "Create", "a", "Session", "using", "Speex", "Codec", "." ]
train
https://github.com/igniterealtime/Smack/blob/870756997faec1e1bfabfac0cd6c2395b04da873/smack-jingle-old/src/main/java/org/jivesoftware/smackx/jingleold/mediaimpl/jspeex/AudioMediaSession.java#L76-L95
Whiley/WhileyCompiler
src/main/java/wyc/util/ErrorMessages.java
ErrorMessages.syntaxError
public static void syntaxError(SyntacticItem e, int code, SyntacticItem... context) { """ Report an error message. This may additionally sanity check the supplied context. @param e @param code @param context """ WyilFile wf = (WyilFile) e.getHeap(); // Allocate syntax error in the heap)); SyntacticIt...
java
public static void syntaxError(SyntacticItem e, int code, SyntacticItem... context) { WyilFile wf = (WyilFile) e.getHeap(); // Allocate syntax error in the heap)); SyntacticItem.Marker m = wf.allocate(new WyilFile.SyntaxError(code, e, new Tuple<>(context))); // Record marker to ensure it gets written to disk ...
[ "public", "static", "void", "syntaxError", "(", "SyntacticItem", "e", ",", "int", "code", ",", "SyntacticItem", "...", "context", ")", "{", "WyilFile", "wf", "=", "(", "WyilFile", ")", "e", ".", "getHeap", "(", ")", ";", "// Allocate syntax error in the heap))...
Report an error message. This may additionally sanity check the supplied context. @param e @param code @param context
[ "Report", "an", "error", "message", ".", "This", "may", "additionally", "sanity", "check", "the", "supplied", "context", "." ]
train
https://github.com/Whiley/WhileyCompiler/blob/680f8a657d3fc286f8cc422755988b6d74ab3f4c/src/main/java/wyc/util/ErrorMessages.java#L256-L262
JOML-CI/JOML
src/org/joml/Matrix4f.java
Matrix4f.rotateAffine
public Matrix4f rotateAffine(float ang, float x, float y, float z) { """ Apply rotation to this {@link #isAffine() affine} matrix by rotating the given amount of radians about the specified <code>(x, y, z)</code> axis. <p> This method assumes <code>this</code> to be {@link #isAffine() affine}. <p> The axis de...
java
public Matrix4f rotateAffine(float ang, float x, float y, float z) { return rotateAffine(ang, x, y, z, thisOrNew()); }
[ "public", "Matrix4f", "rotateAffine", "(", "float", "ang", ",", "float", "x", ",", "float", "y", ",", "float", "z", ")", "{", "return", "rotateAffine", "(", "ang", ",", "x", ",", "y", ",", "z", ",", "thisOrNew", "(", ")", ")", ";", "}" ]
Apply rotation to this {@link #isAffine() affine} matrix by rotating the given amount of radians about the specified <code>(x, y, z)</code> axis. <p> This method assumes <code>this</code> to be {@link #isAffine() affine}. <p> The axis described by the three components needs to be a unit vector. <p> When used with a rig...
[ "Apply", "rotation", "to", "this", "{", "@link", "#isAffine", "()", "affine", "}", "matrix", "by", "rotating", "the", "given", "amount", "of", "radians", "about", "the", "specified", "<code", ">", "(", "x", "y", "z", ")", "<", "/", "code", ">", "axis",...
train
https://github.com/JOML-CI/JOML/blob/ce2652fc236b42bda3875c591f8e6645048a678f/src/org/joml/Matrix4f.java#L6127-L6129
Azure/azure-sdk-for-java
cognitiveservices/data-plane/vision/customvision/training/src/main/java/com/microsoft/azure/cognitiveservices/vision/customvision/training/implementation/TrainingsImpl.java
TrainingsImpl.getTaggedImagesAsync
public Observable<List<Image>> getTaggedImagesAsync(UUID projectId, GetTaggedImagesOptionalParameter getTaggedImagesOptionalParameter) { """ Get tagged images for a given project iteration. This API supports batching and range selection. By default it will only return first 50 images matching images. Use the {ta...
java
public Observable<List<Image>> getTaggedImagesAsync(UUID projectId, GetTaggedImagesOptionalParameter getTaggedImagesOptionalParameter) { return getTaggedImagesWithServiceResponseAsync(projectId, getTaggedImagesOptionalParameter).map(new Func1<ServiceResponse<List<Image>>, List<Image>>() { @Override ...
[ "public", "Observable", "<", "List", "<", "Image", ">", ">", "getTaggedImagesAsync", "(", "UUID", "projectId", ",", "GetTaggedImagesOptionalParameter", "getTaggedImagesOptionalParameter", ")", "{", "return", "getTaggedImagesWithServiceResponseAsync", "(", "projectId", ",", ...
Get tagged images for a given project iteration. This API supports batching and range selection. By default it will only return first 50 images matching images. Use the {take} and {skip} parameters to control how many images to return in a given batch. The filtering is on an and/or relationship. For example, if the pro...
[ "Get", "tagged", "images", "for", "a", "given", "project", "iteration", ".", "This", "API", "supports", "batching", "and", "range", "selection", ".", "By", "default", "it", "will", "only", "return", "first", "50", "images", "matching", "images", ".", "Use", ...
train
https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/cognitiveservices/data-plane/vision/customvision/training/src/main/java/com/microsoft/azure/cognitiveservices/vision/customvision/training/implementation/TrainingsImpl.java#L5007-L5014
lievendoclo/Valkyrie-RCP
valkyrie-rcp-core/src/main/java/org/valkyriercp/util/ClassUtils.java
ClassUtils.getClassFieldNameWithValue
public static String getClassFieldNameWithValue(Class clazz, Object value) { """ Returns the qualified class field name with the specified value. For example, with a class defined with a static field "NORMAL" with value = "0", passing in "0" would return: className.NORMAL. @return The qualified field. """...
java
public static String getClassFieldNameWithValue(Class clazz, Object value) { Field[] fields = clazz.getFields(); for (int i = 0; i < fields.length; i++) { Field field = fields[i]; try { Object constant = field.get(null); if (value.equals(constant)) { return clazz.getName() + "." + field.getName()...
[ "public", "static", "String", "getClassFieldNameWithValue", "(", "Class", "clazz", ",", "Object", "value", ")", "{", "Field", "[", "]", "fields", "=", "clazz", ".", "getFields", "(", ")", ";", "for", "(", "int", "i", "=", "0", ";", "i", "<", "fields", ...
Returns the qualified class field name with the specified value. For example, with a class defined with a static field "NORMAL" with value = "0", passing in "0" would return: className.NORMAL. @return The qualified field.
[ "Returns", "the", "qualified", "class", "field", "name", "with", "the", "specified", "value", ".", "For", "example", "with", "a", "class", "defined", "with", "a", "static", "field", "NORMAL", "with", "value", "=", "0", "passing", "in", "0", "would", "retur...
train
https://github.com/lievendoclo/Valkyrie-RCP/blob/6aad6e640b348cda8f3b0841f6e42025233f1eb8/valkyrie-rcp-core/src/main/java/org/valkyriercp/util/ClassUtils.java#L84-L99
moparisthebest/beehive
beehive-netui-core/src/main/java/org/apache/beehive/netui/pageflow/interceptor/action/ActionInterceptor.java
ActionInterceptor.postInvoke
public void postInvoke( InterceptorContext context, InterceptorChain chain ) throws InterceptorException { """ Callback invoked after the action is processed. {@link #postAction} may be used instead. """ postAction( ( ActionInterceptorContext ) context, chain ); }
java
public void postInvoke( InterceptorContext context, InterceptorChain chain ) throws InterceptorException { postAction( ( ActionInterceptorContext ) context, chain ); }
[ "public", "void", "postInvoke", "(", "InterceptorContext", "context", ",", "InterceptorChain", "chain", ")", "throws", "InterceptorException", "{", "postAction", "(", "(", "ActionInterceptorContext", ")", "context", ",", "chain", ")", ";", "}" ]
Callback invoked after the action is processed. {@link #postAction} may be used instead.
[ "Callback", "invoked", "after", "the", "action", "is", "processed", ".", "{" ]
train
https://github.com/moparisthebest/beehive/blob/4246a0cc40ce3c05f1a02c2da2653ac622703d77/beehive-netui-core/src/main/java/org/apache/beehive/netui/pageflow/interceptor/action/ActionInterceptor.java#L117-L120
Carbonado/Carbonado
src/main/java/com/amazon/carbonado/qe/AbstractQuery.java
AbstractQuery.checkSliceArguments
protected boolean checkSliceArguments(long from, Long to) { """ Called by sliced fetch to ensure that arguments are valid. @return false if from is 0 and to is null @throws IllegalArgumentException if arguments are invalid @since 1.2 """ if (from < 0) { throw new IllegalArgumentExcep...
java
protected boolean checkSliceArguments(long from, Long to) { if (from < 0) { throw new IllegalArgumentException("Slice from is negative: " + from); } if (to == null) { if (from == 0) { return false; } } else if (from > to) { ...
[ "protected", "boolean", "checkSliceArguments", "(", "long", "from", ",", "Long", "to", ")", "{", "if", "(", "from", "<", "0", ")", "{", "throw", "new", "IllegalArgumentException", "(", "\"Slice from is negative: \"", "+", "from", ")", ";", "}", "if", "(", ...
Called by sliced fetch to ensure that arguments are valid. @return false if from is 0 and to is null @throws IllegalArgumentException if arguments are invalid @since 1.2
[ "Called", "by", "sliced", "fetch", "to", "ensure", "that", "arguments", "are", "valid", "." ]
train
https://github.com/Carbonado/Carbonado/blob/eee29b365a61c8f03e1a1dc6bed0692e6b04b1db/src/main/java/com/amazon/carbonado/qe/AbstractQuery.java#L195-L208
netty/netty
codec-http2/src/main/java/io/netty/handler/codec/http2/Http2ConnectionHandler.java
Http2ConnectionHandler.onConnectionError
protected void onConnectionError(ChannelHandlerContext ctx, boolean outbound, Throwable cause, Http2Exception http2Ex) { """ Handler for a connection error. Sends a GO_AWAY frame to the remote endpoint. Once all streams are closed, the connection is shut down. @param ctx th...
java
protected void onConnectionError(ChannelHandlerContext ctx, boolean outbound, Throwable cause, Http2Exception http2Ex) { if (http2Ex == null) { http2Ex = new Http2Exception(INTERNAL_ERROR, cause.getMessage(), cause); } ChannelPromise promise = ct...
[ "protected", "void", "onConnectionError", "(", "ChannelHandlerContext", "ctx", ",", "boolean", "outbound", ",", "Throwable", "cause", ",", "Http2Exception", "http2Ex", ")", "{", "if", "(", "http2Ex", "==", "null", ")", "{", "http2Ex", "=", "new", "Http2Exception...
Handler for a connection error. Sends a GO_AWAY frame to the remote endpoint. Once all streams are closed, the connection is shut down. @param ctx the channel context @param outbound {@code true} if the error was caused by an outbound operation. @param cause the exception that was caught @param http2Ex the {@link Http...
[ "Handler", "for", "a", "connection", "error", ".", "Sends", "a", "GO_AWAY", "frame", "to", "the", "remote", "endpoint", ".", "Once", "all", "streams", "are", "closed", "the", "connection", "is", "shut", "down", "." ]
train
https://github.com/netty/netty/blob/ba06eafa1c1824bd154f1a380019e7ea2edf3c4c/codec-http2/src/main/java/io/netty/handler/codec/http2/Http2ConnectionHandler.java#L657-L670
zxing/zxing
core/src/main/java/com/google/zxing/datamatrix/encoder/HighLevelEncoder.java
HighLevelEncoder.encodeHighLevel
public static String encodeHighLevel(String msg) { """ Performs message encoding of a DataMatrix message using the algorithm described in annex P of ISO/IEC 16022:2000(E). @param msg the message @return the encoded message (the char values range from 0 to 255) """ return encodeHighLevel(msg, SymbolSha...
java
public static String encodeHighLevel(String msg) { return encodeHighLevel(msg, SymbolShapeHint.FORCE_NONE, null, null); }
[ "public", "static", "String", "encodeHighLevel", "(", "String", "msg", ")", "{", "return", "encodeHighLevel", "(", "msg", ",", "SymbolShapeHint", ".", "FORCE_NONE", ",", "null", ",", "null", ")", ";", "}" ]
Performs message encoding of a DataMatrix message using the algorithm described in annex P of ISO/IEC 16022:2000(E). @param msg the message @return the encoded message (the char values range from 0 to 255)
[ "Performs", "message", "encoding", "of", "a", "DataMatrix", "message", "using", "the", "algorithm", "described", "in", "annex", "P", "of", "ISO", "/", "IEC", "16022", ":", "2000", "(", "E", ")", "." ]
train
https://github.com/zxing/zxing/blob/653ac2a3beb11481eff82e7d5f2bab8a745f7fac/core/src/main/java/com/google/zxing/datamatrix/encoder/HighLevelEncoder.java#L141-L143
Azure/azure-sdk-for-java
kusto/resource-manager/v2018_09_07_preview/src/main/java/com/microsoft/azure/management/kusto/v2018_09_07_preview/implementation/EventHubConnectionsInner.java
EventHubConnectionsInner.eventhubConnectionValidationAsync
public Observable<EventHubConnectionValidationListResultInner> eventhubConnectionValidationAsync(String resourceGroupName, String clusterName, String databaseName, EventHubConnectionValidation parameters) { """ Checks that the Event Hub data connection parameters are valid. @param resourceGroupName The name of ...
java
public Observable<EventHubConnectionValidationListResultInner> eventhubConnectionValidationAsync(String resourceGroupName, String clusterName, String databaseName, EventHubConnectionValidation parameters) { return eventhubConnectionValidationWithServiceResponseAsync(resourceGroupName, clusterName, databaseName,...
[ "public", "Observable", "<", "EventHubConnectionValidationListResultInner", ">", "eventhubConnectionValidationAsync", "(", "String", "resourceGroupName", ",", "String", "clusterName", ",", "String", "databaseName", ",", "EventHubConnectionValidation", "parameters", ")", "{", ...
Checks that the Event Hub data connection parameters are valid. @param resourceGroupName The name of the resource group containing the Kusto cluster. @param clusterName The name of the Kusto cluster. @param databaseName The name of the database in the Kusto cluster. @param parameters The Event Hub connection parameter...
[ "Checks", "that", "the", "Event", "Hub", "data", "connection", "parameters", "are", "valid", "." ]
train
https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/kusto/resource-manager/v2018_09_07_preview/src/main/java/com/microsoft/azure/management/kusto/v2018_09_07_preview/implementation/EventHubConnectionsInner.java#L240-L247
lucee/Lucee
core/src/main/java/lucee/transformer/cfml/script/AbstrCFMLScriptTransformer.java
AbstrCFMLScriptTransformer.elseifStatement
private final boolean elseifStatement(Data data, Condition cont) throws TemplateException { """ Liest ein else if Statement ein. <br /> EBNF:<br /> <code>spaces condition spaces ")" spaces block;</code> @return else if Statement @throws TemplateException """ int pos = data.srcCode.getPos(); if (!data.s...
java
private final boolean elseifStatement(Data data, Condition cont) throws TemplateException { int pos = data.srcCode.getPos(); if (!data.srcCode.forwardIfCurrent("else")) return false; comments(data); if (!data.srcCode.forwardIfCurrent("if", '(')) { data.srcCode.setPos(pos); return false; } Position lin...
[ "private", "final", "boolean", "elseifStatement", "(", "Data", "data", ",", "Condition", "cont", ")", "throws", "TemplateException", "{", "int", "pos", "=", "data", ".", "srcCode", ".", "getPos", "(", ")", ";", "if", "(", "!", "data", ".", "srcCode", "."...
Liest ein else if Statement ein. <br /> EBNF:<br /> <code>spaces condition spaces ")" spaces block;</code> @return else if Statement @throws TemplateException
[ "Liest", "ein", "else", "if", "Statement", "ein", ".", "<br", "/", ">", "EBNF", ":", "<br", "/", ">", "<code", ">", "spaces", "condition", "spaces", ")", "spaces", "block", ";", "<", "/", "code", ">" ]
train
https://github.com/lucee/Lucee/blob/29b153fc4e126e5edb97da937f2ee2e231b87593/core/src/main/java/lucee/transformer/cfml/script/AbstrCFMLScriptTransformer.java#L291-L313
stratosphere/stratosphere
stratosphere-java/src/main/java/eu/stratosphere/api/java/ExecutionEnvironment.java
ExecutionEnvironment.fromCollection
public <X> DataSource<X> fromCollection(Collection<X> data) { """ Creates a DataSet from the given non-empty collection. The type of the data set is that of the elements in the collection. The elements need to be serializable (as defined by {@link java.io.Serializable}), because the framework may move the elemen...
java
public <X> DataSource<X> fromCollection(Collection<X> data) { if (data == null) { throw new IllegalArgumentException("The data must not be null."); } if (data.size() == 0) { throw new IllegalArgumentException("The size of the collection must not be empty."); } X firstValue = data.iterator().next(); ...
[ "public", "<", "X", ">", "DataSource", "<", "X", ">", "fromCollection", "(", "Collection", "<", "X", ">", "data", ")", "{", "if", "(", "data", "==", "null", ")", "{", "throw", "new", "IllegalArgumentException", "(", "\"The data must not be null.\"", ")", "...
Creates a DataSet from the given non-empty collection. The type of the data set is that of the elements in the collection. The elements need to be serializable (as defined by {@link java.io.Serializable}), because the framework may move the elements into the cluster if needed. <p> The framework will try and determine t...
[ "Creates", "a", "DataSet", "from", "the", "given", "non", "-", "empty", "collection", ".", "The", "type", "of", "the", "data", "set", "is", "that", "of", "the", "elements", "in", "the", "collection", ".", "The", "elements", "need", "to", "be", "serializa...
train
https://github.com/stratosphere/stratosphere/blob/c543a08f9676c5b2b0a7088123bd6e795a8ae0c8/stratosphere-java/src/main/java/eu/stratosphere/api/java/ExecutionEnvironment.java#L331-L342