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
before/uadetector
modules/uadetector-core/src/main/java/net/sf/uadetector/internal/util/RegularExpressionConverter.java
RegularExpressionConverter.convertPerlRegexToPattern
public static Pattern convertPerlRegexToPattern(@Nonnull final String regex, @Nonnull final boolean faultTolerant) { """ Converts a PERL style regular expression into Java style.<br> <br> The leading and ending slash and the modifiers will be removed. @param regex A PERL style regular expression @param faul...
java
public static Pattern convertPerlRegexToPattern(@Nonnull final String regex, @Nonnull final boolean faultTolerant) { Check.notNull(regex, "regex"); String pattern = regex.trim(); final Matcher matcher = faultTolerant ? PERL_STYLE_TOLERANT.matcher(pattern) : PERL_STYLE.matcher(pattern); if (!matcher.matches()) ...
[ "public", "static", "Pattern", "convertPerlRegexToPattern", "(", "@", "Nonnull", "final", "String", "regex", ",", "@", "Nonnull", "final", "boolean", "faultTolerant", ")", "{", "Check", ".", "notNull", "(", "regex", ",", "\"regex\"", ")", ";", "String", "patte...
Converts a PERL style regular expression into Java style.<br> <br> The leading and ending slash and the modifiers will be removed. @param regex A PERL style regular expression @param faultTolerant Fault-tolerant translating the flags @return Pattern
[ "Converts", "a", "PERL", "style", "regular", "expression", "into", "Java", "style", ".", "<br", ">", "<br", ">", "The", "leading", "and", "ending", "slash", "and", "the", "modifiers", "will", "be", "removed", "." ]
train
https://github.com/before/uadetector/blob/215fb652723c52866572cff885f52a3fe67b9db5/modules/uadetector-core/src/main/java/net/sf/uadetector/internal/util/RegularExpressionConverter.java#L300-L316
Nexmo/nexmo-java
src/main/java/com/nexmo/client/insight/InsightClient.java
InsightClient.getAdvancedNumberInsight
@Deprecated public AdvancedInsightResponse getAdvancedNumberInsight(String number, String country, String ipAddress) throws IOException, NexmoClientException { """ Perform an Advanced Insight Request with a number, country, and ipAddress. @param number A single phone number that you need insight about in...
java
@Deprecated public AdvancedInsightResponse getAdvancedNumberInsight(String number, String country, String ipAddress) throws IOException, NexmoClientException { return getAdvancedNumberInsight(AdvancedInsightRequest.builder(number) .country(country) .ipAddress(ipAddress) ...
[ "@", "Deprecated", "public", "AdvancedInsightResponse", "getAdvancedNumberInsight", "(", "String", "number", ",", "String", "country", ",", "String", "ipAddress", ")", "throws", "IOException", ",", "NexmoClientException", "{", "return", "getAdvancedNumberInsight", "(", ...
Perform an Advanced Insight Request with a number, country, and ipAddress. @param number A single phone number that you need insight about in national or international format. @param country If a number does not have a country code or it is uncertain, set the two-character country code. @param ipAddress The IP ad...
[ "Perform", "an", "Advanced", "Insight", "Request", "with", "a", "number", "country", "and", "ipAddress", "." ]
train
https://github.com/Nexmo/nexmo-java/blob/7427eff6d6baa5a5bd9197fa096bcf2564191cf5/src/main/java/com/nexmo/client/insight/InsightClient.java#L202-L208
rapidpro/expressions
java/src/main/java/io/rapidpro/expressions/functions/CustomFunctions.java
CustomFunctions.epoch
public static BigDecimal epoch(EvaluationContext ctx, Object datetime) { """ Converts the given date to the number of nanoseconds since January 1st, 1970 UTC """ Instant instant = Conversions.toDateTime(datetime, ctx).toInstant(); BigDecimal nanos = new BigDecimal(instant.getEpochSecond() * 100...
java
public static BigDecimal epoch(EvaluationContext ctx, Object datetime) { Instant instant = Conversions.toDateTime(datetime, ctx).toInstant(); BigDecimal nanos = new BigDecimal(instant.getEpochSecond() * 1000000000 + instant.getNano()); return nanos.divide(new BigDecimal(1000000000)); }
[ "public", "static", "BigDecimal", "epoch", "(", "EvaluationContext", "ctx", ",", "Object", "datetime", ")", "{", "Instant", "instant", "=", "Conversions", ".", "toDateTime", "(", "datetime", ",", "ctx", ")", ".", "toInstant", "(", ")", ";", "BigDecimal", "na...
Converts the given date to the number of nanoseconds since January 1st, 1970 UTC
[ "Converts", "the", "given", "date", "to", "the", "number", "of", "nanoseconds", "since", "January", "1st", "1970", "UTC" ]
train
https://github.com/rapidpro/expressions/blob/b03d91ec58fc328960bce90ecb5fa49dcf467627/java/src/main/java/io/rapidpro/expressions/functions/CustomFunctions.java#L63-L67
cose-wg/COSE-JAVA
src/main/java/COSE/Attribute.java
Attribute.addAttribute
public void addAttribute(CBORObject label, CBORObject value, int where) throws CoseException { """ Set an attribute in the COSE object. Setting an attribute in one map will remove it from all other maps as a side effect. @param label CBOR object which identifies the attribute in the map @param value CBOR obje...
java
public void addAttribute(CBORObject label, CBORObject value, int where) throws CoseException { removeAttribute(label); if ((label.getType() != CBORType.Number) && (label.getType() != CBORType.TextString)) { throw new CoseException("Labels must be integers or strings"); } swi...
[ "public", "void", "addAttribute", "(", "CBORObject", "label", ",", "CBORObject", "value", ",", "int", "where", ")", "throws", "CoseException", "{", "removeAttribute", "(", "label", ")", ";", "if", "(", "(", "label", ".", "getType", "(", ")", "!=", "CBORTyp...
Set an attribute in the COSE object. Setting an attribute in one map will remove it from all other maps as a side effect. @param label CBOR object which identifies the attribute in the map @param value CBOR object which contains the value of the attribute @param where Identifies which of the buckets to place the attri...
[ "Set", "an", "attribute", "in", "the", "COSE", "object", ".", "Setting", "an", "attribute", "in", "one", "map", "will", "remove", "it", "from", "all", "other", "maps", "as", "a", "side", "effect", "." ]
train
https://github.com/cose-wg/COSE-JAVA/blob/f972b11ab4c9a18f911bc49a15225a6951cf6f63/src/main/java/COSE/Attribute.java#L112-L134
apache/incubator-heron
heron/spi/src/java/org/apache/heron/spi/common/TokenSub.java
TokenSub.combinePaths
private static String combinePaths(List<String> paths) { """ Given a list of strings, concatenate them to form a file system path @param paths a list of strings to be included in the path @return String string that gives the file system path """ File file = new File(paths.get(0)); for (int i = 1;...
java
private static String combinePaths(List<String> paths) { File file = new File(paths.get(0)); for (int i = 1; i < paths.size(); i++) { file = new File(file, paths.get(i)); } return file.getPath(); }
[ "private", "static", "String", "combinePaths", "(", "List", "<", "String", ">", "paths", ")", "{", "File", "file", "=", "new", "File", "(", "paths", ".", "get", "(", "0", ")", ")", ";", "for", "(", "int", "i", "=", "1", ";", "i", "<", "paths", ...
Given a list of strings, concatenate them to form a file system path @param paths a list of strings to be included in the path @return String string that gives the file system path
[ "Given", "a", "list", "of", "strings", "concatenate", "them", "to", "form", "a", "file", "system", "path" ]
train
https://github.com/apache/incubator-heron/blob/776abe2b5a45b93a0eb957fd65cbc149d901a92a/heron/spi/src/java/org/apache/heron/spi/common/TokenSub.java#L149-L157
cybazeitalia/emaze-dysfunctional
src/main/java/net/emaze/dysfunctional/Spies.java
Spies.spy2nd
public static <T1, T2, T3> TriPredicate<T1, T2, T3> spy2nd(TriPredicate<T1, T2, T3> predicate, Box<T2> param2) { """ Proxies a ternary predicate spying for second parameter. @param <T1> the predicate first parameter type @param <T2> the predicate second parameter type @param <T3> the predicate third parameter...
java
public static <T1, T2, T3> TriPredicate<T1, T2, T3> spy2nd(TriPredicate<T1, T2, T3> predicate, Box<T2> param2) { return spy(predicate, Box.<Boolean>empty(), Box.<T1>empty(), param2, Box.<T3>empty()); }
[ "public", "static", "<", "T1", ",", "T2", ",", "T3", ">", "TriPredicate", "<", "T1", ",", "T2", ",", "T3", ">", "spy2nd", "(", "TriPredicate", "<", "T1", ",", "T2", ",", "T3", ">", "predicate", ",", "Box", "<", "T2", ">", "param2", ")", "{", "r...
Proxies a ternary predicate spying for second parameter. @param <T1> the predicate first parameter type @param <T2> the predicate second parameter type @param <T3> the predicate third parameter type @param predicate the predicate that will be spied @param param2 a box that will be containing the second spied parameter...
[ "Proxies", "a", "ternary", "predicate", "spying", "for", "second", "parameter", "." ]
train
https://github.com/cybazeitalia/emaze-dysfunctional/blob/98115a436e35335c5e8831f9fdc12f6d93d524be/src/main/java/net/emaze/dysfunctional/Spies.java#L429-L431
elki-project/elki
elki-clustering/src/main/java/de/lmu/ifi/dbs/elki/algorithm/clustering/subspace/DOC.java
DOC.dimensionIsRelevant
protected boolean dimensionIsRelevant(int dimension, Relation<V> relation, DBIDs points) { """ Utility method to test if a given dimension is relevant as determined via a set of reference points (i.e. if the variance along the attribute is lower than the threshold). @param dimension the dimension to test. @p...
java
protected boolean dimensionIsRelevant(int dimension, Relation<V> relation, DBIDs points) { double min = Double.POSITIVE_INFINITY, max = Double.NEGATIVE_INFINITY; for(DBIDIter iter = points.iter(); iter.valid(); iter.advance()) { double xV = relation.get(iter).doubleValue(dimension); min = (xV < min)...
[ "protected", "boolean", "dimensionIsRelevant", "(", "int", "dimension", ",", "Relation", "<", "V", ">", "relation", ",", "DBIDs", "points", ")", "{", "double", "min", "=", "Double", ".", "POSITIVE_INFINITY", ",", "max", "=", "Double", ".", "NEGATIVE_INFINITY",...
Utility method to test if a given dimension is relevant as determined via a set of reference points (i.e. if the variance along the attribute is lower than the threshold). @param dimension the dimension to test. @param relation used to get actual values for DBIDs. @param points the points to test. @return <code>true</...
[ "Utility", "method", "to", "test", "if", "a", "given", "dimension", "is", "relevant", "as", "determined", "via", "a", "set", "of", "reference", "points", "(", "i", ".", "e", ".", "if", "the", "variance", "along", "the", "attribute", "is", "lower", "than"...
train
https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-clustering/src/main/java/de/lmu/ifi/dbs/elki/algorithm/clustering/subspace/DOC.java#L306-L317
spockframework/spock
spock-core/src/main/java/spock/mock/DetachedMockFactory.java
DetachedMockFactory.Mock
@Override public <T> T Mock(Map<String, Object> options, Class<T> type) { """ Creates a mock with the specified options and type. The mock name will be the types simple name. Example: <pre> def person = Mock(Person, name: "myPerson") // type is Person.class, name is "myPerson" </pre> @param options op...
java
@Override public <T> T Mock(Map<String, Object> options, Class<T> type) { return createMock(inferNameFromType(type), type, MockNature.MOCK, options); }
[ "@", "Override", "public", "<", "T", ">", "T", "Mock", "(", "Map", "<", "String", ",", "Object", ">", "options", ",", "Class", "<", "T", ">", "type", ")", "{", "return", "createMock", "(", "inferNameFromType", "(", "type", ")", ",", "type", ",", "M...
Creates a mock with the specified options and type. The mock name will be the types simple name. Example: <pre> def person = Mock(Person, name: "myPerson") // type is Person.class, name is "myPerson" </pre> @param options optional options for creating the mock @param type the interface or class type of the mock @par...
[ "Creates", "a", "mock", "with", "the", "specified", "options", "and", "type", ".", "The", "mock", "name", "will", "be", "the", "types", "simple", "name", "." ]
train
https://github.com/spockframework/spock/blob/d751a0abd8d5a2ec5338aa10bc2d19371b3b3ad9/spock-core/src/main/java/spock/mock/DetachedMockFactory.java#L65-L68
Impetus/Kundera
src/jpa-engine/core/src/main/java/com/impetus/kundera/persistence/EntityManagerSession.java
EntityManagerSession.store
protected void store(Object id, Object entity, boolean spillOverToL2) { """ Save to cache. @param id the id @param entity the entity @param spillOverToL2 the spill over to l2 """ String key = cacheKey(entity.getClass(), id); LOG.debug("Writing to L1 >> " + key); sessionCache....
java
protected void store(Object id, Object entity, boolean spillOverToL2) { String key = cacheKey(entity.getClass(), id); LOG.debug("Writing to L1 >> " + key); sessionCache.put(key, entity); if (spillOverToL2) { LOG.debug("Writing to L2 >>" + key); ...
[ "protected", "void", "store", "(", "Object", "id", ",", "Object", "entity", ",", "boolean", "spillOverToL2", ")", "{", "String", "key", "=", "cacheKey", "(", "entity", ".", "getClass", "(", ")", ",", "id", ")", ";", "LOG", ".", "debug", "(", "\"Writing...
Save to cache. @param id the id @param entity the entity @param spillOverToL2 the spill over to l2
[ "Save", "to", "cache", "." ]
train
https://github.com/Impetus/Kundera/blob/268958ab1ec09d14ec4d9184f0c8ded7a9158908/src/jpa-engine/core/src/main/java/com/impetus/kundera/persistence/EntityManagerSession.java#L111-L127
Stratio/stratio-cassandra
src/java/org/apache/cassandra/cli/CliClient.java
CliClient.getBytesAccordingToType
private ByteBuffer getBytesAccordingToType(String object, AbstractType<?> comparator) { """ Converts object represented as string into byte[] according to comparator @param object - object to covert into byte array @param comparator - comparator used to convert object @return byte[] - object in the byte array r...
java
private ByteBuffer getBytesAccordingToType(String object, AbstractType<?> comparator) { if (comparator == null) // default comparator is BytesType comparator = BytesType.instance; try { return comparator.fromString(object); } catch (MarshalException e...
[ "private", "ByteBuffer", "getBytesAccordingToType", "(", "String", "object", ",", "AbstractType", "<", "?", ">", "comparator", ")", "{", "if", "(", "comparator", "==", "null", ")", "// default comparator is BytesType", "comparator", "=", "BytesType", ".", "instance"...
Converts object represented as string into byte[] according to comparator @param object - object to covert into byte array @param comparator - comparator used to convert object @return byte[] - object in the byte array representation
[ "Converts", "object", "represented", "as", "string", "into", "byte", "[]", "according", "to", "comparator" ]
train
https://github.com/Stratio/stratio-cassandra/blob/f6416b43ad5309083349ad56266450fa8c6a2106/src/java/org/apache/cassandra/cli/CliClient.java#L2551-L2564
hazelcast/hazelcast
hazelcast/src/main/java/com/hazelcast/client/impl/protocol/task/dynamicconfig/AbstractAddConfigMessageTask.java
AbstractAddConfigMessageTask.mergePolicyConfig
protected MergePolicyConfig mergePolicyConfig(boolean mergePolicyExist, String mergePolicy, int batchSize) { """ returns a MergePolicyConfig based on given parameters if these exist, or the default MergePolicyConfig """ if (mergePolicyExist) { MergePolicyConfig config = new MergePolicyConfi...
java
protected MergePolicyConfig mergePolicyConfig(boolean mergePolicyExist, String mergePolicy, int batchSize) { if (mergePolicyExist) { MergePolicyConfig config = new MergePolicyConfig(mergePolicy, batchSize); return config; } return new MergePolicyConfig(); }
[ "protected", "MergePolicyConfig", "mergePolicyConfig", "(", "boolean", "mergePolicyExist", ",", "String", "mergePolicy", ",", "int", "batchSize", ")", "{", "if", "(", "mergePolicyExist", ")", "{", "MergePolicyConfig", "config", "=", "new", "MergePolicyConfig", "(", ...
returns a MergePolicyConfig based on given parameters if these exist, or the default MergePolicyConfig
[ "returns", "a", "MergePolicyConfig", "based", "on", "given", "parameters", "if", "these", "exist", "or", "the", "default", "MergePolicyConfig" ]
train
https://github.com/hazelcast/hazelcast/blob/8c4bc10515dbbfb41a33e0302c0caedf3cda1baf/hazelcast/src/main/java/com/hazelcast/client/impl/protocol/task/dynamicconfig/AbstractAddConfigMessageTask.java#L88-L94
apache/flink
flink-core/src/main/java/org/apache/flink/api/common/restartstrategy/RestartStrategies.java
RestartStrategies.fixedDelayRestart
public static RestartStrategyConfiguration fixedDelayRestart(int restartAttempts, long delayBetweenAttempts) { """ Generates a FixedDelayRestartStrategyConfiguration. @param restartAttempts Number of restart attempts for the FixedDelayRestartStrategy @param delayBetweenAttempts Delay in-between restart attempt...
java
public static RestartStrategyConfiguration fixedDelayRestart(int restartAttempts, long delayBetweenAttempts) { return fixedDelayRestart(restartAttempts, Time.of(delayBetweenAttempts, TimeUnit.MILLISECONDS)); }
[ "public", "static", "RestartStrategyConfiguration", "fixedDelayRestart", "(", "int", "restartAttempts", ",", "long", "delayBetweenAttempts", ")", "{", "return", "fixedDelayRestart", "(", "restartAttempts", ",", "Time", ".", "of", "(", "delayBetweenAttempts", ",", "TimeU...
Generates a FixedDelayRestartStrategyConfiguration. @param restartAttempts Number of restart attempts for the FixedDelayRestartStrategy @param delayBetweenAttempts Delay in-between restart attempts for the FixedDelayRestartStrategy @return FixedDelayRestartStrategy
[ "Generates", "a", "FixedDelayRestartStrategyConfiguration", "." ]
train
https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-core/src/main/java/org/apache/flink/api/common/restartstrategy/RestartStrategies.java#L57-L59
pravega/pravega
controller/src/main/java/io/pravega/controller/metrics/StreamMetrics.java
StreamMetrics.sealStreamFailed
public void sealStreamFailed(String scope, String streamName) { """ This method increments the counter of failed Stream seal operations in the system as well as the failed seal attempts for this specific Stream. @param scope Scope. @param streamName Name of the Stream. """ DYNAMIC_LOGGE...
java
public void sealStreamFailed(String scope, String streamName) { DYNAMIC_LOGGER.incCounterValue(globalMetricName(SEAL_STREAM_FAILED), 1); DYNAMIC_LOGGER.incCounterValue(SEAL_STREAM_FAILED, 1, streamTags(scope, streamName)); }
[ "public", "void", "sealStreamFailed", "(", "String", "scope", ",", "String", "streamName", ")", "{", "DYNAMIC_LOGGER", ".", "incCounterValue", "(", "globalMetricName", "(", "SEAL_STREAM_FAILED", ")", ",", "1", ")", ";", "DYNAMIC_LOGGER", ".", "incCounterValue", "(...
This method increments the counter of failed Stream seal operations in the system as well as the failed seal attempts for this specific Stream. @param scope Scope. @param streamName Name of the Stream.
[ "This", "method", "increments", "the", "counter", "of", "failed", "Stream", "seal", "operations", "in", "the", "system", "as", "well", "as", "the", "failed", "seal", "attempts", "for", "this", "specific", "Stream", "." ]
train
https://github.com/pravega/pravega/blob/6e24df7470669b3956a07018f52b2c6b3c2a3503/controller/src/main/java/io/pravega/controller/metrics/StreamMetrics.java#L126-L129
google/j2objc
jre_emul/android/platform/external/icu/android_icu4j/src/main/java/android/icu/text/NumberingSystem.java
NumberingSystem.getInstance
public static NumberingSystem getInstance(int radix_in, boolean isAlgorithmic_in, String desc_in ) { """ Factory method for creating a numbering system. @param radix_in The radix for this numbering system. ICU currently supports only numbering systems whose radix is 10. @param isAlgorithmic_in Specifies whethe...
java
public static NumberingSystem getInstance(int radix_in, boolean isAlgorithmic_in, String desc_in ) { return getInstance(null,radix_in,isAlgorithmic_in,desc_in); }
[ "public", "static", "NumberingSystem", "getInstance", "(", "int", "radix_in", ",", "boolean", "isAlgorithmic_in", ",", "String", "desc_in", ")", "{", "return", "getInstance", "(", "null", ",", "radix_in", ",", "isAlgorithmic_in", ",", "desc_in", ")", ";", "}" ]
Factory method for creating a numbering system. @param radix_in The radix for this numbering system. ICU currently supports only numbering systems whose radix is 10. @param isAlgorithmic_in Specifies whether the numbering system is algorithmic (true) or numeric (false). @param desc_in String used to describe the chara...
[ "Factory", "method", "for", "creating", "a", "numbering", "system", "." ]
train
https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/external/icu/android_icu4j/src/main/java/android/icu/text/NumberingSystem.java#L63-L65
citrusframework/citrus
modules/citrus-core/src/main/java/com/consol/citrus/validation/script/TemplateBasedScriptBuilder.java
TemplateBasedScriptBuilder.fromTemplateResource
public static TemplateBasedScriptBuilder fromTemplateResource(Resource scriptTemplateResource) { """ Static construction method returning a fully qualified instance of this builder. @param scriptTemplateResource external file resource holding script template code. @return instance of this builder. """ ...
java
public static TemplateBasedScriptBuilder fromTemplateResource(Resource scriptTemplateResource) { try { return new TemplateBasedScriptBuilder(FileUtils.readToString(scriptTemplateResource.getInputStream())); } catch (IOException e) { throw new CitrusRuntimeException("Error loading...
[ "public", "static", "TemplateBasedScriptBuilder", "fromTemplateResource", "(", "Resource", "scriptTemplateResource", ")", "{", "try", "{", "return", "new", "TemplateBasedScriptBuilder", "(", "FileUtils", ".", "readToString", "(", "scriptTemplateResource", ".", "getInputStre...
Static construction method returning a fully qualified instance of this builder. @param scriptTemplateResource external file resource holding script template code. @return instance of this builder.
[ "Static", "construction", "method", "returning", "a", "fully", "qualified", "instance", "of", "this", "builder", "." ]
train
https://github.com/citrusframework/citrus/blob/55c58ef74c01d511615e43646ca25c1b2301c56d/modules/citrus-core/src/main/java/com/consol/citrus/validation/script/TemplateBasedScriptBuilder.java#L117-L123
Azure/azure-sdk-for-java
cognitiveservices/data-plane/vision/customvision/training/src/main/java/com/microsoft/azure/cognitiveservices/vision/customvision/training/implementation/TrainingsImpl.java
TrainingsImpl.createImagesFromUrls
public ImageCreateSummary createImagesFromUrls(UUID projectId, ImageUrlCreateBatch batch) { """ Add the provided images urls to the set of training images. This API accepts a batch of urls, and optionally tags, to create images. There is a limit of 64 images and 20 tags. @param projectId The project id @param...
java
public ImageCreateSummary createImagesFromUrls(UUID projectId, ImageUrlCreateBatch batch) { return createImagesFromUrlsWithServiceResponseAsync(projectId, batch).toBlocking().single().body(); }
[ "public", "ImageCreateSummary", "createImagesFromUrls", "(", "UUID", "projectId", ",", "ImageUrlCreateBatch", "batch", ")", "{", "return", "createImagesFromUrlsWithServiceResponseAsync", "(", "projectId", ",", "batch", ")", ".", "toBlocking", "(", ")", ".", "single", ...
Add the provided images urls to the set of training images. This API accepts a batch of urls, and optionally tags, to create images. There is a limit of 64 images and 20 tags. @param projectId The project id @param batch Image urls and tag ids. Limited to 64 images and 20 tags per batch @throws IllegalArgumentExceptio...
[ "Add", "the", "provided", "images", "urls", "to", "the", "set", "of", "training", "images", ".", "This", "API", "accepts", "a", "batch", "of", "urls", "and", "optionally", "tags", "to", "create", "images", ".", "There", "is", "a", "limit", "of", "64", ...
train
https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/cognitiveservices/data-plane/vision/customvision/training/src/main/java/com/microsoft/azure/cognitiveservices/vision/customvision/training/implementation/TrainingsImpl.java#L3840-L3842
tractionsoftware/gwt-traction
src/main/java/com/tractionsoftware/gwt/user/client/ui/impl/UTCDateBoxImplHtml5.java
UTCDateBoxImplHtml5.string2long
private Long string2long(String text, DateTimeFormat fmt) { """ Parses the supplied text and converts it to a Long corresponding to that midnight in UTC on the specified date. @return null if it fails to parsing using the specified DateTimeFormat """ // null or "" returns null if ...
java
private Long string2long(String text, DateTimeFormat fmt) { // null or "" returns null if (text == null) return null; text = text.trim(); if (text.length() == 0) return null; Date date = fmt.parse(text); return date != null ? UTCDateBox.date2utc(date) : ...
[ "private", "Long", "string2long", "(", "String", "text", ",", "DateTimeFormat", "fmt", ")", "{", "// null or \"\" returns null", "if", "(", "text", "==", "null", ")", "return", "null", ";", "text", "=", "text", ".", "trim", "(", ")", ";", "if", "(", "tex...
Parses the supplied text and converts it to a Long corresponding to that midnight in UTC on the specified date. @return null if it fails to parsing using the specified DateTimeFormat
[ "Parses", "the", "supplied", "text", "and", "converts", "it", "to", "a", "Long", "corresponding", "to", "that", "midnight", "in", "UTC", "on", "the", "specified", "date", "." ]
train
https://github.com/tractionsoftware/gwt-traction/blob/efc1423c619439763fb064b777b7235e9ce414a3/src/main/java/com/tractionsoftware/gwt/user/client/ui/impl/UTCDateBoxImplHtml5.java#L136-L145
liferay/com-liferay-commerce
commerce-service/src/main/java/com/liferay/commerce/service/persistence/impl/CommerceCountryPersistenceImpl.java
CommerceCountryPersistenceImpl.findByGroupId
@Override public List<CommerceCountry> findByGroupId(long groupId, int start, int end) { """ Returns a range of all the commerce countries where groupId = &#63;. <p> Useful when paginating results. Returns a maximum of <code>end - start</code> instances. <code>start</code> and <code>end</code> are not primary...
java
@Override public List<CommerceCountry> findByGroupId(long groupId, int start, int end) { return findByGroupId(groupId, start, end, null); }
[ "@", "Override", "public", "List", "<", "CommerceCountry", ">", "findByGroupId", "(", "long", "groupId", ",", "int", "start", ",", "int", "end", ")", "{", "return", "findByGroupId", "(", "groupId", ",", "start", ",", "end", ",", "null", ")", ";", "}" ]
Returns a range of all the commerce countries where groupId = &#63;. <p> Useful when paginating results. Returns a maximum of <code>end - start</code> instances. <code>start</code> and <code>end</code> are not primary keys, they are indexes in the result set. Thus, <code>0</code> refers to the first result in the set....
[ "Returns", "a", "range", "of", "all", "the", "commerce", "countries", "where", "groupId", "=", "&#63", ";", "." ]
train
https://github.com/liferay/com-liferay-commerce/blob/9e54362d7f59531fc684016ba49ee7cdc3a2f22b/commerce-service/src/main/java/com/liferay/commerce/service/persistence/impl/CommerceCountryPersistenceImpl.java#L1530-L1533
js-lib-com/template.xhtml
src/main/java/js/template/xhtml/IdOperator.java
IdOperator.doExec
@Override protected Object doExec(Element element, Object scope, String propertyPath, Object... arguments) throws TemplateException { """ Execute ID operator. Uses property path to extract content value, convert it to string and set <em>id</em> attribute. @param element context element, unused, @param scope ...
java
@Override protected Object doExec(Element element, Object scope, String propertyPath, Object... arguments) throws TemplateException { if (!propertyPath.equals(".") && ConverterRegistry.hasType(scope.getClass())) { throw new TemplateException("Operand is property path but scope is not an object."); } Obje...
[ "@", "Override", "protected", "Object", "doExec", "(", "Element", "element", ",", "Object", "scope", ",", "String", "propertyPath", ",", "Object", "...", "arguments", ")", "throws", "TemplateException", "{", "if", "(", "!", "propertyPath", ".", "equals", "(", ...
Execute ID operator. Uses property path to extract content value, convert it to string and set <em>id</em> attribute. @param element context element, unused, @param scope scope object, @param propertyPath property path, @param arguments optional arguments, unused. @return always returns null for void. @throws Template...
[ "Execute", "ID", "operator", ".", "Uses", "property", "path", "to", "extract", "content", "value", "convert", "it", "to", "string", "and", "set", "<em", ">", "id<", "/", "em", ">", "attribute", "." ]
train
https://github.com/js-lib-com/template.xhtml/blob/d50cec08aca9ab9680baebe2a26a341c096564fb/src/main/java/js/template/xhtml/IdOperator.java#L42-L61
btrplace/scheduler
api/src/main/java/org/btrplace/model/constraint/migration/Precedence.java
Precedence.newPrecedence
public static List<Precedence> newPrecedence(Collection<VM> vmsBefore, Collection<VM> vmsAfter) { """ Instantiate discrete constraints to force a set of VMs to migrate after an other set of VMs. @param vmsBefore the VMs to migrate before the others {@see vmsAfter} @param vmsAfter the VMs to migrate after the ...
java
public static List<Precedence> newPrecedence(Collection<VM> vmsBefore, Collection<VM> vmsAfter) { List<Precedence> l = new ArrayList<>(vmsBefore.size() * vmsAfter.size()); for (VM vmb : vmsBefore) { for (VM vma : vmsAfter) { l.add(new Precedence(vmb, vma)); } ...
[ "public", "static", "List", "<", "Precedence", ">", "newPrecedence", "(", "Collection", "<", "VM", ">", "vmsBefore", ",", "Collection", "<", "VM", ">", "vmsAfter", ")", "{", "List", "<", "Precedence", ">", "l", "=", "new", "ArrayList", "<>", "(", "vmsBef...
Instantiate discrete constraints to force a set of VMs to migrate after an other set of VMs. @param vmsBefore the VMs to migrate before the others {@see vmsAfter} @param vmsAfter the VMs to migrate after the others {@see vmsBefore} @return the associated list of constraints
[ "Instantiate", "discrete", "constraints", "to", "force", "a", "set", "of", "VMs", "to", "migrate", "after", "an", "other", "set", "of", "VMs", "." ]
train
https://github.com/btrplace/scheduler/blob/611063aad0b47a016e57ebf36fa4dfdf24de09e8/api/src/main/java/org/btrplace/model/constraint/migration/Precedence.java#L125-L133
fabric8io/docker-maven-plugin
src/main/java/io/fabric8/maven/docker/util/ImageArchiveUtil.java
ImageArchiveUtil.findEntryByRepoTag
public static ImageArchiveManifestEntry findEntryByRepoTag(String repoTag, ImageArchiveManifest manifest) { """ Search the manifest for an entry that has the repository and tag provided. @param repoTag the repository and tag to search (e.g. busybox:latest). @param manifest the manifest to be searched @return ...
java
public static ImageArchiveManifestEntry findEntryByRepoTag(String repoTag, ImageArchiveManifest manifest) { if(repoTag == null || manifest == null) { return null; } for(ImageArchiveManifestEntry entry : manifest.getEntries()) { for(String entryRepoTag : entry.getRepoTags...
[ "public", "static", "ImageArchiveManifestEntry", "findEntryByRepoTag", "(", "String", "repoTag", ",", "ImageArchiveManifest", "manifest", ")", "{", "if", "(", "repoTag", "==", "null", "||", "manifest", "==", "null", ")", "{", "return", "null", ";", "}", "for", ...
Search the manifest for an entry that has the repository and tag provided. @param repoTag the repository and tag to search (e.g. busybox:latest). @param manifest the manifest to be searched @return the entry found, or null if no match.
[ "Search", "the", "manifest", "for", "an", "entry", "that", "has", "the", "repository", "and", "tag", "provided", "." ]
train
https://github.com/fabric8io/docker-maven-plugin/blob/70ce4f56125d8efb8ddcf2ad4dbb5d6e2c7642b3/src/main/java/io/fabric8/maven/docker/util/ImageArchiveUtil.java#L124-L138
alibaba/canal
client-adapter/common/src/main/java/com/alibaba/otter/canal/client/adapter/support/Util.java
Util.sqlRS
public static void sqlRS(Connection conn, String sql, Consumer<ResultSet> consumer) { """ sql执行获取resultSet @param conn sql connection @param sql sql @param consumer 回调方法 """ try (Statement stmt = conn.createStatement(); ResultSet rs = stmt.executeQuery(sql)) { consumer.accept(rs); ...
java
public static void sqlRS(Connection conn, String sql, Consumer<ResultSet> consumer) { try (Statement stmt = conn.createStatement(); ResultSet rs = stmt.executeQuery(sql)) { consumer.accept(rs); } catch (SQLException e) { logger.error(e.getMessage(), e); } }
[ "public", "static", "void", "sqlRS", "(", "Connection", "conn", ",", "String", "sql", ",", "Consumer", "<", "ResultSet", ">", "consumer", ")", "{", "try", "(", "Statement", "stmt", "=", "conn", ".", "createStatement", "(", ")", ";", "ResultSet", "rs", "=...
sql执行获取resultSet @param conn sql connection @param sql sql @param consumer 回调方法
[ "sql执行获取resultSet" ]
train
https://github.com/alibaba/canal/blob/8f088cddc0755f4350c5aaae95c6e4002d90a40f/client-adapter/common/src/main/java/com/alibaba/otter/canal/client/adapter/support/Util.java#L76-L82
hibernate/hibernate-metamodelgen
src/main/java/org/hibernate/jpamodelgen/util/TypeUtils.java
TypeUtils.isAnnotationMirrorOfType
public static boolean isAnnotationMirrorOfType(AnnotationMirror annotationMirror, String fqcn) { """ Returns {@code true} if the provided annotation type is of the same type as the provided class, {@code false} otherwise. This method uses the string class names for comparison. See also <a href="http://www.retep....
java
public static boolean isAnnotationMirrorOfType(AnnotationMirror annotationMirror, String fqcn) { assert annotationMirror != null; assert fqcn != null; String annotationClassName = annotationMirror.getAnnotationType().toString(); return annotationClassName.equals( fqcn ); }
[ "public", "static", "boolean", "isAnnotationMirrorOfType", "(", "AnnotationMirror", "annotationMirror", ",", "String", "fqcn", ")", "{", "assert", "annotationMirror", "!=", "null", ";", "assert", "fqcn", "!=", "null", ";", "String", "annotationClassName", "=", "anno...
Returns {@code true} if the provided annotation type is of the same type as the provided class, {@code false} otherwise. This method uses the string class names for comparison. See also <a href="http://www.retep.org/2009/02/getting-class-values-from-annotations.html">getting-class-values-from-annotations</a>. @param a...
[ "Returns", "{", "@code", "true", "}", "if", "the", "provided", "annotation", "type", "is", "of", "the", "same", "type", "as", "the", "provided", "class", "{", "@code", "false", "}", "otherwise", ".", "This", "method", "uses", "the", "string", "class", "n...
train
https://github.com/hibernate/hibernate-metamodelgen/blob/2c87b262bc03b1a5a541789fc00c54e0531a36b2/src/main/java/org/hibernate/jpamodelgen/util/TypeUtils.java#L128-L134
phax/ph-web
ph-web/src/main/java/com/helger/web/scope/mgr/WebScopeManager.java
WebScopeManager.internalGetSessionScope
@Nullable @DevelopersNote ("This is only for project-internal use!") public static ISessionWebScope internalGetSessionScope (final boolean bCreateIfNotExisting, final boolean bItsOkayToCreateANewSession) { """ Get the session scope from the current requ...
java
@Nullable @DevelopersNote ("This is only for project-internal use!") public static ISessionWebScope internalGetSessionScope (final boolean bCreateIfNotExisting, final boolean bItsOkayToCreateANewSession) { // Try to to resolve the current request scope...
[ "@", "Nullable", "@", "DevelopersNote", "(", "\"This is only for project-internal use!\"", ")", "public", "static", "ISessionWebScope", "internalGetSessionScope", "(", "final", "boolean", "bCreateIfNotExisting", ",", "final", "boolean", "bItsOkayToCreateANewSession", ")", "{"...
Get the session scope from the current request scope. @param bCreateIfNotExisting if <code>true</code> a new session scope (and a new HTTP session if required) is created if none is existing so far. @param bItsOkayToCreateANewSession if <code>true</code> no warning is emitted, if a new session scope must be created. T...
[ "Get", "the", "session", "scope", "from", "the", "current", "request", "scope", "." ]
train
https://github.com/phax/ph-web/blob/d445fd25184605b62682c93c9782409acf0ae813/ph-web/src/main/java/com/helger/web/scope/mgr/WebScopeManager.java#L331-L339
pravega/pravega
controller/src/main/java/io/pravega/controller/store/stream/StoreException.java
StoreException.create
public static StoreException create(final Type type, final String errorMessage) { """ Factory method to construct Store exceptions. @param type Type of Exception. @param errorMessage The detailed error message. @return Instance of StoreException. """ Exceptions.checkNotNullOrEmpty(errorM...
java
public static StoreException create(final Type type, final String errorMessage) { Exceptions.checkNotNullOrEmpty(errorMessage, "errorMessage"); return create(type, null, errorMessage); }
[ "public", "static", "StoreException", "create", "(", "final", "Type", "type", ",", "final", "String", "errorMessage", ")", "{", "Exceptions", ".", "checkNotNullOrEmpty", "(", "errorMessage", ",", "\"errorMessage\"", ")", ";", "return", "create", "(", "type", ","...
Factory method to construct Store exceptions. @param type Type of Exception. @param errorMessage The detailed error message. @return Instance of StoreException.
[ "Factory", "method", "to", "construct", "Store", "exceptions", "." ]
train
https://github.com/pravega/pravega/blob/6e24df7470669b3956a07018f52b2c6b3c2a3503/controller/src/main/java/io/pravega/controller/store/stream/StoreException.java#L68-L71
cdk/cdk
tool/sdg/src/main/java/org/openscience/cdk/layout/RingPlacer.java
RingPlacer.getNativeRingRadius
public double getNativeRingRadius(IRing ring, double bondLength) { """ Returns the ring radius of a perfect polygons of size ring.getAtomCount() The ring radius is the distance of each atom to the ringcenter. @param ring The ring for which the radius is to calculated @param bondLength The bond length fo...
java
public double getNativeRingRadius(IRing ring, double bondLength) { int size = ring.getAtomCount(); double radius = bondLength / (2 * Math.sin((Math.PI) / size)); return radius; }
[ "public", "double", "getNativeRingRadius", "(", "IRing", "ring", ",", "double", "bondLength", ")", "{", "int", "size", "=", "ring", ".", "getAtomCount", "(", ")", ";", "double", "radius", "=", "bondLength", "/", "(", "2", "*", "Math", ".", "sin", "(", ...
Returns the ring radius of a perfect polygons of size ring.getAtomCount() The ring radius is the distance of each atom to the ringcenter. @param ring The ring for which the radius is to calculated @param bondLength The bond length for each bond in the ring @return The radius of the ring.
[ "Returns", "the", "ring", "radius", "of", "a", "perfect", "polygons", "of", "size", "ring", ".", "getAtomCount", "()", "The", "ring", "radius", "is", "the", "distance", "of", "each", "atom", "to", "the", "ringcenter", "." ]
train
https://github.com/cdk/cdk/blob/c3d0f16502bf08df50365fee392e11d7c9856657/tool/sdg/src/main/java/org/openscience/cdk/layout/RingPlacer.java#L686-L690
OpenLiberty/open-liberty
dev/com.ibm.ws.config/src/com/ibm/ws/config/admin/internal/ManagedServiceFactoryTracker.java
ManagedServiceFactoryTracker.removedService
@Override public void removedService(ServiceReference<ManagedServiceFactory> reference, ManagedServiceFactory service) { """ MangedServiceFactory service removed. Process removal and unget service from its context. @param reference @param service """ String[] factoryPids = getServicePid(refere...
java
@Override public void removedService(ServiceReference<ManagedServiceFactory> reference, ManagedServiceFactory service) { String[] factoryPids = getServicePid(reference); if (factoryPids == null) { if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) { Tr.debu...
[ "@", "Override", "public", "void", "removedService", "(", "ServiceReference", "<", "ManagedServiceFactory", ">", "reference", ",", "ManagedServiceFactory", "service", ")", "{", "String", "[", "]", "factoryPids", "=", "getServicePid", "(", "reference", ")", ";", "i...
MangedServiceFactory service removed. Process removal and unget service from its context. @param reference @param service
[ "MangedServiceFactory", "service", "removed", ".", "Process", "removal", "and", "unget", "service", "from", "its", "context", "." ]
train
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.config/src/com/ibm/ws/config/admin/internal/ManagedServiceFactoryTracker.java#L131-L149
MenoData/Time4J
base/src/main/java/net/time4j/calendar/PersianCalendar.java
PersianCalendar.getDate
public Date getDate(PersianAlgorithm algorithm) { """ /*[deutsch] <p>Erh&auml;lt eine alternative Datumssicht spezifisch f&uuml;r den angegebenen Algorithmus. </p> @param algorithm calendar computation @return Persian date (possibly modified) @throws IllegalArgumentException in case of date overflow @...
java
public Date getDate(PersianAlgorithm algorithm) { ZonalOffset offset = PersianAlgorithm.STD_OFFSET; if (algorithm == DEFAULT_COMPUTATION) { return new Date(this, DEFAULT_COMPUTATION, offset); } long utcDays = DEFAULT_COMPUTATION.transform(this, offset); return new ...
[ "public", "Date", "getDate", "(", "PersianAlgorithm", "algorithm", ")", "{", "ZonalOffset", "offset", "=", "PersianAlgorithm", ".", "STD_OFFSET", ";", "if", "(", "algorithm", "==", "DEFAULT_COMPUTATION", ")", "{", "return", "new", "Date", "(", "this", ",", "DE...
/*[deutsch] <p>Erh&auml;lt eine alternative Datumssicht spezifisch f&uuml;r den angegebenen Algorithmus. </p> @param algorithm calendar computation @return Persian date (possibly modified) @throws IllegalArgumentException in case of date overflow @since 3.33/4.28
[ "/", "*", "[", "deutsch", "]", "<p", ">", "Erh&auml", ";", "lt", "eine", "alternative", "Datumssicht", "spezifisch", "f&uuml", ";", "r", "den", "angegebenen", "Algorithmus", ".", "<", "/", "p", ">" ]
train
https://github.com/MenoData/Time4J/blob/08b2eda6b2dbb140b92011cf7071bb087edd46a5/base/src/main/java/net/time4j/calendar/PersianCalendar.java#L714-L725
nguyenq/tess4j
src/main/java/net/sourceforge/tess4j/util/ImageIOHelper.java
ImageIOHelper.setDPIViaAPI
private static IIOMetadata setDPIViaAPI(IIOMetadata imageMetadata, int dpiX, int dpiY) throws IIOInvalidTreeException { """ Set DPI using API. @param imageMetadata original IIOMetadata @param dpiX horizontal resolution @param dpiY vertical resolution @return modified IIOMetadata @throws IIOInval...
java
private static IIOMetadata setDPIViaAPI(IIOMetadata imageMetadata, int dpiX, int dpiY) throws IIOInvalidTreeException { // Derive the TIFFDirectory from the metadata. TIFFDirectory dir = TIFFDirectory.createFromMetadata(imageMetadata); // Get {X,Y}Resolution tags. BaselineTI...
[ "private", "static", "IIOMetadata", "setDPIViaAPI", "(", "IIOMetadata", "imageMetadata", ",", "int", "dpiX", ",", "int", "dpiY", ")", "throws", "IIOInvalidTreeException", "{", "// Derive the TIFFDirectory from the metadata.", "TIFFDirectory", "dir", "=", "TIFFDirectory", ...
Set DPI using API. @param imageMetadata original IIOMetadata @param dpiX horizontal resolution @param dpiY vertical resolution @return modified IIOMetadata @throws IIOInvalidTreeException
[ "Set", "DPI", "using", "API", "." ]
train
https://github.com/nguyenq/tess4j/blob/cfcd4a8a44042f150b4aaf7bdf5ffc485a2236e1/src/main/java/net/sourceforge/tess4j/util/ImageIOHelper.java#L215-L251
codeprimate-software/cp-elements
src/main/java/org/cp/elements/lang/ElementsExceptionsFactory.java
ElementsExceptionsFactory.newPageNotFoundException
public static PageNotFoundException newPageNotFoundException(Throwable cause, String message, Object... args) { """ Constructs and initializes a new {@link PageNotFoundException} with the given {@link Throwable cause} and {@link String message} formatted with the given {@link Object[] arguments}. @param cause ...
java
public static PageNotFoundException newPageNotFoundException(Throwable cause, String message, Object... args) { return new PageNotFoundException(format(message, args), cause); }
[ "public", "static", "PageNotFoundException", "newPageNotFoundException", "(", "Throwable", "cause", ",", "String", "message", ",", "Object", "...", "args", ")", "{", "return", "new", "PageNotFoundException", "(", "format", "(", "message", ",", "args", ")", ",", ...
Constructs and initializes a new {@link PageNotFoundException} with the given {@link Throwable cause} and {@link String message} formatted with the given {@link Object[] arguments}. @param cause {@link Throwable} identified as the reason this {@link PageNotFoundException} was thrown. @param message {@link String} desc...
[ "Constructs", "and", "initializes", "a", "new", "{", "@link", "PageNotFoundException", "}", "with", "the", "given", "{", "@link", "Throwable", "cause", "}", "and", "{", "@link", "String", "message", "}", "formatted", "with", "the", "given", "{", "@link", "Ob...
train
https://github.com/codeprimate-software/cp-elements/blob/f2163c149fbbef05015e688132064ebcac7c49ab/src/main/java/org/cp/elements/lang/ElementsExceptionsFactory.java#L831-L833
prometheus/client_java
simpleclient/src/main/java/io/prometheus/client/CollectorRegistry.java
CollectorRegistry.getSampleValue
public Double getSampleValue(String name, String[] labelNames, String[] labelValues) { """ Returns the given value, or null if it doesn't exist. <p> This is inefficient, and intended only for use in unittests. """ for (Collector.MetricFamilySamples metricFamilySamples : Collections.list(metricFamilySampl...
java
public Double getSampleValue(String name, String[] labelNames, String[] labelValues) { for (Collector.MetricFamilySamples metricFamilySamples : Collections.list(metricFamilySamples())) { for (Collector.MetricFamilySamples.Sample sample : metricFamilySamples.samples) { if (sample.name.equals(name) ...
[ "public", "Double", "getSampleValue", "(", "String", "name", ",", "String", "[", "]", "labelNames", ",", "String", "[", "]", "labelValues", ")", "{", "for", "(", "Collector", ".", "MetricFamilySamples", "metricFamilySamples", ":", "Collections", ".", "list", "...
Returns the given value, or null if it doesn't exist. <p> This is inefficient, and intended only for use in unittests.
[ "Returns", "the", "given", "value", "or", "null", "if", "it", "doesn", "t", "exist", ".", "<p", ">", "This", "is", "inefficient", "and", "intended", "only", "for", "use", "in", "unittests", "." ]
train
https://github.com/prometheus/client_java/blob/4e0e7527b048f1ffd0382dcb74c0b9dab23b4d9f/simpleclient/src/main/java/io/prometheus/client/CollectorRegistry.java#L246-L257
jhunters/jprotobuf
v3/src/main/java/com/baidu/bjf/remoting/protobuf/code/AbstractCodeGenerator.java
AbstractCodeGenerator.getMismatchTypeErroMessage
private String getMismatchTypeErroMessage(FieldType type, Field field) { """ get error message info by type not matched. @param type the type @param field the field @return error message for mismatch type """ return "Type mismatch. @Protobuf required type '" + type.getJavaType() + "' but field ty...
java
private String getMismatchTypeErroMessage(FieldType type, Field field) { return "Type mismatch. @Protobuf required type '" + type.getJavaType() + "' but field type is '" + field.getType().getSimpleName() + "' of field name '" + field.getName() + "' on class " + field.getDeclar...
[ "private", "String", "getMismatchTypeErroMessage", "(", "FieldType", "type", ",", "Field", "field", ")", "{", "return", "\"Type mismatch. @Protobuf required type '\"", "+", "type", ".", "getJavaType", "(", ")", "+", "\"' but field type is '\"", "+", "field", ".", "get...
get error message info by type not matched. @param type the type @param field the field @return error message for mismatch type
[ "get", "error", "message", "info", "by", "type", "not", "matched", "." ]
train
https://github.com/jhunters/jprotobuf/blob/55832c9b4792afb128e5b35139d8a3891561d8a3/v3/src/main/java/com/baidu/bjf/remoting/protobuf/code/AbstractCodeGenerator.java#L177-L181
ThreeTen/threetenbp
src/main/java/org/threeten/bp/zone/ZoneRulesProvider.java
ZoneRulesProvider.getRules
public static ZoneRules getRules(String zoneId, boolean forCaching) { """ Gets the rules for the zone ID. <p> This returns the latest available rules for the zone ID. <p> This method relies on time-zone data provider files that are configured. These are loaded using a {@code ServiceLoader}. <p> The caching ...
java
public static ZoneRules getRules(String zoneId, boolean forCaching) { Jdk8Methods.requireNonNull(zoneId, "zoneId"); return getProvider(zoneId).provideRules(zoneId, forCaching); }
[ "public", "static", "ZoneRules", "getRules", "(", "String", "zoneId", ",", "boolean", "forCaching", ")", "{", "Jdk8Methods", ".", "requireNonNull", "(", "zoneId", ",", "\"zoneId\"", ")", ";", "return", "getProvider", "(", "zoneId", ")", ".", "provideRules", "(...
Gets the rules for the zone ID. <p> This returns the latest available rules for the zone ID. <p> This method relies on time-zone data provider files that are configured. These are loaded using a {@code ServiceLoader}. <p> The caching flag is designed to allow provider implementations to prevent the rules being cached i...
[ "Gets", "the", "rules", "for", "the", "zone", "ID", ".", "<p", ">", "This", "returns", "the", "latest", "available", "rules", "for", "the", "zone", "ID", ".", "<p", ">", "This", "method", "relies", "on", "time", "-", "zone", "data", "provider", "files"...
train
https://github.com/ThreeTen/threetenbp/blob/5f05b649f89f205aabd96b2f83c36796ec616fe6/src/main/java/org/threeten/bp/zone/ZoneRulesProvider.java#L120-L123
Azure/azure-sdk-for-java
cognitiveservices/data-plane/language/luis/authoring/src/main/java/com/microsoft/azure/cognitiveservices/language/luis/authoring/implementation/VersionsImpl.java
VersionsImpl.cloneAsync
public Observable<String> cloneAsync(UUID appId, String versionId, CloneOptionalParameter cloneOptionalParameter) { """ Creates a new version using the current snapshot of the selected application version. @param appId The application ID. @param versionId The version ID. @param cloneOptionalParameter the obje...
java
public Observable<String> cloneAsync(UUID appId, String versionId, CloneOptionalParameter cloneOptionalParameter) { return cloneWithServiceResponseAsync(appId, versionId, cloneOptionalParameter).map(new Func1<ServiceResponse<String>, String>() { @Override public String call(ServiceRespon...
[ "public", "Observable", "<", "String", ">", "cloneAsync", "(", "UUID", "appId", ",", "String", "versionId", ",", "CloneOptionalParameter", "cloneOptionalParameter", ")", "{", "return", "cloneWithServiceResponseAsync", "(", "appId", ",", "versionId", ",", "cloneOptiona...
Creates a new version using the current snapshot of the selected application version. @param appId The application ID. @param versionId The version ID. @param cloneOptionalParameter the object representing the optional parameters to be set before calling this API @throws IllegalArgumentException thrown if parameters f...
[ "Creates", "a", "new", "version", "using", "the", "current", "snapshot", "of", "the", "selected", "application", "version", "." ]
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/VersionsImpl.java#L144-L151
jayantk/jklol
src/com/jayantkrish/jklol/ccg/lexicon/StringContext.java
StringContext.getContextsFromExamples
public static List<StringContext> getContextsFromExamples(List<CcgExample> examples) { """ Generates and returns a list of every StringContext for every sentence in {@code examples}. @param examples @return """ List<StringContext> contexts = Lists.newArrayList(); for (CcgExample example : examples...
java
public static List<StringContext> getContextsFromExamples(List<CcgExample> examples) { List<StringContext> contexts = Lists.newArrayList(); for (CcgExample example : examples) { AnnotatedSentence sentence = example.getSentence(); int numTerminals = sentence.size(); for (int i = 0; i < numTermi...
[ "public", "static", "List", "<", "StringContext", ">", "getContextsFromExamples", "(", "List", "<", "CcgExample", ">", "examples", ")", "{", "List", "<", "StringContext", ">", "contexts", "=", "Lists", ".", "newArrayList", "(", ")", ";", "for", "(", "CcgExam...
Generates and returns a list of every StringContext for every sentence in {@code examples}. @param examples @return
[ "Generates", "and", "returns", "a", "list", "of", "every", "StringContext", "for", "every", "sentence", "in", "{", "@code", "examples", "}", "." ]
train
https://github.com/jayantk/jklol/blob/d27532ca83e212d51066cf28f52621acc3fd44cc/src/com/jayantkrish/jklol/ccg/lexicon/StringContext.java#L37-L49
teatrove/teatrove
teaapps/src/main/java/org/teatrove/teaapps/contexts/HttpContext.java
HttpContext.doSecureGet
public String doSecureGet(String host, String path, int port, Map<String, String> headers, int timeout) throws UnknownHostException, ConnectException, IOException { """ Perform a secure HTTPS GET at the given path returning the results of the r...
java
public String doSecureGet(String host, String path, int port, Map<String, String> headers, int timeout) throws UnknownHostException, ConnectException, IOException { return doHttpCall(host, path, null, port, headers, timeout, true); ...
[ "public", "String", "doSecureGet", "(", "String", "host", ",", "String", "path", ",", "int", "port", ",", "Map", "<", "String", ",", "String", ">", "headers", ",", "int", "timeout", ")", "throws", "UnknownHostException", ",", "ConnectException", ",", "IOExce...
Perform a secure HTTPS GET at the given path returning the results of the response. @param host The hostname of the request @param path The path of the request @param port The port of the request @param headers The headers to pass in the request @param timeout The timeout of the request in milliseconds @return The da...
[ "Perform", "a", "secure", "HTTPS", "GET", "at", "the", "given", "path", "returning", "the", "results", "of", "the", "response", "." ]
train
https://github.com/teatrove/teatrove/blob/7039bdd4da6817ff8c737f7e4e07bac7e3ad8bea/teaapps/src/main/java/org/teatrove/teaapps/contexts/HttpContext.java#L83-L89
looly/hutool
hutool-extra/src/main/java/cn/hutool/extra/mail/MailUtil.java
MailUtil.send
public static void send(MailAccount mailAccount, Collection<String> tos, Collection<String> ccs, Collection<String> bccs, String subject, String content, boolean isHtml, File... files) { """ 发送邮件给多人 @param mailAccount 邮件认证对象 @param tos 收件人列表 @param ccs 抄送人列表,可以为null或空 @param bccs 密送人列表,可以为null或空 @param subj...
java
public static void send(MailAccount mailAccount, Collection<String> tos, Collection<String> ccs, Collection<String> bccs, String subject, String content, boolean isHtml, File... files) { final Mail mail = Mail.create(mailAccount); //可选抄送人 if(CollUtil.isNotEmpty(ccs)) { mail.setCcs(ccs.toArray(new Strin...
[ "public", "static", "void", "send", "(", "MailAccount", "mailAccount", ",", "Collection", "<", "String", ">", "tos", ",", "Collection", "<", "String", ">", "ccs", ",", "Collection", "<", "String", ">", "bccs", ",", "String", "subject", ",", "String", "cont...
发送邮件给多人 @param mailAccount 邮件认证对象 @param tos 收件人列表 @param ccs 抄送人列表,可以为null或空 @param bccs 密送人列表,可以为null或空 @param subject 标题 @param content 正文 @param isHtml 是否为HTML格式 @param files 附件列表 @since 4.0.3
[ "发送邮件给多人" ]
train
https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-extra/src/main/java/cn/hutool/extra/mail/MailUtil.java#L180-L199
ZieIony/Carbon
carbon/src/main/java/carbon/drawable/ripple/LayerDrawable.java
LayerDrawable.setLayerGravity
public void setLayerGravity(int index, int gravity) { """ Sets the gravity used to position or stretch the specified layer within its container. Gravity is applied after any layer insets (see {@link #setLayerInset(int, int, int, int, int)}) or padding (see {@link #setPaddingMode(int)}). <p/> If gravity is spec...
java
public void setLayerGravity(int index, int gravity) { final ChildDrawable childDrawable = mLayerState.mChildren[index]; childDrawable.mGravity = gravity; }
[ "public", "void", "setLayerGravity", "(", "int", "index", ",", "int", "gravity", ")", "{", "final", "ChildDrawable", "childDrawable", "=", "mLayerState", ".", "mChildren", "[", "index", "]", ";", "childDrawable", ".", "mGravity", "=", "gravity", ";", "}" ]
Sets the gravity used to position or stretch the specified layer within its container. Gravity is applied after any layer insets (see {@link #setLayerInset(int, int, int, int, int)}) or padding (see {@link #setPaddingMode(int)}). <p/> If gravity is specified as {@link Gravity#NO_GRAVITY}, the default behavior depends o...
[ "Sets", "the", "gravity", "used", "to", "position", "or", "stretch", "the", "specified", "layer", "within", "its", "container", ".", "Gravity", "is", "applied", "after", "any", "layer", "insets", "(", "see", "{", "@link", "#setLayerInset", "(", "int", "int",...
train
https://github.com/ZieIony/Carbon/blob/78b0a432bd49edc7a6a13ce111cab274085d1693/carbon/src/main/java/carbon/drawable/ripple/LayerDrawable.java#L642-L645
opsmatters/opsmatters-core
src/main/java/com/opsmatters/core/util/FormatUtilities.java
FormatUtilities.getDateTime
static public long getDateTime(String s, String format, boolean useTZ) { """ Returns the given date parsed using the given format. @param s The formatted date to be parsed @param format The format to use when parsing the date @param useTZ <CODE>true</CODE> if the date should be parsed using the current timezone...
java
static public long getDateTime(String s, String format, boolean useTZ) { return getDateTime(s, format, useTZ, false); }
[ "static", "public", "long", "getDateTime", "(", "String", "s", ",", "String", "format", ",", "boolean", "useTZ", ")", "{", "return", "getDateTime", "(", "s", ",", "format", ",", "useTZ", ",", "false", ")", ";", "}" ]
Returns the given date parsed using the given format. @param s The formatted date to be parsed @param format The format to use when parsing the date @param useTZ <CODE>true</CODE> if the date should be parsed using the current timezone @return The given date parsed using the given format
[ "Returns", "the", "given", "date", "parsed", "using", "the", "given", "format", "." ]
train
https://github.com/opsmatters/opsmatters-core/blob/c48904f7e8d029fd45357811ec38a735e261e3fd/src/main/java/com/opsmatters/core/util/FormatUtilities.java#L260-L263
google/j2objc
jre_emul/android/platform/libcore/luni/src/main/java/libcore/io/Streams.java
Streams.readFully
public static void readFully(InputStream in, byte[] dst, int offset, int byteCount) throws IOException { """ Reads exactly 'byteCount' bytes from 'in' (into 'dst' at offset 'offset'), and throws EOFException if insufficient bytes are available. Used to implement {@link java.io.DataInputStream#readFully(byte[],...
java
public static void readFully(InputStream in, byte[] dst, int offset, int byteCount) throws IOException { if (byteCount == 0) { return; } if (in == null) { throw new NullPointerException("in == null"); } if (dst == null) { throw new NullPointerE...
[ "public", "static", "void", "readFully", "(", "InputStream", "in", ",", "byte", "[", "]", "dst", ",", "int", "offset", ",", "int", "byteCount", ")", "throws", "IOException", "{", "if", "(", "byteCount", "==", "0", ")", "{", "return", ";", "}", "if", ...
Reads exactly 'byteCount' bytes from 'in' (into 'dst' at offset 'offset'), and throws EOFException if insufficient bytes are available. Used to implement {@link java.io.DataInputStream#readFully(byte[], int, int)}.
[ "Reads", "exactly", "byteCount", "bytes", "from", "in", "(", "into", "dst", "at", "offset", "offset", ")", "and", "throws", "EOFException", "if", "insufficient", "bytes", "are", "available", "." ]
train
https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/libcore/luni/src/main/java/libcore/io/Streams.java#L69-L88
alkacon/opencms-core
src-gwt/org/opencms/acacia/client/export/CmsEntityWrapper.java
CmsEntityWrapper.setAttributeValueEntity
public void setAttributeValueEntity(String attributeName, CmsEntityWrapper value) { """ Wrapper method.<p> @param attributeName parameter for the wrapped method @param value parameter for the wrapped method """ m_entity.setAttributeValue(attributeName, value.getEntity()); }
java
public void setAttributeValueEntity(String attributeName, CmsEntityWrapper value) { m_entity.setAttributeValue(attributeName, value.getEntity()); }
[ "public", "void", "setAttributeValueEntity", "(", "String", "attributeName", ",", "CmsEntityWrapper", "value", ")", "{", "m_entity", ".", "setAttributeValue", "(", "attributeName", ",", "value", ".", "getEntity", "(", ")", ")", ";", "}" ]
Wrapper method.<p> @param attributeName parameter for the wrapped method @param value parameter for the wrapped method
[ "Wrapper", "method", ".", "<p", ">" ]
train
https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src-gwt/org/opencms/acacia/client/export/CmsEntityWrapper.java#L208-L211
couchbase/couchbase-jvm-core
src/main/java/com/couchbase/client/core/endpoint/AbstractGenericHandler.java
AbstractGenericHandler.onKeepAliveResponse
protected void onKeepAliveResponse(ChannelHandlerContext ctx, CouchbaseResponse keepAliveResponse) { """ Override to customize the behavior when a keep alive has been responded to. The default behavior is to log the event and the response status at trace level. @param ctx the channel context. @param keepAli...
java
protected void onKeepAliveResponse(ChannelHandlerContext ctx, CouchbaseResponse keepAliveResponse) { if (traceEnabled) { LOGGER.trace(logIdent(ctx, endpoint) + "keepAlive was answered, status " + keepAliveResponse.status()); } }
[ "protected", "void", "onKeepAliveResponse", "(", "ChannelHandlerContext", "ctx", ",", "CouchbaseResponse", "keepAliveResponse", ")", "{", "if", "(", "traceEnabled", ")", "{", "LOGGER", ".", "trace", "(", "logIdent", "(", "ctx", ",", "endpoint", ")", "+", "\"keep...
Override to customize the behavior when a keep alive has been responded to. The default behavior is to log the event and the response status at trace level. @param ctx the channel context. @param keepAliveResponse the keep alive request that was sent when keep alive was triggered
[ "Override", "to", "customize", "the", "behavior", "when", "a", "keep", "alive", "has", "been", "responded", "to", "." ]
train
https://github.com/couchbase/couchbase-jvm-core/blob/97f0427112c2168fee1d6499904f5fa0e24c6797/src/main/java/com/couchbase/client/core/endpoint/AbstractGenericHandler.java#L804-L809
groovy/groovy-core
src/main/org/codehaus/groovy/reflection/ClassInfo.java
ClassInfo.isValidWeakMetaClass
private boolean isValidWeakMetaClass(MetaClass metaClass, MetaClassRegistry.MetaClassCreationHandle mccHandle) { """ if EMC.enableGlobally() is OFF, return whatever the cached answer is. but if EMC.enableGlobally() is ON and the cached answer is not an EMC, come up with a fresh answer """ if(metaClass...
java
private boolean isValidWeakMetaClass(MetaClass metaClass, MetaClassRegistry.MetaClassCreationHandle mccHandle) { if(metaClass==null) return false; boolean enableGloballyOn = (mccHandle instanceof ExpandoMetaClassCreationHandle); boolean cachedAnswerIsEMC = (metaClass instanceof ExpandoMetaClass)...
[ "private", "boolean", "isValidWeakMetaClass", "(", "MetaClass", "metaClass", ",", "MetaClassRegistry", ".", "MetaClassCreationHandle", "mccHandle", ")", "{", "if", "(", "metaClass", "==", "null", ")", "return", "false", ";", "boolean", "enableGloballyOn", "=", "(", ...
if EMC.enableGlobally() is OFF, return whatever the cached answer is. but if EMC.enableGlobally() is ON and the cached answer is not an EMC, come up with a fresh answer
[ "if", "EMC", ".", "enableGlobally", "()", "is", "OFF", "return", "whatever", "the", "cached", "answer", "is", ".", "but", "if", "EMC", ".", "enableGlobally", "()", "is", "ON", "and", "the", "cached", "answer", "is", "not", "an", "EMC", "come", "up", "w...
train
https://github.com/groovy/groovy-core/blob/01309f9d4be34ddf93c4a9943b5a97843bff6181/src/main/org/codehaus/groovy/reflection/ClassInfo.java#L271-L276
google/truth
core/src/main/java/com/google/common/truth/MapSubject.java
MapSubject.containsAtLeastEntriesIn
@CanIgnoreReturnValue public Ordered containsAtLeastEntriesIn(Map<?, ?> expectedMap) { """ Fails if the map does not contain at least the given set of entries in the given map. """ if (expectedMap.isEmpty()) { return IN_ORDER; } boolean containsAnyOrder = containsEntriesInAnyOrder(e...
java
@CanIgnoreReturnValue public Ordered containsAtLeastEntriesIn(Map<?, ?> expectedMap) { if (expectedMap.isEmpty()) { return IN_ORDER; } boolean containsAnyOrder = containsEntriesInAnyOrder(expectedMap, "contains at least", /* allowUnexpected= */ true); if (containsAnyOrder) { return...
[ "@", "CanIgnoreReturnValue", "public", "Ordered", "containsAtLeastEntriesIn", "(", "Map", "<", "?", ",", "?", ">", "expectedMap", ")", "{", "if", "(", "expectedMap", ".", "isEmpty", "(", ")", ")", "{", "return", "IN_ORDER", ";", "}", "boolean", "containsAnyO...
Fails if the map does not contain at least the given set of entries in the given map.
[ "Fails", "if", "the", "map", "does", "not", "contain", "at", "least", "the", "given", "set", "of", "entries", "in", "the", "given", "map", "." ]
train
https://github.com/google/truth/blob/60eceffd2e8c3297655d33ed87d965cf5af51108/core/src/main/java/com/google/common/truth/MapSubject.java#L251-L263
baasbox/Android-SDK
library/src/main/java/com/baasbox/android/BaasDocument.java
BaasDocument.getStructure
public JsonStructure getStructure(String name, JsonStructure otherwise) { """ Returns the value mapped to <code>name</code> as a {@link com.baasbox.android.json.JsonStructure} or <code>otherwise</code> if the mapping is absent. @param name a non <code>null</code> key @param otherwise a default value @re...
java
public JsonStructure getStructure(String name, JsonStructure otherwise) { return data.getStructure(name, otherwise); }
[ "public", "JsonStructure", "getStructure", "(", "String", "name", ",", "JsonStructure", "otherwise", ")", "{", "return", "data", ".", "getStructure", "(", "name", ",", "otherwise", ")", ";", "}" ]
Returns the value mapped to <code>name</code> as a {@link com.baasbox.android.json.JsonStructure} or <code>otherwise</code> if the mapping is absent. @param name a non <code>null</code> key @param otherwise a default value @return the value mapped to <code>name</code> or <code>otherwise</code>
[ "Returns", "the", "value", "mapped", "to", "<code", ">", "name<", "/", "code", ">", "as", "a", "{", "@link", "com", ".", "baasbox", ".", "android", ".", "json", ".", "JsonStructure", "}", "or", "<code", ">", "otherwise<", "/", "code", ">", "if", "the...
train
https://github.com/baasbox/Android-SDK/blob/6bb2203246b885b2ad63a7bfaf37c83caf15e0d8/library/src/main/java/com/baasbox/android/BaasDocument.java#L994-L996
jsurfer/JsonSurfer
jsurfer-core/src/main/java/org/jsfr/json/JsonSurfer.java
JsonSurfer.collectOne
public Object collectOne(String json, String... paths) { """ Collect the first matched value and stop parsing immediately @param json json @param paths JsonPath @return value """ return collectOne(json, compile(paths)); }
java
public Object collectOne(String json, String... paths) { return collectOne(json, compile(paths)); }
[ "public", "Object", "collectOne", "(", "String", "json", ",", "String", "...", "paths", ")", "{", "return", "collectOne", "(", "json", ",", "compile", "(", "paths", ")", ")", ";", "}" ]
Collect the first matched value and stop parsing immediately @param json json @param paths JsonPath @return value
[ "Collect", "the", "first", "matched", "value", "and", "stop", "parsing", "immediately" ]
train
https://github.com/jsurfer/JsonSurfer/blob/52bd75a453338b86e115092803da140bf99cee62/jsurfer-core/src/main/java/org/jsfr/json/JsonSurfer.java#L388-L390
moparisthebest/beehive
beehive-netui-core/src/main/java/org/apache/beehive/netui/pageflow/AutoRegisterActionServlet.java
AutoRegisterActionServlet.registerModule
protected synchronized ModuleConfig registerModule( String modulePath, String configFilePath ) throws ServletException { """ Register a Struts module, initialized by the given configuration file. @param modulePath the module path, starting at the webapp root, e.g., "/info/help". @param configFilePath t...
java
protected synchronized ModuleConfig registerModule( String modulePath, String configFilePath ) throws ServletException { if ( _log.isInfoEnabled() ) { _log.info( "Dynamically registering module " + modulePath + ", config XML " + configFilePath ); } if ( _...
[ "protected", "synchronized", "ModuleConfig", "registerModule", "(", "String", "modulePath", ",", "String", "configFilePath", ")", "throws", "ServletException", "{", "if", "(", "_log", ".", "isInfoEnabled", "(", ")", ")", "{", "_log", ".", "info", "(", "\"Dynamic...
Register a Struts module, initialized by the given configuration file. @param modulePath the module path, starting at the webapp root, e.g., "/info/help". @param configFilePath the path, starting at the webapp root, to the module configuration file (e.g., "/WEB-INF/my-generated-struts-config-info-help.xml"). @return t...
[ "Register", "a", "Struts", "module", "initialized", "by", "the", "given", "configuration", "file", "." ]
train
https://github.com/moparisthebest/beehive/blob/4246a0cc40ce3c05f1a02c2da2653ac622703d77/beehive-netui-core/src/main/java/org/apache/beehive/netui/pageflow/AutoRegisterActionServlet.java#L539-L584
Talend/tesb-rt-se
examples/cxf/jaxrs-attachments/client/src/main/java/client/RESTClient.java
RESTClient.createXopBean
private XopBean createXopBean() throws Exception { """ Creates a XopBean. The image on the disk is included as a byte array, a DataHandler and java.awt.Image @return the bean @throws Exception """ XopBean xop = new XopBean(); xop.setName("xopName"); InputStream is = getClass...
java
private XopBean createXopBean() throws Exception { XopBean xop = new XopBean(); xop.setName("xopName"); InputStream is = getClass().getResourceAsStream("/java.jpg"); byte[] data = IOUtils.readBytesFromStream(is); // Pass java.jpg as an array of bytes xo...
[ "private", "XopBean", "createXopBean", "(", ")", "throws", "Exception", "{", "XopBean", "xop", "=", "new", "XopBean", "(", ")", ";", "xop", ".", "setName", "(", "\"xopName\"", ")", ";", "InputStream", "is", "=", "getClass", "(", ")", ".", "getResourceAsStr...
Creates a XopBean. The image on the disk is included as a byte array, a DataHandler and java.awt.Image @return the bean @throws Exception
[ "Creates", "a", "XopBean", ".", "The", "image", "on", "the", "disk", "is", "included", "as", "a", "byte", "array", "a", "DataHandler", "and", "java", ".", "awt", ".", "Image" ]
train
https://github.com/Talend/tesb-rt-se/blob/0a151a6d91ffff65ac4b5ee0c5b2c882ac28d886/examples/cxf/jaxrs-attachments/client/src/main/java/client/RESTClient.java#L191-L212
tvesalainen/util
util/src/main/java/org/vesalainen/math/AbstractPoint.java
AbstractPoint.move
public static final Point move(Point p, double radians, double distance) { """ Creates a new Point distance from p to radians direction @param p Start point @param radians Angle in radians @param distance Distance @return A new Point """ return new AbstractPoint( p.getX() + distan...
java
public static final Point move(Point p, double radians, double distance) { return new AbstractPoint( p.getX() + distance*Math.cos(radians), p.getY() + distance*Math.sin(radians) ); }
[ "public", "static", "final", "Point", "move", "(", "Point", "p", ",", "double", "radians", ",", "double", "distance", ")", "{", "return", "new", "AbstractPoint", "(", "p", ".", "getX", "(", ")", "+", "distance", "*", "Math", ".", "cos", "(", "radians",...
Creates a new Point distance from p to radians direction @param p Start point @param radians Angle in radians @param distance Distance @return A new Point
[ "Creates", "a", "new", "Point", "distance", "from", "p", "to", "radians", "direction" ]
train
https://github.com/tvesalainen/util/blob/bba7a44689f638ffabc8be40a75bdc9a33676433/util/src/main/java/org/vesalainen/math/AbstractPoint.java#L164-L170
bazaarvoice/emodb
sor/src/main/java/com/bazaarvoice/emodb/sor/db/astyanax/CqlBlockedDataReaderDAO.java
CqlBlockedDataReaderDAO.recordScan
private Iterator<Record> recordScan(DeltaPlacement placement, AstyanaxTable table, ByteBufferRange keyRange, ReadConsistency consistency) { """ Similar to {@link #rowScan(DeltaPlacement, AstyanaxTable, com.netflix.astyanax.model.ByteBufferRange, com.bazaarvoice.emodb.sor.api...
java
private Iterator<Record> recordScan(DeltaPlacement placement, AstyanaxTable table, ByteBufferRange keyRange, ReadConsistency consistency) { Iterator<Iterable<Row>> rowGroups = rowScan(placement, table, keyRange, consistency); return decodeRows(rowGroups, table, p...
[ "private", "Iterator", "<", "Record", ">", "recordScan", "(", "DeltaPlacement", "placement", ",", "AstyanaxTable", "table", ",", "ByteBufferRange", "keyRange", ",", "ReadConsistency", "consistency", ")", "{", "Iterator", "<", "Iterable", "<", "Row", ">>", "rowGrou...
Similar to {@link #rowScan(DeltaPlacement, AstyanaxTable, com.netflix.astyanax.model.ByteBufferRange, com.bazaarvoice.emodb.sor.api.ReadConsistency)} except this method converts each C* row into a Record.
[ "Similar", "to", "{" ]
train
https://github.com/bazaarvoice/emodb/blob/97ec7671bc78b47fc2a1c11298c0c872bd5ec7fb/sor/src/main/java/com/bazaarvoice/emodb/sor/db/astyanax/CqlBlockedDataReaderDAO.java#L538-L543
ixa-ehu/kaflib
src/main/java/ixa/kaflib/KAFDocument.java
KAFDocument.newEntity
public Entity newEntity(List<Span<Term>> references) { """ Creates a new Entity. It assigns an appropriate ID to it. The entity is added to the document object. @param type entity type. 8 values are posible: Person, Organization, Location, Date, Time, Money, Percent, Misc. @param references it contains one or mo...
java
public Entity newEntity(List<Span<Term>> references) { String newId = idManager.getNextId(AnnotationType.ENTITY); Entity newEntity = new Entity(newId, references); annotationContainer.add(newEntity, Layer.ENTITIES, AnnotationType.ENTITY); return newEntity; }
[ "public", "Entity", "newEntity", "(", "List", "<", "Span", "<", "Term", ">", ">", "references", ")", "{", "String", "newId", "=", "idManager", ".", "getNextId", "(", "AnnotationType", ".", "ENTITY", ")", ";", "Entity", "newEntity", "=", "new", "Entity", ...
Creates a new Entity. It assigns an appropriate ID to it. The entity is added to the document object. @param type entity type. 8 values are posible: Person, Organization, Location, Date, Time, Money, Percent, Misc. @param references it contains one or more span elements. A span can be used to reference the different oc...
[ "Creates", "a", "new", "Entity", ".", "It", "assigns", "an", "appropriate", "ID", "to", "it", ".", "The", "entity", "is", "added", "to", "the", "document", "object", "." ]
train
https://github.com/ixa-ehu/kaflib/blob/3921f55d9ae4621736a329418f6334fb721834b8/src/main/java/ixa/kaflib/KAFDocument.java#L744-L749
apache/incubator-gobblin
gobblin-compaction/src/main/java/org/apache/gobblin/compaction/mapreduce/MRCompactorJobPropCreator.java
MRCompactorJobPropCreator.getNewDataInFolder
private Set<Path> getNewDataInFolder(Path inputFolder, Path outputFolder) throws IOException { """ Check if inputFolder contains any files which have modification times which are more recent than the last compaction time as stored within outputFolder; return any files which do. An empty list will be returned if ...
java
private Set<Path> getNewDataInFolder(Path inputFolder, Path outputFolder) throws IOException { Set<Path> newFiles = Sets.newHashSet(); if (!this.fs.exists(inputFolder) || !this.fs.exists(outputFolder)) { return newFiles; } DateTime lastCompactionTime = new DateTime(MRCompactor.readCompactionTime...
[ "private", "Set", "<", "Path", ">", "getNewDataInFolder", "(", "Path", "inputFolder", ",", "Path", "outputFolder", ")", "throws", "IOException", "{", "Set", "<", "Path", ">", "newFiles", "=", "Sets", ".", "newHashSet", "(", ")", ";", "if", "(", "!", "thi...
Check if inputFolder contains any files which have modification times which are more recent than the last compaction time as stored within outputFolder; return any files which do. An empty list will be returned if all files are older than the last compaction time.
[ "Check", "if", "inputFolder", "contains", "any", "files", "which", "have", "modification", "times", "which", "are", "more", "recent", "than", "the", "last", "compaction", "time", "as", "stored", "within", "outputFolder", ";", "return", "any", "files", "which", ...
train
https://github.com/apache/incubator-gobblin/blob/f029b4c0fea0fe4aa62f36dda2512344ff708bae/gobblin-compaction/src/main/java/org/apache/gobblin/compaction/mapreduce/MRCompactorJobPropCreator.java#L314-L335
Azure/azure-sdk-for-java
containerregistry/resource-manager/v2018_09_01/src/main/java/com/microsoft/azure/management/containerregistry/v2018_09_01/implementation/TasksInner.java
TasksInner.beginUpdateAsync
public Observable<TaskInner> beginUpdateAsync(String resourceGroupName, String registryName, String taskName, TaskUpdateParameters taskUpdateParameters) { """ Updates a task with the specified parameters. @param resourceGroupName The name of the resource group to which the container registry belongs. @param re...
java
public Observable<TaskInner> beginUpdateAsync(String resourceGroupName, String registryName, String taskName, TaskUpdateParameters taskUpdateParameters) { return beginUpdateWithServiceResponseAsync(resourceGroupName, registryName, taskName, taskUpdateParameters).map(new Func1<ServiceResponse<TaskInner>, TaskInn...
[ "public", "Observable", "<", "TaskInner", ">", "beginUpdateAsync", "(", "String", "resourceGroupName", ",", "String", "registryName", ",", "String", "taskName", ",", "TaskUpdateParameters", "taskUpdateParameters", ")", "{", "return", "beginUpdateWithServiceResponseAsync", ...
Updates a task with the specified parameters. @param resourceGroupName The name of the resource group to which the container registry belongs. @param registryName The name of the container registry. @param taskName The name of the container registry task. @param taskUpdateParameters The parameters for updating a task....
[ "Updates", "a", "task", "with", "the", "specified", "parameters", "." ]
train
https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/containerregistry/resource-manager/v2018_09_01/src/main/java/com/microsoft/azure/management/containerregistry/v2018_09_01/implementation/TasksInner.java#L791-L798
antlrjavaparser/antlr-java-parser
src/main/java/com/github/antlrjavaparser/ASTHelper.java
ASTHelper.addTypeDeclaration
public static void addTypeDeclaration(CompilationUnit cu, TypeDeclaration type) { """ Adds the given type declaration to the compilation unit. The list of types will be initialized if it is <code>null</code>. @param cu compilation unit @param type type declaration """ List<TypeDeclaration> types...
java
public static void addTypeDeclaration(CompilationUnit cu, TypeDeclaration type) { List<TypeDeclaration> types = cu.getTypes(); if (types == null) { types = new ArrayList<TypeDeclaration>(); cu.setTypes(types); } types.add(type); }
[ "public", "static", "void", "addTypeDeclaration", "(", "CompilationUnit", "cu", ",", "TypeDeclaration", "type", ")", "{", "List", "<", "TypeDeclaration", ">", "types", "=", "cu", ".", "getTypes", "(", ")", ";", "if", "(", "types", "==", "null", ")", "{", ...
Adds the given type declaration to the compilation unit. The list of types will be initialized if it is <code>null</code>. @param cu compilation unit @param type type declaration
[ "Adds", "the", "given", "type", "declaration", "to", "the", "compilation", "unit", ".", "The", "list", "of", "types", "will", "be", "initialized", "if", "it", "is", "<code", ">", "null<", "/", "code", ">", "." ]
train
https://github.com/antlrjavaparser/antlr-java-parser/blob/077160deb44d952c40c442800abd91af7e6fe006/src/main/java/com/github/antlrjavaparser/ASTHelper.java#L202-L210
deeplearning4j/deeplearning4j
nd4j/nd4j-backends/nd4j-api-parent/nd4j-api/src/main/java/org/nd4j/imports/graphmapper/tf/TFGraphMapper.java
TFGraphMapper.initFunctionFromProperties
public void initFunctionFromProperties(DifferentialFunction on, Map<String, AttrValue> attributesForNode, NodeDef node, GraphDef graph) { """ Calls {@link #initFunctionFromProperties(DifferentialFunction, Map, NodeDef, GraphDef)} using {@link DifferentialFunction#tensorflowName()} @param on the function to use i...
java
public void initFunctionFromProperties(DifferentialFunction on, Map<String, AttrValue> attributesForNode, NodeDef node, GraphDef graph) { initFunctionFromProperties(on.tensorflowName(),on,attributesForNode,node,graph); }
[ "public", "void", "initFunctionFromProperties", "(", "DifferentialFunction", "on", ",", "Map", "<", "String", ",", "AttrValue", ">", "attributesForNode", ",", "NodeDef", "node", ",", "GraphDef", "graph", ")", "{", "initFunctionFromProperties", "(", "on", ".", "ten...
Calls {@link #initFunctionFromProperties(DifferentialFunction, Map, NodeDef, GraphDef)} using {@link DifferentialFunction#tensorflowName()} @param on the function to use init on @param attributesForNode the attributes for the node @param node @param graph
[ "Calls", "{" ]
train
https://github.com/deeplearning4j/deeplearning4j/blob/effce52f2afd7eeb53c5bcca699fcd90bd06822f/nd4j/nd4j-backends/nd4j-api-parent/nd4j-api/src/main/java/org/nd4j/imports/graphmapper/tf/TFGraphMapper.java#L676-L678
facebookarchive/hadoop-20
src/contrib/raid/src/java/org/apache/hadoop/hdfs/server/namenode/BlockPlacementPolicyRaid.java
BlockPlacementPolicyRaid.getSourceFile
NameWithINode getSourceFile(String parity, String prefix) throws IOException { """ Get path for the corresponding source file for a valid parity file. Returns null if it does not exists @param parity the toUri path of the parity file @return the toUri path of the source file """ if (isHarFile(parity)) {...
java
NameWithINode getSourceFile(String parity, String prefix) throws IOException { if (isHarFile(parity)) { return null; } // remove the prefix String src = parity.substring(prefix.length()); byte[][] components = INodeDirectory.getPathComponents(src); INode inode = namesystem.dir.getINode(com...
[ "NameWithINode", "getSourceFile", "(", "String", "parity", ",", "String", "prefix", ")", "throws", "IOException", "{", "if", "(", "isHarFile", "(", "parity", ")", ")", "{", "return", "null", ";", "}", "// remove the prefix", "String", "src", "=", "parity", "...
Get path for the corresponding source file for a valid parity file. Returns null if it does not exists @param parity the toUri path of the parity file @return the toUri path of the source file
[ "Get", "path", "for", "the", "corresponding", "source", "file", "for", "a", "valid", "parity", "file", ".", "Returns", "null", "if", "it", "does", "not", "exists" ]
train
https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/contrib/raid/src/java/org/apache/hadoop/hdfs/server/namenode/BlockPlacementPolicyRaid.java#L774-L783
RestComm/sip-servlets
sip-servlets-examples/facebook-c2c/src/main/java/com/facebook/api/FacebookRestClient.java
FacebookRestClient.photos_upload
public T photos_upload(File photo, String caption, Long albumId) throws FacebookException, IOException { """ Uploads a photo to Facebook. @param photo an image file @param caption a description of the image contents @param albumId the album into which the photo should be uploaded @return a T with the stand...
java
public T photos_upload(File photo, String caption, Long albumId) throws FacebookException, IOException { ArrayList<Pair<String, CharSequence>> params = new ArrayList<Pair<String, CharSequence>>(FacebookMethod.PHOTOS_UPLOAD.numParams()); assert (photo.exists() && photo.canRead()); this._uploadFile ...
[ "public", "T", "photos_upload", "(", "File", "photo", ",", "String", "caption", ",", "Long", "albumId", ")", "throws", "FacebookException", ",", "IOException", "{", "ArrayList", "<", "Pair", "<", "String", ",", "CharSequence", ">", ">", "params", "=", "new",...
Uploads a photo to Facebook. @param photo an image file @param caption a description of the image contents @param albumId the album into which the photo should be uploaded @return a T with the standard Facebook photo information @see <a href="http://wiki.developers.facebook.com/index.php/Photos.upload"> Developers wiki...
[ "Uploads", "a", "photo", "to", "Facebook", "." ]
train
https://github.com/RestComm/sip-servlets/blob/fd7011d2803ab1d205b140768a760c8c69e0c997/sip-servlets-examples/facebook-c2c/src/main/java/com/facebook/api/FacebookRestClient.java#L1322-L1333
exoplatform/jcr
exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/lucene/SearchIndex.java
SearchIndex.logErrorChanges
public void logErrorChanges(Set<String> removed, Set<String> added) throws IOException { """ Log unindexed changes into error.log @param removed set of removed node uuids @param added map of added node states and uuids @throws IOException """ logErrorChanges(errorLog, removed, added); }
java
public void logErrorChanges(Set<String> removed, Set<String> added) throws IOException { logErrorChanges(errorLog, removed, added); }
[ "public", "void", "logErrorChanges", "(", "Set", "<", "String", ">", "removed", ",", "Set", "<", "String", ">", "added", ")", "throws", "IOException", "{", "logErrorChanges", "(", "errorLog", ",", "removed", ",", "added", ")", ";", "}" ]
Log unindexed changes into error.log @param removed set of removed node uuids @param added map of added node states and uuids @throws IOException
[ "Log", "unindexed", "changes", "into", "error", ".", "log" ]
train
https://github.com/exoplatform/jcr/blob/3e7f9ee1b5683640d73a4316fb4b0ad5eac5b8a2/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/lucene/SearchIndex.java#L3425-L3428
offbynull/coroutines
instrumenter/src/main/java/com/offbynull/coroutines/instrumenter/generators/GenericGenerators.java
GenericGenerators.createNewObjectArray
public static InsnList createNewObjectArray(InsnList size) { """ Creates a new object array on the stack. @param size instructions to calculate the size of the new array -- must leave an int on the stack @return instructions to create a new object array -- will leave the object array on the stack @throws NullPo...
java
public static InsnList createNewObjectArray(InsnList size) { Validate.notNull(size); InsnList ret = new InsnList(); ret.add(size); ret.add(new TypeInsnNode(Opcodes.ANEWARRAY, "java/lang/Object")); return ret; }
[ "public", "static", "InsnList", "createNewObjectArray", "(", "InsnList", "size", ")", "{", "Validate", ".", "notNull", "(", "size", ")", ";", "InsnList", "ret", "=", "new", "InsnList", "(", ")", ";", "ret", ".", "add", "(", "size", ")", ";", "ret", "."...
Creates a new object array on the stack. @param size instructions to calculate the size of the new array -- must leave an int on the stack @return instructions to create a new object array -- will leave the object array on the stack @throws NullPointerException if any argument is {@code null}
[ "Creates", "a", "new", "object", "array", "on", "the", "stack", "." ]
train
https://github.com/offbynull/coroutines/blob/b1b83c293945f53a2f63fca8f15a53e88b796bf5/instrumenter/src/main/java/com/offbynull/coroutines/instrumenter/generators/GenericGenerators.java#L534-L543
JDBDT/jdbdt
src/main/java/org/jdbdt/DBSetup.java
DBSetup.doPopulate
private static void doPopulate(CallInfo callInfo, Table table, DataSet data) { """ Auxiliary method to populate a table. @param callInfo Call info. @param table Table. @param data Data set. """ doDeleteAll(callInfo, table); doInsert(callInfo, table, data); table.setSnapshot(data); }
java
private static void doPopulate(CallInfo callInfo, Table table, DataSet data) { doDeleteAll(callInfo, table); doInsert(callInfo, table, data); table.setSnapshot(data); }
[ "private", "static", "void", "doPopulate", "(", "CallInfo", "callInfo", ",", "Table", "table", ",", "DataSet", "data", ")", "{", "doDeleteAll", "(", "callInfo", ",", "table", ")", ";", "doInsert", "(", "callInfo", ",", "table", ",", "data", ")", ";", "ta...
Auxiliary method to populate a table. @param callInfo Call info. @param table Table. @param data Data set.
[ "Auxiliary", "method", "to", "populate", "a", "table", "." ]
train
https://github.com/JDBDT/jdbdt/blob/7e32845ad41dfbc5d6fd0fd561e3613697186df4/src/main/java/org/jdbdt/DBSetup.java#L94-L98
apache/groovy
src/main/java/org/codehaus/groovy/runtime/DefaultGroovyMethods.java
DefaultGroovyMethods.and
public static Boolean and(Boolean left, Boolean right) { """ Logical conjunction of two boolean operators. @param left left operator @param right right operator @return result of logical conjunction @since 1.0 """ return left && Boolean.TRUE.equals(right); }
java
public static Boolean and(Boolean left, Boolean right) { return left && Boolean.TRUE.equals(right); }
[ "public", "static", "Boolean", "and", "(", "Boolean", "left", ",", "Boolean", "right", ")", "{", "return", "left", "&&", "Boolean", ".", "TRUE", ".", "equals", "(", "right", ")", ";", "}" ]
Logical conjunction of two boolean operators. @param left left operator @param right right operator @return result of logical conjunction @since 1.0
[ "Logical", "conjunction", "of", "two", "boolean", "operators", "." ]
train
https://github.com/apache/groovy/blob/71cf20addb611bb8d097a59e395fd20bc7f31772/src/main/java/org/codehaus/groovy/runtime/DefaultGroovyMethods.java#L16597-L16599
OpenLiberty/open-liberty
dev/com.ibm.ws.monitor/src/com/ibm/ws/monitor/internal/bci/ProbeClassFileTransformer.java
ProbeClassFileTransformer.transformWithProbes
@Sensitive byte[] transformWithProbes(Class<?> clazz, @Sensitive byte[] classfileBuffer) { """ Inject the byte code required to fire probes. @param classfileBuffer the source class file @param probes the probe sites to activate @return the modified class file """ Set<ProbeListener> listeners...
java
@Sensitive byte[] transformWithProbes(Class<?> clazz, @Sensitive byte[] classfileBuffer) { Set<ProbeListener> listeners = probeManagerImpl.getInterestedByClass(clazz); if (listeners.isEmpty()) { return null; } // reader --> serial version uid adder --> process candidate ...
[ "@", "Sensitive", "byte", "[", "]", "transformWithProbes", "(", "Class", "<", "?", ">", "clazz", ",", "@", "Sensitive", "byte", "[", "]", "classfileBuffer", ")", "{", "Set", "<", "ProbeListener", ">", "listeners", "=", "probeManagerImpl", ".", "getInterested...
Inject the byte code required to fire probes. @param classfileBuffer the source class file @param probes the probe sites to activate @return the modified class file
[ "Inject", "the", "byte", "code", "required", "to", "fire", "probes", "." ]
train
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.monitor/src/com/ibm/ws/monitor/internal/bci/ProbeClassFileTransformer.java#L132-L172
RestComm/Restcomm-Connect
restcomm/restcomm.dao/src/main/java/org/restcomm/connect/dao/mybatis/MybatisUsageDao.java
MybatisUsageDao.getUsageCalls
private List<Usage> getUsageCalls(final Sid accountSid, Usage.Category category, DateTime startDate, DateTime endDate, final String queryName) { """ /* @Override public List<Usage> getUsageToday(final Sid accountSid, Usage.Category category, DateTime startDate, DateTime endDate) { return getUsageCalls(accountSi...
java
private List<Usage> getUsageCalls(final Sid accountSid, Usage.Category category, DateTime startDate, DateTime endDate, final String queryName) { return getUsageCalls(accountSid, category, startDate, endDate, "", queryName); }
[ "private", "List", "<", "Usage", ">", "getUsageCalls", "(", "final", "Sid", "accountSid", ",", "Usage", ".", "Category", "category", ",", "DateTime", "startDate", ",", "DateTime", "endDate", ",", "final", "String", "queryName", ")", "{", "return", "getUsageCal...
/* @Override public List<Usage> getUsageToday(final Sid accountSid, Usage.Category category, DateTime startDate, DateTime endDate) { return getUsageCalls(accountSid, category, startDate, endDate, "getTodayCalls"); } @Override public List<Usage> getUsageYesterday(final Sid accountSid, Usage.Category category, DateTime ...
[ "/", "*", "@Override", "public", "List<Usage", ">", "getUsageToday", "(", "final", "Sid", "accountSid", "Usage", ".", "Category", "category", "DateTime", "startDate", "DateTime", "endDate", ")", "{", "return", "getUsageCalls", "(", "accountSid", "category", "start...
train
https://github.com/RestComm/Restcomm-Connect/blob/2194dee4fc524cdfd0af77a218ba5f212f97f7c5/restcomm/restcomm.dao/src/main/java/org/restcomm/connect/dao/mybatis/MybatisUsageDao.java#L126-L128
jcuda/jcudnn
JCudnnJava/src/main/java/jcuda/jcudnn/JCudnn.java
JCudnn.cudnnGetConvolutionNdForwardOutputDim
public static int cudnnGetConvolutionNdForwardOutputDim( cudnnConvolutionDescriptor convDesc, cudnnTensorDescriptor inputTensorDesc, cudnnFilterDescriptor filterDesc, int nbDims, int[] tensorOuputDimA) { """ Helper function to return the dimensions of the output tensor g...
java
public static int cudnnGetConvolutionNdForwardOutputDim( cudnnConvolutionDescriptor convDesc, cudnnTensorDescriptor inputTensorDesc, cudnnFilterDescriptor filterDesc, int nbDims, int[] tensorOuputDimA) { return checkResult(cudnnGetConvolutionNdForwardOutputDimNati...
[ "public", "static", "int", "cudnnGetConvolutionNdForwardOutputDim", "(", "cudnnConvolutionDescriptor", "convDesc", ",", "cudnnTensorDescriptor", "inputTensorDesc", ",", "cudnnFilterDescriptor", "filterDesc", ",", "int", "nbDims", ",", "int", "[", "]", "tensorOuputDimA", ")"...
Helper function to return the dimensions of the output tensor given a convolution descriptor
[ "Helper", "function", "to", "return", "the", "dimensions", "of", "the", "output", "tensor", "given", "a", "convolution", "descriptor" ]
train
https://github.com/jcuda/jcudnn/blob/ce71f2fc02817cecace51a80e6db5f0c7f10cffc/JCudnnJava/src/main/java/jcuda/jcudnn/JCudnn.java#L989-L997
voldemort/voldemort
src/java/voldemort/tools/admin/AdminParserUtils.java
AdminParserUtils.checkRequired
public static void checkRequired(OptionSet options, String opt) throws VoldemortException { """ Checks if the required option exists. @param options OptionSet to checked @param opt Required option to check @throws VoldemortException """ List<String> opts = Lists.newArrayList(); opts.add(op...
java
public static void checkRequired(OptionSet options, String opt) throws VoldemortException { List<String> opts = Lists.newArrayList(); opts.add(opt); checkRequired(options, opts); }
[ "public", "static", "void", "checkRequired", "(", "OptionSet", "options", ",", "String", "opt", ")", "throws", "VoldemortException", "{", "List", "<", "String", ">", "opts", "=", "Lists", ".", "newArrayList", "(", ")", ";", "opts", ".", "add", "(", "opt", ...
Checks if the required option exists. @param options OptionSet to checked @param opt Required option to check @throws VoldemortException
[ "Checks", "if", "the", "required", "option", "exists", "." ]
train
https://github.com/voldemort/voldemort/blob/a7dbdea58032021361680faacf2782cf981c5332/src/java/voldemort/tools/admin/AdminParserUtils.java#L312-L316
spring-projects/spring-boot
spring-boot-project/spring-boot-tools/spring-boot-configuration-processor/src/main/java/org/springframework/boot/configurationprocessor/TypeUtils.java
TypeUtils.getType
public String getType(TypeElement element, TypeMirror type) { """ Return the type of the specified {@link TypeMirror} including all its generic information. @param element the {@link TypeElement} in which this {@code type} is declared @param type the type to handle @return a representation of the type includin...
java
public String getType(TypeElement element, TypeMirror type) { if (type == null) { return null; } return type.accept(this.typeExtractor, createTypeDescriptor(element)); }
[ "public", "String", "getType", "(", "TypeElement", "element", ",", "TypeMirror", "type", ")", "{", "if", "(", "type", "==", "null", ")", "{", "return", "null", ";", "}", "return", "type", ".", "accept", "(", "this", ".", "typeExtractor", ",", "createType...
Return the type of the specified {@link TypeMirror} including all its generic information. @param element the {@link TypeElement} in which this {@code type} is declared @param type the type to handle @return a representation of the type including all its generic information
[ "Return", "the", "type", "of", "the", "specified", "{" ]
train
https://github.com/spring-projects/spring-boot/blob/0b27f7c70e164b2b1a96477f1d9c1acba56790c1/spring-boot-project/spring-boot-tools/spring-boot-configuration-processor/src/main/java/org/springframework/boot/configurationprocessor/TypeUtils.java#L138-L143
baratine/baratine
framework/src/main/java/com/caucho/v5/vfs/Crc64InputStream.java
Crc64InputStream.read
@Override public int read(byte []buffer, int offset, int length) throws IOException { """ Writes a buffer to the underlying stream. @param buffer the byte array to write. @param offset the offset into the byte array. @param length the number of bytes to write. @param @Override isEnd true when the writ...
java
@Override public int read(byte []buffer, int offset, int length) throws IOException { int sublen = _next.read(buffer, offset, length); if (sublen <= 0) { return 0; } _crc = Crc64.generate(_crc, buffer, offset, sublen); _length += sublen; return sublen; }
[ "@", "Override", "public", "int", "read", "(", "byte", "[", "]", "buffer", ",", "int", "offset", ",", "int", "length", ")", "throws", "IOException", "{", "int", "sublen", "=", "_next", ".", "read", "(", "buffer", ",", "offset", ",", "length", ")", ";...
Writes a buffer to the underlying stream. @param buffer the byte array to write. @param offset the offset into the byte array. @param length the number of bytes to write. @param @Override isEnd true when the write is flushing a close.
[ "Writes", "a", "buffer", "to", "the", "underlying", "stream", "." ]
train
https://github.com/baratine/baratine/blob/db34b45c03c5a5e930d8142acc72319125569fcf/framework/src/main/java/com/caucho/v5/vfs/Crc64InputStream.java#L85-L100
google/error-prone-javac
src/jdk.javadoc/share/classes/com/sun/tools/doclets/internal/toolkit/builders/AnnotationTypeRequiredMemberBuilder.java
AnnotationTypeRequiredMemberBuilder.buildAnnotationTypeMember
public void buildAnnotationTypeMember(XMLNode node, Content memberDetailsTree) { """ Build the member documentation. @param node the XML element that specifies which components to document @param memberDetailsTree the content tree to which the documentation will be added """ if (writer == null) { ...
java
public void buildAnnotationTypeMember(XMLNode node, Content memberDetailsTree) { if (writer == null) { return; } int size = members.size(); if (size > 0) { writer.addAnnotationDetailsMarker(memberDetailsTree); for (currentMemberIndex = 0; currentMember...
[ "public", "void", "buildAnnotationTypeMember", "(", "XMLNode", "node", ",", "Content", "memberDetailsTree", ")", "{", "if", "(", "writer", "==", "null", ")", "{", "return", ";", "}", "int", "size", "=", "members", ".", "size", "(", ")", ";", "if", "(", ...
Build the member documentation. @param node the XML element that specifies which components to document @param memberDetailsTree the content tree to which the documentation will be added
[ "Build", "the", "member", "documentation", "." ]
train
https://github.com/google/error-prone-javac/blob/a53d069bbdb2c60232ed3811c19b65e41c3e60e0/src/jdk.javadoc/share/classes/com/sun/tools/doclets/internal/toolkit/builders/AnnotationTypeRequiredMemberBuilder.java#L164-L183
albfernandez/itext2
src/main/java/com/lowagie/text/rtf/parser/destinations/RtfDestinationMgr.java
RtfDestinationMgr.addListener
public static boolean addListener(String destination, RtfDestinationListener listener) { """ Adds a <CODE>RtfDestinationListener</CODE> to the appropriate <CODE>RtfDestination</CODE>. @param destination the destination string for the listener @param listener the new RtfDestinationListener. """ RtfDesti...
java
public static boolean addListener(String destination, RtfDestinationListener listener) { RtfDestination dest = getDestination(destination); if(dest != null) { return dest.addListener(listener); } return false; }
[ "public", "static", "boolean", "addListener", "(", "String", "destination", ",", "RtfDestinationListener", "listener", ")", "{", "RtfDestination", "dest", "=", "getDestination", "(", "destination", ")", ";", "if", "(", "dest", "!=", "null", ")", "{", "return", ...
Adds a <CODE>RtfDestinationListener</CODE> to the appropriate <CODE>RtfDestination</CODE>. @param destination the destination string for the listener @param listener the new RtfDestinationListener.
[ "Adds", "a", "<CODE", ">", "RtfDestinationListener<", "/", "CODE", ">", "to", "the", "appropriate", "<CODE", ">", "RtfDestination<", "/", "CODE", ">", "." ]
train
https://github.com/albfernandez/itext2/blob/438fc1899367fd13dfdfa8dfdca9a3c1a7783b84/src/main/java/com/lowagie/text/rtf/parser/destinations/RtfDestinationMgr.java#L209-L215
OpenTSDB/opentsdb
src/tsd/RollupDataPointRpc.java
RollupDataPointRpc.execute
@Override public void execute(final TSDB tsdb, final HttpQuery query) throws IOException { """ Handles HTTP RPC put requests @param tsdb The TSDB to which we belong @param query The HTTP query from the user @throws IOException if there is an error parsing the query or formatting the output @throws...
java
@Override public void execute(final TSDB tsdb, final HttpQuery query) throws IOException { http_requests.incrementAndGet(); // only accept POST if (query.method() != HttpMethod.POST) { throw new BadRequestException(HttpResponseStatus.METHOD_NOT_ALLOWED, "Method not allowed",...
[ "@", "Override", "public", "void", "execute", "(", "final", "TSDB", "tsdb", ",", "final", "HttpQuery", "query", ")", "throws", "IOException", "{", "http_requests", ".", "incrementAndGet", "(", ")", ";", "// only accept POST", "if", "(", "query", ".", "method",...
Handles HTTP RPC put requests @param tsdb The TSDB to which we belong @param query The HTTP query from the user @throws IOException if there is an error parsing the query or formatting the output @throws BadRequestException if the user supplied bad data
[ "Handles", "HTTP", "RPC", "put", "requests" ]
train
https://github.com/OpenTSDB/opentsdb/blob/3fc2d491c3c1ad397252c0a80203a69a3f9e3ef3/src/tsd/RollupDataPointRpc.java#L64-L79
Javacord/Javacord
javacord-api/src/main/java/org/javacord/api/entity/server/ServerUpdater.java
ServerUpdater.setVoiceChannel
public ServerUpdater setVoiceChannel(User user, ServerVoiceChannel channel) { """ Queues a moving a user to a different voice channel. @param user The user who should be moved. @param channel The new voice channel of the user. @return The current instance in order to chain call methods. """ delega...
java
public ServerUpdater setVoiceChannel(User user, ServerVoiceChannel channel) { delegate.setVoiceChannel(user, channel); return this; }
[ "public", "ServerUpdater", "setVoiceChannel", "(", "User", "user", ",", "ServerVoiceChannel", "channel", ")", "{", "delegate", ".", "setVoiceChannel", "(", "user", ",", "channel", ")", ";", "return", "this", ";", "}" ]
Queues a moving a user to a different voice channel. @param user The user who should be moved. @param channel The new voice channel of the user. @return The current instance in order to chain call methods.
[ "Queues", "a", "moving", "a", "user", "to", "a", "different", "voice", "channel", "." ]
train
https://github.com/Javacord/Javacord/blob/915aad084dc5e863284267529d0dccd625fc6886/javacord-api/src/main/java/org/javacord/api/entity/server/ServerUpdater.java#L444-L447
wildfly/wildfly-core
controller/src/main/java/org/jboss/as/controller/AttributeDefinition.java
AttributeDefinition.addOperationParameterDescription
public ModelNode addOperationParameterDescription(final ResourceBundle bundle, final String prefix, final ModelNode operationDescription) { """ Creates a returns a basic model node describing a parameter that sets this attribute, after attaching it to the given overall operation description model node. The node ...
java
public ModelNode addOperationParameterDescription(final ResourceBundle bundle, final String prefix, final ModelNode operationDescription) { final ModelNode param = getNoTextDescription(true); param.get(ModelDescriptionConstants.DESCRIPTION).set(getAttributeTextDescription(bundle, prefix)); final...
[ "public", "ModelNode", "addOperationParameterDescription", "(", "final", "ResourceBundle", "bundle", ",", "final", "String", "prefix", ",", "final", "ModelNode", "operationDescription", ")", "{", "final", "ModelNode", "param", "=", "getNoTextDescription", "(", "true", ...
Creates a returns a basic model node describing a parameter that sets this attribute, after attaching it to the given overall operation description model node. The node describing the parameter is returned to make it easy to perform further modification. @param bundle resource bundle to use for text descriptions @par...
[ "Creates", "a", "returns", "a", "basic", "model", "node", "describing", "a", "parameter", "that", "sets", "this", "attribute", "after", "attaching", "it", "to", "the", "given", "overall", "operation", "description", "model", "node", ".", "The", "node", "descri...
train
https://github.com/wildfly/wildfly-core/blob/cfaf0479dcbb2d320a44c5374b93b944ec39fade/controller/src/main/java/org/jboss/as/controller/AttributeDefinition.java#L821-L830
looly/hutool
hutool-core/src/main/java/cn/hutool/core/util/XmlUtil.java
XmlUtil.getElementByXPath
public static Element getElementByXPath(String expression, Object source) { """ 通过XPath方式读取XML节点等信息<br> Xpath相关文章:https://www.ibm.com/developerworks/cn/xml/x-javaxpathapi.html @param expression XPath表达式 @param source 资源,可以是Docunent、Node节点等 @return 匹配返回类型的值 @since 4.0.9 """ return (Element) getNodeByX...
java
public static Element getElementByXPath(String expression, Object source) { return (Element) getNodeByXPath(expression, source); }
[ "public", "static", "Element", "getElementByXPath", "(", "String", "expression", ",", "Object", "source", ")", "{", "return", "(", "Element", ")", "getNodeByXPath", "(", "expression", ",", "source", ")", ";", "}" ]
通过XPath方式读取XML节点等信息<br> Xpath相关文章:https://www.ibm.com/developerworks/cn/xml/x-javaxpathapi.html @param expression XPath表达式 @param source 资源,可以是Docunent、Node节点等 @return 匹配返回类型的值 @since 4.0.9
[ "通过XPath方式读取XML节点等信息<br", ">", "Xpath相关文章:https", ":", "//", "www", ".", "ibm", ".", "com", "/", "developerworks", "/", "cn", "/", "xml", "/", "x", "-", "javaxpathapi", ".", "html" ]
train
https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-core/src/main/java/cn/hutool/core/util/XmlUtil.java#L572-L574
kirgor/enklib
common/src/main/java/com/kirgor/enklib/common/ConfigUtils.java
ConfigUtils.loadFromXMLFile
public static <T> T loadFromXMLFile(Class<T> configClass, File file) throws Exception { """ Loads config values from XML file, maps them to configuration class fields and returns the result instance. @param configClass Class, which fields will be mapped to config values. @param file Where to load the co...
java
public static <T> T loadFromXMLFile(Class<T> configClass, File file) throws Exception { Persister persister = new Persister(); return persister.read(configClass, file); }
[ "public", "static", "<", "T", ">", "T", "loadFromXMLFile", "(", "Class", "<", "T", ">", "configClass", ",", "File", "file", ")", "throws", "Exception", "{", "Persister", "persister", "=", "new", "Persister", "(", ")", ";", "return", "persister", ".", "re...
Loads config values from XML file, maps them to configuration class fields and returns the result instance. @param configClass Class, which fields will be mapped to config values. @param file Where to load the config from. @param <T> Generic type of configClass @return Instance of configClass with field...
[ "Loads", "config", "values", "from", "XML", "file", "maps", "them", "to", "configuration", "class", "fields", "and", "returns", "the", "result", "instance", "." ]
train
https://github.com/kirgor/enklib/blob/8a24db296dc43db5d8fe509cf64ace0a0c7be8f2/common/src/main/java/com/kirgor/enklib/common/ConfigUtils.java#L71-L74
lessthanoptimal/BoofCV
main/boofcv-io/src/main/java/boofcv/io/image/ConvertBufferedImage.java
ConvertBufferedImage.convertTo_U8
public static BufferedImage convertTo_U8(Planar<GrayU8> src, BufferedImage dst, boolean orderRgb ) { """ Converts a {@link Planar} {@link GrayU8} into a BufferedImage. @param src Input image. @param dst Where the converted image is written to. If null a new image is created. @param orderRgb If applicable, sh...
java
public static BufferedImage convertTo_U8(Planar<GrayU8> src, BufferedImage dst, boolean orderRgb ) { dst = checkInputs(src, dst); if( orderRgb ) { src = orderBandsIntoBuffered(src, dst); } DataBuffer buffer = dst.getRaster().getDataBuffer(); try { if (buffer.getDataType() == DataBuffer.TYPE_BYTE && is...
[ "public", "static", "BufferedImage", "convertTo_U8", "(", "Planar", "<", "GrayU8", ">", "src", ",", "BufferedImage", "dst", ",", "boolean", "orderRgb", ")", "{", "dst", "=", "checkInputs", "(", "src", ",", "dst", ")", ";", "if", "(", "orderRgb", ")", "{"...
Converts a {@link Planar} {@link GrayU8} into a BufferedImage. @param src Input image. @param dst Where the converted image is written to. If null a new image is created. @param orderRgb If applicable, should it change the order of the color bands (assumed RGB or ARGB) into the order based on BufferedImage.TYPE. Most...
[ "Converts", "a", "{", "@link", "Planar", "}", "{", "@link", "GrayU8", "}", "into", "a", "BufferedImage", "." ]
train
https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-io/src/main/java/boofcv/io/image/ConvertBufferedImage.java#L784-L807
UrielCh/ovh-java-sdk
ovh-java-sdk-dedicatedserver/src/main/java/net/minidev/ovh/api/ApiOvhDedicatedserver.java
ApiOvhDedicatedserver.serviceName_secondaryDnsDomains_domain_PUT
public void serviceName_secondaryDnsDomains_domain_PUT(String serviceName, String domain, OvhSecondaryDNS body) throws IOException { """ Alter this object properties REST: PUT /dedicated/server/{serviceName}/secondaryDnsDomains/{domain} @param body [required] New object properties @param serviceName [required...
java
public void serviceName_secondaryDnsDomains_domain_PUT(String serviceName, String domain, OvhSecondaryDNS body) throws IOException { String qPath = "/dedicated/server/{serviceName}/secondaryDnsDomains/{domain}"; StringBuilder sb = path(qPath, serviceName, domain); exec(qPath, "PUT", sb.toString(), body); }
[ "public", "void", "serviceName_secondaryDnsDomains_domain_PUT", "(", "String", "serviceName", ",", "String", "domain", ",", "OvhSecondaryDNS", "body", ")", "throws", "IOException", "{", "String", "qPath", "=", "\"/dedicated/server/{serviceName}/secondaryDnsDomains/{domain}\"", ...
Alter this object properties REST: PUT /dedicated/server/{serviceName}/secondaryDnsDomains/{domain} @param body [required] New object properties @param serviceName [required] The internal name of your dedicated server @param domain [required] domain on slave server
[ "Alter", "this", "object", "properties" ]
train
https://github.com/UrielCh/ovh-java-sdk/blob/6d531a40e56e09701943e334c25f90f640c55701/ovh-java-sdk-dedicatedserver/src/main/java/net/minidev/ovh/api/ApiOvhDedicatedserver.java#L1963-L1967
DataSketches/sketches-core
src/main/java/com/yahoo/sketches/hll/DirectAuxHashMap.java
DirectAuxHashMap.find
private static final int find(final DirectHllArray host, final int slotNo) { """ If the probe comes back to original index, throws an exception. """ final int lgAuxArrInts = extractLgArr(host.mem); assert lgAuxArrInts < host.lgConfigK : lgAuxArrInts; final int auxInts = 1 << lgAuxArrInts; final...
java
private static final int find(final DirectHllArray host, final int slotNo) { final int lgAuxArrInts = extractLgArr(host.mem); assert lgAuxArrInts < host.lgConfigK : lgAuxArrInts; final int auxInts = 1 << lgAuxArrInts; final int auxArrMask = auxInts - 1; final int configKmask = (1 << host.lgConfigK) ...
[ "private", "static", "final", "int", "find", "(", "final", "DirectHllArray", "host", ",", "final", "int", "slotNo", ")", "{", "final", "int", "lgAuxArrInts", "=", "extractLgArr", "(", "host", ".", "mem", ")", ";", "assert", "lgAuxArrInts", "<", "host", "."...
If the probe comes back to original index, throws an exception.
[ "If", "the", "probe", "comes", "back", "to", "original", "index", "throws", "an", "exception", "." ]
train
https://github.com/DataSketches/sketches-core/blob/900c8c9668a1e2f1d54d453e956caad54702e540/src/main/java/com/yahoo/sketches/hll/DirectAuxHashMap.java#L133-L153
lievendoclo/Valkyrie-RCP
valkyrie-rcp-core/src/main/java/org/valkyriercp/application/exceptionhandling/JXErrorDialogExceptionHandler.java
JXErrorDialogExceptionHandler.notifyUserAboutException
public void notifyUserAboutException(Thread thread, final Throwable throwable) { """ Shows the {@link org.jdesktop.swingx.JXErrorPane} to the user. """ SwingUtilities.invokeLater(new Runnable() { @Override public void run() { final ErrorInfo errorInfo = new Error...
java
public void notifyUserAboutException(Thread thread, final Throwable throwable) { SwingUtilities.invokeLater(new Runnable() { @Override public void run() { final ErrorInfo errorInfo = new ErrorInfo( resolveExceptionCaption(throwable), ...
[ "public", "void", "notifyUserAboutException", "(", "Thread", "thread", ",", "final", "Throwable", "throwable", ")", "{", "SwingUtilities", ".", "invokeLater", "(", "new", "Runnable", "(", ")", "{", "@", "Override", "public", "void", "run", "(", ")", "{", "fi...
Shows the {@link org.jdesktop.swingx.JXErrorPane} to the user.
[ "Shows", "the", "{" ]
train
https://github.com/lievendoclo/Valkyrie-RCP/blob/6aad6e640b348cda8f3b0841f6e42025233f1eb8/valkyrie-rcp-core/src/main/java/org/valkyriercp/application/exceptionhandling/JXErrorDialogExceptionHandler.java#L59-L76
jakenjarvis/Android-OrmLiteContentProvider
ormlite-content-provider-library/src/com/tojc/ormlite/android/OrmLiteSimpleContentProvider.java
OrmLiteSimpleContentProvider.getSortOrderStringForQuery
protected String getSortOrderStringForQuery(MatcherPattern target, QueryParameters parameter) { """ This method gets the appropriate sort order. @param target Arguments passed to the onQuery() method. @param parameter Arguments passed to the onQuery() method. @return return an sort order string. @since 1.0.4...
java
protected String getSortOrderStringForQuery(MatcherPattern target, QueryParameters parameter) { String result = ""; if (parameter.getSortOrder() != null && parameter.getSortOrder().length() >= 1) { result = parameter.getSortOrder(); } else { result = target.getTableInfo()...
[ "protected", "String", "getSortOrderStringForQuery", "(", "MatcherPattern", "target", ",", "QueryParameters", "parameter", ")", "{", "String", "result", "=", "\"\"", ";", "if", "(", "parameter", ".", "getSortOrder", "(", ")", "!=", "null", "&&", "parameter", "."...
This method gets the appropriate sort order. @param target Arguments passed to the onQuery() method. @param parameter Arguments passed to the onQuery() method. @return return an sort order string. @since 1.0.4
[ "This", "method", "gets", "the", "appropriate", "sort", "order", "." ]
train
https://github.com/jakenjarvis/Android-OrmLiteContentProvider/blob/8f102f0743b308c9f58d43639e98f832fd951985/ormlite-content-provider-library/src/com/tojc/ormlite/android/OrmLiteSimpleContentProvider.java#L180-L188
ThreeTen/threeten-extra
src/main/java/org/threeten/extra/scale/UtcInstant.java
UtcInstant.ofModifiedJulianDay
public static UtcInstant ofModifiedJulianDay(long mjDay, long nanoOfDay) { """ Obtains an instance of {@code UtcInstant} from a Modified Julian Day with a nanosecond fraction of day. <p> Modified Julian Day is a simple incrementing count of days where day 0 is 1858-11-17. Nanosecond-of-day is a simple count of...
java
public static UtcInstant ofModifiedJulianDay(long mjDay, long nanoOfDay) { UtcRules.system().validateModifiedJulianDay(mjDay, nanoOfDay); return new UtcInstant(mjDay, nanoOfDay); }
[ "public", "static", "UtcInstant", "ofModifiedJulianDay", "(", "long", "mjDay", ",", "long", "nanoOfDay", ")", "{", "UtcRules", ".", "system", "(", ")", ".", "validateModifiedJulianDay", "(", "mjDay", ",", "nanoOfDay", ")", ";", "return", "new", "UtcInstant", "...
Obtains an instance of {@code UtcInstant} from a Modified Julian Day with a nanosecond fraction of day. <p> Modified Julian Day is a simple incrementing count of days where day 0 is 1858-11-17. Nanosecond-of-day is a simple count of nanoseconds from the start of the day including any additional leap-second. This method...
[ "Obtains", "an", "instance", "of", "{", "@code", "UtcInstant", "}", "from", "a", "Modified", "Julian", "Day", "with", "a", "nanosecond", "fraction", "of", "day", ".", "<p", ">", "Modified", "Julian", "Day", "is", "a", "simple", "incrementing", "count", "of...
train
https://github.com/ThreeTen/threeten-extra/blob/e94ecd3592ef70e54d6eea21095239ea9ffbab78/src/main/java/org/threeten/extra/scale/UtcInstant.java#L153-L156
svenkubiak/mangooio
mangooio-core/src/main/java/io/mangoo/routing/handlers/ResponseHandler.java
ResponseHandler.handleRedirectResponse
protected void handleRedirectResponse(HttpServerExchange exchange, Response response) { """ Handles a redirect response to the client by sending a 403 status code to the client @param exchange The Undertow HttpServerExchange @param response The response object """ exchange.setStatusCode(StatusCodes...
java
protected void handleRedirectResponse(HttpServerExchange exchange, Response response) { exchange.setStatusCode(StatusCodes.FOUND); Server.headers() .entrySet() .stream() .filter(entry -> StringUtils.isNotBlank(entry.getValue())) .forEach(entry -> ...
[ "protected", "void", "handleRedirectResponse", "(", "HttpServerExchange", "exchange", ",", "Response", "response", ")", "{", "exchange", ".", "setStatusCode", "(", "StatusCodes", ".", "FOUND", ")", ";", "Server", ".", "headers", "(", ")", ".", "entrySet", "(", ...
Handles a redirect response to the client by sending a 403 status code to the client @param exchange The Undertow HttpServerExchange @param response The response object
[ "Handles", "a", "redirect", "response", "to", "the", "client", "by", "sending", "a", "403", "status", "code", "to", "the", "client" ]
train
https://github.com/svenkubiak/mangooio/blob/b3beb6d09510dbbab0ed947d5069c463e1fda6e7/mangooio-core/src/main/java/io/mangoo/routing/handlers/ResponseHandler.java#L63-L75
elki-project/elki
elki-index/src/main/java/de/lmu/ifi/dbs/elki/index/tree/AbstractNode.java
AbstractNode.splitByMask
public final void splitByMask(AbstractNode<E> newNode, long[] assignment) { """ Splits the entries of this node into a new node using the given assignments @param newNode Node to split to @param assignment Assignment mask """ assert (isLeaf() == newNode.isLeaf()); int dest = BitsUtil.nextSetBit(ass...
java
public final void splitByMask(AbstractNode<E> newNode, long[] assignment) { assert (isLeaf() == newNode.isLeaf()); int dest = BitsUtil.nextSetBit(assignment, 0); if(dest < 0) { throw new AbortException("No bits set in splitting mask."); } // FIXME: use faster iteration/testing int pos = de...
[ "public", "final", "void", "splitByMask", "(", "AbstractNode", "<", "E", ">", "newNode", ",", "long", "[", "]", "assignment", ")", "{", "assert", "(", "isLeaf", "(", ")", "==", "newNode", ".", "isLeaf", "(", ")", ")", ";", "int", "dest", "=", "BitsUt...
Splits the entries of this node into a new node using the given assignments @param newNode Node to split to @param assignment Assignment mask
[ "Splits", "the", "entries", "of", "this", "node", "into", "a", "new", "node", "using", "the", "given", "assignments" ]
train
https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-index/src/main/java/de/lmu/ifi/dbs/elki/index/tree/AbstractNode.java#L363-L389
UrielCh/ovh-java-sdk
ovh-java-sdk-cloud/src/main/java/net/minidev/ovh/api/ApiOvhCloud.java
ApiOvhCloud.project_serviceName_credit_POST
public void project_serviceName_credit_POST(String serviceName, String code) throws IOException { """ Add credit to your project REST: POST /cloud/project/{serviceName}/credit @param code [required] Voucher code @param serviceName [required] The project id """ String qPath = "/cloud/project/{serviceName...
java
public void project_serviceName_credit_POST(String serviceName, String code) throws IOException { String qPath = "/cloud/project/{serviceName}/credit"; StringBuilder sb = path(qPath, serviceName); HashMap<String, Object>o = new HashMap<String, Object>(); addBody(o, "code", code); exec(qPath, "POST", sb.toStri...
[ "public", "void", "project_serviceName_credit_POST", "(", "String", "serviceName", ",", "String", "code", ")", "throws", "IOException", "{", "String", "qPath", "=", "\"/cloud/project/{serviceName}/credit\"", ";", "StringBuilder", "sb", "=", "path", "(", "qPath", ",", ...
Add credit to your project REST: POST /cloud/project/{serviceName}/credit @param code [required] Voucher code @param serviceName [required] The project id
[ "Add", "credit", "to", "your", "project" ]
train
https://github.com/UrielCh/ovh-java-sdk/blob/6d531a40e56e09701943e334c25f90f640c55701/ovh-java-sdk-cloud/src/main/java/net/minidev/ovh/api/ApiOvhCloud.java#L975-L981
JOML-CI/JOML
src/org/joml/Vector2f.java
Vector2f.fma
public Vector2f fma(Vector2fc a, Vector2fc b) { """ Add the component-wise multiplication of <code>a * b</code> to this vector. @param a the first multiplicand @param b the second multiplicand @return a vector holding the result """ return fma(a, b, thisOrNew()); }
java
public Vector2f fma(Vector2fc a, Vector2fc b) { return fma(a, b, thisOrNew()); }
[ "public", "Vector2f", "fma", "(", "Vector2fc", "a", ",", "Vector2fc", "b", ")", "{", "return", "fma", "(", "a", ",", "b", ",", "thisOrNew", "(", ")", ")", ";", "}" ]
Add the component-wise multiplication of <code>a * b</code> to this vector. @param a the first multiplicand @param b the second multiplicand @return a vector holding the result
[ "Add", "the", "component", "-", "wise", "multiplication", "of", "<code", ">", "a", "*", "b<", "/", "code", ">", "to", "this", "vector", "." ]
train
https://github.com/JOML-CI/JOML/blob/ce2652fc236b42bda3875c591f8e6645048a678f/src/org/joml/Vector2f.java#L944-L946
GenesysPureEngage/workspace-client-java
src/main/java/com/genesys/internal/workspace/api/MediaApi.java
MediaApi.attachments
public String attachments(String mediatype, String id, String documentId) throws ApiException { """ Get the attachment of the interaction Get the attachment of the interaction specified in the documentId path parameter @param mediatype media-type of interaction (required) @param id id of interaction (required) ...
java
public String attachments(String mediatype, String id, String documentId) throws ApiException { ApiResponse<String> resp = attachmentsWithHttpInfo(mediatype, id, documentId); return resp.getData(); }
[ "public", "String", "attachments", "(", "String", "mediatype", ",", "String", "id", ",", "String", "documentId", ")", "throws", "ApiException", "{", "ApiResponse", "<", "String", ">", "resp", "=", "attachmentsWithHttpInfo", "(", "mediatype", ",", "id", ",", "d...
Get the attachment of the interaction Get the attachment of the interaction specified in the documentId path parameter @param mediatype media-type of interaction (required) @param id id of interaction (required) @param documentId id of document to get (required) @return String @throws ApiException If fail to call the A...
[ "Get", "the", "attachment", "of", "the", "interaction", "Get", "the", "attachment", "of", "the", "interaction", "specified", "in", "the", "documentId", "path", "parameter" ]
train
https://github.com/GenesysPureEngage/workspace-client-java/blob/509fdd9e89b9359d012f9a72be95037a3cef53e6/src/main/java/com/genesys/internal/workspace/api/MediaApi.java#L1158-L1161
infinispan/infinispan
core/src/main/java/org/infinispan/persistence/support/SingletonCacheWriter.java
SingletonCacheWriter.pushState
protected void pushState(final Cache<?, ?> cache) throws Exception { """ Pushes the state of a specific cache by reading the cache's data and putting in the cache store. """ DataContainer<?, ?> dc = cache.getAdvancedCache().getDataContainer(); dc.forEach(entry -> { MarshallableEntry me = c...
java
protected void pushState(final Cache<?, ?> cache) throws Exception { DataContainer<?, ?> dc = cache.getAdvancedCache().getDataContainer(); dc.forEach(entry -> { MarshallableEntry me = ctx.getMarshallableEntryFactory().create(entry.getKey(), entry.getValue(), entry.getMetadata(), entr...
[ "protected", "void", "pushState", "(", "final", "Cache", "<", "?", ",", "?", ">", "cache", ")", "throws", "Exception", "{", "DataContainer", "<", "?", ",", "?", ">", "dc", "=", "cache", ".", "getAdvancedCache", "(", ")", ".", "getDataContainer", "(", "...
Pushes the state of a specific cache by reading the cache's data and putting in the cache store.
[ "Pushes", "the", "state", "of", "a", "specific", "cache", "by", "reading", "the", "cache", "s", "data", "and", "putting", "in", "the", "cache", "store", "." ]
train
https://github.com/infinispan/infinispan/blob/7c62b94886c3febb4774ae8376acf2baa0265ab5/core/src/main/java/org/infinispan/persistence/support/SingletonCacheWriter.java#L141-L148
LearnLib/automatalib
core/src/main/java/net/automatalib/modelchecking/lasso/AbstractLasso.java
AbstractLasso.getSuccessor
@Nullable @Override public Integer getSuccessor(Integer state, @Nullable I input) { """ Get the successor state of a given state, or {@code null} when no such successor exists. @see SimpleDTS#getSuccessor(Object, Object) """ final Integer result; if (state < word.length() && input.eq...
java
@Nullable @Override public Integer getSuccessor(Integer state, @Nullable I input) { final Integer result; if (state < word.length() && input.equals(word.getSymbol(state))) { result = state + 1; } else { result = null; } return result; }
[ "@", "Nullable", "@", "Override", "public", "Integer", "getSuccessor", "(", "Integer", "state", ",", "@", "Nullable", "I", "input", ")", "{", "final", "Integer", "result", ";", "if", "(", "state", "<", "word", ".", "length", "(", ")", "&&", "input", "....
Get the successor state of a given state, or {@code null} when no such successor exists. @see SimpleDTS#getSuccessor(Object, Object)
[ "Get", "the", "successor", "state", "of", "a", "given", "state", "or", "{", "@code", "null", "}", "when", "no", "such", "successor", "exists", "." ]
train
https://github.com/LearnLib/automatalib/blob/8a462ec52f6eaab9f8996e344f2163a72cb8aa6e/core/src/main/java/net/automatalib/modelchecking/lasso/AbstractLasso.java#L208-L219
lastaflute/lastaflute
src/main/java/org/lastaflute/web/login/TypicalLoginAssist.java
TypicalLoginAssist.doLoginByIdentity
protected void doLoginByIdentity(Object userId, LoginSpecifiedOption option) throws LoginFailureException { """ Do actually login for the user by identity (user ID). (no silent) @param userId for the login user. (NotNull) @param option The option of login specified by caller. (NotNull) @throws LoginFailureExcep...
java
protected void doLoginByIdentity(Object userId, LoginSpecifiedOption option) throws LoginFailureException { assertUserIdRequired(userId); handleLoginSuccess(findLoginUser(userId).orElseThrow(() -> { String msg = "Not found the user by the user ID: " + userId + ", " + option; retu...
[ "protected", "void", "doLoginByIdentity", "(", "Object", "userId", ",", "LoginSpecifiedOption", "option", ")", "throws", "LoginFailureException", "{", "assertUserIdRequired", "(", "userId", ")", ";", "handleLoginSuccess", "(", "findLoginUser", "(", "userId", ")", ".",...
Do actually login for the user by identity (user ID). (no silent) @param userId for the login user. (NotNull) @param option The option of login specified by caller. (NotNull) @throws LoginFailureException When it fails to do login by the user info.
[ "Do", "actually", "login", "for", "the", "user", "by", "identity", "(", "user", "ID", ")", ".", "(", "no", "silent", ")" ]
train
https://github.com/lastaflute/lastaflute/blob/17b56dda8322e4c6d79043532c1dda917d6b60a8/src/main/java/org/lastaflute/web/login/TypicalLoginAssist.java#L303-L309
sebastiangraf/treetank
interfacemodules/xml/src/main/java/org/treetank/service/xml/diff/AbsDiff.java
AbsDiff.checkName
boolean checkName(final INodeReadTrx paramNewRtx, final INodeReadTrx paramOldRtx) { """ Check {@link QName} of nodes. @param paramNewRtx {@link IReadTransaction} on new revision @param paramOldRtx {@link IReadTransaction} on old revision @return true if nodes are "equal" according to their {@link QName}s, ...
java
boolean checkName(final INodeReadTrx paramNewRtx, final INodeReadTrx paramOldRtx) { assert paramNewRtx != null; assert paramOldRtx != null; boolean found = false; if (paramNewRtx.getNode().getKind() == paramOldRtx.getNode().getKind()) { switch (paramNewRtx.getNode().getKind()...
[ "boolean", "checkName", "(", "final", "INodeReadTrx", "paramNewRtx", ",", "final", "INodeReadTrx", "paramOldRtx", ")", "{", "assert", "paramNewRtx", "!=", "null", ";", "assert", "paramOldRtx", "!=", "null", ";", "boolean", "found", "=", "false", ";", "if", "("...
Check {@link QName} of nodes. @param paramNewRtx {@link IReadTransaction} on new revision @param paramOldRtx {@link IReadTransaction} on old revision @return true if nodes are "equal" according to their {@link QName}s, otherwise false
[ "Check", "{", "@link", "QName", "}", "of", "nodes", "." ]
train
https://github.com/sebastiangraf/treetank/blob/9b96d631b6c2a8502a0cc958dcb02bd6a6fd8b60/interfacemodules/xml/src/main/java/org/treetank/service/xml/diff/AbsDiff.java#L422-L442
att/AAF
inno/xgen/src/main/java/com/att/xgen/XGenBuff.java
XGenBuff.run
public void run(Cache<G> cache, Code<G> code) throws APIException, IOException { """ Normal case of building up Cached HTML without transaction info @param cache @param code @throws APIException @throws IOException """ code.code(cache, xgen); }
java
public void run(Cache<G> cache, Code<G> code) throws APIException, IOException { code.code(cache, xgen); }
[ "public", "void", "run", "(", "Cache", "<", "G", ">", "cache", ",", "Code", "<", "G", ">", "code", ")", "throws", "APIException", ",", "IOException", "{", "code", ".", "code", "(", "cache", ",", "xgen", ")", ";", "}" ]
Normal case of building up Cached HTML without transaction info @param cache @param code @throws APIException @throws IOException
[ "Normal", "case", "of", "building", "up", "Cached", "HTML", "without", "transaction", "info" ]
train
https://github.com/att/AAF/blob/090562e956c0035db972aafba844dc6d3fc948ee/inno/xgen/src/main/java/com/att/xgen/XGenBuff.java#L32-L34
ngageoint/geopackage-core-java
src/main/java/mil/nga/geopackage/extension/related/RelatedTablesCoreExtension.java
RelatedTablesCoreExtension.getRelations
public List<ExtendedRelation> getRelations(String baseTable, String relatedTable) throws SQLException { """ Get the relations to the base table and related table @param baseTable base table name @param relatedTable related table name @return extended relations @throws SQLException upon failure @since ...
java
public List<ExtendedRelation> getRelations(String baseTable, String relatedTable) throws SQLException { return getRelations(baseTable, null, relatedTable, null, null, null); }
[ "public", "List", "<", "ExtendedRelation", ">", "getRelations", "(", "String", "baseTable", ",", "String", "relatedTable", ")", "throws", "SQLException", "{", "return", "getRelations", "(", "baseTable", ",", "null", ",", "relatedTable", ",", "null", ",", "null",...
Get the relations to the base table and related table @param baseTable base table name @param relatedTable related table name @return extended relations @throws SQLException upon failure @since 3.2.0
[ "Get", "the", "relations", "to", "the", "base", "table", "and", "related", "table" ]
train
https://github.com/ngageoint/geopackage-core-java/blob/6431c3b041a45b7f3802904ea4156b4082a72daa/src/main/java/mil/nga/geopackage/extension/related/RelatedTablesCoreExtension.java#L1079-L1082
JOML-CI/JOML
src/org/joml/Matrix4x3d.java
Matrix4x3d.billboardCylindrical
public Matrix4x3d billboardCylindrical(Vector3dc objPos, Vector3dc targetPos, Vector3dc up) { """ Set this matrix to a cylindrical billboard transformation that rotates the local +Z axis of a given object with position <code>objPos</code> towards a target position at <code>targetPos</code> while constraining a cy...
java
public Matrix4x3d billboardCylindrical(Vector3dc objPos, Vector3dc targetPos, Vector3dc up) { double dirX = targetPos.x() - objPos.x(); double dirY = targetPos.y() - objPos.y(); double dirZ = targetPos.z() - objPos.z(); // left = up x dir double leftX = up.y() * dirZ - up.z() * d...
[ "public", "Matrix4x3d", "billboardCylindrical", "(", "Vector3dc", "objPos", ",", "Vector3dc", "targetPos", ",", "Vector3dc", "up", ")", "{", "double", "dirX", "=", "targetPos", ".", "x", "(", ")", "-", "objPos", ".", "x", "(", ")", ";", "double", "dirY", ...
Set this matrix to a cylindrical billboard transformation that rotates the local +Z axis of a given object with position <code>objPos</code> towards a target position at <code>targetPos</code> while constraining a cylindrical rotation around the given <code>up</code> vector. <p> This method can be used to create the co...
[ "Set", "this", "matrix", "to", "a", "cylindrical", "billboard", "transformation", "that", "rotates", "the", "local", "+", "Z", "axis", "of", "a", "given", "object", "with", "position", "<code", ">", "objPos<", "/", "code", ">", "towards", "a", "target", "p...
train
https://github.com/JOML-CI/JOML/blob/ce2652fc236b42bda3875c591f8e6645048a678f/src/org/joml/Matrix4x3d.java#L9001-L9039
sebastiangraf/treetank
interfacemodules/xml/src/main/java/org/treetank/service/xml/xpath/PipelineBuilder.java
PipelineBuilder.addCastableExpr
public void addCastableExpr(final INodeReadTrx mTransaction, final SingleType mSingleType) { """ Adds a castable expression to the pipeline. @param mTransaction Transaction to operate with. @param mSingleType single type the context item will be casted to. """ assert getPipeStack().size() >= 1; ...
java
public void addCastableExpr(final INodeReadTrx mTransaction, final SingleType mSingleType) { assert getPipeStack().size() >= 1; final AbsAxis candidate = getPipeStack().pop().getExpr(); final AbsAxis axis = new CastableExpr(mTransaction, candidate, mSingleType); if (getPipeStack().emp...
[ "public", "void", "addCastableExpr", "(", "final", "INodeReadTrx", "mTransaction", ",", "final", "SingleType", "mSingleType", ")", "{", "assert", "getPipeStack", "(", ")", ".", "size", "(", ")", ">=", "1", ";", "final", "AbsAxis", "candidate", "=", "getPipeSta...
Adds a castable expression to the pipeline. @param mTransaction Transaction to operate with. @param mSingleType single type the context item will be casted to.
[ "Adds", "a", "castable", "expression", "to", "the", "pipeline", "." ]
train
https://github.com/sebastiangraf/treetank/blob/9b96d631b6c2a8502a0cc958dcb02bd6a6fd8b60/interfacemodules/xml/src/main/java/org/treetank/service/xml/xpath/PipelineBuilder.java#L625-L637
fozziethebeat/S-Space
src/main/java/edu/ucla/sspace/matrix/ArrayMatrix.java
ArrayMatrix.checkIndices
private void checkIndices(int row, int col) { """ Check that the indices of a requested cell are within bounds. @param row The row of the cell to check. @param col The column of the cell to check. @throws ArrayIndexOutOfBoundsException if """ if (row < 0 || row >= rows) throw new Arr...
java
private void checkIndices(int row, int col) { if (row < 0 || row >= rows) throw new ArrayIndexOutOfBoundsException("row: " + row); else if (col < 0 || col >= cols) throw new ArrayIndexOutOfBoundsException("column: " + col); }
[ "private", "void", "checkIndices", "(", "int", "row", ",", "int", "col", ")", "{", "if", "(", "row", "<", "0", "||", "row", ">=", "rows", ")", "throw", "new", "ArrayIndexOutOfBoundsException", "(", "\"row: \"", "+", "row", ")", ";", "else", "if", "(", ...
Check that the indices of a requested cell are within bounds. @param row The row of the cell to check. @param col The column of the cell to check. @throws ArrayIndexOutOfBoundsException if
[ "Check", "that", "the", "indices", "of", "a", "requested", "cell", "are", "within", "bounds", "." ]
train
https://github.com/fozziethebeat/S-Space/blob/a608102737dfd3d59038a9ead33fe60356bc6029/src/main/java/edu/ucla/sspace/matrix/ArrayMatrix.java#L139-L144
petergeneric/stdlib
guice/common/src/main/java/com/peterphi/std/guice/common/ClassScanner.java
ClassScanner.getImplementations
public <T> List<Class<? extends T>> getImplementations(final Class<T> clazz) { """ Find all implementations of an interface (if an interface is provided) or extensions (if a class is provided) @param clazz @param <T> @return """ return getImplementations(clazz, null); }
java
public <T> List<Class<? extends T>> getImplementations(final Class<T> clazz) { return getImplementations(clazz, null); }
[ "public", "<", "T", ">", "List", "<", "Class", "<", "?", "extends", "T", ">", ">", "getImplementations", "(", "final", "Class", "<", "T", ">", "clazz", ")", "{", "return", "getImplementations", "(", "clazz", ",", "null", ")", ";", "}" ]
Find all implementations of an interface (if an interface is provided) or extensions (if a class is provided) @param clazz @param <T> @return
[ "Find", "all", "implementations", "of", "an", "interface", "(", "if", "an", "interface", "is", "provided", ")", "or", "extensions", "(", "if", "a", "class", "is", "provided", ")" ]
train
https://github.com/petergeneric/stdlib/blob/d4025d2f881bc0542b1e004c5f65a1ccaf895836/guice/common/src/main/java/com/peterphi/std/guice/common/ClassScanner.java#L185-L188
cryptomator/siv-mode
src/main/java/org/cryptomator/siv/SivMode.java
SivMode.s2v
byte[] s2v(byte[] macKey, byte[] plaintext, byte[]... associatedData) { """ Visible for testing, throws IllegalArgumentException if key is not accepted by CMac#init(CipherParameters) """ // Maximum permitted AD length is the block size in bits - 2 if (associatedData.length > 126) { // SIV mode cannot be...
java
byte[] s2v(byte[] macKey, byte[] plaintext, byte[]... associatedData) { // Maximum permitted AD length is the block size in bits - 2 if (associatedData.length > 126) { // SIV mode cannot be used safely with this many AD fields throw new IllegalArgumentException("too many Associated Data fields"); } final...
[ "byte", "[", "]", "s2v", "(", "byte", "[", "]", "macKey", ",", "byte", "[", "]", "plaintext", ",", "byte", "[", "]", "...", "associatedData", ")", "{", "// Maximum permitted AD length is the block size in bits - 2", "if", "(", "associatedData", ".", "length", ...
Visible for testing, throws IllegalArgumentException if key is not accepted by CMac#init(CipherParameters)
[ "Visible", "for", "testing", "throws", "IllegalArgumentException", "if", "key", "is", "not", "accepted", "by", "CMac#init", "(", "CipherParameters", ")" ]
train
https://github.com/cryptomator/siv-mode/blob/aa21286cc5a840c42ec3bf6d4c945ab6acaad568/src/main/java/org/cryptomator/siv/SivMode.java#L224-L249
Stratio/stratio-cassandra
src/java/org/apache/cassandra/utils/BloomCalculations.java
BloomCalculations.computeBloomSpec
public static BloomSpecification computeBloomSpec(int maxBucketsPerElement, double maxFalsePosProb) { """ Given a maximum tolerable false positive probability, compute a Bloom specification which will give less than the specified false positive rate, but minimize the number of buckets per element and the number ...
java
public static BloomSpecification computeBloomSpec(int maxBucketsPerElement, double maxFalsePosProb) { assert maxBucketsPerElement >= 1; assert maxBucketsPerElement <= probs.length - 1; int maxK = probs[maxBucketsPerElement].length - 1; // Handle the trivial cases if(maxFalse...
[ "public", "static", "BloomSpecification", "computeBloomSpec", "(", "int", "maxBucketsPerElement", ",", "double", "maxFalsePosProb", ")", "{", "assert", "maxBucketsPerElement", ">=", "1", ";", "assert", "maxBucketsPerElement", "<=", "probs", ".", "length", "-", "1", ...
Given a maximum tolerable false positive probability, compute a Bloom specification which will give less than the specified false positive rate, but minimize the number of buckets per element and the number of hash functions used. Because bandwidth (and therefore total bitvector size) is considered more expensive than...
[ "Given", "a", "maximum", "tolerable", "false", "positive", "probability", "compute", "a", "Bloom", "specification", "which", "will", "give", "less", "than", "the", "specified", "false", "positive", "rate", "but", "minimize", "the", "number", "of", "buckets", "pe...
train
https://github.com/Stratio/stratio-cassandra/blob/f6416b43ad5309083349ad56266450fa8c6a2106/src/java/org/apache/cassandra/utils/BloomCalculations.java#L139-L168
before/uadetector
modules/uadetector-core/src/main/java/net/sf/uadetector/internal/data/XmlDataHandler.java
XmlDataHandler.logParsingIssue
protected static void logParsingIssue(final String prefix, final SAXParseException e) { """ Logs an issue while parsing XML. @param prefix log level as string to add at the beginning of the message @param e exception to log """ final StringBuilder buffer = new StringBuilder(); buffer.append(prefix); ...
java
protected static void logParsingIssue(final String prefix, final SAXParseException e) { final StringBuilder buffer = new StringBuilder(); buffer.append(prefix); buffer.append(" while reading UAS data: "); buffer.append(e.getMessage()); buffer.append(" (line: "); buffer.append(e.getLineNumber()); if (e.get...
[ "protected", "static", "void", "logParsingIssue", "(", "final", "String", "prefix", ",", "final", "SAXParseException", "e", ")", "{", "final", "StringBuilder", "buffer", "=", "new", "StringBuilder", "(", ")", ";", "buffer", ".", "append", "(", "prefix", ")", ...
Logs an issue while parsing XML. @param prefix log level as string to add at the beginning of the message @param e exception to log
[ "Logs", "an", "issue", "while", "parsing", "XML", "." ]
train
https://github.com/before/uadetector/blob/215fb652723c52866572cff885f52a3fe67b9db5/modules/uadetector-core/src/main/java/net/sf/uadetector/internal/data/XmlDataHandler.java#L292-L305
alexvictoor/netty-livereload
src/main/java/com/github/alexvictoor/livereload/FileSystemWatcher.java
FileSystemWatcher.registerFolder
private void registerFolder(final Path folder) throws IOException { """ Register the given directory, and all its sub-directories, with the WatchService. """ // register directory and sub-directories Files.walkFileTree(folder, new SimpleFileVisitor<Path>() { @Override p...
java
private void registerFolder(final Path folder) throws IOException { // register directory and sub-directories Files.walkFileTree(folder, new SimpleFileVisitor<Path>() { @Override public FileVisitResult preVisitDirectory(Path dir, BasicFileAttributes attrs) thr...
[ "private", "void", "registerFolder", "(", "final", "Path", "folder", ")", "throws", "IOException", "{", "// register directory and sub-directories", "Files", ".", "walkFileTree", "(", "folder", ",", "new", "SimpleFileVisitor", "<", "Path", ">", "(", ")", "{", "@",...
Register the given directory, and all its sub-directories, with the WatchService.
[ "Register", "the", "given", "directory", "and", "all", "its", "sub", "-", "directories", "with", "the", "WatchService", "." ]
train
https://github.com/alexvictoor/netty-livereload/blob/61597100ad76caf786d1960bf19f178121d96178/src/main/java/com/github/alexvictoor/livereload/FileSystemWatcher.java#L44-L57
moparisthebest/beehive
beehive-netui-tags/src/main/java/org/apache/beehive/netui/tags/ExpressionHandling.java
ExpressionHandling.ensureValidExpression
public String ensureValidExpression(String dataSource, String attrName, String errorId) throws JspException { """ Ensure that the passed in data source is a valid expression. @param dataSource @param attrName @param errorId @return String @throws javax.servlet.jsp.JspException """ try ...
java
public String ensureValidExpression(String dataSource, String attrName, String errorId) throws JspException { try { boolean isExpr = isExpression(dataSource); // @perf: if the isExpr call fails, this is an error condition, and the containsExpression // call c...
[ "public", "String", "ensureValidExpression", "(", "String", "dataSource", ",", "String", "attrName", ",", "String", "errorId", ")", "throws", "JspException", "{", "try", "{", "boolean", "isExpr", "=", "isExpression", "(", "dataSource", ")", ";", "// @perf: if the ...
Ensure that the passed in data source is a valid expression. @param dataSource @param attrName @param errorId @return String @throws javax.servlet.jsp.JspException
[ "Ensure", "that", "the", "passed", "in", "data", "source", "is", "a", "valid", "expression", "." ]
train
https://github.com/moparisthebest/beehive/blob/4246a0cc40ce3c05f1a02c2da2653ac622703d77/beehive-netui-tags/src/main/java/org/apache/beehive/netui/tags/ExpressionHandling.java#L63-L93