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 |
|---|---|---|---|---|---|---|---|---|---|---|
pgjdbc/pgjdbc | pgjdbc/src/main/java/org/postgresql/jdbc/EscapedFunctions2.java | EscapedFunctions2.sqlceiling | public static void sqlceiling(StringBuilder buf, List<? extends CharSequence> parsedArgs) throws SQLException {
"""
ceiling to ceil translation
@param buf The buffer to append into
@param parsedArgs arguments
@throws SQLException if something wrong happens
"""
singleArgumentFunctionCall(buf, "ceil(", ... | java | public static void sqlceiling(StringBuilder buf, List<? extends CharSequence> parsedArgs) throws SQLException {
singleArgumentFunctionCall(buf, "ceil(", "ceiling", parsedArgs);
} | [
"public",
"static",
"void",
"sqlceiling",
"(",
"StringBuilder",
"buf",
",",
"List",
"<",
"?",
"extends",
"CharSequence",
">",
"parsedArgs",
")",
"throws",
"SQLException",
"{",
"singleArgumentFunctionCall",
"(",
"buf",
",",
"\"ceil(\"",
",",
"\"ceiling\"",
",",
"... | ceiling to ceil translation
@param buf The buffer to append into
@param parsedArgs arguments
@throws SQLException if something wrong happens | [
"ceiling",
"to",
"ceil",
"translation"
] | train | https://github.com/pgjdbc/pgjdbc/blob/95ba7b261e39754674c5817695ae5ebf9a341fae/pgjdbc/src/main/java/org/postgresql/jdbc/EscapedFunctions2.java#L87-L89 |
elki-project/elki | elki-outlier/src/main/java/de/lmu/ifi/dbs/elki/algorithm/outlier/distance/SOS.java | SOS.sumOfProbabilities | public static double sumOfProbabilities(DBIDIter ignore, DBIDArrayIter di, double[] p) {
"""
Compute the sum of probabilities, stop at first 0, ignore query object.
Note: while SOS ensures the 'ignore' object is not added in the first
place, KNNSOS cannot do so efficiently (yet).
@param ignore Object to ign... | java | public static double sumOfProbabilities(DBIDIter ignore, DBIDArrayIter di, double[] p) {
double s = 0;
for(di.seek(0); di.valid(); di.advance()) {
if(DBIDUtil.equal(ignore, di)) {
continue;
}
final double v = p[di.getOffset()];
if(!(v > 0)) {
break;
}
s += v;
... | [
"public",
"static",
"double",
"sumOfProbabilities",
"(",
"DBIDIter",
"ignore",
",",
"DBIDArrayIter",
"di",
",",
"double",
"[",
"]",
"p",
")",
"{",
"double",
"s",
"=",
"0",
";",
"for",
"(",
"di",
".",
"seek",
"(",
"0",
")",
";",
"di",
".",
"valid",
... | Compute the sum of probabilities, stop at first 0, ignore query object.
Note: while SOS ensures the 'ignore' object is not added in the first
place, KNNSOS cannot do so efficiently (yet).
@param ignore Object to ignore.
@param di Object list
@param p Probabilities
@return Sum. | [
"Compute",
"the",
"sum",
"of",
"probabilities",
"stop",
"at",
"first",
"0",
"ignore",
"query",
"object",
"."
] | train | https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-outlier/src/main/java/de/lmu/ifi/dbs/elki/algorithm/outlier/distance/SOS.java#L164-L177 |
weld/core | environments/common/src/main/java/org/jboss/weld/environment/deployment/WeldDeployment.java | WeldDeployment.createAdditionalBeanDeploymentArchive | protected WeldBeanDeploymentArchive createAdditionalBeanDeploymentArchive() {
"""
Additional bean deployment archives are used for extentions, synthetic annotated types and beans which do not come from a bean archive.
@param beanClass
@return the additional bean deployment archive
"""
WeldBeanDeplo... | java | protected WeldBeanDeploymentArchive createAdditionalBeanDeploymentArchive() {
WeldBeanDeploymentArchive additionalBda = new WeldBeanDeploymentArchive(ADDITIONAL_BDA_ID, Collections.synchronizedSet(new HashSet<String>()), null);
additionalBda.getServices().addAll(getServices().entrySet());
beanDe... | [
"protected",
"WeldBeanDeploymentArchive",
"createAdditionalBeanDeploymentArchive",
"(",
")",
"{",
"WeldBeanDeploymentArchive",
"additionalBda",
"=",
"new",
"WeldBeanDeploymentArchive",
"(",
"ADDITIONAL_BDA_ID",
",",
"Collections",
".",
"synchronizedSet",
"(",
"new",
"HashSet",
... | Additional bean deployment archives are used for extentions, synthetic annotated types and beans which do not come from a bean archive.
@param beanClass
@return the additional bean deployment archive | [
"Additional",
"bean",
"deployment",
"archives",
"are",
"used",
"for",
"extentions",
"synthetic",
"annotated",
"types",
"and",
"beans",
"which",
"do",
"not",
"come",
"from",
"a",
"bean",
"archive",
"."
] | train | https://github.com/weld/core/blob/567a2eaf95b168597d23a56be89bf05a7834b2aa/environments/common/src/main/java/org/jboss/weld/environment/deployment/WeldDeployment.java#L104-L110 |
PinaeOS/nala | src/main/java/org/pinae/nala/xb/util/ResourceWriter.java | ResourceWriter.writeToFile | public void writeToFile(StringBuffer content, String filename) throws NoSuchPathException, IOException {
"""
将XML内容写入文件
@param content XML内容
@param filename 需要写入的文件
@throws NoSuchPathException 写入文件时, 无法发现路径引发的异常
@throws IOException 文件写入异常
"""
try {
FileWriter input = new FileWriter(filename);
... | java | public void writeToFile(StringBuffer content, String filename) throws NoSuchPathException, IOException{
try {
FileWriter input = new FileWriter(filename);
input.write(content.toString(), 0, content.length());
input.flush();
input.close();
} catch (FileNotFoundException e) {
throw new NoSuchPathExcept... | [
"public",
"void",
"writeToFile",
"(",
"StringBuffer",
"content",
",",
"String",
"filename",
")",
"throws",
"NoSuchPathException",
",",
"IOException",
"{",
"try",
"{",
"FileWriter",
"input",
"=",
"new",
"FileWriter",
"(",
"filename",
")",
";",
"input",
".",
"wr... | 将XML内容写入文件
@param content XML内容
@param filename 需要写入的文件
@throws NoSuchPathException 写入文件时, 无法发现路径引发的异常
@throws IOException 文件写入异常 | [
"将XML内容写入文件"
] | train | https://github.com/PinaeOS/nala/blob/2047ade4af197cec938278d300d111ea94af6fbf/src/main/java/org/pinae/nala/xb/util/ResourceWriter.java#L29-L38 |
UrielCh/ovh-java-sdk | ovh-java-sdk-domain/src/main/java/net/minidev/ovh/api/ApiOvhDomain.java | ApiOvhDomain.zone_zoneName_redirection_id_GET | public OvhRedirection zone_zoneName_redirection_id_GET(String zoneName, Long id) throws IOException {
"""
Get this object properties
REST: GET /domain/zone/{zoneName}/redirection/{id}
@param zoneName [required] The internal name of your zone
@param id [required] Id of the object
"""
String qPath = "/dom... | java | public OvhRedirection zone_zoneName_redirection_id_GET(String zoneName, Long id) throws IOException {
String qPath = "/domain/zone/{zoneName}/redirection/{id}";
StringBuilder sb = path(qPath, zoneName, id);
String resp = exec(qPath, "GET", sb.toString(), null);
return convertTo(resp, OvhRedirection.class);
} | [
"public",
"OvhRedirection",
"zone_zoneName_redirection_id_GET",
"(",
"String",
"zoneName",
",",
"Long",
"id",
")",
"throws",
"IOException",
"{",
"String",
"qPath",
"=",
"\"/domain/zone/{zoneName}/redirection/{id}\"",
";",
"StringBuilder",
"sb",
"=",
"path",
"(",
"qPath"... | Get this object properties
REST: GET /domain/zone/{zoneName}/redirection/{id}
@param zoneName [required] The internal name of your zone
@param id [required] Id of the object | [
"Get",
"this",
"object",
"properties"
] | train | https://github.com/UrielCh/ovh-java-sdk/blob/6d531a40e56e09701943e334c25f90f640c55701/ovh-java-sdk-domain/src/main/java/net/minidev/ovh/api/ApiOvhDomain.java#L847-L852 |
eclipse/xtext-lib | org.eclipse.xtext.xbase.lib/src/org/eclipse/xtext/xbase/lib/IterableExtensions.java | IterableExtensions.findFirst | public static <T> T findFirst(Iterable<T> iterable, Function1<? super T, Boolean> predicate) {
"""
Finds the first element in the given iterable that fulfills the predicate. If none is found or the iterable is
empty, <code>null</code> is returned.
@param iterable
the iterable. May not be <code>null</code>.
@... | java | public static <T> T findFirst(Iterable<T> iterable, Function1<? super T, Boolean> predicate) {
return IteratorExtensions.findFirst(iterable.iterator(), predicate);
} | [
"public",
"static",
"<",
"T",
">",
"T",
"findFirst",
"(",
"Iterable",
"<",
"T",
">",
"iterable",
",",
"Function1",
"<",
"?",
"super",
"T",
",",
"Boolean",
">",
"predicate",
")",
"{",
"return",
"IteratorExtensions",
".",
"findFirst",
"(",
"iterable",
".",... | Finds the first element in the given iterable that fulfills the predicate. If none is found or the iterable is
empty, <code>null</code> is returned.
@param iterable
the iterable. May not be <code>null</code>.
@param predicate
the predicate. May not be <code>null</code>.
@return the first element in the iterable for wh... | [
"Finds",
"the",
"first",
"element",
"in",
"the",
"given",
"iterable",
"that",
"fulfills",
"the",
"predicate",
".",
"If",
"none",
"is",
"found",
"or",
"the",
"iterable",
"is",
"empty",
"<code",
">",
"null<",
"/",
"code",
">",
"is",
"returned",
"."
] | train | https://github.com/eclipse/xtext-lib/blob/7063572e1f1bd713a3aa53bdf3a8dc60e25c169a/org.eclipse.xtext.xbase.lib/src/org/eclipse/xtext/xbase/lib/IterableExtensions.java#L79-L81 |
kaazing/gateway | mina.core/core/src/main/java/org/apache/mina/filter/executor/ExecutorFilter.java | ExecutorFilter.init | private void init(Executor executor, boolean manageableExecutor, IoEventType... eventTypes) {
"""
Creates a new instance of ExecutorFilter. This private constructor is called by all
the public constructor.
@param executor The underlying {@link Executor} in charge of managing the Thread pool.
@param manageable... | java | private void init(Executor executor, boolean manageableExecutor, IoEventType... eventTypes) {
if (executor == null) {
throw new NullPointerException("executor");
}
initEventTypes(eventTypes);
this.executor = executor;
this.manageableExecutor = manageableExecutor;
... | [
"private",
"void",
"init",
"(",
"Executor",
"executor",
",",
"boolean",
"manageableExecutor",
",",
"IoEventType",
"...",
"eventTypes",
")",
"{",
"if",
"(",
"executor",
"==",
"null",
")",
"{",
"throw",
"new",
"NullPointerException",
"(",
"\"executor\"",
")",
";... | Creates a new instance of ExecutorFilter. This private constructor is called by all
the public constructor.
@param executor The underlying {@link Executor} in charge of managing the Thread pool.
@param manageableExecutor Tells if the Executor's Life Cycle can be managed or not
@param eventTypes The lit of event which ... | [
"Creates",
"a",
"new",
"instance",
"of",
"ExecutorFilter",
".",
"This",
"private",
"constructor",
"is",
"called",
"by",
"all",
"the",
"public",
"constructor",
"."
] | train | https://github.com/kaazing/gateway/blob/06017b19273109b3b992e528e702586446168d57/mina.core/core/src/main/java/org/apache/mina/filter/executor/ExecutorFilter.java#L552-L560 |
svenkubiak/mangooio | mangooio-core/src/main/java/io/mangoo/routing/bindings/Validator.java | Validator.expectUrl | public void expectUrl(String name, String message) {
"""
Validates field to be a valid URL
@param name The field to check
@param message A custom error message instead of the default one
"""
String value = Optional.ofNullable(get(name)).orElse("");
if (!UrlValidator.getInstance().isValid(v... | java | public void expectUrl(String name, String message) {
String value = Optional.ofNullable(get(name)).orElse("");
if (!UrlValidator.getInstance().isValid(value)) {
addError(name, Optional.ofNullable(message).orElse(messages.get(Validation.URL_KEY.name(), name)));
}
} | [
"public",
"void",
"expectUrl",
"(",
"String",
"name",
",",
"String",
"message",
")",
"{",
"String",
"value",
"=",
"Optional",
".",
"ofNullable",
"(",
"get",
"(",
"name",
")",
")",
".",
"orElse",
"(",
"\"\"",
")",
";",
"if",
"(",
"!",
"UrlValidator",
... | Validates field to be a valid URL
@param name The field to check
@param message A custom error message instead of the default one | [
"Validates",
"field",
"to",
"be",
"a",
"valid",
"URL"
] | train | https://github.com/svenkubiak/mangooio/blob/b3beb6d09510dbbab0ed947d5069c463e1fda6e7/mangooio-core/src/main/java/io/mangoo/routing/bindings/Validator.java#L414-L420 |
ehcache/ehcache3 | impl/src/main/java/org/ehcache/config/builders/CacheConfigurationBuilder.java | CacheConfigurationBuilder.withValueSerializer | public CacheConfigurationBuilder<K, V> withValueSerializer(Serializer<V> valueSerializer) {
"""
Adds a {@link Serializer} for cache values to the configured builder.
<p>
{@link Serializer}s are what enables cache storage beyond the heap tier.
@param valueSerializer the key serializer to use
@return a new bui... | java | public CacheConfigurationBuilder<K, V> withValueSerializer(Serializer<V> valueSerializer) {
return withSerializer(new DefaultSerializerConfiguration<>(requireNonNull(valueSerializer, "Null value serializer"), DefaultSerializerConfiguration.Type.VALUE));
} | [
"public",
"CacheConfigurationBuilder",
"<",
"K",
",",
"V",
">",
"withValueSerializer",
"(",
"Serializer",
"<",
"V",
">",
"valueSerializer",
")",
"{",
"return",
"withSerializer",
"(",
"new",
"DefaultSerializerConfiguration",
"<>",
"(",
"requireNonNull",
"(",
"valueSe... | Adds a {@link Serializer} for cache values to the configured builder.
<p>
{@link Serializer}s are what enables cache storage beyond the heap tier.
@param valueSerializer the key serializer to use
@return a new builder with the added value serializer | [
"Adds",
"a",
"{",
"@link",
"Serializer",
"}",
"for",
"cache",
"values",
"to",
"the",
"configured",
"builder",
".",
"<p",
">",
"{",
"@link",
"Serializer",
"}",
"s",
"are",
"what",
"enables",
"cache",
"storage",
"beyond",
"the",
"heap",
"tier",
"."
] | train | https://github.com/ehcache/ehcache3/blob/3cceda57185e522f8d241ddb75146d67ee2af898/impl/src/main/java/org/ehcache/config/builders/CacheConfigurationBuilder.java#L480-L482 |
RestComm/media-core | ice/src/main/java/org/restcomm/media/core/ice/harvest/HostCandidateHarvester.java | HostCandidateHarvester.gatherCandidate | private boolean gatherCandidate(IceComponent component, InetAddress address, int startingPort, RtpPortManager portManager, Selector selector) {
"""
Gathers a candidate and registers it in the respective ICE Component. A
datagram channel will be bound to the local candidate address.
@param component
The compon... | java | private boolean gatherCandidate(IceComponent component, InetAddress address, int startingPort, RtpPortManager portManager, Selector selector) {
// Recursion stop criteria
if(startingPort == portManager.peek()) {
return false;
}
// Gather the candidate using current port
try {
int port = portManager.c... | [
"private",
"boolean",
"gatherCandidate",
"(",
"IceComponent",
"component",
",",
"InetAddress",
"address",
",",
"int",
"startingPort",
",",
"RtpPortManager",
"portManager",
",",
"Selector",
"selector",
")",
"{",
"// Recursion stop criteria",
"if",
"(",
"startingPort",
... | Gathers a candidate and registers it in the respective ICE Component. A
datagram channel will be bound to the local candidate address.
@param component
The component the candidate belongs to
@param address
The address of the candidate
@param startingPort
The preferred port for the candidate to use.<br>
The candidate p... | [
"Gathers",
"a",
"candidate",
"and",
"registers",
"it",
"in",
"the",
"respective",
"ICE",
"Component",
".",
"A",
"datagram",
"channel",
"will",
"be",
"bound",
"to",
"the",
"local",
"candidate",
"address",
"."
] | train | https://github.com/RestComm/media-core/blob/07b8703343708599f60af66bae62aded77ee81b5/ice/src/main/java/org/restcomm/media/core/ice/harvest/HostCandidateHarvester.java#L213-L232 |
aws/aws-sdk-java | aws-java-sdk-batch/src/main/java/com/amazonaws/services/batch/model/ArrayPropertiesDetail.java | ArrayPropertiesDetail.withStatusSummary | public ArrayPropertiesDetail withStatusSummary(java.util.Map<String, Integer> statusSummary) {
"""
<p>
A summary of the number of array job children in each available job status. This parameter is returned for parent
array jobs.
</p>
@param statusSummary
A summary of the number of array job children in each... | java | public ArrayPropertiesDetail withStatusSummary(java.util.Map<String, Integer> statusSummary) {
setStatusSummary(statusSummary);
return this;
} | [
"public",
"ArrayPropertiesDetail",
"withStatusSummary",
"(",
"java",
".",
"util",
".",
"Map",
"<",
"String",
",",
"Integer",
">",
"statusSummary",
")",
"{",
"setStatusSummary",
"(",
"statusSummary",
")",
";",
"return",
"this",
";",
"}"
] | <p>
A summary of the number of array job children in each available job status. This parameter is returned for parent
array jobs.
</p>
@param statusSummary
A summary of the number of array job children in each available job status. This parameter is returned for
parent array jobs.
@return Returns a reference to this o... | [
"<p",
">",
"A",
"summary",
"of",
"the",
"number",
"of",
"array",
"job",
"children",
"in",
"each",
"available",
"job",
"status",
".",
"This",
"parameter",
"is",
"returned",
"for",
"parent",
"array",
"jobs",
".",
"<",
"/",
"p",
">"
] | train | https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-batch/src/main/java/com/amazonaws/services/batch/model/ArrayPropertiesDetail.java#L93-L96 |
Red5/red5-server-common | src/main/java/org/red5/server/so/ClientSharedObject.java | ClientSharedObject.notifySendMessage | protected void notifySendMessage(String method, List<?> params) {
"""
Broadcast send event to listeners
@param method
Method name
@param params
Params
"""
for (ISharedObjectListener listener : listeners) {
listener.onSharedObjectSend(this, method, params);
}
} | java | protected void notifySendMessage(String method, List<?> params) {
for (ISharedObjectListener listener : listeners) {
listener.onSharedObjectSend(this, method, params);
}
} | [
"protected",
"void",
"notifySendMessage",
"(",
"String",
"method",
",",
"List",
"<",
"?",
">",
"params",
")",
"{",
"for",
"(",
"ISharedObjectListener",
"listener",
":",
"listeners",
")",
"{",
"listener",
".",
"onSharedObjectSend",
"(",
"this",
",",
"method",
... | Broadcast send event to listeners
@param method
Method name
@param params
Params | [
"Broadcast",
"send",
"event",
"to",
"listeners"
] | train | https://github.com/Red5/red5-server-common/blob/39ae73710c25bda86d70b13ef37ae707962217b9/src/main/java/org/red5/server/so/ClientSharedObject.java#L265-L269 |
lessthanoptimal/BoofCV | main/boofcv-io/src/main/java/boofcv/io/image/ConvertBufferedImage.java | ConvertBufferedImage.convertFrom | public static <T extends ImageBase<T>> T convertFrom(BufferedImage src , boolean orderRgb , ImageType<T> imageType) {
"""
Converts a buffered image into an image of the specified type.
@param src Input BufferedImage which is to be converted
@param orderRgb If applicable, should it adjust the ordering of each c... | java | public static <T extends ImageBase<T>> T convertFrom(BufferedImage src , boolean orderRgb , ImageType<T> imageType) {
T out = imageType.createImage(src.getWidth(),src.getHeight());
switch( imageType.getFamily() ) {
case GRAY:
convertFromSingle(src, (ImageGray)out, imageType.getImageClass());
break;
... | [
"public",
"static",
"<",
"T",
"extends",
"ImageBase",
"<",
"T",
">",
">",
"T",
"convertFrom",
"(",
"BufferedImage",
"src",
",",
"boolean",
"orderRgb",
",",
"ImageType",
"<",
"T",
">",
"imageType",
")",
"{",
"T",
"out",
"=",
"imageType",
".",
"createImage... | Converts a buffered image into an image of the specified type.
@param src Input BufferedImage which is to be converted
@param orderRgb If applicable, should it adjust the ordering of each color band to maintain color consistency
@param imageType Type of image it is to be converted into
@return The image | [
"Converts",
"a",
"buffered",
"image",
"into",
"an",
"image",
"of",
"the",
"specified",
"type",
"."
] | train | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-io/src/main/java/boofcv/io/image/ConvertBufferedImage.java#L291-L313 |
google/j2objc | jre_emul/android/platform/external/icu/android_icu4j/src/main/java/android/icu/lang/CharSequences.java | CharSequences.compare | @Deprecated
public static int compare(CharSequence a, CharSequence b) {
"""
Utility for comparing the contents of CharSequences
@deprecated This API is ICU internal only.
@hide draft / provisional / internal are hidden on Android
"""
int alength = a.length();
int blength = b.length();
... | java | @Deprecated
public static int compare(CharSequence a, CharSequence b) {
int alength = a.length();
int blength = b.length();
int min = alength <= blength ? alength : blength;
for (int i = 0; i < min; ++i) {
int diff = a.charAt(i) - b.charAt(i);
if (diff != 0) {... | [
"@",
"Deprecated",
"public",
"static",
"int",
"compare",
"(",
"CharSequence",
"a",
",",
"CharSequence",
"b",
")",
"{",
"int",
"alength",
"=",
"a",
".",
"length",
"(",
")",
";",
"int",
"blength",
"=",
"b",
".",
"length",
"(",
")",
";",
"int",
"min",
... | Utility for comparing the contents of CharSequences
@deprecated This API is ICU internal only.
@hide draft / provisional / internal are hidden on Android | [
"Utility",
"for",
"comparing",
"the",
"contents",
"of",
"CharSequences"
] | train | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/external/icu/android_icu4j/src/main/java/android/icu/lang/CharSequences.java#L219-L231 |
vtatai/srec | core/src/main/java/com/github/srec/command/base/BaseCommand.java | BaseCommand.coerceToString | protected static String coerceToString(Value value, ExecutionContext context) {
"""
Coerces a value to String. Throws a
{@link com.github.srec.command.exception.CommandExecutionException} if
value is not of the expected type.
@param value
The value
@param context
The context used to evaluate the text, requ... | java | protected static String coerceToString(Value value, ExecutionContext context) {
if (value == null)
return null;
if (!(value instanceof StringValue))
throw new CommandExecutionException("Value " + value + ", class "
+ value.getClass().getCanonicalName() + " is not a string");
String str = value.toString... | [
"protected",
"static",
"String",
"coerceToString",
"(",
"Value",
"value",
",",
"ExecutionContext",
"context",
")",
"{",
"if",
"(",
"value",
"==",
"null",
")",
"return",
"null",
";",
"if",
"(",
"!",
"(",
"value",
"instanceof",
"StringValue",
")",
")",
"thro... | Coerces a value to String. Throws a
{@link com.github.srec.command.exception.CommandExecutionException} if
value is not of the expected type.
@param value
The value
@param context
The context used to evaluate the text, required if there is
string interpolation
@return The converted value | [
"Coerces",
"a",
"value",
"to",
"String",
".",
"Throws",
"a",
"{",
"@link",
"com",
".",
"github",
".",
"srec",
".",
"command",
".",
"exception",
".",
"CommandExecutionException",
"}",
"if",
"value",
"is",
"not",
"of",
"the",
"expected",
"type",
"."
] | train | https://github.com/vtatai/srec/blob/87fa6754a6a5f8569ef628db4d149eea04062568/core/src/main/java/com/github/srec/command/base/BaseCommand.java#L56-L66 |
BlueBrain/bluima | modules/bluima_typesystem/src/main/java/de/julielab/jules/types/mmax/MMAXAnnotation.java | MMAXAnnotation.setAttributeList | public void setAttributeList(int i, MMAXAttribute v) {
"""
indexed setter for attributeList - sets an indexed value - List of attributes of the MMAX annotation.
@generated
@param i index in the array to set
@param v value to set into the array
"""
if (MMAXAnnotation_Type.featOkTst && ((MMAXAnnotation_T... | java | public void setAttributeList(int i, MMAXAttribute v) {
if (MMAXAnnotation_Type.featOkTst && ((MMAXAnnotation_Type)jcasType).casFeat_attributeList == null)
jcasType.jcas.throwFeatMissing("attributeList", "de.julielab.jules.types.mmax.MMAXAnnotation");
jcasType.jcas.checkArrayBounds(jcasType.ll_cas.ll_getR... | [
"public",
"void",
"setAttributeList",
"(",
"int",
"i",
",",
"MMAXAttribute",
"v",
")",
"{",
"if",
"(",
"MMAXAnnotation_Type",
".",
"featOkTst",
"&&",
"(",
"(",
"MMAXAnnotation_Type",
")",
"jcasType",
")",
".",
"casFeat_attributeList",
"==",
"null",
")",
"jcasT... | indexed setter for attributeList - sets an indexed value - List of attributes of the MMAX annotation.
@generated
@param i index in the array to set
@param v value to set into the array | [
"indexed",
"setter",
"for",
"attributeList",
"-",
"sets",
"an",
"indexed",
"value",
"-",
"List",
"of",
"attributes",
"of",
"the",
"MMAX",
"annotation",
"."
] | train | https://github.com/BlueBrain/bluima/blob/793ea3f46761dce72094e057a56cddfa677156ae/modules/bluima_typesystem/src/main/java/de/julielab/jules/types/mmax/MMAXAnnotation.java#L207-L211 |
facebookarchive/hive-dwrf | hive-dwrf/src/main/java/com/facebook/hive/orc/InStream.java | InStream.create | public static InStream create(String name, ByteBuffer input, CompressionCodec codec,
int bufferSize, boolean useVInts) throws IOException {
"""
This should only be used if the data happens to already be in memory, e.g. for tests
"""
if (codec == null) {
return new UncompressedStream(name, input... | java | public static InStream create(String name, ByteBuffer input, CompressionCodec codec,
int bufferSize, boolean useVInts) throws IOException {
if (codec == null) {
return new UncompressedStream(name, input, useVInts);
} else {
return new CompressedStream(name, input, codec, bufferSize, useVInts);... | [
"public",
"static",
"InStream",
"create",
"(",
"String",
"name",
",",
"ByteBuffer",
"input",
",",
"CompressionCodec",
"codec",
",",
"int",
"bufferSize",
",",
"boolean",
"useVInts",
")",
"throws",
"IOException",
"{",
"if",
"(",
"codec",
"==",
"null",
")",
"{"... | This should only be used if the data happens to already be in memory, e.g. for tests | [
"This",
"should",
"only",
"be",
"used",
"if",
"the",
"data",
"happens",
"to",
"already",
"be",
"in",
"memory",
"e",
".",
"g",
".",
"for",
"tests"
] | train | https://github.com/facebookarchive/hive-dwrf/blob/a7b4fcf28a57e006a2fc041d40cf7e5ad16e6b45/hive-dwrf/src/main/java/com/facebook/hive/orc/InStream.java#L489-L496 |
deeplearning4j/deeplearning4j | deeplearning4j/deeplearning4j-nlp-parent/deeplearning4j-nlp/src/main/java/org/deeplearning4j/models/word2vec/wordstore/inmemory/AbstractCache.java | AbstractCache.setCountForDoc | @Override
public void setCountForDoc(String word, long count) {
"""
Set exact number of observed documents that contain specified word
Please note: this method is NOT thread-safe
@param word the word to set the count for
@param count the count of the word
"""
T element = extendedVocabulary.g... | java | @Override
public void setCountForDoc(String word, long count) {
T element = extendedVocabulary.get(word);
if (element != null) {
element.setSequencesCount(count);
}
} | [
"@",
"Override",
"public",
"void",
"setCountForDoc",
"(",
"String",
"word",
",",
"long",
"count",
")",
"{",
"T",
"element",
"=",
"extendedVocabulary",
".",
"get",
"(",
"word",
")",
";",
"if",
"(",
"element",
"!=",
"null",
")",
"{",
"element",
".",
"set... | Set exact number of observed documents that contain specified word
Please note: this method is NOT thread-safe
@param word the word to set the count for
@param count the count of the word | [
"Set",
"exact",
"number",
"of",
"observed",
"documents",
"that",
"contain",
"specified",
"word"
] | train | https://github.com/deeplearning4j/deeplearning4j/blob/effce52f2afd7eeb53c5bcca699fcd90bd06822f/deeplearning4j/deeplearning4j-nlp-parent/deeplearning4j-nlp/src/main/java/org/deeplearning4j/models/word2vec/wordstore/inmemory/AbstractCache.java#L350-L356 |
jingwei/krati | krati-main/src/main/java/krati/core/StoreConfig.java | StoreConfig.setProperty | public boolean setProperty(String pName, String pValue) {
"""
Sets a store configuration property via its name and value.
@param pName - the property name
@param pValue - the property value
@return <code>true</code> if the property is set successfully.
"""
if(pName == null) return false;
... | java | public boolean setProperty(String pName, String pValue) {
if(pName == null) return false;
_properties.setProperty(pName, pValue);
return true;
} | [
"public",
"boolean",
"setProperty",
"(",
"String",
"pName",
",",
"String",
"pValue",
")",
"{",
"if",
"(",
"pName",
"==",
"null",
")",
"return",
"false",
";",
"_properties",
".",
"setProperty",
"(",
"pName",
",",
"pValue",
")",
";",
"return",
"true",
";",... | Sets a store configuration property via its name and value.
@param pName - the property name
@param pValue - the property value
@return <code>true</code> if the property is set successfully. | [
"Sets",
"a",
"store",
"configuration",
"property",
"via",
"its",
"name",
"and",
"value",
"."
] | train | https://github.com/jingwei/krati/blob/1ca0f994a7b0c8215b827eac9aaf95789ec08d21/krati-main/src/main/java/krati/core/StoreConfig.java#L365-L369 |
looly/hutool | hutool-http/src/main/java/cn/hutool/http/HtmlUtil.java | HtmlUtil.removeHtmlTag | public static String removeHtmlTag(String content, boolean withTagContent, String... tagNames) {
"""
清除指定HTML标签<br>
不区分大小写
@param content 文本
@param withTagContent 是否去掉被包含在标签中的内容
@param tagNames 要清除的标签
@return 去除标签后的文本
"""
String regex = null;
for (String tagName : tagNames) {
if (StrUtil.isBla... | java | public static String removeHtmlTag(String content, boolean withTagContent, String... tagNames) {
String regex = null;
for (String tagName : tagNames) {
if (StrUtil.isBlank(tagName)) {
continue;
}
tagName = tagName.trim();
// (?i)表示其后面的表达式忽略大小写
if (withTagContent) {
// 标签及其包含内容
r... | [
"public",
"static",
"String",
"removeHtmlTag",
"(",
"String",
"content",
",",
"boolean",
"withTagContent",
",",
"String",
"...",
"tagNames",
")",
"{",
"String",
"regex",
"=",
"null",
";",
"for",
"(",
"String",
"tagName",
":",
"tagNames",
")",
"{",
"if",
"(... | 清除指定HTML标签<br>
不区分大小写
@param content 文本
@param withTagContent 是否去掉被包含在标签中的内容
@param tagNames 要清除的标签
@return 去除标签后的文本 | [
"清除指定HTML标签<br",
">",
"不区分大小写"
] | train | https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-http/src/main/java/cn/hutool/http/HtmlUtil.java#L122-L141 |
WinRoad-NET/htmldoclet4jdk8 | src/main/java/net/winroad/htmldoclet4jdk8/HtmlDoclet.java | HtmlDoclet.generateWRAPIDetailFiles | protected void generateWRAPIDetailFiles(RootDoc root, WRDoc wrDoc) {
"""
Generate the tag documentation.
@param root
the RootDoc of source to document.
@param wrDoc
the data structure representing the doc to generate.
"""
List<String> tagList = new ArrayList<String>(wrDoc.getWRTags());
for (String ta... | java | protected void generateWRAPIDetailFiles(RootDoc root, WRDoc wrDoc) {
List<String> tagList = new ArrayList<String>(wrDoc.getWRTags());
for (String tag : tagList) {
List<OpenAPI> openAPIList = wrDoc.getTaggedOpenAPIs().get(tag);
Set<String> filesGenerated = new HashSet<String>();
for (OpenAPI openAPI : openA... | [
"protected",
"void",
"generateWRAPIDetailFiles",
"(",
"RootDoc",
"root",
",",
"WRDoc",
"wrDoc",
")",
"{",
"List",
"<",
"String",
">",
"tagList",
"=",
"new",
"ArrayList",
"<",
"String",
">",
"(",
"wrDoc",
".",
"getWRTags",
"(",
")",
")",
";",
"for",
"(",
... | Generate the tag documentation.
@param root
the RootDoc of source to document.
@param wrDoc
the data structure representing the doc to generate. | [
"Generate",
"the",
"tag",
"documentation",
"."
] | train | https://github.com/WinRoad-NET/htmldoclet4jdk8/blob/1e0aa93c12e0228fb0f7a1b4f8e89d9a17cbe5c7/src/main/java/net/winroad/htmldoclet4jdk8/HtmlDoclet.java#L234-L282 |
spotbugs/spotbugs | spotbugs/src/main/java/edu/umd/cs/findbugs/xml/Dom4JXMLOutput.java | Dom4JXMLOutput.writeElementList | public void writeElementList(String tagName, Collection<String> listValues) {
"""
Add a list of Strings to document as elements with given tag name to the
tree.
@param tagName
the tag name
@param listValues
Collection of String values to add
"""
for (String listValue : listValues) {
... | java | public void writeElementList(String tagName, Collection<String> listValues) {
for (String listValue : listValues) {
openTag(tagName);
writeText(listValue);
closeTag(tagName);
}
} | [
"public",
"void",
"writeElementList",
"(",
"String",
"tagName",
",",
"Collection",
"<",
"String",
">",
"listValues",
")",
"{",
"for",
"(",
"String",
"listValue",
":",
"listValues",
")",
"{",
"openTag",
"(",
"tagName",
")",
";",
"writeText",
"(",
"listValue",... | Add a list of Strings to document as elements with given tag name to the
tree.
@param tagName
the tag name
@param listValues
Collection of String values to add | [
"Add",
"a",
"list",
"of",
"Strings",
"to",
"document",
"as",
"elements",
"with",
"given",
"tag",
"name",
"to",
"the",
"tree",
"."
] | train | https://github.com/spotbugs/spotbugs/blob/f6365c6eea6515035bded38efa4a7c8b46ccf28c/spotbugs/src/main/java/edu/umd/cs/findbugs/xml/Dom4JXMLOutput.java#L131-L137 |
pawelprazak/java-extended | guava/src/main/java/com/bluecatcode/common/contract/Checks.java | Checks.checkUri | public static String checkUri(String uri,
@Nullable String errorMessageTemplate,
@Nullable Object... errorMessageArgs) {
"""
Performs URI check against RFC 2396 specification
@param uri the URI to check
@return the checked uri
@throws Illegal... | java | public static String checkUri(String uri,
@Nullable String errorMessageTemplate,
@Nullable Object... errorMessageArgs) {
checkArgument(uri != null, "Expected non-null uri");
checkArgument(uri.length() > 0 && uri.length() < 2000,
... | [
"public",
"static",
"String",
"checkUri",
"(",
"String",
"uri",
",",
"@",
"Nullable",
"String",
"errorMessageTemplate",
",",
"@",
"Nullable",
"Object",
"...",
"errorMessageArgs",
")",
"{",
"checkArgument",
"(",
"uri",
"!=",
"null",
",",
"\"Expected non-null uri\""... | Performs URI check against RFC 2396 specification
@param uri the URI to check
@return the checked uri
@throws IllegalArgumentException if the {@code uri} is invalid
@throws NullPointerException if the {@code uri} is null
@see java.net.URI | [
"Performs",
"URI",
"check",
"against",
"RFC",
"2396",
"specification"
] | train | https://github.com/pawelprazak/java-extended/blob/ce1a556a95cbbf7c950a03662938bc02622de69b/guava/src/main/java/com/bluecatcode/common/contract/Checks.java#L430-L437 |
Whiley/WhileyCompiler | src/main/java/wyil/transform/VerificationConditionGenerator.java | VerificationConditionGenerator.or | private WyalFile.Stmt or(WyalFile.Stmt lhs, WyalFile.Stmt rhs) {
"""
Construct a disjunct of two expressions
@param lhs
@param rhs
@return
"""
if (lhs == null) {
return rhs;
} else if (rhs == null) {
return rhs;
} else {
WyalFile.Stmt.Block lhsBlock = new WyalFile.Stmt.Block(lhs);
WyalFi... | java | private WyalFile.Stmt or(WyalFile.Stmt lhs, WyalFile.Stmt rhs) {
if (lhs == null) {
return rhs;
} else if (rhs == null) {
return rhs;
} else {
WyalFile.Stmt.Block lhsBlock = new WyalFile.Stmt.Block(lhs);
WyalFile.Stmt.Block rhsBlock = new WyalFile.Stmt.Block(rhs);
return new WyalFile.Stmt.CaseOf(lh... | [
"private",
"WyalFile",
".",
"Stmt",
"or",
"(",
"WyalFile",
".",
"Stmt",
"lhs",
",",
"WyalFile",
".",
"Stmt",
"rhs",
")",
"{",
"if",
"(",
"lhs",
"==",
"null",
")",
"{",
"return",
"rhs",
";",
"}",
"else",
"if",
"(",
"rhs",
"==",
"null",
")",
"{",
... | Construct a disjunct of two expressions
@param lhs
@param rhs
@return | [
"Construct",
"a",
"disjunct",
"of",
"two",
"expressions"
] | train | https://github.com/Whiley/WhileyCompiler/blob/680f8a657d3fc286f8cc422755988b6d74ab3f4c/src/main/java/wyil/transform/VerificationConditionGenerator.java#L1765-L1775 |
m-m-m/util | validation/src/main/java/net/sf/mmm/util/validation/base/collection/AbstractMapValidatorBuilder.java | AbstractMapValidatorBuilder.withKeys | public <SUB extends ObjectValidatorBuilder<K, ? extends SELF, ?>> SUB withKeys(BiFunction<ObjectValidatorBuilderFactory<SELF>, K, SUB> factory) {
"""
Creates a new {@link ObjectValidatorBuilder builder} for the {@link AbstractValidator validators} to invoke for
each {@link Map#keySet() key} in the {@link Map}.<br... | java | public <SUB extends ObjectValidatorBuilder<K, ? extends SELF, ?>> SUB withKeys(BiFunction<ObjectValidatorBuilderFactory<SELF>, K, SUB> factory) {
if (this.keySubBuilder != null) {
throw new IllegalStateException("keySubBuilder already exists!");
}
SUB sub = factory.apply(getSubFactory(), null);
t... | [
"public",
"<",
"SUB",
"extends",
"ObjectValidatorBuilder",
"<",
"K",
",",
"?",
"extends",
"SELF",
",",
"?",
">",
">",
"SUB",
"withKeys",
"(",
"BiFunction",
"<",
"ObjectValidatorBuilderFactory",
"<",
"SELF",
">",
",",
"K",
",",
"SUB",
">",
"factory",
")",
... | Creates a new {@link ObjectValidatorBuilder builder} for the {@link AbstractValidator validators} to invoke for
each {@link Map#keySet() key} in the {@link Map}.<br/>
Use {@link #and()} to return to this builder after the sub-builder is complete.<br/>
A typical usage looks like this:
<pre>
[...].withKeys((f, v) -> f.c... | [
"Creates",
"a",
"new",
"{",
"@link",
"ObjectValidatorBuilder",
"builder",
"}",
"for",
"the",
"{",
"@link",
"AbstractValidator",
"validators",
"}",
"to",
"invoke",
"for",
"each",
"{",
"@link",
"Map#keySet",
"()",
"key",
"}",
"in",
"the",
"{",
"@link",
"Map",
... | train | https://github.com/m-m-m/util/blob/f0e4e084448f8dfc83ca682a9e1618034a094ce6/validation/src/main/java/net/sf/mmm/util/validation/base/collection/AbstractMapValidatorBuilder.java#L91-L99 |
google/error-prone-javac | src/jdk.compiler/share/classes/com/sun/tools/javac/parser/JavaTokenizer.java | JavaTokenizer.processWhiteSpace | protected void processWhiteSpace(int pos, int endPos) {
"""
Called when a complete whitespace run has been scanned. pos and endPos
will mark the whitespace boundary.
"""
if (scannerDebug)
System.out.println("processWhitespace(" + pos
+ "," + endPos + ")=|" +
... | java | protected void processWhiteSpace(int pos, int endPos) {
if (scannerDebug)
System.out.println("processWhitespace(" + pos
+ "," + endPos + ")=|" +
new String(reader.getRawCharacters(pos, endPos))
+ "|");
} | [
"protected",
"void",
"processWhiteSpace",
"(",
"int",
"pos",
",",
"int",
"endPos",
")",
"{",
"if",
"(",
"scannerDebug",
")",
"System",
".",
"out",
".",
"println",
"(",
"\"processWhitespace(\"",
"+",
"pos",
"+",
"\",\"",
"+",
"endPos",
"+",
"\")=|\"",
"+",
... | Called when a complete whitespace run has been scanned. pos and endPos
will mark the whitespace boundary. | [
"Called",
"when",
"a",
"complete",
"whitespace",
"run",
"has",
"been",
"scanned",
".",
"pos",
"and",
"endPos",
"will",
"mark",
"the",
"whitespace",
"boundary",
"."
] | train | https://github.com/google/error-prone-javac/blob/a53d069bbdb2c60232ed3811c19b65e41c3e60e0/src/jdk.compiler/share/classes/com/sun/tools/javac/parser/JavaTokenizer.java#L741-L747 |
rhuss/jolokia | agent/jvm/src/main/java/org/jolokia/jvmagent/JvmAgent.java | JvmAgent.awaitServerInitialization | private static void awaitServerInitialization(JvmAgentConfig pConfig, final Instrumentation instrumentation) {
"""
Lookup the server detectors and notify detector about the JVM startup
@param instrumentation
@see ServerDetector#jvmAgentStartup(Instrumentation)
"""
List<ServerDetector> detectors = M... | java | private static void awaitServerInitialization(JvmAgentConfig pConfig, final Instrumentation instrumentation) {
List<ServerDetector> detectors = MBeanServerHandler.lookupDetectors();
for (ServerDetector detector : detectors) {
detector.jvmAgentStartup(instrumentation);
}
} | [
"private",
"static",
"void",
"awaitServerInitialization",
"(",
"JvmAgentConfig",
"pConfig",
",",
"final",
"Instrumentation",
"instrumentation",
")",
"{",
"List",
"<",
"ServerDetector",
">",
"detectors",
"=",
"MBeanServerHandler",
".",
"lookupDetectors",
"(",
")",
";",... | Lookup the server detectors and notify detector about the JVM startup
@param instrumentation
@see ServerDetector#jvmAgentStartup(Instrumentation) | [
"Lookup",
"the",
"server",
"detectors",
"and",
"notify",
"detector",
"about",
"the",
"JVM",
"startup"
] | train | https://github.com/rhuss/jolokia/blob/dc95e7bef859b1829776c5a84c8f7738f5d7d9c3/agent/jvm/src/main/java/org/jolokia/jvmagent/JvmAgent.java#L121-L126 |
kaazing/java.client | ws/ws/src/main/java/org/kaazing/gateway/client/util/WrappedByteBuffer.java | WrappedByteBuffer.putIntAt | public WrappedByteBuffer putIntAt(int index, int v) {
"""
Puts a four-byte int into the buffer at the specified index.
@param index the index
@param v the four-byte int
@return the buffer
"""
_checkForWriteAt(index, 4);
_buf.putInt(index, v);
return this;
} | java | public WrappedByteBuffer putIntAt(int index, int v) {
_checkForWriteAt(index, 4);
_buf.putInt(index, v);
return this;
} | [
"public",
"WrappedByteBuffer",
"putIntAt",
"(",
"int",
"index",
",",
"int",
"v",
")",
"{",
"_checkForWriteAt",
"(",
"index",
",",
"4",
")",
";",
"_buf",
".",
"putInt",
"(",
"index",
",",
"v",
")",
";",
"return",
"this",
";",
"}"
] | Puts a four-byte int into the buffer at the specified index.
@param index the index
@param v the four-byte int
@return the buffer | [
"Puts",
"a",
"four",
"-",
"byte",
"int",
"into",
"the",
"buffer",
"at",
"the",
"specified",
"index",
"."
] | train | https://github.com/kaazing/java.client/blob/25ad2ae5bb24aa9d6b79400fce649b518dcfbe26/ws/ws/src/main/java/org/kaazing/gateway/client/util/WrappedByteBuffer.java#L493-L497 |
orbisgis/h2gis | h2gis-functions/src/main/java/org/h2gis/functions/spatial/create/ST_MakeEnvelope.java | ST_MakeEnvelope.makeEnvelope | public static Polygon makeEnvelope(double xmin, double ymin, double xmax, double ymax) {
"""
Creates a rectangular Polygon formed from the minima and maxima by the
given shell.
@param xmin X min
@param ymin Y min
@param xmax X max
@param ymax Y max
@return Envelope as a POLYGON
"""
Coordinate[]... | java | public static Polygon makeEnvelope(double xmin, double ymin, double xmax, double ymax) {
Coordinate[] coordinates = new Coordinate[]{
new Coordinate(xmin, ymin),
new Coordinate(xmax, ymin),
new Coordinate(xmax, ymax),
new Coordinate(xmin, ymax),
new Co... | [
"public",
"static",
"Polygon",
"makeEnvelope",
"(",
"double",
"xmin",
",",
"double",
"ymin",
",",
"double",
"xmax",
",",
"double",
"ymax",
")",
"{",
"Coordinate",
"[",
"]",
"coordinates",
"=",
"new",
"Coordinate",
"[",
"]",
"{",
"new",
"Coordinate",
"(",
... | Creates a rectangular Polygon formed from the minima and maxima by the
given shell.
@param xmin X min
@param ymin Y min
@param xmax X max
@param ymax Y max
@return Envelope as a POLYGON | [
"Creates",
"a",
"rectangular",
"Polygon",
"formed",
"from",
"the",
"minima",
"and",
"maxima",
"by",
"the",
"given",
"shell",
"."
] | train | https://github.com/orbisgis/h2gis/blob/9cd70b447e6469cecbc2fc64b16774b59491df3b/h2gis-functions/src/main/java/org/h2gis/functions/spatial/create/ST_MakeEnvelope.java#L59-L68 |
apache/flink | flink-core/src/main/java/org/apache/flink/api/common/typeinfo/Types.java | Types.ROW_NAMED | public static TypeInformation<Row> ROW_NAMED(String[] fieldNames, TypeInformation<?>... types) {
"""
Returns type information for {@link org.apache.flink.types.Row} with fields of the given types and
with given names. A row must not be null.
<p>A row is a fixed-length, null-aware composite type for storing mul... | java | public static TypeInformation<Row> ROW_NAMED(String[] fieldNames, TypeInformation<?>... types) {
return new RowTypeInfo(types, fieldNames);
} | [
"public",
"static",
"TypeInformation",
"<",
"Row",
">",
"ROW_NAMED",
"(",
"String",
"[",
"]",
"fieldNames",
",",
"TypeInformation",
"<",
"?",
">",
"...",
"types",
")",
"{",
"return",
"new",
"RowTypeInfo",
"(",
"types",
",",
"fieldNames",
")",
";",
"}"
] | Returns type information for {@link org.apache.flink.types.Row} with fields of the given types and
with given names. A row must not be null.
<p>A row is a fixed-length, null-aware composite type for storing multiple values in a
deterministic field order. Every field can be null independent of the field's type.
The typ... | [
"Returns",
"type",
"information",
"for",
"{",
"@link",
"org",
".",
"apache",
".",
"flink",
".",
"types",
".",
"Row",
"}",
"with",
"fields",
"of",
"the",
"given",
"types",
"and",
"with",
"given",
"names",
".",
"A",
"row",
"must",
"not",
"be",
"null",
... | train | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-core/src/main/java/org/apache/flink/api/common/typeinfo/Types.java#L200-L202 |
wildfly/wildfly-core | cli/src/main/java/org/jboss/as/cli/parsing/StateParser.java | StateParser.parseLine | public static SubstitutedLine parseLine(String str, ParsingStateCallbackHandler callbackHandler, ParsingState initialState, boolean strict) throws CommandFormatException {
"""
Returns the string which was actually parsed with all the substitutions
performed. NB: No CommandCOntext being provided, variables can't b... | java | public static SubstitutedLine parseLine(String str, ParsingStateCallbackHandler callbackHandler, ParsingState initialState, boolean strict) throws CommandFormatException {
return parseLine(str, callbackHandler, initialState, strict, null);
} | [
"public",
"static",
"SubstitutedLine",
"parseLine",
"(",
"String",
"str",
",",
"ParsingStateCallbackHandler",
"callbackHandler",
",",
"ParsingState",
"initialState",
",",
"boolean",
"strict",
")",
"throws",
"CommandFormatException",
"{",
"return",
"parseLine",
"(",
"str... | Returns the string which was actually parsed with all the substitutions
performed. NB: No CommandCOntext being provided, variables can't be
resolved. variables should be already resolved when calling this parse
method. | [
"Returns",
"the",
"string",
"which",
"was",
"actually",
"parsed",
"with",
"all",
"the",
"substitutions",
"performed",
".",
"NB",
":",
"No",
"CommandCOntext",
"being",
"provided",
"variables",
"can",
"t",
"be",
"resolved",
".",
"variables",
"should",
"be",
"alr... | train | https://github.com/wildfly/wildfly-core/blob/cfaf0479dcbb2d320a44c5374b93b944ec39fade/cli/src/main/java/org/jboss/as/cli/parsing/StateParser.java#L94-L96 |
shrinkwrap/shrinkwrap | impl-base/src/main/java/org/jboss/shrinkwrap/impl/base/io/tar/TarArchive.java | TarArchive.setUserInfo | public void setUserInfo(int userId, String userName, int groupId, String groupName) {
"""
Set user and group information that will be used to fill in the tar archive's entry headers. Since Java currently
provides no means of determining a user name, user id, group name, or group id for a given File, TarArchive
a... | java | public void setUserInfo(int userId, String userName, int groupId, String groupName) {
this.userId = userId;
this.userName = userName;
this.groupId = groupId;
this.groupName = groupName;
} | [
"public",
"void",
"setUserInfo",
"(",
"int",
"userId",
",",
"String",
"userName",
",",
"int",
"groupId",
",",
"String",
"groupName",
")",
"{",
"this",
".",
"userId",
"=",
"userId",
";",
"this",
".",
"userName",
"=",
"userName",
";",
"this",
".",
"groupId... | Set user and group information that will be used to fill in the tar archive's entry headers. Since Java currently
provides no means of determining a user name, user id, group name, or group id for a given File, TarArchive
allows the programmer to specify values to be used in their place.
@param userId
The user Id to u... | [
"Set",
"user",
"and",
"group",
"information",
"that",
"will",
"be",
"used",
"to",
"fill",
"in",
"the",
"tar",
"archive",
"s",
"entry",
"headers",
".",
"Since",
"Java",
"currently",
"provides",
"no",
"means",
"of",
"determining",
"a",
"user",
"name",
"user"... | train | https://github.com/shrinkwrap/shrinkwrap/blob/3f8a1a6d344651428c709a63ebb52d35343c5387/impl-base/src/main/java/org/jboss/shrinkwrap/impl/base/io/tar/TarArchive.java#L239-L244 |
google/j2objc | xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/serializer/ToStream.java | ToStream.writeUTF16Surrogate | protected int writeUTF16Surrogate(char c, char ch[], int i, int end)
throws IOException {
"""
Once a surrogate has been detected, write out the pair of
characters if it is in the encoding, or if there is no
encoding, otherwise write out an entity reference
of the value of the unicode code point of the c... | java | protected int writeUTF16Surrogate(char c, char ch[], int i, int end)
throws IOException
{
int codePoint = 0;
if (i + 1 >= end)
{
throw new IOException(
Utils.messages.createMessage(
MsgKey.ER_INVALID_UTF16_SURROGATE,
... | [
"protected",
"int",
"writeUTF16Surrogate",
"(",
"char",
"c",
",",
"char",
"ch",
"[",
"]",
",",
"int",
"i",
",",
"int",
"end",
")",
"throws",
"IOException",
"{",
"int",
"codePoint",
"=",
"0",
";",
"if",
"(",
"i",
"+",
"1",
">=",
"end",
")",
"{",
"... | Once a surrogate has been detected, write out the pair of
characters if it is in the encoding, or if there is no
encoding, otherwise write out an entity reference
of the value of the unicode code point of the character
represented by the high/low surrogate pair.
<p>
An exception is thrown if there is no low surrogate i... | [
"Once",
"a",
"surrogate",
"has",
"been",
"detected",
"write",
"out",
"the",
"pair",
"of",
"characters",
"if",
"it",
"is",
"in",
"the",
"encoding",
"or",
"if",
"there",
"is",
"no",
"encoding",
"otherwise",
"write",
"out",
"an",
"entity",
"reference",
"of",
... | train | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/serializer/ToStream.java#L983-L1039 |
samskivert/pythagoras | src/main/java/pythagoras/d/Arc.java | Arc.setArc | public void setArc (IRectangle rect, double start, double extent, int type) {
"""
Sets the location, size, angular extents, and closure type of this arc to the specified
values.
"""
setArc(rect.x(), rect.y(), rect.width(), rect.height(), start, extent, type);
} | java | public void setArc (IRectangle rect, double start, double extent, int type) {
setArc(rect.x(), rect.y(), rect.width(), rect.height(), start, extent, type);
} | [
"public",
"void",
"setArc",
"(",
"IRectangle",
"rect",
",",
"double",
"start",
",",
"double",
"extent",
",",
"int",
"type",
")",
"{",
"setArc",
"(",
"rect",
".",
"x",
"(",
")",
",",
"rect",
".",
"y",
"(",
")",
",",
"rect",
".",
"width",
"(",
")",... | Sets the location, size, angular extents, and closure type of this arc to the specified
values. | [
"Sets",
"the",
"location",
"size",
"angular",
"extents",
"and",
"closure",
"type",
"of",
"this",
"arc",
"to",
"the",
"specified",
"values",
"."
] | train | https://github.com/samskivert/pythagoras/blob/b8fea743ee8a7d742ad9c06ee4f11f50571fbd32/src/main/java/pythagoras/d/Arc.java#L151-L153 |
UrielCh/ovh-java-sdk | ovh-java-sdk-order/src/main/java/net/minidev/ovh/api/ApiOvhOrder.java | ApiOvhOrder.hosting_web_serviceName_bandwidth_duration_GET | public OvhOrder hosting_web_serviceName_bandwidth_duration_GET(String serviceName, String duration, OvhBandwidthOfferEnum traffic) throws IOException {
"""
Get prices and contracts information
REST: GET /order/hosting/web/{serviceName}/bandwidth/{duration}
@param traffic [required] Available offers to increase... | java | public OvhOrder hosting_web_serviceName_bandwidth_duration_GET(String serviceName, String duration, OvhBandwidthOfferEnum traffic) throws IOException {
String qPath = "/order/hosting/web/{serviceName}/bandwidth/{duration}";
StringBuilder sb = path(qPath, serviceName, duration);
query(sb, "traffic", traffic);
St... | [
"public",
"OvhOrder",
"hosting_web_serviceName_bandwidth_duration_GET",
"(",
"String",
"serviceName",
",",
"String",
"duration",
",",
"OvhBandwidthOfferEnum",
"traffic",
")",
"throws",
"IOException",
"{",
"String",
"qPath",
"=",
"\"/order/hosting/web/{serviceName}/bandwidth/{du... | Get prices and contracts information
REST: GET /order/hosting/web/{serviceName}/bandwidth/{duration}
@param traffic [required] Available offers to increase bandwidth quota (unit: GB)
@param serviceName [required] The internal name of your hosting
@param duration [required] Duration | [
"Get",
"prices",
"and",
"contracts",
"information"
] | train | https://github.com/UrielCh/ovh-java-sdk/blob/6d531a40e56e09701943e334c25f90f640c55701/ovh-java-sdk-order/src/main/java/net/minidev/ovh/api/ApiOvhOrder.java#L4800-L4806 |
mangstadt/biweekly | src/main/java/biweekly/component/ICalComponent.java | ICalComponent.removeProperties | public <T extends ICalProperty> List<T> removeProperties(Class<T> clazz) {
"""
Removes all properties of a given class from this component.
@param clazz the class of the properties to remove (e.g.
"DateStart.class")
@param <T> the property class
@return the removed properties (this list is immutable)
"""
... | java | public <T extends ICalProperty> List<T> removeProperties(Class<T> clazz) {
List<ICalProperty> removed = properties.removeAll(clazz);
return castList(removed, clazz);
} | [
"public",
"<",
"T",
"extends",
"ICalProperty",
">",
"List",
"<",
"T",
">",
"removeProperties",
"(",
"Class",
"<",
"T",
">",
"clazz",
")",
"{",
"List",
"<",
"ICalProperty",
">",
"removed",
"=",
"properties",
".",
"removeAll",
"(",
"clazz",
")",
";",
"re... | Removes all properties of a given class from this component.
@param clazz the class of the properties to remove (e.g.
"DateStart.class")
@param <T> the property class
@return the removed properties (this list is immutable) | [
"Removes",
"all",
"properties",
"of",
"a",
"given",
"class",
"from",
"this",
"component",
"."
] | train | https://github.com/mangstadt/biweekly/blob/2e21350f85c13dfff52fdef98fdbebe2976fcf61/src/main/java/biweekly/component/ICalComponent.java#L154-L157 |
finmath/finmath-lib | src/main/java6/net/finmath/montecarlo/AbstractMonteCarloProduct.java | AbstractMonteCarloProduct.getValuesForModifiedData | public Map<String, Object> getValuesForModifiedData(MonteCarloSimulationInterface model, Map<String,Object> dataModified) throws CalculationException {
"""
This method returns the value under shifted market data (or model parameters).
In its default implementation it does bump (creating a new model) and revalue.
... | java | public Map<String, Object> getValuesForModifiedData(MonteCarloSimulationInterface model, Map<String,Object> dataModified) throws CalculationException
{
return getValuesForModifiedData(0.0, model, dataModified);
} | [
"public",
"Map",
"<",
"String",
",",
"Object",
">",
"getValuesForModifiedData",
"(",
"MonteCarloSimulationInterface",
"model",
",",
"Map",
"<",
"String",
",",
"Object",
">",
"dataModified",
")",
"throws",
"CalculationException",
"{",
"return",
"getValuesForModifiedDat... | This method returns the value under shifted market data (or model parameters).
In its default implementation it does bump (creating a new model) and revalue.
Override the way the new model is created, to implemented improved techniques (proxy scheme, re-calibration).
@param model The model used to price the product, e... | [
"This",
"method",
"returns",
"the",
"value",
"under",
"shifted",
"market",
"data",
"(",
"or",
"model",
"parameters",
")",
".",
"In",
"its",
"default",
"implementation",
"it",
"does",
"bump",
"(",
"creating",
"a",
"new",
"model",
")",
"and",
"revalue",
".",... | train | https://github.com/finmath/finmath-lib/blob/a3c067d52dd33feb97d851df6cab130e4116759f/src/main/java6/net/finmath/montecarlo/AbstractMonteCarloProduct.java#L194-L197 |
sporniket/core | sporniket-core-lang/src/main/java/com/sporniket/libre/lang/functor/FunctorFactory.java | FunctorFactory.instanciateFunctorAsAMethodWrapper | public static Functor instanciateFunctorAsAMethodWrapper(final Object instance, final Method method) throws Exception {
"""
Create a functor without parameter, wrapping a call to another method.
@param instance
null is allowed, for wrapping static method calls
@param method
the method to call.
@return a Fun... | java | public static Functor instanciateFunctorAsAMethodWrapper(final Object instance, final Method method) throws Exception
{
if (null == method)
{
throw new NullPointerException("Method is null");
}
if (method.getParameterTypes().length > 0)
{
throw new InvalidParameterException("Method should not a... | [
"public",
"static",
"Functor",
"instanciateFunctorAsAMethodWrapper",
"(",
"final",
"Object",
"instance",
",",
"final",
"Method",
"method",
")",
"throws",
"Exception",
"{",
"if",
"(",
"null",
"==",
"method",
")",
"{",
"throw",
"new",
"NullPointerException",
"(",
... | Create a functor without parameter, wrapping a call to another method.
@param instance
null is allowed, for wrapping static method calls
@param method
the method to call.
@return a Functor that call the specified method on the specified instance.
@throws Exception if there is a problem to deal with. | [
"Create",
"a",
"functor",
"without",
"parameter",
"wrapping",
"a",
"call",
"to",
"another",
"method",
"."
] | train | https://github.com/sporniket/core/blob/3480ebd72a07422fcc09971be2607ee25efb2c26/sporniket-core-lang/src/main/java/com/sporniket/libre/lang/functor/FunctorFactory.java#L70-L87 |
wildfly/wildfly-core | cli/src/main/java/org/jboss/as/cli/util/CLIExpressionResolver.java | CLIExpressionResolver.resolveOrOriginal | public static String resolveOrOriginal(String input) {
"""
Attempts to substitute all the found expressions in the input
with their corresponding resolved values.
If any of the found expressions failed to resolve or
if the input does not contain any expression, the input is returned as is.
@param input the ... | java | public static String resolveOrOriginal(String input) {
try {
return resolve(input, true);
} catch (UnresolvedExpressionException e) {
return input;
}
} | [
"public",
"static",
"String",
"resolveOrOriginal",
"(",
"String",
"input",
")",
"{",
"try",
"{",
"return",
"resolve",
"(",
"input",
",",
"true",
")",
";",
"}",
"catch",
"(",
"UnresolvedExpressionException",
"e",
")",
"{",
"return",
"input",
";",
"}",
"}"
] | Attempts to substitute all the found expressions in the input
with their corresponding resolved values.
If any of the found expressions failed to resolve or
if the input does not contain any expression, the input is returned as is.
@param input the input string
@return the input with resolved expressions or the orig... | [
"Attempts",
"to",
"substitute",
"all",
"the",
"found",
"expressions",
"in",
"the",
"input",
"with",
"their",
"corresponding",
"resolved",
"values",
".",
"If",
"any",
"of",
"the",
"found",
"expressions",
"failed",
"to",
"resolve",
"or",
"if",
"the",
"input",
... | train | https://github.com/wildfly/wildfly-core/blob/cfaf0479dcbb2d320a44c5374b93b944ec39fade/cli/src/main/java/org/jboss/as/cli/util/CLIExpressionResolver.java#L79-L85 |
optimaize/language-detector | src/main/java/com/optimaize/langdetect/profiles/LanguageProfileBuilder.java | LanguageProfileBuilder.addGram | public LanguageProfileBuilder addGram(String ngram, int frequency) {
"""
If the builder already has this ngram, the given frequency is added to the current count.
"""
Map<String, Integer> map = ngrams.get(ngram.length());
if (map==null) {
map = new HashMap<>();
ngrams.pu... | java | public LanguageProfileBuilder addGram(String ngram, int frequency) {
Map<String, Integer> map = ngrams.get(ngram.length());
if (map==null) {
map = new HashMap<>();
ngrams.put(ngram.length(), map);
}
Integer total = map.get(ngram);
if (total==null) total = ... | [
"public",
"LanguageProfileBuilder",
"addGram",
"(",
"String",
"ngram",
",",
"int",
"frequency",
")",
"{",
"Map",
"<",
"String",
",",
"Integer",
">",
"map",
"=",
"ngrams",
".",
"get",
"(",
"ngram",
".",
"length",
"(",
")",
")",
";",
"if",
"(",
"map",
... | If the builder already has this ngram, the given frequency is added to the current count. | [
"If",
"the",
"builder",
"already",
"has",
"this",
"ngram",
"the",
"given",
"frequency",
"is",
"added",
"to",
"the",
"current",
"count",
"."
] | train | https://github.com/optimaize/language-detector/blob/1a322c462f977b29eca8d3142b816b7111d3fa19/src/main/java/com/optimaize/langdetect/profiles/LanguageProfileBuilder.java#L100-L111 |
feedzai/pdb | src/main/java/com/feedzai/commons/sql/abstraction/dml/result/ResultColumn.java | ResultColumn.toBlob | public <T> T toBlob() throws DatabaseEngineRuntimeException {
"""
Converts this result (in the form of blob) to the specified object type.
@param <T> The type to convert.
@return The instance that was in the form of blob.
@throws DatabaseEngineRuntimeException If the value is not a blob or if
something goes ... | java | public <T> T toBlob() throws DatabaseEngineRuntimeException {
if (isNull()) {
return null;
}
InputStream is;
if (val instanceof Blob) {
try {
is = ((Blob) val).getBinaryStream();
} catch (final SQLException e) {
throw n... | [
"public",
"<",
"T",
">",
"T",
"toBlob",
"(",
")",
"throws",
"DatabaseEngineRuntimeException",
"{",
"if",
"(",
"isNull",
"(",
")",
")",
"{",
"return",
"null",
";",
"}",
"InputStream",
"is",
";",
"if",
"(",
"val",
"instanceof",
"Blob",
")",
"{",
"try",
... | Converts this result (in the form of blob) to the specified object type.
@param <T> The type to convert.
@return The instance that was in the form of blob.
@throws DatabaseEngineRuntimeException If the value is not a blob or if
something goes wrong when reading the object. | [
"Converts",
"this",
"result",
"(",
"in",
"the",
"form",
"of",
"blob",
")",
"to",
"the",
"specified",
"object",
"type",
"."
] | train | https://github.com/feedzai/pdb/blob/fe07ca08417e0ddcd620a36aa1fdbca7f338be98/src/main/java/com/feedzai/commons/sql/abstraction/dml/result/ResultColumn.java#L180-L194 |
line/armeria | core/src/main/java/com/linecorp/armeria/server/auth/HttpAuthServiceBuilder.java | HttpAuthServiceBuilder.newDecorator | public Function<Service<HttpRequest, HttpResponse>, HttpAuthService> newDecorator() {
"""
Returns a newly-created decorator that decorates a {@link Service} with a new {@link HttpAuthService}
based on the {@link Authorizer}s added to this builder.
"""
final Authorizer<HttpRequest> authorizer = authori... | java | public Function<Service<HttpRequest, HttpResponse>, HttpAuthService> newDecorator() {
final Authorizer<HttpRequest> authorizer = authorizer();
final AuthSuccessHandler<HttpRequest, HttpResponse> successHandler = this.successHandler;
final AuthFailureHandler<HttpRequest, HttpResponse> failureHand... | [
"public",
"Function",
"<",
"Service",
"<",
"HttpRequest",
",",
"HttpResponse",
">",
",",
"HttpAuthService",
">",
"newDecorator",
"(",
")",
"{",
"final",
"Authorizer",
"<",
"HttpRequest",
">",
"authorizer",
"=",
"authorizer",
"(",
")",
";",
"final",
"AuthSucces... | Returns a newly-created decorator that decorates a {@link Service} with a new {@link HttpAuthService}
based on the {@link Authorizer}s added to this builder. | [
"Returns",
"a",
"newly",
"-",
"created",
"decorator",
"that",
"decorates",
"a",
"{"
] | train | https://github.com/line/armeria/blob/67d29e019fd35a35f89c45cc8f9119ff9b12b44d/core/src/main/java/com/linecorp/armeria/server/auth/HttpAuthServiceBuilder.java#L170-L175 |
VoltDB/voltdb | src/frontend/org/voltdb/NonVoltDBBackend.java | NonVoltDBBackend.isGeoColumn | private boolean isGeoColumn(String columnName, List<String> tableNames, boolean debugPrint) {
"""
Returns true if the <i>columnName</i> is a Geospatial column type, i.e.,
a GEOGRAPHY_POINT (point) or GEOGRAPHY (polygon) column, or equivalents
in a comparison, non-VoltDB database; false otherwise.
"""
... | java | private boolean isGeoColumn(String columnName, List<String> tableNames, boolean debugPrint) {
List<String> geoColumnTypes = Arrays.asList("GEOGRAPHY", "GEOGRAPHY_POINT");
return isColumnType(geoColumnTypes, columnName, tableNames, debugPrint);
} | [
"private",
"boolean",
"isGeoColumn",
"(",
"String",
"columnName",
",",
"List",
"<",
"String",
">",
"tableNames",
",",
"boolean",
"debugPrint",
")",
"{",
"List",
"<",
"String",
">",
"geoColumnTypes",
"=",
"Arrays",
".",
"asList",
"(",
"\"GEOGRAPHY\"",
",",
"\... | Returns true if the <i>columnName</i> is a Geospatial column type, i.e.,
a GEOGRAPHY_POINT (point) or GEOGRAPHY (polygon) column, or equivalents
in a comparison, non-VoltDB database; false otherwise. | [
"Returns",
"true",
"if",
"the",
"<i",
">",
"columnName<",
"/",
"i",
">",
"is",
"a",
"Geospatial",
"column",
"type",
"i",
".",
"e",
".",
"a",
"GEOGRAPHY_POINT",
"(",
"point",
")",
"or",
"GEOGRAPHY",
"(",
"polygon",
")",
"column",
"or",
"equivalents",
"i... | train | https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/src/frontend/org/voltdb/NonVoltDBBackend.java#L556-L559 |
geomajas/geomajas-project-server | api/src/main/java/org/geomajas/layer/feature/attribute/ManyToOneAttribute.java | ManyToOneAttribute.setImageUrlAttribute | public void setImageUrlAttribute(String name, String value) {
"""
Sets the specified image URL attribute to the specified value.
@param name name of the attribute
@param value value of the attribute
@since 1.9.0
"""
ensureValue();
Attribute attribute = new ImageUrlAttribute(value);
attribute.setEdit... | java | public void setImageUrlAttribute(String name, String value) {
ensureValue();
Attribute attribute = new ImageUrlAttribute(value);
attribute.setEditable(isEditable(name));
getValue().getAllAttributes().put(name, attribute);
} | [
"public",
"void",
"setImageUrlAttribute",
"(",
"String",
"name",
",",
"String",
"value",
")",
"{",
"ensureValue",
"(",
")",
";",
"Attribute",
"attribute",
"=",
"new",
"ImageUrlAttribute",
"(",
"value",
")",
";",
"attribute",
".",
"setEditable",
"(",
"isEditabl... | Sets the specified image URL attribute to the specified value.
@param name name of the attribute
@param value value of the attribute
@since 1.9.0 | [
"Sets",
"the",
"specified",
"image",
"URL",
"attribute",
"to",
"the",
"specified",
"value",
"."
] | train | https://github.com/geomajas/geomajas-project-server/blob/904b7d7deed1350d28955589098dd1e0a786d76e/api/src/main/java/org/geomajas/layer/feature/attribute/ManyToOneAttribute.java#L188-L193 |
ralscha/wampspring | src/main/java/ch/rasc/wampspring/user/UserEventMessenger.java | UserEventMessenger.sendToUsers | public void sendToUsers(String topicURI, Object event, Set<String> eligibleUsers) {
"""
Send an {@link EventMessage} to every client that is currently subscribed to the
given topicURI and are listed in the eligibleUsers set. If no user of the provided
set is subscribed to the topicURI nothing happens.
@param ... | java | public void sendToUsers(String topicURI, Object event, Set<String> eligibleUsers) {
Set<String> eligibleSessionIds = null;
if (eligibleUsers != null && !eligibleUsers.isEmpty()) {
eligibleSessionIds = new HashSet<>(eligibleUsers.size());
for (String user : eligibleUsers) {
for (SimpSession session : thi... | [
"public",
"void",
"sendToUsers",
"(",
"String",
"topicURI",
",",
"Object",
"event",
",",
"Set",
"<",
"String",
">",
"eligibleUsers",
")",
"{",
"Set",
"<",
"String",
">",
"eligibleSessionIds",
"=",
"null",
";",
"if",
"(",
"eligibleUsers",
"!=",
"null",
"&&"... | Send an {@link EventMessage} to every client that is currently subscribed to the
given topicURI and are listed in the eligibleUsers set. If no user of the provided
set is subscribed to the topicURI nothing happens.
@param topicURI the name of the topic
@param event the payload of the {@link EventMessage}
@param eligib... | [
"Send",
"an",
"{",
"@link",
"EventMessage",
"}",
"to",
"every",
"client",
"that",
"is",
"currently",
"subscribed",
"to",
"the",
"given",
"topicURI",
"and",
"are",
"listed",
"in",
"the",
"eligibleUsers",
"set",
".",
"If",
"no",
"user",
"of",
"the",
"provide... | train | https://github.com/ralscha/wampspring/blob/7571bb6773b848c580b29890587eb35397bfe5b5/src/main/java/ch/rasc/wampspring/user/UserEventMessenger.java#L145-L160 |
apiman/apiman | manager/api/es/src/main/java/io/apiman/manager/api/es/EsStorage.java | EsStorage.indexEntity | private void indexEntity(String type, String id, XContentBuilder sourceEntity) throws StorageException {
"""
Indexes an entity.
@param type
@param id
@param sourceEntity
@throws StorageException
"""
indexEntity(type, id, sourceEntity, false);
} | java | private void indexEntity(String type, String id, XContentBuilder sourceEntity) throws StorageException {
indexEntity(type, id, sourceEntity, false);
} | [
"private",
"void",
"indexEntity",
"(",
"String",
"type",
",",
"String",
"id",
",",
"XContentBuilder",
"sourceEntity",
")",
"throws",
"StorageException",
"{",
"indexEntity",
"(",
"type",
",",
"id",
",",
"sourceEntity",
",",
"false",
")",
";",
"}"
] | Indexes an entity.
@param type
@param id
@param sourceEntity
@throws StorageException | [
"Indexes",
"an",
"entity",
"."
] | train | https://github.com/apiman/apiman/blob/8c049c2a2f2e4a69bbb6125686a15edd26f29c21/manager/api/es/src/main/java/io/apiman/manager/api/es/EsStorage.java#L1988-L1990 |
btrplace/scheduler | btrpsl/src/main/java/org/btrplace/btrpsl/tree/BtrPlaceTree.java | BtrPlaceTree.append | public void append(Token t, String msg) {
"""
Add an error message related to a given token
@param t the token that points to the error
@param msg the error message
"""
errors.append(t.getLine(), t.getCharPositionInLine(), msg);
} | java | public void append(Token t, String msg) {
errors.append(t.getLine(), t.getCharPositionInLine(), msg);
} | [
"public",
"void",
"append",
"(",
"Token",
"t",
",",
"String",
"msg",
")",
"{",
"errors",
".",
"append",
"(",
"t",
".",
"getLine",
"(",
")",
",",
"t",
".",
"getCharPositionInLine",
"(",
")",
",",
"msg",
")",
";",
"}"
] | Add an error message related to a given token
@param t the token that points to the error
@param msg the error message | [
"Add",
"an",
"error",
"message",
"related",
"to",
"a",
"given",
"token"
] | train | https://github.com/btrplace/scheduler/blob/611063aad0b47a016e57ebf36fa4dfdf24de09e8/btrpsl/src/main/java/org/btrplace/btrpsl/tree/BtrPlaceTree.java#L113-L115 |
wmdietl/jsr308-langtools | src/share/classes/com/sun/tools/javac/parser/JavaTokenizer.java | JavaTokenizer.processComment | protected Tokens.Comment processComment(int pos, int endPos, CommentStyle style) {
"""
Called when a complete comment has been scanned. pos and endPos
will mark the comment boundary.
"""
if (scannerDebug)
System.out.println("processComment(" + pos
+ "," + end... | java | protected Tokens.Comment processComment(int pos, int endPos, CommentStyle style) {
if (scannerDebug)
System.out.println("processComment(" + pos
+ "," + endPos + "," + style + ")=|"
+ new String(reader.getRawCharacters(pos, endPos))
... | [
"protected",
"Tokens",
".",
"Comment",
"processComment",
"(",
"int",
"pos",
",",
"int",
"endPos",
",",
"CommentStyle",
"style",
")",
"{",
"if",
"(",
"scannerDebug",
")",
"System",
".",
"out",
".",
"println",
"(",
"\"processComment(\"",
"+",
"pos",
"+",
"\"... | Called when a complete comment has been scanned. pos and endPos
will mark the comment boundary. | [
"Called",
"when",
"a",
"complete",
"comment",
"has",
"been",
"scanned",
".",
"pos",
"and",
"endPos",
"will",
"mark",
"the",
"comment",
"boundary",
"."
] | train | https://github.com/wmdietl/jsr308-langtools/blob/8812d28c20f4de070a0dd6de1b45602431379834/src/share/classes/com/sun/tools/javac/parser/JavaTokenizer.java#L872-L880 |
tango-controls/JTango | server/src/main/java/org/tango/server/servant/DeviceImpl.java | DeviceImpl.set_attribute_config_5 | @Override
public void set_attribute_config_5(final AttributeConfig_5[] newConf, final ClntIdent clIdent) throws DevFailed {
"""
Set some attribute configs. IDL5 version
@param newConf the new configurations
@param clIdent client id
@throws DevFailed
"""
MDC.setContextMap(contextMap);
x... | java | @Override
public void set_attribute_config_5(final AttributeConfig_5[] newConf, final ClntIdent clIdent) throws DevFailed {
MDC.setContextMap(contextMap);
xlogger.entry();
checkInitialization();
clientIdentity.set(clIdent);
if (!name.equalsIgnoreCase(getAdminDeviceName())) {
... | [
"@",
"Override",
"public",
"void",
"set_attribute_config_5",
"(",
"final",
"AttributeConfig_5",
"[",
"]",
"newConf",
",",
"final",
"ClntIdent",
"clIdent",
")",
"throws",
"DevFailed",
"{",
"MDC",
".",
"setContextMap",
"(",
"contextMap",
")",
";",
"xlogger",
".",
... | Set some attribute configs. IDL5 version
@param newConf the new configurations
@param clIdent client id
@throws DevFailed | [
"Set",
"some",
"attribute",
"configs",
".",
"IDL5",
"version"
] | train | https://github.com/tango-controls/JTango/blob/1ccc9dcb83e6de2359a9f1906d170571cacf1345/server/src/main/java/org/tango/server/servant/DeviceImpl.java#L1991-L2027 |
OpenLiberty/open-liberty | dev/com.ibm.ws.webcontainer.security/src/com/ibm/ws/webcontainer/security/metadata/WebResourceCollection.java | WebResourceCollection.performUrlMatch | public CollectionMatch performUrlMatch(String resourceName) {
"""
Gets the match for the resource name.
<pre>
To perform a URL match,
1. For each URL pattern determine if the resource matches it
2. Construct the match object
Exact match has first priority. The longest path match has second priority. The ext... | java | public CollectionMatch performUrlMatch(String resourceName) {
CollectionMatch match = null;
String longestUrlPattern = null;
for (String urlPattern : urlPatterns) {
if (URLMatchingUtils.isExactMatch(resourceName, urlPattern)) {
return new CollectionMatch(resourceName,... | [
"public",
"CollectionMatch",
"performUrlMatch",
"(",
"String",
"resourceName",
")",
"{",
"CollectionMatch",
"match",
"=",
"null",
";",
"String",
"longestUrlPattern",
"=",
"null",
";",
"for",
"(",
"String",
"urlPattern",
":",
"urlPatterns",
")",
"{",
"if",
"(",
... | Gets the match for the resource name.
<pre>
To perform a URL match,
1. For each URL pattern determine if the resource matches it
2. Construct the match object
Exact match has first priority. The longest path match has second priority. The extension match has last priority.
</pre>
@param uriName
@return | [
"Gets",
"the",
"match",
"for",
"the",
"resource",
"name",
".",
"<pre",
">",
"To",
"perform",
"a",
"URL",
"match",
"1",
".",
"For",
"each",
"URL",
"pattern",
"determine",
"if",
"the",
"resource",
"matches",
"it",
"2",
".",
"Construct",
"the",
"match",
"... | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.webcontainer.security/src/com/ibm/ws/webcontainer/security/metadata/WebResourceCollection.java#L91-L107 |
PeterisP/LVTagger | src/main/java/edu/stanford/nlp/io/IOUtils.java | IOUtils.encodedOutputStreamPrintWriter | public static PrintWriter encodedOutputStreamPrintWriter(OutputStream stream,
String encoding, boolean autoFlush) throws IOException {
"""
Create a Reader with an explicit encoding around an InputStream.
This static method will treat null as meaning to use the platform default,
unlike the J... | java | public static PrintWriter encodedOutputStreamPrintWriter(OutputStream stream,
String encoding, boolean autoFlush) throws IOException {
// PrintWriter doesn't allow encoding to be null; or to have charset and flush
if (encoding == null) {
return new PrintWriter(stream, autoFlush);
... | [
"public",
"static",
"PrintWriter",
"encodedOutputStreamPrintWriter",
"(",
"OutputStream",
"stream",
",",
"String",
"encoding",
",",
"boolean",
"autoFlush",
")",
"throws",
"IOException",
"{",
"// PrintWriter doesn't allow encoding to be null; or to have charset and flush\r",
"if",... | Create a Reader with an explicit encoding around an InputStream.
This static method will treat null as meaning to use the platform default,
unlike the Java library methods that disallow a null encoding.
@param stream An InputStream
@param encoding A charset encoding
@return A Reader
@throws IOException If any IO probl... | [
"Create",
"a",
"Reader",
"with",
"an",
"explicit",
"encoding",
"around",
"an",
"InputStream",
".",
"This",
"static",
"method",
"will",
"treat",
"null",
"as",
"meaning",
"to",
"use",
"the",
"platform",
"default",
"unlike",
"the",
"Java",
"library",
"methods",
... | train | https://github.com/PeterisP/LVTagger/blob/b3d44bab9ec07ace0d13612c448a6b7298c1f681/src/main/java/edu/stanford/nlp/io/IOUtils.java#L1358-L1366 |
DataSketches/sketches-core | src/main/java/com/yahoo/sketches/theta/ForwardCompatibility.java | ForwardCompatibility.heapify1to3 | static final CompactSketch heapify1to3(final Memory srcMem, final long seed) {
"""
Convert a serialization version (SerVer) 1 sketch to a SerVer 3 HeapCompactOrderedSketch.
Note: SerVer 1 sketches always have metadata-longs of 3 and are always stored
in a compact ordered form, but with 3 different sketch types. ... | java | static final CompactSketch heapify1to3(final Memory srcMem, final long seed) {
final int memCap = (int) srcMem.getCapacity();
final short seedHash = Util.computeSeedHash(seed);
if (memCap <= 24) { //return empty
return HeapCompactOrderedSketch
.compact(new long[0], true, seedHash, 0, Long.... | [
"static",
"final",
"CompactSketch",
"heapify1to3",
"(",
"final",
"Memory",
"srcMem",
",",
"final",
"long",
"seed",
")",
"{",
"final",
"int",
"memCap",
"=",
"(",
"int",
")",
"srcMem",
".",
"getCapacity",
"(",
")",
";",
"final",
"short",
"seedHash",
"=",
"... | Convert a serialization version (SerVer) 1 sketch to a SerVer 3 HeapCompactOrderedSketch.
Note: SerVer 1 sketches always have metadata-longs of 3 and are always stored
in a compact ordered form, but with 3 different sketch types. All SerVer 1 sketches will
be converted to a SerVer 3, HeapCompactOrderedSketch.
@param ... | [
"Convert",
"a",
"serialization",
"version",
"(",
"SerVer",
")",
"1",
"sketch",
"to",
"a",
"SerVer",
"3",
"HeapCompactOrderedSketch",
".",
"Note",
":",
"SerVer",
"1",
"sketches",
"always",
"have",
"metadata",
"-",
"longs",
"of",
"3",
"and",
"are",
"always",
... | train | https://github.com/DataSketches/sketches-core/blob/900c8c9668a1e2f1d54d453e956caad54702e540/src/main/java/com/yahoo/sketches/theta/ForwardCompatibility.java#L42-L64 |
bignerdranch/expandable-recycler-view | sampleapp/src/main/java/com/bignerdranch/expandablerecyclerviewsample/linear/horizontal/HorizontalExpandableAdapter.java | HorizontalExpandableAdapter.onCreateChildViewHolder | @UiThread
@NonNull
@Override
public HorizontalChildViewHolder onCreateChildViewHolder(@NonNull ViewGroup parent, int viewType) {
"""
OnCreateViewHolder implementation for child items. The desired ChildViewHolder should
be inflated here
@param parent for inflating the View
@return the user's custom... | java | @UiThread
@NonNull
@Override
public HorizontalChildViewHolder onCreateChildViewHolder(@NonNull ViewGroup parent, int viewType) {
View view = mInflater.inflate(R.layout.list_item_child_horizontal, parent, false);
return new HorizontalChildViewHolder(view);
} | [
"@",
"UiThread",
"@",
"NonNull",
"@",
"Override",
"public",
"HorizontalChildViewHolder",
"onCreateChildViewHolder",
"(",
"@",
"NonNull",
"ViewGroup",
"parent",
",",
"int",
"viewType",
")",
"{",
"View",
"view",
"=",
"mInflater",
".",
"inflate",
"(",
"R",
".",
"... | OnCreateViewHolder implementation for child items. The desired ChildViewHolder should
be inflated here
@param parent for inflating the View
@return the user's custom parent ViewHolder that must extend ParentViewHolder | [
"OnCreateViewHolder",
"implementation",
"for",
"child",
"items",
".",
"The",
"desired",
"ChildViewHolder",
"should",
"be",
"inflated",
"here"
] | train | https://github.com/bignerdranch/expandable-recycler-view/blob/930912510620894c531d236856fa79d646e2f1ed/sampleapp/src/main/java/com/bignerdranch/expandablerecyclerviewsample/linear/horizontal/HorizontalExpandableAdapter.java#L56-L62 |
OpenLiberty/open-liberty | dev/com.ibm.ws.ejbcontainer.core/src/com/ibm/ejs/util/cache/Cache.java | Cache.findDontPinNAdjustPinCount | @Override
public Object findDontPinNAdjustPinCount(Object key, int adjustPinCount) {
"""
Return element for the given key but do not pin the element. In addition,
if object is found, add adjustPinCount to the pinned state. <p>
Note: This method is added to support the scenario in the activation
strategy c... | java | @Override
public Object findDontPinNAdjustPinCount(Object key, int adjustPinCount)
{
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
Tr.entry(tc, "findDontPinNAdjustPinCount", key +
", adujust pin count=" + adjustPinCoun... | [
"@",
"Override",
"public",
"Object",
"findDontPinNAdjustPinCount",
"(",
"Object",
"key",
",",
"int",
"adjustPinCount",
")",
"{",
"if",
"(",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
"&&",
"tc",
".",
"isEntryEnabled",
"(",
")",
")",
"Tr",
".",
"... | Return element for the given key but do not pin the element. In addition,
if object is found, add adjustPinCount to the pinned state. <p>
Note: This method is added to support the scenario in the activation
strategy classes that multiple cache.unpin() are called immediately
after the find() operation to negate the pin... | [
"Return",
"element",
"for",
"the",
"given",
"key",
"but",
"do",
"not",
"pin",
"the",
"element",
".",
"In",
"addition",
"if",
"object",
"is",
"found",
"add",
"adjustPinCount",
"to",
"the",
"pinned",
"state",
".",
"<p",
">"
] | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.ejbcontainer.core/src/com/ibm/ejs/util/cache/Cache.java#L339-L371 |
biezhi/anima | src/main/java/io/github/biezhi/anima/core/AnimaQuery.java | AnimaQuery.queryOne | public <S> S queryOne(Class<S> type, String sql, List<Object> params) {
"""
Querying a model
@param type model type
@param sql sql statement
@param params params
@param <S>
@return S
"""
if (Anima.of().isUseSQLLimit()) {
sql += " LIMIT 1";
}
List<S> list = queryL... | java | public <S> S queryOne(Class<S> type, String sql, List<Object> params) {
if (Anima.of().isUseSQLLimit()) {
sql += " LIMIT 1";
}
List<S> list = queryList(type, sql, params);
return AnimaUtils.isNotEmpty(list) ? list.get(0) : null;
} | [
"public",
"<",
"S",
">",
"S",
"queryOne",
"(",
"Class",
"<",
"S",
">",
"type",
",",
"String",
"sql",
",",
"List",
"<",
"Object",
">",
"params",
")",
"{",
"if",
"(",
"Anima",
".",
"of",
"(",
")",
".",
"isUseSQLLimit",
"(",
")",
")",
"{",
"sql",
... | Querying a model
@param type model type
@param sql sql statement
@param params params
@param <S>
@return S | [
"Querying",
"a",
"model"
] | train | https://github.com/biezhi/anima/blob/d6655e47ac4c08d9d7f961ac0569062bead8b1ed/src/main/java/io/github/biezhi/anima/core/AnimaQuery.java#L1098-L1104 |
line/armeria | core/src/main/java/com/linecorp/armeria/client/circuitbreaker/CircuitBreakerHttpClient.java | CircuitBreakerHttpClient.newDecorator | public static Function<Client<HttpRequest, HttpResponse>, CircuitBreakerHttpClient>
newDecorator(CircuitBreaker circuitBreaker, CircuitBreakerStrategy strategy) {
"""
Creates a new decorator using the specified {@link CircuitBreaker} instance and
{@link CircuitBreakerStrategy}.
<p>Since {@link CircuitBreak... | java | public static Function<Client<HttpRequest, HttpResponse>, CircuitBreakerHttpClient>
newDecorator(CircuitBreaker circuitBreaker, CircuitBreakerStrategy strategy) {
return newDecorator((ctx, req) -> circuitBreaker, strategy);
} | [
"public",
"static",
"Function",
"<",
"Client",
"<",
"HttpRequest",
",",
"HttpResponse",
">",
",",
"CircuitBreakerHttpClient",
">",
"newDecorator",
"(",
"CircuitBreaker",
"circuitBreaker",
",",
"CircuitBreakerStrategy",
"strategy",
")",
"{",
"return",
"newDecorator",
"... | Creates a new decorator using the specified {@link CircuitBreaker} instance and
{@link CircuitBreakerStrategy}.
<p>Since {@link CircuitBreaker} is a unit of failure detection, don't reuse the same instance for
unrelated services. | [
"Creates",
"a",
"new",
"decorator",
"using",
"the",
"specified",
"{",
"@link",
"CircuitBreaker",
"}",
"instance",
"and",
"{",
"@link",
"CircuitBreakerStrategy",
"}",
"."
] | train | https://github.com/line/armeria/blob/67d29e019fd35a35f89c45cc8f9119ff9b12b44d/core/src/main/java/com/linecorp/armeria/client/circuitbreaker/CircuitBreakerHttpClient.java#L41-L44 |
james-hu/jabb-core | src/main/java/net/sf/jabb/util/text/PasswordUtility.java | PasswordUtility.unmaskInUrl | public static String unmaskInUrl(String url, String password) {
"""
Unmask password in URL.
@param url The URL in which the password part had been masked.
@param password The clear password
@return The URL with clear password.
"""
String result = null;
if (url != null){
Matcher urlMatcher... | java | public static String unmaskInUrl(String url, String password){
String result = null;
if (url != null){
Matcher urlMatcher = URL_PATTERN.matcher(url);
if (urlMatcher.find()) {
int s = url.indexOf(PASSWORD_IN_URL_MASK);
if (s >= 0){
StringBuilder sb = new StringBuilder();
sb.append(url... | [
"public",
"static",
"String",
"unmaskInUrl",
"(",
"String",
"url",
",",
"String",
"password",
")",
"{",
"String",
"result",
"=",
"null",
";",
"if",
"(",
"url",
"!=",
"null",
")",
"{",
"Matcher",
"urlMatcher",
"=",
"URL_PATTERN",
".",
"matcher",
"(",
"url... | Unmask password in URL.
@param url The URL in which the password part had been masked.
@param password The clear password
@return The URL with clear password. | [
"Unmask",
"password",
"in",
"URL",
"."
] | train | https://github.com/james-hu/jabb-core/blob/bceed441595c5e5195a7418795f03b69fa7b61e4/src/main/java/net/sf/jabb/util/text/PasswordUtility.java#L67-L86 |
authlete/authlete-java-common | src/main/java/com/authlete/common/util/TypedProperties.java | TypedProperties.setInt | public void setInt(Enum<?> key, int value) {
"""
Equivalent to {@link #setInt(String, int)
setInt}{@code (key.name(), value)}.
If {@code key} is null, nothing is done.
"""
if (key == null)
{
return;
}
setInt(key.name(), value);
} | java | public void setInt(Enum<?> key, int value)
{
if (key == null)
{
return;
}
setInt(key.name(), value);
} | [
"public",
"void",
"setInt",
"(",
"Enum",
"<",
"?",
">",
"key",
",",
"int",
"value",
")",
"{",
"if",
"(",
"key",
"==",
"null",
")",
"{",
"return",
";",
"}",
"setInt",
"(",
"key",
".",
"name",
"(",
")",
",",
"value",
")",
";",
"}"
] | Equivalent to {@link #setInt(String, int)
setInt}{@code (key.name(), value)}.
If {@code key} is null, nothing is done. | [
"Equivalent",
"to",
"{"
] | train | https://github.com/authlete/authlete-java-common/blob/49c94c483713cbf5a04d805ff7dbd83766c9c964/src/main/java/com/authlete/common/util/TypedProperties.java#L683-L691 |
cdk/cdk | tool/formula/src/main/java/org/openscience/cdk/formula/MolecularFormulaRange.java | MolecularFormulaRange.addIsotope | public void addIsotope(IIsotope isotope, int countMin, int countMax) {
"""
Adds an Isotope to this MolecularFormulaExpand in a number of
maximum and minimum occurrences allowed.
@param isotope The isotope to be added to this MolecularFormulaExpand
@param countMax The maximal number of occurrences to add
@... | java | public void addIsotope(IIsotope isotope, int countMin, int countMax) {
if (isotope == null)
throw new IllegalArgumentException("Isotope must not be null");
boolean flag = false;
for (Iterator<IIsotope> it = isotopes().iterator(); it.hasNext();) {
IIsoto... | [
"public",
"void",
"addIsotope",
"(",
"IIsotope",
"isotope",
",",
"int",
"countMin",
",",
"int",
"countMax",
")",
"{",
"if",
"(",
"isotope",
"==",
"null",
")",
"throw",
"new",
"IllegalArgumentException",
"(",
"\"Isotope must not be null\"",
")",
";",
"boolean",
... | Adds an Isotope to this MolecularFormulaExpand in a number of
maximum and minimum occurrences allowed.
@param isotope The isotope to be added to this MolecularFormulaExpand
@param countMax The maximal number of occurrences to add
@param countMin The minimal number of occurrences to add | [
"Adds",
"an",
"Isotope",
"to",
"this",
"MolecularFormulaExpand",
"in",
"a",
"number",
"of",
"maximum",
"and",
"minimum",
"occurrences",
"allowed",
"."
] | train | https://github.com/cdk/cdk/blob/c3d0f16502bf08df50365fee392e11d7c9856657/tool/formula/src/main/java/org/openscience/cdk/formula/MolecularFormulaRange.java#L67-L86 |
apache/incubator-druid | server/src/main/java/org/apache/druid/segment/realtime/plumber/RealtimePlumber.java | RealtimePlumber.persistHydrant | protected int persistHydrant(
FireHydrant indexToPersist,
DataSchema schema,
Interval interval,
Map<String, Object> metadataElems
) {
"""
Persists the given hydrant and returns the number of rows persisted
@param indexToPersist hydrant to persist
@param schema datasource schem... | java | protected int persistHydrant(
FireHydrant indexToPersist,
DataSchema schema,
Interval interval,
Map<String, Object> metadataElems
)
{
synchronized (indexToPersist) {
if (indexToPersist.hasSwapped()) {
log.info(
"DataSource[%s], Interval[%s], Hydrant[%s] already ... | [
"protected",
"int",
"persistHydrant",
"(",
"FireHydrant",
"indexToPersist",
",",
"DataSchema",
"schema",
",",
"Interval",
"interval",
",",
"Map",
"<",
"String",
",",
"Object",
">",
"metadataElems",
")",
"{",
"synchronized",
"(",
"indexToPersist",
")",
"{",
"if",... | Persists the given hydrant and returns the number of rows persisted
@param indexToPersist hydrant to persist
@param schema datasource schema
@param interval interval to persist
@return the number of rows persisted | [
"Persists",
"the",
"given",
"hydrant",
"and",
"returns",
"the",
"number",
"of",
"rows",
"persisted"
] | train | https://github.com/apache/incubator-druid/blob/f776b9408962b9006cfcfe4d6c1794751972cc8e/server/src/main/java/org/apache/druid/segment/realtime/plumber/RealtimePlumber.java#L932-L983 |
netscaler/nitro | src/main/java/com/citrix/netscaler/nitro/resource/stat/audit/audit_stats.java | audit_stats.get | public static audit_stats get(nitro_service service, options option) throws Exception {
"""
Use this API to fetch the statistics of all audit_stats resources that are configured on netscaler.
"""
audit_stats obj = new audit_stats();
audit_stats[] response = (audit_stats[])obj.stat_resources(service,option... | java | public static audit_stats get(nitro_service service, options option) throws Exception{
audit_stats obj = new audit_stats();
audit_stats[] response = (audit_stats[])obj.stat_resources(service,option);
return response[0];
} | [
"public",
"static",
"audit_stats",
"get",
"(",
"nitro_service",
"service",
",",
"options",
"option",
")",
"throws",
"Exception",
"{",
"audit_stats",
"obj",
"=",
"new",
"audit_stats",
"(",
")",
";",
"audit_stats",
"[",
"]",
"response",
"=",
"(",
"audit_stats",
... | Use this API to fetch the statistics of all audit_stats resources that are configured on netscaler. | [
"Use",
"this",
"API",
"to",
"fetch",
"the",
"statistics",
"of",
"all",
"audit_stats",
"resources",
"that",
"are",
"configured",
"on",
"netscaler",
"."
] | train | https://github.com/netscaler/nitro/blob/2a98692dcf4e4ec430c7d7baab8382e4ba5a35e4/src/main/java/com/citrix/netscaler/nitro/resource/stat/audit/audit_stats.java#L323-L327 |
j-a-w-r/jawr-main-repo | jawr/jawr-core/src/main/java/net/jawr/web/resource/bundle/factory/BundlesHandlerFactory.java | BundlesHandlerFactory.bundleListContains | private boolean bundleListContains(List<JoinableResourceBundle> bundles, String bundleName) {
"""
Checks if the bundle name exists in the bundle list
@param bundles
the bundle list
@param bundleName
the bundle name
@return true if the bundle name exists in the bundle list
"""
boolean contains = false;... | java | private boolean bundleListContains(List<JoinableResourceBundle> bundles, String bundleName) {
boolean contains = false;
for (JoinableResourceBundle bundle : bundles) {
if (bundle.getName().equals(bundleName)) {
contains = true;
break;
}
}
return contains;
} | [
"private",
"boolean",
"bundleListContains",
"(",
"List",
"<",
"JoinableResourceBundle",
">",
"bundles",
",",
"String",
"bundleName",
")",
"{",
"boolean",
"contains",
"=",
"false",
";",
"for",
"(",
"JoinableResourceBundle",
"bundle",
":",
"bundles",
")",
"{",
"if... | Checks if the bundle name exists in the bundle list
@param bundles
the bundle list
@param bundleName
the bundle name
@return true if the bundle name exists in the bundle list | [
"Checks",
"if",
"the",
"bundle",
"name",
"exists",
"in",
"the",
"bundle",
"list"
] | train | https://github.com/j-a-w-r/jawr-main-repo/blob/5381f6acf461cd2502593c67a77bd6ef9eab848d/jawr/jawr-core/src/main/java/net/jawr/web/resource/bundle/factory/BundlesHandlerFactory.java#L725-L734 |
davidcarboni/cryptolite-java | src/main/java/com/github/davidcarboni/cryptolite/KeyExchange.java | KeyExchange.getCipher | private Cipher getCipher(int mode, Key key) {
"""
This method returns a {@link Cipher} instance, for {@value #CIPHER_ALGORITHM} in mode
{@value #CIPHER_MODE}, with padding {@value #CIPHER_PADDING}.
<p>
It then initialises the {@link Cipher} in either {@link Cipher#ENCRYPT_MODE} or
{@link Cipher#DECRYPT_MODE}),... | java | private Cipher getCipher(int mode, Key key) {
if (cipher == null) {
try {
// Get a Cipher instance:
cipher = Cipher.getInstance(cipherName);
} catch (NoSuchAlgorithmException e) {
if (SecurityProvider.addProvider()) {
... | [
"private",
"Cipher",
"getCipher",
"(",
"int",
"mode",
",",
"Key",
"key",
")",
"{",
"if",
"(",
"cipher",
"==",
"null",
")",
"{",
"try",
"{",
"// Get a Cipher instance:\r",
"cipher",
"=",
"Cipher",
".",
"getInstance",
"(",
"cipherName",
")",
";",
"}",
"cat... | This method returns a {@link Cipher} instance, for {@value #CIPHER_ALGORITHM} in mode
{@value #CIPHER_MODE}, with padding {@value #CIPHER_PADDING}.
<p>
It then initialises the {@link Cipher} in either {@link Cipher#ENCRYPT_MODE} or
{@link Cipher#DECRYPT_MODE}), as specified by the mode parameter, with the given
{@link ... | [
"This",
"method",
"returns",
"a",
"{",
"@link",
"Cipher",
"}",
"instance",
"for",
"{",
"@value",
"#CIPHER_ALGORITHM",
"}",
"in",
"mode",
"{",
"@value",
"#CIPHER_MODE",
"}",
"with",
"padding",
"{",
"@value",
"#CIPHER_PADDING",
"}",
".",
"<p",
">",
"It",
"th... | train | https://github.com/davidcarboni/cryptolite-java/blob/e67954181a04ffc9beb1d9abca1421195fcf9764/src/main/java/com/github/davidcarboni/cryptolite/KeyExchange.java#L193-L221 |
paymill/paymill-java | src/main/java/com/paymill/services/SubscriptionService.java | SubscriptionService.endTrialAt | public Subscription endTrialAt( Subscription subscription, Date date ) {
"""
Stop the trial period of a subscription on a specific date.
@param subscription the subscription.
@param date the date, on which the subscription should end.
@return the updated subscription.
"""
ParameterMap<String, String> ... | java | public Subscription endTrialAt( Subscription subscription, Date date ) {
ParameterMap<String, String> params = new ParameterMap<String, String>();
params.add( "trial_end", String.valueOf( date.getTime() / 1000 ) );
return RestfulUtils.update( SubscriptionService.PATH, subscription, params, false, Subscripti... | [
"public",
"Subscription",
"endTrialAt",
"(",
"Subscription",
"subscription",
",",
"Date",
"date",
")",
"{",
"ParameterMap",
"<",
"String",
",",
"String",
">",
"params",
"=",
"new",
"ParameterMap",
"<",
"String",
",",
"String",
">",
"(",
")",
";",
"params",
... | Stop the trial period of a subscription on a specific date.
@param subscription the subscription.
@param date the date, on which the subscription should end.
@return the updated subscription. | [
"Stop",
"the",
"trial",
"period",
"of",
"a",
"subscription",
"on",
"a",
"specific",
"date",
"."
] | train | https://github.com/paymill/paymill-java/blob/17281a0d4376c76f1711af9f09bfc138c90ba65a/src/main/java/com/paymill/services/SubscriptionService.java#L527-L531 |
UrielCh/ovh-java-sdk | ovh-java-sdk-me/src/main/java/net/minidev/ovh/api/ApiOvhMe.java | ApiOvhMe.consent_campaignName_decision_GET | public OvhConsent consent_campaignName_decision_GET(String campaignName) throws IOException {
"""
Get decision value for a consent campaign
REST: GET /me/consent/{campaignName}/decision
@param campaignName [required] Consent campaign name
"""
String qPath = "/me/consent/{campaignName}/decision";
String... | java | public OvhConsent consent_campaignName_decision_GET(String campaignName) throws IOException {
String qPath = "/me/consent/{campaignName}/decision";
StringBuilder sb = path(qPath, campaignName);
String resp = exec(qPath, "GET", sb.toString(), null);
return convertTo(resp, OvhConsent.class);
} | [
"public",
"OvhConsent",
"consent_campaignName_decision_GET",
"(",
"String",
"campaignName",
")",
"throws",
"IOException",
"{",
"String",
"qPath",
"=",
"\"/me/consent/{campaignName}/decision\"",
";",
"StringBuilder",
"sb",
"=",
"path",
"(",
"qPath",
",",
"campaignName",
... | Get decision value for a consent campaign
REST: GET /me/consent/{campaignName}/decision
@param campaignName [required] Consent campaign name | [
"Get",
"decision",
"value",
"for",
"a",
"consent",
"campaign"
] | train | https://github.com/UrielCh/ovh-java-sdk/blob/6d531a40e56e09701943e334c25f90f640c55701/ovh-java-sdk-me/src/main/java/net/minidev/ovh/api/ApiOvhMe.java#L1562-L1567 |
biezhi/anima | src/main/java/io/github/biezhi/anima/core/AnimaQuery.java | AnimaQuery.buildPageSQL | private String buildPageSQL(String sql, PageRow pageRow) {
"""
Build a paging statement
@param pageRow page param
@return paging sql
"""
SQLParams sqlParams = SQLParams.builder()
.modelClass(this.modelClass)
.selectColumns(this.selectColumns)
.tableNa... | java | private String buildPageSQL(String sql, PageRow pageRow) {
SQLParams sqlParams = SQLParams.builder()
.modelClass(this.modelClass)
.selectColumns(this.selectColumns)
.tableName(this.tableName)
.pkName(this.primaryKeyColumn)
.conditio... | [
"private",
"String",
"buildPageSQL",
"(",
"String",
"sql",
",",
"PageRow",
"pageRow",
")",
"{",
"SQLParams",
"sqlParams",
"=",
"SQLParams",
".",
"builder",
"(",
")",
".",
"modelClass",
"(",
"this",
".",
"modelClass",
")",
".",
"selectColumns",
"(",
"this",
... | Build a paging statement
@param pageRow page param
@return paging sql | [
"Build",
"a",
"paging",
"statement"
] | train | https://github.com/biezhi/anima/blob/d6655e47ac4c08d9d7f961ac0569062bead8b1ed/src/main/java/io/github/biezhi/anima/core/AnimaQuery.java#L1404-L1417 |
stevespringett/Alpine | alpine/src/main/java/alpine/persistence/AlpineQueryManager.java | AlpineQueryManager.createManagedUser | public ManagedUser createManagedUser(final String username, final String fullname, final String email,
final String passwordHash, final boolean forcePasswordChange,
final boolean nonExpiryPassword, final boolean suspended) {
"""
Crea... | java | public ManagedUser createManagedUser(final String username, final String fullname, final String email,
final String passwordHash, final boolean forcePasswordChange,
final boolean nonExpiryPassword, final boolean suspended) {
pm.cu... | [
"public",
"ManagedUser",
"createManagedUser",
"(",
"final",
"String",
"username",
",",
"final",
"String",
"fullname",
",",
"final",
"String",
"email",
",",
"final",
"String",
"passwordHash",
",",
"final",
"boolean",
"forcePasswordChange",
",",
"final",
"boolean",
... | Creates a new ManagedUser object.
@param username The username for the user
@param fullname The fullname of the user
@param email The users email address
@param passwordHash The hashed password
@param forcePasswordChange Whether or not user needs to change password on next login or not
@param nonExpiryPassword Whether ... | [
"Creates",
"a",
"new",
"ManagedUser",
"object",
"."
] | train | https://github.com/stevespringett/Alpine/blob/6c5ef5e1ba4f38922096f1307d3950c09edb3093/alpine/src/main/java/alpine/persistence/AlpineQueryManager.java#L250-L266 |
xcesco/kripton | kripton/src/main/java/com/abubusoft/kripton/xml/XMLSerializer.java | XMLSerializer.setOutput | public void setOutput(OutputStream os, String encoding) throws IOException {
"""
Sets the output.
@param os the os
@param encoding the encoding
@throws IOException Signals that an I/O exception has occurred.
"""
if (os == null)
throw new IllegalArgumentException("output stream can not be null");
re... | java | public void setOutput(OutputStream os, String encoding) throws IOException {
if (os == null)
throw new IllegalArgumentException("output stream can not be null");
reset();
if (encoding != null) {
out = new OutputStreamWriter(os, encoding);
} else {
out = new OutputStreamWriter(os);
}
} | [
"public",
"void",
"setOutput",
"(",
"OutputStream",
"os",
",",
"String",
"encoding",
")",
"throws",
"IOException",
"{",
"if",
"(",
"os",
"==",
"null",
")",
"throw",
"new",
"IllegalArgumentException",
"(",
"\"output stream can not be null\"",
")",
";",
"reset",
"... | Sets the output.
@param os the os
@param encoding the encoding
@throws IOException Signals that an I/O exception has occurred. | [
"Sets",
"the",
"output",
"."
] | train | https://github.com/xcesco/kripton/blob/90de2c0523d39b99e81b8d38aa996898762f594a/kripton/src/main/java/com/abubusoft/kripton/xml/XMLSerializer.java#L521-L530 |
eclipse/xtext-lib | org.eclipse.xtext.xbase.lib/src/org/eclipse/xtext/xbase/lib/MapExtensions.java | MapExtensions.forEach | public static <K, V> void forEach(Map<K, V> map, Procedure3<? super K, ? super V, ? super Integer> procedure) {
"""
Applies the given {@code procedure} for each {@link java.util.Map.Entry key value pair} of the given {@code map}.
The procedure takes the key, the value and a loop counter. If the counter would over... | java | public static <K, V> void forEach(Map<K, V> map, Procedure3<? super K, ? super V, ? super Integer> procedure) {
if (procedure == null)
throw new NullPointerException("procedure");
int i = 0;
for (Map.Entry<K, V> entry : map.entrySet()) {
procedure.apply(entry.getKey(), entry.getValue(), i);
if (i != Inte... | [
"public",
"static",
"<",
"K",
",",
"V",
">",
"void",
"forEach",
"(",
"Map",
"<",
"K",
",",
"V",
">",
"map",
",",
"Procedure3",
"<",
"?",
"super",
"K",
",",
"?",
"super",
"V",
",",
"?",
"super",
"Integer",
">",
"procedure",
")",
"{",
"if",
"(",
... | Applies the given {@code procedure} for each {@link java.util.Map.Entry key value pair} of the given {@code map}.
The procedure takes the key, the value and a loop counter. If the counter would overflow, {@link Integer#MAX_VALUE}
is returned for all subsequent pairs. The first pair is at index zero.
@param map
the map... | [
"Applies",
"the",
"given",
"{",
"@code",
"procedure",
"}",
"for",
"each",
"{",
"@link",
"java",
".",
"util",
".",
"Map",
".",
"Entry",
"key",
"value",
"pair",
"}",
"of",
"the",
"given",
"{",
"@code",
"map",
"}",
".",
"The",
"procedure",
"takes",
"the... | train | https://github.com/eclipse/xtext-lib/blob/7063572e1f1bd713a3aa53bdf3a8dc60e25c169a/org.eclipse.xtext.xbase.lib/src/org/eclipse/xtext/xbase/lib/MapExtensions.java#L62-L71 |
orbisgis/h2gis | h2gis-functions/src/main/java/org/h2gis/functions/spatial/create/ST_MakePolygon.java | ST_MakePolygon.makePolygon | public static Polygon makePolygon(Geometry shell, Geometry... holes) throws IllegalArgumentException {
"""
Creates a Polygon formed by the given shell and holes.
@param shell
@param holes
@return
"""
if(shell == null) {
return null;
}
LinearRing outerLine = checkLineStr... | java | public static Polygon makePolygon(Geometry shell, Geometry... holes) throws IllegalArgumentException {
if(shell == null) {
return null;
}
LinearRing outerLine = checkLineString(shell);
LinearRing[] interiorlinestrings = new LinearRing[holes.length];
for (int i = 0; i ... | [
"public",
"static",
"Polygon",
"makePolygon",
"(",
"Geometry",
"shell",
",",
"Geometry",
"...",
"holes",
")",
"throws",
"IllegalArgumentException",
"{",
"if",
"(",
"shell",
"==",
"null",
")",
"{",
"return",
"null",
";",
"}",
"LinearRing",
"outerLine",
"=",
"... | Creates a Polygon formed by the given shell and holes.
@param shell
@param holes
@return | [
"Creates",
"a",
"Polygon",
"formed",
"by",
"the",
"given",
"shell",
"and",
"holes",
"."
] | train | https://github.com/orbisgis/h2gis/blob/9cd70b447e6469cecbc2fc64b16774b59491df3b/h2gis-functions/src/main/java/org/h2gis/functions/spatial/create/ST_MakePolygon.java#L67-L77 |
RuedigerMoeller/kontraktor | examples/misc/pub-sub/tcp-based/src/main/java/pubsub/point2point/MediatorActor.java | MediatorActor.askSubscribers | public void askSubscribers( Actor sender, String topic, Object message, Callback cb ) {
"""
send a message to all and stream the result of each receiver back to sender
@param sender
@param topic
@param message
@param cb
"""
List<ReceiverActor> subscriber = topic2Subscriber.get(topic);
if ... | java | public void askSubscribers( Actor sender, String topic, Object message, Callback cb ) {
List<ReceiverActor> subscriber = topic2Subscriber.get(topic);
if ( subscriber != null ) {
List<IPromise> results = subscriber.stream()
.filter(subs -> !subs.equals(sender))
... | [
"public",
"void",
"askSubscribers",
"(",
"Actor",
"sender",
",",
"String",
"topic",
",",
"Object",
"message",
",",
"Callback",
"cb",
")",
"{",
"List",
"<",
"ReceiverActor",
">",
"subscriber",
"=",
"topic2Subscriber",
".",
"get",
"(",
"topic",
")",
";",
"if... | send a message to all and stream the result of each receiver back to sender
@param sender
@param topic
@param message
@param cb | [
"send",
"a",
"message",
"to",
"all",
"and",
"stream",
"the",
"result",
"of",
"each",
"receiver",
"back",
"to",
"sender"
] | train | https://github.com/RuedigerMoeller/kontraktor/blob/d5f3817f9476f3786187b8ef00400b7a4f25a404/examples/misc/pub-sub/tcp-based/src/main/java/pubsub/point2point/MediatorActor.java#L80-L96 |
maxirosson/jdroid-android | jdroid-android-google-inappbilling/src/main/java/com/jdroid/android/google/inappbilling/client/utils/Security.java | Security.verifyPurchase | public static boolean verifyPurchase(String base64PublicKey, String signedData, String signature) {
"""
Verifies that the data was signed with the given signature, and returns the verified purchase. The data is in
JSON format and signed with a private key.
@param base64PublicKey the base64-encoded public key t... | java | public static boolean verifyPurchase(String base64PublicKey, String signedData, String signature) {
if (TextUtils.isEmpty(signedData) || TextUtils.isEmpty(base64PublicKey) || TextUtils.isEmpty(signature)) {
LOGGER.error("Purchase verification failed: missing data.");
return false;
}
PublicKey key = Securit... | [
"public",
"static",
"boolean",
"verifyPurchase",
"(",
"String",
"base64PublicKey",
",",
"String",
"signedData",
",",
"String",
"signature",
")",
"{",
"if",
"(",
"TextUtils",
".",
"isEmpty",
"(",
"signedData",
")",
"||",
"TextUtils",
".",
"isEmpty",
"(",
"base6... | Verifies that the data was signed with the given signature, and returns the verified purchase. The data is in
JSON format and signed with a private key.
@param base64PublicKey the base64-encoded public key to use for verifying.
@param signedData the signed JSON string (signed, not encrypted)
@param signature the signa... | [
"Verifies",
"that",
"the",
"data",
"was",
"signed",
"with",
"the",
"given",
"signature",
"and",
"returns",
"the",
"verified",
"purchase",
".",
"The",
"data",
"is",
"in",
"JSON",
"format",
"and",
"signed",
"with",
"a",
"private",
"key",
"."
] | train | https://github.com/maxirosson/jdroid-android/blob/1ba9cae56a16fa36bdb2c9c04379853f0300707f/jdroid-android-google-inappbilling/src/main/java/com/jdroid/android/google/inappbilling/client/utils/Security.java#L50-L58 |
Blazebit/blaze-utils | blaze-common-utils/src/main/java/com/blazebit/reflection/ReflectionUtils.java | ReflectionUtils.getTypeVariablePosition | public static int getTypeVariablePosition(GenericDeclaration genericDeclartion, TypeVariable<?> typeVariable) {
"""
Tries to find the position of the given type variable in the type
parameters of the given class. This method iterates through the type
parameters of the given class and tries to find the given type... | java | public static int getTypeVariablePosition(GenericDeclaration genericDeclartion, TypeVariable<?> typeVariable) {
int position = -1;
TypeVariable<?>[] typeVariableDeclarationParameters = genericDeclartion
.getTypeParameters();
// Try to find the position of the type variable in th... | [
"public",
"static",
"int",
"getTypeVariablePosition",
"(",
"GenericDeclaration",
"genericDeclartion",
",",
"TypeVariable",
"<",
"?",
">",
"typeVariable",
")",
"{",
"int",
"position",
"=",
"-",
"1",
";",
"TypeVariable",
"<",
"?",
">",
"[",
"]",
"typeVariableDecla... | Tries to find the position of the given type variable in the type
parameters of the given class. This method iterates through the type
parameters of the given class and tries to find the given type variable
within the type parameters. When the type variable is found, the position
is returned, otherwise -1.
@param gene... | [
"Tries",
"to",
"find",
"the",
"position",
"of",
"the",
"given",
"type",
"variable",
"in",
"the",
"type",
"parameters",
"of",
"the",
"given",
"class",
".",
"This",
"method",
"iterates",
"through",
"the",
"type",
"parameters",
"of",
"the",
"given",
"class",
... | train | https://github.com/Blazebit/blaze-utils/blob/3e35a694a8f71d515aad066196acd523994d6aaa/blaze-common-utils/src/main/java/com/blazebit/reflection/ReflectionUtils.java#L494-L508 |
ButterFaces/ButterFaces | components/src/main/java/org/butterfaces/model/table/json/JsonToModelConverter.java | JsonToModelConverter.convertTableColumnVisibility | public TableColumnVisibility convertTableColumnVisibility(final String tableIdentifier, final String json) {
"""
Converts given json string to {@link TableColumnVisibility} used by {@link TableColumnVisibilityModel}.
@param tableIdentifier an application unique table identifier.
@param json string t... | java | public TableColumnVisibility convertTableColumnVisibility(final String tableIdentifier, final String json) {
final String[] split = this.splitColumns(json);
final List<String> visibleColumns = new ArrayList<>();
final List<String> invisibleColumns = new ArrayList<>();
for (String colum... | [
"public",
"TableColumnVisibility",
"convertTableColumnVisibility",
"(",
"final",
"String",
"tableIdentifier",
",",
"final",
"String",
"json",
")",
"{",
"final",
"String",
"[",
"]",
"split",
"=",
"this",
".",
"splitColumns",
"(",
"json",
")",
";",
"final",
"List"... | Converts given json string to {@link TableColumnVisibility} used by {@link TableColumnVisibilityModel}.
@param tableIdentifier an application unique table identifier.
@param json string to convert to {@link TableColumnVisibility}.
@return the converted {@link TableColumnVisibility}. | [
"Converts",
"given",
"json",
"string",
"to",
"{",
"@link",
"TableColumnVisibility",
"}",
"used",
"by",
"{",
"@link",
"TableColumnVisibilityModel",
"}",
"."
] | train | https://github.com/ButterFaces/ButterFaces/blob/e8c2bb340c89dcdbac409fcfc7a2a0e07f2462fc/components/src/main/java/org/butterfaces/model/table/json/JsonToModelConverter.java#L25-L44 |
facebook/fresco | imagepipeline-base/src/main/java/com/facebook/imagepipeline/cache/CountingLruMap.java | CountingLruMap.put | @Nullable
public synchronized V put(K key, V value) {
"""
Adds the element to the map, and removes the old element with the same key if any.
"""
// We do remove and insert instead of just replace, in order to cause a structural change
// to the map, as we always want the latest inserted element to be... | java | @Nullable
public synchronized V put(K key, V value) {
// We do remove and insert instead of just replace, in order to cause a structural change
// to the map, as we always want the latest inserted element to be last in the queue.
V oldValue = mMap.remove(key);
mSizeInBytes -= getValueSizeInBytes(oldVa... | [
"@",
"Nullable",
"public",
"synchronized",
"V",
"put",
"(",
"K",
"key",
",",
"V",
"value",
")",
"{",
"// We do remove and insert instead of just replace, in order to cause a structural change",
"// to the map, as we always want the latest inserted element to be last in the queue.",
"... | Adds the element to the map, and removes the old element with the same key if any. | [
"Adds",
"the",
"element",
"to",
"the",
"map",
"and",
"removes",
"the",
"old",
"element",
"with",
"the",
"same",
"key",
"if",
"any",
"."
] | train | https://github.com/facebook/fresco/blob/0b85879d51c5036d5e46e627a6651afefc0b971a/imagepipeline-base/src/main/java/com/facebook/imagepipeline/cache/CountingLruMap.java#L85-L94 |
JakeWharton/NineOldAndroids | library/src/com/nineoldandroids/view/ViewPropertyAnimatorHC.java | ViewPropertyAnimatorHC.setValue | private void setValue(int propertyConstant, float value) {
"""
This method handles setting the property values directly in the View object's fields.
propertyConstant tells it which property should be set, value is the value to set
the property to.
@param propertyConstant The property to be set
@param value T... | java | private void setValue(int propertyConstant, float value) {
//final View.TransformationInfo info = mView.mTransformationInfo;
View v = mView.get();
if (v != null) {
switch (propertyConstant) {
case TRANSLATION_X:
//info.mTranslationX = value;
... | [
"private",
"void",
"setValue",
"(",
"int",
"propertyConstant",
",",
"float",
"value",
")",
"{",
"//final View.TransformationInfo info = mView.mTransformationInfo;",
"View",
"v",
"=",
"mView",
".",
"get",
"(",
")",
";",
"if",
"(",
"v",
"!=",
"null",
")",
"{",
"... | This method handles setting the property values directly in the View object's fields.
propertyConstant tells it which property should be set, value is the value to set
the property to.
@param propertyConstant The property to be set
@param value The value to set the property to | [
"This",
"method",
"handles",
"setting",
"the",
"property",
"values",
"directly",
"in",
"the",
"View",
"object",
"s",
"fields",
".",
"propertyConstant",
"tells",
"it",
"which",
"property",
"should",
"be",
"set",
"value",
"is",
"the",
"value",
"to",
"set",
"th... | train | https://github.com/JakeWharton/NineOldAndroids/blob/d582f0ec8e79013e9fa96c07986160b52e662e63/library/src/com/nineoldandroids/view/ViewPropertyAnimatorHC.java#L534-L581 |
before/uadetector | modules/uadetector-core/src/main/java/net/sf/uadetector/internal/util/Closeables.java | Closeables.closeAndConvert | public static void closeAndConvert(@Nullable final Closeable closeable, final boolean swallowIOException) {
"""
Closes a {@link Closeable} and swallows an occurring {@link IOException} if argument {@code swallowIOException}
is {@code true}, otherwise the {@code IOException} will be converted into a runtime except... | java | public static void closeAndConvert(@Nullable final Closeable closeable, final boolean swallowIOException) {
if (closeable != null) {
try {
closeable.close();
} catch (final IOException e) {
if (!swallowIOException) {
throw new CannotCloseException(e.getLocalizedMessage(), e);
}
LOG.warn(e.g... | [
"public",
"static",
"void",
"closeAndConvert",
"(",
"@",
"Nullable",
"final",
"Closeable",
"closeable",
",",
"final",
"boolean",
"swallowIOException",
")",
"{",
"if",
"(",
"closeable",
"!=",
"null",
")",
"{",
"try",
"{",
"closeable",
".",
"close",
"(",
")",
... | Closes a {@link Closeable} and swallows an occurring {@link IOException} if argument {@code swallowIOException}
is {@code true}, otherwise the {@code IOException} will be converted into a runtime exception.
<p>
This method does nothing if a null reference is passed as {@code closeable}.
@param closeable
the {@code Clo... | [
"Closes",
"a",
"{",
"@link",
"Closeable",
"}",
"and",
"swallows",
"an",
"occurring",
"{",
"@link",
"IOException",
"}",
"if",
"argument",
"{",
"@code",
"swallowIOException",
"}",
"is",
"{",
"@code",
"true",
"}",
"otherwise",
"the",
"{",
"@code",
"IOException"... | train | https://github.com/before/uadetector/blob/215fb652723c52866572cff885f52a3fe67b9db5/modules/uadetector-core/src/main/java/net/sf/uadetector/internal/util/Closeables.java#L80-L91 |
Alluxio/alluxio | core/server/common/src/main/java/alluxio/master/journal/raft/RaftJournalSystem.java | RaftJournalSystem.catchUp | private void catchUp(JournalStateMachine stateMachine, CopycatClient client)
throws TimeoutException, InterruptedException {
"""
Attempts to catch up. If the master loses leadership during this method, it will return early.
The caller is responsible for detecting and responding to leadership changes.
... | java | private void catchUp(JournalStateMachine stateMachine, CopycatClient client)
throws TimeoutException, InterruptedException {
long startTime = System.currentTimeMillis();
// Wait for any outstanding snapshot to complete.
CommonUtils.waitFor("snapshotting to finish", () -> !stateMachine.isSnapshotting()... | [
"private",
"void",
"catchUp",
"(",
"JournalStateMachine",
"stateMachine",
",",
"CopycatClient",
"client",
")",
"throws",
"TimeoutException",
",",
"InterruptedException",
"{",
"long",
"startTime",
"=",
"System",
".",
"currentTimeMillis",
"(",
")",
";",
"// Wait for any... | Attempts to catch up. If the master loses leadership during this method, it will return early.
The caller is responsible for detecting and responding to leadership changes. | [
"Attempts",
"to",
"catch",
"up",
".",
"If",
"the",
"master",
"loses",
"leadership",
"during",
"this",
"method",
"it",
"will",
"return",
"early",
"."
] | train | https://github.com/Alluxio/alluxio/blob/af38cf3ab44613355b18217a3a4d961f8fec3a10/core/server/common/src/main/java/alluxio/master/journal/raft/RaftJournalSystem.java#L335-L397 |
jdereg/java-util | src/main/java/com/cedarsoftware/util/ReflectionUtils.java | ReflectionUtils.getClassAnnotation | public static Annotation getClassAnnotation(final Class classToCheck, final Class annoClass) {
"""
Determine if the passed in class (classToCheck) has the annotation (annoClass) on itself,
any of its super classes, any of it's interfaces, or any of it's super interfaces.
This is a exhaustive check throughout the... | java | public static Annotation getClassAnnotation(final Class classToCheck, final Class annoClass)
{
final Set<Class> visited = new HashSet<>();
final LinkedList<Class> stack = new LinkedList<>();
stack.add(classToCheck);
while (!stack.isEmpty())
{
Class classToChk = s... | [
"public",
"static",
"Annotation",
"getClassAnnotation",
"(",
"final",
"Class",
"classToCheck",
",",
"final",
"Class",
"annoClass",
")",
"{",
"final",
"Set",
"<",
"Class",
">",
"visited",
"=",
"new",
"HashSet",
"<>",
"(",
")",
";",
"final",
"LinkedList",
"<",... | Determine if the passed in class (classToCheck) has the annotation (annoClass) on itself,
any of its super classes, any of it's interfaces, or any of it's super interfaces.
This is a exhaustive check throughout the complete inheritance hierarchy.
@return the Annotation if found, null otherwise. | [
"Determine",
"if",
"the",
"passed",
"in",
"class",
"(",
"classToCheck",
")",
"has",
"the",
"annotation",
"(",
"annoClass",
")",
"on",
"itself",
"any",
"of",
"its",
"super",
"classes",
"any",
"of",
"it",
"s",
"interfaces",
"or",
"any",
"of",
"it",
"s",
... | train | https://github.com/jdereg/java-util/blob/a2dce61aed16d6454ee575174dda1ba6bff0015c/src/main/java/com/cedarsoftware/util/ReflectionUtils.java#L51-L74 |
sagiegurari/fax4j | src/main/java/org/fax4j/util/IOHelper.java | IOHelper.getFax4jInternalTemporaryDirectoryImpl | private static File getFax4jInternalTemporaryDirectoryImpl() {
"""
This function returns the fax4j library internal temporary directory.
@return The fax4j library internal temporary directory
"""
File temporaryFile=null;
try
{
//create temporary file
temporar... | java | private static File getFax4jInternalTemporaryDirectoryImpl()
{
File temporaryFile=null;
try
{
//create temporary file
temporaryFile=File.createTempFile("temp_",".temp");
}
catch(IOException exception)
{
throw new FaxException("Unabl... | [
"private",
"static",
"File",
"getFax4jInternalTemporaryDirectoryImpl",
"(",
")",
"{",
"File",
"temporaryFile",
"=",
"null",
";",
"try",
"{",
"//create temporary file",
"temporaryFile",
"=",
"File",
".",
"createTempFile",
"(",
"\"temp_\"",
",",
"\".temp\"",
")",
";",... | This function returns the fax4j library internal temporary directory.
@return The fax4j library internal temporary directory | [
"This",
"function",
"returns",
"the",
"fax4j",
"library",
"internal",
"temporary",
"directory",
"."
] | train | https://github.com/sagiegurari/fax4j/blob/42fa51acabe7bf279e27ab3dd1cf76146b27955f/src/main/java/org/fax4j/util/IOHelper.java#L61-L103 |
ManfredTremmel/gwt-commons-lang3 | src/main/java/org/apache/commons/lang3/builder/ToStringBuilder.java | ToStringBuilder.reflectionToString | @GwtIncompatible("incompatible method")
public static String reflectionToString(final Object object, final ToStringStyle style) {
"""
<p>Uses <code>ReflectionToStringBuilder</code> to generate a
<code>toString</code> for the specified object.</p>
@param object the Object to be output
@param style the st... | java | @GwtIncompatible("incompatible method")
public static String reflectionToString(final Object object, final ToStringStyle style) {
return ReflectionToStringBuilder.toString(object, style);
} | [
"@",
"GwtIncompatible",
"(",
"\"incompatible method\"",
")",
"public",
"static",
"String",
"reflectionToString",
"(",
"final",
"Object",
"object",
",",
"final",
"ToStringStyle",
"style",
")",
"{",
"return",
"ReflectionToStringBuilder",
".",
"toString",
"(",
"object",
... | <p>Uses <code>ReflectionToStringBuilder</code> to generate a
<code>toString</code> for the specified object.</p>
@param object the Object to be output
@param style the style of the <code>toString</code> to create, may be <code>null</code>
@return the String result
@see ReflectionToStringBuilder#toString(Object,ToStr... | [
"<p",
">",
"Uses",
"<code",
">",
"ReflectionToStringBuilder<",
"/",
"code",
">",
"to",
"generate",
"a",
"<code",
">",
"toString<",
"/",
"code",
">",
"for",
"the",
"specified",
"object",
".",
"<",
"/",
"p",
">"
] | train | https://github.com/ManfredTremmel/gwt-commons-lang3/blob/9e2dfbbda3668cfa5d935fe76479d1426c294504/src/main/java/org/apache/commons/lang3/builder/ToStringBuilder.java#L165-L168 |
alkacon/opencms-core | src/org/opencms/ade/containerpage/CmsContainerpageService.java | CmsContainerpageService.isModelPage | private boolean isModelPage(CmsObject cms, CmsResource containerPage) {
"""
Checks if a page is a model page.<p>
@param cms the CMS context to use
@param containerPage the page to check
@return true if the resource is a model page
"""
CmsADEConfigData config = getConfigData(containerPage.getRoo... | java | private boolean isModelPage(CmsObject cms, CmsResource containerPage) {
CmsADEConfigData config = getConfigData(containerPage.getRootPath());
for (CmsModelPageConfig modelConfig : config.getModelPages()) {
if (modelConfig.getResource().getStructureId().equals(containerPage.getStructureId())... | [
"private",
"boolean",
"isModelPage",
"(",
"CmsObject",
"cms",
",",
"CmsResource",
"containerPage",
")",
"{",
"CmsADEConfigData",
"config",
"=",
"getConfigData",
"(",
"containerPage",
".",
"getRootPath",
"(",
")",
")",
";",
"for",
"(",
"CmsModelPageConfig",
"modelC... | Checks if a page is a model page.<p>
@param cms the CMS context to use
@param containerPage the page to check
@return true if the resource is a model page | [
"Checks",
"if",
"a",
"page",
"is",
"a",
"model",
"page",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/ade/containerpage/CmsContainerpageService.java#L2758-L2767 |
google/error-prone-javac | src/jdk.javadoc/share/classes/com/sun/tools/doclets/internal/toolkit/builders/PackageSummaryBuilder.java | PackageSummaryBuilder.buildExceptionSummary | public void buildExceptionSummary(XMLNode node, Content summaryContentTree) {
"""
Build the summary for the exceptions in this package.
@param node the XML element that specifies which components to document
@param summaryContentTree the summary tree to which the exception summary will
be added
"""
... | java | public void buildExceptionSummary(XMLNode node, Content summaryContentTree) {
String exceptionTableSummary =
configuration.getText("doclet.Member_Table_Summary",
configuration.getText("doclet.Exception_Summary"),
configuration.getText("doclet.exceptions"));
... | [
"public",
"void",
"buildExceptionSummary",
"(",
"XMLNode",
"node",
",",
"Content",
"summaryContentTree",
")",
"{",
"String",
"exceptionTableSummary",
"=",
"configuration",
".",
"getText",
"(",
"\"doclet.Member_Table_Summary\"",
",",
"configuration",
".",
"getText",
"(",... | Build the summary for the exceptions in this package.
@param node the XML element that specifies which components to document
@param summaryContentTree the summary tree to which the exception summary will
be added | [
"Build",
"the",
"summary",
"for",
"the",
"exceptions",
"in",
"this",
"package",
"."
] | train | https://github.com/google/error-prone-javac/blob/a53d069bbdb2c60232ed3811c19b65e41c3e60e0/src/jdk.javadoc/share/classes/com/sun/tools/doclets/internal/toolkit/builders/PackageSummaryBuilder.java#L254-L275 |
googleapis/google-http-java-client | google-http-client/src/main/java/com/google/api/client/util/StringUtils.java | StringUtils.newStringUtf8 | public static String newStringUtf8(byte[] bytes) {
"""
Constructs a new <code>String</code> by decoding the specified array of bytes using the UTF-8
charset.
@param bytes The bytes to be decoded into characters
@return A new <code>String</code> decoded from the specified array of bytes using the UTF-8
charse... | java | public static String newStringUtf8(byte[] bytes) {
if (bytes == null) {
return null;
}
return new String(bytes, StandardCharsets.UTF_8);
} | [
"public",
"static",
"String",
"newStringUtf8",
"(",
"byte",
"[",
"]",
"bytes",
")",
"{",
"if",
"(",
"bytes",
"==",
"null",
")",
"{",
"return",
"null",
";",
"}",
"return",
"new",
"String",
"(",
"bytes",
",",
"StandardCharsets",
".",
"UTF_8",
")",
";",
... | Constructs a new <code>String</code> by decoding the specified array of bytes using the UTF-8
charset.
@param bytes The bytes to be decoded into characters
@return A new <code>String</code> decoded from the specified array of bytes using the UTF-8
charset, or <code>null</code> if the input byte array was <code>null</c... | [
"Constructs",
"a",
"new",
"<code",
">",
"String<",
"/",
"code",
">",
"by",
"decoding",
"the",
"specified",
"array",
"of",
"bytes",
"using",
"the",
"UTF",
"-",
"8",
"charset",
"."
] | train | https://github.com/googleapis/google-http-java-client/blob/0988ae4e0f26a80f579b6adb2b276dd8254928de/google-http-client/src/main/java/com/google/api/client/util/StringUtils.java#L65-L70 |
tumblr/jumblr | src/main/java/com/tumblr/jumblr/JumblrClient.java | JumblrClient.postCreate | public Long postCreate(String blogName, Map<String, ?> detail) throws IOException {
"""
Create a post
@param blogName The blog name for the post
@param detail the detail to save
@return Long the created post's id
@throws IOException if any file specified in detail cannot be read
"""
return requestB... | java | public Long postCreate(String blogName, Map<String, ?> detail) throws IOException {
return requestBuilder.postMultipart(JumblrClient.blogPath(blogName, "/post"), detail).getId();
} | [
"public",
"Long",
"postCreate",
"(",
"String",
"blogName",
",",
"Map",
"<",
"String",
",",
"?",
">",
"detail",
")",
"throws",
"IOException",
"{",
"return",
"requestBuilder",
".",
"postMultipart",
"(",
"JumblrClient",
".",
"blogPath",
"(",
"blogName",
",",
"\... | Create a post
@param blogName The blog name for the post
@param detail the detail to save
@return Long the created post's id
@throws IOException if any file specified in detail cannot be read | [
"Create",
"a",
"post"
] | train | https://github.com/tumblr/jumblr/blob/373629fd545defb016e227ea758f092507fbd624/src/main/java/com/tumblr/jumblr/JumblrClient.java#L384-L386 |
biojava/biojava | biojava-structure/src/main/java/org/biojava/nbio/structure/Calc.java | Calc.getDistanceFast | public static double getDistanceFast(Atom a, Atom b) {
"""
Will calculate the square of distances between two atoms. This will be
faster as it will not perform the final square root to get the actual
distance. Use this if doing large numbers of distance comparisons - it is
marginally faster than getDistance().
... | java | public static double getDistanceFast(Atom a, Atom b) {
double x = a.getX() - b.getX();
double y = a.getY() - b.getY();
double z = a.getZ() - b.getZ();
return x * x + y * y + z * z;
} | [
"public",
"static",
"double",
"getDistanceFast",
"(",
"Atom",
"a",
",",
"Atom",
"b",
")",
"{",
"double",
"x",
"=",
"a",
".",
"getX",
"(",
")",
"-",
"b",
".",
"getX",
"(",
")",
";",
"double",
"y",
"=",
"a",
".",
"getY",
"(",
")",
"-",
"b",
"."... | Will calculate the square of distances between two atoms. This will be
faster as it will not perform the final square root to get the actual
distance. Use this if doing large numbers of distance comparisons - it is
marginally faster than getDistance().
@param a
an Atom object
@param b
an Atom object
@return a double | [
"Will",
"calculate",
"the",
"square",
"of",
"distances",
"between",
"two",
"atoms",
".",
"This",
"will",
"be",
"faster",
"as",
"it",
"will",
"not",
"perform",
"the",
"final",
"square",
"root",
"to",
"get",
"the",
"actual",
"distance",
".",
"Use",
"this",
... | train | https://github.com/biojava/biojava/blob/a1c71a8e3d40cc32104b1d387a3d3b560b43356e/biojava-structure/src/main/java/org/biojava/nbio/structure/Calc.java#L90-L96 |
JRebirth/JRebirth | org.jrebirth.af/core/src/main/java/org/jrebirth/af/core/application/AbstractApplication.java | AbstractApplication.launchNow | protected static void launchNow(final Class<? extends Application> appClass, final String... args) {
"""
Launch the Given JavaFX Application (without any preloader).
@param appClass the JavaFX application class to launch
@param args arguments passed to java command line
"""
Application.launch(appCl... | java | protected static void launchNow(final Class<? extends Application> appClass, final String... args) {
Application.launch(appClass, args);
} | [
"protected",
"static",
"void",
"launchNow",
"(",
"final",
"Class",
"<",
"?",
"extends",
"Application",
">",
"appClass",
",",
"final",
"String",
"...",
"args",
")",
"{",
"Application",
".",
"launch",
"(",
"appClass",
",",
"args",
")",
";",
"}"
] | Launch the Given JavaFX Application (without any preloader).
@param appClass the JavaFX application class to launch
@param args arguments passed to java command line | [
"Launch",
"the",
"Given",
"JavaFX",
"Application",
"(",
"without",
"any",
"preloader",
")",
"."
] | train | https://github.com/JRebirth/JRebirth/blob/93f4fc087b83c73db540333b9686e97b4cec694d/org.jrebirth.af/core/src/main/java/org/jrebirth/af/core/application/AbstractApplication.java#L143-L145 |
Nexmo/nexmo-java | src/main/java/com/nexmo/client/voice/VoiceClient.java | VoiceClient.transferCall | public ModifyCallResponse transferCall(String uuid, String nccoUrl) throws IOException, NexmoClientException {
"""
Transfer a call to a different NCCO endpoint.
@param uuid The UUID of the call, obtained from the object returned by {@link #createCall(Call)}. This value can
be obtained with {@link CallEvent#... | java | public ModifyCallResponse transferCall(String uuid, String nccoUrl) throws IOException, NexmoClientException {
return this.modifyCall(CallModifier.transferCall(uuid, nccoUrl));
} | [
"public",
"ModifyCallResponse",
"transferCall",
"(",
"String",
"uuid",
",",
"String",
"nccoUrl",
")",
"throws",
"IOException",
",",
"NexmoClientException",
"{",
"return",
"this",
".",
"modifyCall",
"(",
"CallModifier",
".",
"transferCall",
"(",
"uuid",
",",
"nccoU... | Transfer a call to a different NCCO endpoint.
@param uuid The UUID of the call, obtained from the object returned by {@link #createCall(Call)}. This value can
be obtained with {@link CallEvent#getUuid()}
@param nccoUrl The URL of the NCCO endpoint the call should be transferred to
@return A ModifyCallResponse obje... | [
"Transfer",
"a",
"call",
"to",
"a",
"different",
"NCCO",
"endpoint",
"."
] | train | https://github.com/Nexmo/nexmo-java/blob/7427eff6d6baa5a5bd9197fa096bcf2564191cf5/src/main/java/com/nexmo/client/voice/VoiceClient.java#L188-L190 |
io7m/jcanephora | com.io7m.jcanephora.core/src/main/java/com/io7m/jcanephora/core/JCGLTextureUpdates.java | JCGLTextureUpdates.newUpdateReplacingAreaCube | public static JCGLTextureCubeUpdateType newUpdateReplacingAreaCube(
final JCGLTextureCubeUsableType t,
final AreaL update_area) {
"""
Create a new update that will replace the given {@code area} of {@code t}.
{@code area} must be included within the area of {@code t}.
@param t The texture
@p... | java | public static JCGLTextureCubeUpdateType newUpdateReplacingAreaCube(
final JCGLTextureCubeUsableType t,
final AreaL update_area)
{
NullCheck.notNull(t, "Texture");
NullCheck.notNull(update_area, "Area");
final AreaL texture_area = AreaSizesL.area(t.size());
if (!AreasL.contains(texture_area, u... | [
"public",
"static",
"JCGLTextureCubeUpdateType",
"newUpdateReplacingAreaCube",
"(",
"final",
"JCGLTextureCubeUsableType",
"t",
",",
"final",
"AreaL",
"update_area",
")",
"{",
"NullCheck",
".",
"notNull",
"(",
"t",
",",
"\"Texture\"",
")",
";",
"NullCheck",
".",
"not... | Create a new update that will replace the given {@code area} of {@code t}.
{@code area} must be included within the area of {@code t}.
@param t The texture
@param update_area The area that will be updated
@return A new update
@throws RangeCheckException Iff {@code area} is not included within {@code
t} | [
"Create",
"a",
"new",
"update",
"that",
"will",
"replace",
"the",
"given",
"{",
"@code",
"area",
"}",
"of",
"{",
"@code",
"t",
"}",
".",
"{",
"@code",
"area",
"}",
"must",
"be",
"included",
"within",
"the",
"area",
"of",
"{",
"@code",
"t",
"}",
"."... | train | https://github.com/io7m/jcanephora/blob/0004c1744b7f0969841d04cd4fa693f402b10980/com.io7m.jcanephora.core/src/main/java/com/io7m/jcanephora/core/JCGLTextureUpdates.java#L70-L99 |
alkacon/opencms-core | src-modules/org/opencms/workplace/CmsMultiDialog.java | CmsMultiDialog.checkMultiOperationException | public void checkMultiOperationException(I_CmsMessageBundle messages, String key) throws CmsException {
"""
Checks if an exception occurred during a multi resource operation, and throws a new exception if necessary.<p>
@param messages the message bundle to use for the exception message generation
@param key th... | java | public void checkMultiOperationException(I_CmsMessageBundle messages, String key) throws CmsException {
if (m_multiOperationException.hasExceptions()) {
m_multiOperationException.setMessage(
new CmsMessageContainer(messages, key, new Object[] {m_multiOperationException}));
... | [
"public",
"void",
"checkMultiOperationException",
"(",
"I_CmsMessageBundle",
"messages",
",",
"String",
"key",
")",
"throws",
"CmsException",
"{",
"if",
"(",
"m_multiOperationException",
".",
"hasExceptions",
"(",
")",
")",
"{",
"m_multiOperationException",
".",
"setM... | Checks if an exception occurred during a multi resource operation, and throws a new exception if necessary.<p>
@param messages the message bundle to use for the exception message generation
@param key the key for the exception to throw with one parameter
@throws CmsException the exception that is thrown when the multi... | [
"Checks",
"if",
"an",
"exception",
"occurred",
"during",
"a",
"multi",
"resource",
"operation",
"and",
"throws",
"a",
"new",
"exception",
"if",
"necessary",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src-modules/org/opencms/workplace/CmsMultiDialog.java#L192-L199 |
alkacon/opencms-core | src-gwt/org/opencms/ade/sitemap/client/alias/CmsAliasTableController.java | CmsAliasTableController.editAliasPath | public void editAliasPath(CmsAliasTableRow row, String path) {
"""
This method is called after the alias path of an alias has been edited.<p>
@param row the edited row
@param path the new alias path
"""
row.editAliasPath(path);
row.setEdited(true);
validate();
} | java | public void editAliasPath(CmsAliasTableRow row, String path) {
row.editAliasPath(path);
row.setEdited(true);
validate();
} | [
"public",
"void",
"editAliasPath",
"(",
"CmsAliasTableRow",
"row",
",",
"String",
"path",
")",
"{",
"row",
".",
"editAliasPath",
"(",
"path",
")",
";",
"row",
".",
"setEdited",
"(",
"true",
")",
";",
"validate",
"(",
")",
";",
"}"
] | This method is called after the alias path of an alias has been edited.<p>
@param row the edited row
@param path the new alias path | [
"This",
"method",
"is",
"called",
"after",
"the",
"alias",
"path",
"of",
"an",
"alias",
"has",
"been",
"edited",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src-gwt/org/opencms/ade/sitemap/client/alias/CmsAliasTableController.java#L166-L172 |
xmlunit/xmlunit | xmlunit-legacy/src/main/java/org/custommonkey/xmlunit/XMLAssert.java | XMLAssert.assertXMLNotEqual | public static void assertXMLNotEqual(InputSource control, InputSource test)
throws SAXException, IOException {
"""
Assert that two XML documents are NOT similar
@param control XML to be compared against
@param test XML to be tested
@throws SAXException
@throws IOException
"""
assertXMLNotEq... | java | public static void assertXMLNotEqual(InputSource control, InputSource test)
throws SAXException, IOException {
assertXMLNotEqual(null, control, test);
} | [
"public",
"static",
"void",
"assertXMLNotEqual",
"(",
"InputSource",
"control",
",",
"InputSource",
"test",
")",
"throws",
"SAXException",
",",
"IOException",
"{",
"assertXMLNotEqual",
"(",
"null",
",",
"control",
",",
"test",
")",
";",
"}"
] | Assert that two XML documents are NOT similar
@param control XML to be compared against
@param test XML to be tested
@throws SAXException
@throws IOException | [
"Assert",
"that",
"two",
"XML",
"documents",
"are",
"NOT",
"similar"
] | train | https://github.com/xmlunit/xmlunit/blob/fe3d701d43f57ee83dcba336e4c1555619d3084b/xmlunit-legacy/src/main/java/org/custommonkey/xmlunit/XMLAssert.java#L269-L272 |
jcuda/jcusolver | JCusolverJava/src/main/java/jcuda/jcusolver/JCusolverRf.java | JCusolverRf.cusolverRfResetValues | public static int cusolverRfResetValues(
int n,
int nnzA,
Pointer csrRowPtrA,
Pointer csrColIndA,
Pointer csrValA,
Pointer P,
Pointer Q,
/** Output */
cusolverRfHandle handle) {
"""
CUSOLVERRF update the matrix values (assuming... | java | public static int cusolverRfResetValues(
int n,
int nnzA,
Pointer csrRowPtrA,
Pointer csrColIndA,
Pointer csrValA,
Pointer P,
Pointer Q,
/** Output */
cusolverRfHandle handle)
{
return checkResult(cusolverRfResetValues... | [
"public",
"static",
"int",
"cusolverRfResetValues",
"(",
"int",
"n",
",",
"int",
"nnzA",
",",
"Pointer",
"csrRowPtrA",
",",
"Pointer",
"csrColIndA",
",",
"Pointer",
"csrValA",
",",
"Pointer",
"P",
",",
"Pointer",
"Q",
",",
"/** Output */",
"cusolverRfHandle",
... | CUSOLVERRF update the matrix values (assuming the reordering, pivoting
and consequently the sparsity pattern of L and U did not change),
and zero out the remaining values. | [
"CUSOLVERRF",
"update",
"the",
"matrix",
"values",
"(",
"assuming",
"the",
"reordering",
"pivoting",
"and",
"consequently",
"the",
"sparsity",
"pattern",
"of",
"L",
"and",
"U",
"did",
"not",
"change",
")",
"and",
"zero",
"out",
"the",
"remaining",
"values",
... | train | https://github.com/jcuda/jcusolver/blob/2600c7eca36a92a60ebcc78cae6e028e0c1d00b9/JCusolverJava/src/main/java/jcuda/jcusolver/JCusolverRf.java#L288-L300 |
lucee/Lucee | core/src/main/java/lucee/runtime/op/Caster.java | Caster.toFloat | public static Float toFloat(Object o, Float defaultValue) {
"""
cast a Object to a Float Object(reference type)
@param o Object to cast
@param defaultValue
@return casted Float Object
"""
if (o instanceof Float) return (Float) o;
if (defaultValue != null) return new Float(toFloatValue(o, defaultValue.fl... | java | public static Float toFloat(Object o, Float defaultValue) {
if (o instanceof Float) return (Float) o;
if (defaultValue != null) return new Float(toFloatValue(o, defaultValue.floatValue()));
float res = toFloatValue(o, Float.MIN_VALUE);
if (res == Float.MIN_VALUE) return defaultValue;
return new Float(res);
} | [
"public",
"static",
"Float",
"toFloat",
"(",
"Object",
"o",
",",
"Float",
"defaultValue",
")",
"{",
"if",
"(",
"o",
"instanceof",
"Float",
")",
"return",
"(",
"Float",
")",
"o",
";",
"if",
"(",
"defaultValue",
"!=",
"null",
")",
"return",
"new",
"Float... | cast a Object to a Float Object(reference type)
@param o Object to cast
@param defaultValue
@return casted Float Object | [
"cast",
"a",
"Object",
"to",
"a",
"Float",
"Object",
"(",
"reference",
"type",
")"
] | train | https://github.com/lucee/Lucee/blob/29b153fc4e126e5edb97da937f2ee2e231b87593/core/src/main/java/lucee/runtime/op/Caster.java#L1615-L1622 |
msgpack/msgpack-java | msgpack-core/src/main/java/org/msgpack/core/buffer/MessageBuffer.java | MessageBuffer.newMessageBuffer | private static MessageBuffer newMessageBuffer(byte[] arr, int off, int len) {
"""
Creates a new MessageBuffer instance backed by a java heap array
@param arr
@return
"""
checkNotNull(arr);
if (mbArrConstructor != null) {
return newInstance(mbArrConstructor, arr, off, len);
... | java | private static MessageBuffer newMessageBuffer(byte[] arr, int off, int len)
{
checkNotNull(arr);
if (mbArrConstructor != null) {
return newInstance(mbArrConstructor, arr, off, len);
}
return new MessageBuffer(arr, off, len);
} | [
"private",
"static",
"MessageBuffer",
"newMessageBuffer",
"(",
"byte",
"[",
"]",
"arr",
",",
"int",
"off",
",",
"int",
"len",
")",
"{",
"checkNotNull",
"(",
"arr",
")",
";",
"if",
"(",
"mbArrConstructor",
"!=",
"null",
")",
"{",
"return",
"newInstance",
... | Creates a new MessageBuffer instance backed by a java heap array
@param arr
@return | [
"Creates",
"a",
"new",
"MessageBuffer",
"instance",
"backed",
"by",
"a",
"java",
"heap",
"array"
] | train | https://github.com/msgpack/msgpack-java/blob/16e370e348215a72a14c210b42d448d513aee015/msgpack-core/src/main/java/org/msgpack/core/buffer/MessageBuffer.java#L273-L280 |
google/error-prone-javac | src/jdk.compiler/share/classes/com/sun/tools/javac/comp/Enter.java | Enter.classEnter | Type classEnter(JCTree tree, Env<AttrContext> env) {
"""
Visitor method: enter all classes in given tree, catching any
completion failure exceptions. Return the tree's type.
@param tree The tree to be visited.
@param env The environment visitor argument.
"""
Env<AttrContext> prevEnv = this.... | java | Type classEnter(JCTree tree, Env<AttrContext> env) {
Env<AttrContext> prevEnv = this.env;
try {
this.env = env;
annotate.blockAnnotations();
tree.accept(this);
return result;
} catch (CompletionFailure ex) {
return chk.completionError(... | [
"Type",
"classEnter",
"(",
"JCTree",
"tree",
",",
"Env",
"<",
"AttrContext",
">",
"env",
")",
"{",
"Env",
"<",
"AttrContext",
">",
"prevEnv",
"=",
"this",
".",
"env",
";",
"try",
"{",
"this",
".",
"env",
"=",
"env",
";",
"annotate",
".",
"blockAnnota... | Visitor method: enter all classes in given tree, catching any
completion failure exceptions. Return the tree's type.
@param tree The tree to be visited.
@param env The environment visitor argument. | [
"Visitor",
"method",
":",
"enter",
"all",
"classes",
"in",
"given",
"tree",
"catching",
"any",
"completion",
"failure",
"exceptions",
".",
"Return",
"the",
"tree",
"s",
"type",
"."
] | train | https://github.com/google/error-prone-javac/blob/a53d069bbdb2c60232ed3811c19b65e41c3e60e0/src/jdk.compiler/share/classes/com/sun/tools/javac/comp/Enter.java#L280-L293 |
ravendb/ravendb-jvm-client | src/main/java/net/ravendb/client/documents/subscriptions/DocumentSubscriptions.java | DocumentSubscriptions.getSubscriptionWorkerForRevisions | public <T> SubscriptionWorker<Revision<T>> getSubscriptionWorkerForRevisions(Class<T> clazz, String subscriptionName, String database) {
"""
It opens a subscription and starts pulling documents since a last processed document for that subscription.
The connection options determine client and server cooperation ru... | java | public <T> SubscriptionWorker<Revision<T>> getSubscriptionWorkerForRevisions(Class<T> clazz, String subscriptionName, String database) {
return getSubscriptionWorkerForRevisions(clazz, new SubscriptionWorkerOptions(subscriptionName), database);
} | [
"public",
"<",
"T",
">",
"SubscriptionWorker",
"<",
"Revision",
"<",
"T",
">",
">",
"getSubscriptionWorkerForRevisions",
"(",
"Class",
"<",
"T",
">",
"clazz",
",",
"String",
"subscriptionName",
",",
"String",
"database",
")",
"{",
"return",
"getSubscriptionWorke... | It opens a subscription and starts pulling documents since a last processed document for that subscription.
The connection options determine client and server cooperation rules like document batch sizes or a timeout in a matter of which a client
needs to acknowledge that batch has been processed. The acknowledgment is ... | [
"It",
"opens",
"a",
"subscription",
"and",
"starts",
"pulling",
"documents",
"since",
"a",
"last",
"processed",
"document",
"for",
"that",
"subscription",
".",
"The",
"connection",
"options",
"determine",
"client",
"and",
"server",
"cooperation",
"rules",
"like",
... | train | https://github.com/ravendb/ravendb-jvm-client/blob/5a45727de507b541d1571e79ddd97c7d88bee787/src/main/java/net/ravendb/client/documents/subscriptions/DocumentSubscriptions.java#L333-L335 |
m-m-m/util | sandbox/src/main/java/net/sf/mmm/util/path/base/AbstractPathFactory.java | AbstractPathFactory.registerProvider | public void registerProvider(PathProvider provider, String schemePrefix) throws DuplicateObjectException {
"""
This method registers the given {@link PathProvider}.
@param provider is the {@link PathProvider} to register.
@param schemePrefix is the {@link PathUri#getSchemePrefix() scheme-prefix} for which the ... | java | public void registerProvider(PathProvider provider, String schemePrefix) throws DuplicateObjectException {
getInitializationState().requireNotInitilized();
if (provider == null) {
throw new NlsNullPointerException("provider");
}
if (this.schema2providerMap.containsKey(schemePrefix)) {
throw... | [
"public",
"void",
"registerProvider",
"(",
"PathProvider",
"provider",
",",
"String",
"schemePrefix",
")",
"throws",
"DuplicateObjectException",
"{",
"getInitializationState",
"(",
")",
".",
"requireNotInitilized",
"(",
")",
";",
"if",
"(",
"provider",
"==",
"null",... | This method registers the given {@link PathProvider}.
@param provider is the {@link PathProvider} to register.
@param schemePrefix is the {@link PathUri#getSchemePrefix() scheme-prefix} for which the {@link PathProvider} shall
be registered.
@throws DuplicateObjectException if a {@link PathProvider} is already registe... | [
"This",
"method",
"registers",
"the",
"given",
"{",
"@link",
"PathProvider",
"}",
"."
] | train | https://github.com/m-m-m/util/blob/f0e4e084448f8dfc83ca682a9e1618034a094ce6/sandbox/src/main/java/net/sf/mmm/util/path/base/AbstractPathFactory.java#L74-L84 |
dkpro/dkpro-statistics | dkpro-statistics-agreement/src/main/java/org/dkpro/statistics/agreement/unitizing/UnitizingAnnotationStudy.java | UnitizingAnnotationStudy.findNextUnit | public static IUnitizingAnnotationUnit findNextUnit(
final Iterator<IUnitizingAnnotationUnit> units, final Object category) {
"""
Utility method for moving on the cursor of the given iterator until
a unit of the specified category is returned.
"""
return findNextUnit(units, -1, category);
} | java | public static IUnitizingAnnotationUnit findNextUnit(
final Iterator<IUnitizingAnnotationUnit> units, final Object category) {
return findNextUnit(units, -1, category);
} | [
"public",
"static",
"IUnitizingAnnotationUnit",
"findNextUnit",
"(",
"final",
"Iterator",
"<",
"IUnitizingAnnotationUnit",
">",
"units",
",",
"final",
"Object",
"category",
")",
"{",
"return",
"findNextUnit",
"(",
"units",
",",
"-",
"1",
",",
"category",
")",
";... | Utility method for moving on the cursor of the given iterator until
a unit of the specified category is returned. | [
"Utility",
"method",
"for",
"moving",
"on",
"the",
"cursor",
"of",
"the",
"given",
"iterator",
"until",
"a",
"unit",
"of",
"the",
"specified",
"category",
"is",
"returned",
"."
] | train | https://github.com/dkpro/dkpro-statistics/blob/0b0e93dc49223984964411cbc6df420ba796a8cb/dkpro-statistics-agreement/src/main/java/org/dkpro/statistics/agreement/unitizing/UnitizingAnnotationStudy.java#L127-L130 |
Breinify/brein-time-utilities | src/com/brein/time/utils/TimeUtils.java | TimeUtils.secondsToFullMinute | public static int secondsToFullMinute(final long now, final int offset) {
"""
Calculate the rest of seconds to a full minute, i.e. at 10:44:14 the method returns 46.
@param now the current time
@return the seconds until the full minute
"""
final int value = Long.valueOf(60 - ((now + offset) % 60)... | java | public static int secondsToFullMinute(final long now, final int offset) {
final int value = Long.valueOf(60 - ((now + offset) % 60)).intValue();
return value == 60 ? 0 : value;
} | [
"public",
"static",
"int",
"secondsToFullMinute",
"(",
"final",
"long",
"now",
",",
"final",
"int",
"offset",
")",
"{",
"final",
"int",
"value",
"=",
"Long",
".",
"valueOf",
"(",
"60",
"-",
"(",
"(",
"now",
"+",
"offset",
")",
"%",
"60",
")",
")",
... | Calculate the rest of seconds to a full minute, i.e. at 10:44:14 the method returns 46.
@param now the current time
@return the seconds until the full minute | [
"Calculate",
"the",
"rest",
"of",
"seconds",
"to",
"a",
"full",
"minute",
"i",
".",
"e",
".",
"at",
"10",
":",
"44",
":",
"14",
"the",
"method",
"returns",
"46",
"."
] | train | https://github.com/Breinify/brein-time-utilities/blob/ec0165a50ec1951ec7730b72c85c801c2018f314/src/com/brein/time/utils/TimeUtils.java#L87-L90 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.