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
DataSketches/sketches-core
src/main/java/com/yahoo/sketches/ByteArrayUtil.java
ByteArrayUtil.putDoubleLE
public static void putDoubleLE(final byte[] array, final int offset, final double value) { """ Put the source <i>double</i> into the destination byte array starting at the given offset in little endian order. There is no bounds checking. @param array destination byte array @param offset destination offset @pa...
java
public static void putDoubleLE(final byte[] array, final int offset, final double value) { putLongLE(array, offset, Double.doubleToRawLongBits(value)); }
[ "public", "static", "void", "putDoubleLE", "(", "final", "byte", "[", "]", "array", ",", "final", "int", "offset", ",", "final", "double", "value", ")", "{", "putLongLE", "(", "array", ",", "offset", ",", "Double", ".", "doubleToRawLongBits", "(", "value",...
Put the source <i>double</i> into the destination byte array starting at the given offset in little endian order. There is no bounds checking. @param array destination byte array @param offset destination offset @param value source <i>double</i>
[ "Put", "the", "source", "<i", ">", "double<", "/", "i", ">", "into", "the", "destination", "byte", "array", "starting", "at", "the", "given", "offset", "in", "little", "endian", "order", ".", "There", "is", "no", "bounds", "checking", "." ]
train
https://github.com/DataSketches/sketches-core/blob/900c8c9668a1e2f1d54d453e956caad54702e540/src/main/java/com/yahoo/sketches/ByteArrayUtil.java#L261-L263
kite-sdk/kite
kite-data/kite-data-core/src/main/java/org/kitesdk/data/spi/filesystem/FileSystemMetadataProvider.java
FileSystemMetadataProvider.checkExists
private static void checkExists(FileSystem fs, Path location) { """ Precondition-style static validation that a dataset exists @param fs A FileSystem where the metadata should be stored @param location The Path where the metadata should be stored @throws org.kitesdk.data.DatasetNotFoundException if th...
java
private static void checkExists(FileSystem fs, Path location) { try { if (!fs.exists(location)) { throw new DatasetNotFoundException( "Descriptor location does not exist: " + location); } } catch (IOException ex) { throw new DatasetIOException( "Cannot access desc...
[ "private", "static", "void", "checkExists", "(", "FileSystem", "fs", ",", "Path", "location", ")", "{", "try", "{", "if", "(", "!", "fs", ".", "exists", "(", "location", ")", ")", "{", "throw", "new", "DatasetNotFoundException", "(", "\"Descriptor location d...
Precondition-style static validation that a dataset exists @param fs A FileSystem where the metadata should be stored @param location The Path where the metadata should be stored @throws org.kitesdk.data.DatasetNotFoundException if the descriptor location is missing @throws org.kitesdk.data.DatasetIOException ...
[ "Precondition", "-", "style", "static", "validation", "that", "a", "dataset", "exists" ]
train
https://github.com/kite-sdk/kite/blob/72bfb4b1a881af85808cd7f14bc3e15160a1e811/kite-data/kite-data-core/src/main/java/org/kitesdk/data/spi/filesystem/FileSystemMetadataProvider.java#L575-L585
Carbonado/Carbonado
src/main/java/com/amazon/carbonado/raw/DataDecoder.java
DataDecoder.decodeSingle
public static byte[] decodeSingle(byte[] src, int prefixPadding, int suffixPadding) throws CorruptEncodingException { """ Decodes the given byte array which was encoded by {@link DataEncoder#encodeSingle}. Always returns a new byte array instance. @param prefixPadding amount of extra bytes to skip fro...
java
public static byte[] decodeSingle(byte[] src, int prefixPadding, int suffixPadding) throws CorruptEncodingException { try { int length = src.length - suffixPadding - prefixPadding; if (length == 0) { return EMPTY_BYTE_ARRAY; } i...
[ "public", "static", "byte", "[", "]", "decodeSingle", "(", "byte", "[", "]", "src", ",", "int", "prefixPadding", ",", "int", "suffixPadding", ")", "throws", "CorruptEncodingException", "{", "try", "{", "int", "length", "=", "src", ".", "length", "-", "suff...
Decodes the given byte array which was encoded by {@link DataEncoder#encodeSingle}. Always returns a new byte array instance. @param prefixPadding amount of extra bytes to skip from start of encoded byte array @param suffixPadding amount of extra bytes to skip at end of encoded byte array
[ "Decodes", "the", "given", "byte", "array", "which", "was", "encoded", "by", "{", "@link", "DataEncoder#encodeSingle", "}", ".", "Always", "returns", "a", "new", "byte", "array", "instance", "." ]
train
https://github.com/Carbonado/Carbonado/blob/eee29b365a61c8f03e1a1dc6bed0692e6b04b1db/src/main/java/com/amazon/carbonado/raw/DataDecoder.java#L666-L684
spring-projects/spring-android
spring-android-core/src/main/java/org/springframework/util/ReflectionUtils.java
ReflectionUtils.doWithFields
public static void doWithFields(Class<?> clazz, FieldCallback fc, FieldFilter ff) throws IllegalArgumentException { """ Invoke the given callback on all fields in the target class, going up the class hierarchy to get all declared fields. @param clazz the target class to analyze @param fc the callback to invo...
java
public static void doWithFields(Class<?> clazz, FieldCallback fc, FieldFilter ff) throws IllegalArgumentException { // Keep backing up the inheritance hierarchy. Class<?> targetClass = clazz; do { Field[] fields = targetClass.getDeclaredFields(); for (Field field : fields) { // Skip static and final...
[ "public", "static", "void", "doWithFields", "(", "Class", "<", "?", ">", "clazz", ",", "FieldCallback", "fc", ",", "FieldFilter", "ff", ")", "throws", "IllegalArgumentException", "{", "// Keep backing up the inheritance hierarchy.", "Class", "<", "?", ">", "targetCl...
Invoke the given callback on all fields in the target class, going up the class hierarchy to get all declared fields. @param clazz the target class to analyze @param fc the callback to invoke for each field @param ff the filter that determines the fields to apply the callback to
[ "Invoke", "the", "given", "callback", "on", "all", "fields", "in", "the", "target", "class", "going", "up", "the", "class", "hierarchy", "to", "get", "all", "declared", "fields", "." ]
train
https://github.com/spring-projects/spring-android/blob/941296e152d49a40e0745a3e81628a974f72b7e4/spring-android-core/src/main/java/org/springframework/util/ReflectionUtils.java#L567-L589
attribyte/wpdb
src/main/java/org/attribyte/wp/db/DB.java
DB.clearPostTerms
public void clearPostTerms(final long postId, final String taxonomy) throws SQLException { """ Clears all terms associated with a post with a specified taxonomy. @param postId The post id. @param taxonomy The taxonomy. @throws SQLException on database error. """ List<TaxonomyTerm> terms = selectPostTe...
java
public void clearPostTerms(final long postId, final String taxonomy) throws SQLException { List<TaxonomyTerm> terms = selectPostTerms(postId, taxonomy); for(TaxonomyTerm term : terms) { clearPostTerm(postId, term.id); } }
[ "public", "void", "clearPostTerms", "(", "final", "long", "postId", ",", "final", "String", "taxonomy", ")", "throws", "SQLException", "{", "List", "<", "TaxonomyTerm", ">", "terms", "=", "selectPostTerms", "(", "postId", ",", "taxonomy", ")", ";", "for", "(...
Clears all terms associated with a post with a specified taxonomy. @param postId The post id. @param taxonomy The taxonomy. @throws SQLException on database error.
[ "Clears", "all", "terms", "associated", "with", "a", "post", "with", "a", "specified", "taxonomy", "." ]
train
https://github.com/attribyte/wpdb/blob/b9adf6131dfb67899ebff770c9bfeb001cc42f30/src/main/java/org/attribyte/wp/db/DB.java#L2512-L2517
couchbase/couchbase-java-client
src/main/java/com/couchbase/client/java/query/dsl/functions/PatternMatchingFunctions.java
PatternMatchingFunctions.regexpPosition
public static Expression regexpPosition(Expression expression, String pattern) { """ Returned expression results in the first position of the regular expression pattern within the string, or -1. """ return x("REGEXP_POSITION(" + expression.toString() + ", \"" + pattern + "\")"); }
java
public static Expression regexpPosition(Expression expression, String pattern) { return x("REGEXP_POSITION(" + expression.toString() + ", \"" + pattern + "\")"); }
[ "public", "static", "Expression", "regexpPosition", "(", "Expression", "expression", ",", "String", "pattern", ")", "{", "return", "x", "(", "\"REGEXP_POSITION(\"", "+", "expression", ".", "toString", "(", ")", "+", "\", \\\"\"", "+", "pattern", "+", "\"\\\")\""...
Returned expression results in the first position of the regular expression pattern within the string, or -1.
[ "Returned", "expression", "results", "in", "the", "first", "position", "of", "the", "regular", "expression", "pattern", "within", "the", "string", "or", "-", "1", "." ]
train
https://github.com/couchbase/couchbase-java-client/blob/f36a0ee0c66923bdde47838ca543e50cbaa99e14/src/main/java/com/couchbase/client/java/query/dsl/functions/PatternMatchingFunctions.java#L70-L72
cloudant/java-cloudant
cloudant-client/src/main/java/com/cloudant/client/api/Replication.java
Replication.queryParams
public Replication queryParams(Map<String, Object> queryParams) { """ Specify additional query parameters to be passed to the filter function. @param queryParams map of key-value parameters @return this Replication instance to set more options or trigger the replication """ this.replication = repl...
java
public Replication queryParams(Map<String, Object> queryParams) { this.replication = replication.queryParams(queryParams); return this; }
[ "public", "Replication", "queryParams", "(", "Map", "<", "String", ",", "Object", ">", "queryParams", ")", "{", "this", ".", "replication", "=", "replication", ".", "queryParams", "(", "queryParams", ")", ";", "return", "this", ";", "}" ]
Specify additional query parameters to be passed to the filter function. @param queryParams map of key-value parameters @return this Replication instance to set more options or trigger the replication
[ "Specify", "additional", "query", "parameters", "to", "be", "passed", "to", "the", "filter", "function", "." ]
train
https://github.com/cloudant/java-cloudant/blob/42c438654945361bded2cc0827afc046d535b31b/cloudant-client/src/main/java/com/cloudant/client/api/Replication.java#L131-L134
Azure/azure-sdk-for-java
compute/resource-manager/v2017_12_01/src/main/java/com/microsoft/azure/management/compute/v2017_12_01/implementation/VirtualMachineExtensionImagesInner.java
VirtualMachineExtensionImagesInner.listVersionsAsync
public Observable<List<VirtualMachineExtensionImageInner>> listVersionsAsync(String location, String publisherName, String type) { """ Gets a list of virtual machine extension image versions. @param location The name of a supported Azure region. @param publisherName the String value @param type the String val...
java
public Observable<List<VirtualMachineExtensionImageInner>> listVersionsAsync(String location, String publisherName, String type) { return listVersionsWithServiceResponseAsync(location, publisherName, type).map(new Func1<ServiceResponse<List<VirtualMachineExtensionImageInner>>, List<VirtualMachineExtensionImageI...
[ "public", "Observable", "<", "List", "<", "VirtualMachineExtensionImageInner", ">", ">", "listVersionsAsync", "(", "String", "location", ",", "String", "publisherName", ",", "String", "type", ")", "{", "return", "listVersionsWithServiceResponseAsync", "(", "location", ...
Gets a list of virtual machine extension image versions. @param location The name of a supported Azure region. @param publisherName the String value @param type the String value @throws IllegalArgumentException thrown if parameters fail the validation @return the observable to the List&lt;VirtualMachineExtensionImageI...
[ "Gets", "a", "list", "of", "virtual", "machine", "extension", "image", "versions", "." ]
train
https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/compute/resource-manager/v2017_12_01/src/main/java/com/microsoft/azure/management/compute/v2017_12_01/implementation/VirtualMachineExtensionImagesInner.java#L293-L300
jmxtrans/embedded-jmxtrans
src/main/java/org/jmxtrans/embedded/util/jmx/JmxUtils2.java
JmxUtils2.registerObject
@Nullable public static ObjectName registerObject(Object object, String objectName, MBeanServer mbeanServer) { """ Try to register given <code>object</code> with <code>objectName</code>. If registration fails, a {@link Logger#warn(String)} message is emitted and <code>null</code> is returned. @param obje...
java
@Nullable public static ObjectName registerObject(Object object, String objectName, MBeanServer mbeanServer) { try { return mbeanServer.registerMBean(object, new ObjectName(objectName)).getObjectName(); } catch (Exception e) { logger.warn("Failure to register {}:{}", objectNa...
[ "@", "Nullable", "public", "static", "ObjectName", "registerObject", "(", "Object", "object", ",", "String", "objectName", ",", "MBeanServer", "mbeanServer", ")", "{", "try", "{", "return", "mbeanServer", ".", "registerMBean", "(", "object", ",", "new", "ObjectN...
Try to register given <code>object</code> with <code>objectName</code>. If registration fails, a {@link Logger#warn(String)} message is emitted and <code>null</code> is returned. @param object @param objectName @param mbeanServer @return the ObjectName of the registered object or <code>null</code> if registration fai...
[ "Try", "to", "register", "given", "<code", ">", "object<", "/", "code", ">", "with", "<code", ">", "objectName<", "/", "code", ">", "." ]
train
https://github.com/jmxtrans/embedded-jmxtrans/blob/17224389e7d8323284cabc2a5167fc03bed6d223/src/main/java/org/jmxtrans/embedded/util/jmx/JmxUtils2.java#L55-L63
spockframework/spock
spock-core/src/main/java/org/spockframework/compiler/AstUtil.java
AstUtil.toArgumentArray
public static Expression toArgumentArray(List<Expression> argList, IRewriteResources resources) { """ Turns an argument list obtained from AstUtil.getArguments() into an Object[] array suitable to be passed to InvokerHelper or SpockRuntime. The main challenge is to handle SpreadExpression's correctly. """ ...
java
public static Expression toArgumentArray(List<Expression> argList, IRewriteResources resources) { List<Expression> normalArgs = new ArrayList<>(); List<Expression> spreadArgs = new ArrayList<>(); List<Expression> spreadPositions = new ArrayList<>(); for (int i = 0; i < argList.size(); i++) { Expr...
[ "public", "static", "Expression", "toArgumentArray", "(", "List", "<", "Expression", ">", "argList", ",", "IRewriteResources", "resources", ")", "{", "List", "<", "Expression", ">", "normalArgs", "=", "new", "ArrayList", "<>", "(", ")", ";", "List", "<", "Ex...
Turns an argument list obtained from AstUtil.getArguments() into an Object[] array suitable to be passed to InvokerHelper or SpockRuntime. The main challenge is to handle SpreadExpression's correctly.
[ "Turns", "an", "argument", "list", "obtained", "from", "AstUtil", ".", "getArguments", "()", "into", "an", "Object", "[]", "array", "suitable", "to", "be", "passed", "to", "InvokerHelper", "or", "SpockRuntime", ".", "The", "main", "challenge", "is", "to", "h...
train
https://github.com/spockframework/spock/blob/d751a0abd8d5a2ec5338aa10bc2d19371b3b3ad9/spock-core/src/main/java/org/spockframework/compiler/AstUtil.java#L210-L236
pgjdbc/pgjdbc
pgjdbc/src/main/java/org/postgresql/copy/CopyManager.java
CopyManager.copyIn
public long copyIn(final String sql, InputStream from, int bufferSize) throws SQLException, IOException { """ Use COPY FROM STDIN for very fast copying from an InputStream into a database table. @param sql COPY FROM STDIN statement @param from a CSV file or such @param bufferSize number of bytes to buff...
java
public long copyIn(final String sql, InputStream from, int bufferSize) throws SQLException, IOException { byte[] buf = new byte[bufferSize]; int len; CopyIn cp = copyIn(sql); try { while ((len = from.read(buf)) >= 0) { if (len > 0) { cp.writeToCopy(buf, 0, len); } ...
[ "public", "long", "copyIn", "(", "final", "String", "sql", ",", "InputStream", "from", ",", "int", "bufferSize", ")", "throws", "SQLException", ",", "IOException", "{", "byte", "[", "]", "buf", "=", "new", "byte", "[", "bufferSize", "]", ";", "int", "len...
Use COPY FROM STDIN for very fast copying from an InputStream into a database table. @param sql COPY FROM STDIN statement @param from a CSV file or such @param bufferSize number of bytes to buffer and push over network to server at once @return number of rows updated for server 8.2 or newer; -1 for older @throws SQLEx...
[ "Use", "COPY", "FROM", "STDIN", "for", "very", "fast", "copying", "from", "an", "InputStream", "into", "a", "database", "table", "." ]
train
https://github.com/pgjdbc/pgjdbc/blob/95ba7b261e39754674c5817695ae5ebf9a341fae/pgjdbc/src/main/java/org/postgresql/copy/CopyManager.java#L212-L229
SeaCloudsEU/SeaCloudsPlatform
sla/sla-core/sla-service/src/main/java/eu/atos/sla/service/rest/ProviderRest.java
ProviderRest.getProviderByUuid
@GET @Path(" { """ Gets the information of an specific provider If the provider it is not in the database, it returns 404 with empty payload <pre> GET /providers/{uuid} Request: GET /providers HTTP/1.1 Response: {@code <?xml version="1.0" encoding="UTF-8"?> <provider> <uuid>fc923960-03fe-41eb...
java
@GET @Path("{uuid}") @Produces(MediaType.APPLICATION_XML) public Response getProviderByUuid(@PathParam("uuid") String provider_uuid) throws IOException, JAXBException { logger.debug("StartOf getProviderByUuid - REQUEST for /providers/" + provider_uuid); try { Provide...
[ "@", "GET", "@", "Path", "(", "\"{uuid}\"", ")", "@", "Produces", "(", "MediaType", ".", "APPLICATION_XML", ")", "public", "Response", "getProviderByUuid", "(", "@", "PathParam", "(", "\"uuid\"", ")", "String", "provider_uuid", ")", "throws", "IOException", ",...
Gets the information of an specific provider If the provider it is not in the database, it returns 404 with empty payload <pre> GET /providers/{uuid} Request: GET /providers HTTP/1.1 Response: {@code <?xml version="1.0" encoding="UTF-8"?> <provider> <uuid>fc923960-03fe-41eb-8a21-a56709f9370f</uuid> <name>provider-p...
[ "Gets", "the", "information", "of", "an", "specific", "provider", "If", "the", "provider", "it", "is", "not", "in", "the", "database", "it", "returns", "404", "with", "empty", "payload" ]
train
https://github.com/SeaCloudsEU/SeaCloudsPlatform/blob/b199fe6de2c63b808cb248d3aca947d802375df8/sla/sla-core/sla-service/src/main/java/eu/atos/sla/service/rest/ProviderRest.java#L147-L171
aws/aws-sdk-java
aws-java-sdk-ssm/src/main/java/com/amazonaws/services/simplesystemsmanagement/model/StepExecution.java
StepExecution.withOverriddenParameters
public StepExecution withOverriddenParameters(java.util.Map<String, java.util.List<String>> overriddenParameters) { """ <p> A user-specified list of parameters to override when running a step. </p> @param overriddenParameters A user-specified list of parameters to override when running a step. @return Retur...
java
public StepExecution withOverriddenParameters(java.util.Map<String, java.util.List<String>> overriddenParameters) { setOverriddenParameters(overriddenParameters); return this; }
[ "public", "StepExecution", "withOverriddenParameters", "(", "java", ".", "util", ".", "Map", "<", "String", ",", "java", ".", "util", ".", "List", "<", "String", ">", ">", "overriddenParameters", ")", "{", "setOverriddenParameters", "(", "overriddenParameters", ...
<p> A user-specified list of parameters to override when running a step. </p> @param overriddenParameters A user-specified list of parameters to override when running a step. @return Returns a reference to this object so that method calls can be chained together.
[ "<p", ">", "A", "user", "-", "specified", "list", "of", "parameters", "to", "override", "when", "running", "a", "step", ".", "<", "/", "p", ">" ]
train
https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-ssm/src/main/java/com/amazonaws/services/simplesystemsmanagement/model/StepExecution.java#L901-L904
dlew/joda-time-android
library/src/main/java/net/danlew/android/joda/DateUtils.java
DateUtils.getRelativeTimeSpanString
public static CharSequence getRelativeTimeSpanString(Context ctx, ReadableInstant time, boolean withPreposition) { """ Returns a relative time string to display the time expressed by millis. See {@link android.text.format.DateUtils#getRelativeTimeSpanString} for full docs. @param withPreposition If true, the...
java
public static CharSequence getRelativeTimeSpanString(Context ctx, ReadableInstant time, boolean withPreposition) { String result; LocalDate now = LocalDate.now(); LocalDate timeDate = new LocalDate(time); int prepositionId; if (Days.daysBetween(now, timeDate).getDays() == 0) { ...
[ "public", "static", "CharSequence", "getRelativeTimeSpanString", "(", "Context", "ctx", ",", "ReadableInstant", "time", ",", "boolean", "withPreposition", ")", "{", "String", "result", ";", "LocalDate", "now", "=", "LocalDate", ".", "now", "(", ")", ";", "LocalD...
Returns a relative time string to display the time expressed by millis. See {@link android.text.format.DateUtils#getRelativeTimeSpanString} for full docs. @param withPreposition If true, the string returned will include the correct preposition ("at 9:20am", "on 10/12/2008" or "on May 29").
[ "Returns", "a", "relative", "time", "string", "to", "display", "the", "time", "expressed", "by", "millis", "." ]
train
https://github.com/dlew/joda-time-android/blob/5bf96f6ef4ea63ee91e73e1e528896fa00108dec/library/src/main/java/net/danlew/android/joda/DateUtils.java#L363-L395
jfinal/jfinal
src/main/java/com/jfinal/captcha/CaptchaRender.java
CaptchaRender.validate
public static boolean validate(String captchaKey, String userInputString) { """ 校验用户输入的验证码是否正确 @param captchaKey 验证码 key,在不支持 cookie 的情况下可通过传参给服务端 @param userInputString 用户输入的字符串 @return 验证通过返回 true, 否则返回 false """ ICaptchaCache captchaCache = CaptchaManager.me().getCaptchaCache(); Captcha captcha = c...
java
public static boolean validate(String captchaKey, String userInputString) { ICaptchaCache captchaCache = CaptchaManager.me().getCaptchaCache(); Captcha captcha = captchaCache.get(captchaKey); if (captcha != null && captcha.notExpired() && captcha.getValue().equalsIgnoreCase(userInputString)) { captchaCache...
[ "public", "static", "boolean", "validate", "(", "String", "captchaKey", ",", "String", "userInputString", ")", "{", "ICaptchaCache", "captchaCache", "=", "CaptchaManager", ".", "me", "(", ")", ".", "getCaptchaCache", "(", ")", ";", "Captcha", "captcha", "=", "...
校验用户输入的验证码是否正确 @param captchaKey 验证码 key,在不支持 cookie 的情况下可通过传参给服务端 @param userInputString 用户输入的字符串 @return 验证通过返回 true, 否则返回 false
[ "校验用户输入的验证码是否正确" ]
train
https://github.com/jfinal/jfinal/blob/fc07f0f5d56e85ccd3cfcdd587b56b8dd9c663e9/src/main/java/com/jfinal/captcha/CaptchaRender.java#L233-L241
VoltDB/voltdb
src/frontend/org/voltdb/TheHashinator.java
TheHashinator.getHashinator
public static TheHashinator getHashinator(Class<? extends TheHashinator> hashinatorImplementation, byte config[], boolean cooked) { """ Get TheHashinator instanced based on known implementation and configuration. Used by client after asking server what it is running. @param hashinatorImplementation...
java
public static TheHashinator getHashinator(Class<? extends TheHashinator> hashinatorImplementation, byte config[], boolean cooked) { return constructHashinator(hashinatorImplementation, config, cooked); }
[ "public", "static", "TheHashinator", "getHashinator", "(", "Class", "<", "?", "extends", "TheHashinator", ">", "hashinatorImplementation", ",", "byte", "config", "[", "]", ",", "boolean", "cooked", ")", "{", "return", "constructHashinator", "(", "hashinatorImplement...
Get TheHashinator instanced based on known implementation and configuration. Used by client after asking server what it is running. @param hashinatorImplementation @param config @return
[ "Get", "TheHashinator", "instanced", "based", "on", "known", "implementation", "and", "configuration", ".", "Used", "by", "client", "after", "asking", "server", "what", "it", "is", "running", "." ]
train
https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/src/frontend/org/voltdb/TheHashinator.java#L129-L132
box/box-java-sdk
src/main/java/com/box/sdk/BoxWebHookSignatureVerifier.java
BoxWebHookSignatureVerifier.signRaw
private byte[] signRaw(BoxSignatureAlgorithm algorithm, String key, String webHookPayload, String deliveryTimestamp) { """ Calculates signature for a provided information. @param algorithm for which algorithm @param key used by signing @param webHookPayload for singing @param deliveryTimestamp...
java
private byte[] signRaw(BoxSignatureAlgorithm algorithm, String key, String webHookPayload, String deliveryTimestamp) { Mac mac = MAC_POOL.acquire(algorithm.javaProviderName); try { mac.init(new SecretKeySpec(key.getBytes(UTF_8), algorithm.javaProviderName)); mac.updat...
[ "private", "byte", "[", "]", "signRaw", "(", "BoxSignatureAlgorithm", "algorithm", ",", "String", "key", ",", "String", "webHookPayload", ",", "String", "deliveryTimestamp", ")", "{", "Mac", "mac", "=", "MAC_POOL", ".", "acquire", "(", "algorithm", ".", "javaP...
Calculates signature for a provided information. @param algorithm for which algorithm @param key used by signing @param webHookPayload for singing @param deliveryTimestamp for signing @return calculated signature
[ "Calculates", "signature", "for", "a", "provided", "information", "." ]
train
https://github.com/box/box-java-sdk/blob/35b4ba69417f9d6a002c19dfaab57527750ef349/src/main/java/com/box/sdk/BoxWebHookSignatureVerifier.java#L180-L193
ow2-chameleon/fuchsia
bases/knx/calimero/src/main/java/tuwien/auto/calimero/dptxlator/TranslatorTypes.java
TranslatorTypes.createTranslator
public static DPTXlator createTranslator(DPT dpt) throws KNXException { """ Creates a DPT translator for the given datapoint type. <p> The translation behavior of a DPT translator instance is uniquely defined by the supplied datapoint type. <p> If translator creation according {@link #createTranslator(int, St...
java
public static DPTXlator createTranslator(DPT dpt) throws KNXException { try { return createTranslator(0, dpt.getID()); } catch (final KNXException e) { for (final Iterator i = map.values().iterator(); i.hasNext(); ) try { return ((MainType) i.next()).createTranslator(dpt); } catc...
[ "public", "static", "DPTXlator", "createTranslator", "(", "DPT", "dpt", ")", "throws", "KNXException", "{", "try", "{", "return", "createTranslator", "(", "0", ",", "dpt", ".", "getID", "(", ")", ")", ";", "}", "catch", "(", "final", "KNXException", "e", ...
Creates a DPT translator for the given datapoint type. <p> The translation behavior of a DPT translator instance is uniquely defined by the supplied datapoint type. <p> If translator creation according {@link #createTranslator(int, String)} fails, all available main types are enumerated to find an appropriate translato...
[ "Creates", "a", "DPT", "translator", "for", "the", "given", "datapoint", "type", ".", "<p", ">", "The", "translation", "behavior", "of", "a", "DPT", "translator", "instance", "is", "uniquely", "defined", "by", "the", "supplied", "datapoint", "type", ".", "<p...
train
https://github.com/ow2-chameleon/fuchsia/blob/4e9318eadbdeb945e529789f573b45386e619bed/bases/knx/calimero/src/main/java/tuwien/auto/calimero/dptxlator/TranslatorTypes.java#L486-L499
infinispan/infinispan
core/src/main/java/org/infinispan/cache/impl/CacheImpl.java
CacheImpl.executeCommandAsyncWithInjectedTx
private <T> CompletableFuture<T> executeCommandAsyncWithInjectedTx(InvocationContext ctx, VisitableCommand command) { """ The asynchronous method of {@link #executeCommandWithInjectedTx(InvocationContext, VisitableCommand)} """ CompletableFuture<T> cf; final Transaction implicitTransaction; t...
java
private <T> CompletableFuture<T> executeCommandAsyncWithInjectedTx(InvocationContext ctx, VisitableCommand command) { CompletableFuture<T> cf; final Transaction implicitTransaction; try { // interceptors must not access thread-local transaction anyway implicitTransaction = transactio...
[ "private", "<", "T", ">", "CompletableFuture", "<", "T", ">", "executeCommandAsyncWithInjectedTx", "(", "InvocationContext", "ctx", ",", "VisitableCommand", "command", ")", "{", "CompletableFuture", "<", "T", ">", "cf", ";", "final", "Transaction", "implicitTransact...
The asynchronous method of {@link #executeCommandWithInjectedTx(InvocationContext, VisitableCommand)}
[ "The", "asynchronous", "method", "of", "{" ]
train
https://github.com/infinispan/infinispan/blob/7c62b94886c3febb4774ae8376acf2baa0265ab5/core/src/main/java/org/infinispan/cache/impl/CacheImpl.java#L1952-L1985
michael-rapp/AndroidUtil
library/src/main/java/de/mrapp/android/util/view/HeaderAndFooterGridView.java
HeaderAndFooterGridView.getViewHeight
protected final int getViewHeight(@NonNull final ListAdapter adapter, final int position) { """ Returns the height of the view, which corresponds to a specific position of an adapter. @param adapter The adapter as an instance of the type {@link ListAdapter}. The adapter may not be null @param position The p...
java
protected final int getViewHeight(@NonNull final ListAdapter adapter, final int position) { View view = adapter.getView(position, null, this); LayoutParams layoutParams = (LayoutParams) view.getLayoutParams(); if (layoutParams == null) { layoutParams = new LayoutParams(LayoutParams....
[ "protected", "final", "int", "getViewHeight", "(", "@", "NonNull", "final", "ListAdapter", "adapter", ",", "final", "int", "position", ")", "{", "View", "view", "=", "adapter", ".", "getView", "(", "position", ",", "null", ",", "this", ")", ";", "LayoutPar...
Returns the height of the view, which corresponds to a specific position of an adapter. @param adapter The adapter as an instance of the type {@link ListAdapter}. The adapter may not be null @param position The position of the view, whose height should be returned, as an {@link Integer} value @return The height of the...
[ "Returns", "the", "height", "of", "the", "view", "which", "corresponds", "to", "a", "specific", "position", "of", "an", "adapter", "." ]
train
https://github.com/michael-rapp/AndroidUtil/blob/67ec0e5732344eeb4d946dd1f96d782939e449f4/library/src/main/java/de/mrapp/android/util/view/HeaderAndFooterGridView.java#L387-L404
TheCoder4eu/BootsFaces-OSP
src/main/java/net/bootsfaces/component/panelGrid/PanelGridRenderer.java
PanelGridRenderer.generateColumnStart
protected void generateColumnStart(UIComponent child, String colStyleClass, ResponseWriter writer) throws IOException { """ Generates the start of each Bootstrap column. @param child the child component to be drawn within the column. @param colStyleClass the current CSS style class @param writer the curren...
java
protected void generateColumnStart(UIComponent child, String colStyleClass, ResponseWriter writer) throws IOException { writer.startElement("div", child); writer.writeAttribute("class", colStyleClass, "class"); }
[ "protected", "void", "generateColumnStart", "(", "UIComponent", "child", ",", "String", "colStyleClass", ",", "ResponseWriter", "writer", ")", "throws", "IOException", "{", "writer", ".", "startElement", "(", "\"div\"", ",", "child", ")", ";", "writer", ".", "wr...
Generates the start of each Bootstrap column. @param child the child component to be drawn within the column. @param colStyleClass the current CSS style class @param writer the current response writer. @throws IOException if something's wrong with the response writer.
[ "Generates", "the", "start", "of", "each", "Bootstrap", "column", "." ]
train
https://github.com/TheCoder4eu/BootsFaces-OSP/blob/d1a70952bc240979b5272fa4fe1c7f100873add0/src/main/java/net/bootsfaces/component/panelGrid/PanelGridRenderer.java#L271-L274
Azure/azure-sdk-for-java
cognitiveservices/data-plane/language/luis/authoring/src/main/java/com/microsoft/azure/cognitiveservices/language/luis/authoring/implementation/ModelsImpl.java
ModelsImpl.deleteCompositeEntity
public OperationStatus deleteCompositeEntity(UUID appId, String versionId, UUID cEntityId) { """ Deletes a composite entity extractor from the application. @param appId The application ID. @param versionId The version ID. @param cEntityId The composite entity extractor ID. @throws IllegalArgumentException th...
java
public OperationStatus deleteCompositeEntity(UUID appId, String versionId, UUID cEntityId) { return deleteCompositeEntityWithServiceResponseAsync(appId, versionId, cEntityId).toBlocking().single().body(); }
[ "public", "OperationStatus", "deleteCompositeEntity", "(", "UUID", "appId", ",", "String", "versionId", ",", "UUID", "cEntityId", ")", "{", "return", "deleteCompositeEntityWithServiceResponseAsync", "(", "appId", ",", "versionId", ",", "cEntityId", ")", ".", "toBlocki...
Deletes a composite entity extractor from the application. @param appId The application ID. @param versionId The version ID. @param cEntityId The composite entity extractor ID. @throws IllegalArgumentException thrown if parameters fail the validation @throws ErrorResponseException thrown if the request is rejected by ...
[ "Deletes", "a", "composite", "entity", "extractor", "from", "the", "application", "." ]
train
https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/cognitiveservices/data-plane/language/luis/authoring/src/main/java/com/microsoft/azure/cognitiveservices/language/luis/authoring/implementation/ModelsImpl.java#L4127-L4129
j256/ormlite-core
src/main/java/com/j256/ormlite/misc/TransactionManager.java
TransactionManager.callInTransaction
public <T> T callInTransaction(String tableName, final Callable<T> callable) throws SQLException { """ Same as {@link #callInTransaction(Callable)} except as a this has a table-name specified. <p> WARNING: it is up to you to properly synchronize around this method if multiple threads are using a connection-so...
java
public <T> T callInTransaction(String tableName, final Callable<T> callable) throws SQLException { return callInTransaction(tableName, connectionSource, callable); }
[ "public", "<", "T", ">", "T", "callInTransaction", "(", "String", "tableName", ",", "final", "Callable", "<", "T", ">", "callable", ")", "throws", "SQLException", "{", "return", "callInTransaction", "(", "tableName", ",", "connectionSource", ",", "callable", "...
Same as {@link #callInTransaction(Callable)} except as a this has a table-name specified. <p> WARNING: it is up to you to properly synchronize around this method if multiple threads are using a connection-source which works gives out a single-connection. The reason why this is necessary is that multiple operations are...
[ "Same", "as", "{", "@link", "#callInTransaction", "(", "Callable", ")", "}", "except", "as", "a", "this", "has", "a", "table", "-", "name", "specified", "." ]
train
https://github.com/j256/ormlite-core/blob/154d85bbb9614a0ea65a012251257831fb4fba21/src/main/java/com/j256/ormlite/misc/TransactionManager.java#L142-L144
nguillaumin/slick2d-maven
slick2d-hiero/src/main/java/org/newdawn/slick/tools/hiero/truetype/TTFSubSetFile.java
TTFSubSetFile.writeUShort
private void writeUShort(int pos, int s) { """ Appends a USHORT to the output array, at the given position without changing currentPos @param pos The position to write to @param s The short to be written """ byte b1 = (byte)((s >> 8) & 0xff); byte b2 = (byte)(s & 0xff); output[pos]...
java
private void writeUShort(int pos, int s) { byte b1 = (byte)((s >> 8) & 0xff); byte b2 = (byte)(s & 0xff); output[pos] = b1; output[pos + 1] = b2; }
[ "private", "void", "writeUShort", "(", "int", "pos", ",", "int", "s", ")", "{", "byte", "b1", "=", "(", "byte", ")", "(", "(", "s", ">>", "8", ")", "&", "0xff", ")", ";", "byte", "b2", "=", "(", "byte", ")", "(", "s", "&", "0xff", ")", ";",...
Appends a USHORT to the output array, at the given position without changing currentPos @param pos The position to write to @param s The short to be written
[ "Appends", "a", "USHORT", "to", "the", "output", "array", "at", "the", "given", "position", "without", "changing", "currentPos" ]
train
https://github.com/nguillaumin/slick2d-maven/blob/8251f88a0ed6a70e726d2468842455cd1f80893f/slick2d-hiero/src/main/java/org/newdawn/slick/tools/hiero/truetype/TTFSubSetFile.java#L825-L830
khuxtable/seaglass
src/main/java/com/seaglasslookandfeel/painter/CheckBoxPainter.java
CheckBoxPainter.createCheckMark
private Shape createCheckMark(int x, int y, int size) { """ Create the check mark shape. @param x the x coordinate of the upper-left corner of the check mark. @param y the y coordinate of the upper-left corner of the check mark. @param size the check mark size in pixels. @return the check mark sha...
java
private Shape createCheckMark(int x, int y, int size) { int markSize = (int) (size * SIZE_MULTIPLIER + 0.5); int markX = x + (int) (size * X_MULTIPLIER + 0.5); int markY = y + (int) (size * Y_MULTIPLIER + 0.5); return shapeGenerator.createCheckMark(markX, markY, markSize, markSize...
[ "private", "Shape", "createCheckMark", "(", "int", "x", ",", "int", "y", ",", "int", "size", ")", "{", "int", "markSize", "=", "(", "int", ")", "(", "size", "*", "SIZE_MULTIPLIER", "+", "0.5", ")", ";", "int", "markX", "=", "x", "+", "(", "int", ...
Create the check mark shape. @param x the x coordinate of the upper-left corner of the check mark. @param y the y coordinate of the upper-left corner of the check mark. @param size the check mark size in pixels. @return the check mark shape.
[ "Create", "the", "check", "mark", "shape", "." ]
train
https://github.com/khuxtable/seaglass/blob/f25ecba622923d7b29b64cb7d6068dd8005989b3/src/main/java/com/seaglasslookandfeel/painter/CheckBoxPainter.java#L188-L194
aws/aws-sdk-java
aws-java-sdk-ssm/src/main/java/com/amazonaws/services/simplesystemsmanagement/model/StepExecution.java
StepExecution.setOverriddenParameters
public void setOverriddenParameters(java.util.Map<String, java.util.List<String>> overriddenParameters) { """ <p> A user-specified list of parameters to override when running a step. </p> @param overriddenParameters A user-specified list of parameters to override when running a step. """ this.ove...
java
public void setOverriddenParameters(java.util.Map<String, java.util.List<String>> overriddenParameters) { this.overriddenParameters = overriddenParameters; }
[ "public", "void", "setOverriddenParameters", "(", "java", ".", "util", ".", "Map", "<", "String", ",", "java", ".", "util", ".", "List", "<", "String", ">", ">", "overriddenParameters", ")", "{", "this", ".", "overriddenParameters", "=", "overriddenParameters"...
<p> A user-specified list of parameters to override when running a step. </p> @param overriddenParameters A user-specified list of parameters to override when running a step.
[ "<p", ">", "A", "user", "-", "specified", "list", "of", "parameters", "to", "override", "when", "running", "a", "step", ".", "<", "/", "p", ">" ]
train
https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-ssm/src/main/java/com/amazonaws/services/simplesystemsmanagement/model/StepExecution.java#L887-L889
vikingbrain/thedavidbox-client4j
src/main/java/com/vikingbrain/nmt/operations/TheDavidboxOperationFactory.java
TheDavidboxOperationFactory.sendAndParse
private <T extends DavidBoxResponse> T sendAndParse(String urlGet, Class<T> responseTargetClass) throws TheDavidBoxClientException { """ It sends the url get to the service and parse the response in the desired response target class. @param urlGet the url to send to the service @param responseTargetClass the res...
java
private <T extends DavidBoxResponse> T sendAndParse(String urlGet, Class<T> responseTargetClass) throws TheDavidBoxClientException{ logger.debug("urlGet: " + urlGet); //Notify the listener about the request notifyRequest(urlGet); // Call the davidbox service to get the xml response String xmlR...
[ "private", "<", "T", "extends", "DavidBoxResponse", ">", "T", "sendAndParse", "(", "String", "urlGet", ",", "Class", "<", "T", ">", "responseTargetClass", ")", "throws", "TheDavidBoxClientException", "{", "logger", ".", "debug", "(", "\"urlGet: \"", "+", "urlGet...
It sends the url get to the service and parse the response in the desired response target class. @param urlGet the url to send to the service @param responseTargetClass the response target class @return the response object filled with the xml result @throws TheDavidBoxClientException exception in the client
[ "It", "sends", "the", "url", "get", "to", "the", "service", "and", "parse", "the", "response", "in", "the", "desired", "response", "target", "class", "." ]
train
https://github.com/vikingbrain/thedavidbox-client4j/blob/b2375a59b30fc3bd5dae34316bda68e01d006535/src/main/java/com/vikingbrain/nmt/operations/TheDavidboxOperationFactory.java#L110-L137
xcesco/kripton
kripton-processor/src/main/java/com/abubusoft/kripton/processor/bind/transform/EnumBindTransform.java
EnumBindTransform.generateParseOnXml
@Override public void generateParseOnXml(BindTypeContext context, MethodSpec.Builder methodBuilder, String parserName, TypeName beanClass, String beanName, BindProperty property) { """ /* (non-Javadoc) @see com.abubusoft.kripton.processor.bind.transform.BindTransform#generateParseOnXml(com.abubusoft.kripton.proc...
java
@Override public void generateParseOnXml(BindTypeContext context, MethodSpec.Builder methodBuilder, String parserName, TypeName beanClass, String beanName, BindProperty property) { XmlType xmlType = property.xmlInfo.xmlType; switch (xmlType) { case ATTRIBUTE: methodBuilder.addStatement(setter(beanClass, bean...
[ "@", "Override", "public", "void", "generateParseOnXml", "(", "BindTypeContext", "context", ",", "MethodSpec", ".", "Builder", "methodBuilder", ",", "String", "parserName", ",", "TypeName", "beanClass", ",", "String", "beanName", ",", "BindProperty", "property", ")"...
/* (non-Javadoc) @see com.abubusoft.kripton.processor.bind.transform.BindTransform#generateParseOnXml(com.abubusoft.kripton.processor.bind.BindTypeContext, com.squareup.javapoet.MethodSpec.Builder, java.lang.String, com.squareup.javapoet.TypeName, java.lang.String, com.abubusoft.kripton.processor.bind.model.BindPropert...
[ "/", "*", "(", "non", "-", "Javadoc", ")" ]
train
https://github.com/xcesco/kripton/blob/90de2c0523d39b99e81b8d38aa996898762f594a/kripton-processor/src/main/java/com/abubusoft/kripton/processor/bind/transform/EnumBindTransform.java#L124-L143
groovy/groovy-core
src/main/org/codehaus/groovy/runtime/DefaultGroovyMethods.java
DefaultGroovyMethods.findResult
public static <T,U> T findResult(Collection<U> self, @ClosureParams(FirstParam.FirstGenericType.class) Closure<T> closure) { """ Iterates through the collection calling the given closure for each item but stopping once the first non-null result is found and returning that result. If all results are null, null is ...
java
public static <T,U> T findResult(Collection<U> self, @ClosureParams(FirstParam.FirstGenericType.class) Closure<T> closure) { for (Object value : self) { T result = closure.call(value); if (result != null) { return result; } } return null; }
[ "public", "static", "<", "T", ",", "U", ">", "T", "findResult", "(", "Collection", "<", "U", ">", "self", ",", "@", "ClosureParams", "(", "FirstParam", ".", "FirstGenericType", ".", "class", ")", "Closure", "<", "T", ">", "closure", ")", "{", "for", ...
Iterates through the collection calling the given closure for each item but stopping once the first non-null result is found and returning that result. If all results are null, null is returned. <p> Example: <pre class="groovyTestCase"> def list = [1,2,3] assert "Found 2" == list.findResult { it > 1 ? "Found $it" : nul...
[ "Iterates", "through", "the", "collection", "calling", "the", "given", "closure", "for", "each", "item", "but", "stopping", "once", "the", "first", "non", "-", "null", "result", "is", "found", "and", "returning", "that", "result", ".", "If", "all", "results"...
train
https://github.com/groovy/groovy-core/blob/01309f9d4be34ddf93c4a9943b5a97843bff6181/src/main/org/codehaus/groovy/runtime/DefaultGroovyMethods.java#L3971-L3979
nohana/Amalgam
amalgam/src/main/java/com/amalgam/os/BundleUtils.java
BundleUtils.optCharSequenceArray
@TargetApi(Build.VERSION_CODES.FROYO) @Nullable public static CharSequence[] optCharSequenceArray(@Nullable Bundle bundle, @Nullable String key) { """ Returns a optional {@link CharSequence} array value. In other words, returns the value mapped by key if it exists and is a {@link CharSequence} array. The ...
java
@TargetApi(Build.VERSION_CODES.FROYO) @Nullable public static CharSequence[] optCharSequenceArray(@Nullable Bundle bundle, @Nullable String key) { return optCharSequenceArray(bundle, key, new CharSequence[0]); }
[ "@", "TargetApi", "(", "Build", ".", "VERSION_CODES", ".", "FROYO", ")", "@", "Nullable", "public", "static", "CharSequence", "[", "]", "optCharSequenceArray", "(", "@", "Nullable", "Bundle", "bundle", ",", "@", "Nullable", "String", "key", ")", "{", "return...
Returns a optional {@link CharSequence} array value. In other words, returns the value mapped by key if it exists and is a {@link CharSequence} array. The bundle argument is allowed to be {@code null}. If the bundle is null, this method returns null. @param bundle a bundle. If the bundle is null, this method will retur...
[ "Returns", "a", "optional", "{" ]
train
https://github.com/nohana/Amalgam/blob/57809ddbfe7897e979cf507982ce0b3aa5e0ed8a/amalgam/src/main/java/com/amalgam/os/BundleUtils.java#L359-L363
intellimate/Izou
src/main/java/org/intellimate/izou/events/EventDistributor.java
EventDistributor.registerEventFinishedListener
@SuppressWarnings("SynchronizationOnLocalVariableOrMethodParameter") public void registerEventFinishedListener(List<String> ids, EventListenerModel eventListener) { """ Adds an listener for events that gets called when the event finished processing. <p> It will register for all ids individually! This method...
java
@SuppressWarnings("SynchronizationOnLocalVariableOrMethodParameter") public void registerEventFinishedListener(List<String> ids, EventListenerModel eventListener) { for(String id : ids) { ArrayList<EventListenerModel> listenersList = finishListeners.get(id); if (listenersList == null...
[ "@", "SuppressWarnings", "(", "\"SynchronizationOnLocalVariableOrMethodParameter\"", ")", "public", "void", "registerEventFinishedListener", "(", "List", "<", "String", ">", "ids", ",", "EventListenerModel", "eventListener", ")", "{", "for", "(", "String", "id", ":", ...
Adds an listener for events that gets called when the event finished processing. <p> It will register for all ids individually! This method will ignore if this listener is already listening to an Event. Method is thread-safe. </p> @param ids this can be type, or descriptors etc. @param eventListener the ActivatorEventL...
[ "Adds", "an", "listener", "for", "events", "that", "gets", "called", "when", "the", "event", "finished", "processing", ".", "<p", ">", "It", "will", "register", "for", "all", "ids", "individually!", "This", "method", "will", "ignore", "if", "this", "listener...
train
https://github.com/intellimate/Izou/blob/40a808b97998e17655c4a78e30ce7326148aed27/src/main/java/org/intellimate/izou/events/EventDistributor.java#L219-L233
OpenLiberty/open-liberty
dev/com.ibm.ws.classloading/src/com/ibm/ws/classloading/internal/ClassLoadingServiceImpl.java
ClassLoadingServiceImpl.listenForLibraryChanges
private void listenForLibraryChanges(String libid, AppClassLoader acl) { """ create a listener to remove a loader from the canonical store on library update """ // ensure this loader is removed from the canonical store when the library is updated new WeakLibraryListener(libid, acl.getKey().getI...
java
private void listenForLibraryChanges(String libid, AppClassLoader acl) { // ensure this loader is removed from the canonical store when the library is updated new WeakLibraryListener(libid, acl.getKey().getId(), acl, bundleContext) { @Override protected void update() { ...
[ "private", "void", "listenForLibraryChanges", "(", "String", "libid", ",", "AppClassLoader", "acl", ")", "{", "// ensure this loader is removed from the canonical store when the library is updated", "new", "WeakLibraryListener", "(", "libid", ",", "acl", ".", "getKey", "(", ...
create a listener to remove a loader from the canonical store on library update
[ "create", "a", "listener", "to", "remove", "a", "loader", "from", "the", "canonical", "store", "on", "library", "update" ]
train
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.classloading/src/com/ibm/ws/classloading/internal/ClassLoadingServiceImpl.java#L508-L519
fernandospr/java-wns
src/main/java/ar/com/fernandospr/wns/WnsService.java
WnsService.pushBadge
public List<WnsNotificationResponse> pushBadge(List<String> channelUris, WnsBadge badge) throws WnsException { """ Pushes a badge to channelUris @param channelUris @param badge which should be built with {@link ar.com.fernandospr.wns.model.builders.WnsBadgeBuilder} @return list of WnsNotificationResponse for ea...
java
public List<WnsNotificationResponse> pushBadge(List<String> channelUris, WnsBadge badge) throws WnsException { return this.pushBadge(channelUris, null, badge); }
[ "public", "List", "<", "WnsNotificationResponse", ">", "pushBadge", "(", "List", "<", "String", ">", "channelUris", ",", "WnsBadge", "badge", ")", "throws", "WnsException", "{", "return", "this", ".", "pushBadge", "(", "channelUris", ",", "null", ",", "badge",...
Pushes a badge to channelUris @param channelUris @param badge which should be built with {@link ar.com.fernandospr.wns.model.builders.WnsBadgeBuilder} @return list of WnsNotificationResponse for each channelUri, please see response headers from <a href="http://msdn.microsoft.com/en-us/library/windows/apps/hh465435.aspx...
[ "Pushes", "a", "badge", "to", "channelUris" ]
train
https://github.com/fernandospr/java-wns/blob/cd621b9c17d1e706f6284e0913531d834904a90d/src/main/java/ar/com/fernandospr/wns/WnsService.java#L191-L193
marklogic/java-client-api
marklogic-client-api/src/main/java/com/marklogic/client/query/StructuredQueryBuilder.java
StructuredQueryBuilder.wordConstraint
public StructuredQueryDefinition wordConstraint(String constraintName, double weight, String... words) { """ Matches the container specified by the constraint when it has at least one of the criteria words. @param constraintName the constraint definition @param weight the multiplier for the match in the d...
java
public StructuredQueryDefinition wordConstraint(String constraintName, double weight, String... words) { return new WordConstraintQuery(constraintName, weight, words); }
[ "public", "StructuredQueryDefinition", "wordConstraint", "(", "String", "constraintName", ",", "double", "weight", ",", "String", "...", "words", ")", "{", "return", "new", "WordConstraintQuery", "(", "constraintName", ",", "weight", ",", "words", ")", ";", "}" ]
Matches the container specified by the constraint when it has at least one of the criteria words. @param constraintName the constraint definition @param weight the multiplier for the match in the document ranking @param words the possible words to match @return the StructuredQueryDefinition for the word con...
[ "Matches", "the", "container", "specified", "by", "the", "constraint", "when", "it", "has", "at", "least", "one", "of", "the", "criteria", "words", "." ]
train
https://github.com/marklogic/java-client-api/blob/acf60229a928abd4a8cc4b21b641d56957467da7/marklogic-client-api/src/main/java/com/marklogic/client/query/StructuredQueryBuilder.java#L1067-L1069
joniles/mpxj
src/main/java/net/sf/mpxj/Task.java
Task.setEnterpriseDuration
public void setEnterpriseDuration(int index, Duration value) { """ Set an enterprise field value. @param index field index @param value field value """ set(selectField(TaskFieldLists.ENTERPRISE_DURATION, index), value); }
java
public void setEnterpriseDuration(int index, Duration value) { set(selectField(TaskFieldLists.ENTERPRISE_DURATION, index), value); }
[ "public", "void", "setEnterpriseDuration", "(", "int", "index", ",", "Duration", "value", ")", "{", "set", "(", "selectField", "(", "TaskFieldLists", ".", "ENTERPRISE_DURATION", ",", "index", ")", ",", "value", ")", ";", "}" ]
Set an enterprise field value. @param index field index @param value field value
[ "Set", "an", "enterprise", "field", "value", "." ]
train
https://github.com/joniles/mpxj/blob/143ea0e195da59cd108f13b3b06328e9542337e8/src/main/java/net/sf/mpxj/Task.java#L3881-L3884
netty/netty
handler/src/main/java/io/netty/handler/ssl/SslContextBuilder.java
SslContextBuilder.keyManager
public SslContextBuilder keyManager(PrivateKey key, X509Certificate... keyCertChain) { """ Identifying certificate for this host. {@code keyCertChain} and {@code key} may be {@code null} for client contexts, which disables mutual authentication. @param key a PKCS#8 private key @param keyCertChain an X.509 cer...
java
public SslContextBuilder keyManager(PrivateKey key, X509Certificate... keyCertChain) { return keyManager(key, null, keyCertChain); }
[ "public", "SslContextBuilder", "keyManager", "(", "PrivateKey", "key", ",", "X509Certificate", "...", "keyCertChain", ")", "{", "return", "keyManager", "(", "key", ",", "null", ",", "keyCertChain", ")", ";", "}" ]
Identifying certificate for this host. {@code keyCertChain} and {@code key} may be {@code null} for client contexts, which disables mutual authentication. @param key a PKCS#8 private key @param keyCertChain an X.509 certificate chain
[ "Identifying", "certificate", "for", "this", "host", ".", "{", "@code", "keyCertChain", "}", "and", "{", "@code", "key", "}", "may", "be", "{", "@code", "null", "}", "for", "client", "contexts", "which", "disables", "mutual", "authentication", "." ]
train
https://github.com/netty/netty/blob/ba06eafa1c1824bd154f1a380019e7ea2edf3c4c/handler/src/main/java/io/netty/handler/ssl/SslContextBuilder.java#L246-L248
salesforce/Argus
ArgusWebServices/src/main/java/com/salesforce/dva/argus/ws/resources/UserResources.java
UserResources.updateUserEmail
@PUT @Produces(MediaType.APPLICATION_JSON) @Consumes(MediaType.APPLICATION_FORM_URLENCODED) @Path("/ { """ Updates the user email. @param req The HTTP request. @param userId The ID of the user to update. @param email The new email address. @return The updated user DTO. @throws ...
java
@PUT @Produces(MediaType.APPLICATION_JSON) @Consumes(MediaType.APPLICATION_FORM_URLENCODED) @Path("/{userId}/email") @Description("Update user email") public PrincipalUserDto updateUserEmail(@Context HttpServletRequest req, @PathParam("userId") final BigInteger userId, @FormParam("em...
[ "@", "PUT", "@", "Produces", "(", "MediaType", ".", "APPLICATION_JSON", ")", "@", "Consumes", "(", "MediaType", ".", "APPLICATION_FORM_URLENCODED", ")", "@", "Path", "(", "\"/{userId}/email\"", ")", "@", "Description", "(", "\"Update user email\"", ")", "public", ...
Updates the user email. @param req The HTTP request. @param userId The ID of the user to update. @param email The new email address. @return The updated user DTO. @throws WebApplicationException If an error occurs.
[ "Updates", "the", "user", "email", "." ]
train
https://github.com/salesforce/Argus/blob/121b59a268da264316cded6a3e9271366a23cd86/ArgusWebServices/src/main/java/com/salesforce/dva/argus/ws/resources/UserResources.java#L208-L233
spotify/apollo
apollo-api-impl/src/main/java/com/spotify/apollo/request/RequestRunnableImpl.java
RequestRunnableImpl.run
@Override public void run(BiConsumer<OngoingRequest, RuleMatch<Endpoint>> matchContinuation) { """ Route the request to a matching endpoint and continue with the {@link BiConsumer} """ try { matchAndRun(matchContinuation); } catch (Exception e) { LOG.error("Exception when handling request...
java
@Override public void run(BiConsumer<OngoingRequest, RuleMatch<Endpoint>> matchContinuation) { try { matchAndRun(matchContinuation); } catch (Exception e) { LOG.error("Exception when handling request", e); // ensure that we reply with a server error, if possible ongoingRequest.reply(fo...
[ "@", "Override", "public", "void", "run", "(", "BiConsumer", "<", "OngoingRequest", ",", "RuleMatch", "<", "Endpoint", ">", ">", "matchContinuation", ")", "{", "try", "{", "matchAndRun", "(", "matchContinuation", ")", ";", "}", "catch", "(", "Exception", "e"...
Route the request to a matching endpoint and continue with the {@link BiConsumer}
[ "Route", "the", "request", "to", "a", "matching", "endpoint", "and", "continue", "with", "the", "{" ]
train
https://github.com/spotify/apollo/blob/3aba09840538a2aff9cdac5be42cc114dd276c70/apollo-api-impl/src/main/java/com/spotify/apollo/request/RequestRunnableImpl.java#L67-L76
google/j2objc
jre_emul/android/platform/external/icu/android_icu4j/src/main/java/android/icu/text/CharsetDetector.java
CharsetDetector.getString
public String getString(byte[] in, String declaredEncoding) { """ Autodetect the charset of an inputStream, and return a String containing the converted input data. <p> This is a convenience method that is equivalent to <code>this.setDeclaredEncoding(declaredEncoding).setText(in).detect().getString();</code> ...
java
public String getString(byte[] in, String declaredEncoding) { fDeclaredEncoding = declaredEncoding; try { setText(in); CharsetMatch match = detect(); if (match == null) { return null; } ...
[ "public", "String", "getString", "(", "byte", "[", "]", "in", ",", "String", "declaredEncoding", ")", "{", "fDeclaredEncoding", "=", "declaredEncoding", ";", "try", "{", "setText", "(", "in", ")", ";", "CharsetMatch", "match", "=", "detect", "(", ")", ";",...
Autodetect the charset of an inputStream, and return a String containing the converted input data. <p> This is a convenience method that is equivalent to <code>this.setDeclaredEncoding(declaredEncoding).setText(in).detect().getString();</code> <p> Raise an exception if no charsets appear to match the input data. @para...
[ "Autodetect", "the", "charset", "of", "an", "inputStream", "and", "return", "a", "String", "containing", "the", "converted", "input", "data", ".", "<p", ">", "This", "is", "a", "convenience", "method", "that", "is", "equivalent", "to", "<code", ">", "this", ...
train
https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/external/icu/android_icu4j/src/main/java/android/icu/text/CharsetDetector.java#L252-L269
RestComm/sipunit
src/main/java/org/cafesip/sipunit/SipCall.java
SipCall.respondToDisconnect
public boolean respondToDisconnect(int statusCode, String reasonPhrase) { """ This method is the same as the basic respondToDisconnect() method except that it uses the given parameters for the status code and reason in the response message sent out. @param statusCode The integer status code to use (ie, SipResp...
java
public boolean respondToDisconnect(int statusCode, String reasonPhrase) { initErrorInfo(); if (parent.sendReply(transaction, statusCode, reasonPhrase, myTag, null, -1) != null) { return true; } setReturnCode(parent.getReturnCode()); setException(parent.getException()); setErrorMessage("re...
[ "public", "boolean", "respondToDisconnect", "(", "int", "statusCode", ",", "String", "reasonPhrase", ")", "{", "initErrorInfo", "(", ")", ";", "if", "(", "parent", ".", "sendReply", "(", "transaction", ",", "statusCode", ",", "reasonPhrase", ",", "myTag", ",",...
This method is the same as the basic respondToDisconnect() method except that it uses the given parameters for the status code and reason in the response message sent out. @param statusCode The integer status code to use (ie, SipResponse.OK). @param reasonPhrase The String reason phrase to use. @return true if the res...
[ "This", "method", "is", "the", "same", "as", "the", "basic", "respondToDisconnect", "()", "method", "except", "that", "it", "uses", "the", "given", "parameters", "for", "the", "status", "code", "and", "reason", "in", "the", "response", "message", "sent", "ou...
train
https://github.com/RestComm/sipunit/blob/18a6be2e29be3fbdc14226e8c41b25e2d57378b1/src/main/java/org/cafesip/sipunit/SipCall.java#L1334-L1345
castorflex/SmoothProgressBar
library-circular/src/main/java/fr.castorflex.android.circularprogressbar/CircularProgressDrawable.java
CircularProgressDrawable.initDelegate
private void initDelegate() { """ Inits the delegate. Create one if the delegate is null or not the right mode """ boolean powerSaveMode = Utils.isPowerSaveModeEnabled(mPowerManager); if (powerSaveMode) { if (mPBDelegate == null || !(mPBDelegate instanceof PowerSaveModeDelegate)) { if (mP...
java
private void initDelegate() { boolean powerSaveMode = Utils.isPowerSaveModeEnabled(mPowerManager); if (powerSaveMode) { if (mPBDelegate == null || !(mPBDelegate instanceof PowerSaveModeDelegate)) { if (mPBDelegate != null) mPBDelegate.stop(); mPBDelegate = new PowerSaveModeDelegate(this); ...
[ "private", "void", "initDelegate", "(", ")", "{", "boolean", "powerSaveMode", "=", "Utils", ".", "isPowerSaveModeEnabled", "(", "mPowerManager", ")", ";", "if", "(", "powerSaveMode", ")", "{", "if", "(", "mPBDelegate", "==", "null", "||", "!", "(", "mPBDeleg...
Inits the delegate. Create one if the delegate is null or not the right mode
[ "Inits", "the", "delegate", ".", "Create", "one", "if", "the", "delegate", "is", "null", "or", "not", "the", "right", "mode" ]
train
https://github.com/castorflex/SmoothProgressBar/blob/29fe0041f163695510775facdcc8c48114580def/library-circular/src/main/java/fr.castorflex.android.circularprogressbar/CircularProgressDrawable.java#L113-L126
mygreen/xlsmapper
src/main/java/com/gh/mygreen/xlsmapper/xml/MultipleLoaderClassResolver.java
MultipleLoaderClassResolver.classForName
@SuppressWarnings( { """ Loads class from multiple ClassLoader. If this method can not load target class, it tries to add package java.lang(default package) and load target class. Still, if it can not the class, throws ClassNotFoundException. (behavior is put together on DefaultClassResolver.) @param cla...
java
@SuppressWarnings({"unchecked", "rawtypes"}) public Class classForName(String className, Map loaderMap) throws ClassNotFoundException { Collection<ClassLoader> loaders = null; // add context-classloader loaders = new HashSet<ClassLoader>(); loaders.add(Thread.curren...
[ "@", "SuppressWarnings", "(", "{", "\"unchecked\"", ",", "\"rawtypes\"", "}", ")", "public", "Class", "classForName", "(", "String", "className", ",", "Map", "loaderMap", ")", "throws", "ClassNotFoundException", "{", "Collection", "<", "ClassLoader", ">", "loaders...
Loads class from multiple ClassLoader. If this method can not load target class, it tries to add package java.lang(default package) and load target class. Still, if it can not the class, throws ClassNotFoundException. (behavior is put together on DefaultClassResolver.) @param className class name -- that wants to lo...
[ "Loads", "class", "from", "multiple", "ClassLoader", "." ]
train
https://github.com/mygreen/xlsmapper/blob/a0c6b25c622e5f3a50b199ef685d2ee46ad5483c/src/main/java/com/gh/mygreen/xlsmapper/xml/MultipleLoaderClassResolver.java#L30-L62
carewebframework/carewebframework-core
org.carewebframework.shell/src/main/java/org/carewebframework/shell/elements/ElementToolbar.java
ElementToolbar.addToolbarComponent
public void addToolbarComponent(BaseComponent component, String action) { """ Adds a component to the toolbar. @param component Component to add. If the component is a toolbar itself, its children will be added to the toolbar. @param action The action to associate with the component. """ BaseCompo...
java
public void addToolbarComponent(BaseComponent component, String action) { BaseComponent ref = toolbar.getFirstChild(); if (component instanceof Toolbar) { BaseComponent child; while ((child = component.getFirstChild()) != null) { toolbar.addC...
[ "public", "void", "addToolbarComponent", "(", "BaseComponent", "component", ",", "String", "action", ")", "{", "BaseComponent", "ref", "=", "toolbar", ".", "getFirstChild", "(", ")", ";", "if", "(", "component", "instanceof", "Toolbar", ")", "{", "BaseComponent"...
Adds a component to the toolbar. @param component Component to add. If the component is a toolbar itself, its children will be added to the toolbar. @param action The action to associate with the component.
[ "Adds", "a", "component", "to", "the", "toolbar", "." ]
train
https://github.com/carewebframework/carewebframework-core/blob/fa3252d4f7541dbe151b92c3d4f6f91433cd1673/org.carewebframework.shell/src/main/java/org/carewebframework/shell/elements/ElementToolbar.java#L72-L86
OpenLiberty/open-liberty
dev/com.ibm.ws.jaxrs.2.0.common/src/org/apache/cxf/jaxrs/utils/ThreadLocalProxyCopyOnWriteArrayList.java
ThreadLocalProxyCopyOnWriteArrayList.lastIndexOf
private static int lastIndexOf(Object o, Object[] elements, int index) { """ static version of lastIndexOf. @param o element to search for @param elements the array @param index first index to search @return index of element, or -1 if absent """ if (o == null) { for (int i = index; i ...
java
private static int lastIndexOf(Object o, Object[] elements, int index) { if (o == null) { for (int i = index; i >= 0; i--) if (elements[i] == null) return i; } else { for (int i = index; i >= 0; i--) if (o.equals(elements[i])) ...
[ "private", "static", "int", "lastIndexOf", "(", "Object", "o", ",", "Object", "[", "]", "elements", ",", "int", "index", ")", "{", "if", "(", "o", "==", "null", ")", "{", "for", "(", "int", "i", "=", "index", ";", "i", ">=", "0", ";", "i", "--"...
static version of lastIndexOf. @param o element to search for @param elements the array @param index first index to search @return index of element, or -1 if absent
[ "static", "version", "of", "lastIndexOf", "." ]
train
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.jaxrs.2.0.common/src/org/apache/cxf/jaxrs/utils/ThreadLocalProxyCopyOnWriteArrayList.java#L142-L153
primefaces-extensions/core
src/main/java/org/primefaces/extensions/util/JavascriptVarBuilder.java
JavascriptVarBuilder.appendText
public JavascriptVarBuilder appendText(final String value, final boolean quoted) { """ Appends text to the var string @param value the value to append @param quoted if true, the value is quoted and escaped. @return this builder """ if (quoted) { sb.append("\""); if (value !...
java
public JavascriptVarBuilder appendText(final String value, final boolean quoted) { if (quoted) { sb.append("\""); if (value != null) { sb.append(EscapeUtils.forJavaScript(value)); } sb.append("\""); } else if (value != null) { ...
[ "public", "JavascriptVarBuilder", "appendText", "(", "final", "String", "value", ",", "final", "boolean", "quoted", ")", "{", "if", "(", "quoted", ")", "{", "sb", ".", "append", "(", "\"\\\"\"", ")", ";", "if", "(", "value", "!=", "null", ")", "{", "sb...
Appends text to the var string @param value the value to append @param quoted if true, the value is quoted and escaped. @return this builder
[ "Appends", "text", "to", "the", "var", "string" ]
train
https://github.com/primefaces-extensions/core/blob/afdbca591f60f47898e3517e1e939bc2f63d5355/src/main/java/org/primefaces/extensions/util/JavascriptVarBuilder.java#L106-L118
headius/invokebinder
src/main/java/com/headius/invokebinder/Binder.java
Binder.invokeQuiet
public MethodHandle invokeQuiet(MethodHandles.Lookup lookup, Method method) { """ Apply the chain of transforms and bind them to a static method specified using the end signature plus the given class and method. The method will be retrieved using the given Lookup and must match the end signature exactly. If ...
java
public MethodHandle invokeQuiet(MethodHandles.Lookup lookup, Method method) { try { return invoke(lookup, method); } catch (IllegalAccessException iae) { throw new InvalidTransformException(iae); } }
[ "public", "MethodHandle", "invokeQuiet", "(", "MethodHandles", ".", "Lookup", "lookup", ",", "Method", "method", ")", "{", "try", "{", "return", "invoke", "(", "lookup", ",", "method", ")", ";", "}", "catch", "(", "IllegalAccessException", "iae", ")", "{", ...
Apply the chain of transforms and bind them to a static method specified using the end signature plus the given class and method. The method will be retrieved using the given Lookup and must match the end signature exactly. If the final handle's type does not exactly match the initial type for this Binder, an addition...
[ "Apply", "the", "chain", "of", "transforms", "and", "bind", "them", "to", "a", "static", "method", "specified", "using", "the", "end", "signature", "plus", "the", "given", "class", "and", "method", ".", "The", "method", "will", "be", "retrieved", "using", ...
train
https://github.com/headius/invokebinder/blob/ce6bfeb8e33265480daa7b797989dd915d51238d/src/main/java/com/headius/invokebinder/Binder.java#L1186-L1192
google/error-prone-javac
src/jdk.compiler/share/classes/com/sun/tools/javac/jvm/Gen.java
Gen.genStats
public void genStats(List<JCStatement> trees, Env<GenContext> env, int crtFlags) { """ Derived visitor method: check whether CharacterRangeTable should be emitted, if so, put a new entry into CRTable and call method to generate bytecode. If not, just call method to generate bytecode. @see #genStats(List, En...
java
public void genStats(List<JCStatement> trees, Env<GenContext> env, int crtFlags) { if (!genCrt) { genStats(trees, env); return; } if (trees.length() == 1) { // mark one statement with the flags genStat(trees.head, env, crtFlags | CRT_STATEMENT); ...
[ "public", "void", "genStats", "(", "List", "<", "JCStatement", ">", "trees", ",", "Env", "<", "GenContext", ">", "env", ",", "int", "crtFlags", ")", "{", "if", "(", "!", "genCrt", ")", "{", "genStats", "(", "trees", ",", "env", ")", ";", "return", ...
Derived visitor method: check whether CharacterRangeTable should be emitted, if so, put a new entry into CRTable and call method to generate bytecode. If not, just call method to generate bytecode. @see #genStats(List, Env) @param trees The list of trees to be visited. @param env The environment to use. @...
[ "Derived", "visitor", "method", ":", "check", "whether", "CharacterRangeTable", "should", "be", "emitted", "if", "so", "put", "a", "new", "entry", "into", "CRTable", "and", "call", "method", "to", "generate", "bytecode", ".", "If", "not", "just", "call", "me...
train
https://github.com/google/error-prone-javac/blob/a53d069bbdb2c60232ed3811c19b65e41c3e60e0/src/jdk.compiler/share/classes/com/sun/tools/javac/jvm/Gen.java#L647-L659
BioPAX/Paxtools
pattern/src/main/java/org/biopax/paxtools/pattern/PatternBox.java
PatternBox.controlsExpressionWithTemplateReac
public static Pattern controlsExpressionWithTemplateReac() { """ Finds transcription factors that trans-activate or trans-inhibit an entity. @return the pattern """ Pattern p = new Pattern(SequenceEntityReference.class, "TF ER"); p.add(linkedER(true), "TF ER", "TF generic ER"); p.add(erToPE(), "TF gener...
java
public static Pattern controlsExpressionWithTemplateReac() { Pattern p = new Pattern(SequenceEntityReference.class, "TF ER"); p.add(linkedER(true), "TF ER", "TF generic ER"); p.add(erToPE(), "TF generic ER", "TF SPE"); p.add(linkToComplex(), "TF SPE", "TF PE"); p.add(peToControl(), "TF PE", "Control"); p.a...
[ "public", "static", "Pattern", "controlsExpressionWithTemplateReac", "(", ")", "{", "Pattern", "p", "=", "new", "Pattern", "(", "SequenceEntityReference", ".", "class", ",", "\"TF ER\"", ")", ";", "p", ".", "add", "(", "linkedER", "(", "true", ")", ",", "\"T...
Finds transcription factors that trans-activate or trans-inhibit an entity. @return the pattern
[ "Finds", "transcription", "factors", "that", "trans", "-", "activate", "or", "trans", "-", "inhibit", "an", "entity", "." ]
train
https://github.com/BioPAX/Paxtools/blob/2f93afa94426bf8b5afc2e0e61cd4b269a83288d/pattern/src/main/java/org/biopax/paxtools/pattern/PatternBox.java#L419-L434
mapbox/mapbox-java
services-matching/src/main/java/com/mapbox/api/matching/v5/MapboxMapMatching.java
MapboxMapMatching.enqueueCall
@Override public void enqueueCall(final Callback<MapMatchingResponse> callback) { """ Wrapper method for Retrofits {@link Call#enqueue(Callback)} call returning a response specific to the Map Matching API. Use this method to make a directions request on the Main Thread. @param callback a {@link Callback} whi...
java
@Override public void enqueueCall(final Callback<MapMatchingResponse> callback) { getCall().enqueue(new Callback<MapMatchingResponse>() { @Override public void onResponse(Call<MapMatchingResponse> call, Response<MapMatchingResponse> response) { MatchingResponseFact...
[ "@", "Override", "public", "void", "enqueueCall", "(", "final", "Callback", "<", "MapMatchingResponse", ">", "callback", ")", "{", "getCall", "(", ")", ".", "enqueue", "(", "new", "Callback", "<", "MapMatchingResponse", ">", "(", ")", "{", "@", "Override", ...
Wrapper method for Retrofits {@link Call#enqueue(Callback)} call returning a response specific to the Map Matching API. Use this method to make a directions request on the Main Thread. @param callback a {@link Callback} which is used once the {@link MapMatchingResponse} is created. @since 1.0.0
[ "Wrapper", "method", "for", "Retrofits", "{", "@link", "Call#enqueue", "(", "Callback", ")", "}", "call", "returning", "a", "response", "specific", "to", "the", "Map", "Matching", "API", ".", "Use", "this", "method", "to", "make", "a", "directions", "request...
train
https://github.com/mapbox/mapbox-java/blob/c0be138f462f91441388584c668f3760ba0e18e2/services-matching/src/main/java/com/mapbox/api/matching/v5/MapboxMapMatching.java#L154-L171
spotbugs/spotbugs
eclipsePlugin/src/de/tobject/findbugs/properties/DetectorProvider.java
DetectorProvider.isEclipsePluginDisabled
static boolean isEclipsePluginDisabled(String pluginId, Map<URI, Plugin> allPlugins) { """ Eclipse plugin can be disabled ONLY by user, so it must NOT be in the list of loaded plugins """ for (Plugin plugin : allPlugins.values()) { if(pluginId.equals(plugin.getPluginId())) { ...
java
static boolean isEclipsePluginDisabled(String pluginId, Map<URI, Plugin> allPlugins) { for (Plugin plugin : allPlugins.values()) { if(pluginId.equals(plugin.getPluginId())) { return false; } } return true; }
[ "static", "boolean", "isEclipsePluginDisabled", "(", "String", "pluginId", ",", "Map", "<", "URI", ",", "Plugin", ">", "allPlugins", ")", "{", "for", "(", "Plugin", "plugin", ":", "allPlugins", ".", "values", "(", ")", ")", "{", "if", "(", "pluginId", "....
Eclipse plugin can be disabled ONLY by user, so it must NOT be in the list of loaded plugins
[ "Eclipse", "plugin", "can", "be", "disabled", "ONLY", "by", "user", "so", "it", "must", "NOT", "be", "in", "the", "list", "of", "loaded", "plugins" ]
train
https://github.com/spotbugs/spotbugs/blob/f6365c6eea6515035bded38efa4a7c8b46ccf28c/eclipsePlugin/src/de/tobject/findbugs/properties/DetectorProvider.java#L135-L142
vlingo/vlingo-actors
src/main/java/io/vlingo/actors/World.java
World.registerDefaultSupervisor
@Override public void registerDefaultSupervisor(final String stageName, final String name, final Class<? extends Actor> supervisorClass) { """ Registers the {@code supervisorClass} plugin by {@code name} that will serve as the default supervise for all {@code Actors} that are not supervised by a specific superv...
java
@Override public void registerDefaultSupervisor(final String stageName, final String name, final Class<? extends Actor> supervisorClass) { try { final String actualStageName = stageName.equals("default") ? DEFAULT_STAGE : stageName; final Stage stage = stageNamed(actualStageName); defaultSupervi...
[ "@", "Override", "public", "void", "registerDefaultSupervisor", "(", "final", "String", "stageName", ",", "final", "String", "name", ",", "final", "Class", "<", "?", "extends", "Actor", ">", "supervisorClass", ")", "{", "try", "{", "final", "String", "actualSt...
Registers the {@code supervisorClass} plugin by {@code name} that will serve as the default supervise for all {@code Actors} that are not supervised by a specific supervisor. @param stageName the {@code String} name of the {@code Stage} in which the {@code supervisorClass} is to be registered @param name the {@code Str...
[ "Registers", "the", "{" ]
train
https://github.com/vlingo/vlingo-actors/blob/c7d046fd139c0490cf0fd2588d7dc2f792f13493/src/main/java/io/vlingo/actors/World.java#L329-L339
foundation-runtime/service-directory
2.0/sd-api/src/main/java/com/cisco/oss/foundation/directory/impl/DirectoryServiceClient.java
DirectoryServiceClient.updateServiceInstance
public void updateServiceInstance(ProvidedServiceInstance instance, final RegistrationCallback cb, Object context) { """ Update the ServiceInstance with callback. @param instance the ServiceInstance. @param cb the Callback. @param context the context object. """ ProtocolHeader header = new Prot...
java
public void updateServiceInstance(ProvidedServiceInstance instance, final RegistrationCallback cb, Object context){ ProtocolHeader header = new ProtocolHeader(); header.setType(ProtocolType.UpdateServiceInstance); UpdateServiceInstanceProtocol p = new UpdateServiceInstanceProtocol(instance); ...
[ "public", "void", "updateServiceInstance", "(", "ProvidedServiceInstance", "instance", ",", "final", "RegistrationCallback", "cb", ",", "Object", "context", ")", "{", "ProtocolHeader", "header", "=", "new", "ProtocolHeader", "(", ")", ";", "header", ".", "setType", ...
Update the ServiceInstance with callback. @param instance the ServiceInstance. @param cb the Callback. @param context the context object.
[ "Update", "the", "ServiceInstance", "with", "callback", "." ]
train
https://github.com/foundation-runtime/service-directory/blob/a7bdefe173dc99e75eff4a24e07e6407e62f2ed4/2.0/sd-api/src/main/java/com/cisco/oss/foundation/directory/impl/DirectoryServiceClient.java#L565-L580
google/error-prone-javac
src/jdk.javadoc/share/classes/com/sun/tools/doclets/formats/html/HtmlSerialMethodWriter.java
HtmlSerialMethodWriter.addMemberTags
public void addMemberTags(MethodDoc member, Content methodsContentTree) { """ Add the tag information for this member. @param member the method to document. @param methodsContentTree the tree to which the member tags info will be added """ Content tagContent = new ContentBuilder(); TagletMa...
java
public void addMemberTags(MethodDoc member, Content methodsContentTree) { Content tagContent = new ContentBuilder(); TagletManager tagletManager = configuration.tagletManager; TagletWriter.genTagOuput(tagletManager, member, tagletManager.getSerializedFormTaglets(), ...
[ "public", "void", "addMemberTags", "(", "MethodDoc", "member", ",", "Content", "methodsContentTree", ")", "{", "Content", "tagContent", "=", "new", "ContentBuilder", "(", ")", ";", "TagletManager", "tagletManager", "=", "configuration", ".", "tagletManager", ";", ...
Add the tag information for this member. @param member the method to document. @param methodsContentTree the tree to which the member tags info will be added
[ "Add", "the", "tag", "information", "for", "this", "member", "." ]
train
https://github.com/google/error-prone-javac/blob/a53d069bbdb2c60232ed3811c19b65e41c3e60e0/src/jdk.javadoc/share/classes/com/sun/tools/doclets/formats/html/HtmlSerialMethodWriter.java#L145-L161
aws/aws-sdk-java
aws-java-sdk-codepipeline/src/main/java/com/amazonaws/services/codepipeline/model/ActionDeclaration.java
ActionDeclaration.withConfiguration
public ActionDeclaration withConfiguration(java.util.Map<String, String> configuration) { """ <p> The action declaration's configuration. </p> @param configuration The action declaration's configuration. @return Returns a reference to this object so that method calls can be chained together. """ ...
java
public ActionDeclaration withConfiguration(java.util.Map<String, String> configuration) { setConfiguration(configuration); return this; }
[ "public", "ActionDeclaration", "withConfiguration", "(", "java", ".", "util", ".", "Map", "<", "String", ",", "String", ">", "configuration", ")", "{", "setConfiguration", "(", "configuration", ")", ";", "return", "this", ";", "}" ]
<p> The action declaration's configuration. </p> @param configuration The action declaration's configuration. @return Returns a reference to this object so that method calls can be chained together.
[ "<p", ">", "The", "action", "declaration", "s", "configuration", ".", "<", "/", "p", ">" ]
train
https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-codepipeline/src/main/java/com/amazonaws/services/codepipeline/model/ActionDeclaration.java#L236-L239
irmen/Pyrolite
java/src/main/java/net/razorvine/pyro/Message.java
Message.from_header
public static Message from_header(byte[] header) { """ Parses a message header. Does not yet process the annotations chunks and message data. """ if(header==null || header.length!=HEADER_SIZE) throw new PyroException("header data size mismatch"); if(header[0]!='P'||header[1]!='Y'||header[2]!='R'||hea...
java
public static Message from_header(byte[] header) { if(header==null || header.length!=HEADER_SIZE) throw new PyroException("header data size mismatch"); if(header[0]!='P'||header[1]!='Y'||header[2]!='R'||header[3]!='O') throw new PyroException("invalid message"); int version = ((header[4]&0xff) <...
[ "public", "static", "Message", "from_header", "(", "byte", "[", "]", "header", ")", "{", "if", "(", "header", "==", "null", "||", "header", ".", "length", "!=", "HEADER_SIZE", ")", "throw", "new", "PyroException", "(", "\"header data size mismatch\"", ")", "...
Parses a message header. Does not yet process the annotations chunks and message data.
[ "Parses", "a", "message", "header", ".", "Does", "not", "yet", "process", "the", "annotations", "chunks", "and", "message", "data", "." ]
train
https://github.com/irmen/Pyrolite/blob/060bc3c9069cd31560b6da4f67280736fb2cdf63/java/src/main/java/net/razorvine/pyro/Message.java#L209-L243
akarnokd/ixjava
src/main/java/ix/Ix.java
Ix.subscribe
public final void subscribe(IxConsumer<? super T> onNext, IxConsumer<Throwable> onError, Runnable onCompleted) { """ Iterates over this sequence and calls the given onNext action with each element and calls the onError with any exception thrown by the iteration or the onNext action; otherwise calls the onComplet...
java
public final void subscribe(IxConsumer<? super T> onNext, IxConsumer<Throwable> onError, Runnable onCompleted) { try { for (T v : this) { onNext.accept(v); } } catch (Throwable ex) { onError.accept(ex); return; } onCompleted...
[ "public", "final", "void", "subscribe", "(", "IxConsumer", "<", "?", "super", "T", ">", "onNext", ",", "IxConsumer", "<", "Throwable", ">", "onError", ",", "Runnable", "onCompleted", ")", "{", "try", "{", "for", "(", "T", "v", ":", "this", ")", "{", ...
Iterates over this sequence and calls the given onNext action with each element and calls the onError with any exception thrown by the iteration or the onNext action; otherwise calls the onCompleted action when the sequence completes without exception. @param onNext the consumer to call with each element @param onError...
[ "Iterates", "over", "this", "sequence", "and", "calls", "the", "given", "onNext", "action", "with", "each", "element", "and", "calls", "the", "onError", "with", "any", "exception", "thrown", "by", "the", "iteration", "or", "the", "onNext", "action", ";", "ot...
train
https://github.com/akarnokd/ixjava/blob/add721bba550c36541faa450e40a975bb65e78d7/src/main/java/ix/Ix.java#L2610-L2620
sarl/sarl
docs/io.sarl.docs.doclet/src/main/java/io/sarl/docs/doclet/utils/Reflect.java
Reflect.getField
public static <T> T getField(Object obj, String string, Class<?> clazz, Class<T> fieldType) { """ Replies the value of the field. @param <T> the field type. @param obj the instance. @param string the field name. @param clazz the container type. @param fieldType the field type. @return the value. """ ...
java
public static <T> T getField(Object obj, String string, Class<?> clazz, Class<T> fieldType) { try { final Field field = clazz.getDeclaredField(string); field.setAccessible(true); final Object value = field.get(obj); return fieldType.cast(value); } catch (Exception exception) { throw new Error(excepti...
[ "public", "static", "<", "T", ">", "T", "getField", "(", "Object", "obj", ",", "String", "string", ",", "Class", "<", "?", ">", "clazz", ",", "Class", "<", "T", ">", "fieldType", ")", "{", "try", "{", "final", "Field", "field", "=", "clazz", ".", ...
Replies the value of the field. @param <T> the field type. @param obj the instance. @param string the field name. @param clazz the container type. @param fieldType the field type. @return the value.
[ "Replies", "the", "value", "of", "the", "field", "." ]
train
https://github.com/sarl/sarl/blob/ca00ff994598c730339972def4e19a60e0b8cace/docs/io.sarl.docs.doclet/src/main/java/io/sarl/docs/doclet/utils/Reflect.java#L118-L127
javactic/javactic
src/main/java/com/github/javactic/Accumulation.java
Accumulation.validatedBy
public static <F, G, A, I extends Iterable<? extends G>, ERR> Or<I, Every<ERR>> validatedBy(Iterable<? extends F> iterable, Function<? super F, ? extends Or<? extends G, ? extends Every<? extends ERR>>> f, Collector<? super G, A, I> collector) { """ Maps an iterable of Fs into Ors o...
java
public static <F, G, A, I extends Iterable<? extends G>, ERR> Or<I, Every<ERR>> validatedBy(Iterable<? extends F> iterable, Function<? super F, ? extends Or<? extends G, ? extends Every<? extends ERR>>> f, Collector<? super G, A, I> collector) { Vector<Or<? extends G, ? extends Ever...
[ "public", "static", "<", "F", ",", "G", ",", "A", ",", "I", "extends", "Iterable", "<", "?", "extends", "G", ">", ",", "ERR", ">", "Or", "<", "I", ",", "Every", "<", "ERR", ">", ">", "validatedBy", "(", "Iterable", "<", "?", "extends", "F", ">"...
Maps an iterable of Fs into Ors of type Or&lt;G, EVERY&lt;ERR&gt;&gt; (where EVERY is some subtype of Every) using the passed function f, then combines the resulting Ors into a single Or of type Or&lt;COLL&lt;G&gt;, Every&lt;ERR&gt;&gt; using a Collector to determine the wanted collection type COLL. <p> Note: the proce...
[ "Maps", "an", "iterable", "of", "Fs", "into", "Ors", "of", "type", "Or&lt", ";", "G", "EVERY&lt", ";", "ERR&gt", ";", "&gt", ";", "(", "where", "EVERY", "is", "some", "subtype", "of", "Every", ")", "using", "the", "passed", "function", "f", "then", "...
train
https://github.com/javactic/javactic/blob/dfa040062178c259c3067fd9b59cb4498022d8bc/src/main/java/com/github/javactic/Accumulation.java#L138-L149
OpenLiberty/open-liberty
dev/com.ibm.ws.ejbcontainer.core/src/com/ibm/ws/ejbcontainer/util/ScheduleExpressionParser.java
ScheduleExpressionParser.parseTimeZone
private void parseTimeZone(ParsedScheduleExpression parsedExpr, String string) { """ Parses the time zone ID and stores the result in parsedExpr. If the parsed schedule already has a time zone, then it is kept. If the time zone ID is null, then the default time zone is used. @param parsedExpr the object in wh...
java
private void parseTimeZone(ParsedScheduleExpression parsedExpr, String string) { if (parsedExpr.timeZone == null) // d639610 { if (string == null) { parsedExpr.timeZone = TimeZone.getDefault(); // d639610 } else { ...
[ "private", "void", "parseTimeZone", "(", "ParsedScheduleExpression", "parsedExpr", ",", "String", "string", ")", "{", "if", "(", "parsedExpr", ".", "timeZone", "==", "null", ")", "// d639610", "{", "if", "(", "string", "==", "null", ")", "{", "parsedExpr", "...
Parses the time zone ID and stores the result in parsedExpr. If the parsed schedule already has a time zone, then it is kept. If the time zone ID is null, then the default time zone is used. @param parsedExpr the object in which to store the result @param string the time zone ID @throws ScheduleExpressionParserExcepti...
[ "Parses", "the", "time", "zone", "ID", "and", "stores", "the", "result", "in", "parsedExpr", ".", "If", "the", "parsed", "schedule", "already", "has", "a", "time", "zone", "then", "it", "is", "kept", ".", "If", "the", "time", "zone", "ID", "is", "null"...
train
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.ejbcontainer.core/src/com/ibm/ws/ejbcontainer/util/ScheduleExpressionParser.java#L301-L322
canoo/dolphin-platform
platform/dolphin-platform-core/src/main/java/com/canoo/dp/impl/platform/core/commons/lang/TypeUtils.java
TypeUtils.getTypeArguments
private static Map<TypeVariable<?>, Type> getTypeArguments( final ParameterizedType parameterizedType, final Class<?> toClass, final Map<TypeVariable<?>, Type> subtypeVarAssigns) { """ <p>Return a map of the type arguments of a parameterized type in the context of {@code toClass}.</p> @p...
java
private static Map<TypeVariable<?>, Type> getTypeArguments( final ParameterizedType parameterizedType, final Class<?> toClass, final Map<TypeVariable<?>, Type> subtypeVarAssigns) { final Class<?> cls = getRawType(parameterizedType); // make sure they're assignable if (!i...
[ "private", "static", "Map", "<", "TypeVariable", "<", "?", ">", ",", "Type", ">", "getTypeArguments", "(", "final", "ParameterizedType", "parameterizedType", ",", "final", "Class", "<", "?", ">", "toClass", ",", "final", "Map", "<", "TypeVariable", "<", "?",...
<p>Return a map of the type arguments of a parameterized type in the context of {@code toClass}.</p> @param parameterizedType the parameterized type @param toClass the class @param subtypeVarAssigns a map with type variables @return the {@code Map} with type arguments
[ "<p", ">", "Return", "a", "map", "of", "the", "type", "arguments", "of", "a", "parameterized", "type", "in", "the", "context", "of", "{", "@code", "toClass", "}", ".", "<", "/", "p", ">" ]
train
https://github.com/canoo/dolphin-platform/blob/fb99c1fab24df80d2fa094d8688b546140146874/platform/dolphin-platform-core/src/main/java/com/canoo/dp/impl/platform/core/commons/lang/TypeUtils.java#L741-L784
apache/incubator-atlas
typesystem/src/main/java/org/apache/atlas/typesystem/types/HierarchicalType.java
HierarchicalType.validateUpdate
@Override public void validateUpdate(IDataType newType) throws TypeUpdateException { """ Validate that current definition can be updated with the new definition @param newType @return true if the current definition can be updated with the new definition, else false """ super.validateUpdate(newTyp...
java
@Override public void validateUpdate(IDataType newType) throws TypeUpdateException { super.validateUpdate(newType); HierarchicalType newHierarchicalType = (HierarchicalType) newType; //validate on supertypes if ((newHierarchicalType.superTypes.size() != superTypes.size()) ...
[ "@", "Override", "public", "void", "validateUpdate", "(", "IDataType", "newType", ")", "throws", "TypeUpdateException", "{", "super", ".", "validateUpdate", "(", "newType", ")", ";", "HierarchicalType", "newHierarchicalType", "=", "(", "HierarchicalType", ")", "newT...
Validate that current definition can be updated with the new definition @param newType @return true if the current definition can be updated with the new definition, else false
[ "Validate", "that", "current", "definition", "can", "be", "updated", "with", "the", "new", "definition" ]
train
https://github.com/apache/incubator-atlas/blob/e0d2cdc27c32742ebecd24db4cca62dc04dcdf4b/typesystem/src/main/java/org/apache/atlas/typesystem/types/HierarchicalType.java#L121-L140
alkacon/opencms-core
src/org/opencms/widgets/A_CmsHtmlWidget.java
A_CmsHtmlWidget.buildOpenCmsButtonRow
protected String buildOpenCmsButtonRow(I_CmsWidgetDialog widgetDialog, String paramId) { """ Returns the HTML for the OpenCms specific button row for galleries and links.<p> Use this method to generate a button row with OpenCms specific dialog buttons in the {@link org.opencms.widgets.I_CmsWidget#getDialogWidg...
java
protected String buildOpenCmsButtonRow(I_CmsWidgetDialog widgetDialog, String paramId) { StringBuffer result = new StringBuffer(2048); // flag indicating if at least one button is active boolean buttonsActive = false; // generate button row start HTML result.append(buildOpenCms...
[ "protected", "String", "buildOpenCmsButtonRow", "(", "I_CmsWidgetDialog", "widgetDialog", ",", "String", "paramId", ")", "{", "StringBuffer", "result", "=", "new", "StringBuffer", "(", "2048", ")", ";", "// flag indicating if at least one button is active", "boolean", "bu...
Returns the HTML for the OpenCms specific button row for galleries and links.<p> Use this method to generate a button row with OpenCms specific dialog buttons in the {@link org.opencms.widgets.I_CmsWidget#getDialogWidget(org.opencms.file.CmsObject, org.opencms.widgets.I_CmsWidgetDialog, org.opencms.widgets.I_CmsWidget...
[ "Returns", "the", "HTML", "for", "the", "OpenCms", "specific", "button", "row", "for", "galleries", "and", "links", ".", "<p", ">" ]
train
https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/widgets/A_CmsHtmlWidget.java#L151-L202
Azure/azure-sdk-for-java
cognitiveservices/data-plane/language/luis/authoring/src/main/java/com/microsoft/azure/cognitiveservices/language/luis/authoring/implementation/ModelsImpl.java
ModelsImpl.getEntityAsync
public Observable<EntityExtractor> getEntityAsync(UUID appId, String versionId, UUID entityId) { """ Gets information about the entity model. @param appId The application ID. @param versionId The version ID. @param entityId The entity extractor ID. @throws IllegalArgumentException thrown if parameters fail t...
java
public Observable<EntityExtractor> getEntityAsync(UUID appId, String versionId, UUID entityId) { return getEntityWithServiceResponseAsync(appId, versionId, entityId).map(new Func1<ServiceResponse<EntityExtractor>, EntityExtractor>() { @Override public EntityExtractor call(ServiceResponse...
[ "public", "Observable", "<", "EntityExtractor", ">", "getEntityAsync", "(", "UUID", "appId", ",", "String", "versionId", ",", "UUID", "entityId", ")", "{", "return", "getEntityWithServiceResponseAsync", "(", "appId", ",", "versionId", ",", "entityId", ")", ".", ...
Gets information about the entity model. @param appId The application ID. @param versionId The version ID. @param entityId The entity extractor ID. @throws IllegalArgumentException thrown if parameters fail the validation @return the observable to the EntityExtractor object
[ "Gets", "information", "about", "the", "entity", "model", "." ]
train
https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/cognitiveservices/data-plane/language/luis/authoring/src/main/java/com/microsoft/azure/cognitiveservices/language/luis/authoring/implementation/ModelsImpl.java#L3312-L3319
Netflix/spectator
spectator-api/src/main/java/com/netflix/spectator/api/patterns/CardinalityLimiters.java
CardinalityLimiters.mostFrequent
static Function<String, String> mostFrequent(int n, Clock clock) { """ Allows the clock to be specified for testing. See {@link #mostFrequent(int)} for details on the usage. """ return new MostFrequentLimiter(Math.min(n, MAX_LIMIT), clock); }
java
static Function<String, String> mostFrequent(int n, Clock clock) { return new MostFrequentLimiter(Math.min(n, MAX_LIMIT), clock); }
[ "static", "Function", "<", "String", ",", "String", ">", "mostFrequent", "(", "int", "n", ",", "Clock", "clock", ")", "{", "return", "new", "MostFrequentLimiter", "(", "Math", ".", "min", "(", "n", ",", "MAX_LIMIT", ")", ",", "clock", ")", ";", "}" ]
Allows the clock to be specified for testing. See {@link #mostFrequent(int)} for details on the usage.
[ "Allows", "the", "clock", "to", "be", "specified", "for", "testing", ".", "See", "{" ]
train
https://github.com/Netflix/spectator/blob/259318252770de3bad581b85adff187d8f2c6537/spectator-api/src/main/java/com/netflix/spectator/api/patterns/CardinalityLimiters.java#L138-L140
xiancloud/xian
xian-oauth20/xian-apifestOauth20/src/main/java/com/apifest/oauth20/ScopeService.java
ScopeService.updateScope
public String updateScope(FullHttpRequest req, String scopeName) throws OAuthException { """ Updates a scope. If the scope does not exists, returns an error. @param req http request @return String message that will be returned in the response """ String contentType = (req.headers() != null) ? req.h...
java
public String updateScope(FullHttpRequest req, String scopeName) throws OAuthException { String contentType = (req.headers() != null) ? req.headers().get(HttpHeaderNames.CONTENT_TYPE) : null; // check Content-Type if (contentType != null && contentType.contains(ResponseBuilder.APPLICATION_JSON))...
[ "public", "String", "updateScope", "(", "FullHttpRequest", "req", ",", "String", "scopeName", ")", "throws", "OAuthException", "{", "String", "contentType", "=", "(", "req", ".", "headers", "(", ")", "!=", "null", ")", "?", "req", ".", "headers", "(", ")",...
Updates a scope. If the scope does not exists, returns an error. @param req http request @return String message that will be returned in the response
[ "Updates", "a", "scope", ".", "If", "the", "scope", "does", "not", "exists", "returns", "an", "error", "." ]
train
https://github.com/xiancloud/xian/blob/1948e088545553d2745b2c86d8b5a64988bb850e/xian-oauth20/xian-apifestOauth20/src/main/java/com/apifest/oauth20/ScopeService.java#L216-L243
qspin/qtaste
kernel/src/main/java/com/qspin/qtaste/validator/CacheValidator.java
CacheValidator.check
public static void check(LinkedHashMap<String, Object> nameExpectedValues, long timeout) throws QTasteTestFailException { """ Note that since nameExpectedValues is a map, it can only contain one expected value per name. """ check(nameExpectedValues, timeout, null); }
java
public static void check(LinkedHashMap<String, Object> nameExpectedValues, long timeout) throws QTasteTestFailException { check(nameExpectedValues, timeout, null); }
[ "public", "static", "void", "check", "(", "LinkedHashMap", "<", "String", ",", "Object", ">", "nameExpectedValues", ",", "long", "timeout", ")", "throws", "QTasteTestFailException", "{", "check", "(", "nameExpectedValues", ",", "timeout", ",", "null", ")", ";", ...
Note that since nameExpectedValues is a map, it can only contain one expected value per name.
[ "Note", "that", "since", "nameExpectedValues", "is", "a", "map", "it", "can", "only", "contain", "one", "expected", "value", "per", "name", "." ]
train
https://github.com/qspin/qtaste/blob/ba45d4d86eb29b92f157c6e98536dee2002ddfdc/kernel/src/main/java/com/qspin/qtaste/validator/CacheValidator.java#L59-L61
ysc/word
src/main/java/org/apdplat/word/segmentation/impl/AbstractSegmentation.java
AbstractSegmentation.addWord
protected void addWord(List<Word> result, String text, int start, int len) { """ 将识别出的词放入队列 @param result 队列 @param text 文本 @param start 词开始索引 @param len 词长度 """ Word word = getWord(text, start, len); if(word != null){ result.add(word); } }
java
protected void addWord(List<Word> result, String text, int start, int len){ Word word = getWord(text, start, len); if(word != null){ result.add(word); } }
[ "protected", "void", "addWord", "(", "List", "<", "Word", ">", "result", ",", "String", "text", ",", "int", "start", ",", "int", "len", ")", "{", "Word", "word", "=", "getWord", "(", "text", ",", "start", ",", "len", ")", ";", "if", "(", "word", ...
将识别出的词放入队列 @param result 队列 @param text 文本 @param start 词开始索引 @param len 词长度
[ "将识别出的词放入队列" ]
train
https://github.com/ysc/word/blob/5e45607f4e97207f55d1e3bc561abda6b34f7c54/src/main/java/org/apdplat/word/segmentation/impl/AbstractSegmentation.java#L200-L205
google/error-prone-javac
src/jdk.jshell/share/classes/jdk/jshell/execution/RemoteExecutionControl.java
RemoteExecutionControl.main
public static void main(String[] args) throws Exception { """ Launch the agent, connecting to the JShell-core over the socket specified in the command-line argument. @param args standard command-line arguments, expectation is the socket number is the only argument @throws Exception any unexpected exception ...
java
public static void main(String[] args) throws Exception { String loopBack = null; Socket socket = new Socket(loopBack, Integer.parseInt(args[0])); InputStream inStream = socket.getInputStream(); OutputStream outStream = socket.getOutputStream(); Map<String, Consumer<OutputStream>...
[ "public", "static", "void", "main", "(", "String", "[", "]", "args", ")", "throws", "Exception", "{", "String", "loopBack", "=", "null", ";", "Socket", "socket", "=", "new", "Socket", "(", "loopBack", ",", "Integer", ".", "parseInt", "(", "args", "[", ...
Launch the agent, connecting to the JShell-core over the socket specified in the command-line argument. @param args standard command-line arguments, expectation is the socket number is the only argument @throws Exception any unexpected exception
[ "Launch", "the", "agent", "connecting", "to", "the", "JShell", "-", "core", "over", "the", "socket", "specified", "in", "the", "command", "-", "line", "argument", "." ]
train
https://github.com/google/error-prone-javac/blob/a53d069bbdb2c60232ed3811c19b65e41c3e60e0/src/jdk.jshell/share/classes/jdk/jshell/execution/RemoteExecutionControl.java#L60-L71
ManfredTremmel/gwt-commons-lang3
src/main/java/org/apache/commons/lang3/reflect/FieldUtils.java
FieldUtils.writeStaticField
public static void writeStaticField(final Class<?> cls, final String fieldName, final Object value) throws IllegalAccessException { """ Writes a named {@code public static} {@link Field}. Superclasses will be considered. @param cls {@link Class} on which the field is to be found @param fieldName to write @p...
java
public static void writeStaticField(final Class<?> cls, final String fieldName, final Object value) throws IllegalAccessException { writeStaticField(cls, fieldName, value, false); }
[ "public", "static", "void", "writeStaticField", "(", "final", "Class", "<", "?", ">", "cls", ",", "final", "String", "fieldName", ",", "final", "Object", "value", ")", "throws", "IllegalAccessException", "{", "writeStaticField", "(", "cls", ",", "fieldName", "...
Writes a named {@code public static} {@link Field}. Superclasses will be considered. @param cls {@link Class} on which the field is to be found @param fieldName to write @param value to set @throws IllegalArgumentException if {@code cls} is {@code null}, the field name is blank or empty, the field cannot be located or...
[ "Writes", "a", "named", "{", "@code", "public", "static", "}", "{", "@link", "Field", "}", ".", "Superclasses", "will", "be", "considered", "." ]
train
https://github.com/ManfredTremmel/gwt-commons-lang3/blob/9e2dfbbda3668cfa5d935fe76479d1426c294504/src/main/java/org/apache/commons/lang3/reflect/FieldUtils.java#L572-L574
Azure/azure-sdk-for-java
cognitiveservices/data-plane/vision/faceapi/src/main/java/com/microsoft/azure/cognitiveservices/vision/faceapi/FaceAPIManager.java
FaceAPIManager.authenticate
public static FaceAPI authenticate(AzureRegions region, ServiceClientCredentials credentials) { """ Initializes an instance of Face API client. @param region Supported Azure regions for Cognitive Services endpoints. @param credentials the management credentials for Azure @return the Face API client """ ...
java
public static FaceAPI authenticate(AzureRegions region, ServiceClientCredentials credentials) { return authenticate("https://{AzureRegion}.api.cognitive.microsoft.com/face/v1.0/", credentials) .withAzureRegion(region); }
[ "public", "static", "FaceAPI", "authenticate", "(", "AzureRegions", "region", ",", "ServiceClientCredentials", "credentials", ")", "{", "return", "authenticate", "(", "\"https://{AzureRegion}.api.cognitive.microsoft.com/face/v1.0/\"", ",", "credentials", ")", ".", "withAzureR...
Initializes an instance of Face API client. @param region Supported Azure regions for Cognitive Services endpoints. @param credentials the management credentials for Azure @return the Face API client
[ "Initializes", "an", "instance", "of", "Face", "API", "client", "." ]
train
https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/cognitiveservices/data-plane/vision/faceapi/src/main/java/com/microsoft/azure/cognitiveservices/vision/faceapi/FaceAPIManager.java#L72-L75
looly/hutool
hutool-core/src/main/java/cn/hutool/core/img/ImgUtil.java
ImgUtil.convert
public static void convert(Image srcImage, String formatName, ImageOutputStream destImageStream, boolean isSrcPng) { """ 图像类型转换:GIF=》JPG、GIF=》PNG、PNG=》JPG、PNG=》GIF(X)、BMP=》PNG<br> 此方法并不关闭流 @param srcImage 源图像流 @param formatName 包含格式非正式名称的 String:如JPG、JPEG、GIF等 @param destImageStream 目标图像输出流 @param isSrcPng ...
java
public static void convert(Image srcImage, String formatName, ImageOutputStream destImageStream, boolean isSrcPng) { try { ImageIO.write(isSrcPng ? copyImage(srcImage, BufferedImage.TYPE_INT_RGB) : toBufferedImage(srcImage), formatName, destImageStream); } catch (IOException e) { throw new IORuntimeExcept...
[ "public", "static", "void", "convert", "(", "Image", "srcImage", ",", "String", "formatName", ",", "ImageOutputStream", "destImageStream", ",", "boolean", "isSrcPng", ")", "{", "try", "{", "ImageIO", ".", "write", "(", "isSrcPng", "?", "copyImage", "(", "srcIm...
图像类型转换:GIF=》JPG、GIF=》PNG、PNG=》JPG、PNG=》GIF(X)、BMP=》PNG<br> 此方法并不关闭流 @param srcImage 源图像流 @param formatName 包含格式非正式名称的 String:如JPG、JPEG、GIF等 @param destImageStream 目标图像输出流 @param isSrcPng 源图片是否为PNG格式 @since 4.1.14
[ "图像类型转换:GIF", "=", "》JPG、GIF", "=", "》PNG、PNG", "=", "》JPG、PNG", "=", "》GIF", "(", "X", ")", "、BMP", "=", "》PNG<br", ">", "此方法并不关闭流" ]
train
https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-core/src/main/java/cn/hutool/core/img/ImgUtil.java#L565-L571
LearnLib/automatalib
util/src/main/java/net/automatalib/util/automata/transducers/StateLocalInputMealyUtil.java
StateLocalInputMealyUtil.partialToObservableOutput
public static <I, O> StateLocalInputMealyMachine<Integer, I, ?, OutputAndLocalInputs<I, O>> partialToObservableOutput( StateLocalInputMealyMachine<Integer, I, ?, O> reference) { """ Convenience method for {@link #partialToObservableOutput(StateLocalInputMealyMachine, Object)}, where the size of the gi...
java
public static <I, O> StateLocalInputMealyMachine<Integer, I, ?, OutputAndLocalInputs<I, O>> partialToObservableOutput( StateLocalInputMealyMachine<Integer, I, ?, O> reference) { return partialToObservableOutput(reference, reference.size()); }
[ "public", "static", "<", "I", ",", "O", ">", "StateLocalInputMealyMachine", "<", "Integer", ",", "I", ",", "?", ",", "OutputAndLocalInputs", "<", "I", ",", "O", ">", ">", "partialToObservableOutput", "(", "StateLocalInputMealyMachine", "<", "Integer", ",", "I"...
Convenience method for {@link #partialToObservableOutput(StateLocalInputMealyMachine, Object)}, where the size of the given reference is used as the new sink state. @param reference the (partial) mealy to transform @param <I> input symbol type @param <O> output symbol type @return see {@link #partialToObservableOutpu...
[ "Convenience", "method", "for", "{", "@link", "#partialToObservableOutput", "(", "StateLocalInputMealyMachine", "Object", ")", "}", "where", "the", "size", "of", "the", "given", "reference", "is", "used", "as", "the", "new", "sink", "state", "." ]
train
https://github.com/LearnLib/automatalib/blob/8a462ec52f6eaab9f8996e344f2163a72cb8aa6e/util/src/main/java/net/automatalib/util/automata/transducers/StateLocalInputMealyUtil.java#L53-L56
elki-project/elki
elki-core-distance/src/main/java/de/lmu/ifi/dbs/elki/distance/distancefunction/correlation/UncenteredCorrelationDistanceFunction.java
UncenteredCorrelationDistanceFunction.uncenteredCorrelation
public static double uncenteredCorrelation(double[] x, double[] y) { """ Compute the uncentered correlation of two vectors. @param x first NumberVector @param y second NumberVector @return the uncentered correlation coefficient for x and y """ final int xdim = x.length, ydim = y.length; if(xdim !=...
java
public static double uncenteredCorrelation(double[] x, double[] y) { final int xdim = x.length, ydim = y.length; if(xdim != ydim) { throw new IllegalArgumentException("Invalid arguments: number vectors differ in dimensionality."); } double sumXX = 0., sumYY = 0., sumXY = 0.; for(int i = 0; i <...
[ "public", "static", "double", "uncenteredCorrelation", "(", "double", "[", "]", "x", ",", "double", "[", "]", "y", ")", "{", "final", "int", "xdim", "=", "x", ".", "length", ",", "ydim", "=", "y", ".", "length", ";", "if", "(", "xdim", "!=", "ydim"...
Compute the uncentered correlation of two vectors. @param x first NumberVector @param y second NumberVector @return the uncentered correlation coefficient for x and y
[ "Compute", "the", "uncentered", "correlation", "of", "two", "vectors", "." ]
train
https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-core-distance/src/main/java/de/lmu/ifi/dbs/elki/distance/distancefunction/correlation/UncenteredCorrelationDistanceFunction.java#L86-L103
Azure/azure-sdk-for-java
compute/resource-manager/v2017_12_01/src/main/java/com/microsoft/azure/management/compute/v2017_12_01/implementation/VirtualMachineScaleSetsInner.java
VirtualMachineScaleSetsInner.forceRecoveryServiceFabricPlatformUpdateDomainWalkAsync
public Observable<RecoveryWalkResponseInner> forceRecoveryServiceFabricPlatformUpdateDomainWalkAsync(String resourceGroupName, String vmScaleSetName, int platformUpdateDomain) { """ Manual platform update domain walk to update virtual machines in a service fabric virtual machine scale set. @param resourceGroupN...
java
public Observable<RecoveryWalkResponseInner> forceRecoveryServiceFabricPlatformUpdateDomainWalkAsync(String resourceGroupName, String vmScaleSetName, int platformUpdateDomain) { return forceRecoveryServiceFabricPlatformUpdateDomainWalkWithServiceResponseAsync(resourceGroupName, vmScaleSetName, platformUpdateDom...
[ "public", "Observable", "<", "RecoveryWalkResponseInner", ">", "forceRecoveryServiceFabricPlatformUpdateDomainWalkAsync", "(", "String", "resourceGroupName", ",", "String", "vmScaleSetName", ",", "int", "platformUpdateDomain", ")", "{", "return", "forceRecoveryServiceFabricPlatfo...
Manual platform update domain walk to update virtual machines in a service fabric virtual machine scale set. @param resourceGroupName The name of the resource group. @param vmScaleSetName The name of the VM scale set. @param platformUpdateDomain The platform update domain for which a manual recovery walk is requested ...
[ "Manual", "platform", "update", "domain", "walk", "to", "update", "virtual", "machines", "in", "a", "service", "fabric", "virtual", "machine", "scale", "set", "." ]
train
https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/compute/resource-manager/v2017_12_01/src/main/java/com/microsoft/azure/management/compute/v2017_12_01/implementation/VirtualMachineScaleSetsInner.java#L4384-L4391
devnied/Bit-lib4j
src/main/java/fr/devnied/bitlib/BitUtils.java
BitUtils.setNextDate
public void setNextDate(final Date pValue, final String pPattern, final boolean pUseBcd) { """ Method to write a date @param pValue the value to write @param pPattern the Date pattern @param pUseBcd write date as BCD (binary coded decimal) """ // create date formatter SimpleDateFormat sdf = new S...
java
public void setNextDate(final Date pValue, final String pPattern, final boolean pUseBcd) { // create date formatter SimpleDateFormat sdf = new SimpleDateFormat(pPattern); String value = sdf.format(pValue); if (pUseBcd) { setNextHexaString(value, value.length() * 4); } else { setNextString(value...
[ "public", "void", "setNextDate", "(", "final", "Date", "pValue", ",", "final", "String", "pPattern", ",", "final", "boolean", "pUseBcd", ")", "{", "// create date formatter\r", "SimpleDateFormat", "sdf", "=", "new", "SimpleDateFormat", "(", "pPattern", ")", ";", ...
Method to write a date @param pValue the value to write @param pPattern the Date pattern @param pUseBcd write date as BCD (binary coded decimal)
[ "Method", "to", "write", "a", "date" ]
train
https://github.com/devnied/Bit-lib4j/blob/bdfa79fd12e7e3d5cf1196291825ef1bb12a1ee0/src/main/java/fr/devnied/bitlib/BitUtils.java#L536-L546
Mozu/mozu-java
mozu-java-core/src/main/java/com/mozu/api/urls/commerce/checkouts/DestinationUrl.java
DestinationUrl.addDestinationUrl
public static MozuUrl addDestinationUrl(String checkoutId, String responseFields) { """ Get Resource Url for AddDestination @param checkoutId The unique identifier of the checkout. @param responseFields Filtering syntax appended to an API call to increase or decrease the amount of data returned inside a JSON obj...
java
public static MozuUrl addDestinationUrl(String checkoutId, String responseFields) { UrlFormatter formatter = new UrlFormatter("/api/commerce/checkouts/{checkoutId}/destinations?responseFields={responseFields}"); formatter.formatUrl("checkoutId", checkoutId); formatter.formatUrl("responseFields", responseFiel...
[ "public", "static", "MozuUrl", "addDestinationUrl", "(", "String", "checkoutId", ",", "String", "responseFields", ")", "{", "UrlFormatter", "formatter", "=", "new", "UrlFormatter", "(", "\"/api/commerce/checkouts/{checkoutId}/destinations?responseFields={responseFields}\"", ")"...
Get Resource Url for AddDestination @param checkoutId The unique identifier of the checkout. @param responseFields Filtering syntax appended to an API call to increase or decrease the amount of data returned inside a JSON object. This parameter should only be used to retrieve data. Attempting to update data using this ...
[ "Get", "Resource", "Url", "for", "AddDestination" ]
train
https://github.com/Mozu/mozu-java/blob/5beadde73601a859f845e3e2fc1077b39c8bea83/mozu-java-core/src/main/java/com/mozu/api/urls/commerce/checkouts/DestinationUrl.java#L50-L56
di2e/Argo
Responder/ResponderDaemon/src/main/java/ws/argo/responder/Responder.java
Responder.addHandler
private void addHandler(String classname, String configFilename) throws ProbeHandlerConfigException { """ Add a new handler given the classname and config filename. It instantiates the class and then calls its initialization method to get the handler ready to process inbound probes. @param classname is the FQ...
java
private void addHandler(String classname, String configFilename) throws ProbeHandlerConfigException { ClassLoader cl = ClassLoader.getSystemClassLoader(); Class<?> handlerClass; try { handlerClass = cl.loadClass(classname); } catch (ClassNotFoundException e1) { throw new ProbeHandlerConfigE...
[ "private", "void", "addHandler", "(", "String", "classname", ",", "String", "configFilename", ")", "throws", "ProbeHandlerConfigException", "{", "ClassLoader", "cl", "=", "ClassLoader", ".", "getSystemClassLoader", "(", ")", ";", "Class", "<", "?", ">", "handlerCl...
Add a new handler given the classname and config filename. It instantiates the class and then calls its initialization method to get the handler ready to process inbound probes. @param classname is the FQCN of the handler class @param configFilename is the full path name of the config file name specific for the handle...
[ "Add", "a", "new", "handler", "given", "the", "classname", "and", "config", "filename", ".", "It", "instantiates", "the", "class", "and", "then", "calls", "its", "initialization", "method", "to", "get", "the", "handler", "ready", "to", "process", "inbound", ...
train
https://github.com/di2e/Argo/blob/f537a03d2d25fdfecda7999ec10e1da67dc3b8f3/Responder/ResponderDaemon/src/main/java/ws/argo/responder/Responder.java#L265-L287
Wadpam/guja
guja-core/src/main/java/com/wadpam/guja/oauth2/dao/GeneratedDConnectionDaoImpl.java
GeneratedDConnectionDaoImpl.queryByUserId
public Iterable<DConnection> queryByUserId(java.lang.Long userId) { """ query-by method for field userId @param userId the specified attribute @return an Iterable of DConnections for the specified userId """ return queryByField(null, DConnectionMapper.Field.USERID.getFieldName(), userId); }
java
public Iterable<DConnection> queryByUserId(java.lang.Long userId) { return queryByField(null, DConnectionMapper.Field.USERID.getFieldName(), userId); }
[ "public", "Iterable", "<", "DConnection", ">", "queryByUserId", "(", "java", ".", "lang", ".", "Long", "userId", ")", "{", "return", "queryByField", "(", "null", ",", "DConnectionMapper", ".", "Field", ".", "USERID", ".", "getFieldName", "(", ")", ",", "us...
query-by method for field userId @param userId the specified attribute @return an Iterable of DConnections for the specified userId
[ "query", "-", "by", "method", "for", "field", "userId" ]
train
https://github.com/Wadpam/guja/blob/eb8ba8e6794a96ea0dd9744cada4f9ad9618f114/guja-core/src/main/java/com/wadpam/guja/oauth2/dao/GeneratedDConnectionDaoImpl.java#L169-L171
Azure/azure-sdk-for-java
keyvault/data-plane/azure-keyvault/src/main/java/com/microsoft/azure/keyvault/implementation/KeyVaultClientBaseImpl.java
KeyVaultClientBaseImpl.restoreCertificate
public CertificateBundle restoreCertificate(String vaultBaseUrl, byte[] certificateBundleBackup) { """ Restores a backed up certificate to a vault. Restores a backed up certificate, and all its versions, to a vault. This operation requires the certificates/restore permission. @param vaultBaseUrl The vault name...
java
public CertificateBundle restoreCertificate(String vaultBaseUrl, byte[] certificateBundleBackup) { return restoreCertificateWithServiceResponseAsync(vaultBaseUrl, certificateBundleBackup).toBlocking().single().body(); }
[ "public", "CertificateBundle", "restoreCertificate", "(", "String", "vaultBaseUrl", ",", "byte", "[", "]", "certificateBundleBackup", ")", "{", "return", "restoreCertificateWithServiceResponseAsync", "(", "vaultBaseUrl", ",", "certificateBundleBackup", ")", ".", "toBlocking...
Restores a backed up certificate to a vault. Restores a backed up certificate, and all its versions, to a vault. This operation requires the certificates/restore permission. @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. @param certificateBundleBackup The backup blob associated with a...
[ "Restores", "a", "backed", "up", "certificate", "to", "a", "vault", ".", "Restores", "a", "backed", "up", "certificate", "and", "all", "its", "versions", "to", "a", "vault", ".", "This", "operation", "requires", "the", "certificates", "/", "restore", "permis...
train
https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/keyvault/data-plane/azure-keyvault/src/main/java/com/microsoft/azure/keyvault/implementation/KeyVaultClientBaseImpl.java#L8203-L8205
jbundle/jbundle
base/base/src/main/java/org/jbundle/base/field/event/CopyLastHandler.java
CopyLastHandler.init
public void init(BaseField field, BaseField fldTarget, Converter checkMark, String fieldName) { """ Constructor. @param field The basefield owner of this listener (usually null and set on setOwner()). @param field The destination last name field. @param iFieldSeq The sequence of the last name field in this reco...
java
public void init(BaseField field, BaseField fldTarget, Converter checkMark, String fieldName) { super.init(field, fldTarget, checkMark, fieldName); }
[ "public", "void", "init", "(", "BaseField", "field", ",", "BaseField", "fldTarget", ",", "Converter", "checkMark", ",", "String", "fieldName", ")", "{", "super", ".", "init", "(", "field", ",", "fldTarget", ",", "checkMark", ",", "fieldName", ")", ";", "}"...
Constructor. @param field The basefield owner of this listener (usually null and set on setOwner()). @param field The destination last name field. @param iFieldSeq The sequence of the last name field in this record. @param checkMark If false, do not move the last name.
[ "Constructor", "." ]
train
https://github.com/jbundle/jbundle/blob/4037fcfa85f60c7d0096c453c1a3cd573c2b0abc/base/base/src/main/java/org/jbundle/base/field/event/CopyLastHandler.java#L70-L73
pravega/pravega
common/src/main/java/io/pravega/common/util/btree/BTreePage.java
BTreePage.formatHeaderAndFooter
private void formatHeaderAndFooter(int itemCount, int id) { """ Formats the Header and Footer of this BTreePage with the given information. @param itemCount The number of items in this BTreePage. @param id The Id of this BTreePage. """ // Header. this.header.set(VERSION_OFFSET, CURRE...
java
private void formatHeaderAndFooter(int itemCount, int id) { // Header. this.header.set(VERSION_OFFSET, CURRENT_VERSION); this.header.set(FLAGS_OFFSET, getFlags(this.config.isIndexPage ? FLAG_INDEX_PAGE : FLAG_NONE)); setHeaderId(id); setCount(itemCount); // Matching foot...
[ "private", "void", "formatHeaderAndFooter", "(", "int", "itemCount", ",", "int", "id", ")", "{", "// Header.", "this", ".", "header", ".", "set", "(", "VERSION_OFFSET", ",", "CURRENT_VERSION", ")", ";", "this", ".", "header", ".", "set", "(", "FLAGS_OFFSET",...
Formats the Header and Footer of this BTreePage with the given information. @param itemCount The number of items in this BTreePage. @param id The Id of this BTreePage.
[ "Formats", "the", "Header", "and", "Footer", "of", "this", "BTreePage", "with", "the", "given", "information", "." ]
train
https://github.com/pravega/pravega/blob/6e24df7470669b3956a07018f52b2c6b3c2a3503/common/src/main/java/io/pravega/common/util/btree/BTreePage.java#L202-L211
pinterest/secor
src/main/java/com/pinterest/secor/util/ReflectionUtil.java
ReflectionUtil.createFileReader
public static FileReader createFileReader(String className, LogFilePath logFilePath, CompressionCodec codec, SecorConfig config) throws Exception { """ Use the FileReaderWriterFactory specified by className to b...
java
public static FileReader createFileReader(String className, LogFilePath logFilePath, CompressionCodec codec, SecorConfig config) throws Exception { return createFileReaderWriterFactory(className, config).Buil...
[ "public", "static", "FileReader", "createFileReader", "(", "String", "className", ",", "LogFilePath", "logFilePath", ",", "CompressionCodec", "codec", ",", "SecorConfig", "config", ")", "throws", "Exception", "{", "return", "createFileReaderWriterFactory", "(", "classNa...
Use the FileReaderWriterFactory specified by className to build a FileReader @param className the class name of a subclass of FileReaderWriterFactory to create a FileReader from @param logFilePath the LogFilePath that the returned FileReader should read from @param codec an instance CompressionCodec to decompress the ...
[ "Use", "the", "FileReaderWriterFactory", "specified", "by", "className", "to", "build", "a", "FileReader" ]
train
https://github.com/pinterest/secor/blob/4099ff061db392f11044e57dedf46c1617895278/src/main/java/com/pinterest/secor/util/ReflectionUtil.java#L169-L174
albfernandez/itext2
src/main/java/com/lowagie/text/pdf/PdfFileSpecification.java
PdfFileSpecification.fileEmbedded
public static PdfFileSpecification fileEmbedded(PdfWriter writer, String filePath, String fileDisplay, byte fileStore[], boolean compress) throws IOException { """ Creates a file specification with the file embedded. The file may come from the file system or from a byte array. @param writer the <CODE>PdfWriter</...
java
public static PdfFileSpecification fileEmbedded(PdfWriter writer, String filePath, String fileDisplay, byte fileStore[], boolean compress) throws IOException { return fileEmbedded(writer, filePath, fileDisplay, fileStore, null, null, compress ? PdfStream.BEST_COMPRESSION : PdfStream.NO_COMPRESSION); }
[ "public", "static", "PdfFileSpecification", "fileEmbedded", "(", "PdfWriter", "writer", ",", "String", "filePath", ",", "String", "fileDisplay", ",", "byte", "fileStore", "[", "]", ",", "boolean", "compress", ")", "throws", "IOException", "{", "return", "fileEmbed...
Creates a file specification with the file embedded. The file may come from the file system or from a byte array. @param writer the <CODE>PdfWriter</CODE> @param filePath the file path @param fileDisplay the file information that is presented to the user @param fileStore the byte array with the file. If it is not <CODE...
[ "Creates", "a", "file", "specification", "with", "the", "file", "embedded", ".", "The", "file", "may", "come", "from", "the", "file", "system", "or", "from", "a", "byte", "array", "." ]
train
https://github.com/albfernandez/itext2/blob/438fc1899367fd13dfdfa8dfdca9a3c1a7783b84/src/main/java/com/lowagie/text/pdf/PdfFileSpecification.java#L131-L133
Stratio/stratio-connector-commons
connector-commons/src/main/java/com/stratio/connector/commons/engine/CommonsStorageEngine.java
CommonsStorageEngine.truncate
@Override public final void truncate(ClusterName targetCluster, TableName tableName) throws UnsupportedException, ExecutionException { """ This method deletes all the rows of a table. @param targetCluster Target cluster. @param tableName Target table name including fully qualified including...
java
@Override public final void truncate(ClusterName targetCluster, TableName tableName) throws UnsupportedException, ExecutionException { try { connectionHandler.startJob(targetCluster.getName()); if (logger.isDebugEnabled()) { logger.debug( ...
[ "@", "Override", "public", "final", "void", "truncate", "(", "ClusterName", "targetCluster", ",", "TableName", "tableName", ")", "throws", "UnsupportedException", ",", "ExecutionException", "{", "try", "{", "connectionHandler", ".", "startJob", "(", "targetCluster", ...
This method deletes all the rows of a table. @param targetCluster Target cluster. @param tableName Target table name including fully qualified including catalog. @throws UnsupportedException @throws ExecutionException
[ "This", "method", "deletes", "all", "the", "rows", "of", "a", "table", "." ]
train
https://github.com/Stratio/stratio-connector-commons/blob/d7cc66cb9591344a13055962e87a91f01c3707d1/connector-commons/src/main/java/com/stratio/connector/commons/engine/CommonsStorageEngine.java#L196-L215
looly/hutool
hutool-core/src/main/java/cn/hutool/core/io/FileUtil.java
FileUtil.readString
public static String readString(URL url, String charset) throws IORuntimeException { """ 读取文件内容 @param url 文件URL @param charset 字符集 @return 内容 @throws IORuntimeException IO异常 """ if (url == null) { throw new NullPointerException("Empty url provided!"); } InputStream in = null; try { ...
java
public static String readString(URL url, String charset) throws IORuntimeException { if (url == null) { throw new NullPointerException("Empty url provided!"); } InputStream in = null; try { in = url.openStream(); return IoUtil.read(in, charset); } catch (IOException e) { throw new IORun...
[ "public", "static", "String", "readString", "(", "URL", "url", ",", "String", "charset", ")", "throws", "IORuntimeException", "{", "if", "(", "url", "==", "null", ")", "{", "throw", "new", "NullPointerException", "(", "\"Empty url provided!\"", ")", ";", "}", ...
读取文件内容 @param url 文件URL @param charset 字符集 @return 内容 @throws IORuntimeException IO异常
[ "读取文件内容" ]
train
https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-core/src/main/java/cn/hutool/core/io/FileUtil.java#L2138-L2152
infinispan/infinispan
core/src/main/java/org/infinispan/interceptors/InvocationStage.java
InvocationStage.thenApply
public Object thenApply(InvocationContext ctx, VisitableCommand command, InvocationSuccessFunction function) { """ After the current stage completes successfully, invoke {@code function} and return its result. The result may be either a plain value, or a new {@link Invocation...
java
public Object thenApply(InvocationContext ctx, VisitableCommand command, InvocationSuccessFunction function) { return addCallback(ctx, command, function); }
[ "public", "Object", "thenApply", "(", "InvocationContext", "ctx", ",", "VisitableCommand", "command", ",", "InvocationSuccessFunction", "function", ")", "{", "return", "addCallback", "(", "ctx", ",", "command", ",", "function", ")", ";", "}" ]
After the current stage completes successfully, invoke {@code function} and return its result. The result may be either a plain value, or a new {@link InvocationStage}.
[ "After", "the", "current", "stage", "completes", "successfully", "invoke", "{", "@code", "function", "}", "and", "return", "its", "result", "." ]
train
https://github.com/infinispan/infinispan/blob/7c62b94886c3febb4774ae8376acf2baa0265ab5/core/src/main/java/org/infinispan/interceptors/InvocationStage.java#L43-L46
jamesagnew/hapi-fhir
hapi-fhir-server/src/main/java/ca/uhn/fhir/rest/server/RestfulServer.java
RestfulServer.removeResourceMethods
private void removeResourceMethods(Object theProvider, Class<?> clazz, Collection<String> resourceNames) throws ConfigurationException { """ /* Collect the set of RESTful methods for a single class when it is being unregistered """ for (Method m : ReflectionUtil.getDeclaredMethods(clazz)) { BaseMethodBin...
java
private void removeResourceMethods(Object theProvider, Class<?> clazz, Collection<String> resourceNames) throws ConfigurationException { for (Method m : ReflectionUtil.getDeclaredMethods(clazz)) { BaseMethodBinding<?> foundMethodBinding = BaseMethodBinding.bindMethod(m, getFhirContext(), theProvider); if (found...
[ "private", "void", "removeResourceMethods", "(", "Object", "theProvider", ",", "Class", "<", "?", ">", "clazz", ",", "Collection", "<", "String", ">", "resourceNames", ")", "throws", "ConfigurationException", "{", "for", "(", "Method", "m", ":", "ReflectionUtil"...
/* Collect the set of RESTful methods for a single class when it is being unregistered
[ "/", "*", "Collect", "the", "set", "of", "RESTful", "methods", "for", "a", "single", "class", "when", "it", "is", "being", "unregistered" ]
train
https://github.com/jamesagnew/hapi-fhir/blob/150a84d52fe691b7f48fcb28247c4bddb7aec352/hapi-fhir-server/src/main/java/ca/uhn/fhir/rest/server/RestfulServer.java#L1528-L1543
op4j/op4j
src/main/java/org/op4j/functions/FnFunc.java
FnFunc.ifNullOrTrueThenElse
public static final <T,R> Function<T,R> ifNullOrTrueThenElse( final Type<T> targetType, final IFunction<? super T, Boolean> condition, final IFunction<? super T,R> thenFunction, final IFunction<? super T,R> elseFunction) { """ <p> Builds a function that will execute the specified functi...
java
public static final <T,R> Function<T,R> ifNullOrTrueThenElse( final Type<T> targetType, final IFunction<? super T, Boolean> condition, final IFunction<? super T,R> thenFunction, final IFunction<? super T,R> elseFunction) { return ifTrueThenElse(targetType, FnBoolean.or(FnObject.isNul...
[ "public", "static", "final", "<", "T", ",", "R", ">", "Function", "<", "T", ",", "R", ">", "ifNullOrTrueThenElse", "(", "final", "Type", "<", "T", ">", "targetType", ",", "final", "IFunction", "<", "?", "super", "T", ",", "Boolean", ">", "condition", ...
<p> Builds a function that will execute the specified function <tt>thenFunction</tt> only if the target object is null or the result of executing <tt>condition</tt> on the target object is true, and will execute the specified function <tt>elseFunction</tt> otherwise. </p> <p> The built function can effectively change t...
[ "<p", ">", "Builds", "a", "function", "that", "will", "execute", "the", "specified", "function", "<tt", ">", "thenFunction<", "/", "tt", ">", "only", "if", "the", "target", "object", "is", "null", "or", "the", "result", "of", "executing", "<tt", ">", "co...
train
https://github.com/op4j/op4j/blob/b577596dfe462089d3dd169666defc6de7ad289a/src/main/java/org/op4j/functions/FnFunc.java#L294-L298
rythmengine/rythmengine
src/main/java/org/rythmengine/toString/ToStringStyle.java
ToStringStyle.appendDetail
protected void appendDetail(StringBuilder buffer, String fieldName, Object[] array) { """ <p>Append to the <code>toString</code> the detail of an <code>Object</code> array.</p> @param buffer the <code>StringBuilder</code> to populate @param fieldName the field name, typically not used as already appended ...
java
protected void appendDetail(StringBuilder buffer, String fieldName, Object[] array) { buffer.append(arrayStart); for (int i = 0; i < array.length; i++) { Object item = array[i]; if (i > 0) { buffer.append(arraySeparator); } if (item == null...
[ "protected", "void", "appendDetail", "(", "StringBuilder", "buffer", ",", "String", "fieldName", ",", "Object", "[", "]", "array", ")", "{", "buffer", ".", "append", "(", "arrayStart", ")", ";", "for", "(", "int", "i", "=", "0", ";", "i", "<", "array",...
<p>Append to the <code>toString</code> the detail of an <code>Object</code> array.</p> @param buffer the <code>StringBuilder</code> to populate @param fieldName the field name, typically not used as already appended @param array the array to add to the <code>toString</code>, not <code>null</code>
[ "<p", ">", "Append", "to", "the", "<code", ">", "toString<", "/", "code", ">", "the", "detail", "of", "an", "<code", ">", "Object<", "/", "code", ">", "array", ".", "<", "/", "p", ">" ]
train
https://github.com/rythmengine/rythmengine/blob/064b565f08d9da07378bf77a9dd856ea5831cc92/src/main/java/org/rythmengine/toString/ToStringStyle.java#L895-L910
apache/incubator-heron
heron/tools/apiserver/src/java/org/apache/heron/apiserver/utils/ConfigUtils.java
ConfigUtils.applyOverridesToStateManagerConfig
@SuppressWarnings("unchecked") public static void applyOverridesToStateManagerConfig(Path overridesPath, Path stateManagerPath) throws IOException { """ this is needed because the heron executor ignores the override.yaml """ final Path tempStateManagerPath = Files.createTempFile("statemgr-", CONF...
java
@SuppressWarnings("unchecked") public static void applyOverridesToStateManagerConfig(Path overridesPath, Path stateManagerPath) throws IOException { final Path tempStateManagerPath = Files.createTempFile("statemgr-", CONFIG_SUFFIX); Reader stateManagerReader = null; try ( Reader overrideRe...
[ "@", "SuppressWarnings", "(", "\"unchecked\"", ")", "public", "static", "void", "applyOverridesToStateManagerConfig", "(", "Path", "overridesPath", ",", "Path", "stateManagerPath", ")", "throws", "IOException", "{", "final", "Path", "tempStateManagerPath", "=", "Files",...
this is needed because the heron executor ignores the override.yaml
[ "this", "is", "needed", "because", "the", "heron", "executor", "ignores", "the", "override", ".", "yaml" ]
train
https://github.com/apache/incubator-heron/blob/776abe2b5a45b93a0eb957fd65cbc149d901a92a/heron/tools/apiserver/src/java/org/apache/heron/apiserver/utils/ConfigUtils.java#L130-L163
elki-project/elki
elki-clustering/src/main/java/de/lmu/ifi/dbs/elki/algorithm/clustering/subspace/PROCLUS.java
PROCLUS.avgDistance
private double avgDistance(double[] centroid, DBIDs objectIDs, Relation<V> database, int dimension) { """ Computes the average distance of the objects to the centroid along the specified dimension. @param centroid the centroid @param objectIDs the set of objects ids @param database the database holding the o...
java
private double avgDistance(double[] centroid, DBIDs objectIDs, Relation<V> database, int dimension) { Mean avg = new Mean(); for(DBIDIter iter = objectIDs.iter(); iter.valid(); iter.advance()) { V o = database.get(iter); avg.put(Math.abs(centroid[dimension] - o.doubleValue(dimension))); } re...
[ "private", "double", "avgDistance", "(", "double", "[", "]", "centroid", ",", "DBIDs", "objectIDs", ",", "Relation", "<", "V", ">", "database", ",", "int", "dimension", ")", "{", "Mean", "avg", "=", "new", "Mean", "(", ")", ";", "for", "(", "DBIDIter",...
Computes the average distance of the objects to the centroid along the specified dimension. @param centroid the centroid @param objectIDs the set of objects ids @param database the database holding the objects @param dimension the dimension for which the average distance is computed @return the average distance of the...
[ "Computes", "the", "average", "distance", "of", "the", "objects", "to", "the", "centroid", "along", "the", "specified", "dimension", "." ]
train
https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-clustering/src/main/java/de/lmu/ifi/dbs/elki/algorithm/clustering/subspace/PROCLUS.java#L689-L696
Crab2died/Excel4J
src/main/java/com/github/crab2died/ExcelUtils.java
ExcelUtils.exportObjects2Excel
public void exportObjects2Excel(List<?> data, Class clazz, boolean isWriteHeader, OutputStream os) throws Excel4JException, IOException { """ 无模板、基于注解的数据导出 @param data 待导出数据 @param clazz {@link com.github.crab2died.annotation.ExcelField}映射对象Class @param isWriteHeader 是否写入表头 @para...
java
public void exportObjects2Excel(List<?> data, Class clazz, boolean isWriteHeader, OutputStream os) throws Excel4JException, IOException { try (Workbook workbook = exportExcelNoTemplateHandler(data, clazz, isWriteHeader, null, true)) { workbook.write(os); } }
[ "public", "void", "exportObjects2Excel", "(", "List", "<", "?", ">", "data", ",", "Class", "clazz", ",", "boolean", "isWriteHeader", ",", "OutputStream", "os", ")", "throws", "Excel4JException", ",", "IOException", "{", "try", "(", "Workbook", "workbook", "=",...
无模板、基于注解的数据导出 @param data 待导出数据 @param clazz {@link com.github.crab2died.annotation.ExcelField}映射对象Class @param isWriteHeader 是否写入表头 @param os 生成的Excel待输出数据流 @throws Excel4JException 异常 @throws IOException 异常 @author Crab2Died
[ "无模板、基于注解的数据导出" ]
train
https://github.com/Crab2died/Excel4J/blob/2ab0a3b8226a69ff868c3ead6e724f3a774f5f77/src/main/java/com/github/crab2died/ExcelUtils.java#L1058-L1064
cloudinary/cloudinary_java
cloudinary-core/src/main/java/com/cloudinary/utils/StringUtils.java
StringUtils.urlEncode
public static String urlEncode(String url, Pattern unsafe, Charset charset) { """ Replaces the unsafe characters in url with url-encoded values. This is based on {@link java.net.URLEncoder#encode(String, String)} @param url The url to encode @param unsafe Regex pattern of unsafe caracters @param charset @retu...
java
public static String urlEncode(String url, Pattern unsafe, Charset charset) { StringBuffer sb = new StringBuffer(url.length()); Matcher matcher = unsafe.matcher(url); while (matcher.find()) { String str = matcher.group(0); byte[] bytes = str.getBytes(charset); ...
[ "public", "static", "String", "urlEncode", "(", "String", "url", ",", "Pattern", "unsafe", ",", "Charset", "charset", ")", "{", "StringBuffer", "sb", "=", "new", "StringBuffer", "(", "url", ".", "length", "(", ")", ")", ";", "Matcher", "matcher", "=", "u...
Replaces the unsafe characters in url with url-encoded values. This is based on {@link java.net.URLEncoder#encode(String, String)} @param url The url to encode @param unsafe Regex pattern of unsafe caracters @param charset @return An encoded url string
[ "Replaces", "the", "unsafe", "characters", "in", "url", "with", "url", "-", "encoded", "values", ".", "This", "is", "based", "on", "{" ]
train
https://github.com/cloudinary/cloudinary_java/blob/58ee1823180da2dea6a2eb7e5cf00d5a760f8aef/cloudinary-core/src/main/java/com/cloudinary/utils/StringUtils.java#L223-L244
JOML-CI/JOML
src/org/joml/Matrix3f.java
Matrix3f.rotateTowards
public Matrix3f rotateTowards(float dirX, float dirY, float dirZ, float upX, float upY, float upZ) { """ Apply a model transformation to this matrix for a right-handed coordinate system, that aligns the local <code>+Z</code> axis with <code>direction</code>. <p> If <code>M</code> is <code>this</code> matrix and...
java
public Matrix3f rotateTowards(float dirX, float dirY, float dirZ, float upX, float upY, float upZ) { return rotateTowards(dirX, dirY, dirZ, upX, upY, upZ, this); }
[ "public", "Matrix3f", "rotateTowards", "(", "float", "dirX", ",", "float", "dirY", ",", "float", "dirZ", ",", "float", "upX", ",", "float", "upY", ",", "float", "upZ", ")", "{", "return", "rotateTowards", "(", "dirX", ",", "dirY", ",", "dirZ", ",", "up...
Apply a model transformation to this matrix for a right-handed coordinate system, that aligns the local <code>+Z</code> axis with <code>direction</code>. <p> If <code>M</code> is <code>this</code> matrix and <code>L</code> the lookat matrix, then the new matrix will be <code>M * L</code>. So when transforming a vector ...
[ "Apply", "a", "model", "transformation", "to", "this", "matrix", "for", "a", "right", "-", "handed", "coordinate", "system", "that", "aligns", "the", "local", "<code", ">", "+", "Z<", "/", "code", ">", "axis", "with", "<code", ">", "direction<", "/", "co...
train
https://github.com/JOML-CI/JOML/blob/ce2652fc236b42bda3875c591f8e6645048a678f/src/org/joml/Matrix3f.java#L3922-L3924
deeplearning4j/deeplearning4j
deeplearning4j/deeplearning4j-nn/src/main/java/org/deeplearning4j/util/Convolution1DUtils.java
Convolution1DUtils.validateConvolutionModePadding
public static void validateConvolutionModePadding(ConvolutionMode mode, int padding) { """ Check that the convolution mode is consistent with the padding specification """ if (mode == ConvolutionMode.Same) { boolean nullPadding = true; if (padding != 0) nullPadding = false; ...
java
public static void validateConvolutionModePadding(ConvolutionMode mode, int padding) { if (mode == ConvolutionMode.Same) { boolean nullPadding = true; if (padding != 0) nullPadding = false; if (!nullPadding) throw new IllegalArgumentException("Padding cannot b...
[ "public", "static", "void", "validateConvolutionModePadding", "(", "ConvolutionMode", "mode", ",", "int", "padding", ")", "{", "if", "(", "mode", "==", "ConvolutionMode", ".", "Same", ")", "{", "boolean", "nullPadding", "=", "true", ";", "if", "(", "padding", ...
Check that the convolution mode is consistent with the padding specification
[ "Check", "that", "the", "convolution", "mode", "is", "consistent", "with", "the", "padding", "specification" ]
train
https://github.com/deeplearning4j/deeplearning4j/blob/effce52f2afd7eeb53c5bcca699fcd90bd06822f/deeplearning4j/deeplearning4j-nn/src/main/java/org/deeplearning4j/util/Convolution1DUtils.java#L181-L189
jcuda/jcusparse
JCusparseJava/src/main/java/jcuda/jcusparse/JCusparse.java
JCusparse.cusparseSgebsr2gebsc_bufferSize
public static int cusparseSgebsr2gebsc_bufferSize( cusparseHandle handle, int mb, int nb, int nnzb, Pointer bsrSortedVal, Pointer bsrSortedRowPtr, Pointer bsrSortedColInd, int rowBlockDim, int colBlockDim, int[] pBufferSi...
java
public static int cusparseSgebsr2gebsc_bufferSize( cusparseHandle handle, int mb, int nb, int nnzb, Pointer bsrSortedVal, Pointer bsrSortedRowPtr, Pointer bsrSortedColInd, int rowBlockDim, int colBlockDim, int[] pBufferSi...
[ "public", "static", "int", "cusparseSgebsr2gebsc_bufferSize", "(", "cusparseHandle", "handle", ",", "int", "mb", ",", "int", "nb", ",", "int", "nnzb", ",", "Pointer", "bsrSortedVal", ",", "Pointer", "bsrSortedRowPtr", ",", "Pointer", "bsrSortedColInd", ",", "int",...
Description: This routine converts a sparse matrix in general block-CSR storage format to a sparse matrix in general block-CSC storage format.
[ "Description", ":", "This", "routine", "converts", "a", "sparse", "matrix", "in", "general", "block", "-", "CSR", "storage", "format", "to", "a", "sparse", "matrix", "in", "general", "block", "-", "CSC", "storage", "format", "." ]
train
https://github.com/jcuda/jcusparse/blob/7687a62a4ef6b76cb91cf7da93d4cf5ade96a791/JCusparseJava/src/main/java/jcuda/jcusparse/JCusparse.java#L12660-L12673
fhoeben/hsac-fitnesse-fixtures
src/main/java/nl/hsac/fitnesse/fixture/util/FileUtil.java
FileUtil.streamToString
public static String streamToString(InputStream inputStream, String fileName) { """ Copies UTF-8 input stream's content to a string (closes the stream). @param inputStream input stream (UTF-8) to read. @param fileName description for stream in error messages. @return content of stream @throws RuntimeExcep...
java
public static String streamToString(InputStream inputStream, String fileName) { return streamToString(inputStream, fileName, null); }
[ "public", "static", "String", "streamToString", "(", "InputStream", "inputStream", ",", "String", "fileName", ")", "{", "return", "streamToString", "(", "inputStream", ",", "fileName", ",", "null", ")", ";", "}" ]
Copies UTF-8 input stream's content to a string (closes the stream). @param inputStream input stream (UTF-8) to read. @param fileName description for stream in error messages. @return content of stream @throws RuntimeException if content could not be read.
[ "Copies", "UTF", "-", "8", "input", "stream", "s", "content", "to", "a", "string", "(", "closes", "the", "stream", ")", "." ]
train
https://github.com/fhoeben/hsac-fitnesse-fixtures/blob/4e9018d7386a9aa65bfcbf07eb28ae064edd1732/src/main/java/nl/hsac/fitnesse/fixture/util/FileUtil.java#L55-L57
stephenc/redmine-java-api
src/main/java/org/redmine/ta/internal/RedmineJSONBuilder.java
RedmineJSONBuilder.addFull
public static void addFull(JSONWriter writer, String field, Date value) throws JSONException { """ Adds a value to a writer. @param writer writer to add object to. @param field field name to set. @param value field value. @throws JSONException if io error occurs. """ final SimpleDateFormat forma...
java
public static void addFull(JSONWriter writer, String field, Date value) throws JSONException { final SimpleDateFormat format = RedmineDateUtils.FULL_DATE_FORMAT.get(); JsonOutput.add(writer, field, value, format); }
[ "public", "static", "void", "addFull", "(", "JSONWriter", "writer", ",", "String", "field", ",", "Date", "value", ")", "throws", "JSONException", "{", "final", "SimpleDateFormat", "format", "=", "RedmineDateUtils", ".", "FULL_DATE_FORMAT", ".", "get", "(", ")", ...
Adds a value to a writer. @param writer writer to add object to. @param field field name to set. @param value field value. @throws JSONException if io error occurs.
[ "Adds", "a", "value", "to", "a", "writer", "." ]
train
https://github.com/stephenc/redmine-java-api/blob/7e5270c84aba32d74a506260ec47ff86ab6c9d84/src/main/java/org/redmine/ta/internal/RedmineJSONBuilder.java#L383-L387
gmessner/gitlab4j-api
src/main/java/org/gitlab4j/api/MergeRequestApi.java
MergeRequestApi.getMergeRequest
public MergeRequest getMergeRequest(Object projectIdOrPath, Integer mergeRequestIid) throws GitLabApiException { """ Get information about a single merge request. <p>NOTE: GitLab API V4 uses IID (internal ID), V3 uses ID to identify the merge request.</p> <pre><code>GitLab Endpoint: GET /projects/:id/merge_r...
java
public MergeRequest getMergeRequest(Object projectIdOrPath, Integer mergeRequestIid) throws GitLabApiException { Response response = get(Response.Status.OK, null, "projects", getProjectIdOrPath(projectIdOrPath), "merge_requests", mergeRequestIid); return (response.readEntity(MergeRequest.class)); }
[ "public", "MergeRequest", "getMergeRequest", "(", "Object", "projectIdOrPath", ",", "Integer", "mergeRequestIid", ")", "throws", "GitLabApiException", "{", "Response", "response", "=", "get", "(", "Response", ".", "Status", ".", "OK", ",", "null", ",", "\"projects...
Get information about a single merge request. <p>NOTE: GitLab API V4 uses IID (internal ID), V3 uses ID to identify the merge request.</p> <pre><code>GitLab Endpoint: GET /projects/:id/merge_requests/:merge_request_id</code></pre> @param projectIdOrPath the project in the form of an Integer(ID), String(path), or Pro...
[ "Get", "information", "about", "a", "single", "merge", "request", "." ]
train
https://github.com/gmessner/gitlab4j-api/blob/ab045070abac0a8f4ccbf17b5ed9bfdef5723eed/src/main/java/org/gitlab4j/api/MergeRequestApi.java#L245-L248
apache/groovy
subprojects/groovy-sql/src/main/java/groovy/sql/Sql.java
Sql.setParameters
protected void setParameters(List<Object> params, PreparedStatement statement) throws SQLException { """ Hook to allow derived classes to override behavior associated with setting params for a prepared statement. Default behavior is to append the parameters to the given statement using <code>setObject</code>. ...
java
protected void setParameters(List<Object> params, PreparedStatement statement) throws SQLException { int i = 1; ParameterMetaData metaData = getParameterMetaDataSafe(statement); if (metaData != null) { if (metaData.getParameterCount() == 0 && params.size() == 1 && params.get(0) insta...
[ "protected", "void", "setParameters", "(", "List", "<", "Object", ">", "params", ",", "PreparedStatement", "statement", ")", "throws", "SQLException", "{", "int", "i", "=", "1", ";", "ParameterMetaData", "metaData", "=", "getParameterMetaDataSafe", "(", "statement...
Hook to allow derived classes to override behavior associated with setting params for a prepared statement. Default behavior is to append the parameters to the given statement using <code>setObject</code>. @param params the parameters to append @param statement the statement @throws SQLException if a database acces...
[ "Hook", "to", "allow", "derived", "classes", "to", "override", "behavior", "associated", "with", "setting", "params", "for", "a", "prepared", "statement", ".", "Default", "behavior", "is", "to", "append", "the", "parameters", "to", "the", "given", "statement", ...
train
https://github.com/apache/groovy/blob/71cf20addb611bb8d097a59e395fd20bc7f31772/subprojects/groovy-sql/src/main/java/groovy/sql/Sql.java#L4148-L4164