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
zxing/zxing
android/src/com/google/zxing/client/android/CaptureActivity.java
CaptureActivity.drawResultPoints
private void drawResultPoints(Bitmap barcode, float scaleFactor, Result rawResult) { """ Superimpose a line for 1D or dots for 2D to highlight the key features of the barcode. @param barcode A bitmap of the captured image. @param scaleFactor amount by which thumbnail was scaled @param rawResult The decoded ...
java
private void drawResultPoints(Bitmap barcode, float scaleFactor, Result rawResult) { ResultPoint[] points = rawResult.getResultPoints(); if (points != null && points.length > 0) { Canvas canvas = new Canvas(barcode); Paint paint = new Paint(); paint.setColor(getResources().getColor(R.color.res...
[ "private", "void", "drawResultPoints", "(", "Bitmap", "barcode", ",", "float", "scaleFactor", ",", "Result", "rawResult", ")", "{", "ResultPoint", "[", "]", "points", "=", "rawResult", ".", "getResultPoints", "(", ")", ";", "if", "(", "points", "!=", "null",...
Superimpose a line for 1D or dots for 2D to highlight the key features of the barcode. @param barcode A bitmap of the captured image. @param scaleFactor amount by which thumbnail was scaled @param rawResult The decoded results which contains the points to draw.
[ "Superimpose", "a", "line", "for", "1D", "or", "dots", "for", "2D", "to", "highlight", "the", "key", "features", "of", "the", "barcode", "." ]
train
https://github.com/zxing/zxing/blob/653ac2a3beb11481eff82e7d5f2bab8a745f7fac/android/src/com/google/zxing/client/android/CaptureActivity.java#L491-L515
romannurik/muzei
muzei-api/src/main/java/com/google/android/apps/muzei/api/provider/MuzeiArtProvider.java
MuzeiArtProvider.openArtworkInfo
protected boolean openArtworkInfo(@NonNull Artwork artwork) { """ Callback when the user wishes to see more information about the given artwork. The default implementation opens the {@link ProviderContract.Artwork#WEB_URI web uri} of the artwork. @param artwork The artwork the user wants to see more informatio...
java
protected boolean openArtworkInfo(@NonNull Artwork artwork) { if (artwork.getWebUri() != null && getContext() != null) { try { Intent intent = new Intent(Intent.ACTION_VIEW, artwork.getWebUri()); intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK); getConte...
[ "protected", "boolean", "openArtworkInfo", "(", "@", "NonNull", "Artwork", "artwork", ")", "{", "if", "(", "artwork", ".", "getWebUri", "(", ")", "!=", "null", "&&", "getContext", "(", ")", "!=", "null", ")", "{", "try", "{", "Intent", "intent", "=", "...
Callback when the user wishes to see more information about the given artwork. The default implementation opens the {@link ProviderContract.Artwork#WEB_URI web uri} of the artwork. @param artwork The artwork the user wants to see more information about. @return True if the artwork info was successfully opened.
[ "Callback", "when", "the", "user", "wishes", "to", "see", "more", "information", "about", "the", "given", "artwork", ".", "The", "default", "implementation", "opens", "the", "{", "@link", "ProviderContract", ".", "Artwork#WEB_URI", "web", "uri", "}", "of", "th...
train
https://github.com/romannurik/muzei/blob/d00777a5fc59f34471be338c814ea85ddcbde304/muzei-api/src/main/java/com/google/android/apps/muzei/api/provider/MuzeiArtProvider.java#L605-L618
BlueBrain/bluima
utils/pdf_glyph_mapping/src/main/java/org/xmlcml/pdf2svg/GlyphCorrector.java
GlyphCorrector.codePointConversion
public int codePointConversion(String fontName, int codePoint) { """ Takes in argument a codepoint. If for the given police the codepoint doesn't correspond to what the font actually displays, the conversion is made. Otherwise, the old codepoint is return. @param fontName name of the font of the character in...
java
public int codePointConversion(String fontName, int codePoint) { NonStandardFontFamily nonStandardFontFamily = get(fontName); if (nonStandardFontFamily == null) return codePoint; CodePointSet codePointSet = nonStandardFontFamily.getCodePointSet(); if (codePointSet == null) ...
[ "public", "int", "codePointConversion", "(", "String", "fontName", ",", "int", "codePoint", ")", "{", "NonStandardFontFamily", "nonStandardFontFamily", "=", "get", "(", "fontName", ")", ";", "if", "(", "nonStandardFontFamily", "==", "null", ")", "return", "codePoi...
Takes in argument a codepoint. If for the given police the codepoint doesn't correspond to what the font actually displays, the conversion is made. Otherwise, the old codepoint is return. @param fontName name of the font of the character in the pdf @param oldCodePoint unicode point in the original pdf @return
[ "Takes", "in", "argument", "a", "codepoint", ".", "If", "for", "the", "given", "police", "the", "codepoint", "doesn", "t", "correspond", "to", "what", "the", "font", "actually", "displays", "the", "conversion", "is", "made", ".", "Otherwise", "the", "old", ...
train
https://github.com/BlueBrain/bluima/blob/793ea3f46761dce72094e057a56cddfa677156ae/utils/pdf_glyph_mapping/src/main/java/org/xmlcml/pdf2svg/GlyphCorrector.java#L75-L96
UrielCh/ovh-java-sdk
ovh-java-sdk-hostingweb/src/main/java/net/minidev/ovh/api/ApiOvhHostingweb.java
ApiOvhHostingweb.serviceName_runtimeAvailableTypes_GET
public ArrayList<OvhTypeEnum> serviceName_runtimeAvailableTypes_GET(String serviceName, String language) throws IOException { """ List available runtime configurations available backend types REST: GET /hosting/web/{serviceName}/runtimeAvailableTypes @param language [required] Specific programming language to ...
java
public ArrayList<OvhTypeEnum> serviceName_runtimeAvailableTypes_GET(String serviceName, String language) throws IOException { String qPath = "/hosting/web/{serviceName}/runtimeAvailableTypes"; StringBuilder sb = path(qPath, serviceName); query(sb, "language", language); String resp = exec(qPath, "GET", sb.toStr...
[ "public", "ArrayList", "<", "OvhTypeEnum", ">", "serviceName_runtimeAvailableTypes_GET", "(", "String", "serviceName", ",", "String", "language", ")", "throws", "IOException", "{", "String", "qPath", "=", "\"/hosting/web/{serviceName}/runtimeAvailableTypes\"", ";", "StringB...
List available runtime configurations available backend types REST: GET /hosting/web/{serviceName}/runtimeAvailableTypes @param language [required] Specific programming language to filter @param serviceName [required] The internal name of your hosting
[ "List", "available", "runtime", "configurations", "available", "backend", "types" ]
train
https://github.com/UrielCh/ovh-java-sdk/blob/6d531a40e56e09701943e334c25f90f640c55701/ovh-java-sdk-hostingweb/src/main/java/net/minidev/ovh/api/ApiOvhHostingweb.java#L230-L236
weld/core
impl/src/main/java/org/jboss/weld/resolution/BeanTypeAssignabilityRules.java
BeanTypeAssignabilityRules.matches
private boolean matches(Class<?> type1, ParameterizedType type2) { """ A parameterized bean type is considered assignable to a raw required type if the raw types are identical and all type parameters of the bean type are either unbounded type variables or java.lang.Object. <p> A raw bean type is considered ass...
java
private boolean matches(Class<?> type1, ParameterizedType type2) { if (!type1.equals(Reflections.getRawType(type2))) { return false; } return Types.isArrayOfUnboundedTypeVariablesOrObjects(type2.getActualTypeArguments()); }
[ "private", "boolean", "matches", "(", "Class", "<", "?", ">", "type1", ",", "ParameterizedType", "type2", ")", "{", "if", "(", "!", "type1", ".", "equals", "(", "Reflections", ".", "getRawType", "(", "type2", ")", ")", ")", "{", "return", "false", ";",...
A parameterized bean type is considered assignable to a raw required type if the raw types are identical and all type parameters of the bean type are either unbounded type variables or java.lang.Object. <p> A raw bean type is considered assignable to a parameterized required type if the raw types are identical and all ...
[ "A", "parameterized", "bean", "type", "is", "considered", "assignable", "to", "a", "raw", "required", "type", "if", "the", "raw", "types", "are", "identical", "and", "all", "type", "parameters", "of", "the", "bean", "type", "are", "either", "unbounded", "typ...
train
https://github.com/weld/core/blob/567a2eaf95b168597d23a56be89bf05a7834b2aa/impl/src/main/java/org/jboss/weld/resolution/BeanTypeAssignabilityRules.java#L89-L94
openengsb/openengsb
components/ekb/common/src/main/java/org/openengsb/core/ekb/common/EDBConverter.java
EDBConverter.checkEDBObjectModelType
private boolean checkEDBObjectModelType(EDBObject object, Class<?> model) { """ Tests if an EDBObject has the correct model class in which it should be converted. Returns false if the model type is not fitting, returns true if the model type is fitting or model type is unknown. """ String modelClass =...
java
private boolean checkEDBObjectModelType(EDBObject object, Class<?> model) { String modelClass = object.getString(EDBConstants.MODEL_TYPE); if (modelClass == null) { LOGGER.warn(String.format("The EDBObject with the oid %s has no model type information." + "The resulting m...
[ "private", "boolean", "checkEDBObjectModelType", "(", "EDBObject", "object", ",", "Class", "<", "?", ">", "model", ")", "{", "String", "modelClass", "=", "object", ".", "getString", "(", "EDBConstants", ".", "MODEL_TYPE", ")", ";", "if", "(", "modelClass", "...
Tests if an EDBObject has the correct model class in which it should be converted. Returns false if the model type is not fitting, returns true if the model type is fitting or model type is unknown.
[ "Tests", "if", "an", "EDBObject", "has", "the", "correct", "model", "class", "in", "which", "it", "should", "be", "converted", ".", "Returns", "false", "if", "the", "model", "type", "is", "not", "fitting", "returns", "true", "if", "the", "model", "type", ...
train
https://github.com/openengsb/openengsb/blob/d39058000707f617cd405629f9bc7f17da7b414a/components/ekb/common/src/main/java/org/openengsb/core/ekb/common/EDBConverter.java#L100-L110
czyzby/gdx-lml
kiwi/src/main/java/com/github/czyzby/kiwi/util/gdx/collection/lazy/LazyObjectMap.java
LazyObjectMap.get
@Override @Deprecated public Value get(final Key key, final Value defaultValue) { """ LazyObjectMap initiates values on access. No need for default values, as nulls are impossible as long as the provided is correctly implemented and nulls are not put into the map. @param key selected key. @param defau...
java
@Override @Deprecated public Value get(final Key key, final Value defaultValue) { return super.get(key, defaultValue); }
[ "@", "Override", "@", "Deprecated", "public", "Value", "get", "(", "final", "Key", "key", ",", "final", "Value", "defaultValue", ")", "{", "return", "super", ".", "get", "(", "key", ",", "defaultValue", ")", ";", "}" ]
LazyObjectMap initiates values on access. No need for default values, as nulls are impossible as long as the provided is correctly implemented and nulls are not put into the map. @param key selected key. @param defaultValue returned if no value is set for the key.
[ "LazyObjectMap", "initiates", "values", "on", "access", ".", "No", "need", "for", "default", "values", "as", "nulls", "are", "impossible", "as", "long", "as", "the", "provided", "is", "correctly", "implemented", "and", "nulls", "are", "not", "put", "into", "...
train
https://github.com/czyzby/gdx-lml/blob/7623b322e6afe49ad4dd636c80c230150a1cfa4e/kiwi/src/main/java/com/github/czyzby/kiwi/util/gdx/collection/lazy/LazyObjectMap.java#L165-L169
rjeschke/txtmark
src/main/java/com/github/rjeschke/txtmark/Utils.java
Utils.readMdLink
public final static int readMdLink(final StringBuilder out, final String in, final int start) { """ Reads a markdown link. @param out The StringBuilder to write to. @param in Input String. @param start Starting position. @return The new position or -1 if this is no valid markdown link. """ int...
java
public final static int readMdLink(final StringBuilder out, final String in, final int start) { int pos = start; int counter = 1; while (pos < in.length()) { final char ch = in.charAt(pos); if (ch == '\\' && pos + 1 < in.length()) { ...
[ "public", "final", "static", "int", "readMdLink", "(", "final", "StringBuilder", "out", ",", "final", "String", "in", ",", "final", "int", "start", ")", "{", "int", "pos", "=", "start", ";", "int", "counter", "=", "1", ";", "while", "(", "pos", "<", ...
Reads a markdown link. @param out The StringBuilder to write to. @param in Input String. @param start Starting position. @return The new position or -1 if this is no valid markdown link.
[ "Reads", "a", "markdown", "link", "." ]
train
https://github.com/rjeschke/txtmark/blob/108cee6b209a362843729c032c2d982625d12d98/src/main/java/com/github/rjeschke/txtmark/Utils.java#L194-L237
Azure/azure-sdk-for-java
notificationhubs/resource-manager/v2017_04_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2017_04_01/implementation/NotificationHubsInner.java
NotificationHubsInner.checkNotificationHubAvailability
public CheckAvailabilityResultInner checkNotificationHubAvailability(String resourceGroupName, String namespaceName, CheckAvailabilityParameters parameters) { """ Checks the availability of the given notificationHub in a namespace. @param resourceGroupName The name of the resource group. @param namespaceName T...
java
public CheckAvailabilityResultInner checkNotificationHubAvailability(String resourceGroupName, String namespaceName, CheckAvailabilityParameters parameters) { return checkNotificationHubAvailabilityWithServiceResponseAsync(resourceGroupName, namespaceName, parameters).toBlocking().single().body(); }
[ "public", "CheckAvailabilityResultInner", "checkNotificationHubAvailability", "(", "String", "resourceGroupName", ",", "String", "namespaceName", ",", "CheckAvailabilityParameters", "parameters", ")", "{", "return", "checkNotificationHubAvailabilityWithServiceResponseAsync", "(", "...
Checks the availability of the given notificationHub in a namespace. @param resourceGroupName The name of the resource group. @param namespaceName The namespace name. @param parameters The notificationHub name. @throws IllegalArgumentException thrown if parameters fail the validation @throws CloudException thrown if t...
[ "Checks", "the", "availability", "of", "the", "given", "notificationHub", "in", "a", "namespace", "." ]
train
https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/notificationhubs/resource-manager/v2017_04_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2017_04_01/implementation/NotificationHubsInner.java#L149-L151
Stratio/stratio-cassandra
src/java/org/apache/cassandra/cql/Term.java
Term.getByteBuffer
public ByteBuffer getByteBuffer(AbstractType<?> validator, List<ByteBuffer> variables) throws InvalidRequestException { """ Returns the typed value, serialized to a ByteBuffer according to a comparator/validator. @return a ByteBuffer of the value. @throws InvalidRequestException if unable to coerce the string...
java
public ByteBuffer getByteBuffer(AbstractType<?> validator, List<ByteBuffer> variables) throws InvalidRequestException { try { if (!isBindMarker()) return validator.fromStringCQL2(text); // must be a marker term so check for a CqlBindValue stored in the term if (b...
[ "public", "ByteBuffer", "getByteBuffer", "(", "AbstractType", "<", "?", ">", "validator", ",", "List", "<", "ByteBuffer", ">", "variables", ")", "throws", "InvalidRequestException", "{", "try", "{", "if", "(", "!", "isBindMarker", "(", ")", ")", "return", "v...
Returns the typed value, serialized to a ByteBuffer according to a comparator/validator. @return a ByteBuffer of the value. @throws InvalidRequestException if unable to coerce the string to its type.
[ "Returns", "the", "typed", "value", "serialized", "to", "a", "ByteBuffer", "according", "to", "a", "comparator", "/", "validator", "." ]
train
https://github.com/Stratio/stratio-cassandra/blob/f6416b43ad5309083349ad56266450fa8c6a2106/src/java/org/apache/cassandra/cql/Term.java#L89-L105
cdk/cdk
legacy/src/main/java/org/openscience/cdk/math/qm/OneElectronJob.java
OneElectronJob.calculateV
private Matrix calculateV(IBasis basis) { """ Calculates the matrix for the potential matrix V_i,j = <chi_i | 1/r | chi_j> """ int size = basis.getSize(); Matrix V = new Matrix(size, size); int i, j; for (i = 0; i < size; i++) for (j = 0; j < size; j++) ...
java
private Matrix calculateV(IBasis basis) { int size = basis.getSize(); Matrix V = new Matrix(size, size); int i, j; for (i = 0; i < size; i++) for (j = 0; j < size; j++) V.matrix[i][j] = basis.calcV(i, j); return V; }
[ "private", "Matrix", "calculateV", "(", "IBasis", "basis", ")", "{", "int", "size", "=", "basis", ".", "getSize", "(", ")", ";", "Matrix", "V", "=", "new", "Matrix", "(", "size", ",", "size", ")", ";", "int", "i", ",", "j", ";", "for", "(", "i", ...
Calculates the matrix for the potential matrix V_i,j = <chi_i | 1/r | chi_j>
[ "Calculates", "the", "matrix", "for", "the", "potential", "matrix" ]
train
https://github.com/cdk/cdk/blob/c3d0f16502bf08df50365fee392e11d7c9856657/legacy/src/main/java/org/openscience/cdk/math/qm/OneElectronJob.java#L119-L128
EdwardRaff/JSAT
JSAT/src/jsat/linear/vectorcollection/lsh/E2LSH.java
E2LSH.searchR
public List<? extends VecPaired<Vec, Double>> searchR(Vec q) { """ Performs a search for points within the set {@link #getRadius() radius} of the query point. @param q the query point to search near @return a list of vectors paired with their true distance from the query point that are within the desired radiu...
java
public List<? extends VecPaired<Vec, Double>> searchR(Vec q) { return searchR(q, false); }
[ "public", "List", "<", "?", "extends", "VecPaired", "<", "Vec", ",", "Double", ">", ">", "searchR", "(", "Vec", "q", ")", "{", "return", "searchR", "(", "q", ",", "false", ")", ";", "}" ]
Performs a search for points within the set {@link #getRadius() radius} of the query point. @param q the query point to search near @return a list of vectors paired with their true distance from the query point that are within the desired radius of the query point
[ "Performs", "a", "search", "for", "points", "within", "the", "set", "{" ]
train
https://github.com/EdwardRaff/JSAT/blob/0ff53b7b39684b2379cc1da522f5b3a954b15cfb/JSAT/src/jsat/linear/vectorcollection/lsh/E2LSH.java#L170-L173
UrielCh/ovh-java-sdk
ovh-java-sdk-dedicatedCloud/src/main/java/net/minidev/ovh/api/ApiOvhDedicatedCloud.java
ApiOvhDedicatedCloud.serviceName_allowedNetwork_networkAccessId_PUT
public void serviceName_allowedNetwork_networkAccessId_PUT(String serviceName, Long networkAccessId, OvhAllowedNetwork body) throws IOException { """ Alter this object properties REST: PUT /dedicatedCloud/{serviceName}/allowedNetwork/{networkAccessId} @param body [required] New object properties @param servic...
java
public void serviceName_allowedNetwork_networkAccessId_PUT(String serviceName, Long networkAccessId, OvhAllowedNetwork body) throws IOException { String qPath = "/dedicatedCloud/{serviceName}/allowedNetwork/{networkAccessId}"; StringBuilder sb = path(qPath, serviceName, networkAccessId); exec(qPath, "PUT", sb.toS...
[ "public", "void", "serviceName_allowedNetwork_networkAccessId_PUT", "(", "String", "serviceName", ",", "Long", "networkAccessId", ",", "OvhAllowedNetwork", "body", ")", "throws", "IOException", "{", "String", "qPath", "=", "\"/dedicatedCloud/{serviceName}/allowedNetwork/{networ...
Alter this object properties REST: PUT /dedicatedCloud/{serviceName}/allowedNetwork/{networkAccessId} @param body [required] New object properties @param serviceName [required] Domain of the service @param networkAccessId [required]
[ "Alter", "this", "object", "properties" ]
train
https://github.com/UrielCh/ovh-java-sdk/blob/6d531a40e56e09701943e334c25f90f640c55701/ovh-java-sdk-dedicatedCloud/src/main/java/net/minidev/ovh/api/ApiOvhDedicatedCloud.java#L322-L326
gmessner/gitlab4j-api
src/main/java/org/gitlab4j/api/GitLabApiForm.java
GitLabApiForm.withParam
public GitLabApiForm withParam(String name, Date date, boolean required) throws IllegalArgumentException { """ Fluent method for adding Date query and form parameters to a get() or post() call. @param name the name of the field/attribute to add @param date the value of the field/attribute to add @param requir...
java
public GitLabApiForm withParam(String name, Date date, boolean required) throws IllegalArgumentException { return (withParam(name, (date == null ? null : ISO8601.toString(date)), required)); }
[ "public", "GitLabApiForm", "withParam", "(", "String", "name", ",", "Date", "date", ",", "boolean", "required", ")", "throws", "IllegalArgumentException", "{", "return", "(", "withParam", "(", "name", ",", "(", "date", "==", "null", "?", "null", ":", "ISO860...
Fluent method for adding Date query and form parameters to a get() or post() call. @param name the name of the field/attribute to add @param date the value of the field/attribute to add @param required the field is required flag @return this GitLabAPiForm instance @throws IllegalArgumentException if a required paramet...
[ "Fluent", "method", "for", "adding", "Date", "query", "and", "form", "parameters", "to", "a", "get", "()", "or", "post", "()", "call", "." ]
train
https://github.com/gmessner/gitlab4j-api/blob/ab045070abac0a8f4ccbf17b5ed9bfdef5723eed/src/main/java/org/gitlab4j/api/GitLabApiForm.java#L70-L72
redkale/redkale
src/org/redkale/convert/json/JsonWriter.java
JsonWriter.writeTo
public void writeTo(final boolean quote, final String value) { """ <b>注意:</b> 该String值不能为null且不会进行转义, 只用于不含需要转义字符的字符串,例如enum、double、BigInteger转换的String @param quote 是否加双引号 @param value 非null且不含需要转义的字符的String值 """ int len = value.length(); expand(len + (quote ? 2 : 0)); if (quote)...
java
public void writeTo(final boolean quote, final String value) { int len = value.length(); expand(len + (quote ? 2 : 0)); if (quote) content[count++] = '"'; value.getChars(0, len, content, count); count += len; if (quote) content[count++] = '"'; }
[ "public", "void", "writeTo", "(", "final", "boolean", "quote", ",", "final", "String", "value", ")", "{", "int", "len", "=", "value", ".", "length", "(", ")", ";", "expand", "(", "len", "+", "(", "quote", "?", "2", ":", "0", ")", ")", ";", "if", ...
<b>注意:</b> 该String值不能为null且不会进行转义, 只用于不含需要转义字符的字符串,例如enum、double、BigInteger转换的String @param quote 是否加双引号 @param value 非null且不含需要转义的字符的String值
[ "<b", ">", "注意:<", "/", "b", ">", "该String值不能为null且不会进行转义,", "只用于不含需要转义字符的字符串,例如enum、double、BigInteger转换的String" ]
train
https://github.com/redkale/redkale/blob/ea5169b5c5ea7412fd762331c0c497165832e901/src/org/redkale/convert/json/JsonWriter.java#L91-L98
spring-projects/spring-ldap
core/src/main/java/org/springframework/ldap/pool2/factory/PooledContextSource.java
PooledContextSource.getContext
protected DirContext getContext(DirContextType dirContextType) { """ Gets a DirContext of the specified type from the keyed object pool. @param dirContextType The type of context to return. @return A wrapped DirContext of the specified type. @throws DataAccessResourceFailureException If retrieving the object ...
java
protected DirContext getContext(DirContextType dirContextType) { final DirContext dirContext; try { dirContext = (DirContext) this.keyedObjectPool.borrowObject(dirContextType); } catch (Exception e) { throw new DataAccessResourceFailureException("Failed to borrow DirContext from pool.", e); } if (dir...
[ "protected", "DirContext", "getContext", "(", "DirContextType", "dirContextType", ")", "{", "final", "DirContext", "dirContext", ";", "try", "{", "dirContext", "=", "(", "DirContext", ")", "this", ".", "keyedObjectPool", ".", "borrowObject", "(", "dirContextType", ...
Gets a DirContext of the specified type from the keyed object pool. @param dirContextType The type of context to return. @return A wrapped DirContext of the specified type. @throws DataAccessResourceFailureException If retrieving the object from the pool throws an exception
[ "Gets", "a", "DirContext", "of", "the", "specified", "type", "from", "the", "keyed", "object", "pool", "." ]
train
https://github.com/spring-projects/spring-ldap/blob/15142d4ae18a9dc6b363a1ebf085e2bda9d9a4c0/core/src/main/java/org/springframework/ldap/pool2/factory/PooledContextSource.java#L257-L271
google/j2objc
xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/serializer/ToStream.java
ToStream.internalEntityDecl
public void internalEntityDecl(String name, String value) throws SAXException { """ Report an internal entity declaration. <p>Only the effective (first) declaration for each entity will be reported.</p> @param name The name of the entity. If it is a parameter entity, the name will begin with '%'. ...
java
public void internalEntityDecl(String name, String value) throws SAXException { // Do not inline external DTD if (m_inExternalDTD) return; try { DTDprolog(); outputEntityDecl(name, value); } catch (IOException e) { ...
[ "public", "void", "internalEntityDecl", "(", "String", "name", ",", "String", "value", ")", "throws", "SAXException", "{", "// Do not inline external DTD", "if", "(", "m_inExternalDTD", ")", "return", ";", "try", "{", "DTDprolog", "(", ")", ";", "outputEntityDecl"...
Report an internal entity declaration. <p>Only the effective (first) declaration for each entity will be reported.</p> @param name The name of the entity. If it is a parameter entity, the name will begin with '%'. @param value The replacement text of the entity. @exception SAXException The application may raise an e...
[ "Report", "an", "internal", "entity", "declaration", "." ]
train
https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/serializer/ToStream.java#L337-L353
Whiley/WhileyCompiler
src/main/java/wyc/io/WhileyFileParser.java
WhileyFileParser.parseAssignmentStatement
private Stmt parseAssignmentStatement(EnclosingScope scope) { """ Parse an assignment statement, which has the form: <pre> AssignStmt ::= LVal '=' Expr </pre> Here the <code>lhs</code> must be an <code>LVal</code> --- that is, an expression permitted on the left-side of an assignment. The following illus...
java
private Stmt parseAssignmentStatement(EnclosingScope scope) { int start = index; Tuple<LVal> lvals = parseLVals(scope); match(Equals); Tuple<Expr> rvals = parseExpressions(scope, false); int end = index; matchEndLine(); return annotateSourceLocation(new Stmt.Assign(lvals, rvals), start,end-1); }
[ "private", "Stmt", "parseAssignmentStatement", "(", "EnclosingScope", "scope", ")", "{", "int", "start", "=", "index", ";", "Tuple", "<", "LVal", ">", "lvals", "=", "parseLVals", "(", "scope", ")", ";", "match", "(", "Equals", ")", ";", "Tuple", "<", "Ex...
Parse an assignment statement, which has the form: <pre> AssignStmt ::= LVal '=' Expr </pre> Here the <code>lhs</code> must be an <code>LVal</code> --- that is, an expression permitted on the left-side of an assignment. The following illustrates different possible assignment statements: <pre> x = y // variable...
[ "Parse", "an", "assignment", "statement", "which", "has", "the", "form", ":" ]
train
https://github.com/Whiley/WhileyCompiler/blob/680f8a657d3fc286f8cc422755988b6d74ab3f4c/src/main/java/wyc/io/WhileyFileParser.java#L1421-L1429
looly/hutool
hutool-core/src/main/java/cn/hutool/core/io/IoUtil.java
IoUtil.copy
public static long copy(Reader reader, Writer writer, int bufferSize, StreamProgress streamProgress) throws IORuntimeException { """ 将Reader中的内容复制到Writer中 @param reader Reader @param writer Writer @param bufferSize 缓存大小 @param streamProgress 进度处理器 @return 传输的byte数 @throws IORuntimeException IO异常 """ ...
java
public static long copy(Reader reader, Writer writer, int bufferSize, StreamProgress streamProgress) throws IORuntimeException { char[] buffer = new char[bufferSize]; long size = 0; int readSize; if (null != streamProgress) { streamProgress.start(); } try { while ((readSize = reader.read(buffe...
[ "public", "static", "long", "copy", "(", "Reader", "reader", ",", "Writer", "writer", ",", "int", "bufferSize", ",", "StreamProgress", "streamProgress", ")", "throws", "IORuntimeException", "{", "char", "[", "]", "buffer", "=", "new", "char", "[", "bufferSize"...
将Reader中的内容复制到Writer中 @param reader Reader @param writer Writer @param bufferSize 缓存大小 @param streamProgress 进度处理器 @return 传输的byte数 @throws IORuntimeException IO异常
[ "将Reader中的内容复制到Writer中" ]
train
https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-core/src/main/java/cn/hutool/core/io/IoUtil.java#L100-L123
Waikato/moa
moa/src/main/java/moa/classifiers/lazy/neighboursearch/EuclideanDistance.java
EuclideanDistance.sqDifference
public double sqDifference(int index, double val1, double val2) { """ Returns the squared difference of two values of an attribute. @param index the attribute index @param val1 the first value @param val2 the second value @return the squared difference """ double val = difference(index, val1, val2);...
java
public double sqDifference(int index, double val1, double val2) { double val = difference(index, val1, val2); return val*val; }
[ "public", "double", "sqDifference", "(", "int", "index", ",", "double", "val1", ",", "double", "val2", ")", "{", "double", "val", "=", "difference", "(", "index", ",", "val1", ",", "val2", ")", ";", "return", "val", "*", "val", ";", "}" ]
Returns the squared difference of two values of an attribute. @param index the attribute index @param val1 the first value @param val2 the second value @return the squared difference
[ "Returns", "the", "squared", "difference", "of", "two", "values", "of", "an", "attribute", "." ]
train
https://github.com/Waikato/moa/blob/395982e5100bfe75a3a4d26115462ce2cc74cbb0/moa/src/main/java/moa/classifiers/lazy/neighboursearch/EuclideanDistance.java#L171-L174
thiagokimo/Faker
faker-core/src/main/java/io/kimo/lib/faker/Faker.java
Faker.fillWithProgress
public void fillWithProgress(ProgressBar view, FakerNumericComponent component) { """ Fill a @{link ProgressBar} with a random progress @param view @param component """ validateNotNullableView(view); validateIfIsAProgressBar(view); validateNotNullableFakerComponent(component); ...
java
public void fillWithProgress(ProgressBar view, FakerNumericComponent component) { validateNotNullableView(view); validateIfIsAProgressBar(view); validateNotNullableFakerComponent(component); view.setProgress(Math.abs(component.randomNumber().intValue())); }
[ "public", "void", "fillWithProgress", "(", "ProgressBar", "view", ",", "FakerNumericComponent", "component", ")", "{", "validateNotNullableView", "(", "view", ")", ";", "validateIfIsAProgressBar", "(", "view", ")", ";", "validateNotNullableFakerComponent", "(", "compone...
Fill a @{link ProgressBar} with a random progress @param view @param component
[ "Fill", "a" ]
train
https://github.com/thiagokimo/Faker/blob/8b0eccd499817a2bc3377db0c6e1b50736d0f034/faker-core/src/main/java/io/kimo/lib/faker/Faker.java#L177-L183
kstateome/canvas-api
src/main/java/edu/ksu/canvas/util/CanvasURLBuilder.java
CanvasURLBuilder.buildCanvasUrl
public static String buildCanvasUrl(String canvasBaseUrl, int canvasAPIVersion, String canvasMethod, Map<String, List<String>> parameters) { """ /* Builds parameters in form of ?param[]=value1&param[]=value2&otherParam=someValue """ canvasMethod = removeForwardSlashIfExists(canvasMethod); Strin...
java
public static String buildCanvasUrl(String canvasBaseUrl, int canvasAPIVersion, String canvasMethod, Map<String, List<String>> parameters) { canvasMethod = removeForwardSlashIfExists(canvasMethod); String url = canvasBaseUrl + "/api/v" + canvasAPIVersion + "/" + canvasMethod; String finalUrl = ...
[ "public", "static", "String", "buildCanvasUrl", "(", "String", "canvasBaseUrl", ",", "int", "canvasAPIVersion", ",", "String", "canvasMethod", ",", "Map", "<", "String", ",", "List", "<", "String", ">", ">", "parameters", ")", "{", "canvasMethod", "=", "remove...
/* Builds parameters in form of ?param[]=value1&param[]=value2&otherParam=someValue
[ "/", "*", "Builds", "parameters", "in", "form", "of", "?param", "[]", "=", "value1&param", "[]", "=", "value2&otherParam", "=", "someValue" ]
train
https://github.com/kstateome/canvas-api/blob/426bf403a8fd7aca3f170348005feda25b374e5a/src/main/java/edu/ksu/canvas/util/CanvasURLBuilder.java#L12-L18
jnidzwetzki/bitfinex-v2-wss-api-java
src/main/java/com/github/jnidzwetzki/bitfinex/v2/symbol/BitfinexSymbols.java
BitfinexSymbols.orderBook
public static BitfinexOrderBookSymbol orderBook(final String currency, final String profitCurrency, final BitfinexOrderBookSymbol.Precision precision, final BitfinexOrderBookSymbol.Frequency frequency, final int pricePoints) { """ Returns symbol for candlestick channel @param currency of orde...
java
public static BitfinexOrderBookSymbol orderBook(final String currency, final String profitCurrency, final BitfinexOrderBookSymbol.Precision precision, final BitfinexOrderBookSymbol.Frequency frequency, final int pricePoints) { final String currencyNonNull = Objects.requireNonNull(currency).to...
[ "public", "static", "BitfinexOrderBookSymbol", "orderBook", "(", "final", "String", "currency", ",", "final", "String", "profitCurrency", ",", "final", "BitfinexOrderBookSymbol", ".", "Precision", "precision", ",", "final", "BitfinexOrderBookSymbol", ".", "Frequency", "...
Returns symbol for candlestick channel @param currency of order book @param profitCurrency of order book @param precision of order book @param frequency of order book @param pricePoints in initial snapshot @return symbol
[ "Returns", "symbol", "for", "candlestick", "channel" ]
train
https://github.com/jnidzwetzki/bitfinex-v2-wss-api-java/blob/2e6adf1eb6f8cd4c8722f1619f78ab2cc3c600ee/src/main/java/com/github/jnidzwetzki/bitfinex/v2/symbol/BitfinexSymbols.java#L155-L163
baratine/baratine
framework/src/main/java/com/caucho/v5/ramp/jamp/InJamp.java
InJamp.readMessages
public int readMessages(Reader is) throws IOException { """ Reads the next HMTP packet from the stream, returning false on end of file. """ //InboxAmp oldInbox = null; try (OutboxAmp outbox = OutboxAmp.currentOrCreate(getManager())) { //OutboxThreadLocal.setCurrent(_outbox); retur...
java
public int readMessages(Reader is) throws IOException { //InboxAmp oldInbox = null; try (OutboxAmp outbox = OutboxAmp.currentOrCreate(getManager())) { //OutboxThreadLocal.setCurrent(_outbox); return readMessages(is, outbox); } finally { //OutboxThreadLocal.setCurrent(null); ...
[ "public", "int", "readMessages", "(", "Reader", "is", ")", "throws", "IOException", "{", "//InboxAmp oldInbox = null;", "try", "(", "OutboxAmp", "outbox", "=", "OutboxAmp", ".", "currentOrCreate", "(", "getManager", "(", ")", ")", ")", "{", "//OutboxThreadLocal.se...
Reads the next HMTP packet from the stream, returning false on end of file.
[ "Reads", "the", "next", "HMTP", "packet", "from", "the", "stream", "returning", "false", "on", "end", "of", "file", "." ]
train
https://github.com/baratine/baratine/blob/db34b45c03c5a5e930d8142acc72319125569fcf/framework/src/main/java/com/caucho/v5/ramp/jamp/InJamp.java#L199-L210
raphw/byte-buddy
byte-buddy-gradle-plugin/src/main/java/net/bytebuddy/build/gradle/Initialization.java
Initialization.getEntryPoint
public EntryPoint getEntryPoint(ClassLoaderResolver classLoaderResolver, File root, Iterable<? extends File> classPath) { """ Resolves this initialization to an entry point instance. @param classLoaderResolver The class loader resolver to use if appropriate. @param root The root file describing ...
java
public EntryPoint getEntryPoint(ClassLoaderResolver classLoaderResolver, File root, Iterable<? extends File> classPath) { if (entryPoint == null || entryPoint.length() == 0) { throw new GradleException("Entry point name is not defined"); } for (EntryPoint.Default entryPoint : EntryPo...
[ "public", "EntryPoint", "getEntryPoint", "(", "ClassLoaderResolver", "classLoaderResolver", ",", "File", "root", ",", "Iterable", "<", "?", "extends", "File", ">", "classPath", ")", "{", "if", "(", "entryPoint", "==", "null", "||", "entryPoint", ".", "length", ...
Resolves this initialization to an entry point instance. @param classLoaderResolver The class loader resolver to use if appropriate. @param root The root file describing the current tasks classes. @param classPath The class path of the current task. @return A resolved entry point.
[ "Resolves", "this", "initialization", "to", "an", "entry", "point", "instance", "." ]
train
https://github.com/raphw/byte-buddy/blob/4d2dac80efb6bed89367567260f6811c2f712d12/byte-buddy-gradle-plugin/src/main/java/net/bytebuddy/build/gradle/Initialization.java#L61-L77
haraldk/TwelveMonkeys
sandbox/sandbox-servlet/src/main/java/com/twelvemonkeys/servlet/jsp/taglib/logic/IteratorProviderTEI.java
IteratorProviderTEI.getVariableInfo
public VariableInfo[] getVariableInfo(TagData pData) { """ Gets the variable info for IteratorProvider tags. The attribute with the name defined by the "id" attribute and type defined by the "type" attribute is declared with scope {@code VariableInfo.AT_END}. @param pData TagData instance provided by containe...
java
public VariableInfo[] getVariableInfo(TagData pData) { // Get attribute name String attributeName = pData.getId(); if (attributeName == null) { attributeName = IteratorProviderTag.getDefaultIteratorName(); } // Get type String type = pData.getAttribut...
[ "public", "VariableInfo", "[", "]", "getVariableInfo", "(", "TagData", "pData", ")", "{", "// Get attribute name\r", "String", "attributeName", "=", "pData", ".", "getId", "(", ")", ";", "if", "(", "attributeName", "==", "null", ")", "{", "attributeName", "=",...
Gets the variable info for IteratorProvider tags. The attribute with the name defined by the "id" attribute and type defined by the "type" attribute is declared with scope {@code VariableInfo.AT_END}. @param pData TagData instance provided by container @return an VariableInfo array of lenght 1, containing the attribut...
[ "Gets", "the", "variable", "info", "for", "IteratorProvider", "tags", ".", "The", "attribute", "with", "the", "name", "defined", "by", "the", "id", "attribute", "and", "type", "defined", "by", "the", "type", "attribute", "is", "declared", "with", "scope", "{...
train
https://github.com/haraldk/TwelveMonkeys/blob/7fad4d5cd8cb3a6728c7fd3f28a7b84d8ce0101d/sandbox/sandbox-servlet/src/main/java/com/twelvemonkeys/servlet/jsp/taglib/logic/IteratorProviderTEI.java#L22-L39
52inc/android-52Kit
library/src/main/java/com/ftinc/kit/util/MediaUtils.java
MediaUtils.grantPermissions
private static void grantPermissions(Context ctx, Uri uri) { """ Grant URI permissions for all potential camera applications that can handle the capture intent. """ Intent intent = new Intent(MediaStore.ACTION_IMAGE_CAPTURE); List<ResolveInfo> resolvedIntentActivities = ctx.getPackageManager()...
java
private static void grantPermissions(Context ctx, Uri uri){ Intent intent = new Intent(MediaStore.ACTION_IMAGE_CAPTURE); List<ResolveInfo> resolvedIntentActivities = ctx.getPackageManager().queryIntentActivities(intent, PackageManager.MATCH_DEFAULT_ONLY); for (ResolveInfo resolvedIntentInfo : re...
[ "private", "static", "void", "grantPermissions", "(", "Context", "ctx", ",", "Uri", "uri", ")", "{", "Intent", "intent", "=", "new", "Intent", "(", "MediaStore", ".", "ACTION_IMAGE_CAPTURE", ")", ";", "List", "<", "ResolveInfo", ">", "resolvedIntentActivities", ...
Grant URI permissions for all potential camera applications that can handle the capture intent.
[ "Grant", "URI", "permissions", "for", "all", "potential", "camera", "applications", "that", "can", "handle", "the", "capture", "intent", "." ]
train
https://github.com/52inc/android-52Kit/blob/8644fab0f633477b1bb1dddd8147a9ef8bc03516/library/src/main/java/com/ftinc/kit/util/MediaUtils.java#L255-L266
burberius/eve-esi
src/main/java/net/troja/eve/esi/api/UserInterfaceApi.java
UserInterfaceApi.postUiOpenwindowMarketdetails
public void postUiOpenwindowMarketdetails(Integer typeId, String datasource, String token) throws ApiException { """ Open Market Details Open the market details window for a specific typeID inside the client --- SSO Scope: esi-ui.open_window.v1 @param typeId The item type to open in market window (required) ...
java
public void postUiOpenwindowMarketdetails(Integer typeId, String datasource, String token) throws ApiException { postUiOpenwindowMarketdetailsWithHttpInfo(typeId, datasource, token); }
[ "public", "void", "postUiOpenwindowMarketdetails", "(", "Integer", "typeId", ",", "String", "datasource", ",", "String", "token", ")", "throws", "ApiException", "{", "postUiOpenwindowMarketdetailsWithHttpInfo", "(", "typeId", ",", "datasource", ",", "token", ")", ";",...
Open Market Details Open the market details window for a specific typeID inside the client --- SSO Scope: esi-ui.open_window.v1 @param typeId The item type to open in market window (required) @param datasource The server name you would like data from (optional, default to tranquility) @param token Access token to use ...
[ "Open", "Market", "Details", "Open", "the", "market", "details", "window", "for", "a", "specific", "typeID", "inside", "the", "client", "---", "SSO", "Scope", ":", "esi", "-", "ui", ".", "open_window", ".", "v1" ]
train
https://github.com/burberius/eve-esi/blob/24a941c592cfc15f23471ef849b282fbc582ca13/src/main/java/net/troja/eve/esi/api/UserInterfaceApi.java#L620-L622
xiaosunzhu/resource-utils
src/main/java/net/sunyijun/resource/config/Configs.java
Configs.setSystemConfigs
public static void setSystemConfigs(String systemConfigAbsoluteClassPath, OneProperties systemConfigsObj) { """ <p>Set self define system configs.</p> Can use self system configs path or self class extends {@link OneProperties}. @param systemConfigAbsoluteClassPath self system configs absolute class path. Can...
java
public static void setSystemConfigs(String systemConfigAbsoluteClassPath, OneProperties systemConfigsObj) { if (systemConfigsObj != null) { Configs.systemConfigs = systemConfigsObj; } if (systemConfigAbsoluteClassPath != null) { Configs.systemConfigAbsoluteClassPath ...
[ "public", "static", "void", "setSystemConfigs", "(", "String", "systemConfigAbsoluteClassPath", ",", "OneProperties", "systemConfigsObj", ")", "{", "if", "(", "systemConfigsObj", "!=", "null", ")", "{", "Configs", ".", "systemConfigs", "=", "systemConfigsObj", ";", ...
<p>Set self define system configs.</p> Can use self system configs path or self class extends {@link OneProperties}. @param systemConfigAbsoluteClassPath self system configs absolute class path. Can be null, if null means use default path "{@value #DEFAULT_SYSTEM_CONFIG_ABSOLUTE_CLASS_PATH}" @param systemConfigsObj ...
[ "<p", ">", "Set", "self", "define", "system", "configs", ".", "<", "/", "p", ">", "Can", "use", "self", "system", "configs", "path", "or", "self", "class", "extends", "{", "@link", "OneProperties", "}", "." ]
train
https://github.com/xiaosunzhu/resource-utils/blob/4f2bf3f36df10195a978f122ed682ba1eb0462b5/src/main/java/net/sunyijun/resource/config/Configs.java#L619-L629
Alluxio/alluxio
core/server/common/src/main/java/alluxio/master/journal/ufs/UfsJournalFile.java
UfsJournalFile.encodeCheckpointFileLocation
static URI encodeCheckpointFileLocation(UfsJournal journal, long end) { """ Encodes a checkpoint location under the checkpoint directory. @param journal the UFS journal instance @param end the end sequence number (exclusive) @return the location """ String filename = String.format("0x%x-0x%x", 0, end)...
java
static URI encodeCheckpointFileLocation(UfsJournal journal, long end) { String filename = String.format("0x%x-0x%x", 0, end); URI location = URIUtils.appendPathOrDie(journal.getCheckpointDir(), filename); return location; }
[ "static", "URI", "encodeCheckpointFileLocation", "(", "UfsJournal", "journal", ",", "long", "end", ")", "{", "String", "filename", "=", "String", ".", "format", "(", "\"0x%x-0x%x\"", ",", "0", ",", "end", ")", ";", "URI", "location", "=", "URIUtils", ".", ...
Encodes a checkpoint location under the checkpoint directory. @param journal the UFS journal instance @param end the end sequence number (exclusive) @return the location
[ "Encodes", "a", "checkpoint", "location", "under", "the", "checkpoint", "directory", "." ]
train
https://github.com/Alluxio/alluxio/blob/af38cf3ab44613355b18217a3a4d961f8fec3a10/core/server/common/src/main/java/alluxio/master/journal/ufs/UfsJournalFile.java#L113-L117
jcustenborder/connect-utils
connect-utils/src/main/java/com/github/jcustenborder/kafka/connect/utils/config/ValidPort.java
ValidPort.ensureValid
@Override public void ensureValid(String setting, Object value) { """ Method is used to validate that the supplied port is within the valid range. @param setting name of the setting being tested. @param value value being tested. """ if (null == value || !(value instanceof Integer)) { throw ne...
java
@Override public void ensureValid(String setting, Object value) { if (null == value || !(value instanceof Integer)) { throw new ConfigException(setting, "Must be an integer."); } final Integer port = (Integer) value; if (!(port >= this.start && port <= this.end)) { throw new ConfigExcepti...
[ "@", "Override", "public", "void", "ensureValid", "(", "String", "setting", ",", "Object", "value", ")", "{", "if", "(", "null", "==", "value", "||", "!", "(", "value", "instanceof", "Integer", ")", ")", "{", "throw", "new", "ConfigException", "(", "sett...
Method is used to validate that the supplied port is within the valid range. @param setting name of the setting being tested. @param value value being tested.
[ "Method", "is", "used", "to", "validate", "that", "the", "supplied", "port", "is", "within", "the", "valid", "range", "." ]
train
https://github.com/jcustenborder/connect-utils/blob/19add138921f59ffcc85282d7aad551eeb582370/connect-utils/src/main/java/com/github/jcustenborder/kafka/connect/utils/config/ValidPort.java#L75-L88
Netflix/ribbon
ribbon-loadbalancer/src/main/java/com/netflix/client/PrimeConnections.java
PrimeConnections.primeConnections
public void primeConnections(List<Server> servers) { """ Prime connections, blocking until configured percentage (default is 100%) of target servers are primed or max time is reached. @see CommonClientConfigKey#MinPrimeConnectionsRatio @see CommonClientConfigKey#MaxTotalTimeToPrimeConnections """ ...
java
public void primeConnections(List<Server> servers) { if (servers == null || servers.size() == 0) { logger.debug("No server to prime"); return; } for (Server server: servers) { server.setReadyToServe(false); } int totalCount = (int) (servers.siz...
[ "public", "void", "primeConnections", "(", "List", "<", "Server", ">", "servers", ")", "{", "if", "(", "servers", "==", "null", "||", "servers", ".", "size", "(", ")", "==", "0", ")", "{", "logger", ".", "debug", "(", "\"No server to prime\"", ")", ";"...
Prime connections, blocking until configured percentage (default is 100%) of target servers are primed or max time is reached. @see CommonClientConfigKey#MinPrimeConnectionsRatio @see CommonClientConfigKey#MaxTotalTimeToPrimeConnections
[ "Prime", "connections", "blocking", "until", "configured", "percentage", "(", "default", "is", "100%", ")", "of", "target", "servers", "are", "primed", "or", "max", "time", "is", "reached", "." ]
train
https://github.com/Netflix/ribbon/blob/d15cd7715b0bf2f64ae6ca98c5e4d184f178e261/ribbon-loadbalancer/src/main/java/com/netflix/client/PrimeConnections.java#L198-L235
zeroturnaround/zt-zip
src/main/java/org/zeroturnaround/zip/ZipUtil.java
ZipUtil.doUnpackEntry
private static boolean doUnpackEntry(ZipFile zf, String name, File file) throws IOException { """ Unpacks a single file from a ZIP archive to a file. @param zf ZIP file. @param name entry name. @param file target file to be created or overwritten. @return <code>true</code> if the entry was found and unpac...
java
private static boolean doUnpackEntry(ZipFile zf, String name, File file) throws IOException { if (log.isTraceEnabled()) { log.trace("Extracting '" + zf.getName() + "' entry '" + name + "' into '" + file + "'."); } ZipEntry ze = zf.getEntry(name); if (ze == null) { return false; // entry not...
[ "private", "static", "boolean", "doUnpackEntry", "(", "ZipFile", "zf", ",", "String", "name", ",", "File", "file", ")", "throws", "IOException", "{", "if", "(", "log", ".", "isTraceEnabled", "(", ")", ")", "{", "log", ".", "trace", "(", "\"Extracting '\"",...
Unpacks a single file from a ZIP archive to a file. @param zf ZIP file. @param name entry name. @param file target file to be created or overwritten. @return <code>true</code> if the entry was found and unpacked, <code>false</code> if the entry was not found.
[ "Unpacks", "a", "single", "file", "from", "a", "ZIP", "archive", "to", "a", "file", "." ]
train
https://github.com/zeroturnaround/zt-zip/blob/abb4dc43583e4d19339c0c021035019798970a13/src/main/java/org/zeroturnaround/zip/ZipUtil.java#L389-L417
intendia-oss/rxjava-gwt
src/main/modified/io/reactivex/super/io/reactivex/Flowable.java
Flowable.observeOn
@CheckReturnValue @BackpressureSupport(BackpressureKind.FULL) @SchedulerSupport(SchedulerSupport.CUSTOM) public final Flowable<T> observeOn(Scheduler scheduler, boolean delayError, int bufferSize) { """ Modifies a Publisher to perform its emissions and notifications on a specified {@link Scheduler}, a...
java
@CheckReturnValue @BackpressureSupport(BackpressureKind.FULL) @SchedulerSupport(SchedulerSupport.CUSTOM) public final Flowable<T> observeOn(Scheduler scheduler, boolean delayError, int bufferSize) { ObjectHelper.requireNonNull(scheduler, "scheduler is null"); ObjectHelper.verifyPositive(buff...
[ "@", "CheckReturnValue", "@", "BackpressureSupport", "(", "BackpressureKind", ".", "FULL", ")", "@", "SchedulerSupport", "(", "SchedulerSupport", ".", "CUSTOM", ")", "public", "final", "Flowable", "<", "T", ">", "observeOn", "(", "Scheduler", "scheduler", ",", "...
Modifies a Publisher to perform its emissions and notifications on a specified {@link Scheduler}, asynchronously with a bounded buffer of configurable size and optionally delays onError notifications. <p> <img width="640" height="308" src="https://raw.github.com/wiki/ReactiveX/RxJava/images/rx-operators/observeOn.png" ...
[ "Modifies", "a", "Publisher", "to", "perform", "its", "emissions", "and", "notifications", "on", "a", "specified", "{", "@link", "Scheduler", "}", "asynchronously", "with", "a", "bounded", "buffer", "of", "configurable", "size", "and", "optionally", "delays", "o...
train
https://github.com/intendia-oss/rxjava-gwt/blob/8d5635b12ce40da99e76b59dc6bfe6fc2fffc1fa/src/main/modified/io/reactivex/super/io/reactivex/Flowable.java#L11292-L11299
xiancloud/xian
xian-oauth20/xian-apifestOauth20/src/main/java/com/apifest/oauth20/ScopeService.java
ScopeService.getScopes
public String getScopes(HttpRequest req) throws OAuthException { """ Returns either all scopes or scopes for a specific client_id passed as query parameter. @param req request @return string If query param client_id is passed, then the scopes for that client_id will be returned. Otherwise, all available scope...
java
public String getScopes(HttpRequest req) throws OAuthException { QueryStringDecoder dec = new QueryStringDecoder(req.uri()); Map<String, List<String>> queryParams = dec.parameters(); if (queryParams.containsKey("client_id")) { return getScopes(queryParams.get("client_id").get(0)); ...
[ "public", "String", "getScopes", "(", "HttpRequest", "req", ")", "throws", "OAuthException", "{", "QueryStringDecoder", "dec", "=", "new", "QueryStringDecoder", "(", "req", ".", "uri", "(", ")", ")", ";", "Map", "<", "String", ",", "List", "<", "String", "...
Returns either all scopes or scopes for a specific client_id passed as query parameter. @param req request @return string If query param client_id is passed, then the scopes for that client_id will be returned. Otherwise, all available scopes will be returned in JSON format.
[ "Returns", "either", "all", "scopes", "or", "scopes", "for", "a", "specific", "client_id", "passed", "as", "query", "parameter", "." ]
train
https://github.com/xiancloud/xian/blob/1948e088545553d2745b2c86d8b5a64988bb850e/xian-oauth20/xian-apifestOauth20/src/main/java/com/apifest/oauth20/ScopeService.java#L108-L123
PureSolTechnologies/parsers
parsers/src/main/java/com/puresoltechnologies/parsers/grammar/GrammarConverter.java
GrammarConverter.createNewIdentifier
private String createNewIdentifier(ParseTreeNode productionPart, String suffix) throws TreeException { """ This method generates a new construction identifier for an automatically generated BNF production for optionals, optional lists and lists. @param productionPart @param suffix @return @throws TreeE...
java
private String createNewIdentifier(ParseTreeNode productionPart, String suffix) throws TreeException { String identifier = ""; if (productionPart.hasChild("IDENTIFIER")) { identifier = productionPart.getChild("IDENTIFIER").getText(); } else if (productionPart.hasChild("STRING_LITERAL")) { identifier =...
[ "private", "String", "createNewIdentifier", "(", "ParseTreeNode", "productionPart", ",", "String", "suffix", ")", "throws", "TreeException", "{", "String", "identifier", "=", "\"\"", ";", "if", "(", "productionPart", ".", "hasChild", "(", "\"IDENTIFIER\"", ")", ")...
This method generates a new construction identifier for an automatically generated BNF production for optionals, optional lists and lists. @param productionPart @param suffix @return @throws TreeException
[ "This", "method", "generates", "a", "new", "construction", "identifier", "for", "an", "automatically", "generated", "BNF", "production", "for", "optionals", "optional", "lists", "and", "lists", "." ]
train
https://github.com/PureSolTechnologies/parsers/blob/61077223b90d3768ff9445ae13036343c98b63cd/parsers/src/main/java/com/puresoltechnologies/parsers/grammar/GrammarConverter.java#L499-L508
liferay/com-liferay-commerce
commerce-price-list-service/src/main/java/com/liferay/commerce/price/list/service/persistence/impl/CommercePriceEntryPersistenceImpl.java
CommercePriceEntryPersistenceImpl.findAll
@Override public List<CommercePriceEntry> findAll(int start, int end) { """ Returns a range of all the commerce price entries. <p> Useful when paginating results. Returns a maximum of <code>end - start</code> instances. <code>start</code> and <code>end</code> are not primary keys, they are indexes in the resu...
java
@Override public List<CommercePriceEntry> findAll(int start, int end) { return findAll(start, end, null); }
[ "@", "Override", "public", "List", "<", "CommercePriceEntry", ">", "findAll", "(", "int", "start", ",", "int", "end", ")", "{", "return", "findAll", "(", "start", ",", "end", ",", "null", ")", ";", "}" ]
Returns a range of all the commerce price entries. <p> Useful when paginating results. Returns a maximum of <code>end - start</code> instances. <code>start</code> and <code>end</code> are not primary keys, they are indexes in the result set. Thus, <code>0</code> refers to the first result in the set. Setting both <cod...
[ "Returns", "a", "range", "of", "all", "the", "commerce", "price", "entries", "." ]
train
https://github.com/liferay/com-liferay-commerce/blob/9e54362d7f59531fc684016ba49ee7cdc3a2f22b/commerce-price-list-service/src/main/java/com/liferay/commerce/price/list/service/persistence/impl/CommercePriceEntryPersistenceImpl.java#L4915-L4918
pgjdbc/pgjdbc
pgjdbc/src/main/java/org/postgresql/fastpath/Fastpath.java
Fastpath.getLong
public long getLong(String name, FastpathArg[] args) throws SQLException { """ This convenience method assumes that the return value is a long (bigint). @param name Function name @param args Function arguments @return long result @throws SQLException if a database-access error occurs or no result """ ...
java
public long getLong(String name, FastpathArg[] args) throws SQLException { byte[] returnValue = fastpath(name, args); if (returnValue == null) { throw new PSQLException( GT.tr("Fastpath call {0} - No result was returned and we expected a long.", name), PSQLState.NO_DATA); } if ...
[ "public", "long", "getLong", "(", "String", "name", ",", "FastpathArg", "[", "]", "args", ")", "throws", "SQLException", "{", "byte", "[", "]", "returnValue", "=", "fastpath", "(", "name", ",", "args", ")", ";", "if", "(", "returnValue", "==", "null", ...
This convenience method assumes that the return value is a long (bigint). @param name Function name @param args Function arguments @return long result @throws SQLException if a database-access error occurs or no result
[ "This", "convenience", "method", "assumes", "that", "the", "return", "value", "is", "a", "long", "(", "bigint", ")", "." ]
train
https://github.com/pgjdbc/pgjdbc/blob/95ba7b261e39754674c5817695ae5ebf9a341fae/pgjdbc/src/main/java/org/postgresql/fastpath/Fastpath.java#L182-L198
Azure/azure-sdk-for-java
appservice/resource-manager/v2018_02_01/src/main/java/com/microsoft/azure/management/appservice/v2018_02_01/implementation/AppServiceCertificateOrdersInner.java
AppServiceCertificateOrdersInner.retrieveCertificateEmailHistory
public List<CertificateEmailInner> retrieveCertificateEmailHistory(String resourceGroupName, String name) { """ Retrieve email history. Retrieve email history. @param resourceGroupName Name of the resource group to which the resource belongs. @param name Name of the certificate order. @throws IllegalArgument...
java
public List<CertificateEmailInner> retrieveCertificateEmailHistory(String resourceGroupName, String name) { return retrieveCertificateEmailHistoryWithServiceResponseAsync(resourceGroupName, name).toBlocking().single().body(); }
[ "public", "List", "<", "CertificateEmailInner", ">", "retrieveCertificateEmailHistory", "(", "String", "resourceGroupName", ",", "String", "name", ")", "{", "return", "retrieveCertificateEmailHistoryWithServiceResponseAsync", "(", "resourceGroupName", ",", "name", ")", ".",...
Retrieve email history. Retrieve email history. @param resourceGroupName Name of the resource group to which the resource belongs. @param name Name of the certificate order. @throws IllegalArgumentException thrown if parameters fail the validation @throws DefaultErrorResponseException thrown if the request is rejected...
[ "Retrieve", "email", "history", ".", "Retrieve", "email", "history", "." ]
train
https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/appservice/resource-manager/v2018_02_01/src/main/java/com/microsoft/azure/management/appservice/v2018_02_01/implementation/AppServiceCertificateOrdersInner.java#L2324-L2326
pugwoo/nimble-orm
src/main/java/com/pugwoo/dbhelper/sql/SQLUtils.java
SQLUtils.getKeysWhereSQL
public static <T> String getKeysWhereSQL(T t, List<Object> keyValues) throws NoKeyColumnAnnotationException, NullKeyValueException { """ 获得主键where子句,包含where关键字。会自动处理软删除条件 @param t @param keyValues 返回传入sql的参数,如果提供list则写入 @return 返回值前面会带空格,以确保安全。 @throws NoKeyColumnAnnotationException @throws NullKeyVal...
java
public static <T> String getKeysWhereSQL(T t, List<Object> keyValues) throws NoKeyColumnAnnotationException, NullKeyValueException { List<Field> keyFields = DOInfoReader.getKeyColumns(t.getClass()); List<Object> _keyValues = new ArrayList<Object>(); String where = joinWhereAndGetValue(keyFields, "AND"...
[ "public", "static", "<", "T", ">", "String", "getKeysWhereSQL", "(", "T", "t", ",", "List", "<", "Object", ">", "keyValues", ")", "throws", "NoKeyColumnAnnotationException", ",", "NullKeyValueException", "{", "List", "<", "Field", ">", "keyFields", "=", "DOInf...
获得主键where子句,包含where关键字。会自动处理软删除条件 @param t @param keyValues 返回传入sql的参数,如果提供list则写入 @return 返回值前面会带空格,以确保安全。 @throws NoKeyColumnAnnotationException @throws NullKeyValueException
[ "获得主键where子句,包含where关键字。会自动处理软删除条件" ]
train
https://github.com/pugwoo/nimble-orm/blob/dd496f3e57029e4f22f9a2f00d18a6513ef94d08/src/main/java/com/pugwoo/dbhelper/sql/SQLUtils.java#L154-L174
albfernandez/itext2
src/main/java/com/lowagie/text/pdf/Type1Font.java
Type1Font.getRawWidth
int getRawWidth(int c, String name) { """ Gets the width from the font according to the <CODE>name</CODE> or, if the <CODE>name</CODE> is null, meaning it is a symbolic font, the char <CODE>c</CODE>. @param c the char if the font is symbolic @param name the glyph name @return the width of the char """ ...
java
int getRawWidth(int c, String name) { Object metrics[]; if (name == null) { // font specific metrics = (Object[])CharMetrics.get(Integer.valueOf(c)); } else { if (name.equals(".notdef")) return 0; metrics = (Object[])CharMetrics.get(nam...
[ "int", "getRawWidth", "(", "int", "c", ",", "String", "name", ")", "{", "Object", "metrics", "[", "]", ";", "if", "(", "name", "==", "null", ")", "{", "// font specific", "metrics", "=", "(", "Object", "[", "]", ")", "CharMetrics", ".", "get", "(", ...
Gets the width from the font according to the <CODE>name</CODE> or, if the <CODE>name</CODE> is null, meaning it is a symbolic font, the char <CODE>c</CODE>. @param c the char if the font is symbolic @param name the glyph name @return the width of the char
[ "Gets", "the", "width", "from", "the", "font", "according", "to", "the", "<CODE", ">", "name<", "/", "CODE", ">", "or", "if", "the", "<CODE", ">", "name<", "/", "CODE", ">", "is", "null", "meaning", "it", "is", "a", "symbolic", "font", "the", "char",...
train
https://github.com/albfernandez/itext2/blob/438fc1899367fd13dfdfa8dfdca9a3c1a7783b84/src/main/java/com/lowagie/text/pdf/Type1Font.java#L295-L308
osmdroid/osmdroid
osmdroid-mapsforge/src/main/java/org/osmdroid/mapsforge/MapsForgeTileSource.java
MapsForgeTileSource.renderTile
public synchronized Drawable renderTile(final long pMapTileIndex) { """ The synchronized here is VERY important. If missing, the mapDatabase read gets corrupted by multiple threads reading the file at once. """ Tile tile = new Tile(MapTileIndex.getX(pMapTileIndex), MapTileIndex.getY(pMapTileIndex), (...
java
public synchronized Drawable renderTile(final long pMapTileIndex) { Tile tile = new Tile(MapTileIndex.getX(pMapTileIndex), MapTileIndex.getY(pMapTileIndex), (byte) MapTileIndex.getZoom(pMapTileIndex), 256); model.setFixedTileSize(256); //You could try something like this to load a custom theme...
[ "public", "synchronized", "Drawable", "renderTile", "(", "final", "long", "pMapTileIndex", ")", "{", "Tile", "tile", "=", "new", "Tile", "(", "MapTileIndex", ".", "getX", "(", "pMapTileIndex", ")", ",", "MapTileIndex", ".", "getY", "(", "pMapTileIndex", ")", ...
The synchronized here is VERY important. If missing, the mapDatabase read gets corrupted by multiple threads reading the file at once.
[ "The", "synchronized", "here", "is", "VERY", "important", ".", "If", "missing", "the", "mapDatabase", "read", "gets", "corrupted", "by", "multiple", "threads", "reading", "the", "file", "at", "once", "." ]
train
https://github.com/osmdroid/osmdroid/blob/3b178b2f078497dd88c137110e87aafe45ad2b16/osmdroid-mapsforge/src/main/java/org/osmdroid/mapsforge/MapsForgeTileSource.java#L178-L207
opencb/biodata
biodata-tools/src/main/java/org/opencb/biodata/tools/variant/metadata/VariantMetadataManager.java
VariantMetadataManager.removeFile
public void removeFile(VariantFileMetadata file, String studyId) { """ Remove a variant file metadata of a given variant study metadata (from study ID). @param file File @param studyId Study ID """ // Sanity check if (file == null) { logger.error("Variant file metadata is...
java
public void removeFile(VariantFileMetadata file, String studyId) { // Sanity check if (file == null) { logger.error("Variant file metadata is null."); return; } removeFile(file.getId(), studyId); }
[ "public", "void", "removeFile", "(", "VariantFileMetadata", "file", ",", "String", "studyId", ")", "{", "// Sanity check", "if", "(", "file", "==", "null", ")", "{", "logger", ".", "error", "(", "\"Variant file metadata is null.\"", ")", ";", "return", ";", "}...
Remove a variant file metadata of a given variant study metadata (from study ID). @param file File @param studyId Study ID
[ "Remove", "a", "variant", "file", "metadata", "of", "a", "given", "variant", "study", "metadata", "(", "from", "study", "ID", ")", "." ]
train
https://github.com/opencb/biodata/blob/21b3d51d71f578efab908422aca4bab7a73097b1/biodata-tools/src/main/java/org/opencb/biodata/tools/variant/metadata/VariantMetadataManager.java#L283-L290
Jasig/uPortal
uPortal-api/uPortal-api-internal/src/main/java/org/apereo/portal/portlets/groupadmin/GroupAdministrationHelper.java
GroupAdministrationHelper.createGroup
public void createGroup(GroupForm groupForm, JsonEntityBean parent, IPerson creator) { """ Create a new group under the specified parent. The new group will automatically be added to the parent group. @param groupForm form object representing the new group @param parent parent group for this new group @param...
java
public void createGroup(GroupForm groupForm, JsonEntityBean parent, IPerson creator) { if (!canCreateMemberGroup(creator, parent.getId())) { throw new RuntimeAuthorizationException( creator, IPermission.CREATE_GROUP_ACTIVITY, groupForm.getKey()); } if (log.isDeb...
[ "public", "void", "createGroup", "(", "GroupForm", "groupForm", ",", "JsonEntityBean", "parent", ",", "IPerson", "creator", ")", "{", "if", "(", "!", "canCreateMemberGroup", "(", "creator", ",", "parent", ".", "getId", "(", ")", ")", ")", "{", "throw", "ne...
Create a new group under the specified parent. The new group will automatically be added to the parent group. @param groupForm form object representing the new group @param parent parent group for this new group @param creator the uPortal user creating the new group
[ "Create", "a", "new", "group", "under", "the", "specified", "parent", ".", "The", "new", "group", "will", "automatically", "be", "added", "to", "the", "parent", "group", "." ]
train
https://github.com/Jasig/uPortal/blob/c1986542abb9acd214268f2df21c6305ad2f262b/uPortal-api/uPortal-api-internal/src/main/java/org/apereo/portal/portlets/groupadmin/GroupAdministrationHelper.java#L189-L236
synchronoss/cpo-api
cpo-jdbc/src/main/java/org/synchronoss/cpo/jdbc/JdbcCpoAdapter.java
JdbcCpoAdapter.getGroupType
protected <T> String getGroupType(T obj, String type, String name, Connection c) throws CpoException { """ DOCUMENT ME! @param obj DOCUMENT ME! @param type DOCUMENT ME! @param name DOCUMENT ME! @param c DOCUMENT ME! @return DOCUMENT ME! @throws CpoException DOCUMENT ME! """ String retType = typ...
java
protected <T> String getGroupType(T obj, String type, String name, Connection c) throws CpoException { String retType = type; long objCount; if (JdbcCpoAdapter.PERSIST_GROUP.equals(retType)) { objCount = existsObject(name, obj, c, null); if (objCount == 0) { retType = JdbcCpoAdapter.CR...
[ "protected", "<", "T", ">", "String", "getGroupType", "(", "T", "obj", ",", "String", "type", ",", "String", "name", ",", "Connection", "c", ")", "throws", "CpoException", "{", "String", "retType", "=", "type", ";", "long", "objCount", ";", "if", "(", ...
DOCUMENT ME! @param obj DOCUMENT ME! @param type DOCUMENT ME! @param name DOCUMENT ME! @param c DOCUMENT ME! @return DOCUMENT ME! @throws CpoException DOCUMENT ME!
[ "DOCUMENT", "ME!" ]
train
https://github.com/synchronoss/cpo-api/blob/dc745aca3b3206abf80b85d9689b0132f5baa694/cpo-jdbc/src/main/java/org/synchronoss/cpo/jdbc/JdbcCpoAdapter.java#L2019-L2036
geomajas/geomajas-project-server
common-servlet/src/main/java/org/geomajas/servlet/ResourceServlet.java
ResourceServlet.configureCaching
private void configureCaching(HttpServletResponse response, int seconds) { """ Set HTTP headers to allow caching for the given number of seconds. @param response where to set the caching settings @param seconds number of seconds into the future that the response should be cacheable for """ // HTTP 1.0 he...
java
private void configureCaching(HttpServletResponse response, int seconds) { // HTTP 1.0 header response.setDateHeader(HTTP_EXPIRES_HEADER, System.currentTimeMillis() + seconds * 1000L); if (seconds > 0) { // HTTP 1.1 header response.setHeader(HTTP_CACHE_CONTROL_HEADER, "max-age=" + seconds); } else { //...
[ "private", "void", "configureCaching", "(", "HttpServletResponse", "response", ",", "int", "seconds", ")", "{", "// HTTP 1.0 header", "response", ".", "setDateHeader", "(", "HTTP_EXPIRES_HEADER", ",", "System", ".", "currentTimeMillis", "(", ")", "+", "seconds", "*"...
Set HTTP headers to allow caching for the given number of seconds. @param response where to set the caching settings @param seconds number of seconds into the future that the response should be cacheable for
[ "Set", "HTTP", "headers", "to", "allow", "caching", "for", "the", "given", "number", "of", "seconds", "." ]
train
https://github.com/geomajas/geomajas-project-server/blob/904b7d7deed1350d28955589098dd1e0a786d76e/common-servlet/src/main/java/org/geomajas/servlet/ResourceServlet.java#L337-L348
google/closure-compiler
src/com/google/javascript/jscomp/NodeTraversal.java
NodeTraversal.pushScope
private void pushScope(AbstractScope<?, ?> s, boolean quietly) { """ Creates a new scope (e.g. when entering a function). @param quietly Don't fire an enterScope callback. """ checkNotNull(curNode); scopes.push(s); recordScopeRoot(s.getRootNode()); if (!quietly && scopeCallback != null) { ...
java
private void pushScope(AbstractScope<?, ?> s, boolean quietly) { checkNotNull(curNode); scopes.push(s); recordScopeRoot(s.getRootNode()); if (!quietly && scopeCallback != null) { scopeCallback.enterScope(this); } }
[ "private", "void", "pushScope", "(", "AbstractScope", "<", "?", ",", "?", ">", "s", ",", "boolean", "quietly", ")", "{", "checkNotNull", "(", "curNode", ")", ";", "scopes", ".", "push", "(", "s", ")", ";", "recordScopeRoot", "(", "s", ".", "getRootNode...
Creates a new scope (e.g. when entering a function). @param quietly Don't fire an enterScope callback.
[ "Creates", "a", "new", "scope", "(", "e", ".", "g", ".", "when", "entering", "a", "function", ")", "." ]
train
https://github.com/google/closure-compiler/blob/d81e36740f6a9e8ac31a825ee8758182e1dc5aae/src/com/google/javascript/jscomp/NodeTraversal.java#L1026-L1033
lucee/Lucee
core/src/main/java/lucee/commons/io/res/util/ResourceUtil.java
ResourceUtil.checkRemoveOK
public static void checkRemoveOK(Resource resource) throws IOException { """ check if removing the file is ok with the rules for the Resource interface, to not change this rules. @param resource @throws IOException """ if (!resource.exists()) throw new IOException("can't delete resource " + resource + ",...
java
public static void checkRemoveOK(Resource resource) throws IOException { if (!resource.exists()) throw new IOException("can't delete resource " + resource + ", resource does not exist"); if (!resource.canWrite()) throw new IOException("can't delete resource " + resource + ", no access"); }
[ "public", "static", "void", "checkRemoveOK", "(", "Resource", "resource", ")", "throws", "IOException", "{", "if", "(", "!", "resource", ".", "exists", "(", ")", ")", "throw", "new", "IOException", "(", "\"can't delete resource \"", "+", "resource", "+", "\", ...
check if removing the file is ok with the rules for the Resource interface, to not change this rules. @param resource @throws IOException
[ "check", "if", "removing", "the", "file", "is", "ok", "with", "the", "rules", "for", "the", "Resource", "interface", "to", "not", "change", "this", "rules", "." ]
train
https://github.com/lucee/Lucee/blob/29b153fc4e126e5edb97da937f2ee2e231b87593/core/src/main/java/lucee/commons/io/res/util/ResourceUtil.java#L1385-L1389
cdk/cdk
base/standard/src/main/java/org/openscience/cdk/isomorphism/mcss/RGraph.java
RGraph.buildB
private BitSet buildB(BitSet c1, BitSet c2) { """ Builds the initial extension set. This is the set of node that may be used as seed for the RGraph parsing. This set depends on the constrains defined by the user. @param c1 constraint in the graph G1 @param c2 constraint in the graph G2 @return the new ex...
java
private BitSet buildB(BitSet c1, BitSet c2) { this.c1 = c1; this.c2 = c2; BitSet bs = new BitSet(); // only nodes that fulfill the initial constrains // are allowed in the initial extension set : B for (Iterator<RNode> i = graph.iterator(); i.hasNext();) { R...
[ "private", "BitSet", "buildB", "(", "BitSet", "c1", ",", "BitSet", "c2", ")", "{", "this", ".", "c1", "=", "c1", ";", "this", ".", "c2", "=", "c2", ";", "BitSet", "bs", "=", "new", "BitSet", "(", ")", ";", "// only nodes that fulfill the initial constrai...
Builds the initial extension set. This is the set of node that may be used as seed for the RGraph parsing. This set depends on the constrains defined by the user. @param c1 constraint in the graph G1 @param c2 constraint in the graph G2 @return the new extension set
[ "Builds", "the", "initial", "extension", "set", ".", "This", "is", "the", "set", "of", "node", "that", "may", "be", "used", "as", "seed", "for", "the", "RGraph", "parsing", ".", "This", "set", "depends", "on", "the", "constrains", "defined", "by", "the",...
train
https://github.com/cdk/cdk/blob/c3d0f16502bf08df50365fee392e11d7c9856657/base/standard/src/main/java/org/openscience/cdk/isomorphism/mcss/RGraph.java#L420-L436
Azure/azure-sdk-for-java
sql/resource-manager/v2014_04_01/src/main/java/com/microsoft/azure/management/sql/v2014_04_01/implementation/ElasticPoolsInner.java
ElasticPoolsInner.createOrUpdate
public ElasticPoolInner createOrUpdate(String resourceGroupName, String serverName, String elasticPoolName, ElasticPoolInner parameters) { """ Creates a new elastic pool or updates an existing elastic pool. @param resourceGroupName The name of the resource group that contains the resource. You can obtain this v...
java
public ElasticPoolInner createOrUpdate(String resourceGroupName, String serverName, String elasticPoolName, ElasticPoolInner parameters) { return createOrUpdateWithServiceResponseAsync(resourceGroupName, serverName, elasticPoolName, parameters).toBlocking().last().body(); }
[ "public", "ElasticPoolInner", "createOrUpdate", "(", "String", "resourceGroupName", ",", "String", "serverName", ",", "String", "elasticPoolName", ",", "ElasticPoolInner", "parameters", ")", "{", "return", "createOrUpdateWithServiceResponseAsync", "(", "resourceGroupName", ...
Creates a new elastic pool or updates an existing elastic pool. @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. @param serverName The name of the server. @param elasticPoolName The name of the elastic pool ...
[ "Creates", "a", "new", "elastic", "pool", "or", "updates", "an", "existing", "elastic", "pool", "." ]
train
https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/sql/resource-manager/v2014_04_01/src/main/java/com/microsoft/azure/management/sql/v2014_04_01/implementation/ElasticPoolsInner.java#L111-L113
pravega/pravega
segmentstore/storage/impl/src/main/java/io/pravega/segmentstore/storage/impl/bookkeeper/BookKeeperLog.java
BookKeeperLog.getWritesToExecute
private List<Write> getWritesToExecute() { """ Collects an ordered list of Writes to execute to BookKeeper. @return The list of Writes to execute. """ // Calculate how much estimated space there is in the current ledger. final long maxTotalSize = this.config.getBkLedgerMaxSize() - getWriteLe...
java
private List<Write> getWritesToExecute() { // Calculate how much estimated space there is in the current ledger. final long maxTotalSize = this.config.getBkLedgerMaxSize() - getWriteLedger().ledger.getLength(); // Get the writes to execute from the queue. List<Write> toExecute = this.wr...
[ "private", "List", "<", "Write", ">", "getWritesToExecute", "(", ")", "{", "// Calculate how much estimated space there is in the current ledger.", "final", "long", "maxTotalSize", "=", "this", ".", "config", ".", "getBkLedgerMaxSize", "(", ")", "-", "getWriteLedger", "...
Collects an ordered list of Writes to execute to BookKeeper. @return The list of Writes to execute.
[ "Collects", "an", "ordered", "list", "of", "Writes", "to", "execute", "to", "BookKeeper", "." ]
train
https://github.com/pravega/pravega/blob/6e24df7470669b3956a07018f52b2c6b3c2a3503/segmentstore/storage/impl/src/main/java/io/pravega/segmentstore/storage/impl/bookkeeper/BookKeeperLog.java#L416-L432
Azure/azure-sdk-for-java
cognitiveservices/data-plane/search/bingnewssearch/src/main/java/com/microsoft/azure/cognitiveservices/search/newssearch/implementation/BingNewsImpl.java
BingNewsImpl.searchWithServiceResponseAsync
public Observable<ServiceResponse<NewsModel>> searchWithServiceResponseAsync(String query, SearchOptionalParameter searchOptionalParameter) { """ The News Search API lets you send a search query to Bing and get back a list of news that are relevant to the search query. This section provides technical details about...
java
public Observable<ServiceResponse<NewsModel>> searchWithServiceResponseAsync(String query, SearchOptionalParameter searchOptionalParameter) { if (query == null) { throw new IllegalArgumentException("Parameter query is required and cannot be null."); } final String acceptLanguage = se...
[ "public", "Observable", "<", "ServiceResponse", "<", "NewsModel", ">", ">", "searchWithServiceResponseAsync", "(", "String", "query", ",", "SearchOptionalParameter", "searchOptionalParameter", ")", "{", "if", "(", "query", "==", "null", ")", "{", "throw", "new", "...
The News Search API lets you send a search query to Bing and get back a list of news that are relevant to the search query. This section provides technical details about the query parameters and headers that you use to request news and the JSON response objects that contain them. For examples that show how to make req...
[ "The", "News", "Search", "API", "lets", "you", "send", "a", "search", "query", "to", "Bing", "and", "get", "back", "a", "list", "of", "news", "that", "are", "relevant", "to", "the", "search", "query", ".", "This", "section", "provides", "technical", "det...
train
https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/cognitiveservices/data-plane/search/bingnewssearch/src/main/java/com/microsoft/azure/cognitiveservices/search/newssearch/implementation/BingNewsImpl.java#L129-L151
menacher/java-game-server
jetclient/src/main/java/org/menacheri/jetclient/util/NettyUtils.java
NettyUtils.readString
public static String readString(ChannelBuffer buffer, Charset charset) { """ This method will first read an unsigned short to find the length of the string and then read the actual string based on the length. This method will also reset the reader index to end of the string @param buffer The Netty buffer con...
java
public static String readString(ChannelBuffer buffer, Charset charset) { String readString = null; if (null != buffer && buffer.readableBytes() > 2) { int length = buffer.readUnsignedShort(); readString = readString(buffer, length, charset); } return readString; }
[ "public", "static", "String", "readString", "(", "ChannelBuffer", "buffer", ",", "Charset", "charset", ")", "{", "String", "readString", "=", "null", ";", "if", "(", "null", "!=", "buffer", "&&", "buffer", ".", "readableBytes", "(", ")", ">", "2", ")", "...
This method will first read an unsigned short to find the length of the string and then read the actual string based on the length. This method will also reset the reader index to end of the string @param buffer The Netty buffer containing at least one unsigned short followed by a string of similar length. @param char...
[ "This", "method", "will", "first", "read", "an", "unsigned", "short", "to", "find", "the", "length", "of", "the", "string", "and", "then", "read", "the", "actual", "string", "based", "on", "the", "length", ".", "This", "method", "will", "also", "reset", ...
train
https://github.com/menacher/java-game-server/blob/668ca49e8bd1dac43add62378cf6c22a93125d48/jetclient/src/main/java/org/menacheri/jetclient/util/NettyUtils.java#L130-L139
sksamuel/scrimage
scrimage-filters/src/main/java/thirdparty/jhlabs/image/Gradient.java
Gradient.setKnotType
public void setKnotType(int n, int type) { """ Set a knot type. @param n the knot index @param type the type @see #getKnotType """ knotTypes[n] = (byte)((knotTypes[n] & ~COLOR_MASK) | type); rebuildGradient(); }
java
public void setKnotType(int n, int type) { knotTypes[n] = (byte)((knotTypes[n] & ~COLOR_MASK) | type); rebuildGradient(); }
[ "public", "void", "setKnotType", "(", "int", "n", ",", "int", "type", ")", "{", "knotTypes", "[", "n", "]", "=", "(", "byte", ")", "(", "(", "knotTypes", "[", "n", "]", "&", "~", "COLOR_MASK", ")", "|", "type", ")", ";", "rebuildGradient", "(", "...
Set a knot type. @param n the knot index @param type the type @see #getKnotType
[ "Set", "a", "knot", "type", "." ]
train
https://github.com/sksamuel/scrimage/blob/52dab448136e6657a71951b0e6b7d5e64dc979ac/scrimage-filters/src/main/java/thirdparty/jhlabs/image/Gradient.java#L197-L200
ckpoint/CheckPoint
src/main/java/hsim/checkpoint/util/AnnotationUtil.java
AnnotationUtil.getAnnotation
public static Annotation getAnnotation(Annotation[] annotations, Class<?> annotationClass) { """ Gets annotation. @param annotations the annotations @param annotationClass the annotation class @return the annotation """ return Arrays.stream(annotations).filter(annotation -> annotation.annotati...
java
public static Annotation getAnnotation(Annotation[] annotations, Class<?> annotationClass) { return Arrays.stream(annotations).filter(annotation -> annotation.annotationType().equals(annotationClass)).findFirst().orElse(null); }
[ "public", "static", "Annotation", "getAnnotation", "(", "Annotation", "[", "]", "annotations", ",", "Class", "<", "?", ">", "annotationClass", ")", "{", "return", "Arrays", ".", "stream", "(", "annotations", ")", ".", "filter", "(", "annotation", "->", "anno...
Gets annotation. @param annotations the annotations @param annotationClass the annotation class @return the annotation
[ "Gets", "annotation", "." ]
train
https://github.com/ckpoint/CheckPoint/blob/2c2b1a87a88485d49ea6afa34acdf16ef4134f19/src/main/java/hsim/checkpoint/util/AnnotationUtil.java#L18-L20
mgm-tp/jfunk
jfunk-core/src/main/java/com/mgmtp/jfunk/core/scripting/ScriptContext.java
ScriptContext.processCsvFile
@Cmd public void processCsvFile(final String csvFile, final String delimiter, final char quoteChar, final Charset charset, final Closure<Void> closure) { """ Processes a CSV file. @param csvFile the file @param delimiter the @param quoteChar the quote character ('\0' for no quoting) @param charset th...
java
@Cmd public void processCsvFile(final String csvFile, final String delimiter, final char quoteChar, final Charset charset, final Closure<Void> closure) { File f = new File(csvFile); try { config.extractFromArchive(f, true); checkState(f.exists(), "CSV file not found: " + f); Reader reader = Files.newRe...
[ "@", "Cmd", "public", "void", "processCsvFile", "(", "final", "String", "csvFile", ",", "final", "String", "delimiter", ",", "final", "char", "quoteChar", ",", "final", "Charset", "charset", ",", "final", "Closure", "<", "Void", ">", "closure", ")", "{", "...
Processes a CSV file. @param csvFile the file @param delimiter the @param quoteChar the quote character ('\0' for no quoting) @param charset the character set @param closure the {@link Closure} representing a Groovy block
[ "Processes", "a", "CSV", "file", "." ]
train
https://github.com/mgm-tp/jfunk/blob/5b9fecac5778b988bb458085ded39ea9a4c7c2ae/jfunk-core/src/main/java/com/mgmtp/jfunk/core/scripting/ScriptContext.java#L448-L460
Wadpam/guja
guja-contact/src/main/java/com/wadpam/guja/dao/GeneratedDContactDaoImpl.java
GeneratedDContactDaoImpl.queryByLinkedIn
public Iterable<DContact> queryByLinkedIn(Object parent, java.lang.String linkedIn) { """ query-by method for field linkedIn @param linkedIn the specified attribute @return an Iterable of DContacts for the specified linkedIn """ return queryByField(parent, DContactMapper.Field.LINKEDIN.getFieldName(), li...
java
public Iterable<DContact> queryByLinkedIn(Object parent, java.lang.String linkedIn) { return queryByField(parent, DContactMapper.Field.LINKEDIN.getFieldName(), linkedIn); }
[ "public", "Iterable", "<", "DContact", ">", "queryByLinkedIn", "(", "Object", "parent", ",", "java", ".", "lang", ".", "String", "linkedIn", ")", "{", "return", "queryByField", "(", "parent", ",", "DContactMapper", ".", "Field", ".", "LINKEDIN", ".", "getFie...
query-by method for field linkedIn @param linkedIn the specified attribute @return an Iterable of DContacts for the specified linkedIn
[ "query", "-", "by", "method", "for", "field", "linkedIn" ]
train
https://github.com/Wadpam/guja/blob/eb8ba8e6794a96ea0dd9744cada4f9ad9618f114/guja-contact/src/main/java/com/wadpam/guja/dao/GeneratedDContactDaoImpl.java#L205-L207
Azure/azure-sdk-for-java
appservice/resource-manager/v2016_09_01/src/main/java/com/microsoft/azure/management/appservice/v2016_09_01/implementation/AppServicePlansInner.java
AppServicePlansInner.listHybridConnectionKeysAsync
public Observable<HybridConnectionKeyInner> listHybridConnectionKeysAsync(String resourceGroupName, String name, String namespaceName, String relayName) { """ Get the send key name and value of a Hybrid Connection. Get the send key name and value of a Hybrid Connection. @param resourceGroupName Name of the res...
java
public Observable<HybridConnectionKeyInner> listHybridConnectionKeysAsync(String resourceGroupName, String name, String namespaceName, String relayName) { return listHybridConnectionKeysWithServiceResponseAsync(resourceGroupName, name, namespaceName, relayName).map(new Func1<ServiceResponse<HybridConnectionKeyI...
[ "public", "Observable", "<", "HybridConnectionKeyInner", ">", "listHybridConnectionKeysAsync", "(", "String", "resourceGroupName", ",", "String", "name", ",", "String", "namespaceName", ",", "String", "relayName", ")", "{", "return", "listHybridConnectionKeysWithServiceResp...
Get the send key name and value of a Hybrid Connection. Get the send key name and value of a Hybrid Connection. @param resourceGroupName Name of the resource group to which the resource belongs. @param name Name of the App Service plan. @param namespaceName The name of the Service Bus namespace. @param relayName The n...
[ "Get", "the", "send", "key", "name", "and", "value", "of", "a", "Hybrid", "Connection", ".", "Get", "the", "send", "key", "name", "and", "value", "of", "a", "Hybrid", "Connection", "." ]
train
https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/appservice/resource-manager/v2016_09_01/src/main/java/com/microsoft/azure/management/appservice/v2016_09_01/implementation/AppServicePlansInner.java#L1374-L1381
OpenLiberty/open-liberty
dev/com.ibm.ws.common.encoder/src/com/ibm/ws/common/internal/encoder/Base64Coder.java
Base64Coder.base64Decode
public static final String base64Decode(String str, String enc) throws UnsupportedEncodingException { """ Converts a String with the given encoding to a base64 encoded String. @param str @param enc @return @throws UnsupportedEncodingException """ if (str == null) { return null; ...
java
public static final String base64Decode(String str, String enc) throws UnsupportedEncodingException { if (str == null) { return null; } else { byte data[] = getBytes(str); return base64Decode(new String(data, enc)); } }
[ "public", "static", "final", "String", "base64Decode", "(", "String", "str", ",", "String", "enc", ")", "throws", "UnsupportedEncodingException", "{", "if", "(", "str", "==", "null", ")", "{", "return", "null", ";", "}", "else", "{", "byte", "data", "[", ...
Converts a String with the given encoding to a base64 encoded String. @param str @param enc @return @throws UnsupportedEncodingException
[ "Converts", "a", "String", "with", "the", "given", "encoding", "to", "a", "base64", "encoded", "String", "." ]
train
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.common.encoder/src/com/ibm/ws/common/internal/encoder/Base64Coder.java#L265-L273
geomajas/geomajas-project-server
impl/src/main/java/org/geomajas/internal/rendering/writer/svg/geometry/MultiLineStringWriter.java
MultiLineStringWriter.writeObject
public void writeObject(Object o, GraphicsDocument document, boolean asChild) throws RenderException { """ Writes the body for a <code>MultiLineString</code> object. MultiLineStrings are encoded into SVG path elements. This function writes the different lines in one d-attribute of an SVG path element, separated ...
java
public void writeObject(Object o, GraphicsDocument document, boolean asChild) throws RenderException { document.writeElement("path", asChild); document.writeAttributeStart("d"); MultiLineString ml = (MultiLineString) o; for (int i = 0; i < ml.getNumGeometries(); i++) { document.writePathContent(ml.getGeometr...
[ "public", "void", "writeObject", "(", "Object", "o", ",", "GraphicsDocument", "document", ",", "boolean", "asChild", ")", "throws", "RenderException", "{", "document", ".", "writeElement", "(", "\"path\"", ",", "asChild", ")", ";", "document", ".", "writeAttribu...
Writes the body for a <code>MultiLineString</code> object. MultiLineStrings are encoded into SVG path elements. This function writes the different lines in one d-attribute of an SVG path element, separated by an 'M' character. @param o The <code>MultiLineString</code> to be encoded.
[ "Writes", "the", "body", "for", "a", "<code", ">", "MultiLineString<", "/", "code", ">", "object", ".", "MultiLineStrings", "are", "encoded", "into", "SVG", "path", "elements", ".", "This", "function", "writes", "the", "different", "lines", "in", "one", "d",...
train
https://github.com/geomajas/geomajas-project-server/blob/904b7d7deed1350d28955589098dd1e0a786d76e/impl/src/main/java/org/geomajas/internal/rendering/writer/svg/geometry/MultiLineStringWriter.java#L37-L45
citrusframework/citrus
modules/citrus-core/src/main/java/com/consol/citrus/junit/jupiter/CitrusBaseExtension.java
CitrusBaseExtension.packageScan
public static Stream<DynamicTest> packageScan(String ... packagesToScan) { """ Creates stream of dynamic tests based on package scan. Scans package for all Xml test case files and creates dynamic test instance for it. @param packagesToScan @return """ List<DynamicTest> tests = new ArrayList<>(); ...
java
public static Stream<DynamicTest> packageScan(String ... packagesToScan) { List<DynamicTest> tests = new ArrayList<>(); for (String packageScan : packagesToScan) { try { for (String fileNamePattern : Citrus.getXmlTestFileNamePattern()) { Resource[] fileRe...
[ "public", "static", "Stream", "<", "DynamicTest", ">", "packageScan", "(", "String", "...", "packagesToScan", ")", "{", "List", "<", "DynamicTest", ">", "tests", "=", "new", "ArrayList", "<>", "(", ")", ";", "for", "(", "String", "packageScan", ":", "packa...
Creates stream of dynamic tests based on package scan. Scans package for all Xml test case files and creates dynamic test instance for it. @param packagesToScan @return
[ "Creates", "stream", "of", "dynamic", "tests", "based", "on", "package", "scan", ".", "Scans", "package", "for", "all", "Xml", "test", "case", "files", "and", "creates", "dynamic", "test", "instance", "for", "it", "." ]
train
https://github.com/citrusframework/citrus/blob/55c58ef74c01d511615e43646ca25c1b2301c56d/modules/citrus-core/src/main/java/com/consol/citrus/junit/jupiter/CitrusBaseExtension.java#L190-L218
byoutline/CachedField
cachedfield/src/main/java/com/byoutline/cachedfield/internal/CachedValue.java
CachedValue.removeStateListener
public synchronized boolean removeStateListener(@Nonnull EndpointStateListener<VALUE_TYPE, ARG_TYPE> listener) throws IllegalArgumentException { """ Remove field state listener @param listener @return true if listeners collection was modified by this operation, false otherwise @throws IllegalArgumentExceptio...
java
public synchronized boolean removeStateListener(@Nonnull EndpointStateListener<VALUE_TYPE, ARG_TYPE> listener) throws IllegalArgumentException { checkListenerNonNull(listener); return fieldStateListeners.remove(listener); }
[ "public", "synchronized", "boolean", "removeStateListener", "(", "@", "Nonnull", "EndpointStateListener", "<", "VALUE_TYPE", ",", "ARG_TYPE", ">", "listener", ")", "throws", "IllegalArgumentException", "{", "checkListenerNonNull", "(", "listener", ")", ";", "return", ...
Remove field state listener @param listener @return true if listeners collection was modified by this operation, false otherwise @throws IllegalArgumentException if listener is null
[ "Remove", "field", "state", "listener" ]
train
https://github.com/byoutline/CachedField/blob/73d83072cdca22d2b3f5b3d60a93b8a26d9513e6/cachedfield/src/main/java/com/byoutline/cachedfield/internal/CachedValue.java#L146-L149
casmi/casmi
src/main/java/casmi/graphics/Graphics.java
Graphics.setDirectionalLight
public void setDirectionalLight(int i, Color color, boolean enableColor, float x, float y, float z) { """ Sets the color value and the position of the No.i directionalLight """ float directionalColor[] = { (float)color.getRed(), (float)color.getGreen(), (float)color.get...
java
public void setDirectionalLight(int i, Color color, boolean enableColor, float x, float y, float z) { float directionalColor[] = { (float)color.getRed(), (float)color.getGreen(), (float)color.getBlue(), (float)color.getAlpha() }; float pos[] = { x, y, z, ...
[ "public", "void", "setDirectionalLight", "(", "int", "i", ",", "Color", "color", ",", "boolean", "enableColor", ",", "float", "x", ",", "float", "y", ",", "float", "z", ")", "{", "float", "directionalColor", "[", "]", "=", "{", "(", "float", ")", "colo...
Sets the color value and the position of the No.i directionalLight
[ "Sets", "the", "color", "value", "and", "the", "position", "of", "the", "No", ".", "i", "directionalLight" ]
train
https://github.com/casmi/casmi/blob/90f6514a9cbce0685186e7a92beb69e22a3b11c4/src/main/java/casmi/graphics/Graphics.java#L510-L523
lessthanoptimal/ejml
main/ejml-ddense/src/org/ejml/dense/row/CommonOps_DDRM.java
CommonOps_DDRM.removeColumns
public static void removeColumns( DMatrixRMaj A , int col0 , int col1 ) { """ Removes columns from the matrix. @param A Matrix. Modified @param col0 First column @param col1 Last column, inclusive. """ if( col1 < col0 ) { throw new IllegalArgumentException("col1 must be >= col0"); ...
java
public static void removeColumns( DMatrixRMaj A , int col0 , int col1 ) { if( col1 < col0 ) { throw new IllegalArgumentException("col1 must be >= col0"); } else if( col0 >= A.numCols || col1 >= A.numCols ) { throw new IllegalArgumentException("Columns which are to be removed ...
[ "public", "static", "void", "removeColumns", "(", "DMatrixRMaj", "A", ",", "int", "col0", ",", "int", "col1", ")", "{", "if", "(", "col1", "<", "col0", ")", "{", "throw", "new", "IllegalArgumentException", "(", "\"col1 must be >= col0\"", ")", ";", "}", "e...
Removes columns from the matrix. @param A Matrix. Modified @param col0 First column @param col1 Last column, inclusive.
[ "Removes", "columns", "from", "the", "matrix", "." ]
train
https://github.com/lessthanoptimal/ejml/blob/1444680cc487af5e866730e62f48f5f9636850d9/main/ejml-ddense/src/org/ejml/dense/row/CommonOps_DDRM.java#L1368-L1388
DDTH/ddth-commons
ddth-commons-core/src/main/java/com/github/ddth/commons/rocksdb/RocksDbWrapper.java
RocksDbWrapper.openReadOnly
public static RocksDbWrapper openReadOnly(String dirPath, DBOptions dbOptions, ReadOptions readOptions) throws RocksDbException, IOException { """ Open a {@link RocksDB} with specified options in read-only mode. @param dirPath existing {@link RocksDB} data directory @param dbOptions @param readOp...
java
public static RocksDbWrapper openReadOnly(String dirPath, DBOptions dbOptions, ReadOptions readOptions) throws RocksDbException, IOException { RocksDbWrapper rocksDbWrapper = new RocksDbWrapper(dirPath, true); rocksDbWrapper.setDbOptions(dbOptions).setReadOptions(readOptions); rocksD...
[ "public", "static", "RocksDbWrapper", "openReadOnly", "(", "String", "dirPath", ",", "DBOptions", "dbOptions", ",", "ReadOptions", "readOptions", ")", "throws", "RocksDbException", ",", "IOException", "{", "RocksDbWrapper", "rocksDbWrapper", "=", "new", "RocksDbWrapper"...
Open a {@link RocksDB} with specified options in read-only mode. @param dirPath existing {@link RocksDB} data directory @param dbOptions @param readOptions @return @throws RocksDBException @throws IOException
[ "Open", "a", "{", "@link", "RocksDB", "}", "with", "specified", "options", "in", "read", "-", "only", "mode", "." ]
train
https://github.com/DDTH/ddth-commons/blob/734f0e77321d41eeca78a557be9884df9874e46e/ddth-commons-core/src/main/java/com/github/ddth/commons/rocksdb/RocksDbWrapper.java#L104-L110
sksamuel/scrimage
scrimage-filters/src/main/java/thirdparty/jhlabs/image/Gradient.java
Gradient.setKnots
public void setKnots(int[] x, int[] rgb, byte[] types) { """ Set the values of all the knots. This version does not require the "extra" knots at -1 and 256 @param x the knot positions @param rgb the knot colors @param types the knot types """ numKnots = rgb.length+2; xKnots = new int[numKnots]; yKnot...
java
public void setKnots(int[] x, int[] rgb, byte[] types) { numKnots = rgb.length+2; xKnots = new int[numKnots]; yKnots = new int[numKnots]; knotTypes = new byte[numKnots]; if (x != null) System.arraycopy(x, 0, xKnots, 1, numKnots-2); else for (int i = 1; i > numKnots-1; i++) xKnots[i] = 255*i/(numKn...
[ "public", "void", "setKnots", "(", "int", "[", "]", "x", ",", "int", "[", "]", "rgb", ",", "byte", "[", "]", "types", ")", "{", "numKnots", "=", "rgb", ".", "length", "+", "2", ";", "xKnots", "=", "new", "int", "[", "numKnots", "]", ";", "yKnot...
Set the values of all the knots. This version does not require the "extra" knots at -1 and 256 @param x the knot positions @param rgb the knot colors @param types the knot types
[ "Set", "the", "values", "of", "all", "the", "knots", ".", "This", "version", "does", "not", "require", "the", "extra", "knots", "at", "-", "1", "and", "256" ]
train
https://github.com/sksamuel/scrimage/blob/52dab448136e6657a71951b0e6b7d5e64dc979ac/scrimage-filters/src/main/java/thirdparty/jhlabs/image/Gradient.java#L288-L306
couchbase/couchbase-lite-java
src/main/java/com/couchbase/lite/AbstractDatabase.java
AbstractDatabase.addDocumentChangeListener
@NonNull public ListenerToken addDocumentChangeListener( @NonNull String id, Executor executor, @NonNull DocumentChangeListener listener) { """ Add the given DocumentChangeListener to the specified document with an executor on which the changes will be posted to the listener. """ ...
java
@NonNull public ListenerToken addDocumentChangeListener( @NonNull String id, Executor executor, @NonNull DocumentChangeListener listener) { if (id == null) { throw new IllegalArgumentException("id cannot be null."); } if (listener == null) { throw new IllegalArgumentException...
[ "@", "NonNull", "public", "ListenerToken", "addDocumentChangeListener", "(", "@", "NonNull", "String", "id", ",", "Executor", "executor", ",", "@", "NonNull", "DocumentChangeListener", "listener", ")", "{", "if", "(", "id", "==", "null", ")", "{", "throw", "ne...
Add the given DocumentChangeListener to the specified document with an executor on which the changes will be posted to the listener.
[ "Add", "the", "given", "DocumentChangeListener", "to", "the", "specified", "document", "with", "an", "executor", "on", "which", "the", "changes", "will", "be", "posted", "to", "the", "listener", "." ]
train
https://github.com/couchbase/couchbase-lite-java/blob/cb72c44186456e6191a9ad0a7feb310011d0b081/src/main/java/com/couchbase/lite/AbstractDatabase.java#L665-L677
OpenLiberty/open-liberty
dev/com.ibm.ws.channelfw/src/com/ibm/ws/channelfw/internal/ChannelUtilsBase.java
ChannelUtilsBase.traceChains
protected final void traceChains(Object logTool, List<?> lchain, String message, String prefix) { """ Display configured channel chains. @param logTool Caller's LogTool (should be Logger OR TraceComponent) @param lchain List of chains to trace @param message Description to accompany trace, e.g. "CFW Channe...
java
protected final void traceChains(Object logTool, List<?> lchain, String message, String prefix) { if (lchain == null || lchain.size() <= 0) { debugTrace(logTool, prefix + " - Specified chain list is empty"); return; } ChainData chain; ChannelData channel; ...
[ "protected", "final", "void", "traceChains", "(", "Object", "logTool", ",", "List", "<", "?", ">", "lchain", ",", "String", "message", ",", "String", "prefix", ")", "{", "if", "(", "lchain", "==", "null", "||", "lchain", ".", "size", "(", ")", "<=", ...
Display configured channel chains. @param logTool Caller's LogTool (should be Logger OR TraceComponent) @param lchain List of chains to trace @param message Description to accompany trace, e.g. "CFW Channel Configuration" @param prefix Component-type prefix used to associate traces together, e.g. "XMEM", "ZIOP", "TCP"...
[ "Display", "configured", "channel", "chains", "." ]
train
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.channelfw/src/com/ibm/ws/channelfw/internal/ChannelUtilsBase.java#L146-L189
UrielCh/ovh-java-sdk
ovh-java-sdk-packxdsl/src/main/java/net/minidev/ovh/api/ApiOvhPackxdsl.java
ApiOvhPackxdsl.packName_hubic_services_domain_GET
public OvhHubic packName_hubic_services_domain_GET(String packName, String domain) throws IOException { """ Get this object properties REST: GET /pack/xdsl/{packName}/hubic/services/{domain} @param packName [required] The internal name of your pack @param domain [required] """ String qPath = "/pack/xdsl...
java
public OvhHubic packName_hubic_services_domain_GET(String packName, String domain) throws IOException { String qPath = "/pack/xdsl/{packName}/hubic/services/{domain}"; StringBuilder sb = path(qPath, packName, domain); String resp = exec(qPath, "GET", sb.toString(), null); return convertTo(resp, OvhHubic.class);...
[ "public", "OvhHubic", "packName_hubic_services_domain_GET", "(", "String", "packName", ",", "String", "domain", ")", "throws", "IOException", "{", "String", "qPath", "=", "\"/pack/xdsl/{packName}/hubic/services/{domain}\"", ";", "StringBuilder", "sb", "=", "path", "(", ...
Get this object properties REST: GET /pack/xdsl/{packName}/hubic/services/{domain} @param packName [required] The internal name of your pack @param domain [required]
[ "Get", "this", "object", "properties" ]
train
https://github.com/UrielCh/ovh-java-sdk/blob/6d531a40e56e09701943e334c25f90f640c55701/ovh-java-sdk-packxdsl/src/main/java/net/minidev/ovh/api/ApiOvhPackxdsl.java#L1069-L1074
wso2/transport-http
components/org.wso2.transport.http.netty/src/main/java/org/wso2/transport/http/netty/contractimpl/sender/http2/Http2TargetHandler.java
Http2TargetHandler.resetStream
void resetStream(ChannelHandlerContext ctx, int streamId, Http2Error http2Error) { """ Terminates a stream. @param streamId stream to be terminated @param http2Error cause for the termination """ encoder.writeRstStream(ctx, streamId, http2Error.code(), ctx.newPromise()); http2ClientChanne...
java
void resetStream(ChannelHandlerContext ctx, int streamId, Http2Error http2Error) { encoder.writeRstStream(ctx, streamId, http2Error.code(), ctx.newPromise()); http2ClientChannel.getDataEventListeners() .forEach(dataEventListener -> dataEventListener.onStreamReset(streamId)); ctx....
[ "void", "resetStream", "(", "ChannelHandlerContext", "ctx", ",", "int", "streamId", ",", "Http2Error", "http2Error", ")", "{", "encoder", ".", "writeRstStream", "(", "ctx", ",", "streamId", ",", "http2Error", ".", "code", "(", ")", ",", "ctx", ".", "newPromi...
Terminates a stream. @param streamId stream to be terminated @param http2Error cause for the termination
[ "Terminates", "a", "stream", "." ]
train
https://github.com/wso2/transport-http/blob/c51aa715b473db6c1b82a7d7b22f6e65f74df4c9/components/org.wso2.transport.http.netty/src/main/java/org/wso2/transport/http/netty/contractimpl/sender/http2/Http2TargetHandler.java#L90-L95
Bernardo-MG/repository-pattern-java
src/main/java/com/wandrell/pattern/repository/spring/SpringJdbcRepository.java
SpringJdbcRepository.getEntity
@Override public final V getEntity(final NamedParameterQueryData query) { """ Queries the entities in the repository and returns a single one. <p> The entity is acquired by building a query from the received {@code QueryData} and executing it. @param query the query user to acquire the entities @return...
java
@Override public final V getEntity(final NamedParameterQueryData query) { V entity; // Entity acquired from the query checkNotNull(query, "Received a null pointer as the query"); // Tries to acquire the entity try { entity = getTemplate().queryForObject(query.getQuery()...
[ "@", "Override", "public", "final", "V", "getEntity", "(", "final", "NamedParameterQueryData", "query", ")", "{", "V", "entity", ";", "// Entity acquired from the query", "checkNotNull", "(", "query", ",", "\"Received a null pointer as the query\"", ")", ";", "// Tries ...
Queries the entities in the repository and returns a single one. <p> The entity is acquired by building a query from the received {@code QueryData} and executing it. @param query the query user to acquire the entities @return the queried entity
[ "Queries", "the", "entities", "in", "the", "repository", "and", "returns", "a", "single", "one", ".", "<p", ">", "The", "entity", "is", "acquired", "by", "building", "a", "query", "from", "the", "received", "{", "@code", "QueryData", "}", "and", "executing...
train
https://github.com/Bernardo-MG/repository-pattern-java/blob/e94d5bbf9aeeb45acc8485f3686a6e791b082ea8/src/main/java/com/wandrell/pattern/repository/spring/SpringJdbcRepository.java#L342-L358
elki-project/elki
elki-core-util/src/main/java/de/lmu/ifi/dbs/elki/utilities/io/ByteArrayUtil.java
ByteArrayUtil.readShort
public static short readShort(byte[] array, int offset) { """ Read a short from the byte array at the given offset. @param array Array to read from @param offset Offset to read at @return (signed) short """ // First make integers to resolve signed vs. unsigned issues. int b0 = array[offset + 0] & ...
java
public static short readShort(byte[] array, int offset) { // First make integers to resolve signed vs. unsigned issues. int b0 = array[offset + 0] & 0xFF; int b1 = array[offset + 1] & 0xFF; return (short) ((b0 << 8) + (b1 << 0)); }
[ "public", "static", "short", "readShort", "(", "byte", "[", "]", "array", ",", "int", "offset", ")", "{", "// First make integers to resolve signed vs. unsigned issues.", "int", "b0", "=", "array", "[", "offset", "+", "0", "]", "&", "0xFF", ";", "int", "b1", ...
Read a short from the byte array at the given offset. @param array Array to read from @param offset Offset to read at @return (signed) short
[ "Read", "a", "short", "from", "the", "byte", "array", "at", "the", "given", "offset", "." ]
train
https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-core-util/src/main/java/de/lmu/ifi/dbs/elki/utilities/io/ByteArrayUtil.java#L179-L184
unbescape/unbescape
src/main/java/org/unbescape/properties/PropertiesEscape.java
PropertiesEscape.escapePropertiesKey
public static void escapePropertiesKey(final char[] text, final int offset, final int len, final Writer writer) throws IOException { """ <p> Perform a Java Properties Key level 2 (basic set and all non-ASCII chars) <strong>escape</strong> operation on a <tt>char[]</tt> ...
java
public static void escapePropertiesKey(final char[] text, final int offset, final int len, final Writer writer) throws IOException { escapePropertiesKey(text, offset, len, writer, PropertiesKeyEscapeLevel.LEVEL_2_ALL_NON_ASCII_PLUS_BASIC_ESCAPE_SET); }
[ "public", "static", "void", "escapePropertiesKey", "(", "final", "char", "[", "]", "text", ",", "final", "int", "offset", ",", "final", "int", "len", ",", "final", "Writer", "writer", ")", "throws", "IOException", "{", "escapePropertiesKey", "(", "text", ","...
<p> Perform a Java Properties Key level 2 (basic set and all non-ASCII chars) <strong>escape</strong> operation on a <tt>char[]</tt> input. </p> <p> <em>Level 2</em> means this method will escape: </p> <ul> <li>The Java Properties Key basic escape set: <ul> <li>The <em>Single Escape Characters</em>: <tt>&#92;t</tt> (<t...
[ "<p", ">", "Perform", "a", "Java", "Properties", "Key", "level", "2", "(", "basic", "set", "and", "all", "non", "-", "ASCII", "chars", ")", "<strong", ">", "escape<", "/", "strong", ">", "operation", "on", "a", "<tt", ">", "char", "[]", "<", "/", "...
train
https://github.com/unbescape/unbescape/blob/ec5435fb3508c2eed25d8165dc27ded2602cae13/src/main/java/org/unbescape/properties/PropertiesEscape.java#L1290-L1293
JodaOrg/joda-time
src/main/java/org/joda/time/DateTimeZone.java
DateTimeZone.fixedOffsetZone
private static DateTimeZone fixedOffsetZone(String id, int offset) { """ Gets the zone using a fixed offset amount. @param id the zone id @param offset the offset in millis @return the zone """ if (offset == 0) { return DateTimeZone.UTC; } return new FixedDateTimeZone...
java
private static DateTimeZone fixedOffsetZone(String id, int offset) { if (offset == 0) { return DateTimeZone.UTC; } return new FixedDateTimeZone(id, null, offset, offset); }
[ "private", "static", "DateTimeZone", "fixedOffsetZone", "(", "String", "id", ",", "int", "offset", ")", "{", "if", "(", "offset", "==", "0", ")", "{", "return", "DateTimeZone", ".", "UTC", ";", "}", "return", "new", "FixedDateTimeZone", "(", "id", ",", "...
Gets the zone using a fixed offset amount. @param id the zone id @param offset the offset in millis @return the zone
[ "Gets", "the", "zone", "using", "a", "fixed", "offset", "amount", "." ]
train
https://github.com/JodaOrg/joda-time/blob/bd79f1c4245e79b3c2c56d7b04fde2a6e191fa42/src/main/java/org/joda/time/DateTimeZone.java#L408-L413
Harium/keel
src/main/java/com/harium/keel/catalano/math/distance/Distance.java
Distance.SymmetricKullbackLeibler
public static double SymmetricKullbackLeibler(double[] p, double[] q) { """ Gets the Symmetric Kullback-Leibler distance. This metric is valid only for real and positive P and Q. @param p P vector. @param q Q vector. @return The Symmetric Kullback Leibler distance between p and q. """ double dist...
java
public static double SymmetricKullbackLeibler(double[] p, double[] q) { double dist = 0; for (int i = 0; i < p.length; i++) { dist += (p[i] - q[i]) * (Math.log(p[i]) - Math.log(q[i])); } return dist; }
[ "public", "static", "double", "SymmetricKullbackLeibler", "(", "double", "[", "]", "p", ",", "double", "[", "]", "q", ")", "{", "double", "dist", "=", "0", ";", "for", "(", "int", "i", "=", "0", ";", "i", "<", "p", ".", "length", ";", "i", "++", ...
Gets the Symmetric Kullback-Leibler distance. This metric is valid only for real and positive P and Q. @param p P vector. @param q Q vector. @return The Symmetric Kullback Leibler distance between p and q.
[ "Gets", "the", "Symmetric", "Kullback", "-", "Leibler", "distance", ".", "This", "metric", "is", "valid", "only", "for", "real", "and", "positive", "P", "and", "Q", "." ]
train
https://github.com/Harium/keel/blob/0369ae674f9e664bccc5f9e161ae7e7a3b949a1e/src/main/java/com/harium/keel/catalano/math/distance/Distance.java#L873-L880
infinispan/infinispan
server/integration/commons/src/main/java/org/infinispan/server/commons/dmr/ModelNodes.java
ModelNodes.asModuleIdentifier
public static ModuleIdentifier asModuleIdentifier(ModelNode value, ModuleIdentifier defaultValue) { """ Returns the value of the node as a module identifier, or the specified default if the node is undefined. @param value a model node @return the value of the node as a module identifier, or the specified default...
java
public static ModuleIdentifier asModuleIdentifier(ModelNode value, ModuleIdentifier defaultValue) { return value.isDefined() ? ModuleIdentifier.fromString(value.asString()) : defaultValue; }
[ "public", "static", "ModuleIdentifier", "asModuleIdentifier", "(", "ModelNode", "value", ",", "ModuleIdentifier", "defaultValue", ")", "{", "return", "value", ".", "isDefined", "(", ")", "?", "ModuleIdentifier", ".", "fromString", "(", "value", ".", "asString", "(...
Returns the value of the node as a module identifier, or the specified default if the node is undefined. @param value a model node @return the value of the node as a module identifier, or the specified default if the node is undefined.
[ "Returns", "the", "value", "of", "the", "node", "as", "a", "module", "identifier", "or", "the", "specified", "default", "if", "the", "node", "is", "undefined", "." ]
train
https://github.com/infinispan/infinispan/blob/7c62b94886c3febb4774ae8376acf2baa0265ab5/server/integration/commons/src/main/java/org/infinispan/server/commons/dmr/ModelNodes.java#L102-L104
windup/windup
rules-java-ee/addon/src/main/java/org/jboss/windup/rules/apps/javaee/service/JmsDestinationService.java
JmsDestinationService.createUnique
public JmsDestinationModel createUnique(Set<ProjectModel> applications, String jndiName, String destinationTypeClass) { """ Creates a new instance with the given name, or converts an existing instance at this location if one already exists """ JmsDestinationType destinationType = JmsDestinationService....
java
public JmsDestinationModel createUnique(Set<ProjectModel> applications, String jndiName, String destinationTypeClass) { JmsDestinationType destinationType = JmsDestinationService.getTypeFromClass(destinationTypeClass); return this.createUnique(applications, jndiName, destinationType); }
[ "public", "JmsDestinationModel", "createUnique", "(", "Set", "<", "ProjectModel", ">", "applications", ",", "String", "jndiName", ",", "String", "destinationTypeClass", ")", "{", "JmsDestinationType", "destinationType", "=", "JmsDestinationService", ".", "getTypeFromClass...
Creates a new instance with the given name, or converts an existing instance at this location if one already exists
[ "Creates", "a", "new", "instance", "with", "the", "given", "name", "or", "converts", "an", "existing", "instance", "at", "this", "location", "if", "one", "already", "exists" ]
train
https://github.com/windup/windup/blob/6668f09e7f012d24a0b4212ada8809417225b2ad/rules-java-ee/addon/src/main/java/org/jboss/windup/rules/apps/javaee/service/JmsDestinationService.java#L35-L40
UrielCh/ovh-java-sdk
ovh-java-sdk-hostingweb/src/main/java/net/minidev/ovh/api/ApiOvhHostingweb.java
ApiOvhHostingweb.serviceName_envVar_POST
public OvhTask serviceName_envVar_POST(String serviceName, String key, net.minidev.ovh.api.hosting.web.envvar.OvhTypeEnum type, String value) throws IOException { """ Set a variable to this hosting REST: POST /hosting/web/{serviceName}/envVar @param value [required] Value of the variable @param key [required]...
java
public OvhTask serviceName_envVar_POST(String serviceName, String key, net.minidev.ovh.api.hosting.web.envvar.OvhTypeEnum type, String value) throws IOException { String qPath = "/hosting/web/{serviceName}/envVar"; StringBuilder sb = path(qPath, serviceName); HashMap<String, Object>o = new HashMap<String, Object>...
[ "public", "OvhTask", "serviceName_envVar_POST", "(", "String", "serviceName", ",", "String", "key", ",", "net", ".", "minidev", ".", "ovh", ".", "api", ".", "hosting", ".", "web", ".", "envvar", ".", "OvhTypeEnum", "type", ",", "String", "value", ")", "thr...
Set a variable to this hosting REST: POST /hosting/web/{serviceName}/envVar @param value [required] Value of the variable @param key [required] Name of the new variable @param type [required] Type of variable set @param serviceName [required] The internal name of your hosting
[ "Set", "a", "variable", "to", "this", "hosting" ]
train
https://github.com/UrielCh/ovh-java-sdk/blob/6d531a40e56e09701943e334c25f90f640c55701/ovh-java-sdk-hostingweb/src/main/java/net/minidev/ovh/api/ApiOvhHostingweb.java#L1831-L1840
alkacon/opencms-core
src/org/opencms/xml/containerpage/CmsFormatterConfiguration.java
CmsFormatterConfiguration.getDefaultSchemaFormatter
public I_CmsFormatterBean getDefaultSchemaFormatter(final String containerTypes, final int containerWidth) { """ Selects the best matching schema formatter for the provided type and width from this configuration.<p> @param containerTypes the container types (comma separated) @param containerWidth the container...
java
public I_CmsFormatterBean getDefaultSchemaFormatter(final String containerTypes, final int containerWidth) { Optional<I_CmsFormatterBean> result = Iterables.tryFind( m_allFormatters, Predicates.and(new IsSchemaFormatter(), new MatchesTypeOrWidth(containerTypes, containerWidth))); ...
[ "public", "I_CmsFormatterBean", "getDefaultSchemaFormatter", "(", "final", "String", "containerTypes", ",", "final", "int", "containerWidth", ")", "{", "Optional", "<", "I_CmsFormatterBean", ">", "result", "=", "Iterables", ".", "tryFind", "(", "m_allFormatters", ",",...
Selects the best matching schema formatter for the provided type and width from this configuration.<p> @param containerTypes the container types (comma separated) @param containerWidth the container width @return the matching formatter, or <code>null</code> if none was found
[ "Selects", "the", "best", "matching", "schema", "formatter", "for", "the", "provided", "type", "and", "width", "from", "this", "configuration", ".", "<p", ">" ]
train
https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/xml/containerpage/CmsFormatterConfiguration.java#L314-L320
baidubce/bce-sdk-java
src/main/java/com/baidubce/services/media/MediaClient.java
MediaClient.getWaterMark
public GetWaterMarkResponse getWaterMark(GetWaterMarkRequest request) { """ Get a water mark for a given water mark ID. @param request The request object containing all options for getting water mark. @return The information of the water mark. """ checkStringNotEmpty(request.getWatermarkId(), "The ...
java
public GetWaterMarkResponse getWaterMark(GetWaterMarkRequest request) { checkStringNotEmpty(request.getWatermarkId(), "The parameter watermarkId should NOT be null or empty string."); InternalRequest internalRequest = createRequest(HttpMethodName.GET, request, WATER_MARK, request.getWate...
[ "public", "GetWaterMarkResponse", "getWaterMark", "(", "GetWaterMarkRequest", "request", ")", "{", "checkStringNotEmpty", "(", "request", ".", "getWatermarkId", "(", ")", ",", "\"The parameter watermarkId should NOT be null or empty string.\"", ")", ";", "InternalRequest", "i...
Get a water mark for a given water mark ID. @param request The request object containing all options for getting water mark. @return The information of the water mark.
[ "Get", "a", "water", "mark", "for", "a", "given", "water", "mark", "ID", "." ]
train
https://github.com/baidubce/bce-sdk-java/blob/f7140f28dd82121515c88ded7bfe769a37d0ec4a/src/main/java/com/baidubce/services/media/MediaClient.java#L1126-L1132
xcesco/kripton
kripton-orm/src/main/java/com/abubusoft/kripton/android/sqlite/commons/IOUtils.java
IOUtils.readTextFile
public static String readTextFile(Context context, int resId) { """ Read text file. @param context the context @param resId the res id @return the string """ InputStream inputStream = context.getResources().openRawResource(resId); return readText(inputStream); }
java
public static String readTextFile(Context context, int resId) { InputStream inputStream = context.getResources().openRawResource(resId); return readText(inputStream); }
[ "public", "static", "String", "readTextFile", "(", "Context", "context", ",", "int", "resId", ")", "{", "InputStream", "inputStream", "=", "context", ".", "getResources", "(", ")", ".", "openRawResource", "(", "resId", ")", ";", "return", "readText", "(", "i...
Read text file. @param context the context @param resId the res id @return the string
[ "Read", "text", "file", "." ]
train
https://github.com/xcesco/kripton/blob/90de2c0523d39b99e81b8d38aa996898762f594a/kripton-orm/src/main/java/com/abubusoft/kripton/android/sqlite/commons/IOUtils.java#L66-L70
UrielCh/ovh-java-sdk
ovh-java-sdk-ip/src/main/java/net/minidev/ovh/api/ApiOvhIp.java
ApiOvhIp.loadBalancing_serviceName_backend_backend_backupState_POST
public OvhLoadBalancingTask loadBalancing_serviceName_backend_backend_backupState_POST(String serviceName, String backend, Boolean backupStateSet, String mainBackendIp) throws IOException { """ Set or unset the backend as a backup of another backend. Requests will be directed to the backup only if the main backend...
java
public OvhLoadBalancingTask loadBalancing_serviceName_backend_backend_backupState_POST(String serviceName, String backend, Boolean backupStateSet, String mainBackendIp) throws IOException { String qPath = "/ip/loadBalancing/{serviceName}/backend/{backend}/backupState"; StringBuilder sb = path(qPath, serviceName, ba...
[ "public", "OvhLoadBalancingTask", "loadBalancing_serviceName_backend_backend_backupState_POST", "(", "String", "serviceName", ",", "String", "backend", ",", "Boolean", "backupStateSet", ",", "String", "mainBackendIp", ")", "throws", "IOException", "{", "String", "qPath", "=...
Set or unset the backend as a backup of another backend. Requests will be directed to the backup only if the main backend is in probe fail REST: POST /ip/loadBalancing/{serviceName}/backend/{backend}/backupState @param backupStateSet [required] Set or unset the backend as backup. mainBackendIp is optional in case of u...
[ "Set", "or", "unset", "the", "backend", "as", "a", "backup", "of", "another", "backend", ".", "Requests", "will", "be", "directed", "to", "the", "backup", "only", "if", "the", "main", "backend", "is", "in", "probe", "fail" ]
train
https://github.com/UrielCh/ovh-java-sdk/blob/6d531a40e56e09701943e334c25f90f640c55701/ovh-java-sdk-ip/src/main/java/net/minidev/ovh/api/ApiOvhIp.java#L1381-L1389
jnidzwetzki/bitfinex-v2-wss-api-java
src/main/java/com/github/jnidzwetzki/bitfinex/v2/BitfinexApiCallbackListeners.java
BitfinexApiCallbackListeners.onExecutedTradeEvent
public Closeable onExecutedTradeEvent(final BiConsumer<BitfinexExecutedTradeSymbol, Collection<BitfinexExecutedTrade>> listener) { """ registers listener for general trades executed within scope of exchange instrument (ie. tBTCUSD) @param listener of event @return hook of this listener """ executedTr...
java
public Closeable onExecutedTradeEvent(final BiConsumer<BitfinexExecutedTradeSymbol, Collection<BitfinexExecutedTrade>> listener) { executedTradesConsumers.offer(listener); return () -> executedTradesConsumers.remove(listener); }
[ "public", "Closeable", "onExecutedTradeEvent", "(", "final", "BiConsumer", "<", "BitfinexExecutedTradeSymbol", ",", "Collection", "<", "BitfinexExecutedTrade", ">", ">", "listener", ")", "{", "executedTradesConsumers", ".", "offer", "(", "listener", ")", ";", "return"...
registers listener for general trades executed within scope of exchange instrument (ie. tBTCUSD) @param listener of event @return hook of this listener
[ "registers", "listener", "for", "general", "trades", "executed", "within", "scope", "of", "exchange", "instrument", "(", "ie", ".", "tBTCUSD", ")" ]
train
https://github.com/jnidzwetzki/bitfinex-v2-wss-api-java/blob/2e6adf1eb6f8cd4c8722f1619f78ab2cc3c600ee/src/main/java/com/github/jnidzwetzki/bitfinex/v2/BitfinexApiCallbackListeners.java#L158-L161
Azure/azure-sdk-for-java
automation/resource-manager/v2015_10_31/src/main/java/com/microsoft/azure/management/automation/v2015_10_31/implementation/DscConfigurationsInner.java
DscConfigurationsInner.getAsync
public Observable<DscConfigurationInner> getAsync(String resourceGroupName, String automationAccountName, String configurationName) { """ Retrieve the configuration identified by configuration name. @param resourceGroupName Name of an Azure Resource group. @param automationAccountName The name of the automatio...
java
public Observable<DscConfigurationInner> getAsync(String resourceGroupName, String automationAccountName, String configurationName) { return getWithServiceResponseAsync(resourceGroupName, automationAccountName, configurationName).map(new Func1<ServiceResponse<DscConfigurationInner>, DscConfigurationInner>() { ...
[ "public", "Observable", "<", "DscConfigurationInner", ">", "getAsync", "(", "String", "resourceGroupName", ",", "String", "automationAccountName", ",", "String", "configurationName", ")", "{", "return", "getWithServiceResponseAsync", "(", "resourceGroupName", ",", "automa...
Retrieve the configuration identified by configuration name. @param resourceGroupName Name of an Azure Resource group. @param automationAccountName The name of the automation account. @param configurationName The configuration name. @throws IllegalArgumentException thrown if parameters fail the validation @return the ...
[ "Retrieve", "the", "configuration", "identified", "by", "configuration", "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/DscConfigurationsInner.java#L226-L233
wisdom-framework/wisdom
core/wisdom-maven-plugin/src/main/java/org/wisdom/maven/mojos/CSSMinifierMojo.java
CSSMinifierMojo.fileCreated
@Override public boolean fileCreated(File file) throws WatchingException { """ Minifies the created files. @param file is the file. @return {@literal false} if the pipeline processing must be interrupted for this event. Most watchers should return {@literal true} to let other watchers be notified. @throw...
java
@Override public boolean fileCreated(File file) throws WatchingException { if (stylesheets != null) { try { process(stylesheets); } catch (MojoExecutionException e) { throw new WatchingException("Error while aggregating or minifying CSS resources", fil...
[ "@", "Override", "public", "boolean", "fileCreated", "(", "File", "file", ")", "throws", "WatchingException", "{", "if", "(", "stylesheets", "!=", "null", ")", "{", "try", "{", "process", "(", "stylesheets", ")", ";", "}", "catch", "(", "MojoExecutionExcepti...
Minifies the created files. @param file is the file. @return {@literal false} if the pipeline processing must be interrupted for this event. Most watchers should return {@literal true} to let other watchers be notified. @throws org.wisdom.maven.WatchingException if the watcher failed to process the given file.
[ "Minifies", "the", "created", "files", "." ]
train
https://github.com/wisdom-framework/wisdom/blob/a35b6431200fec56b178c0ff60837ed73fd7874d/core/wisdom-maven-plugin/src/main/java/org/wisdom/maven/mojos/CSSMinifierMojo.java#L295-L307
apache/groovy
subprojects/groovy-swing/src/main/java/org/codehaus/groovy/runtime/SwingGroovyMethods.java
SwingGroovyMethods.leftShift
public static Container leftShift(Container self, Component c) { """ Overloads the left shift operator to provide an easy way to add components to a Container. @param self a Container @param c a Component to be added to the container. @return same container, after the value was added to it. @since 1.6.4 ...
java
public static Container leftShift(Container self, Component c) { self.add(c); return self; }
[ "public", "static", "Container", "leftShift", "(", "Container", "self", ",", "Component", "c", ")", "{", "self", ".", "add", "(", "c", ")", ";", "return", "self", ";", "}" ]
Overloads the left shift operator to provide an easy way to add components to a Container. @param self a Container @param c a Component to be added to the container. @return same container, after the value was added to it. @since 1.6.4
[ "Overloads", "the", "left", "shift", "operator", "to", "provide", "an", "easy", "way", "to", "add", "components", "to", "a", "Container", "." ]
train
https://github.com/apache/groovy/blob/71cf20addb611bb8d097a59e395fd20bc7f31772/subprojects/groovy-swing/src/main/java/org/codehaus/groovy/runtime/SwingGroovyMethods.java#L76-L79
HanSolo/SteelSeries-Swing
src/main/java/eu/hansolo/steelseries/tools/GradientWrapper.java
GradientWrapper.getColorAt
public Color getColorAt(final float FRACTION) { """ Returns the color that is defined by the given fraction in the linear gradient paint @param FRACTION @return the color that is defined by the given fraction in the linear gradient paint """ float fraction = FRACTION < 0f ? 0f : (FRACTION > 1f ? 1f :...
java
public Color getColorAt(final float FRACTION) { float fraction = FRACTION < 0f ? 0f : (FRACTION > 1f ? 1f : FRACTION); float lowerLimit = 0f; int lowerIndex = 0; float upperLimit = 1f; int upperIndex = 1; int index = 0; for (float currentFraction : fractions) { ...
[ "public", "Color", "getColorAt", "(", "final", "float", "FRACTION", ")", "{", "float", "fraction", "=", "FRACTION", "<", "0f", "?", "0f", ":", "(", "FRACTION", ">", "1f", "?", "1f", ":", "FRACTION", ")", ";", "float", "lowerLimit", "=", "0f", ";", "i...
Returns the color that is defined by the given fraction in the linear gradient paint @param FRACTION @return the color that is defined by the given fraction in the linear gradient paint
[ "Returns", "the", "color", "that", "is", "defined", "by", "the", "given", "fraction", "in", "the", "linear", "gradient", "paint" ]
train
https://github.com/HanSolo/SteelSeries-Swing/blob/c2f7b45a477757ef21bbb6a1174ddedb2250ae57/src/main/java/eu/hansolo/steelseries/tools/GradientWrapper.java#L109-L136
Azure/azure-sdk-for-java
cognitiveservices/data-plane/vision/contentmoderator/src/main/java/com/microsoft/azure/cognitiveservices/vision/contentmoderator/implementation/ReviewsImpl.java
ReviewsImpl.addVideoFrameAsync
public Observable<Void> addVideoFrameAsync(String teamName, String reviewId, AddVideoFrameOptionalParameter addVideoFrameOptionalParameter) { """ The reviews created would show up for Reviewers on your team. As Reviewers complete reviewing, results of the Review would be POSTED (i.e. HTTP POST) on the specified Ca...
java
public Observable<Void> addVideoFrameAsync(String teamName, String reviewId, AddVideoFrameOptionalParameter addVideoFrameOptionalParameter) { return addVideoFrameWithServiceResponseAsync(teamName, reviewId, addVideoFrameOptionalParameter).map(new Func1<ServiceResponse<Void>, Void>() { @Override ...
[ "public", "Observable", "<", "Void", ">", "addVideoFrameAsync", "(", "String", "teamName", ",", "String", "reviewId", ",", "AddVideoFrameOptionalParameter", "addVideoFrameOptionalParameter", ")", "{", "return", "addVideoFrameWithServiceResponseAsync", "(", "teamName", ",", ...
The reviews created would show up for Reviewers on your team. As Reviewers complete reviewing, results of the Review would be POSTED (i.e. HTTP POST) on the specified CallBackEndpoint. &lt;h3&gt;CallBack Schemas &lt;/h3&gt; &lt;h4&gt;Review Completion CallBack Sample&lt;/h4&gt; &lt;p&gt; {&lt;br/&gt; "ReviewId": "&lt;R...
[ "The", "reviews", "created", "would", "show", "up", "for", "Reviewers", "on", "your", "team", ".", "As", "Reviewers", "complete", "reviewing", "results", "of", "the", "Review", "would", "be", "POSTED", "(", "i", ".", "e", ".", "HTTP", "POST", ")", "on", ...
train
https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/cognitiveservices/data-plane/vision/contentmoderator/src/main/java/com/microsoft/azure/cognitiveservices/vision/contentmoderator/implementation/ReviewsImpl.java#L1137-L1144
rundeck/rundeck
core/src/main/java/com/dtolabs/utils/Mapper.java
Mapper.makeMap
public static Map makeMap(Mapper mapper, Iterator i, boolean includeNull) { """ Create a new Map by using the iterator objects as keys, and the mapping result as values. @param mapper a Mapper to map the values @param i Iterator @param includeNull true to include null @return a new Map with values map...
java
public static Map makeMap(Mapper mapper, Iterator i, boolean includeNull) { HashMap h = new HashMap(); for (; i.hasNext();) { Object k = i.next(); Object v = mapper.map(k); if (includeNull || v != null) { h.put(k, v); } } re...
[ "public", "static", "Map", "makeMap", "(", "Mapper", "mapper", ",", "Iterator", "i", ",", "boolean", "includeNull", ")", "{", "HashMap", "h", "=", "new", "HashMap", "(", ")", ";", "for", "(", ";", "i", ".", "hasNext", "(", ")", ";", ")", "{", "Obje...
Create a new Map by using the iterator objects as keys, and the mapping result as values. @param mapper a Mapper to map the values @param i Iterator @param includeNull true to include null @return a new Map with values mapped
[ "Create", "a", "new", "Map", "by", "using", "the", "iterator", "objects", "as", "keys", "and", "the", "mapping", "result", "as", "values", "." ]
train
https://github.com/rundeck/rundeck/blob/8070f774f55bffaa1118ff0c03aea319d40a9668/core/src/main/java/com/dtolabs/utils/Mapper.java#L564-L574
Azure/azure-sdk-for-java
network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/ApplicationSecurityGroupsInner.java
ApplicationSecurityGroupsInner.createOrUpdate
public ApplicationSecurityGroupInner createOrUpdate(String resourceGroupName, String applicationSecurityGroupName, ApplicationSecurityGroupInner parameters) { """ Creates or updates an application security group. @param resourceGroupName The name of the resource group. @param applicationSecurityGroupName The n...
java
public ApplicationSecurityGroupInner createOrUpdate(String resourceGroupName, String applicationSecurityGroupName, ApplicationSecurityGroupInner parameters) { return createOrUpdateWithServiceResponseAsync(resourceGroupName, applicationSecurityGroupName, parameters).toBlocking().last().body(); }
[ "public", "ApplicationSecurityGroupInner", "createOrUpdate", "(", "String", "resourceGroupName", ",", "String", "applicationSecurityGroupName", ",", "ApplicationSecurityGroupInner", "parameters", ")", "{", "return", "createOrUpdateWithServiceResponseAsync", "(", "resourceGroupName"...
Creates or updates an application security group. @param resourceGroupName The name of the resource group. @param applicationSecurityGroupName The name of the application security group. @param parameters Parameters supplied to the create or update ApplicationSecurityGroup operation. @throws IllegalArgumentException t...
[ "Creates", "or", "updates", "an", "application", "security", "group", "." ]
train
https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/ApplicationSecurityGroupsInner.java#L351-L353
Mozu/mozu-java
mozu-java-core/src/main/java/com/mozu/api/urls/commerce/orders/ShipmentUrl.java
ShipmentUrl.deleteShipmentUrl
public static MozuUrl deleteShipmentUrl(String orderId, String shipmentId) { """ Get Resource Url for DeleteShipment @param orderId Unique identifier of the order. @param shipmentId Unique identifier of the shipment to retrieve. @return String Resource Url """ UrlFormatter formatter = new UrlFormatter(...
java
public static MozuUrl deleteShipmentUrl(String orderId, String shipmentId) { UrlFormatter formatter = new UrlFormatter("/api/commerce/orders/{orderId}/shipments/{shipmentId}"); formatter.formatUrl("orderId", orderId); formatter.formatUrl("shipmentId", shipmentId); return new MozuUrl(formatter.getResourceU...
[ "public", "static", "MozuUrl", "deleteShipmentUrl", "(", "String", "orderId", ",", "String", "shipmentId", ")", "{", "UrlFormatter", "formatter", "=", "new", "UrlFormatter", "(", "\"/api/commerce/orders/{orderId}/shipments/{shipmentId}\"", ")", ";", "formatter", ".", "f...
Get Resource Url for DeleteShipment @param orderId Unique identifier of the order. @param shipmentId Unique identifier of the shipment to retrieve. @return String Resource Url
[ "Get", "Resource", "Url", "for", "DeleteShipment" ]
train
https://github.com/Mozu/mozu-java/blob/5beadde73601a859f845e3e2fc1077b39c8bea83/mozu-java-core/src/main/java/com/mozu/api/urls/commerce/orders/ShipmentUrl.java#L64-L70
Crab2died/Excel4J
src/main/java/com/github/crab2died/ExcelUtils.java
ExcelUtils.readExcel2List
public List<List<String>> readExcel2List(String excelPath, int offsetLine, int limitLine, int sheetIndex) throws IOException, InvalidFormatException { """ 读取Excel表格数据,返回{@code List[List[String]]}类型的数据集合 @param excelPath 待读取Excel的路径 @param offsetLine Excel表头行(默认是0) @param limitLine 最大读取行数(默认表尾) ...
java
public List<List<String>> readExcel2List(String excelPath, int offsetLine, int limitLine, int sheetIndex) throws IOException, InvalidFormatException { try (Workbook workbook = WorkbookFactory.create(new FileInputStream(new File(excelPath)))) { return readExcel2ObjectsHandler(workbook, o...
[ "public", "List", "<", "List", "<", "String", ">", ">", "readExcel2List", "(", "String", "excelPath", ",", "int", "offsetLine", ",", "int", "limitLine", ",", "int", "sheetIndex", ")", "throws", "IOException", ",", "InvalidFormatException", "{", "try", "(", "...
读取Excel表格数据,返回{@code List[List[String]]}类型的数据集合 @param excelPath 待读取Excel的路径 @param offsetLine Excel表头行(默认是0) @param limitLine 最大读取行数(默认表尾) @param sheetIndex Sheet索引(默认0) @return 返回{@code List<List<String>>}类型的数据集合 @throws IOException 异常 @throws InvalidFormatException 异常 @author Crab2Died
[ "读取Excel表格数据", "返回", "{", "@code", "List", "[", "List", "[", "String", "]]", "}", "类型的数据集合" ]
train
https://github.com/Crab2died/Excel4J/blob/2ab0a3b8226a69ff868c3ead6e724f3a774f5f77/src/main/java/com/github/crab2died/ExcelUtils.java#L318-L324
j-a-w-r/jawr-main-repo
jawr/jawr-core/src/main/java/net/jawr/web/resource/bundle/IOUtils.java
IOUtils.copy
public static void copy(Reader reader, Writer writer, boolean closeStreams) throws IOException { """ Writes all the contents of a Reader to a Writer. @param reader the reader to read from @param writer the writer to write to @param closeStreams the flag indicating if the stream must be close at the end, e...
java
public static void copy(Reader reader, Writer writer, boolean closeStreams) throws IOException { char[] buf = new char[BUFFER_SIZE]; int num = 0; try { while ((num = reader.read(buf, 0, buf.length)) != -1) { writer.write(buf, 0, num); } } finally { if (closeStreams) { close(reader); close(...
[ "public", "static", "void", "copy", "(", "Reader", "reader", ",", "Writer", "writer", ",", "boolean", "closeStreams", ")", "throws", "IOException", "{", "char", "[", "]", "buf", "=", "new", "char", "[", "BUFFER_SIZE", "]", ";", "int", "num", "=", "0", ...
Writes all the contents of a Reader to a Writer. @param reader the reader to read from @param writer the writer to write to @param closeStreams the flag indicating if the stream must be close at the end, even if an exception occurs @throws java.io.IOException if an IOExcption occurs
[ "Writes", "all", "the", "contents", "of", "a", "Reader", "to", "a", "Writer", "." ]
train
https://github.com/j-a-w-r/jawr-main-repo/blob/5381f6acf461cd2502593c67a77bd6ef9eab848d/jawr/jawr-core/src/main/java/net/jawr/web/resource/bundle/IOUtils.java#L59-L73
primefaces/primefaces
src/main/java/org/primefaces/util/ComponentTraversalUtils.java
ComponentTraversalUtils.firstById
public static void firstById(String id, UIComponent base, char separatorChar, FacesContext context, ContextCallback callback) { """ Finds the first component by the given id expression or client id. @param id The id. @param base The base component to start the traversal. @param separatorChar The separatorChar...
java
public static void firstById(String id, UIComponent base, char separatorChar, FacesContext context, ContextCallback callback) { // try #findComponent first UIComponent component = base.findComponent(id); // try #invokeOnComponent // it's required to support e.g. a full client id for a ...
[ "public", "static", "void", "firstById", "(", "String", "id", ",", "UIComponent", "base", ",", "char", "separatorChar", ",", "FacesContext", "context", ",", "ContextCallback", "callback", ")", "{", "// try #findComponent first", "UIComponent", "component", "=", "bas...
Finds the first component by the given id expression or client id. @param id The id. @param base The base component to start the traversal. @param separatorChar The separatorChar (e.g. :). @param context The FacesContext. @param callback the callback for the found component
[ "Finds", "the", "first", "component", "by", "the", "given", "id", "expression", "or", "client", "id", "." ]
train
https://github.com/primefaces/primefaces/blob/b8cdd5ed395d09826e40e3302d6b14901d3ef4e7/src/main/java/org/primefaces/util/ComponentTraversalUtils.java#L148-L167
hazelcast/hazelcast
hazelcast/src/main/java/com/hazelcast/internal/config/MergePolicyValidator.java
MergePolicyValidator.checkMapMergePolicyWhenStatisticsAreDisabled
private static void checkMapMergePolicyWhenStatisticsAreDisabled(String mergePolicyClass, List<Class> requiredMergeTypes) { """ Checks if the configured merge policy requires merge types, which are just available if map statistics are enabled. @param mergePolicyClass the name of the configured merge policy cl...
java
private static void checkMapMergePolicyWhenStatisticsAreDisabled(String mergePolicyClass, List<Class> requiredMergeTypes) { for (Class<?> requiredMergeType : requiredMergeTypes) { if (MergingLastStoredTime.class.isAssignableFrom(requiredMergeType) || MergingExpirationTime.class.i...
[ "private", "static", "void", "checkMapMergePolicyWhenStatisticsAreDisabled", "(", "String", "mergePolicyClass", ",", "List", "<", "Class", ">", "requiredMergeTypes", ")", "{", "for", "(", "Class", "<", "?", ">", "requiredMergeType", ":", "requiredMergeTypes", ")", "...
Checks if the configured merge policy requires merge types, which are just available if map statistics are enabled. @param mergePolicyClass the name of the configured merge policy class @param requiredMergeTypes the required merge types of the configured merge policy
[ "Checks", "if", "the", "configured", "merge", "policy", "requires", "merge", "types", "which", "are", "just", "available", "if", "map", "statistics", "are", "enabled", "." ]
train
https://github.com/hazelcast/hazelcast/blob/8c4bc10515dbbfb41a33e0302c0caedf3cda1baf/hazelcast/src/main/java/com/hazelcast/internal/config/MergePolicyValidator.java#L164-L173
TheHortonMachine/hortonmachine
gears/src/main/java/org/hortonmachine/gears/io/dxfdwg/libs/dwg/utils/ByteUtils.java
ByteUtils.doubleToBytes
public static final void doubleToBytes( double d, byte[] data, int[] offset ) { """ Write the bytes representing <code>d</code> into the byte array <code>data</code>, starting at index <code>offset [0]</code>, and increment <code>offset [0]</code> by the number of bytes written; if <code>data == null</code>, in...
java
public static final void doubleToBytes( double d, byte[] data, int[] offset ) { long bits = Double.doubleToLongBits(d); longToBytes(bits, data, offset); }
[ "public", "static", "final", "void", "doubleToBytes", "(", "double", "d", ",", "byte", "[", "]", "data", ",", "int", "[", "]", "offset", ")", "{", "long", "bits", "=", "Double", ".", "doubleToLongBits", "(", "d", ")", ";", "longToBytes", "(", "bits", ...
Write the bytes representing <code>d</code> into the byte array <code>data</code>, starting at index <code>offset [0]</code>, and increment <code>offset [0]</code> by the number of bytes written; if <code>data == null</code>, increment <code>offset [0]</code> by the number of bytes that would have been written otherwis...
[ "Write", "the", "bytes", "representing", "<code", ">", "d<", "/", "code", ">", "into", "the", "byte", "array", "<code", ">", "data<", "/", "code", ">", "starting", "at", "index", "<code", ">", "offset", "[", "0", "]", "<", "/", "code", ">", "and", ...
train
https://github.com/TheHortonMachine/hortonmachine/blob/d2b436bbdf951dc1fda56096a42dbc0eae4d35a5/gears/src/main/java/org/hortonmachine/gears/io/dxfdwg/libs/dwg/utils/ByteUtils.java#L237-L240
OpenLiberty/open-liberty
dev/com.ibm.ws.messaging.runtime/src/com/ibm/ws/sib/admin/internal/JsLocalizer.java
JsLocalizer.deleteLocalizationPoint
public void deleteLocalizationPoint(JsBus bus, LWMConfig dest) throws SIBExceptionBase, SIException { """ Delete a given localization point, this will normally involve altering the destination localization held by mp, unless the associated DestinationDefinition has gone, in which case the DestinationDefinition ...
java
public void deleteLocalizationPoint(JsBus bus, LWMConfig dest) throws SIBExceptionBase, SIException { if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) { SibTr.entry(tc, "deleteLocalizationPoint", ((BaseDestination)dest).getName()); } DestinationDefinition destDef = (...
[ "public", "void", "deleteLocalizationPoint", "(", "JsBus", "bus", ",", "LWMConfig", "dest", ")", "throws", "SIBExceptionBase", ",", "SIException", "{", "if", "(", "TraceComponent", ".", "isAnyTracingEnabled", "(", ")", "&&", "tc", ".", "isEntryEnabled", "(", ")"...
Delete a given localization point, this will normally involve altering the destination localization held by mp, unless the associated DestinationDefinition has gone, in which case the DestinationDefinition will be flagged for deletion. The deletetion will occure in the endUpdate() method which will be called after all ...
[ "Delete", "a", "given", "localization", "point", "this", "will", "normally", "involve", "altering", "the", "destination", "localization", "held", "by", "mp", "unless", "the", "associated", "DestinationDefinition", "has", "gone", "in", "which", "case", "the", "Dest...
train
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.messaging.runtime/src/com/ibm/ws/sib/admin/internal/JsLocalizer.java#L432-L454
joniles/mpxj
src/main/java/net/sf/mpxj/sample/MpxjQuery.java
MpxjQuery.listHierarchy
private static void listHierarchy(Task task, String indent) { """ Helper method called recursively to list child tasks. @param task task whose children are to be displayed @param indent whitespace used to indent hierarchy levels """ for (Task child : task.getChildTasks()) { System.out....
java
private static void listHierarchy(Task task, String indent) { for (Task child : task.getChildTasks()) { System.out.println(indent + "Task: " + child.getName() + "\t" + child.getStart() + "\t" + child.getFinish()); listHierarchy(child, indent + " "); } }
[ "private", "static", "void", "listHierarchy", "(", "Task", "task", ",", "String", "indent", ")", "{", "for", "(", "Task", "child", ":", "task", ".", "getChildTasks", "(", ")", ")", "{", "System", ".", "out", ".", "println", "(", "indent", "+", "\"Task:...
Helper method called recursively to list child tasks. @param task task whose children are to be displayed @param indent whitespace used to indent hierarchy levels
[ "Helper", "method", "called", "recursively", "to", "list", "child", "tasks", "." ]
train
https://github.com/joniles/mpxj/blob/143ea0e195da59cd108f13b3b06328e9542337e8/src/main/java/net/sf/mpxj/sample/MpxjQuery.java#L215-L222
looly/hutool
hutool-db/src/main/java/cn/hutool/db/AbstractDb.java
AbstractDb.findBy
public List<Entity> findBy(String tableName, Condition... wheres) throws SQLException { """ 根据某个字段名条件查询数据列表,返回所有字段 @param tableName 表名 @param wheres 字段名 @return 数据对象列表 @throws SQLException SQL执行异常 @since 4.0.0 """ final Query query = new Query(wheres, tableName); return find(query, EntityListHandl...
java
public List<Entity> findBy(String tableName, Condition... wheres) throws SQLException { final Query query = new Query(wheres, tableName); return find(query, EntityListHandler.create()); }
[ "public", "List", "<", "Entity", ">", "findBy", "(", "String", "tableName", ",", "Condition", "...", "wheres", ")", "throws", "SQLException", "{", "final", "Query", "query", "=", "new", "Query", "(", "wheres", ",", "tableName", ")", ";", "return", "find", ...
根据某个字段名条件查询数据列表,返回所有字段 @param tableName 表名 @param wheres 字段名 @return 数据对象列表 @throws SQLException SQL执行异常 @since 4.0.0
[ "根据某个字段名条件查询数据列表,返回所有字段" ]
train
https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-db/src/main/java/cn/hutool/db/AbstractDb.java#L568-L571
alibaba/jstorm
jstorm-core/src/main/java/com/alibaba/jstorm/blobstore/BlobStoreUtils.java
BlobStoreUtils.downloadDistributeStormCode
public static void downloadDistributeStormCode(Map conf, String topologyId, String masterCodeDir) throws IOException, TException { """ no need to synchronize, since EventManager will execute sequentially """ String tmpToot = null; try { // STORM_LOCAL_DIR/supervisor/tmp/...
java
public static void downloadDistributeStormCode(Map conf, String topologyId, String masterCodeDir) throws IOException, TException { String tmpToot = null; try { // STORM_LOCAL_DIR/supervisor/tmp/(UUID) tmpToot = StormConfig.supervisorTmpDir(conf) + File.separator + UUI...
[ "public", "static", "void", "downloadDistributeStormCode", "(", "Map", "conf", ",", "String", "topologyId", ",", "String", "masterCodeDir", ")", "throws", "IOException", ",", "TException", "{", "String", "tmpToot", "=", "null", ";", "try", "{", "// STORM_LOCAL_DIR...
no need to synchronize, since EventManager will execute sequentially
[ "no", "need", "to", "synchronize", "since", "EventManager", "will", "execute", "sequentially" ]
train
https://github.com/alibaba/jstorm/blob/5d6cde22dbca7df3d6e6830bf94f98a6639ab559/jstorm-core/src/main/java/com/alibaba/jstorm/blobstore/BlobStoreUtils.java#L566-L599