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
mgm-tp/jfunk
jfunk-common/src/main/java/com/mgmtp/jfunk/common/random/MathRandom.java
MathRandom.getCalendar
public Calendar getCalendar(final Date min, final Date max) { """ Returns a random Calendar object in the range of [min, max]. @param min minimum value for generated Calendar object @param max maximum value for generated Calendar object """ long millis = getLong(min.getTime(), max.getTime()); retur...
java
public Calendar getCalendar(final Date min, final Date max) { long millis = getLong(min.getTime(), max.getTime()); return createCalendar(millis); }
[ "public", "Calendar", "getCalendar", "(", "final", "Date", "min", ",", "final", "Date", "max", ")", "{", "long", "millis", "=", "getLong", "(", "min", ".", "getTime", "(", ")", ",", "max", ".", "getTime", "(", ")", ")", ";", "return", "createCalendar",...
Returns a random Calendar object in the range of [min, max]. @param min minimum value for generated Calendar object @param max maximum value for generated Calendar object
[ "Returns", "a", "random", "Calendar", "object", "in", "the", "range", "of", "[", "min", "max", "]", "." ]
train
https://github.com/mgm-tp/jfunk/blob/5b9fecac5778b988bb458085ded39ea9a4c7c2ae/jfunk-common/src/main/java/com/mgmtp/jfunk/common/random/MathRandom.java#L191-L194
tsweets/jdefault
src/main/java/org/beer30/jdefault/JDefaultNumber.java
JDefaultNumber.randomIntBetweenTwoNumbers
public static int randomIntBetweenTwoNumbers(int min, int max) { """ generate a random number between 2 numbers - inclusive @param min lowest number to generate @param max max number to generate @return random number string """ int number = RandomUtils.nextInt(max - min); return number + m...
java
public static int randomIntBetweenTwoNumbers(int min, int max) { int number = RandomUtils.nextInt(max - min); return number + min; }
[ "public", "static", "int", "randomIntBetweenTwoNumbers", "(", "int", "min", ",", "int", "max", ")", "{", "int", "number", "=", "RandomUtils", ".", "nextInt", "(", "max", "-", "min", ")", ";", "return", "number", "+", "min", ";", "}" ]
generate a random number between 2 numbers - inclusive @param min lowest number to generate @param max max number to generate @return random number string
[ "generate", "a", "random", "number", "between", "2", "numbers", "-", "inclusive" ]
train
https://github.com/tsweets/jdefault/blob/1793ab8e1337e930f31e362071db4af0c3978b70/src/main/java/org/beer30/jdefault/JDefaultNumber.java#L83-L86
Azure/azure-sdk-for-java
sql/resource-manager/v2017_10_01_preview/src/main/java/com/microsoft/azure/management/sql/v2017_10_01_preview/implementation/InstanceFailoverGroupsInner.java
InstanceFailoverGroupsInner.beginForceFailoverAllowDataLoss
public InstanceFailoverGroupInner beginForceFailoverAllowDataLoss(String resourceGroupName, String locationName, String failoverGroupName) { """ Fails over from the current primary managed instance to this managed instance. This operation might result in data loss. @param resourceGroupName The name of the resou...
java
public InstanceFailoverGroupInner beginForceFailoverAllowDataLoss(String resourceGroupName, String locationName, String failoverGroupName) { return beginForceFailoverAllowDataLossWithServiceResponseAsync(resourceGroupName, locationName, failoverGroupName).toBlocking().single().body(); }
[ "public", "InstanceFailoverGroupInner", "beginForceFailoverAllowDataLoss", "(", "String", "resourceGroupName", ",", "String", "locationName", ",", "String", "failoverGroupName", ")", "{", "return", "beginForceFailoverAllowDataLossWithServiceResponseAsync", "(", "resourceGroupName",...
Fails over from the current primary managed instance to this managed instance. This operation might result in data loss. @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 locationName The name of the r...
[ "Fails", "over", "from", "the", "current", "primary", "managed", "instance", "to", "this", "managed", "instance", ".", "This", "operation", "might", "result", "in", "data", "loss", "." ]
train
https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/sql/resource-manager/v2017_10_01_preview/src/main/java/com/microsoft/azure/management/sql/v2017_10_01_preview/implementation/InstanceFailoverGroupsInner.java#L940-L942
TheHortonMachine/hortonmachine
gears/src/main/java/org/hortonmachine/gears/io/grasslegacy/utils/FileUtilities.java
FileUtilities.deleteFileOrDirOnExit
public static boolean deleteFileOrDirOnExit( File filehandle ) { """ Delete file or folder recursively on exit of the program @param filehandle @return true if all went well """ if (filehandle.isDirectory()) { String[] children = filehandle.list(); for( int i = 0; i < childr...
java
public static boolean deleteFileOrDirOnExit( File filehandle ) { if (filehandle.isDirectory()) { String[] children = filehandle.list(); for( int i = 0; i < children.length; i++ ) { boolean success = deleteFileOrDir(new File(filehandle, children[i])); if (!...
[ "public", "static", "boolean", "deleteFileOrDirOnExit", "(", "File", "filehandle", ")", "{", "if", "(", "filehandle", ".", "isDirectory", "(", ")", ")", "{", "String", "[", "]", "children", "=", "filehandle", ".", "list", "(", ")", ";", "for", "(", "int"...
Delete file or folder recursively on exit of the program @param filehandle @return true if all went well
[ "Delete", "file", "or", "folder", "recursively", "on", "exit", "of", "the", "program" ]
train
https://github.com/TheHortonMachine/hortonmachine/blob/d2b436bbdf951dc1fda56096a42dbc0eae4d35a5/gears/src/main/java/org/hortonmachine/gears/io/grasslegacy/utils/FileUtilities.java#L212-L224
Impetus/Kundera
src/kundera-cassandra/cassandra-core/src/main/java/com/impetus/client/cassandra/schemamanager/CassandraSchemaManager.java
CassandraSchemaManager.replaceColumnsAndStripLastChar
private StringBuilder replaceColumnsAndStripLastChar(String columnFamilyQuery, StringBuilder queryBuilder) { """ Strip last char. @param columnFamilyQuery the column family query @param queryBuilder the query builder @return the string builder """ // strip last ",". if (queryBuilder.leng...
java
private StringBuilder replaceColumnsAndStripLastChar(String columnFamilyQuery, StringBuilder queryBuilder) { // strip last ",". if (queryBuilder.length() > 0) { queryBuilder.deleteCharAt(queryBuilder.length() - 1); columnFamilyQuery = StringUtils.replace(columnFamily...
[ "private", "StringBuilder", "replaceColumnsAndStripLastChar", "(", "String", "columnFamilyQuery", ",", "StringBuilder", "queryBuilder", ")", "{", "// strip last \",\".", "if", "(", "queryBuilder", ".", "length", "(", ")", ">", "0", ")", "{", "queryBuilder", ".", "de...
Strip last char. @param columnFamilyQuery the column family query @param queryBuilder the query builder @return the string builder
[ "Strip", "last", "char", "." ]
train
https://github.com/Impetus/Kundera/blob/268958ab1ec09d14ec4d9184f0c8ded7a9158908/src/kundera-cassandra/cassandra-core/src/main/java/com/impetus/client/cassandra/schemamanager/CassandraSchemaManager.java#L1345-L1356
joniles/mpxj
src/main/java/net/sf/mpxj/primavera/PrimaveraReader.java
PrimaveraReader.processUserDefinedFields
public void processUserDefinedFields(List<Row> fields, List<Row> values) { """ Process User Defined Fields (UDF). @param fields field definitions @param values field values """ // Process fields Map<Integer, String> tableNameMap = new HashMap<Integer, String>(); for (Row row : fields) ...
java
public void processUserDefinedFields(List<Row> fields, List<Row> values) { // Process fields Map<Integer, String> tableNameMap = new HashMap<Integer, String>(); for (Row row : fields) { Integer fieldId = row.getInteger("udf_type_id"); String tableName = row.getString("table_...
[ "public", "void", "processUserDefinedFields", "(", "List", "<", "Row", ">", "fields", ",", "List", "<", "Row", ">", "values", ")", "{", "// Process fields", "Map", "<", "Integer", ",", "String", ">", "tableNameMap", "=", "new", "HashMap", "<", "Integer", "...
Process User Defined Fields (UDF). @param fields field definitions @param values field values
[ "Process", "User", "Defined", "Fields", "(", "UDF", ")", "." ]
train
https://github.com/joniles/mpxj/blob/143ea0e195da59cd108f13b3b06328e9542337e8/src/main/java/net/sf/mpxj/primavera/PrimaveraReader.java#L225-L267
QSFT/Doradus
doradus-server/src/main/java/com/dell/doradus/core/ServerConfig.java
ServerConfig.setParamFromString
private static boolean setParamFromString(String name, String value) throws ConfigurationException { """ Return false if given name is not a known scalar configuration parameter """ try { Field field = config.getClass().getDeclaredField(name); String fieldType = field.getType...
java
private static boolean setParamFromString(String name, String value) throws ConfigurationException { try { Field field = config.getClass().getDeclaredField(name); String fieldType = field.getType().toString(); if (fieldType.compareToIgnoreCase("int") == 0) { ...
[ "private", "static", "boolean", "setParamFromString", "(", "String", "name", ",", "String", "value", ")", "throws", "ConfigurationException", "{", "try", "{", "Field", "field", "=", "config", ".", "getClass", "(", ")", ".", "getDeclaredField", "(", "name", ")"...
Return false if given name is not a known scalar configuration parameter
[ "Return", "false", "if", "given", "name", "is", "not", "a", "known", "scalar", "configuration", "parameter" ]
train
https://github.com/QSFT/Doradus/blob/ad64d3c37922eefda68ec8869ef089c1ca604b70/doradus-server/src/main/java/com/dell/doradus/core/ServerConfig.java#L411-L430
querydsl/querydsl
querydsl-core/src/main/java/com/querydsl/core/util/BeanMap.java
BeanMap.put
@Override public Object put(String name, Object value) { """ Sets the bean property with the given name to the given value. @param name the name of the property to set @param value the value to set that property to @return the previous value of that property """ if (bean != null) { ...
java
@Override public Object put(String name, Object value) { if (bean != null) { Object oldValue = get(name); Method method = getWriteMethod(name); if (method == null) { throw new IllegalArgumentException("The bean of type: " + bean.getClass().getName() + " ha...
[ "@", "Override", "public", "Object", "put", "(", "String", "name", ",", "Object", "value", ")", "{", "if", "(", "bean", "!=", "null", ")", "{", "Object", "oldValue", "=", "get", "(", "name", ")", ";", "Method", "method", "=", "getWriteMethod", "(", "...
Sets the bean property with the given name to the given value. @param name the name of the property to set @param value the value to set that property to @return the previous value of that property
[ "Sets", "the", "bean", "property", "with", "the", "given", "name", "to", "the", "given", "value", "." ]
train
https://github.com/querydsl/querydsl/blob/2bf234caf78549813a1e0f44d9c30ecc5ef734e3/querydsl-core/src/main/java/com/querydsl/core/util/BeanMap.java#L308-L330
sdl/odata
odata_renderer/src/main/java/com/sdl/odata/renderer/xml/writer/XMLServiceDocumentWriter.java
XMLServiceDocumentWriter.buildServiceDocument
public String buildServiceDocument() throws ODataRenderException { """ This is main method which generates service document. @return generated service (root collection) document @throws ODataRenderException in case of errors """ LOG.info("Building service(root) document"); try (ByteArrayOut...
java
public String buildServiceDocument() throws ODataRenderException { LOG.info("Building service(root) document"); try (ByteArrayOutputStream outputStream = new ByteArrayOutputStream(BUFFER_SIZE)) { XMLStreamWriter writer = startServiceDocument(outputStream); writeEntitySets(writer...
[ "public", "String", "buildServiceDocument", "(", ")", "throws", "ODataRenderException", "{", "LOG", ".", "info", "(", "\"Building service(root) document\"", ")", ";", "try", "(", "ByteArrayOutputStream", "outputStream", "=", "new", "ByteArrayOutputStream", "(", "BUFFER_...
This is main method which generates service document. @return generated service (root collection) document @throws ODataRenderException in case of errors
[ "This", "is", "main", "method", "which", "generates", "service", "document", "." ]
train
https://github.com/sdl/odata/blob/eb747d73e9af0f4e59a25b82ed656e526a7e2189/odata_renderer/src/main/java/com/sdl/odata/renderer/xml/writer/XMLServiceDocumentWriter.java#L76-L92
lucee/Lucee
core/src/main/java/lucee/commons/io/ini/IniFile.java
IniFile.isNullOrEmpty
public boolean isNullOrEmpty(String section, String key) { """ Gets the NullOrEmpty attribute of the IniFile object @param section section to check @param key key to check @return is empty or not """ String value = getKeyValueEL(section, key); return (value == null || value.length() == 0); }
java
public boolean isNullOrEmpty(String section, String key) { String value = getKeyValueEL(section, key); return (value == null || value.length() == 0); }
[ "public", "boolean", "isNullOrEmpty", "(", "String", "section", ",", "String", "key", ")", "{", "String", "value", "=", "getKeyValueEL", "(", "section", ",", "key", ")", ";", "return", "(", "value", "==", "null", "||", "value", ".", "length", "(", ")", ...
Gets the NullOrEmpty attribute of the IniFile object @param section section to check @param key key to check @return is empty or not
[ "Gets", "the", "NullOrEmpty", "attribute", "of", "the", "IniFile", "object" ]
train
https://github.com/lucee/Lucee/blob/29b153fc4e126e5edb97da937f2ee2e231b87593/core/src/main/java/lucee/commons/io/ini/IniFile.java#L130-L133
googleapis/google-cloud-java
google-cloud-clients/google-cloud-core/src/main/java/com/google/cloud/Timestamp.java
Timestamp.ofTimeMicroseconds
public static Timestamp ofTimeMicroseconds(long microseconds) { """ Creates an instance representing the value of {@code microseconds}. @throws IllegalArgumentException if the timestamp is outside the representable range """ long seconds = microseconds / 1_000_000; int nanos = (int) (microseconds % ...
java
public static Timestamp ofTimeMicroseconds(long microseconds) { long seconds = microseconds / 1_000_000; int nanos = (int) (microseconds % 1_000_000 * 1000); if (nanos < 0) { seconds--; nanos += 1_000_000_000; } checkArgument( Timestamps.isValid(seconds, nanos), "timestamp out of...
[ "public", "static", "Timestamp", "ofTimeMicroseconds", "(", "long", "microseconds", ")", "{", "long", "seconds", "=", "microseconds", "/", "1_000_000", ";", "int", "nanos", "=", "(", "int", ")", "(", "microseconds", "%", "1_000_000", "*", "1000", ")", ";", ...
Creates an instance representing the value of {@code microseconds}. @throws IllegalArgumentException if the timestamp is outside the representable range
[ "Creates", "an", "instance", "representing", "the", "value", "of", "{", "@code", "microseconds", "}", "." ]
train
https://github.com/googleapis/google-cloud-java/blob/d2f0bc64a53049040fe9c9d338b12fab3dd1ad6a/google-cloud-clients/google-cloud-core/src/main/java/com/google/cloud/Timestamp.java#L89-L99
wisdom-framework/wisdom
core/wisdom-api/src/main/java/org/wisdom/api/router/AbstractRouter.java
AbstractRouter.getReverseRouteFor
@Override public String getReverseRouteFor(Controller controller, String method) { """ Gets the url of the route handled by the specified action method. The action does not takes parameters. @param controller the controller object @param method the controller method @return the url, {@literal null} if...
java
@Override public String getReverseRouteFor(Controller controller, String method) { return getReverseRouteFor(controller.getClass(), method, null); }
[ "@", "Override", "public", "String", "getReverseRouteFor", "(", "Controller", "controller", ",", "String", "method", ")", "{", "return", "getReverseRouteFor", "(", "controller", ".", "getClass", "(", ")", ",", "method", ",", "null", ")", ";", "}" ]
Gets the url of the route handled by the specified action method. The action does not takes parameters. @param controller the controller object @param method the controller method @return the url, {@literal null} if the action method is not found
[ "Gets", "the", "url", "of", "the", "route", "handled", "by", "the", "specified", "action", "method", ".", "The", "action", "does", "not", "takes", "parameters", "." ]
train
https://github.com/wisdom-framework/wisdom/blob/a35b6431200fec56b178c0ff60837ed73fd7874d/core/wisdom-api/src/main/java/org/wisdom/api/router/AbstractRouter.java#L140-L143
gwtbootstrap3/gwtbootstrap3-extras
src/main/java/org/gwtbootstrap3/extras/animate/client/ui/Animate.java
Animate.getStyleNameFromAnimation
private static String getStyleNameFromAnimation(final String animation, int count, int duration, int delay) { """ Helper method, which returns unique class name for combination of animation and it's settings. @param animation Animation CSS class name. @param count Number of animation repeats. @param duration ...
java
private static String getStyleNameFromAnimation(final String animation, int count, int duration, int delay) { // fix input if (count < 0) count = -1; if (duration < 0) duration = -1; if (delay < 0) delay = -1; String styleName = ""; // for all valid animations ...
[ "private", "static", "String", "getStyleNameFromAnimation", "(", "final", "String", "animation", ",", "int", "count", ",", "int", "duration", ",", "int", "delay", ")", "{", "// fix input", "if", "(", "count", "<", "0", ")", "count", "=", "-", "1", ";", "...
Helper method, which returns unique class name for combination of animation and it's settings. @param animation Animation CSS class name. @param count Number of animation repeats. @param duration Animation duration in ms. @param delay Delay before starting the animation loop in ms. @return String representation of cla...
[ "Helper", "method", "which", "returns", "unique", "class", "name", "for", "combination", "of", "animation", "and", "it", "s", "settings", "." ]
train
https://github.com/gwtbootstrap3/gwtbootstrap3-extras/blob/8e42aaffd2a082e9cb23a14c37a3c87b7cbdfa94/src/main/java/org/gwtbootstrap3/extras/animate/client/ui/Animate.java#L359-L382
lessthanoptimal/BoofCV
main/boofcv-ip/src/main/java/boofcv/alg/transform/ii/IntegralImageOps.java
IntegralImageOps.convolveSparse
public static float convolveSparse(GrayF32 integral , IntegralKernel kernel , int x , int y ) { """ Convolves a kernel around a single point in the integral image. @param integral Input integral image. Not modified. @param kernel Convolution kernel. @param x Pixel the convolution is performed at. @param y Pi...
java
public static float convolveSparse(GrayF32 integral , IntegralKernel kernel , int x , int y ) { return ImplIntegralImageOps.convolveSparse(integral, kernel, x, y); }
[ "public", "static", "float", "convolveSparse", "(", "GrayF32", "integral", ",", "IntegralKernel", "kernel", ",", "int", "x", ",", "int", "y", ")", "{", "return", "ImplIntegralImageOps", ".", "convolveSparse", "(", "integral", ",", "kernel", ",", "x", ",", "y...
Convolves a kernel around a single point in the integral image. @param integral Input integral image. Not modified. @param kernel Convolution kernel. @param x Pixel the convolution is performed at. @param y Pixel the convolution is performed at. @return Value of the convolution
[ "Convolves", "a", "kernel", "around", "a", "single", "point", "in", "the", "integral", "image", "." ]
train
https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-ip/src/main/java/boofcv/alg/transform/ii/IntegralImageOps.java#L312-L315
ops4j/org.ops4j.base
ops4j-base-util/src/main/java/org/ops4j/util/i18n/Resources.java
Resources.getInteger
public int getInteger( String key, int defaultValue ) throws MissingResourceException { """ Retrieve a integer from bundle. @param key the key of resource @param defaultValue the default value if key is missing @return the resource integer @throws MissingResourceException if the requeste...
java
public int getInteger( String key, int defaultValue ) throws MissingResourceException { try { return getInteger( key ); } catch( MissingResourceException mre ) { return defaultValue; } }
[ "public", "int", "getInteger", "(", "String", "key", ",", "int", "defaultValue", ")", "throws", "MissingResourceException", "{", "try", "{", "return", "getInteger", "(", "key", ")", ";", "}", "catch", "(", "MissingResourceException", "mre", ")", "{", "return",...
Retrieve a integer from bundle. @param key the key of resource @param defaultValue the default value if key is missing @return the resource integer @throws MissingResourceException if the requested key is unknown
[ "Retrieve", "a", "integer", "from", "bundle", "." ]
train
https://github.com/ops4j/org.ops4j.base/blob/b0e742c0d9511f6b19ca64da2ebaf30b7a47256a/ops4j-base-util/src/main/java/org/ops4j/util/i18n/Resources.java#L327-L338
lessthanoptimal/BoofCV
main/boofcv-ip/src/main/java/boofcv/alg/transform/ii/IntegralImageOps.java
IntegralImageOps.block_unsafe
public static float block_unsafe(GrayF32 integral , int x0 , int y0 , int x1 , int y1 ) { """ <p> Computes the value of a block inside an integral image without bounds checking. The block is defined as follows: x0 &lt; x &le; x1 and y0 &lt; y &le; y1. </p> @param integral Integral image. @param x0 Lower bo...
java
public static float block_unsafe(GrayF32 integral , int x0 , int y0 , int x1 , int y1 ) { return ImplIntegralImageOps.block_unsafe(integral,x0,y0,x1,y1); }
[ "public", "static", "float", "block_unsafe", "(", "GrayF32", "integral", ",", "int", "x0", ",", "int", "y0", ",", "int", "x1", ",", "int", "y1", ")", "{", "return", "ImplIntegralImageOps", ".", "block_unsafe", "(", "integral", ",", "x0", ",", "y0", ",", ...
<p> Computes the value of a block inside an integral image without bounds checking. The block is defined as follows: x0 &lt; x &le; x1 and y0 &lt; y &le; y1. </p> @param integral Integral image. @param x0 Lower bound of the block. Exclusive. @param y0 Lower bound of the block. Exclusive. @param x1 Upper bound of th...
[ "<p", ">", "Computes", "the", "value", "of", "a", "block", "inside", "an", "integral", "image", "without", "bounds", "checking", ".", "The", "block", "is", "defined", "as", "follows", ":", "x0", "&lt", ";", "x", "&le", ";", "x1", "and", "y0", "&lt", ...
train
https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-ip/src/main/java/boofcv/alg/transform/ii/IntegralImageOps.java#L390-L393
WASdev/standards.jsr352.jbatch
com.ibm.jbatch.container/src/main/java/com/ibm/jbatch/container/services/impl/JDBCPersistenceManagerImpl.java
JDBCPersistenceManagerImpl.getPartitionLevelJobInstanceWildCard
private String getPartitionLevelJobInstanceWildCard(long rootJobInstanceId, String stepName) { """ Obviously would be nice if the code writing this special format were in the same place as this code reading it. Assumes format like: JOBINSTANCEDATA (jobinstanceid name, ...) 1197,"partitionMetrics","NOTSE...
java
private String getPartitionLevelJobInstanceWildCard(long rootJobInstanceId, String stepName) { StringBuilder sb = new StringBuilder(":"); sb.append(Long.toString(rootJobInstanceId)); sb.append(":"); sb.append(stepName); sb.append(":%"); return sb.toString(); }
[ "private", "String", "getPartitionLevelJobInstanceWildCard", "(", "long", "rootJobInstanceId", ",", "String", "stepName", ")", "{", "StringBuilder", "sb", "=", "new", "StringBuilder", "(", "\":\"", ")", ";", "sb", ".", "append", "(", "Long", ".", "toString", "("...
Obviously would be nice if the code writing this special format were in the same place as this code reading it. Assumes format like: JOBINSTANCEDATA (jobinstanceid name, ...) 1197,"partitionMetrics","NOTSET" 1198,":1197:step1:0","NOTSET" 1199,":1197:step1:1","NOTSET" 1200,":1197:step2:0","NOTSET" @param rootJobExec...
[ "Obviously", "would", "be", "nice", "if", "the", "code", "writing", "this", "special", "format", "were", "in", "the", "same", "place", "as", "this", "code", "reading", "it", "." ]
train
https://github.com/WASdev/standards.jsr352.jbatch/blob/e267e79dccd4f0bd4bf9c2abc41a8a47b65be28f/com.ibm.jbatch.container/src/main/java/com/ibm/jbatch/container/services/impl/JDBCPersistenceManagerImpl.java#L1919-L1928
tweea/matrixjavalib-main-common
src/main/java/net/matrix/lang/Reflections.java
Reflections.getAccessibleMethodByName
public static Method getAccessibleMethodByName(final Object target, final String name) { """ 循环向上转型,获取对象的 DeclaredMethod,并强制设置为可访问。 如向上转型到 Object 仍无法找到,返回 null。 只匹配函数名。 用于方法需要被多次调用的情况。先使用本函数先取得 Method,然后调用 Method.invoke(Object obj, Object... args) @param target 目标对象 @param name 方法名 @return 方法 """ ...
java
public static Method getAccessibleMethodByName(final Object target, final String name) { for (Class<?> searchType = target.getClass(); searchType != Object.class; searchType = searchType.getSuperclass()) { Method[] methods = searchType.getDeclaredMethods(); for (Method method : methods) { if (method.get...
[ "public", "static", "Method", "getAccessibleMethodByName", "(", "final", "Object", "target", ",", "final", "String", "name", ")", "{", "for", "(", "Class", "<", "?", ">", "searchType", "=", "target", ".", "getClass", "(", ")", ";", "searchType", "!=", "Obj...
循环向上转型,获取对象的 DeclaredMethod,并强制设置为可访问。 如向上转型到 Object 仍无法找到,返回 null。 只匹配函数名。 用于方法需要被多次调用的情况。先使用本函数先取得 Method,然后调用 Method.invoke(Object obj, Object... args) @param target 目标对象 @param name 方法名 @return 方法
[ "循环向上转型,获取对象的", "DeclaredMethod,并强制设置为可访问。", "如向上转型到", "Object", "仍无法找到,返回", "null。", "只匹配函数名。", "用于方法需要被多次调用的情况。先使用本函数先取得", "Method,然后调用", "Method", ".", "invoke", "(", "Object", "obj", "Object", "...", "args", ")" ]
train
https://github.com/tweea/matrixjavalib-main-common/blob/ac8f98322a422e3ef76c3e12d47b98268cec7006/src/main/java/net/matrix/lang/Reflections.java#L250-L261
mnlipp/jgrapes
org.jgrapes.core/src/org/jgrapes/core/Event.java
Event.handlingError
@Override protected void handlingError( EventPipeline eventProcessor, Throwable throwable) { """ Implements the default behavior for handling events thrown by a handler. Fires a {@link HandlingError handling error} event for this event and the given throwable. @see HandlingError """ ...
java
@Override protected void handlingError( EventPipeline eventProcessor, Throwable throwable) { eventProcessor.fire( new HandlingError(this, throwable), channels()); }
[ "@", "Override", "protected", "void", "handlingError", "(", "EventPipeline", "eventProcessor", ",", "Throwable", "throwable", ")", "{", "eventProcessor", ".", "fire", "(", "new", "HandlingError", "(", "this", ",", "throwable", ")", ",", "channels", "(", ")", "...
Implements the default behavior for handling events thrown by a handler. Fires a {@link HandlingError handling error} event for this event and the given throwable. @see HandlingError
[ "Implements", "the", "default", "behavior", "for", "handling", "events", "thrown", "by", "a", "handler", ".", "Fires", "a", "{", "@link", "HandlingError", "handling", "error", "}", "event", "for", "this", "event", "and", "the", "given", "throwable", "." ]
train
https://github.com/mnlipp/jgrapes/blob/8b5d874935d84c34a52d3e3d3745e869b5203fa0/org.jgrapes.core/src/org/jgrapes/core/Event.java#L121-L126
lettuce-io/lettuce-core
src/main/java/io/lettuce/core/ScanStream.java
ScanStream.zscan
public static <K, V> Flux<ScoredValue<V>> zscan(RedisSortedSetReactiveCommands<K, V> commands, K key, ScanArgs scanArgs) { """ Sequentially iterate over elements in a set identified by {@code key}. This method uses {@code SSCAN} to perform an iterative scan. @param commands the commands interface, must not be ...
java
public static <K, V> Flux<ScoredValue<V>> zscan(RedisSortedSetReactiveCommands<K, V> commands, K key, ScanArgs scanArgs) { LettuceAssert.notNull(scanArgs, "ScanArgs must not be null"); return zscan(commands, key, Optional.of(scanArgs)); }
[ "public", "static", "<", "K", ",", "V", ">", "Flux", "<", "ScoredValue", "<", "V", ">", ">", "zscan", "(", "RedisSortedSetReactiveCommands", "<", "K", ",", "V", ">", "commands", ",", "K", "key", ",", "ScanArgs", "scanArgs", ")", "{", "LettuceAssert", "...
Sequentially iterate over elements in a set identified by {@code key}. This method uses {@code SSCAN} to perform an iterative scan. @param commands the commands interface, must not be {@literal null}. @param key the sorted set to scan. @param scanArgs the scan arguments, must not be {@literal null}. @param <K> Key typ...
[ "Sequentially", "iterate", "over", "elements", "in", "a", "set", "identified", "by", "{", "@code", "key", "}", ".", "This", "method", "uses", "{", "@code", "SSCAN", "}", "to", "perform", "an", "iterative", "scan", "." ]
train
https://github.com/lettuce-io/lettuce-core/blob/b6de74e384dea112e3656684ca3f50cdfd6c8e0d/src/main/java/io/lettuce/core/ScanStream.java#L223-L228
UrielCh/ovh-java-sdk
ovh-java-sdk-cloud/src/main/java/net/minidev/ovh/api/ApiOvhCloud.java
ApiOvhCloud.project_serviceName_sshkey_POST
public OvhSshKeyDetail project_serviceName_sshkey_POST(String serviceName, String name, String publicKey, String region) throws IOException { """ Create SSH key REST: POST /cloud/project/{serviceName}/sshkey @param name [required] SSH key name @param publicKey [required] SSH public key @param region [require...
java
public OvhSshKeyDetail project_serviceName_sshkey_POST(String serviceName, String name, String publicKey, String region) throws IOException { String qPath = "/cloud/project/{serviceName}/sshkey"; StringBuilder sb = path(qPath, serviceName); HashMap<String, Object>o = new HashMap<String, Object>(); addBody(o, "n...
[ "public", "OvhSshKeyDetail", "project_serviceName_sshkey_POST", "(", "String", "serviceName", ",", "String", "name", ",", "String", "publicKey", ",", "String", "region", ")", "throws", "IOException", "{", "String", "qPath", "=", "\"/cloud/project/{serviceName}/sshkey\"", ...
Create SSH key REST: POST /cloud/project/{serviceName}/sshkey @param name [required] SSH key name @param publicKey [required] SSH public key @param region [required] Region to create SSH key @param serviceName [required] Project name
[ "Create", "SSH", "key" ]
train
https://github.com/UrielCh/ovh-java-sdk/blob/6d531a40e56e09701943e334c25f90f640c55701/ovh-java-sdk-cloud/src/main/java/net/minidev/ovh/api/ApiOvhCloud.java#L1558-L1567
alkacon/opencms-core
src/org/opencms/site/CmsSiteManagerImpl.java
CmsSiteManagerImpl.isMatchingCurrentSite
public boolean isMatchingCurrentSite(CmsObject cms, CmsSiteMatcher matcher) { """ Returns <code>true</code> if the given site matcher matches the current site.<p> @param cms the current OpenCms user context @param matcher the site matcher to match the site with @return <code>true</code> if the matcher match...
java
public boolean isMatchingCurrentSite(CmsObject cms, CmsSiteMatcher matcher) { return m_siteMatcherSites.get(matcher) == getCurrentSite(cms); }
[ "public", "boolean", "isMatchingCurrentSite", "(", "CmsObject", "cms", ",", "CmsSiteMatcher", "matcher", ")", "{", "return", "m_siteMatcherSites", ".", "get", "(", "matcher", ")", "==", "getCurrentSite", "(", "cms", ")", ";", "}" ]
Returns <code>true</code> if the given site matcher matches the current site.<p> @param cms the current OpenCms user context @param matcher the site matcher to match the site with @return <code>true</code> if the matcher matches the current site
[ "Returns", "<code", ">", "true<", "/", "code", ">", "if", "the", "given", "site", "matcher", "matches", "the", "current", "site", ".", "<p", ">" ]
train
https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/site/CmsSiteManagerImpl.java#L1238-L1241
geomajas/geomajas-project-client-gwt
client/src/main/java/org/geomajas/gwt/client/gfx/context/VmlGraphicsContext.java
VmlGraphicsContext.drawSymbolDefinition
public void drawSymbolDefinition(Object parent, String id, SymbolInfo symbol, ShapeStyle style, Matrix transformation) { """ Draw a type (shapetype for vml). @param parent the parent of the shapetype @param id the types's unique identifier @param symbol the symbol information @param style The default ...
java
public void drawSymbolDefinition(Object parent, String id, SymbolInfo symbol, ShapeStyle style, Matrix transformation) { if (isAttached()) { if (symbol == null) { return; } symbolDefs.put(id, new SymbolDefinition(symbol, style)); if (symbol.getImage() != null) { // When it's an image symbol, ad...
[ "public", "void", "drawSymbolDefinition", "(", "Object", "parent", ",", "String", "id", ",", "SymbolInfo", "symbol", ",", "ShapeStyle", "style", ",", "Matrix", "transformation", ")", "{", "if", "(", "isAttached", "(", ")", ")", "{", "if", "(", "symbol", "=...
Draw a type (shapetype for vml). @param parent the parent of the shapetype @param id the types's unique identifier @param symbol the symbol information @param style The default style to apply on the shape-type. Can be overridden when a shape uses this shape-type. @param transformation the transformation to apply on th...
[ "Draw", "a", "type", "(", "shapetype", "for", "vml", ")", "." ]
train
https://github.com/geomajas/geomajas-project-client-gwt/blob/1c1adc48deb192ed825265eebcc74d70bbf45670/client/src/main/java/org/geomajas/gwt/client/gfx/context/VmlGraphicsContext.java#L358-L376
kiegroup/drools
drools-core/src/main/java/org/drools/core/phreak/SegmentUtilities.java
SegmentUtilities.isTipNode
public static boolean isTipNode( LeftTupleNode node, TerminalNode removingTN ) { """ Returns whether the node is the tip of a segment. EndNodes (rtn and rian) are always the tip of a segment. node cannot be null. The result should discount any removingRule. That means it gives you the result as if the rule...
java
public static boolean isTipNode( LeftTupleNode node, TerminalNode removingTN ) { return NodeTypeEnums.isEndNode(node) || isNonTerminalTipNode( node, removingTN ); }
[ "public", "static", "boolean", "isTipNode", "(", "LeftTupleNode", "node", ",", "TerminalNode", "removingTN", ")", "{", "return", "NodeTypeEnums", ".", "isEndNode", "(", "node", ")", "||", "isNonTerminalTipNode", "(", "node", ",", "removingTN", ")", ";", "}" ]
Returns whether the node is the tip of a segment. EndNodes (rtn and rian) are always the tip of a segment. node cannot be null. The result should discount any removingRule. That means it gives you the result as if the rule had already been removed from the network.
[ "Returns", "whether", "the", "node", "is", "the", "tip", "of", "a", "segment", ".", "EndNodes", "(", "rtn", "and", "rian", ")", "are", "always", "the", "tip", "of", "a", "segment", "." ]
train
https://github.com/kiegroup/drools/blob/22b0275d6dbe93070b8090948502cf46eda543c4/drools-core/src/main/java/org/drools/core/phreak/SegmentUtilities.java#L484-L486
jeremylong/DependencyCheck
core/src/main/java/org/owasp/dependencycheck/utils/ExtractionUtil.java
ExtractionUtil.extractFiles
public static void extractFiles(File archive, File extractTo) throws ExtractionException { """ Extracts the contents of an archive into the specified directory. @param archive an archive file such as a WAR or EAR @param extractTo a directory to extract the contents to @throws ExtractionException thrown if an ...
java
public static void extractFiles(File archive, File extractTo) throws ExtractionException { extractFiles(archive, extractTo, null); }
[ "public", "static", "void", "extractFiles", "(", "File", "archive", ",", "File", "extractTo", ")", "throws", "ExtractionException", "{", "extractFiles", "(", "archive", ",", "extractTo", ",", "null", ")", ";", "}" ]
Extracts the contents of an archive into the specified directory. @param archive an archive file such as a WAR or EAR @param extractTo a directory to extract the contents to @throws ExtractionException thrown if an exception occurs while extracting the files
[ "Extracts", "the", "contents", "of", "an", "archive", "into", "the", "specified", "directory", "." ]
train
https://github.com/jeremylong/DependencyCheck/blob/6cc7690ea12e4ca1454210ceaa2e9a5523f0926c/core/src/main/java/org/owasp/dependencycheck/utils/ExtractionUtil.java#L70-L72
BorderTech/wcomponents
wcomponents-core/src/main/java/com/github/bordertech/wcomponents/SimpleBeanBoundTableModel.java
SimpleBeanBoundTableModel.getBeanPropertyValue
protected Object getBeanPropertyValue(final String property, final Object bean) { """ Get the bean property value. @param property the bean property @param bean the bean @return the bean property value """ if (bean == null) { return null; } if (".".equals(property)) { return bean; } try ...
java
protected Object getBeanPropertyValue(final String property, final Object bean) { if (bean == null) { return null; } if (".".equals(property)) { return bean; } try { Object data = PropertyUtils.getProperty(bean, property); return data; } catch (Exception e) { LOG.error("Failed to get bean p...
[ "protected", "Object", "getBeanPropertyValue", "(", "final", "String", "property", ",", "final", "Object", "bean", ")", "{", "if", "(", "bean", "==", "null", ")", "{", "return", "null", ";", "}", "if", "(", "\".\"", ".", "equals", "(", "property", ")", ...
Get the bean property value. @param property the bean property @param bean the bean @return the bean property value
[ "Get", "the", "bean", "property", "value", "." ]
train
https://github.com/BorderTech/wcomponents/blob/d1a2b2243270067db030feb36ca74255aaa94436/wcomponents-core/src/main/java/com/github/bordertech/wcomponents/SimpleBeanBoundTableModel.java#L521-L537
cqframework/clinical_quality_language
Src/java/elm/src/main/java/org/cqframework/cql/elm/visiting/ElmBaseVisitor.java
ElmBaseVisitor.visitTupleTypeSpecifier
public T visitTupleTypeSpecifier(TupleTypeSpecifier elm, C context) { """ Visit a TupleTypeSpecifier. This method will be called for every node in the tree that is a TupleTypeSpecifier. @param elm the ELM tree @param context the context passed to the visitor @return the visitor result """ for...
java
public T visitTupleTypeSpecifier(TupleTypeSpecifier elm, C context) { for (TupleElementDefinition element : elm.getElement()) { visitElement(element, context); } return null; }
[ "public", "T", "visitTupleTypeSpecifier", "(", "TupleTypeSpecifier", "elm", ",", "C", "context", ")", "{", "for", "(", "TupleElementDefinition", "element", ":", "elm", ".", "getElement", "(", ")", ")", "{", "visitElement", "(", "element", ",", "context", ")", ...
Visit a TupleTypeSpecifier. This method will be called for every node in the tree that is a TupleTypeSpecifier. @param elm the ELM tree @param context the context passed to the visitor @return the visitor result
[ "Visit", "a", "TupleTypeSpecifier", ".", "This", "method", "will", "be", "called", "for", "every", "node", "in", "the", "tree", "that", "is", "a", "TupleTypeSpecifier", "." ]
train
https://github.com/cqframework/clinical_quality_language/blob/67459d1ef453e49db8d7c5c86e87278377ed0a0b/Src/java/elm/src/main/java/org/cqframework/cql/elm/visiting/ElmBaseVisitor.java#L110-L115
codeprimate-software/cp-elements
src/main/java/org/cp/elements/lang/reflect/ProxyFactory.java
ProxyFactory.newProxyFactory
protected static <T> ProxyFactory<T> newProxyFactory() { """ Returns a reference to a {@link ProxyFactory} service provider implementation provided by Elements that delegates all proxy operations to any/all application configured {@link ProxyFactory} service provider implementations. @param <T> {@link Class} t...
java
protected static <T> ProxyFactory<T> newProxyFactory() { return new ProxyFactory<T>() { @Override public boolean canProxy(Object target, Class[] proxyInterfaces) { return ProxyService.<T>newProxyService().canProxy(target, proxyInterfaces); } @Override @SuppressWarnings("unch...
[ "protected", "static", "<", "T", ">", "ProxyFactory", "<", "T", ">", "newProxyFactory", "(", ")", "{", "return", "new", "ProxyFactory", "<", "T", ">", "(", ")", "{", "@", "Override", "public", "boolean", "canProxy", "(", "Object", "target", ",", "Class",...
Returns a reference to a {@link ProxyFactory} service provider implementation provided by Elements that delegates all proxy operations to any/all application configured {@link ProxyFactory} service provider implementations. @param <T> {@link Class} type of the {@link Object} to proxy. @return a reference to the Elemen...
[ "Returns", "a", "reference", "to", "a", "{", "@link", "ProxyFactory", "}", "service", "provider", "implementation", "provided", "by", "Elements", "that", "delegates", "all", "proxy", "operations", "to", "any", "/", "all", "application", "configured", "{", "@link...
train
https://github.com/codeprimate-software/cp-elements/blob/f2163c149fbbef05015e688132064ebcac7c49ab/src/main/java/org/cp/elements/lang/reflect/ProxyFactory.java#L57-L77
facebookarchive/hadoop-20
src/core/org/apache/hadoop/io/retry/RetryPolicies.java
RetryPolicies.retryUpToMaximumCountWithFixedSleep
public static final RetryPolicy retryUpToMaximumCountWithFixedSleep(int maxRetries, long sleepTime, TimeUnit timeUnit) { """ <p> Keep trying a limited number of times, waiting a fixed time between attempts, and then fail by re-throwing the exception. </p> """ return new RetryUpToMaximumCountWithFixedSle...
java
public static final RetryPolicy retryUpToMaximumCountWithFixedSleep(int maxRetries, long sleepTime, TimeUnit timeUnit) { return new RetryUpToMaximumCountWithFixedSleep(maxRetries, sleepTime, timeUnit); }
[ "public", "static", "final", "RetryPolicy", "retryUpToMaximumCountWithFixedSleep", "(", "int", "maxRetries", ",", "long", "sleepTime", ",", "TimeUnit", "timeUnit", ")", "{", "return", "new", "RetryUpToMaximumCountWithFixedSleep", "(", "maxRetries", ",", "sleepTime", ","...
<p> Keep trying a limited number of times, waiting a fixed time between attempts, and then fail by re-throwing the exception. </p>
[ "<p", ">", "Keep", "trying", "a", "limited", "number", "of", "times", "waiting", "a", "fixed", "time", "between", "attempts", "and", "then", "fail", "by", "re", "-", "throwing", "the", "exception", ".", "<", "/", "p", ">" ]
train
https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/core/org/apache/hadoop/io/retry/RetryPolicies.java#L65-L67
sagiegurari/fax4j
src/main/java/org/fax4j/util/DefaultProcessExecutor.java
DefaultProcessExecutor.addPart
protected StringBuilder addPart(List<String> commandList,StringBuilder buffer,int endIndex,boolean typeSpace) { """ Updates the command list and the buffer. @param commandList The command list to update @param buffer The input buffer @param endIndex The end index in the buffer @param typeSpace Tr...
java
protected StringBuilder addPart(List<String> commandList,StringBuilder buffer,int endIndex,boolean typeSpace) { int delta=1; if(typeSpace) { delta=0; } String part=buffer.substring(delta,endIndex); commandList.add(part); buffer.delete(0,en...
[ "protected", "StringBuilder", "addPart", "(", "List", "<", "String", ">", "commandList", ",", "StringBuilder", "buffer", ",", "int", "endIndex", ",", "boolean", "typeSpace", ")", "{", "int", "delta", "=", "1", ";", "if", "(", "typeSpace", ")", "{", "delta"...
Updates the command list and the buffer. @param commandList The command list to update @param buffer The input buffer @param endIndex The end index in the buffer @param typeSpace True space, false for quote @return The updated buffer
[ "Updates", "the", "command", "list", "and", "the", "buffer", "." ]
train
https://github.com/sagiegurari/fax4j/blob/42fa51acabe7bf279e27ab3dd1cf76146b27955f/src/main/java/org/fax4j/util/DefaultProcessExecutor.java#L195-L208
MariaDB/mariadb-connector-j
src/main/java/org/mariadb/jdbc/internal/protocol/AbstractQueryProtocol.java
AbstractQueryProtocol.executeBatchMulti
private void executeBatchMulti(Results results, final ClientPrepareResult clientPrepareResult, final List<ParameterHolder[]> parametersList) throws SQLException { """ Execute clientPrepareQuery batch. @param results results @param clientPrepareResult ClientPrepareResult @param parametersList...
java
private void executeBatchMulti(Results results, final ClientPrepareResult clientPrepareResult, final List<ParameterHolder[]> parametersList) throws SQLException { cmdPrologue(); initializeBatchReader(); new AbstractMultiSend(this, writer, results, clientPrepareResult, parametersList) { @Overri...
[ "private", "void", "executeBatchMulti", "(", "Results", "results", ",", "final", "ClientPrepareResult", "clientPrepareResult", ",", "final", "List", "<", "ParameterHolder", "[", "]", ">", "parametersList", ")", "throws", "SQLException", "{", "cmdPrologue", "(", ")",...
Execute clientPrepareQuery batch. @param results results @param clientPrepareResult ClientPrepareResult @param parametersList List of parameters @throws SQLException exception
[ "Execute", "clientPrepareQuery", "batch", "." ]
train
https://github.com/MariaDB/mariadb-connector-j/blob/d148c7cd347c4680617be65d9e511b289d38a30b/src/main/java/org/mariadb/jdbc/internal/protocol/AbstractQueryProtocol.java#L602-L654
DataSketches/sketches-core
src/main/java/com/yahoo/sketches/ByteArrayUtil.java
ByteArrayUtil.putFloatBE
public static void putFloatBE(final byte[] array, final int offset, final float value) { """ Put the source <i>float</i> into the destination byte array starting at the given offset in big endian order. There is no bounds checking. @param array destination byte array @param offset destination offset @param va...
java
public static void putFloatBE(final byte[] array, final int offset, final float value) { putIntBE(array, offset, Float.floatToRawIntBits(value)); }
[ "public", "static", "void", "putFloatBE", "(", "final", "byte", "[", "]", "array", ",", "final", "int", "offset", ",", "final", "float", "value", ")", "{", "putIntBE", "(", "array", ",", "offset", ",", "Float", ".", "floatToRawIntBits", "(", "value", ")"...
Put the source <i>float</i> into the destination byte array starting at the given offset in big endian order. There is no bounds checking. @param array destination byte array @param offset destination offset @param value source <i>float</i>
[ "Put", "the", "source", "<i", ">", "float<", "/", "i", ">", "into", "the", "destination", "byte", "array", "starting", "at", "the", "given", "offset", "in", "big", "endian", "order", ".", "There", "is", "no", "bounds", "checking", "." ]
train
https://github.com/DataSketches/sketches-core/blob/900c8c9668a1e2f1d54d453e956caad54702e540/src/main/java/com/yahoo/sketches/ByteArrayUtil.java#L237-L239
michel-kraemer/bson4jackson
src/main/java/de/undercouch/bson4jackson/BsonParser.java
BsonParser.regexStrToFlags
@SuppressWarnings("deprecation") protected int regexStrToFlags(String pattern) throws JsonParseException { """ Converts a BSON regex pattern string to a combined value of Java flags that can be used in {@link Pattern#compile(String, int)} @param pattern the regex pattern string @return the Java flags @throws ...
java
@SuppressWarnings("deprecation") protected int regexStrToFlags(String pattern) throws JsonParseException { int flags = 0; for (int i = 0; i < pattern.length(); ++i) { char c = pattern.charAt(i); switch (c) { case 'i': flags |= Pattern.CASE_INSENSITIVE; break; case 'm': flags |= Pattern...
[ "@", "SuppressWarnings", "(", "\"deprecation\"", ")", "protected", "int", "regexStrToFlags", "(", "String", "pattern", ")", "throws", "JsonParseException", "{", "int", "flags", "=", "0", ";", "for", "(", "int", "i", "=", "0", ";", "i", "<", "pattern", ".",...
Converts a BSON regex pattern string to a combined value of Java flags that can be used in {@link Pattern#compile(String, int)} @param pattern the regex pattern string @return the Java flags @throws JsonParseException if the pattern string contains a unsupported flag
[ "Converts", "a", "BSON", "regex", "pattern", "string", "to", "a", "combined", "value", "of", "Java", "flags", "that", "can", "be", "used", "in", "{" ]
train
https://github.com/michel-kraemer/bson4jackson/blob/32d2ab3c516b3c07490fdfcf0c5e4ed0a2ee3979/src/main/java/de/undercouch/bson4jackson/BsonParser.java#L480-L512
gallandarakhneorg/afc
advanced/attributes/src/main/java/org/arakhne/afc/attrs/collection/BufferedAttributeCollection.java
BufferedAttributeCollection.setAttributeFromRawValue
protected Attribute setAttributeFromRawValue(String name, AttributeType type, Object value) throws AttributeException { """ Set the attribute value. @param name is the name of the attribute @param type is the type of the attribute @param value is the raw value to store. @return the new created attribute @th...
java
protected Attribute setAttributeFromRawValue(String name, AttributeType type, Object value) throws AttributeException { AttributeValue oldValue = extractValueForSafe(name); if (oldValue != null) { if (oldValue.equals(value)) { return null; } // Clone the value for avoid border effects. oldValue = ne...
[ "protected", "Attribute", "setAttributeFromRawValue", "(", "String", "name", ",", "AttributeType", "type", ",", "Object", "value", ")", "throws", "AttributeException", "{", "AttributeValue", "oldValue", "=", "extractValueForSafe", "(", "name", ")", ";", "if", "(", ...
Set the attribute value. @param name is the name of the attribute @param type is the type of the attribute @param value is the raw value to store. @return the new created attribute @throws AttributeException on error.
[ "Set", "the", "attribute", "value", "." ]
train
https://github.com/gallandarakhneorg/afc/blob/0c7d2e1ddefd4167ef788416d970a6c1ef6f8bbb/advanced/attributes/src/main/java/org/arakhne/afc/attrs/collection/BufferedAttributeCollection.java#L241-L265
Erudika/para
para-server/src/main/java/com/erudika/para/security/SimpleRequestCache.java
SimpleRequestCache.saveRequest
@Override public void saveRequest(HttpServletRequest request, HttpServletResponse response) { """ Saves a request in cache. @param request HTTP request @param response HTTP response """ if (anyRequestMatcher.matches(request) && !ajaxRequestMatcher.matches(request)) { DefaultSavedRequest savedRequest = ...
java
@Override public void saveRequest(HttpServletRequest request, HttpServletResponse response) { if (anyRequestMatcher.matches(request) && !ajaxRequestMatcher.matches(request)) { DefaultSavedRequest savedRequest = new DefaultSavedRequest(request, portResolver); HttpUtils.setStateParam(Config.RETURNTO_COOKIE, ...
[ "@", "Override", "public", "void", "saveRequest", "(", "HttpServletRequest", "request", ",", "HttpServletResponse", "response", ")", "{", "if", "(", "anyRequestMatcher", ".", "matches", "(", "request", ")", "&&", "!", "ajaxRequestMatcher", ".", "matches", "(", "...
Saves a request in cache. @param request HTTP request @param response HTTP response
[ "Saves", "a", "request", "in", "cache", "." ]
train
https://github.com/Erudika/para/blob/5ba096c477042ea7b18e9a0e8b5b1ee0f5bd6ce9/para-server/src/main/java/com/erudika/para/security/SimpleRequestCache.java#L48-L55
apache/flink
flink-formats/flink-parquet/src/main/java/org/apache/flink/formats/parquet/ParquetInputFormat.java
ParquetInputFormat.getReadSchema
private MessageType getReadSchema(MessageType fileSchema, Path filePath) { """ Generates and returns the read schema based on the projected fields for a given file. @param fileSchema The schema of the given file. @param filePath The path of the given file. @return The read schema based on the given file's sch...
java
private MessageType getReadSchema(MessageType fileSchema, Path filePath) { RowTypeInfo fileTypeInfo = (RowTypeInfo) ParquetSchemaConverter.fromParquetType(fileSchema); List<Type> types = new ArrayList<>(); for (int i = 0; i < fieldNames.length; ++i) { String readFieldName = fieldNames[i]; TypeInformation<?>...
[ "private", "MessageType", "getReadSchema", "(", "MessageType", "fileSchema", ",", "Path", "filePath", ")", "{", "RowTypeInfo", "fileTypeInfo", "=", "(", "RowTypeInfo", ")", "ParquetSchemaConverter", ".", "fromParquetType", "(", "fileSchema", ")", ";", "List", "<", ...
Generates and returns the read schema based on the projected fields for a given file. @param fileSchema The schema of the given file. @param filePath The path of the given file. @return The read schema based on the given file's schema and the projected fields.
[ "Generates", "and", "returns", "the", "read", "schema", "based", "on", "the", "projected", "fields", "for", "a", "given", "file", "." ]
train
https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-formats/flink-parquet/src/main/java/org/apache/flink/formats/parquet/ParquetInputFormat.java#L248-L278
ZieIony/Carbon
carbon/src/main/java/carbon/drawable/ripple/LayerDrawable.java
LayerDrawable.refreshChildPadding
private boolean refreshChildPadding(int i, ChildDrawable r) { """ Refreshes the cached padding values for the specified child. @return true if the child's padding has changed """ if (r.mDrawable != null) { final Rect rect = mTmpRect; r.mDrawable.getPadding(rect); ...
java
private boolean refreshChildPadding(int i, ChildDrawable r) { if (r.mDrawable != null) { final Rect rect = mTmpRect; r.mDrawable.getPadding(rect); if (rect.left != mPaddingL[i] || rect.top != mPaddingT[i] || rect.right != mPaddingR[i] || rect.bottom != mPa...
[ "private", "boolean", "refreshChildPadding", "(", "int", "i", ",", "ChildDrawable", "r", ")", "{", "if", "(", "r", ".", "mDrawable", "!=", "null", ")", "{", "final", "Rect", "rect", "=", "mTmpRect", ";", "r", ".", "mDrawable", ".", "getPadding", "(", "...
Refreshes the cached padding values for the specified child. @return true if the child's padding has changed
[ "Refreshes", "the", "cached", "padding", "values", "for", "the", "specified", "child", "." ]
train
https://github.com/ZieIony/Carbon/blob/78b0a432bd49edc7a6a13ce111cab274085d1693/carbon/src/main/java/carbon/drawable/ripple/LayerDrawable.java#L1551-L1565
optimatika/ojAlgo-finance
src/main/java/org/ojalgo/finance/portfolio/FinancePortfolio.java
FinancePortfolio.getValueAtRisk
public final double getValueAtRisk(final Number confidenceLevel, final Number timePeriod) { """ Value at Risk (VaR) is the maximum loss not exceeded with a given probability defined as the confidence level, over a given period of time. """ final double aReturn = this.getMeanReturn(); final do...
java
public final double getValueAtRisk(final Number confidenceLevel, final Number timePeriod) { final double aReturn = this.getMeanReturn(); final double aStdDev = this.getVolatility(); final double tmpConfidenceScale = SQRT_TWO * RandomUtils.erfi(ONE - (TWO * (ONE - confidenceLevel.doubleValue())...
[ "public", "final", "double", "getValueAtRisk", "(", "final", "Number", "confidenceLevel", ",", "final", "Number", "timePeriod", ")", "{", "final", "double", "aReturn", "=", "this", ".", "getMeanReturn", "(", ")", ";", "final", "double", "aStdDev", "=", "this",...
Value at Risk (VaR) is the maximum loss not exceeded with a given probability defined as the confidence level, over a given period of time.
[ "Value", "at", "Risk", "(", "VaR", ")", "is", "the", "maximum", "loss", "not", "exceeded", "with", "a", "given", "probability", "defined", "as", "the", "confidence", "level", "over", "a", "given", "period", "of", "time", "." ]
train
https://github.com/optimatika/ojAlgo-finance/blob/c8d3f7e1894d4263b7334bca3f4c060e466f8b15/src/main/java/org/ojalgo/finance/portfolio/FinancePortfolio.java#L139-L148
apache/groovy
src/main/java/org/apache/groovy/ast/tools/VisibilityUtils.java
VisibilityUtils.getVisibility
public static int getVisibility(AnnotationNode anno, AnnotatedNode node, Class<? extends AnnotatedNode> clazz, int originalModifiers) { """ Determine the correct modifiers by looking for a potential @VisibilityOptions annotation. @param anno The annotation being processed (if any) which may support a 'visibilit...
java
public static int getVisibility(AnnotationNode anno, AnnotatedNode node, Class<? extends AnnotatedNode> clazz, int originalModifiers) { List<AnnotationNode> annotations = node.getAnnotations(VISIBILITY_OPTIONS_TYPE); if (annotations.isEmpty() || anno == null) return originalModifiers; String vi...
[ "public", "static", "int", "getVisibility", "(", "AnnotationNode", "anno", ",", "AnnotatedNode", "node", ",", "Class", "<", "?", "extends", "AnnotatedNode", ">", "clazz", ",", "int", "originalModifiers", ")", "{", "List", "<", "AnnotationNode", ">", "annotations...
Determine the correct modifiers by looking for a potential @VisibilityOptions annotation. @param anno The annotation being processed (if any) which may support a 'visibilityId' attribute @param node The node being processed which may also be annotated with @VisibilityOptions @param clazz The type of node being constru...
[ "Determine", "the", "correct", "modifiers", "by", "looking", "for", "a", "potential", "@VisibilityOptions", "annotation", "." ]
train
https://github.com/apache/groovy/blob/71cf20addb611bb8d097a59e395fd20bc7f31772/src/main/java/org/apache/groovy/ast/tools/VisibilityUtils.java#L56-L75
apache/groovy
src/main/java/org/codehaus/groovy/runtime/IOGroovyMethods.java
IOGroovyMethods.eachByte
public static void eachByte(InputStream is, @ClosureParams(value=SimpleType.class, options="byte") Closure closure) throws IOException { """ Traverse through each byte of the specified stream. The stream is closed after the closure returns. @param is stream to iterate over, closed after the method call @...
java
public static void eachByte(InputStream is, @ClosureParams(value=SimpleType.class, options="byte") Closure closure) throws IOException { try { while (true) { int b = is.read(); if (b == -1) { break; } else { clos...
[ "public", "static", "void", "eachByte", "(", "InputStream", "is", ",", "@", "ClosureParams", "(", "value", "=", "SimpleType", ".", "class", ",", "options", "=", "\"byte\"", ")", "Closure", "closure", ")", "throws", "IOException", "{", "try", "{", "while", ...
Traverse through each byte of the specified stream. The stream is closed after the closure returns. @param is stream to iterate over, closed after the method call @param closure closure to apply to each byte @throws IOException if an IOException occurs. @since 1.0
[ "Traverse", "through", "each", "byte", "of", "the", "specified", "stream", ".", "The", "stream", "is", "closed", "after", "the", "closure", "returns", "." ]
train
https://github.com/apache/groovy/blob/71cf20addb611bb8d097a59e395fd20bc7f31772/src/main/java/org/codehaus/groovy/runtime/IOGroovyMethods.java#L1319-L1336
JDBDT/jdbdt
src/main/java/org/jdbdt/DB.java
DB.logSetup
void logSetup(CallInfo callInfo, String sql) { """ Log database setup command. @param callInfo Call info. @param sql SQL code. """ if (isEnabled(Option.LOG_SETUP)) { log.writeSQL(callInfo, sql); } }
java
void logSetup(CallInfo callInfo, String sql) { if (isEnabled(Option.LOG_SETUP)) { log.writeSQL(callInfo, sql); } }
[ "void", "logSetup", "(", "CallInfo", "callInfo", ",", "String", "sql", ")", "{", "if", "(", "isEnabled", "(", "Option", ".", "LOG_SETUP", ")", ")", "{", "log", ".", "writeSQL", "(", "callInfo", ",", "sql", ")", ";", "}", "}" ]
Log database setup command. @param callInfo Call info. @param sql SQL code.
[ "Log", "database", "setup", "command", "." ]
train
https://github.com/JDBDT/jdbdt/blob/7e32845ad41dfbc5d6fd0fd561e3613697186df4/src/main/java/org/jdbdt/DB.java#L540-L544
mfornos/humanize
humanize-icu/src/main/java/humanize/ICUHumanize.java
ICUHumanize.messageFormatInstance
public static MessageFormat messageFormatInstance(final String pattern, final Locale locale) { """ <p> Same as {@link #messageFormatInstance(String) messageFormatInstance} for the specified locale. </p> @param locale Target locale @param pattern Format pattern that follows the conventions of {@link com.i...
java
public static MessageFormat messageFormatInstance(final String pattern, final Locale locale) { return withinLocale(new Callable<MessageFormat>() { public MessageFormat call() throws Exception { return messageFormatInstance(pattern); } }, lo...
[ "public", "static", "MessageFormat", "messageFormatInstance", "(", "final", "String", "pattern", ",", "final", "Locale", "locale", ")", "{", "return", "withinLocale", "(", "new", "Callable", "<", "MessageFormat", ">", "(", ")", "{", "public", "MessageFormat", "c...
<p> Same as {@link #messageFormatInstance(String) messageFormatInstance} for the specified locale. </p> @param locale Target locale @param pattern Format pattern that follows the conventions of {@link com.ibm.icu.text.MessageFormat MessageFormat} @return a MessageFormat instance for the current thread
[ "<p", ">", "Same", "as", "{", "@link", "#messageFormatInstance", "(", "String", ")", "messageFormatInstance", "}", "for", "the", "specified", "locale", ".", "<", "/", "p", ">" ]
train
https://github.com/mfornos/humanize/blob/59fc103045de9d217c9e77dbcb7621f992f46c63/humanize-icu/src/main/java/humanize/ICUHumanize.java#L1232-L1241
Azure/azure-sdk-for-java
network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/ExpressRouteCrossConnectionPeeringsInner.java
ExpressRouteCrossConnectionPeeringsInner.beginDelete
public void beginDelete(String resourceGroupName, String crossConnectionName, String peeringName) { """ Deletes the specified peering from the ExpressRouteCrossConnection. @param resourceGroupName The name of the resource group. @param crossConnectionName The name of the ExpressRouteCrossConnection. @param pe...
java
public void beginDelete(String resourceGroupName, String crossConnectionName, String peeringName) { beginDeleteWithServiceResponseAsync(resourceGroupName, crossConnectionName, peeringName).toBlocking().single().body(); }
[ "public", "void", "beginDelete", "(", "String", "resourceGroupName", ",", "String", "crossConnectionName", ",", "String", "peeringName", ")", "{", "beginDeleteWithServiceResponseAsync", "(", "resourceGroupName", ",", "crossConnectionName", ",", "peeringName", ")", ".", ...
Deletes the specified peering from the ExpressRouteCrossConnection. @param resourceGroupName The name of the resource group. @param crossConnectionName The name of the ExpressRouteCrossConnection. @param peeringName The name of the peering. @throws IllegalArgumentException thrown if parameters fail the validation @thr...
[ "Deletes", "the", "specified", "peering", "from", "the", "ExpressRouteCrossConnection", "." ]
train
https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/ExpressRouteCrossConnectionPeeringsInner.java#L298-L300
liferay/com-liferay-commerce
commerce-notification-api/src/main/java/com/liferay/commerce/notification/model/CommerceNotificationTemplateWrapper.java
CommerceNotificationTemplateWrapper.getBody
@Override public String getBody(String languageId, boolean useDefault) { """ Returns the localized body of this commerce notification template in the language, optionally using the default language if no localization exists for the requested language. @param languageId the ID of the language @param useDefault...
java
@Override public String getBody(String languageId, boolean useDefault) { return _commerceNotificationTemplate.getBody(languageId, useDefault); }
[ "@", "Override", "public", "String", "getBody", "(", "String", "languageId", ",", "boolean", "useDefault", ")", "{", "return", "_commerceNotificationTemplate", ".", "getBody", "(", "languageId", ",", "useDefault", ")", ";", "}" ]
Returns the localized body of this commerce notification template in the language, optionally using the default language if no localization exists for the requested language. @param languageId the ID of the language @param useDefault whether to use the default language if no localization exists for the requested langu...
[ "Returns", "the", "localized", "body", "of", "this", "commerce", "notification", "template", "in", "the", "language", "optionally", "using", "the", "default", "language", "if", "no", "localization", "exists", "for", "the", "requested", "language", "." ]
train
https://github.com/liferay/com-liferay-commerce/blob/9e54362d7f59531fc684016ba49ee7cdc3a2f22b/commerce-notification-api/src/main/java/com/liferay/commerce/notification/model/CommerceNotificationTemplateWrapper.java#L277-L280
lessthanoptimal/BoofCV
main/boofcv-ip/src/main/java/boofcv/factory/filter/kernel/FactoryKernelGaussian.java
FactoryKernelGaussian.gaussian1D_F32
protected static Kernel1D_F32 gaussian1D_F32(double sigma, int radius, boolean odd, boolean normalize) { """ <p> Creates a floating point Gaussian kernel with the sigma and radius. If normalized is set to true then the elements in the kernel will sum up to one. </p> @param sigma Distributions standard devi...
java
protected static Kernel1D_F32 gaussian1D_F32(double sigma, int radius, boolean odd, boolean normalize) { Kernel1D_F32 ret; if( odd ) { ret = new Kernel1D_F32(radius * 2 + 1); int index = 0; for (int i = radius; i >= -radius; i--) { ret.data[index++] = (float) UtilGaussian.computePDF(0, sigma, i); } ...
[ "protected", "static", "Kernel1D_F32", "gaussian1D_F32", "(", "double", "sigma", ",", "int", "radius", ",", "boolean", "odd", ",", "boolean", "normalize", ")", "{", "Kernel1D_F32", "ret", ";", "if", "(", "odd", ")", "{", "ret", "=", "new", "Kernel1D_F32", ...
<p> Creates a floating point Gaussian kernel with the sigma and radius. If normalized is set to true then the elements in the kernel will sum up to one. </p> @param sigma Distributions standard deviation. @param radius Kernel's radius. @param odd Does the kernel have an even or add width @param normalize If the ...
[ "<p", ">", "Creates", "a", "floating", "point", "Gaussian", "kernel", "with", "the", "sigma", "and", "radius", ".", "If", "normalized", "is", "set", "to", "true", "then", "the", "elements", "in", "the", "kernel", "will", "sum", "up", "to", "one", ".", ...
train
https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-ip/src/main/java/boofcv/factory/filter/kernel/FactoryKernelGaussian.java#L218-L238
Azure/azure-sdk-for-java
edgegateway/resource-manager/v2019_03_01/src/main/java/com/microsoft/azure/management/edgegateway/v2019_03_01/implementation/DevicesInner.java
DevicesInner.getNetworkSettingsAsync
public Observable<NetworkSettingsInner> getNetworkSettingsAsync(String deviceName, String resourceGroupName) { """ Gets the network settings of the specified data box edge/gateway device. @param deviceName The device name. @param resourceGroupName The resource group name. @throws IllegalArgumentException thro...
java
public Observable<NetworkSettingsInner> getNetworkSettingsAsync(String deviceName, String resourceGroupName) { return getNetworkSettingsWithServiceResponseAsync(deviceName, resourceGroupName).map(new Func1<ServiceResponse<NetworkSettingsInner>, NetworkSettingsInner>() { @Override public ...
[ "public", "Observable", "<", "NetworkSettingsInner", ">", "getNetworkSettingsAsync", "(", "String", "deviceName", ",", "String", "resourceGroupName", ")", "{", "return", "getNetworkSettingsWithServiceResponseAsync", "(", "deviceName", ",", "resourceGroupName", ")", ".", "...
Gets the network settings of the specified data box edge/gateway device. @param deviceName The device name. @param resourceGroupName The resource group name. @throws IllegalArgumentException thrown if parameters fail the validation @return the observable to the NetworkSettingsInner object
[ "Gets", "the", "network", "settings", "of", "the", "specified", "data", "box", "edge", "/", "gateway", "device", "." ]
train
https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/edgegateway/resource-manager/v2019_03_01/src/main/java/com/microsoft/azure/management/edgegateway/v2019_03_01/implementation/DevicesInner.java#L1622-L1629
gmessner/gitlab4j-api
src/main/java/org/gitlab4j/api/RunnersApi.java
RunnersApi.disableRunner
public Runner disableRunner(Object projectIdOrPath, Integer runnerId) throws GitLabApiException { """ Disable a specific runner from the project. It works only if the project isn't the only project associated with the specified runner. If so, an error is returned. Use the {@link #removeRunner(Integer)} instead. ...
java
public Runner disableRunner(Object projectIdOrPath, Integer runnerId) throws GitLabApiException { Response response = delete(Response.Status.OK, null, "projects", getProjectIdOrPath(projectIdOrPath), "runners", runnerId); return (response.readEntity(Runner.class)); }
[ "public", "Runner", "disableRunner", "(", "Object", "projectIdOrPath", ",", "Integer", "runnerId", ")", "throws", "GitLabApiException", "{", "Response", "response", "=", "delete", "(", "Response", ".", "Status", ".", "OK", ",", "null", ",", "\"projects\"", ",", ...
Disable a specific runner from the project. It works only if the project isn't the only project associated with the specified runner. If so, an error is returned. Use the {@link #removeRunner(Integer)} instead. <pre><code>GitLab Endpoint: DELETE /projects/:id/runners/:runner_id</code></pre> @param projectIdOrPath the...
[ "Disable", "a", "specific", "runner", "from", "the", "project", ".", "It", "works", "only", "if", "the", "project", "isn", "t", "the", "only", "project", "associated", "with", "the", "specified", "runner", ".", "If", "so", "an", "error", "is", "returned", ...
train
https://github.com/gmessner/gitlab4j-api/blob/ab045070abac0a8f4ccbf17b5ed9bfdef5723eed/src/main/java/org/gitlab4j/api/RunnersApi.java#L477-L481
mebigfatguy/fb-contrib
src/main/java/com/mebigfatguy/fbcontrib/detect/WiringIssues.java
WiringIssues.loadParentAutowireds
@edu.umd.cs.findbugs.annotations.SuppressFBWarnings(value = "SF_SWITCH_NO_DEFAULT", justification = "Only a few cases need special handling") private void loadParentAutowireds(JavaClass cls, Map<WiringType, FieldAnnotation> wiredFields) throws ClassNotFoundException { """ loads all the types that are injected ...
java
@edu.umd.cs.findbugs.annotations.SuppressFBWarnings(value = "SF_SWITCH_NO_DEFAULT", justification = "Only a few cases need special handling") private void loadParentAutowireds(JavaClass cls, Map<WiringType, FieldAnnotation> wiredFields) throws ClassNotFoundException { if (Values.DOTTED_JAVA_LANG_OBJECT.equ...
[ "@", "edu", ".", "umd", ".", "cs", ".", "findbugs", ".", "annotations", ".", "SuppressFBWarnings", "(", "value", "=", "\"SF_SWITCH_NO_DEFAULT\"", ",", "justification", "=", "\"Only a few cases need special handling\"", ")", "private", "void", "loadParentAutowireds", "...
loads all the types that are injected by @Autowired annotations in super classes @param cls the class who's parents you want to load @param wiredFields the collected map of autowired types @throws ClassNotFoundException if a parent class can't be loaded
[ "loads", "all", "the", "types", "that", "are", "injected", "by", "@Autowired", "annotations", "in", "super", "classes" ]
train
https://github.com/mebigfatguy/fb-contrib/blob/3b5203196f627b399fbcea3c2ab2b1f4e56cc7b8/src/main/java/com/mebigfatguy/fbcontrib/detect/WiringIssues.java#L170-L204
fhoeben/hsac-fitnesse-fixtures
src/main/java/nl/hsac/fitnesse/fixture/slim/StringFixture.java
StringFixture.textContains
public boolean textContains(String value, String expectedSubstring) { """ Checks whether values contains a specific sub string. @param value value to find substring in. @param expectedSubstring text that is expected to occur in value. @return true if value contained the expected substring. """ boole...
java
public boolean textContains(String value, String expectedSubstring) { boolean result = false; if (value != null) { result = value.contains(expectedSubstring); } return result; }
[ "public", "boolean", "textContains", "(", "String", "value", ",", "String", "expectedSubstring", ")", "{", "boolean", "result", "=", "false", ";", "if", "(", "value", "!=", "null", ")", "{", "result", "=", "value", ".", "contains", "(", "expectedSubstring", ...
Checks whether values contains a specific sub string. @param value value to find substring in. @param expectedSubstring text that is expected to occur in value. @return true if value contained the expected substring.
[ "Checks", "whether", "values", "contains", "a", "specific", "sub", "string", "." ]
train
https://github.com/fhoeben/hsac-fitnesse-fixtures/blob/4e9018d7386a9aa65bfcbf07eb28ae064edd1732/src/main/java/nl/hsac/fitnesse/fixture/slim/StringFixture.java#L72-L78
sagiegurari/fax4j
src/main/java/org/fax4j/spi/process/ExitCodeProcessOutputValidator.java
ExitCodeProcessOutputValidator.validateProcessOutput
public void validateProcessOutput(FaxClientSpi faxClientSpi,ProcessOutput processOutput,FaxActionType faxActionType) { """ This function validates the process output for errors.<br> If not valid, an exception should be thrown. @param faxClientSpi The fax client SPI @param processOutput The process outpu...
java
public void validateProcessOutput(FaxClientSpi faxClientSpi,ProcessOutput processOutput,FaxActionType faxActionType) { //validate exit code int exitCode=processOutput.getExitCode(); if(exitCode!=0) { throw new FaxException("Error while invoking fax action process, exit co...
[ "public", "void", "validateProcessOutput", "(", "FaxClientSpi", "faxClientSpi", ",", "ProcessOutput", "processOutput", ",", "FaxActionType", "faxActionType", ")", "{", "//validate exit code", "int", "exitCode", "=", "processOutput", ".", "getExitCode", "(", ")", ";", ...
This function validates the process output for errors.<br> If not valid, an exception should be thrown. @param faxClientSpi The fax client SPI @param processOutput The process output to validate @param faxActionType The fax action type
[ "This", "function", "validates", "the", "process", "output", "for", "errors", ".", "<br", ">", "If", "not", "valid", "an", "exception", "should", "be", "thrown", "." ]
train
https://github.com/sagiegurari/fax4j/blob/42fa51acabe7bf279e27ab3dd1cf76146b27955f/src/main/java/org/fax4j/spi/process/ExitCodeProcessOutputValidator.java#L36-L44
jdereg/java-util
src/main/java/com/cedarsoftware/util/UrlUtilities.java
UrlUtilities.getContentFromUrlAsString
@Deprecated public static String getContentFromUrlAsString(String url, Proxy proxy) { """ Get content from the passed in URL. This code will open a connection to the passed in server, fetch the requested content, and return it as a byte[]. Anyone using the proxy calls such as this one should have that ma...
java
@Deprecated public static String getContentFromUrlAsString(String url, Proxy proxy) { byte[] bytes = getContentFromUrl(url, proxy); return bytes == null ? null : StringUtilities.createString(bytes, "UTF-8"); }
[ "@", "Deprecated", "public", "static", "String", "getContentFromUrlAsString", "(", "String", "url", ",", "Proxy", "proxy", ")", "{", "byte", "[", "]", "bytes", "=", "getContentFromUrl", "(", "url", ",", "proxy", ")", ";", "return", "bytes", "==", "null", "...
Get content from the passed in URL. This code will open a connection to the passed in server, fetch the requested content, and return it as a byte[]. Anyone using the proxy calls such as this one should have that managed by the jvm with -D parameters: http.proxyHost http.proxyPort (default: 80) http.nonProxyHosts (sh...
[ "Get", "content", "from", "the", "passed", "in", "URL", ".", "This", "code", "will", "open", "a", "connection", "to", "the", "passed", "in", "server", "fetch", "the", "requested", "content", "and", "return", "it", "as", "a", "byte", "[]", "." ]
train
https://github.com/jdereg/java-util/blob/a2dce61aed16d6454ee575174dda1ba6bff0015c/src/main/java/com/cedarsoftware/util/UrlUtilities.java#L832-L837
OpenLiberty/open-liberty
dev/com.ibm.ws.messaging.runtime/src/com/ibm/ws/sib/processor/impl/DestinationManager.java
DestinationManager.getTopicSpaceMapping
public String getTopicSpaceMapping(String busName, SIBUuid12 topicSpace) { """ Returns the topicSpaceName of the foreign topicSpace @param String The busname of the foreign TS @param SIBUuid12 The uuid of the TS on this bus @return String The foreign TS name """ if (TraceComponent.isAnyTracingEnab...
java
public String getTopicSpaceMapping(String busName, SIBUuid12 topicSpace) { if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.entry(tc, "getTopicSpaceMapping", new Object[] { busName, topicSpace }); VirtualLinkDefinition linkDef = getLinkDefinition(busName); ...
[ "public", "String", "getTopicSpaceMapping", "(", "String", "busName", ",", "SIBUuid12", "topicSpace", ")", "{", "if", "(", "TraceComponent", ".", "isAnyTracingEnabled", "(", ")", "&&", "tc", ".", "isEntryEnabled", "(", ")", ")", "SibTr", ".", "entry", "(", "...
Returns the topicSpaceName of the foreign topicSpace @param String The busname of the foreign TS @param SIBUuid12 The uuid of the TS on this bus @return String The foreign TS name
[ "Returns", "the", "topicSpaceName", "of", "the", "foreign", "topicSpace" ]
train
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.messaging.runtime/src/com/ibm/ws/sib/processor/impl/DestinationManager.java#L1854-L1873
UrielCh/ovh-java-sdk
ovh-java-sdk-cloud/src/main/java/net/minidev/ovh/api/ApiOvhCloud.java
ApiOvhCloud.project_serviceName_network_private_networkId_GET
public OvhNetwork project_serviceName_network_private_networkId_GET(String serviceName, String networkId) throws IOException { """ Get private network REST: GET /cloud/project/{serviceName}/network/private/{networkId} @param networkId [required] Network id @param serviceName [required] Service name """ ...
java
public OvhNetwork project_serviceName_network_private_networkId_GET(String serviceName, String networkId) throws IOException { String qPath = "/cloud/project/{serviceName}/network/private/{networkId}"; StringBuilder sb = path(qPath, serviceName, networkId); String resp = exec(qPath, "GET", sb.toString(), null); ...
[ "public", "OvhNetwork", "project_serviceName_network_private_networkId_GET", "(", "String", "serviceName", ",", "String", "networkId", ")", "throws", "IOException", "{", "String", "qPath", "=", "\"/cloud/project/{serviceName}/network/private/{networkId}\"", ";", "StringBuilder", ...
Get private network REST: GET /cloud/project/{serviceName}/network/private/{networkId} @param networkId [required] Network id @param serviceName [required] Service name
[ "Get", "private", "network" ]
train
https://github.com/UrielCh/ovh-java-sdk/blob/6d531a40e56e09701943e334c25f90f640c55701/ovh-java-sdk-cloud/src/main/java/net/minidev/ovh/api/ApiOvhCloud.java#L781-L786
leancloud/java-sdk-all
android-sdk/huawei-hmsagent/src/main/java/com/huawei/android/hms/agent/sns/GetUiIntentApi.java
GetUiIntentApi.getUiIntent
public void getUiIntent(int type, long param, GetUiIntentHandler handler) { """ 获取拉起社交界面的intent @param type 指定打开哪个界面,取值参考{@link com.huawei.hms.support.api.entity.sns.Constants.UiIntentType} @param param 附加的参数 <br> 当{@code type}为 {@link com.huawei.hms.support.api.entity.sns.Constants.UiIntentType#UI_MSG}, {@lin...
java
public void getUiIntent(int type, long param, GetUiIntentHandler handler){ HMSAgentLog.i("getUiIntent:type=" + type + " param=" + param + " handler=" + StrUtils.objDesc(handler)); this.type = type; this.param = param; this.handler = handler; retryTimes = MAX_RETRY_TIMES; ...
[ "public", "void", "getUiIntent", "(", "int", "type", ",", "long", "param", ",", "GetUiIntentHandler", "handler", ")", "{", "HMSAgentLog", ".", "i", "(", "\"getUiIntent:type=\"", "+", "type", "+", "\" param=\"", "+", "param", "+", "\" handler=\"", "+", "StrUt...
获取拉起社交界面的intent @param type 指定打开哪个界面,取值参考{@link com.huawei.hms.support.api.entity.sns.Constants.UiIntentType} @param param 附加的参数 <br> 当{@code type}为 {@link com.huawei.hms.support.api.entity.sns.Constants.UiIntentType#UI_MSG}, {@link com.huawei.hms.support.api.entity.sns.Constants.UiIntentType#UI_FRIEND}, {@link com.hua...
[ "获取拉起社交界面的intent" ]
train
https://github.com/leancloud/java-sdk-all/blob/323f8e7ee38051b1350790e5192304768c5c9f5f/android-sdk/huawei-hmsagent/src/main/java/com/huawei/android/hms/agent/sns/GetUiIntentApi.java#L127-L134
dnsjava/dnsjava
org/xbill/DNS/TSIG.java
TSIG.apply
public void apply(Message m, int error, TSIGRecord old) { """ Generates a TSIG record with a specific error for a message and adds it to the message. @param m The message @param error The error @param old If this message is a response, the TSIG from the request """ Record r = generate(m, m.toWire(), error...
java
public void apply(Message m, int error, TSIGRecord old) { Record r = generate(m, m.toWire(), error, old); m.addRecord(r, Section.ADDITIONAL); m.tsigState = Message.TSIG_SIGNED; }
[ "public", "void", "apply", "(", "Message", "m", ",", "int", "error", ",", "TSIGRecord", "old", ")", "{", "Record", "r", "=", "generate", "(", "m", ",", "m", ".", "toWire", "(", ")", ",", "error", ",", "old", ")", ";", "m", ".", "addRecord", "(", ...
Generates a TSIG record with a specific error for a message and adds it to the message. @param m The message @param error The error @param old If this message is a response, the TSIG from the request
[ "Generates", "a", "TSIG", "record", "with", "a", "specific", "error", "for", "a", "message", "and", "adds", "it", "to", "the", "message", "." ]
train
https://github.com/dnsjava/dnsjava/blob/d97b6a0685d59143372bb392ab591dd8dd840b61/org/xbill/DNS/TSIG.java#L350-L355
Alluxio/alluxio
core/server/worker/src/main/java/alluxio/worker/block/BlockLockManager.java
BlockLockManager.lockBlock
public long lockBlock(long sessionId, long blockId, BlockLockType blockLockType) { """ Locks a block. Note that even if this block does not exist, a lock id is still returned. If all {@link PropertyKey#WORKER_TIERED_STORE_BLOCK_LOCKS} are already in use and no lock has been allocated for the specified block, t...
java
public long lockBlock(long sessionId, long blockId, BlockLockType blockLockType) { ClientRWLock blockLock = getBlockLock(blockId); Lock lock; if (blockLockType == BlockLockType.READ) { lock = blockLock.readLock(); } else { // Make sure the session isn't already holding the block lock. ...
[ "public", "long", "lockBlock", "(", "long", "sessionId", ",", "long", "blockId", ",", "BlockLockType", "blockLockType", ")", "{", "ClientRWLock", "blockLock", "=", "getBlockLock", "(", "blockId", ")", ";", "Lock", "lock", ";", "if", "(", "blockLockType", "==",...
Locks a block. Note that even if this block does not exist, a lock id is still returned. If all {@link PropertyKey#WORKER_TIERED_STORE_BLOCK_LOCKS} are already in use and no lock has been allocated for the specified block, this method will need to wait until a lock can be acquired from the lock pool. @param sessionId...
[ "Locks", "a", "block", ".", "Note", "that", "even", "if", "this", "block", "does", "not", "exist", "a", "lock", "id", "is", "still", "returned", "." ]
train
https://github.com/Alluxio/alluxio/blob/af38cf3ab44613355b18217a3a4d961f8fec3a10/core/server/worker/src/main/java/alluxio/worker/block/BlockLockManager.java#L100-L132
knightliao/apollo
src/main/java/com/github/knightliao/apollo/utils/time/DateUtils.java
DateUtils.formatDate
public static String formatDate(java.util.Date pDate, String format) { """ 按照给定格式返回代表日期的字符串 @param pDate Date @param format String 日期格式 @return String 代表日期的字符串 """ if (pDate == null) { pDate = new java.util.Date(); } SimpleDateFormat sdf = new SimpleDateFormat(forma...
java
public static String formatDate(java.util.Date pDate, String format) { if (pDate == null) { pDate = new java.util.Date(); } SimpleDateFormat sdf = new SimpleDateFormat(format); return sdf.format(pDate); }
[ "public", "static", "String", "formatDate", "(", "java", ".", "util", ".", "Date", "pDate", ",", "String", "format", ")", "{", "if", "(", "pDate", "==", "null", ")", "{", "pDate", "=", "new", "java", ".", "util", ".", "Date", "(", ")", ";", "}", ...
按照给定格式返回代表日期的字符串 @param pDate Date @param format String 日期格式 @return String 代表日期的字符串
[ "按照给定格式返回代表日期的字符串" ]
train
https://github.com/knightliao/apollo/blob/d7a283659fa3e67af6375db8969b2d065a8ce6eb/src/main/java/com/github/knightliao/apollo/utils/time/DateUtils.java#L61-L68
antopen/alipay-sdk-java
src/main/java/com/alipay/api/internal/util/AlipayUtils.java
AlipayUtils.parseResponse
public static <T extends AlipayResponse> T parseResponse(String json, Class<T> clazz) throws AlipayApiException { """ 把JSON字符串解释为对象结构。 @param <T> API响应类型 @param json JSON字符串 @param clazz API响应类 @return API响应对象 """ ...
java
public static <T extends AlipayResponse> T parseResponse(String json, Class<T> clazz) throws AlipayApiException { ObjectJsonParser<T> parser = new ObjectJsonParser<T>(clazz); return parser.parse(json); }
[ "public", "static", "<", "T", "extends", "AlipayResponse", ">", "T", "parseResponse", "(", "String", "json", ",", "Class", "<", "T", ">", "clazz", ")", "throws", "AlipayApiException", "{", "ObjectJsonParser", "<", "T", ">", "parser", "=", "new", "ObjectJsonP...
把JSON字符串解释为对象结构。 @param <T> API响应类型 @param json JSON字符串 @param clazz API响应类 @return API响应对象
[ "把JSON字符串解释为对象结构。" ]
train
https://github.com/antopen/alipay-sdk-java/blob/e82aeac7d0239330ee173c7e393596e51e41c1cd/src/main/java/com/alipay/api/internal/util/AlipayUtils.java#L127-L131
codeprimate-software/cp-elements
src/main/java/org/cp/elements/util/ArrayUtils.java
ArrayUtils.getFirst
public static <T> T getFirst(T[] array, T defaultValue) { """ Returns the first element (at index 0) in the {@code array}. @param <T> {@link Class} type of elements in the array. @param array array from which to extract the first element. @param defaultValue default value to return if the given array is {@lit...
java
public static <T> T getFirst(T[] array, T defaultValue) { return getElementAt(array, 0, defaultValue); }
[ "public", "static", "<", "T", ">", "T", "getFirst", "(", "T", "[", "]", "array", ",", "T", "defaultValue", ")", "{", "return", "getElementAt", "(", "array", ",", "0", ",", "defaultValue", ")", ";", "}" ]
Returns the first element (at index 0) in the {@code array}. @param <T> {@link Class} type of elements in the array. @param array array from which to extract the first element. @param defaultValue default value to return if the given array is {@literal null} or empty. @return the first element in the array or return t...
[ "Returns", "the", "first", "element", "(", "at", "index", "0", ")", "in", "the", "{", "@code", "array", "}", "." ]
train
https://github.com/codeprimate-software/cp-elements/blob/f2163c149fbbef05015e688132064ebcac7c49ab/src/main/java/org/cp/elements/util/ArrayUtils.java#L469-L471
io7m/jaffirm
com.io7m.jaffirm.core/src/main/java/com/io7m/jaffirm/core/Postconditions.java
Postconditions.checkPostconditions
@SafeVarargs public static <T> T checkPostconditions( final T value, final ContractConditionType<T>... conditions) throws PostconditionViolationException { """ <p>Evaluate all of the given {@code conditions} using {@code value} as input.</p> <p>All of the conditions are evaluated and the function...
java
@SafeVarargs public static <T> T checkPostconditions( final T value, final ContractConditionType<T>... conditions) throws PostconditionViolationException { final Violations violations = innerCheckAll(value, conditions); if (violations != null) { throw failed(null, value, violations); }...
[ "@", "SafeVarargs", "public", "static", "<", "T", ">", "T", "checkPostconditions", "(", "final", "T", "value", ",", "final", "ContractConditionType", "<", "T", ">", "...", "conditions", ")", "throws", "PostconditionViolationException", "{", "final", "Violations", ...
<p>Evaluate all of the given {@code conditions} using {@code value} as input.</p> <p>All of the conditions are evaluated and the function throws {@link PostconditionViolationException} if any of the conditions are false, or raise an exception that is not of type {@link Error}. Exceptions of type {@link Error} are prop...
[ "<p", ">", "Evaluate", "all", "of", "the", "given", "{", "@code", "conditions", "}", "using", "{", "@code", "value", "}", "as", "input", ".", "<", "/", "p", ">" ]
train
https://github.com/io7m/jaffirm/blob/c97d246242d381e48832838737418cfe4cb57b4d/com.io7m.jaffirm.core/src/main/java/com/io7m/jaffirm/core/Postconditions.java#L73-L84
xcesco/kripton
kripton-processor/src/main/java/com/abubusoft/kripton/processor/sqlite/ModifyRawHelper.java
ModifyRawHelper.isIn
static boolean isIn(TypeName value, Class<?>... classes) { """ Checks if is in. @param value the value @param classes the classes @return true, if is in """ for (Class<?> item : classes) { if (value.toString().equals(TypeName.get(item).toString())) { return true; } } return false; }
java
static boolean isIn(TypeName value, Class<?>... classes) { for (Class<?> item : classes) { if (value.toString().equals(TypeName.get(item).toString())) { return true; } } return false; }
[ "static", "boolean", "isIn", "(", "TypeName", "value", ",", "Class", "<", "?", ">", "...", "classes", ")", "{", "for", "(", "Class", "<", "?", ">", "item", ":", "classes", ")", "{", "if", "(", "value", ".", "toString", "(", ")", ".", "equals", "(...
Checks if is in. @param value the value @param classes the classes @return true, if is in
[ "Checks", "if", "is", "in", "." ]
train
https://github.com/xcesco/kripton/blob/90de2c0523d39b99e81b8d38aa996898762f594a/kripton-processor/src/main/java/com/abubusoft/kripton/processor/sqlite/ModifyRawHelper.java#L631-L639
joniles/mpxj
src/main/java/net/sf/mpxj/mspdi/DatatypeConverter.java
DatatypeConverter.parseDurationInFractionsOfMinutes
private static final Duration parseDurationInFractionsOfMinutes(ProjectProperties properties, Number value, TimeUnit targetTimeUnit, int factor) { """ Parse duration represented as an arbitrary fraction of minutes. @param properties project properties @param value duration value @param targetTimeUnit required...
java
private static final Duration parseDurationInFractionsOfMinutes(ProjectProperties properties, Number value, TimeUnit targetTimeUnit, int factor) { Duration result = null; if (value != null) { result = Duration.getInstance(value.intValue() / factor, TimeUnit.MINUTES); if (targetTi...
[ "private", "static", "final", "Duration", "parseDurationInFractionsOfMinutes", "(", "ProjectProperties", "properties", ",", "Number", "value", ",", "TimeUnit", "targetTimeUnit", ",", "int", "factor", ")", "{", "Duration", "result", "=", "null", ";", "if", "(", "va...
Parse duration represented as an arbitrary fraction of minutes. @param properties project properties @param value duration value @param targetTimeUnit required output time units @param factor required fraction of a minute @return Duration instance
[ "Parse", "duration", "represented", "as", "an", "arbitrary", "fraction", "of", "minutes", "." ]
train
https://github.com/joniles/mpxj/blob/143ea0e195da59cd108f13b3b06328e9542337e8/src/main/java/net/sf/mpxj/mspdi/DatatypeConverter.java#L1408-L1422
cdapio/tigon
tigon-api/src/main/java/co/cask/tigon/api/common/Bytes.java
Bytes.putFloat
public static int putFloat(byte [] bytes, int offset, float f) { """ Put a float value out to the specified byte array position. @param bytes byte array @param offset offset to write to @param f float value @return New offset in <code>bytes</code> """ return putInt(bytes, offset, Float.floatToRawIntBit...
java
public static int putFloat(byte [] bytes, int offset, float f) { return putInt(bytes, offset, Float.floatToRawIntBits(f)); }
[ "public", "static", "int", "putFloat", "(", "byte", "[", "]", "bytes", ",", "int", "offset", ",", "float", "f", ")", "{", "return", "putInt", "(", "bytes", ",", "offset", ",", "Float", ".", "floatToRawIntBits", "(", "f", ")", ")", ";", "}" ]
Put a float value out to the specified byte array position. @param bytes byte array @param offset offset to write to @param f float value @return New offset in <code>bytes</code>
[ "Put", "a", "float", "value", "out", "to", "the", "specified", "byte", "array", "position", "." ]
train
https://github.com/cdapio/tigon/blob/5be6dffd7c79519d1211bb08f75be7dcfbbad392/tigon-api/src/main/java/co/cask/tigon/api/common/Bytes.java#L469-L471
lucee/Lucee
core/src/main/java/lucee/runtime/interpreter/CFMLExpressionInterpreter.java
CFMLExpressionInterpreter.negateMinusOp
private Ref negateMinusOp() throws PageException { """ Liest die Vordlobe einer Zahl ein @return CFXD Element @throws PageException """ // And Operation if (cfml.forwardIfCurrent('-')) { if (cfml.forwardIfCurrent('-')) { cfml.removeSpace(); Ref expr = clip(); Ref res = preciseMath ? new BigMin...
java
private Ref negateMinusOp() throws PageException { // And Operation if (cfml.forwardIfCurrent('-')) { if (cfml.forwardIfCurrent('-')) { cfml.removeSpace(); Ref expr = clip(); Ref res = preciseMath ? new BigMinus(expr, new LNumber(new Double(1)), limited) : new Minus(expr, new LNumber(new Double(1)), limite...
[ "private", "Ref", "negateMinusOp", "(", ")", "throws", "PageException", "{", "// And Operation", "if", "(", "cfml", ".", "forwardIfCurrent", "(", "'", "'", ")", ")", "{", "if", "(", "cfml", ".", "forwardIfCurrent", "(", "'", "'", ")", ")", "{", "cfml", ...
Liest die Vordlobe einer Zahl ein @return CFXD Element @throws PageException
[ "Liest", "die", "Vordlobe", "einer", "Zahl", "ein" ]
train
https://github.com/lucee/Lucee/blob/29b153fc4e126e5edb97da937f2ee2e231b87593/core/src/main/java/lucee/runtime/interpreter/CFMLExpressionInterpreter.java#L894-L919
JOML-CI/JOML
src/org/joml/Matrix4x3d.java
Matrix4x3d.rotateZYX
public Matrix4x3d rotateZYX(Vector3d angles) { """ Apply rotation of <code>angles.z</code> radians about the Z axis, followed by a rotation of <code>angles.y</code> radians about the Y axis and followed by a rotation of <code>angles.x</code> radians about the X axis. <p> When used with a right-handed coordinate...
java
public Matrix4x3d rotateZYX(Vector3d angles) { return rotateZYX(angles.z, angles.y, angles.x); }
[ "public", "Matrix4x3d", "rotateZYX", "(", "Vector3d", "angles", ")", "{", "return", "rotateZYX", "(", "angles", ".", "z", ",", "angles", ".", "y", ",", "angles", ".", "x", ")", ";", "}" ]
Apply rotation of <code>angles.z</code> radians about the Z axis, followed by a rotation of <code>angles.y</code> radians about the Y axis and followed by a rotation of <code>angles.x</code> radians about the X axis. <p> When used with a right-handed coordinate system, the produced rotation will rotate a vector counter...
[ "Apply", "rotation", "of", "<code", ">", "angles", ".", "z<", "/", "code", ">", "radians", "about", "the", "Z", "axis", "followed", "by", "a", "rotation", "of", "<code", ">", "angles", ".", "y<", "/", "code", ">", "radians", "about", "the", "Y", "axi...
train
https://github.com/JOML-CI/JOML/blob/ce2652fc236b42bda3875c591f8e6645048a678f/src/org/joml/Matrix4x3d.java#L4484-L4486
mikepenz/FastAdapter
library/src/main/java/com/mikepenz/fastadapter/commons/utils/FastAdapterDiffUtil.java
FastAdapterDiffUtil.calculateDiff
public static <A extends ModelAdapter<Model, Item>, Model, Item extends IItem> DiffUtil.DiffResult calculateDiff(final A adapter, final List<Item> items, final DiffCallback<Item> callback) { """ convenient function for {@link #calculateDiff(ModelAdapter, List, DiffCallback, boolean)} @return the {@link androidx...
java
public static <A extends ModelAdapter<Model, Item>, Model, Item extends IItem> DiffUtil.DiffResult calculateDiff(final A adapter, final List<Item> items, final DiffCallback<Item> callback) { return calculateDiff(adapter, items, callback, true); }
[ "public", "static", "<", "A", "extends", "ModelAdapter", "<", "Model", ",", "Item", ">", ",", "Model", ",", "Item", "extends", "IItem", ">", "DiffUtil", ".", "DiffResult", "calculateDiff", "(", "final", "A", "adapter", ",", "final", "List", "<", "Item", ...
convenient function for {@link #calculateDiff(ModelAdapter, List, DiffCallback, boolean)} @return the {@link androidx.recyclerview.widget.DiffUtil.DiffResult} computed.
[ "convenient", "function", "for", "{", "@link", "#calculateDiff", "(", "ModelAdapter", "List", "DiffCallback", "boolean", ")", "}" ]
train
https://github.com/mikepenz/FastAdapter/blob/3b2412abe001ba58422e0125846b704d4dba4ae9/library/src/main/java/com/mikepenz/fastadapter/commons/utils/FastAdapterDiffUtil.java#L117-L119
Azure/azure-sdk-for-java
batch/data-plane/src/main/java/com/microsoft/azure/batch/ComputeNodeOperations.java
ComputeNodeOperations.uploadBatchServiceLogs
public UploadBatchServiceLogsResult uploadBatchServiceLogs(String poolId, String nodeId, String containerUrl, DateTime startTime) throws BatchErrorException, IOException { """ Upload Azure Batch service log files from the specified compute node to Azure Blob Storage. This is for gathering Azure Batch service log ...
java
public UploadBatchServiceLogsResult uploadBatchServiceLogs(String poolId, String nodeId, String containerUrl, DateTime startTime) throws BatchErrorException, IOException { return uploadBatchServiceLogs(poolId, nodeId, containerUrl, startTime, null, null); }
[ "public", "UploadBatchServiceLogsResult", "uploadBatchServiceLogs", "(", "String", "poolId", ",", "String", "nodeId", ",", "String", "containerUrl", ",", "DateTime", "startTime", ")", "throws", "BatchErrorException", ",", "IOException", "{", "return", "uploadBatchServiceL...
Upload Azure Batch service log files from the specified compute node to Azure Blob Storage. This is for gathering Azure Batch service log files in an automated fashion from nodes if you are experiencing an error and wish to escalate to Azure support. The Azure Batch service log files should be shared with Azure support...
[ "Upload", "Azure", "Batch", "service", "log", "files", "from", "the", "specified", "compute", "node", "to", "Azure", "Blob", "Storage", ".", "This", "is", "for", "gathering", "Azure", "Batch", "service", "log", "files", "in", "an", "automated", "fashion", "f...
train
https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/batch/data-plane/src/main/java/com/microsoft/azure/batch/ComputeNodeOperations.java#L554-L557
netscaler/sdx_nitro
src/main/java/com/citrix/sdx/nitro/resource/config/xen/xen.java
xen.get_nitro_bulk_response
protected base_resource[] get_nitro_bulk_response(nitro_service service, String response) throws Exception { """ <pre> Converts API response of bulk operation into object and returns the object array in case of get request. </pre> """ xen_responses result = (xen_responses) service.get_payload_formatter()....
java
protected base_resource[] get_nitro_bulk_response(nitro_service service, String response) throws Exception { xen_responses result = (xen_responses) service.get_payload_formatter().string_to_resource(xen_responses.class, response); if(result.errorcode != 0) { if (result.errorcode == SESSION_NOT_EXISTS) ...
[ "protected", "base_resource", "[", "]", "get_nitro_bulk_response", "(", "nitro_service", "service", ",", "String", "response", ")", "throws", "Exception", "{", "xen_responses", "result", "=", "(", "xen_responses", ")", "service", ".", "get_payload_formatter", "(", "...
<pre> Converts API response of bulk operation into object and returns the object array in case of get request. </pre>
[ "<pre", ">", "Converts", "API", "response", "of", "bulk", "operation", "into", "object", "and", "returns", "the", "object", "array", "in", "case", "of", "get", "request", ".", "<", "/", "pre", ">" ]
train
https://github.com/netscaler/sdx_nitro/blob/c840919f1a8f7c0a5634c0f23d34fa14d1765ff1/src/main/java/com/citrix/sdx/nitro/resource/config/xen/xen.java#L442-L459
lessthanoptimal/BoofCV
main/boofcv-feature/src/main/java/boofcv/alg/feature/detect/line/ConnectLinesGrid.java
ConnectLinesGrid.closestFarthestPoints
private void closestFarthestPoints(LineSegment2D_F32 a, LineSegment2D_F32 b) { """ Finds the points on each line which are closest and farthest away from each other. """ dist[0] = a.a.distance2(b.a); dist[1] = a.a.distance2(b.b); dist[2] = a.b.distance2(b.a); dist[3] = a.b.distance2(b.b); // find th...
java
private void closestFarthestPoints(LineSegment2D_F32 a, LineSegment2D_F32 b) { dist[0] = a.a.distance2(b.a); dist[1] = a.a.distance2(b.b); dist[2] = a.b.distance2(b.a); dist[3] = a.b.distance2(b.b); // find the two points which are closest together and save which ones those are // for future reference f...
[ "private", "void", "closestFarthestPoints", "(", "LineSegment2D_F32", "a", ",", "LineSegment2D_F32", "b", ")", "{", "dist", "[", "0", "]", "=", "a", ".", "a", ".", "distance2", "(", "b", ".", "a", ")", ";", "dist", "[", "1", "]", "=", "a", ".", "a"...
Finds the points on each line which are closest and farthest away from each other.
[ "Finds", "the", "points", "on", "each", "line", "which", "are", "closest", "and", "farthest", "away", "from", "each", "other", "." ]
train
https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-feature/src/main/java/boofcv/alg/feature/detect/line/ConnectLinesGrid.java#L268-L291
paypal/SeLion
server/src/main/java/com/paypal/selion/proxy/SeLionRemoteProxy.java
SeLionRemoteProxy.upgradeNode
public boolean upgradeNode(String downloadJSON) { """ Upgrades the node by calling {@link NodeAutoUpgradeServlet} and then {@link #requestNodeShutdown} @param downloadJSON the download.json to install on node @return <code>true</code> on success. <code>false</code> when an error occured. """ LOGGE...
java
public boolean upgradeNode(String downloadJSON) { LOGGER.entering(downloadJSON); // verify the servlet is supported on the node if (!supportsAutoUpgrade()) { LOGGER.exiting(false); return false; } // call the NodeAutoUpgradeServlet on the node pr...
[ "public", "boolean", "upgradeNode", "(", "String", "downloadJSON", ")", "{", "LOGGER", ".", "entering", "(", "downloadJSON", ")", ";", "// verify the servlet is supported on the node", "if", "(", "!", "supportsAutoUpgrade", "(", ")", ")", "{", "LOGGER", ".", "exit...
Upgrades the node by calling {@link NodeAutoUpgradeServlet} and then {@link #requestNodeShutdown} @param downloadJSON the download.json to install on node @return <code>true</code> on success. <code>false</code> when an error occured.
[ "Upgrades", "the", "node", "by", "calling", "{", "@link", "NodeAutoUpgradeServlet", "}", "and", "then", "{", "@link", "#requestNodeShutdown", "}" ]
train
https://github.com/paypal/SeLion/blob/694d12d0df76db48d0360b16192770c6a4fbdfd2/server/src/main/java/com/paypal/selion/proxy/SeLionRemoteProxy.java#L272-L307
deeplearning4j/deeplearning4j
nd4j/nd4j-backends/nd4j-api-parent/nd4j-api/src/main/java/org/nd4j/linalg/api/shape/Shape.java
Shape.lengthOfBuffer
public static long lengthOfBuffer(@NonNull long[] shape, @NonNull long[] stride) { """ Calculate the length of the buffer required to store the given shape with the given strides @param shape Shape of the array @param stride Strides @return Length of the buffer """ Preconditions.checkArgument(sha...
java
public static long lengthOfBuffer(@NonNull long[] shape, @NonNull long[] stride){ Preconditions.checkArgument(shape.length == stride.length, "Shape and strides must be same length: shape %s, stride %s", shape, stride); //Length is simply 1 + the buffer index of the last element l...
[ "public", "static", "long", "lengthOfBuffer", "(", "@", "NonNull", "long", "[", "]", "shape", ",", "@", "NonNull", "long", "[", "]", "stride", ")", "{", "Preconditions", ".", "checkArgument", "(", "shape", ".", "length", "==", "stride", ".", "length", ",...
Calculate the length of the buffer required to store the given shape with the given strides @param shape Shape of the array @param stride Strides @return Length of the buffer
[ "Calculate", "the", "length", "of", "the", "buffer", "required", "to", "store", "the", "given", "shape", "with", "the", "given", "strides" ]
train
https://github.com/deeplearning4j/deeplearning4j/blob/effce52f2afd7eeb53c5bcca699fcd90bd06822f/nd4j/nd4j-backends/nd4j-api-parent/nd4j-api/src/main/java/org/nd4j/linalg/api/shape/Shape.java#L3571-L3580
taimos/dvalin
mongodb/src/main/java/de/taimos/dvalin/mongo/ChangelogUtil.java
ChangelogUtil.addTTLIndex
public static void addTTLIndex(DBCollection collection, String field, int ttl) { """ adds a TTL index to the given collection. The TTL must be a positive integer. @param collection the collection to use for the TTL index @param field the field to use for the TTL index @param ttl the TTL to set on ...
java
public static void addTTLIndex(DBCollection collection, String field, int ttl) { if (ttl <= 0) { throw new IllegalArgumentException("TTL must be positive"); } collection.createIndex(new BasicDBObject(field, 1), new BasicDBObject("expireAfterSeconds", ttl)); }
[ "public", "static", "void", "addTTLIndex", "(", "DBCollection", "collection", ",", "String", "field", ",", "int", "ttl", ")", "{", "if", "(", "ttl", "<=", "0", ")", "{", "throw", "new", "IllegalArgumentException", "(", "\"TTL must be positive\"", ")", ";", "...
adds a TTL index to the given collection. The TTL must be a positive integer. @param collection the collection to use for the TTL index @param field the field to use for the TTL index @param ttl the TTL to set on the given field @throws IllegalArgumentException if the TTL is less or equal 0
[ "adds", "a", "TTL", "index", "to", "the", "given", "collection", ".", "The", "TTL", "must", "be", "a", "positive", "integer", "." ]
train
https://github.com/taimos/dvalin/blob/ff8f1bf594e43d7e8ca8de0b4da9f923b66a1a47/mongodb/src/main/java/de/taimos/dvalin/mongo/ChangelogUtil.java#L47-L52
Impetus/Kundera
src/kundera-cassandra/cassandra-core/src/main/java/com/impetus/client/cassandra/datahandler/CassandraDataHandlerBase.java
CassandraDataHandlerBase.getThriftRow
private ThriftRow getThriftRow(Object id, String columnFamily, Map<String, ThriftRow> thriftRows) { """ Gets the thrift row. @param id the id @param columnFamily the column family @param thriftRows the thrift rows @return the thrift row """ ThriftRow tr = thriftRows.get(columnFamily); ...
java
private ThriftRow getThriftRow(Object id, String columnFamily, Map<String, ThriftRow> thriftRows) { ThriftRow tr = thriftRows.get(columnFamily); if (tr == null) { tr = new ThriftRow(); tr.setColumnFamilyName(columnFamily); // column-family name tr.setId(id...
[ "private", "ThriftRow", "getThriftRow", "(", "Object", "id", ",", "String", "columnFamily", ",", "Map", "<", "String", ",", "ThriftRow", ">", "thriftRows", ")", "{", "ThriftRow", "tr", "=", "thriftRows", ".", "get", "(", "columnFamily", ")", ";", "if", "("...
Gets the thrift row. @param id the id @param columnFamily the column family @param thriftRows the thrift rows @return the thrift row
[ "Gets", "the", "thrift", "row", "." ]
train
https://github.com/Impetus/Kundera/blob/268958ab1ec09d14ec4d9184f0c8ded7a9158908/src/kundera-cassandra/cassandra-core/src/main/java/com/impetus/client/cassandra/datahandler/CassandraDataHandlerBase.java#L436-L447
kuujo/vertigo
core/src/main/java/net/kuujo/vertigo/util/Components.java
Components.buildConfig
public static JsonObject buildConfig(InstanceContext context, Cluster cluster) { """ Builds a verticle configuration. @param context The verticle context. @return A verticle configuration. """ JsonObject config = context.component().config().copy(); return config.putObject("__context__", Contexts.s...
java
public static JsonObject buildConfig(InstanceContext context, Cluster cluster) { JsonObject config = context.component().config().copy(); return config.putObject("__context__", Contexts.serialize(context)); }
[ "public", "static", "JsonObject", "buildConfig", "(", "InstanceContext", "context", ",", "Cluster", "cluster", ")", "{", "JsonObject", "config", "=", "context", ".", "component", "(", ")", ".", "config", "(", ")", ".", "copy", "(", ")", ";", "return", "con...
Builds a verticle configuration. @param context The verticle context. @return A verticle configuration.
[ "Builds", "a", "verticle", "configuration", "." ]
train
https://github.com/kuujo/vertigo/blob/c5869dbc5fff89eb5262e83f7a81719b01a5ba6f/core/src/main/java/net/kuujo/vertigo/util/Components.java#L85-L88
canoo/open-dolphin
subprojects/shared/src/main/groovy/org/opendolphin/core/BasePresentationModel.java
BasePresentationModel.getValue
public int getValue(String attributeName, int defaultValue) { """ Convenience method to get the value of an attribute if it exists or a default value otherwise. """ A attribute = getAt(attributeName); Object attributeValue = (attribute == null) ? null : attribute.getValue(); return (att...
java
public int getValue(String attributeName, int defaultValue) { A attribute = getAt(attributeName); Object attributeValue = (attribute == null) ? null : attribute.getValue(); return (attributeValue == null) ? defaultValue : Integer.parseInt(attributeValue.toString()); }
[ "public", "int", "getValue", "(", "String", "attributeName", ",", "int", "defaultValue", ")", "{", "A", "attribute", "=", "getAt", "(", "attributeName", ")", ";", "Object", "attributeValue", "=", "(", "attribute", "==", "null", ")", "?", "null", ":", "attr...
Convenience method to get the value of an attribute if it exists or a default value otherwise.
[ "Convenience", "method", "to", "get", "the", "value", "of", "an", "attribute", "if", "it", "exists", "or", "a", "default", "value", "otherwise", "." ]
train
https://github.com/canoo/open-dolphin/blob/50166defc3ef2de473d7a7246c32dc04304d80ef/subprojects/shared/src/main/groovy/org/opendolphin/core/BasePresentationModel.java#L126-L130
Azure/azure-sdk-for-java
compute/resource-manager/v2017_03_30/src/main/java/com/microsoft/azure/management/compute/v2017_03_30/implementation/VirtualMachineScaleSetExtensionsInner.java
VirtualMachineScaleSetExtensionsInner.beginCreateOrUpdateAsync
public Observable<VirtualMachineScaleSetExtensionInner> beginCreateOrUpdateAsync(String resourceGroupName, String vmScaleSetName, String vmssExtensionName, VirtualMachineScaleSetExtensionInner extensionParameters) { """ The operation to create or update an extension. @param resourceGroupName The name of the res...
java
public Observable<VirtualMachineScaleSetExtensionInner> beginCreateOrUpdateAsync(String resourceGroupName, String vmScaleSetName, String vmssExtensionName, VirtualMachineScaleSetExtensionInner extensionParameters) { return beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, vmScaleSetName, vmssExtens...
[ "public", "Observable", "<", "VirtualMachineScaleSetExtensionInner", ">", "beginCreateOrUpdateAsync", "(", "String", "resourceGroupName", ",", "String", "vmScaleSetName", ",", "String", "vmssExtensionName", ",", "VirtualMachineScaleSetExtensionInner", "extensionParameters", ")", ...
The operation to create or update an extension. @param resourceGroupName The name of the resource group. @param vmScaleSetName The name of the VM scale set where the extension should be create or updated. @param vmssExtensionName The name of the VM scale set extension. @param extensionParameters Parameters supplied to...
[ "The", "operation", "to", "create", "or", "update", "an", "extension", "." ]
train
https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/compute/resource-manager/v2017_03_30/src/main/java/com/microsoft/azure/management/compute/v2017_03_30/implementation/VirtualMachineScaleSetExtensionsInner.java#L219-L226
fabric8io/docker-maven-plugin
src/main/java/io/fabric8/maven/docker/access/ecr/AwsSigner4.java
AwsSigner4.task3
final byte[] task3(AwsSigner4Request sr, AuthConfig credentials) { """ Task 3. <a href="https://docs.aws.amazon.com/general/latest/gr/sigv4-create-string-to-sign.html">Calculate the Signature for AWS Signature Version 4</a> """ return hmacSha256(getSigningKey(sr, credentials), task2(sr)); }
java
final byte[] task3(AwsSigner4Request sr, AuthConfig credentials) { return hmacSha256(getSigningKey(sr, credentials), task2(sr)); }
[ "final", "byte", "[", "]", "task3", "(", "AwsSigner4Request", "sr", ",", "AuthConfig", "credentials", ")", "{", "return", "hmacSha256", "(", "getSigningKey", "(", "sr", ",", "credentials", ")", ",", "task2", "(", "sr", ")", ")", ";", "}" ]
Task 3. <a href="https://docs.aws.amazon.com/general/latest/gr/sigv4-create-string-to-sign.html">Calculate the Signature for AWS Signature Version 4</a>
[ "Task", "3", ".", "<a", "href", "=", "https", ":", "//", "docs", ".", "aws", ".", "amazon", ".", "com", "/", "general", "/", "latest", "/", "gr", "/", "sigv4", "-", "create", "-", "string", "-", "to", "-", "sign", ".", "html", ">", "Calculate", ...
train
https://github.com/fabric8io/docker-maven-plugin/blob/70ce4f56125d8efb8ddcf2ad4dbb5d6e2c7642b3/src/main/java/io/fabric8/maven/docker/access/ecr/AwsSigner4.java#L98-L100
j256/simplemagic
src/main/java/com/j256/simplemagic/types/PStringType.java
PStringType.extractValueFromBytes
@Override public Object extractValueFromBytes(int offset, byte[] bytes, boolean required) { """ Extracted value is the extracted string using the first byte as the length. """ // we don't need to extract the value if all we are doing is matching if (!required) { return EMPTY; } if (offset >= bytes....
java
@Override public Object extractValueFromBytes(int offset, byte[] bytes, boolean required) { // we don't need to extract the value if all we are doing is matching if (!required) { return EMPTY; } if (offset >= bytes.length) { return null; } // length is from the first byte of the string int len = (b...
[ "@", "Override", "public", "Object", "extractValueFromBytes", "(", "int", "offset", ",", "byte", "[", "]", "bytes", ",", "boolean", "required", ")", "{", "// we don't need to extract the value if all we are doing is matching", "if", "(", "!", "required", ")", "{", "...
Extracted value is the extracted string using the first byte as the length.
[ "Extracted", "value", "is", "the", "extracted", "string", "using", "the", "first", "byte", "as", "the", "length", "." ]
train
https://github.com/j256/simplemagic/blob/360362b52be76e31d01182abffe73f25e170221d/src/main/java/com/j256/simplemagic/types/PStringType.java#L14-L37
akarnokd/akarnokd-xml
src/main/java/hu/akarnokd/xml/XNElement.java
XNElement.get
public String get(String attributeName, String attributeNamespace) { """ Retrieve the specific attribute. @param attributeName the attribute name @param attributeNamespace the attribute namespace URI @return the attribute value or null if not present """ return attributes.get(new XAttributeName(attr...
java
public String get(String attributeName, String attributeNamespace) { return attributes.get(new XAttributeName(attributeName, attributeNamespace, null)); }
[ "public", "String", "get", "(", "String", "attributeName", ",", "String", "attributeNamespace", ")", "{", "return", "attributes", ".", "get", "(", "new", "XAttributeName", "(", "attributeName", ",", "attributeNamespace", ",", "null", ")", ")", ";", "}" ]
Retrieve the specific attribute. @param attributeName the attribute name @param attributeNamespace the attribute namespace URI @return the attribute value or null if not present
[ "Retrieve", "the", "specific", "attribute", "." ]
train
https://github.com/akarnokd/akarnokd-xml/blob/57466a5a9cb455a13d7121557c165287b31ee870/src/main/java/hu/akarnokd/xml/XNElement.java#L686-L688
Jasig/uPortal
uPortal-api/uPortal-api-rest/src/main/java/org/apereo/portal/layout/dlm/remoting/UpdatePreferencesServlet.java
UpdatePreferencesServlet.movePortlet
@RequestMapping(method = RequestMethod.POST, params = "action=movePortlet") @Deprecated public ModelAndView movePortlet( HttpServletRequest request, HttpServletResponse response, @RequestParam(value = "sourceID") String sourceId, @RequestParam String method, ...
java
@RequestMapping(method = RequestMethod.POST, params = "action=movePortlet") @Deprecated public ModelAndView movePortlet( HttpServletRequest request, HttpServletResponse response, @RequestParam(value = "sourceID") String sourceId, @RequestParam String method, ...
[ "@", "RequestMapping", "(", "method", "=", "RequestMethod", ".", "POST", ",", "params", "=", "\"action=movePortlet\"", ")", "@", "Deprecated", "public", "ModelAndView", "movePortlet", "(", "HttpServletRequest", "request", ",", "HttpServletResponse", "response", ",", ...
Move a portlet to another location on the tab. <p>This deprecated method is replaced by the method/action "moveElement". The code is the same, but the naming better abstracts the action. This method is here for backwards compatibility with anything using the "movePortlet" action of the API. <p>Used by Respondr UI whe...
[ "Move", "a", "portlet", "to", "another", "location", "on", "the", "tab", "." ]
train
https://github.com/Jasig/uPortal/blob/c1986542abb9acd214268f2df21c6305ad2f262b/uPortal-api/uPortal-api-rest/src/main/java/org/apereo/portal/layout/dlm/remoting/UpdatePreferencesServlet.java#L331-L341
joniles/mpxj
src/main/java/net/sf/mpxj/fasttrack/FastTrackData.java
FastTrackData.readTableBlock
private void readTableBlock(int startIndex, int blockLength) { """ Read the name of a table and prepare to populate it with column data. @param startIndex start of the block @param blockLength length of the block """ for (int index = startIndex; index < (startIndex + blockLength - 11); index++) ...
java
private void readTableBlock(int startIndex, int blockLength) { for (int index = startIndex; index < (startIndex + blockLength - 11); index++) { if (matchPattern(TABLE_BLOCK_PATTERNS, index)) { int offset = index + 7; int nameLength = FastTrackUtility.getInt(m_buf...
[ "private", "void", "readTableBlock", "(", "int", "startIndex", ",", "int", "blockLength", ")", "{", "for", "(", "int", "index", "=", "startIndex", ";", "index", "<", "(", "startIndex", "+", "blockLength", "-", "11", ")", ";", "index", "++", ")", "{", "...
Read the name of a table and prepare to populate it with column data. @param startIndex start of the block @param blockLength length of the block
[ "Read", "the", "name", "of", "a", "table", "and", "prepare", "to", "populate", "it", "with", "column", "data", "." ]
train
https://github.com/joniles/mpxj/blob/143ea0e195da59cd108f13b3b06328e9542337e8/src/main/java/net/sf/mpxj/fasttrack/FastTrackData.java#L161-L185
Alluxio/alluxio
job/client/src/main/java/alluxio/client/job/JobGrpcClientUtils.java
JobGrpcClientUtils.createProgressThread
public static Thread createProgressThread(final long intervalMs, final PrintStream stream) { """ Creates a thread which will write "." to the given print stream at the given interval. The created thread is not started by this method. The created thread will be daemonic and will halt when interrupted. @param i...
java
public static Thread createProgressThread(final long intervalMs, final PrintStream stream) { Thread thread = new Thread(new Runnable() { @Override public void run() { while (true) { CommonUtils.sleepMs(intervalMs); if (Thread.interrupted()) { return; } ...
[ "public", "static", "Thread", "createProgressThread", "(", "final", "long", "intervalMs", ",", "final", "PrintStream", "stream", ")", "{", "Thread", "thread", "=", "new", "Thread", "(", "new", "Runnable", "(", ")", "{", "@", "Override", "public", "void", "ru...
Creates a thread which will write "." to the given print stream at the given interval. The created thread is not started by this method. The created thread will be daemonic and will halt when interrupted. @param intervalMs the time interval in milliseconds between writes @param stream the print stream to write to @ret...
[ "Creates", "a", "thread", "which", "will", "write", ".", "to", "the", "given", "print", "stream", "at", "the", "given", "interval", ".", "The", "created", "thread", "is", "not", "started", "by", "this", "method", ".", "The", "created", "thread", "will", ...
train
https://github.com/Alluxio/alluxio/blob/af38cf3ab44613355b18217a3a4d961f8fec3a10/job/client/src/main/java/alluxio/client/job/JobGrpcClientUtils.java#L97-L112
grpc/grpc-java
stub/src/main/java/io/grpc/stub/ClientCalls.java
ClientCalls.blockingUnaryCall
public static <ReqT, RespT> RespT blockingUnaryCall( Channel channel, MethodDescriptor<ReqT, RespT> method, CallOptions callOptions, ReqT req) { """ Executes a unary call and blocks on the response. The {@code call} should not be already started. After calling this method, {@code call} should no longer be...
java
public static <ReqT, RespT> RespT blockingUnaryCall( Channel channel, MethodDescriptor<ReqT, RespT> method, CallOptions callOptions, ReqT req) { ThreadlessExecutor executor = new ThreadlessExecutor(); ClientCall<ReqT, RespT> call = channel.newCall(method, callOptions.withExecutor(executor)); try { ...
[ "public", "static", "<", "ReqT", ",", "RespT", ">", "RespT", "blockingUnaryCall", "(", "Channel", "channel", ",", "MethodDescriptor", "<", "ReqT", ",", "RespT", ">", "method", ",", "CallOptions", "callOptions", ",", "ReqT", "req", ")", "{", "ThreadlessExecutor...
Executes a unary call and blocks on the response. The {@code call} should not be already started. After calling this method, {@code call} should no longer be used. @return the single response message.
[ "Executes", "a", "unary", "call", "and", "blocks", "on", "the", "response", ".", "The", "{", "@code", "call", "}", "should", "not", "be", "already", "started", ".", "After", "calling", "this", "method", "{", "@code", "call", "}", "should", "no", "longer"...
train
https://github.com/grpc/grpc-java/blob/973885457f9609de232d2553b82c67f6c3ff57bf/stub/src/main/java/io/grpc/stub/ClientCalls.java#L123-L146
google/j2objc
jre_emul/openjdk/src/share/classes/java/math/MutableBigInteger.java
MutableBigInteger.getBlock
private MutableBigInteger getBlock(int index, int numBlocks, int blockLength) { """ Returns a {@code MutableBigInteger} containing {@code blockLength} ints from {@code this} number, starting at {@code index*blockLength}.<br/> Used by Burnikel-Ziegler division. @param index the block index @param numBlocks the ...
java
private MutableBigInteger getBlock(int index, int numBlocks, int blockLength) { int blockStart = index * blockLength; if (blockStart >= intLen) { return new MutableBigInteger(); } int blockEnd; if (index == numBlocks-1) { blockEnd = intLen; } else...
[ "private", "MutableBigInteger", "getBlock", "(", "int", "index", ",", "int", "numBlocks", ",", "int", "blockLength", ")", "{", "int", "blockStart", "=", "index", "*", "blockLength", ";", "if", "(", "blockStart", ">=", "intLen", ")", "{", "return", "new", "...
Returns a {@code MutableBigInteger} containing {@code blockLength} ints from {@code this} number, starting at {@code index*blockLength}.<br/> Used by Burnikel-Ziegler division. @param index the block index @param numBlocks the total number of blocks in {@code this} number @param blockLength length of one block in units...
[ "Returns", "a", "{" ]
train
https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/openjdk/src/share/classes/java/math/MutableBigInteger.java#L1403-L1421
stratosphere/stratosphere
stratosphere-runtime/src/main/java/eu/stratosphere/nephele/jobmanager/JobManager.java
JobManager.main
public static void main(String[] args) { """ Entry point for the program @param args arguments from the command line """ // determine if a valid log4j config exists and initialize a default logger if not if (System.getProperty("log4j.configuration") == null) { Logger root = Logger.getRootLogger(); ...
java
public static void main(String[] args) { // determine if a valid log4j config exists and initialize a default logger if not if (System.getProperty("log4j.configuration") == null) { Logger root = Logger.getRootLogger(); root.removeAllAppenders(); PatternLayout layout = new PatternLayout("%d{HH:mm:ss,SSS} %-...
[ "public", "static", "void", "main", "(", "String", "[", "]", "args", ")", "{", "// determine if a valid log4j config exists and initialize a default logger if not", "if", "(", "System", ".", "getProperty", "(", "\"log4j.configuration\"", ")", "==", "null", ")", "{", "...
Entry point for the program @param args arguments from the command line
[ "Entry", "point", "for", "the", "program" ]
train
https://github.com/stratosphere/stratosphere/blob/c543a08f9676c5b2b0a7088123bd6e795a8ae0c8/stratosphere-runtime/src/main/java/eu/stratosphere/nephele/jobmanager/JobManager.java#L332-L362
eclipse/xtext-lib
org.eclipse.xtext.xbase.lib/src/org/eclipse/xtext/xbase/lib/IteratorExtensions.java
IteratorExtensions.maxBy
public static <T, C extends Comparable<? super C>> T maxBy(final Iterator<T> iterator, final Function1<? super T, C> compareBy) { """ Finds the element that yields the maximum value when passed to <code>compareBy</code> If there are several maxima, the first one will be returned. @param iterator the elements ...
java
public static <T, C extends Comparable<? super C>> T maxBy(final Iterator<T> iterator, final Function1<? super T, C> compareBy) { if (compareBy == null) throw new NullPointerException("compareBy"); return max(iterator, new KeyComparator<T, C>(compareBy)); }
[ "public", "static", "<", "T", ",", "C", "extends", "Comparable", "<", "?", "super", "C", ">", ">", "T", "maxBy", "(", "final", "Iterator", "<", "T", ">", "iterator", ",", "final", "Function1", "<", "?", "super", "T", ",", "C", ">", "compareBy", ")"...
Finds the element that yields the maximum value when passed to <code>compareBy</code> If there are several maxima, the first one will be returned. @param iterator the elements to find the maximum of. May not be <code>null</code>. @param compareBy a function that returns a comparable characteristic to compare the eleme...
[ "Finds", "the", "element", "that", "yields", "the", "maximum", "value", "when", "passed", "to", "<code", ">", "compareBy<", "/", "code", ">", "If", "there", "are", "several", "maxima", "the", "first", "one", "will", "be", "returned", "." ]
train
https://github.com/eclipse/xtext-lib/blob/7063572e1f1bd713a3aa53bdf3a8dc60e25c169a/org.eclipse.xtext.xbase.lib/src/org/eclipse/xtext/xbase/lib/IteratorExtensions.java#L1017-L1021
aws/aws-sdk-java
aws-java-sdk-s3/src/main/java/com/amazonaws/services/s3/AmazonS3Client.java
AmazonS3Client.addDateHeader
private static void addDateHeader(Request<?> request, String header, Date value) { """ <p> Adds the specified date header in RFC 822 date format to the specified request. This method will not add a date header if the specified date value is <code>null</code>. </p> @param request The request to add the head...
java
private static void addDateHeader(Request<?> request, String header, Date value) { if (value != null) { request.addHeader(header, ServiceUtils.formatRfc822Date(value)); } }
[ "private", "static", "void", "addDateHeader", "(", "Request", "<", "?", ">", "request", ",", "String", "header", ",", "Date", "value", ")", "{", "if", "(", "value", "!=", "null", ")", "{", "request", ".", "addHeader", "(", "header", ",", "ServiceUtils", ...
<p> Adds the specified date header in RFC 822 date format to the specified request. This method will not add a date header if the specified date value is <code>null</code>. </p> @param request The request to add the header to. @param header The header name. @param value The header value.
[ "<p", ">", "Adds", "the", "specified", "date", "header", "in", "RFC", "822", "date", "format", "to", "the", "specified", "request", ".", "This", "method", "will", "not", "add", "a", "date", "header", "if", "the", "specified", "date", "value", "is", "<cod...
train
https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-s3/src/main/java/com/amazonaws/services/s3/AmazonS3Client.java#L4491-L4495
goshippo/shippo-java-client
src/main/java/com/shippo/model/Track.java
Track.registerTrackingWebhook
public static Track registerTrackingWebhook(String carrier, String trackingNumber, String metadata, String apiKey) throws AuthenticationException, InvalidRequestException, APIConnectionException, APIException { """ Register webhook for tracking shipment of a package. This corresponds to API defined in https://...
java
public static Track registerTrackingWebhook(String carrier, String trackingNumber, String metadata, String apiKey) throws AuthenticationException, InvalidRequestException, APIConnectionException, APIException { Map<String, Object> params = new HashMap<String, Object>(); params.put("carrier", carrier); params.p...
[ "public", "static", "Track", "registerTrackingWebhook", "(", "String", "carrier", ",", "String", "trackingNumber", ",", "String", "metadata", ",", "String", "apiKey", ")", "throws", "AuthenticationException", ",", "InvalidRequestException", ",", "APIConnectionException", ...
Register webhook for tracking shipment of a package. This corresponds to API defined in https://goshippo.com/docs/reference#tracks-create. Please note that the webhook where information will be posted need to be already provided in https://app.goshippo.com @param carrier Name of the carrier (like "usps") tracking the ...
[ "Register", "webhook", "for", "tracking", "shipment", "of", "a", "package", ".", "This", "corresponds", "to", "API", "defined", "in", "https", ":", "//", "goshippo", ".", "com", "/", "docs", "/", "reference#tracks", "-", "create", ".", "Please", "note", "t...
train
https://github.com/goshippo/shippo-java-client/blob/eecf801c7e07a627c3677a331c0cfcf36cb1678b/src/main/java/com/shippo/model/Track.java#L206-L213
spotify/docgenerator
scanner/src/main/java/com/spotify/docgenerator/JacksonJerseyAnnotationProcessor.java
JacksonJerseyAnnotationProcessor.makeTypeDescriptor
private TypeDescriptor makeTypeDescriptor(final TypeMirror type) { """ Make a {@link TypeDescriptor} by examining the {@link TypeMirror} and recursively looking at the generic arguments to the type (if they exist). """ if (type.getKind() != TypeKind.DECLARED) { return new TypeDescriptor(type.toStrin...
java
private TypeDescriptor makeTypeDescriptor(final TypeMirror type) { if (type.getKind() != TypeKind.DECLARED) { return new TypeDescriptor(type.toString(), ImmutableList.<TypeDescriptor>of()); } final DeclaredType dt = (DeclaredType) type; final String plainType = processingEnv.getTypeUtils().erasur...
[ "private", "TypeDescriptor", "makeTypeDescriptor", "(", "final", "TypeMirror", "type", ")", "{", "if", "(", "type", ".", "getKind", "(", ")", "!=", "TypeKind", ".", "DECLARED", ")", "{", "return", "new", "TypeDescriptor", "(", "type", ".", "toString", "(", ...
Make a {@link TypeDescriptor} by examining the {@link TypeMirror} and recursively looking at the generic arguments to the type (if they exist).
[ "Make", "a", "{" ]
train
https://github.com/spotify/docgenerator/blob/a7965f6d4a1546864a3f8584b86841cef9ac2f65/scanner/src/main/java/com/spotify/docgenerator/JacksonJerseyAnnotationProcessor.java#L296-L309
wildfly/wildfly-core
controller/src/main/java/org/jboss/as/controller/parsing/ParseUtils.java
ParseUtils.invalidAttributeValue
public static XMLStreamException invalidAttributeValue(final XMLExtendedStreamReader reader, final int index) { """ Get an exception reporting an invalid XML attribute value. @param reader the stream reader @param index the attribute index @return the exception """ final XMLStreamException ex = Cont...
java
public static XMLStreamException invalidAttributeValue(final XMLExtendedStreamReader reader, final int index) { final XMLStreamException ex = ControllerLogger.ROOT_LOGGER.invalidAttributeValue(reader.getAttributeValue(index), reader.getAttributeName(index), reader.getLocation()); return new XMLStreamVa...
[ "public", "static", "XMLStreamException", "invalidAttributeValue", "(", "final", "XMLExtendedStreamReader", "reader", ",", "final", "int", "index", ")", "{", "final", "XMLStreamException", "ex", "=", "ControllerLogger", ".", "ROOT_LOGGER", ".", "invalidAttributeValue", ...
Get an exception reporting an invalid XML attribute value. @param reader the stream reader @param index the attribute index @return the exception
[ "Get", "an", "exception", "reporting", "an", "invalid", "XML", "attribute", "value", "." ]
train
https://github.com/wildfly/wildfly-core/blob/cfaf0479dcbb2d320a44c5374b93b944ec39fade/controller/src/main/java/org/jboss/as/controller/parsing/ParseUtils.java#L180-L189
allure-framework/allure-java
allure-java-commons/src/main/java/io/qameta/allure/AllureLifecycle.java
AllureLifecycle.startTearDownFixture
public void startTearDownFixture(final String containerUuid, final String uuid, final FixtureResult result) { """ Start a new tear down fixture with given parent. @param containerUuid the uuid of parent container. @param uuid the fixture uuid. @param result the fixture. """ storage...
java
public void startTearDownFixture(final String containerUuid, final String uuid, final FixtureResult result) { storage.getContainer(containerUuid).ifPresent(container -> { synchronized (storage) { container.getAfters().add(result); } }); notifier.beforeFix...
[ "public", "void", "startTearDownFixture", "(", "final", "String", "containerUuid", ",", "final", "String", "uuid", ",", "final", "FixtureResult", "result", ")", "{", "storage", ".", "getContainer", "(", "containerUuid", ")", ".", "ifPresent", "(", "container", "...
Start a new tear down fixture with given parent. @param containerUuid the uuid of parent container. @param uuid the fixture uuid. @param result the fixture.
[ "Start", "a", "new", "tear", "down", "fixture", "with", "given", "parent", "." ]
train
https://github.com/allure-framework/allure-java/blob/64015ca2b789aa6f7b19c793f1512e2f11d0174e/allure-java-commons/src/main/java/io/qameta/allure/AllureLifecycle.java#L201-L211
before/quality-check
modules/quality-check/src/main/java/net/sf/qualitycheck/ConditionalCheck.java
ConditionalCheck.notEmpty
@ArgumentsChecked @Throws( { """ Ensures that a passed string as a parameter of the calling method is not empty. <p> We recommend to use the overloaded method {@link Check#notEmpty(CharSequence, String)} and pass as second argument the name of the parameter to enhance the exception message. @param conditi...
java
@ArgumentsChecked @Throws({ IllegalNullArgumentException.class, IllegalEmptyArgumentException.class }) public static <T extends CharSequence> void notEmpty(final boolean condition, @Nonnull final T chars) { if (condition) { Check.notEmpty(chars); } }
[ "@", "ArgumentsChecked", "@", "Throws", "(", "{", "IllegalNullArgumentException", ".", "class", ",", "IllegalEmptyArgumentException", ".", "class", "}", ")", "public", "static", "<", "T", "extends", "CharSequence", ">", "void", "notEmpty", "(", "final", "boolean",...
Ensures that a passed string as a parameter of the calling method is not empty. <p> We recommend to use the overloaded method {@link Check#notEmpty(CharSequence, String)} and pass as second argument the name of the parameter to enhance the exception message. @param condition condition must be {@code true}^ so that th...
[ "Ensures", "that", "a", "passed", "string", "as", "a", "parameter", "of", "the", "calling", "method", "is", "not", "empty", "." ]
train
https://github.com/before/quality-check/blob/a75c32c39434ddb1f89bece57acae0536724c15a/modules/quality-check/src/main/java/net/sf/qualitycheck/ConditionalCheck.java#L1208-L1214
google/j2objc
jre_emul/android/platform/external/icu/android_icu4j/src/main/java/android/icu/text/NFSubstitution.java
NFSubstitution.doSubstitution
public void doSubstitution(long number, StringBuilder toInsertInto, int position, int recursionCount) { """ Performs a mathematical operation on the number, formats it using either ruleSet or decimalFormat, and inserts the result into toInsertInto. @param number The number being formatted. @param toInsertInto ...
java
public void doSubstitution(long number, StringBuilder toInsertInto, int position, int recursionCount) { // perform a transformation on the number that is dependent // on the type of substitution this is, then just call its // rule set's format() method to format the result long numberToF...
[ "public", "void", "doSubstitution", "(", "long", "number", ",", "StringBuilder", "toInsertInto", ",", "int", "position", ",", "int", "recursionCount", ")", "{", "// perform a transformation on the number that is dependent", "// on the type of substitution this is, then just call ...
Performs a mathematical operation on the number, formats it using either ruleSet or decimalFormat, and inserts the result into toInsertInto. @param number The number being formatted. @param toInsertInto The string we insert the result into @param position The position in toInsertInto where the owning rule's rule text b...
[ "Performs", "a", "mathematical", "operation", "on", "the", "number", "formats", "it", "using", "either", "ruleSet", "or", "decimalFormat", "and", "inserts", "the", "result", "into", "toInsertInto", "." ]
train
https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/external/icu/android_icu4j/src/main/java/android/icu/text/NFSubstitution.java#L293-L304
fcrepo4/fcrepo4
fcrepo-kernel-modeshape/src/main/java/org/fcrepo/kernel/modeshape/FedoraResourceImpl.java
FedoraResourceImpl.getLastModifiedDate
@Override public Instant getLastModifiedDate() { """ This method gets the last modified date for this FedoraResource. Because the last modified date is managed by fcrepo (not ModeShape) while the created date *is* sometimes managed by ModeShape in the current implementation it's possible that the last modi...
java
@Override public Instant getLastModifiedDate() { final Instant createdDate = getCreatedDate(); try { final long created = createdDate == null ? NO_TIME : createdDate.toEpochMilli(); if (hasProperty(FEDORA_LASTMODIFIED)) { return ofEpochMilli(getTimestamp(FEDO...
[ "@", "Override", "public", "Instant", "getLastModifiedDate", "(", ")", "{", "final", "Instant", "createdDate", "=", "getCreatedDate", "(", ")", ";", "try", "{", "final", "long", "created", "=", "createdDate", "==", "null", "?", "NO_TIME", ":", "createdDate", ...
This method gets the last modified date for this FedoraResource. Because the last modified date is managed by fcrepo (not ModeShape) while the created date *is* sometimes managed by ModeShape in the current implementation it's possible that the last modified date will be before the created date. Instead of making a s...
[ "This", "method", "gets", "the", "last", "modified", "date", "for", "this", "FedoraResource", ".", "Because", "the", "last", "modified", "date", "is", "managed", "by", "fcrepo", "(", "not", "ModeShape", ")", "while", "the", "created", "date", "*", "is", "*...
train
https://github.com/fcrepo4/fcrepo4/blob/7489ad5bc8fb44e2442c93eceb7d97ac54553ab6/fcrepo-kernel-modeshape/src/main/java/org/fcrepo/kernel/modeshape/FedoraResourceImpl.java#L702-L726
igniterealtime/Smack
smack-extensions/src/main/java/org/jivesoftware/smackx/vcardtemp/packet/VCard.java
VCard.setAvatar
public void setAvatar(byte[] bytes, String mimeType) { """ Specify the bytes for the avatar to use as well as the mime type. @param bytes the bytes of the avatar. @param mimeType the mime type of the avatar. """ // If bytes is null, remove the avatar if (bytes == null) { removeA...
java
public void setAvatar(byte[] bytes, String mimeType) { // If bytes is null, remove the avatar if (bytes == null) { removeAvatar(); return; } // Otherwise, add to mappings. String encodedImage = Base64.encodeToString(bytes); setAvatar(encodedImage...
[ "public", "void", "setAvatar", "(", "byte", "[", "]", "bytes", ",", "String", "mimeType", ")", "{", "// If bytes is null, remove the avatar", "if", "(", "bytes", "==", "null", ")", "{", "removeAvatar", "(", ")", ";", "return", ";", "}", "// Otherwise, add to m...
Specify the bytes for the avatar to use as well as the mime type. @param bytes the bytes of the avatar. @param mimeType the mime type of the avatar.
[ "Specify", "the", "bytes", "for", "the", "avatar", "to", "use", "as", "well", "as", "the", "mime", "type", "." ]
train
https://github.com/igniterealtime/Smack/blob/870756997faec1e1bfabfac0cd6c2395b04da873/smack-extensions/src/main/java/org/jivesoftware/smackx/vcardtemp/packet/VCard.java#L402-L413
fcrepo4/fcrepo4
fcrepo-http-commons/src/main/java/org/fcrepo/http/commons/responses/ViewHelpers.java
ViewHelpers.isVersionedNode
public boolean isVersionedNode(final Graph graph, final Node subject) { """ Determines whether the subject is of type memento:Memento. @param graph the graph @param subject the subject @return whether the subject is a versioned node """ return listObjects(graph, subject, RDF.type.asNode()).toList(...
java
public boolean isVersionedNode(final Graph graph, final Node subject) { return listObjects(graph, subject, RDF.type.asNode()).toList().stream().map(Node::getURI) .anyMatch((MEMENTO_TYPE)::equals); }
[ "public", "boolean", "isVersionedNode", "(", "final", "Graph", "graph", ",", "final", "Node", "subject", ")", "{", "return", "listObjects", "(", "graph", ",", "subject", ",", "RDF", ".", "type", ".", "asNode", "(", ")", ")", ".", "toList", "(", ")", "....
Determines whether the subject is of type memento:Memento. @param graph the graph @param subject the subject @return whether the subject is a versioned node
[ "Determines", "whether", "the", "subject", "is", "of", "type", "memento", ":", "Memento", "." ]
train
https://github.com/fcrepo4/fcrepo4/blob/7489ad5bc8fb44e2442c93eceb7d97ac54553ab6/fcrepo-http-commons/src/main/java/org/fcrepo/http/commons/responses/ViewHelpers.java#L213-L216
igniterealtime/Smack
smack-extensions/src/main/java/org/jivesoftware/smackx/xhtmlim/XHTMLText.java
XHTMLText.appendOpenHeaderTag
public XHTMLText appendOpenHeaderTag(int level, String style) { """ Appends a tag that indicates a header, a title of a section of the message. @param level the level of the Header. It must be a value between 1 and 3 @param style the XHTML style of the blockquote @return this. """ if (level > 3 ...
java
public XHTMLText appendOpenHeaderTag(int level, String style) { if (level > 3 || level < 1) { throw new IllegalArgumentException("Level must be between 1 and 3"); } text.halfOpenElement(H + Integer.toString(level)); text.optAttribute(STYLE, style); text.rightAngleBrac...
[ "public", "XHTMLText", "appendOpenHeaderTag", "(", "int", "level", ",", "String", "style", ")", "{", "if", "(", "level", ">", "3", "||", "level", "<", "1", ")", "{", "throw", "new", "IllegalArgumentException", "(", "\"Level must be between 1 and 3\"", ")", ";"...
Appends a tag that indicates a header, a title of a section of the message. @param level the level of the Header. It must be a value between 1 and 3 @param style the XHTML style of the blockquote @return this.
[ "Appends", "a", "tag", "that", "indicates", "a", "header", "a", "title", "of", "a", "section", "of", "the", "message", "." ]
train
https://github.com/igniterealtime/Smack/blob/870756997faec1e1bfabfac0cd6c2395b04da873/smack-extensions/src/main/java/org/jivesoftware/smackx/xhtmlim/XHTMLText.java#L200-L208
googleapis/google-oauth-java-client
google-oauth-client/src/main/java/com/google/api/client/auth/oauth2/AuthorizationCodeFlow.java
AuthorizationCodeFlow.loadCredential
@SuppressWarnings("deprecation") public Credential loadCredential(String userId) throws IOException { """ Loads the credential of the given user ID from the credential store. @param userId user ID or {@code null} if not using a persisted credential store @return credential found in the credential store of th...
java
@SuppressWarnings("deprecation") public Credential loadCredential(String userId) throws IOException { // No requests need to be performed when userId is not specified. if (isNullOrEmpty(userId)) { return null; } if (credentialDataStore == null && credentialStore == null) { return null; ...
[ "@", "SuppressWarnings", "(", "\"deprecation\"", ")", "public", "Credential", "loadCredential", "(", "String", "userId", ")", "throws", "IOException", "{", "// No requests need to be performed when userId is not specified.", "if", "(", "isNullOrEmpty", "(", "userId", ")", ...
Loads the credential of the given user ID from the credential store. @param userId user ID or {@code null} if not using a persisted credential store @return credential found in the credential store of the given user ID or {@code null} for none found
[ "Loads", "the", "credential", "of", "the", "given", "user", "ID", "from", "the", "credential", "store", "." ]
train
https://github.com/googleapis/google-oauth-java-client/blob/7a829f8fd4d216c7d5882a82b9b58930fb375592/google-oauth-client/src/main/java/com/google/api/client/auth/oauth2/AuthorizationCodeFlow.java#L245-L269
Azure/azure-sdk-for-java
batch/data-plane/src/main/java/com/microsoft/azure/batch/protocol/implementation/FilesImpl.java
FilesImpl.listFromTaskAsync
public ServiceFuture<List<NodeFile>> listFromTaskAsync(final String jobId, final String taskId, final Boolean recursive, final FileListFromTaskOptions fileListFromTaskOptions, final ListOperationCallback<NodeFile> serviceCallback) { """ Lists the files in a task's directory on its compute node. @param jobId The...
java
public ServiceFuture<List<NodeFile>> listFromTaskAsync(final String jobId, final String taskId, final Boolean recursive, final FileListFromTaskOptions fileListFromTaskOptions, final ListOperationCallback<NodeFile> serviceCallback) { return AzureServiceFuture.fromHeaderPageResponse( listFromTaskS...
[ "public", "ServiceFuture", "<", "List", "<", "NodeFile", ">", ">", "listFromTaskAsync", "(", "final", "String", "jobId", ",", "final", "String", "taskId", ",", "final", "Boolean", "recursive", ",", "final", "FileListFromTaskOptions", "fileListFromTaskOptions", ",", ...
Lists the files in a task's directory on its compute node. @param jobId The ID of the job that contains the task. @param taskId The ID of the task whose files you want to list. @param recursive Whether to list children of the task directory. This parameter can be used in combination with the filter parameter to list s...
[ "Lists", "the", "files", "in", "a", "task", "s", "directory", "on", "its", "compute", "node", "." ]
train
https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/batch/data-plane/src/main/java/com/microsoft/azure/batch/protocol/implementation/FilesImpl.java#L1764-L1781
stripe/stripe-android
stripe/src/main/java/com/stripe/android/view/CardInputWidget.java
CardInputWidget.getCard
@Nullable public Card getCard() { """ Gets a {@link Card} object from the user input, if all fields are valid. If not, returns {@code null}. @return a valid {@link Card} object based on user input, or {@code null} if any field is invalid """ String cardNumber = mCardNumberEditText.getCardNumbe...
java
@Nullable public Card getCard() { String cardNumber = mCardNumberEditText.getCardNumber(); int[] cardDate = mExpiryDateEditText.getValidDateFields(); if (cardNumber == null || cardDate == null || cardDate.length != 2) { return null; } // CVC/CVV is the only field...
[ "@", "Nullable", "public", "Card", "getCard", "(", ")", "{", "String", "cardNumber", "=", "mCardNumberEditText", ".", "getCardNumber", "(", ")", ";", "int", "[", "]", "cardDate", "=", "mExpiryDateEditText", ".", "getValidDateFields", "(", ")", ";", "if", "("...
Gets a {@link Card} object from the user input, if all fields are valid. If not, returns {@code null}. @return a valid {@link Card} object based on user input, or {@code null} if any field is invalid
[ "Gets", "a", "{", "@link", "Card", "}", "object", "from", "the", "user", "input", "if", "all", "fields", "are", "valid", ".", "If", "not", "returns", "{", "@code", "null", "}", "." ]
train
https://github.com/stripe/stripe-android/blob/0f199255f3769a3b84583fe3ace47bfae8c3b1c8/stripe/src/main/java/com/stripe/android/view/CardInputWidget.java#L116-L132