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 |
|---|---|---|---|---|---|---|---|---|---|---|
phax/ph-commons | ph-commons/src/main/java/com/helger/commons/base64/Base64.java | Base64.safeDecodeAsString | @Nullable
public static String safeDecodeAsString (@Nullable final byte [] aEncodedBytes,
@Nonnegative final int nOfs,
@Nonnegative final int nLength,
@Nonnull final Charset aCharset) {
... | java | @Nullable
public static String safeDecodeAsString (@Nullable final byte [] aEncodedBytes,
@Nonnegative final int nOfs,
@Nonnegative final int nLength,
@Nonnull final Charset aCharset)
{
... | [
"@",
"Nullable",
"public",
"static",
"String",
"safeDecodeAsString",
"(",
"@",
"Nullable",
"final",
"byte",
"[",
"]",
"aEncodedBytes",
",",
"@",
"Nonnegative",
"final",
"int",
"nOfs",
",",
"@",
"Nonnegative",
"final",
"int",
"nLength",
",",
"@",
"Nonnull",
"... | Decode the byte array and convert it to a string.
@param aEncodedBytes
The encoded byte array.
@param nOfs
Offset into array
@param nLength
Number of bytes to decode.
@param aCharset
The character set to be used.
@return <code>null</code> if decoding failed. | [
"Decode",
"the",
"byte",
"array",
"and",
"convert",
"it",
"to",
"a",
"string",
"."
] | train | https://github.com/phax/ph-commons/blob/d28c03565f44a0b804d96028d0969f9bb38c4313/ph-commons/src/main/java/com/helger/commons/base64/Base64.java#L2711-L2729 |
phax/ph-oton | ph-oton-core/src/main/java/com/helger/photon/core/form/FormErrorList.java | FormErrorList.addFieldInfo | public void addFieldInfo (@Nonnull @Nonempty final String sFieldName, @Nonnull @Nonempty final String sText) {
"""
Add a field specific information message.
@param sFieldName
The field name for which the message is to be recorded. May neither
be <code>null</code> nor empty.
@param sText
The text to use. May... | java | public void addFieldInfo (@Nonnull @Nonempty final String sFieldName, @Nonnull @Nonempty final String sText)
{
add (SingleError.builderInfo ().setErrorFieldName (sFieldName).setErrorText (sText).build ());
} | [
"public",
"void",
"addFieldInfo",
"(",
"@",
"Nonnull",
"@",
"Nonempty",
"final",
"String",
"sFieldName",
",",
"@",
"Nonnull",
"@",
"Nonempty",
"final",
"String",
"sText",
")",
"{",
"add",
"(",
"SingleError",
".",
"builderInfo",
"(",
")",
".",
"setErrorFieldN... | Add a field specific information message.
@param sFieldName
The field name for which the message is to be recorded. May neither
be <code>null</code> nor empty.
@param sText
The text to use. May neither be <code>null</code> nor empty. | [
"Add",
"a",
"field",
"specific",
"information",
"message",
"."
] | train | https://github.com/phax/ph-oton/blob/f3aaacbbc02a9f3e4f32fe8db8e4adf7b9c1d3ef/ph-oton-core/src/main/java/com/helger/photon/core/form/FormErrorList.java#L52-L55 |
mapfish/mapfish-print | core/src/main/java/org/mapfish/print/processor/http/matcher/MatchInfo.java | MatchInfo.fromUri | public static MatchInfo fromUri(final URI uri, final HttpMethod method) {
"""
Create an info object from a uri and the http method object.
@param uri the uri
@param method the method
"""
int newPort = uri.getPort();
if (newPort < 0) {
try {
newPort = uri.toURL().... | java | public static MatchInfo fromUri(final URI uri, final HttpMethod method) {
int newPort = uri.getPort();
if (newPort < 0) {
try {
newPort = uri.toURL().getDefaultPort();
} catch (MalformedURLException | IllegalArgumentException e) {
newPort = ANY_POR... | [
"public",
"static",
"MatchInfo",
"fromUri",
"(",
"final",
"URI",
"uri",
",",
"final",
"HttpMethod",
"method",
")",
"{",
"int",
"newPort",
"=",
"uri",
".",
"getPort",
"(",
")",
";",
"if",
"(",
"newPort",
"<",
"0",
")",
"{",
"try",
"{",
"newPort",
"=",... | Create an info object from a uri and the http method object.
@param uri the uri
@param method the method | [
"Create",
"an",
"info",
"object",
"from",
"a",
"uri",
"and",
"the",
"http",
"method",
"object",
"."
] | train | https://github.com/mapfish/mapfish-print/blob/25a452cb39f592bd8a53b20db1037703898e1e22/core/src/main/java/org/mapfish/print/processor/http/matcher/MatchInfo.java#L95-L107 |
resilience4j/resilience4j | resilience4j-metrics/src/main/java/io/github/resilience4j/metrics/CircuitBreakerMetrics.java | CircuitBreakerMetrics.ofCircuitBreakerRegistry | public static CircuitBreakerMetrics ofCircuitBreakerRegistry(String prefix, CircuitBreakerRegistry circuitBreakerRegistry) {
"""
Creates a new instance CircuitBreakerMetrics {@link CircuitBreakerMetrics} with specified metrics names prefix and
a {@link CircuitBreakerRegistry} as a source.
@param prefix ... | java | public static CircuitBreakerMetrics ofCircuitBreakerRegistry(String prefix, CircuitBreakerRegistry circuitBreakerRegistry) {
return new CircuitBreakerMetrics(prefix, circuitBreakerRegistry.getAllCircuitBreakers());
} | [
"public",
"static",
"CircuitBreakerMetrics",
"ofCircuitBreakerRegistry",
"(",
"String",
"prefix",
",",
"CircuitBreakerRegistry",
"circuitBreakerRegistry",
")",
"{",
"return",
"new",
"CircuitBreakerMetrics",
"(",
"prefix",
",",
"circuitBreakerRegistry",
".",
"getAllCircuitBrea... | Creates a new instance CircuitBreakerMetrics {@link CircuitBreakerMetrics} with specified metrics names prefix and
a {@link CircuitBreakerRegistry} as a source.
@param prefix the prefix of metrics names
@param circuitBreakerRegistry the registry of circuit breakers | [
"Creates",
"a",
"new",
"instance",
"CircuitBreakerMetrics",
"{",
"@link",
"CircuitBreakerMetrics",
"}",
"with",
"specified",
"metrics",
"names",
"prefix",
"and",
"a",
"{",
"@link",
"CircuitBreakerRegistry",
"}",
"as",
"a",
"source",
"."
] | train | https://github.com/resilience4j/resilience4j/blob/fa843d30f531c00f0c3dc218b65a7f2bb51af336/resilience4j-metrics/src/main/java/io/github/resilience4j/metrics/CircuitBreakerMetrics.java#L77-L79 |
BrunoEberhard/minimal-j | src/main/java/org/minimalj/util/IdUtils.java | IdUtils.getId | public static Object getId(Object object) {
"""
Get the value of the <code>id</code> field. The id is converted to
'plain' if it is a ReadOnly id
@param object object containing the id. Must not be <code>null</code>
@return the value of the <code>id</code> field
"""
Objects.nonNull(object);
try {
F... | java | public static Object getId(Object object) {
Objects.nonNull(object);
try {
Field idField = getIdField(object.getClass());
if (idField == null) throw new IllegalArgumentException(object.getClass().getName() + " has no id field to get");
Object id = idField.get(object);
return id;
} catch (SecurityExcep... | [
"public",
"static",
"Object",
"getId",
"(",
"Object",
"object",
")",
"{",
"Objects",
".",
"nonNull",
"(",
"object",
")",
";",
"try",
"{",
"Field",
"idField",
"=",
"getIdField",
"(",
"object",
".",
"getClass",
"(",
")",
")",
";",
"if",
"(",
"idField",
... | Get the value of the <code>id</code> field. The id is converted to
'plain' if it is a ReadOnly id
@param object object containing the id. Must not be <code>null</code>
@return the value of the <code>id</code> field | [
"Get",
"the",
"value",
"of",
"the",
"<code",
">",
"id<",
"/",
"code",
">",
"field",
".",
"The",
"id",
"is",
"converted",
"to",
"plain",
"if",
"it",
"is",
"a",
"ReadOnly",
"id"
] | train | https://github.com/BrunoEberhard/minimal-j/blob/f7c5461b2b47a10b383aee1e2f1f150f6773703b/src/main/java/org/minimalj/util/IdUtils.java#L53-L63 |
camunda/camunda-bpm-platform | engine/src/main/java/org/camunda/bpm/container/impl/jmx/MBeanServiceContainer.java | MBeanServiceContainer.getServiceValue | public <S> S getServiceValue(ServiceType type, String localName) {
"""
get the service value for a specific service by name or null if no such
Service exists.
"""
String globalName = composeLocalName(type, localName);
ObjectName serviceName = getObjectName(globalName);
return getServiceValue(servi... | java | public <S> S getServiceValue(ServiceType type, String localName) {
String globalName = composeLocalName(type, localName);
ObjectName serviceName = getObjectName(globalName);
return getServiceValue(serviceName);
} | [
"public",
"<",
"S",
">",
"S",
"getServiceValue",
"(",
"ServiceType",
"type",
",",
"String",
"localName",
")",
"{",
"String",
"globalName",
"=",
"composeLocalName",
"(",
"type",
",",
"localName",
")",
";",
"ObjectName",
"serviceName",
"=",
"getObjectName",
"(",... | get the service value for a specific service by name or null if no such
Service exists. | [
"get",
"the",
"service",
"value",
"for",
"a",
"specific",
"service",
"by",
"name",
"or",
"null",
"if",
"no",
"such",
"Service",
"exists",
"."
] | train | https://github.com/camunda/camunda-bpm-platform/blob/1a464fc887ef3760e53d6f91b9e5b871a0d77cc0/engine/src/main/java/org/camunda/bpm/container/impl/jmx/MBeanServiceContainer.java#L209-L213 |
google/j2objc | jre_emul/android/platform/external/icu/android_icu4j/src/main/java/android/icu/text/DateTimePatternGenerator.java | DateTimePatternGenerator.replaceFieldTypes | public String replaceFieldTypes(String pattern, String skeleton) {
"""
Adjusts the field types (width and subtype) of a pattern to match what is
in a skeleton. That is, if you supply a pattern like "d-M H:m", and a
skeleton of "MMMMddhhmm", then the input pattern is adjusted to be
"dd-MMMM hh:mm". This is used ... | java | public String replaceFieldTypes(String pattern, String skeleton) {
return replaceFieldTypes(pattern, skeleton, MATCH_NO_OPTIONS);
} | [
"public",
"String",
"replaceFieldTypes",
"(",
"String",
"pattern",
",",
"String",
"skeleton",
")",
"{",
"return",
"replaceFieldTypes",
"(",
"pattern",
",",
"skeleton",
",",
"MATCH_NO_OPTIONS",
")",
";",
"}"
] | Adjusts the field types (width and subtype) of a pattern to match what is
in a skeleton. That is, if you supply a pattern like "d-M H:m", and a
skeleton of "MMMMddhhmm", then the input pattern is adjusted to be
"dd-MMMM hh:mm". This is used internally to get the best match for the
input skeleton, but can also be used e... | [
"Adjusts",
"the",
"field",
"types",
"(",
"width",
"and",
"subtype",
")",
"of",
"a",
"pattern",
"to",
"match",
"what",
"is",
"in",
"a",
"skeleton",
".",
"That",
"is",
"if",
"you",
"supply",
"a",
"pattern",
"like",
"d",
"-",
"M",
"H",
":",
"m",
"and"... | train | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/external/icu/android_icu4j/src/main/java/android/icu/text/DateTimePatternGenerator.java#L824-L826 |
cdk/cdk | tool/sdg/src/main/java/org/openscience/cdk/layout/LayoutRefiner.java | LayoutRefiner.getCommon | private static IAtom getCommon(IBond bndA, IBond bndB) {
"""
Access the common atom shared by two bonds.
@param bndA first bond
@param bndB second bond
@return common atom or null if non exists
"""
IAtom beg = bndA.getBegin();
IAtom end = bndA.getEnd();
if (bndB.contains(beg))
... | java | private static IAtom getCommon(IBond bndA, IBond bndB) {
IAtom beg = bndA.getBegin();
IAtom end = bndA.getEnd();
if (bndB.contains(beg))
return beg;
else if (bndB.contains(end))
return end;
else
return null;
} | [
"private",
"static",
"IAtom",
"getCommon",
"(",
"IBond",
"bndA",
",",
"IBond",
"bndB",
")",
"{",
"IAtom",
"beg",
"=",
"bndA",
".",
"getBegin",
"(",
")",
";",
"IAtom",
"end",
"=",
"bndA",
".",
"getEnd",
"(",
")",
";",
"if",
"(",
"bndB",
".",
"contai... | Access the common atom shared by two bonds.
@param bndA first bond
@param bndB second bond
@return common atom or null if non exists | [
"Access",
"the",
"common",
"atom",
"shared",
"by",
"two",
"bonds",
"."
] | train | https://github.com/cdk/cdk/blob/c3d0f16502bf08df50365fee392e11d7c9856657/tool/sdg/src/main/java/org/openscience/cdk/layout/LayoutRefiner.java#L1041-L1050 |
gallandarakhneorg/afc | advanced/gis/giscore/src/main/java/org/arakhne/afc/gis/coordinate/GISCoordinates.java | GISCoordinates.L2_EL2 | @Pure
public static Point2d L2_EL2(double x, double y) {
"""
This function convert France Lambert II coordinate to
extended France Lambert II coordinate.
@param x is the coordinate in France Lambert II
@param y is the coordinate in France Lambert II
@return the extended France Lambert II coordinate.
"""... | java | @Pure
public static Point2d L2_EL2(double x, double y) {
return new Point2d(x, y - (LAMBERT_2E_YS - LAMBERT_2_YS));
} | [
"@",
"Pure",
"public",
"static",
"Point2d",
"L2_EL2",
"(",
"double",
"x",
",",
"double",
"y",
")",
"{",
"return",
"new",
"Point2d",
"(",
"x",
",",
"y",
"-",
"(",
"LAMBERT_2E_YS",
"-",
"LAMBERT_2_YS",
")",
")",
";",
"}"
] | This function convert France Lambert II coordinate to
extended France Lambert II coordinate.
@param x is the coordinate in France Lambert II
@param y is the coordinate in France Lambert II
@return the extended France Lambert II coordinate. | [
"This",
"function",
"convert",
"France",
"Lambert",
"II",
"coordinate",
"to",
"extended",
"France",
"Lambert",
"II",
"coordinate",
"."
] | train | https://github.com/gallandarakhneorg/afc/blob/0c7d2e1ddefd4167ef788416d970a6c1ef6f8bbb/advanced/gis/giscore/src/main/java/org/arakhne/afc/gis/coordinate/GISCoordinates.java#L437-L440 |
casbin/jcasbin | src/main/java/org/casbin/jcasbin/util/BuiltInFunctions.java | BuiltInFunctions.keyMatch2 | public static boolean keyMatch2(String key1, String key2) {
"""
keyMatch2 determines whether key1 matches the pattern of key2 (similar to RESTful path), key2 can contain a *.
For example, "/foo/bar" matches "/foo/*", "/resource1" matches "/:resource"
@param key1 the first argument.
@param key2 the second argu... | java | public static boolean keyMatch2(String key1, String key2) {
key2 = key2.replace("/*", "/.*");
Pattern p = Pattern.compile("(.*):[^/]+(.*)");
while (true) {
if (!key2.contains("/:")) {
break;
}
key2 = "^" + p.matcher(key2).replaceAll("$1[^/]+$... | [
"public",
"static",
"boolean",
"keyMatch2",
"(",
"String",
"key1",
",",
"String",
"key2",
")",
"{",
"key2",
"=",
"key2",
".",
"replace",
"(",
"\"/*\"",
",",
"\"/.*\"",
")",
";",
"Pattern",
"p",
"=",
"Pattern",
".",
"compile",
"(",
"\"(.*):[^/]+(.*)\"",
"... | keyMatch2 determines whether key1 matches the pattern of key2 (similar to RESTful path), key2 can contain a *.
For example, "/foo/bar" matches "/foo/*", "/resource1" matches "/:resource"
@param key1 the first argument.
@param key2 the second argument.
@return whether key1 matches key2. | [
"keyMatch2",
"determines",
"whether",
"key1",
"matches",
"the",
"pattern",
"of",
"key2",
"(",
"similar",
"to",
"RESTful",
"path",
")",
"key2",
"can",
"contain",
"a",
"*",
".",
"For",
"example",
"/",
"foo",
"/",
"bar",
"matches",
"/",
"foo",
"/",
"*",
"... | train | https://github.com/casbin/jcasbin/blob/b46d7a756b6c39cdb17e0600607e5fcdc66edd11/src/main/java/org/casbin/jcasbin/util/BuiltInFunctions.java#L59-L72 |
aws/aws-sdk-java | aws-java-sdk-elastictranscoder/src/main/java/com/amazonaws/services/elastictranscoder/model/Job.java | Job.withUserMetadata | public Job withUserMetadata(java.util.Map<String, String> userMetadata) {
"""
<p>
User-defined metadata that you want to associate with an Elastic Transcoder job. You specify metadata in
<code>key/value</code> pairs, and you can add up to 10 <code>key/value</code> pairs per job. Elastic Transcoder
does not guar... | java | public Job withUserMetadata(java.util.Map<String, String> userMetadata) {
setUserMetadata(userMetadata);
return this;
} | [
"public",
"Job",
"withUserMetadata",
"(",
"java",
".",
"util",
".",
"Map",
"<",
"String",
",",
"String",
">",
"userMetadata",
")",
"{",
"setUserMetadata",
"(",
"userMetadata",
")",
";",
"return",
"this",
";",
"}"
] | <p>
User-defined metadata that you want to associate with an Elastic Transcoder job. You specify metadata in
<code>key/value</code> pairs, and you can add up to 10 <code>key/value</code> pairs per job. Elastic Transcoder
does not guarantee that <code>key/value</code> pairs are returned in the same order in which you sp... | [
"<p",
">",
"User",
"-",
"defined",
"metadata",
"that",
"you",
"want",
"to",
"associate",
"with",
"an",
"Elastic",
"Transcoder",
"job",
".",
"You",
"specify",
"metadata",
"in",
"<code",
">",
"key",
"/",
"value<",
"/",
"code",
">",
"pairs",
"and",
"you",
... | train | https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-elastictranscoder/src/main/java/com/amazonaws/services/elastictranscoder/model/Job.java#L1094-L1097 |
fhoeben/hsac-fitnesse-fixtures | src/main/java/nl/hsac/fitnesse/fixture/util/FirstNonNullHelper.java | FirstNonNullHelper.firstNonNull | public static <T, R> R firstNonNull(Function<T, R> function, Supplier<Collection<T>>... suppliers) {
"""
Gets first result of function which is not null.
@param <T> type of values.
@param <R> element to return.
@param function function to apply to each value.
@param suppliers all possible suppli... | java | public static <T, R> R firstNonNull(Function<T, R> function, Supplier<Collection<T>>... suppliers) {
Stream<Supplier<R>> resultStream = Stream.of(suppliers)
.map(s -> (() -> firstNonNull(function, s.get())));
return firstNonNull(Supplier::get, resul... | [
"public",
"static",
"<",
"T",
",",
"R",
">",
"R",
"firstNonNull",
"(",
"Function",
"<",
"T",
",",
"R",
">",
"function",
",",
"Supplier",
"<",
"Collection",
"<",
"T",
">",
">",
"...",
"suppliers",
")",
"{",
"Stream",
"<",
"Supplier",
"<",
"R",
">>",... | Gets first result of function which is not null.
@param <T> type of values.
@param <R> element to return.
@param function function to apply to each value.
@param suppliers all possible suppliers that might be able to supply a value.
@return first result which was not null,
OR <code>null</code> if result f... | [
"Gets",
"first",
"result",
"of",
"function",
"which",
"is",
"not",
"null",
"."
] | train | https://github.com/fhoeben/hsac-fitnesse-fixtures/blob/4e9018d7386a9aa65bfcbf07eb28ae064edd1732/src/main/java/nl/hsac/fitnesse/fixture/util/FirstNonNullHelper.java#L64-L68 |
arakelian/more-commons | src/main/java/com/arakelian/core/utils/XmlStreamReaderUtils.java | XmlStreamReaderUtils.optionalIntAttribute | public static int optionalIntAttribute(
final XMLStreamReader reader,
final String localName,
final int defaultValue) {
"""
Returns the value of an attribute as a int. If the attribute is empty, this method returns
the default value provided.
@param reader
<code>XMLStreamRe... | java | public static int optionalIntAttribute(
final XMLStreamReader reader,
final String localName,
final int defaultValue) {
return optionalIntAttribute(reader, null, localName, defaultValue);
} | [
"public",
"static",
"int",
"optionalIntAttribute",
"(",
"final",
"XMLStreamReader",
"reader",
",",
"final",
"String",
"localName",
",",
"final",
"int",
"defaultValue",
")",
"{",
"return",
"optionalIntAttribute",
"(",
"reader",
",",
"null",
",",
"localName",
",",
... | Returns the value of an attribute as a int. If the attribute is empty, this method returns
the default value provided.
@param reader
<code>XMLStreamReader</code> that contains attribute values.
@param localName
local name of attribute (the namespace is ignored).
@param defaultValue
default value
@return value of attri... | [
"Returns",
"the",
"value",
"of",
"an",
"attribute",
"as",
"a",
"int",
".",
"If",
"the",
"attribute",
"is",
"empty",
"this",
"method",
"returns",
"the",
"default",
"value",
"provided",
"."
] | train | https://github.com/arakelian/more-commons/blob/83c607044f64a7f6c005a67866c0ef7cb68d6e29/src/main/java/com/arakelian/core/utils/XmlStreamReaderUtils.java#L797-L802 |
Ordinastie/MalisisCore | src/main/java/net/malisis/core/client/gui/element/position/Positions.java | Positions.centeredTo | public static <T extends IPositioned & ISized> IntSupplier centeredTo(ISized owner, T other, int offset) {
"""
Centers the owner to the other.
@param <T> the generic type
@param other the other
@param offset the offset
@return the int supplier
"""
checkNotNull(other);
return () -> {
return other.p... | java | public static <T extends IPositioned & ISized> IntSupplier centeredTo(ISized owner, T other, int offset)
{
checkNotNull(other);
return () -> {
return other.position().x() + (other.size().width() - owner.size().width()) / 2 + offset;
};
} | [
"public",
"static",
"<",
"T",
"extends",
"IPositioned",
"&",
"ISized",
">",
"IntSupplier",
"centeredTo",
"(",
"ISized",
"owner",
",",
"T",
"other",
",",
"int",
"offset",
")",
"{",
"checkNotNull",
"(",
"other",
")",
";",
"return",
"(",
")",
"->",
"{",
"... | Centers the owner to the other.
@param <T> the generic type
@param other the other
@param offset the offset
@return the int supplier | [
"Centers",
"the",
"owner",
"to",
"the",
"other",
"."
] | train | https://github.com/Ordinastie/MalisisCore/blob/4f8e1fa462d5c372fc23414482ba9f429881cc54/src/main/java/net/malisis/core/client/gui/element/position/Positions.java#L257-L263 |
apache/flink | flink-core/src/main/java/org/apache/flink/api/common/io/FileOutputFormat.java | FileOutputFormat.initializeGlobal | @Override
public void initializeGlobal(int parallelism) throws IOException {
"""
Initialization of the distributed file system if it is used.
@param parallelism The task parallelism.
"""
final Path path = getOutputFilePath();
final FileSystem fs = path.getFileSystem();
// only distributed file sys... | java | @Override
public void initializeGlobal(int parallelism) throws IOException {
final Path path = getOutputFilePath();
final FileSystem fs = path.getFileSystem();
// only distributed file systems can be initialized at start-up time.
if (fs.isDistributedFS()) {
final WriteMode writeMode = getWriteMode();... | [
"@",
"Override",
"public",
"void",
"initializeGlobal",
"(",
"int",
"parallelism",
")",
"throws",
"IOException",
"{",
"final",
"Path",
"path",
"=",
"getOutputFilePath",
"(",
")",
";",
"final",
"FileSystem",
"fs",
"=",
"path",
".",
"getFileSystem",
"(",
")",
"... | Initialization of the distributed file system if it is used.
@param parallelism The task parallelism. | [
"Initialization",
"of",
"the",
"distributed",
"file",
"system",
"if",
"it",
"is",
"used",
"."
] | train | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-core/src/main/java/org/apache/flink/api/common/io/FileOutputFormat.java#L272-L300 |
moparisthebest/beehive | beehive-netui-core/src/main/java/org/apache/beehive/netui/pageflow/AutoRegisterActionServlet.java | AutoRegisterActionServlet.getModuleConfig | protected ModuleConfig getModuleConfig( String modulePath, ServletRequest request, ServletResponse response )
throws IOException, ServletException {
"""
Get the Struts ModuleConfig for the given module path.
@deprecated Use {@link #ensureModuleRegistered} instead.
@param modulePath the module path, fro... | java | protected ModuleConfig getModuleConfig( String modulePath, ServletRequest request, ServletResponse response )
throws IOException, ServletException
{
return ensureModuleRegistered(modulePath);
} | [
"protected",
"ModuleConfig",
"getModuleConfig",
"(",
"String",
"modulePath",
",",
"ServletRequest",
"request",
",",
"ServletResponse",
"response",
")",
"throws",
"IOException",
",",
"ServletException",
"{",
"return",
"ensureModuleRegistered",
"(",
"modulePath",
")",
";"... | Get the Struts ModuleConfig for the given module path.
@deprecated Use {@link #ensureModuleRegistered} instead.
@param modulePath the module path, from the request URI.
@param request the current ServletRequest
@param response the current HttpServletResponse
@return the Struts ModuleConfig that corresponds with <code>... | [
"Get",
"the",
"Struts",
"ModuleConfig",
"for",
"the",
"given",
"module",
"path",
".",
"@deprecated",
"Use",
"{",
"@link",
"#ensureModuleRegistered",
"}",
"instead",
"."
] | train | https://github.com/moparisthebest/beehive/blob/4246a0cc40ce3c05f1a02c2da2653ac622703d77/beehive-netui-core/src/main/java/org/apache/beehive/netui/pageflow/AutoRegisterActionServlet.java#L724-L728 |
spotbugs/spotbugs | eclipsePlugin/src/de/tobject/findbugs/builder/FindBugsWorker.java | FindBugsWorker.toFilterPath | public static IPath toFilterPath(String filePath, IProject project) {
"""
Checks the given absolute path and convert it to relative path if it is
relative to the given project or workspace. This representation can be
used to store filter paths in user preferences file
@param filePath
absolute OS file path
@... | java | public static IPath toFilterPath(String filePath, IProject project) {
IPath path = new Path(filePath);
IPath commonPath;
if (project != null) {
commonPath = project.getLocation();
IPath relativePath = getRelativePath(path, commonPath);
if (!relativePath.equals... | [
"public",
"static",
"IPath",
"toFilterPath",
"(",
"String",
"filePath",
",",
"IProject",
"project",
")",
"{",
"IPath",
"path",
"=",
"new",
"Path",
"(",
"filePath",
")",
";",
"IPath",
"commonPath",
";",
"if",
"(",
"project",
"!=",
"null",
")",
"{",
"commo... | Checks the given absolute path and convert it to relative path if it is
relative to the given project or workspace. This representation can be
used to store filter paths in user preferences file
@param filePath
absolute OS file path
@param project
might be null
@return filter file path as stored in preferences which m... | [
"Checks",
"the",
"given",
"absolute",
"path",
"and",
"convert",
"it",
"to",
"relative",
"path",
"if",
"it",
"is",
"relative",
"to",
"the",
"given",
"project",
"or",
"workspace",
".",
"This",
"representation",
"can",
"be",
"used",
"to",
"store",
"filter",
"... | train | https://github.com/spotbugs/spotbugs/blob/f6365c6eea6515035bded38efa4a7c8b46ccf28c/eclipsePlugin/src/de/tobject/findbugs/builder/FindBugsWorker.java#L441-L453 |
spring-cloud/spring-cloud-contract | spring-cloud-contract-stub-runner/src/main/java/org/springframework/cloud/contract/stubrunner/util/ZipCategory.java | ZipCategory.unzipTo | public static Collection<File> unzipTo(File self, File destination) {
"""
Unzips this file. If the <tt>destination</tt> directory is not provided, it will
fall back to this file's parent directory.
@param self file
@param destination (optional), the destination directory where this file's content
will be unzip... | java | public static Collection<File> unzipTo(File self, File destination) {
checkUnzipDestination(destination);
// if destination directory is not given, we'll fall back to the parent directory
// of 'self'
if (destination == null) {
destination = new File(self.getParent());
}
List<File> unzippedFiles = new Ar... | [
"public",
"static",
"Collection",
"<",
"File",
">",
"unzipTo",
"(",
"File",
"self",
",",
"File",
"destination",
")",
"{",
"checkUnzipDestination",
"(",
"destination",
")",
";",
"// if destination directory is not given, we'll fall back to the parent directory",
"// of 'self... | Unzips this file. If the <tt>destination</tt> directory is not provided, it will
fall back to this file's parent directory.
@param self file
@param destination (optional), the destination directory where this file's content
will be unzipped to.
@return a {@link Collection} of unzipped {@link File} objects. | [
"Unzips",
"this",
"file",
".",
"If",
"the",
"<tt",
">",
"destination<",
"/",
"tt",
">",
"directory",
"is",
"not",
"provided",
"it",
"will",
"fall",
"back",
"to",
"this",
"file",
"s",
"parent",
"directory",
"."
] | train | https://github.com/spring-cloud/spring-cloud-contract/blob/857da51950a87b393286e3bb1b2208c420c01087/spring-cloud-contract-stub-runner/src/main/java/org/springframework/cloud/contract/stubrunner/util/ZipCategory.java#L56-L90 |
iipc/openwayback-access-control | oracle/src/main/java/org/archive/accesscontrol/oracle/RulesController.java | RulesController.getRule | public ModelAndView getRule(long id) {
"""
GET /rules/:id
Retrieves the rule with the given id.
@param id
@return
"""
Rule rule = ruleDao.getRule(id);
if (rule == null) {
return new ModelAndView(view, "object", new SimpleError("Rule "
+ id + " does not ex... | java | public ModelAndView getRule(long id) {
Rule rule = ruleDao.getRule(id);
if (rule == null) {
return new ModelAndView(view, "object", new SimpleError("Rule "
+ id + " does not exist.", 404));
}
return new ModelAndView(view, "object", rule);
} | [
"public",
"ModelAndView",
"getRule",
"(",
"long",
"id",
")",
"{",
"Rule",
"rule",
"=",
"ruleDao",
".",
"getRule",
"(",
"id",
")",
";",
"if",
"(",
"rule",
"==",
"null",
")",
"{",
"return",
"new",
"ModelAndView",
"(",
"view",
",",
"\"object\"",
",",
"n... | GET /rules/:id
Retrieves the rule with the given id.
@param id
@return | [
"GET",
"/",
"rules",
"/",
":",
"id"
] | train | https://github.com/iipc/openwayback-access-control/blob/4a0f70f200fd8d7b6e313624b7628656d834bf31/oracle/src/main/java/org/archive/accesscontrol/oracle/RulesController.java#L46-L55 |
alkacon/opencms-core | src/org/opencms/cmis/A_CmsCmisRepository.java | A_CmsCmisRepository.getAcePrincipalName | protected String getAcePrincipalName(CmsObject cms, CmsUUID principalId) {
"""
Gets a user-readable name for a principal id read from an ACE.<p>
@param cms the current CMS context
@param principalId the principal id from the ACE
@return the name of the principle
"""
if (CmsAccessControlEntry.PR... | java | protected String getAcePrincipalName(CmsObject cms, CmsUUID principalId) {
if (CmsAccessControlEntry.PRINCIPAL_ALL_OTHERS_ID.equals(principalId)) {
return CmsAccessControlEntry.PRINCIPAL_ALL_OTHERS_NAME;
}
if (CmsAccessControlEntry.PRINCIPAL_OVERWRITE_ALL_ID.equals(principalId)... | [
"protected",
"String",
"getAcePrincipalName",
"(",
"CmsObject",
"cms",
",",
"CmsUUID",
"principalId",
")",
"{",
"if",
"(",
"CmsAccessControlEntry",
".",
"PRINCIPAL_ALL_OTHERS_ID",
".",
"equals",
"(",
"principalId",
")",
")",
"{",
"return",
"CmsAccessControlEntry",
"... | Gets a user-readable name for a principal id read from an ACE.<p>
@param cms the current CMS context
@param principalId the principal id from the ACE
@return the name of the principle | [
"Gets",
"a",
"user",
"-",
"readable",
"name",
"for",
"a",
"principal",
"id",
"read",
"from",
"an",
"ACE",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/cmis/A_CmsCmisRepository.java#L311-L328 |
UrielCh/ovh-java-sdk | ovh-java-sdk-cloud/src/main/java/net/minidev/ovh/api/ApiOvhCloud.java | ApiOvhCloud.project_serviceName_instance_group_POST | public OvhInstanceGroup project_serviceName_instance_group_POST(String serviceName, String name, String region, OvhInstanceGroupTypeEnum type) throws IOException {
"""
Create a group
REST: POST /cloud/project/{serviceName}/instance/group
@param name [required] instance group name
@param region [required] Inst... | java | public OvhInstanceGroup project_serviceName_instance_group_POST(String serviceName, String name, String region, OvhInstanceGroupTypeEnum type) throws IOException {
String qPath = "/cloud/project/{serviceName}/instance/group";
StringBuilder sb = path(qPath, serviceName);
HashMap<String, Object>o = new HashMap<Stri... | [
"public",
"OvhInstanceGroup",
"project_serviceName_instance_group_POST",
"(",
"String",
"serviceName",
",",
"String",
"name",
",",
"String",
"region",
",",
"OvhInstanceGroupTypeEnum",
"type",
")",
"throws",
"IOException",
"{",
"String",
"qPath",
"=",
"\"/cloud/project/{se... | Create a group
REST: POST /cloud/project/{serviceName}/instance/group
@param name [required] instance group name
@param region [required] Instance region
@param serviceName [required] Project name
@param type [required] Instance group type | [
"Create",
"a",
"group"
] | train | https://github.com/UrielCh/ovh-java-sdk/blob/6d531a40e56e09701943e334c25f90f640c55701/ovh-java-sdk-cloud/src/main/java/net/minidev/ovh/api/ApiOvhCloud.java#L2134-L2143 |
aws/aws-sdk-java | aws-java-sdk-backup/src/main/java/com/amazonaws/services/backup/model/CreateBackupVaultRequest.java | CreateBackupVaultRequest.withBackupVaultTags | public CreateBackupVaultRequest withBackupVaultTags(java.util.Map<String, String> backupVaultTags) {
"""
<p>
Metadata that you can assign to help organize the resources that you create. Each tag is a key-value pair.
</p>
@param backupVaultTags
Metadata that you can assign to help organize the resources that ... | java | public CreateBackupVaultRequest withBackupVaultTags(java.util.Map<String, String> backupVaultTags) {
setBackupVaultTags(backupVaultTags);
return this;
} | [
"public",
"CreateBackupVaultRequest",
"withBackupVaultTags",
"(",
"java",
".",
"util",
".",
"Map",
"<",
"String",
",",
"String",
">",
"backupVaultTags",
")",
"{",
"setBackupVaultTags",
"(",
"backupVaultTags",
")",
";",
"return",
"this",
";",
"}"
] | <p>
Metadata that you can assign to help organize the resources that you create. Each tag is a key-value pair.
</p>
@param backupVaultTags
Metadata that you can assign to help organize the resources that you create. Each tag is a key-value pair.
@return Returns a reference to this object so that method calls can be ch... | [
"<p",
">",
"Metadata",
"that",
"you",
"can",
"assign",
"to",
"help",
"organize",
"the",
"resources",
"that",
"you",
"create",
".",
"Each",
"tag",
"is",
"a",
"key",
"-",
"value",
"pair",
".",
"<",
"/",
"p",
">"
] | train | https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-backup/src/main/java/com/amazonaws/services/backup/model/CreateBackupVaultRequest.java#L145-L148 |
alkacon/opencms-core | src-gwt/org/opencms/gwt/client/ui/input/form/CmsForm.java | CmsForm.updateFieldValidationStatus | protected void updateFieldValidationStatus(I_CmsFormField field, CmsValidationResult result) {
"""
Updates the field validation status.<p>
@param field the form field
@param result the validation result
"""
if (result.hasNewValue()) {
if (field.getModel() != null) {
fie... | java | protected void updateFieldValidationStatus(I_CmsFormField field, CmsValidationResult result) {
if (result.hasNewValue()) {
if (field.getModel() != null) {
field.getModel().setValue(result.getNewValue(), true);
}
field.getWidget().setFormValueAsString(result.g... | [
"protected",
"void",
"updateFieldValidationStatus",
"(",
"I_CmsFormField",
"field",
",",
"CmsValidationResult",
"result",
")",
"{",
"if",
"(",
"result",
".",
"hasNewValue",
"(",
")",
")",
"{",
"if",
"(",
"field",
".",
"getModel",
"(",
")",
"!=",
"null",
")",... | Updates the field validation status.<p>
@param field the form field
@param result the validation result | [
"Updates",
"the",
"field",
"validation",
"status",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src-gwt/org/opencms/gwt/client/ui/input/form/CmsForm.java#L500-L512 |
spring-projects/spring-retry | src/main/java/org/springframework/retry/support/RetryTemplate.java | RetryTemplate.wrapIfNecessary | private static <E extends Throwable> E wrapIfNecessary(Throwable throwable)
throws RetryException {
"""
Re-throws the original throwable if it is an Exception, and wraps non-exceptions
into {@link RetryException}.
"""
if (throwable instanceof Error) {
throw (Error) throwable;
}
else if (throwable ... | java | private static <E extends Throwable> E wrapIfNecessary(Throwable throwable)
throws RetryException {
if (throwable instanceof Error) {
throw (Error) throwable;
}
else if (throwable instanceof Exception) {
@SuppressWarnings("unchecked")
E rethrow = (E) throwable;
return rethrow;
}
else {
throw... | [
"private",
"static",
"<",
"E",
"extends",
"Throwable",
">",
"E",
"wrapIfNecessary",
"(",
"Throwable",
"throwable",
")",
"throws",
"RetryException",
"{",
"if",
"(",
"throwable",
"instanceof",
"Error",
")",
"{",
"throw",
"(",
"Error",
")",
"throwable",
";",
"}... | Re-throws the original throwable if it is an Exception, and wraps non-exceptions
into {@link RetryException}. | [
"Re",
"-",
"throws",
"the",
"original",
"throwable",
"if",
"it",
"is",
"an",
"Exception",
"and",
"wraps",
"non",
"-",
"exceptions",
"into",
"{"
] | train | https://github.com/spring-projects/spring-retry/blob/e2b0555f96594c2321990d0deeac45fc44d4f123/src/main/java/org/springframework/retry/support/RetryTemplate.java#L600-L613 |
ixa-ehu/ixa-pipe-nerc | src/main/java/eus/ixa/ixa/pipe/nerc/CLI.java | CLI.annotate | public final void annotate(final InputStream inputStream,
final OutputStream outputStream) throws IOException, JDOMException {
"""
Main method to do Named Entity tagging.
@param inputStream
the input stream containing the content to tag
@param outputStream
the output stream providing the named entities... | java | public final void annotate(final InputStream inputStream,
final OutputStream outputStream) throws IOException, JDOMException {
BufferedReader breader = new BufferedReader(
new InputStreamReader(inputStream, UTF_8));
BufferedWriter bwriter = new BufferedWriter(
new OutputStreamWriter(outpu... | [
"public",
"final",
"void",
"annotate",
"(",
"final",
"InputStream",
"inputStream",
",",
"final",
"OutputStream",
"outputStream",
")",
"throws",
"IOException",
",",
"JDOMException",
"{",
"BufferedReader",
"breader",
"=",
"new",
"BufferedReader",
"(",
"new",
"InputStr... | Main method to do Named Entity tagging.
@param inputStream
the input stream containing the content to tag
@param outputStream
the output stream providing the named entities
@throws IOException
exception if problems in input or output streams
@throws JDOMException
if xml formatting problems | [
"Main",
"method",
"to",
"do",
"Named",
"Entity",
"tagging",
"."
] | train | https://github.com/ixa-ehu/ixa-pipe-nerc/blob/299cb49348eb7650fef2ae47c73f6d3384b43c34/src/main/java/eus/ixa/ixa/pipe/nerc/CLI.java#L180-L228 |
cdk/cdk | tool/formula/src/main/java/org/openscience/cdk/formula/rules/IsotopePatternRule.java | IsotopePatternRule.setParameters | @Override
public void setParameters(Object[] params) throws CDKException {
"""
Sets the parameters attribute of the IsotopePatternRule object.
@param params The new parameters value
@throws CDKException Description of the Exception
@see #getParameters
"""
if (par... | java | @Override
public void setParameters(Object[] params) throws CDKException {
if (params.length != 2) throw new CDKException("IsotopePatternRule expects two parameter");
if (!(params[0] instanceof List)) throw new CDKException("The parameter one must be of type List<Double[]>");
if (!(params[... | [
"@",
"Override",
"public",
"void",
"setParameters",
"(",
"Object",
"[",
"]",
"params",
")",
"throws",
"CDKException",
"{",
"if",
"(",
"params",
".",
"length",
"!=",
"2",
")",
"throw",
"new",
"CDKException",
"(",
"\"IsotopePatternRule expects two parameter\"",
")... | Sets the parameters attribute of the IsotopePatternRule object.
@param params The new parameters value
@throws CDKException Description of the Exception
@see #getParameters | [
"Sets",
"the",
"parameters",
"attribute",
"of",
"the",
"IsotopePatternRule",
"object",
"."
] | train | https://github.com/cdk/cdk/blob/c3d0f16502bf08df50365fee392e11d7c9856657/tool/formula/src/main/java/org/openscience/cdk/formula/rules/IsotopePatternRule.java#L88-L102 |
landawn/AbacusUtil | src/com/landawn/abacus/util/SQLExecutor.java | SQLExecutor.streamAll | @SafeVarargs
public final <T> Stream<T> streamAll(final String sql, final StatementSetter statementSetter,
final JdbcUtil.BiRecordGetter<T, RuntimeException> recordGetter, final JdbcSettings jdbcSettings, final Object... parameters) {
"""
Remember to close the returned <code>Stream</code> list to... | java | @SafeVarargs
public final <T> Stream<T> streamAll(final String sql, final StatementSetter statementSetter,
final JdbcUtil.BiRecordGetter<T, RuntimeException> recordGetter, final JdbcSettings jdbcSettings, final Object... parameters) {
checkJdbcSettingsForAllQuery(jdbcSettings);
if ... | [
"@",
"SafeVarargs",
"public",
"final",
"<",
"T",
">",
"Stream",
"<",
"T",
">",
"streamAll",
"(",
"final",
"String",
"sql",
",",
"final",
"StatementSetter",
"statementSetter",
",",
"final",
"JdbcUtil",
".",
"BiRecordGetter",
"<",
"T",
",",
"RuntimeException",
... | Remember to close the returned <code>Stream</code> list to close the underlying <code>ResultSet</code> list.
{@code stream} operation won't be part of transaction or use the connection created by {@code Transaction} even it's in transaction block/range.
@param sql
@param statementSetter
@param jdbcSettings
@param para... | [
"Remember",
"to",
"close",
"the",
"returned",
"<code",
">",
"Stream<",
"/",
"code",
">",
"list",
"to",
"close",
"the",
"underlying",
"<code",
">",
"ResultSet<",
"/",
"code",
">",
"list",
".",
"{",
"@code",
"stream",
"}",
"operation",
"won",
"t",
"be",
... | train | https://github.com/landawn/AbacusUtil/blob/544b7720175d15e9329f83dd22a8cc5fa4515e12/src/com/landawn/abacus/util/SQLExecutor.java#L2915-L2942 |
Impetus/Kundera | src/kundera-cassandra/cassandra-core/src/main/java/com/impetus/client/cassandra/schemamanager/CassandraSchemaManager.java | CassandraSchemaManager.createInvertedIndexTable | private void createInvertedIndexTable(TableInfo tableInfo, KsDef ksDef) throws Exception {
"""
Creates the inverted index table.
@param tableInfo
the table info
@param ksDef
the ks def
@throws Exception
the exception
"""
CfDef cfDef = getInvertedIndexCF(tableInfo);
if (cfDef != null)
... | java | private void createInvertedIndexTable(TableInfo tableInfo, KsDef ksDef) throws Exception
{
CfDef cfDef = getInvertedIndexCF(tableInfo);
if (cfDef != null)
{
try
{
cassandra_client.system_add_column_family(cfDef);
}
catch (Invali... | [
"private",
"void",
"createInvertedIndexTable",
"(",
"TableInfo",
"tableInfo",
",",
"KsDef",
"ksDef",
")",
"throws",
"Exception",
"{",
"CfDef",
"cfDef",
"=",
"getInvertedIndexCF",
"(",
"tableInfo",
")",
";",
"if",
"(",
"cfDef",
"!=",
"null",
")",
"{",
"try",
... | Creates the inverted index table.
@param tableInfo
the table info
@param ksDef
the ks def
@throws Exception
the exception | [
"Creates",
"the",
"inverted",
"index",
"table",
"."
] | train | https://github.com/Impetus/Kundera/blob/268958ab1ec09d14ec4d9184f0c8ded7a9158908/src/kundera-cassandra/cassandra-core/src/main/java/com/impetus/client/cassandra/schemamanager/CassandraSchemaManager.java#L1690-L1705 |
QSFT/Doradus | doradus-server/src/main/java/com/dell/doradus/service/olap/OLAPService.java | OLAPService.mergeShard | public void mergeShard(ApplicationDefinition appDef, String shard, MergeOptions options) {
"""
Merge loaded batches for the given shard name and application, optionally assigning
an expire-date. If "auto-merge" is not set for the application and a merge is
already underway for the shard, an exception is thrown. ... | java | public void mergeShard(ApplicationDefinition appDef, String shard, MergeOptions options) {
checkServiceState();
if (appDef.getOption("auto-merge") != null) {
TaskManagerService.instance().executeTask(appDef, new OLAPMerger(appDef, shard, options));
} else {
m_olap.me... | [
"public",
"void",
"mergeShard",
"(",
"ApplicationDefinition",
"appDef",
",",
"String",
"shard",
",",
"MergeOptions",
"options",
")",
"{",
"checkServiceState",
"(",
")",
";",
"if",
"(",
"appDef",
".",
"getOption",
"(",
"\"auto-merge\"",
")",
"!=",
"null",
")",
... | Merge loaded batches for the given shard name and application, optionally assigning
an expire-date. If "auto-merge" is not set for the application and a merge is
already underway for the shard, an exception is thrown. If "auto-merge" is set, the
shard is merged via a {@link TaskManagerService} task, waiting for an exis... | [
"Merge",
"loaded",
"batches",
"for",
"the",
"given",
"shard",
"name",
"and",
"application",
"optionally",
"assigning",
"an",
"expire",
"-",
"date",
".",
"If",
"auto",
"-",
"merge",
"is",
"not",
"set",
"for",
"the",
"application",
"and",
"a",
"merge",
"is",... | train | https://github.com/QSFT/Doradus/blob/ad64d3c37922eefda68ec8869ef089c1ca604b70/doradus-server/src/main/java/com/dell/doradus/service/olap/OLAPService.java#L342-L349 |
apache/incubator-shardingsphere | sharding-proxy/sharding-proxy-backend/src/main/java/org/apache/shardingsphere/shardingproxy/backend/communication/jdbc/datasource/JDBCBackendDataSource.java | JDBCBackendDataSource.getConnections | @SuppressWarnings("SynchronizationOnLocalVariableOrMethodParameter")
public List<Connection> getConnections(final ConnectionMode connectionMode, final String dataSourceName, final int connectionSize, final TransactionType transactionType) throws SQLException {
"""
Get connections.
@param connectionMode con... | java | @SuppressWarnings("SynchronizationOnLocalVariableOrMethodParameter")
public List<Connection> getConnections(final ConnectionMode connectionMode, final String dataSourceName, final int connectionSize, final TransactionType transactionType) throws SQLException {
DataSource dataSource = dataSources.get(dataSou... | [
"@",
"SuppressWarnings",
"(",
"\"SynchronizationOnLocalVariableOrMethodParameter\"",
")",
"public",
"List",
"<",
"Connection",
">",
"getConnections",
"(",
"final",
"ConnectionMode",
"connectionMode",
",",
"final",
"String",
"dataSourceName",
",",
"final",
"int",
"connecti... | Get connections.
@param connectionMode connection mode
@param dataSourceName data source name
@param connectionSize size of connections to be get
@param transactionType transaction type
@return connections
@throws SQLException SQL exception | [
"Get",
"connections",
"."
] | train | https://github.com/apache/incubator-shardingsphere/blob/f88fd29fc345dfb31fdce12e9e96cbfa0fd2402d/sharding-proxy/sharding-proxy-backend/src/main/java/org/apache/shardingsphere/shardingproxy/backend/communication/jdbc/datasource/JDBCBackendDataSource.java#L111-L123 |
geomajas/geomajas-project-client-gwt | common-gwt-smartgwt/src/main/java/org/geomajas/gwt/client/util/HtmlBuilder.java | HtmlBuilder.tdStyleHtmlContent | public static String tdStyleHtmlContent(String style, String... content) {
"""
Build a HTML TableData with given CSS style attributes for a string.
Use this method if given content contains HTML snippets, prepared with {@link HtmlBuilder#htmlEncode(String)}.
@param style style for td element
@param content co... | java | public static String tdStyleHtmlContent(String style, String... content) {
return tagStyleHtmlContent(Html.Tag.TD, style, content);
} | [
"public",
"static",
"String",
"tdStyleHtmlContent",
"(",
"String",
"style",
",",
"String",
"...",
"content",
")",
"{",
"return",
"tagStyleHtmlContent",
"(",
"Html",
".",
"Tag",
".",
"TD",
",",
"style",
",",
"content",
")",
";",
"}"
] | Build a HTML TableData with given CSS style attributes for a string.
Use this method if given content contains HTML snippets, prepared with {@link HtmlBuilder#htmlEncode(String)}.
@param style style for td element
@param content content string
@return HTML td element as string | [
"Build",
"a",
"HTML",
"TableData",
"with",
"given",
"CSS",
"style",
"attributes",
"for",
"a",
"string",
".",
"Use",
"this",
"method",
"if",
"given",
"content",
"contains",
"HTML",
"snippets",
"prepared",
"with",
"{",
"@link",
"HtmlBuilder#htmlEncode",
"(",
"St... | train | https://github.com/geomajas/geomajas-project-client-gwt/blob/1c1adc48deb192ed825265eebcc74d70bbf45670/common-gwt-smartgwt/src/main/java/org/geomajas/gwt/client/util/HtmlBuilder.java#L177-L179 |
lievendoclo/Valkyrie-RCP | valkyrie-rcp-core/src/main/java/org/valkyriercp/form/binding/swing/SwingBindingFactory.java | SwingBindingFactory.createBoundShuttleList | public Binding createBoundShuttleList( String selectionFormProperty, Object selectableItems ) {
"""
Binds the values specified in the collection contained within
<code>selectableItems</code> (which will be wrapped in a
{@link ValueHolder} to a {@link ShuttleList}, with any user selection
being placed in the for... | java | public Binding createBoundShuttleList( String selectionFormProperty, Object selectableItems ) {
return createBoundShuttleList(selectionFormProperty, new ValueHolder(selectableItems), null);
} | [
"public",
"Binding",
"createBoundShuttleList",
"(",
"String",
"selectionFormProperty",
",",
"Object",
"selectableItems",
")",
"{",
"return",
"createBoundShuttleList",
"(",
"selectionFormProperty",
",",
"new",
"ValueHolder",
"(",
"selectableItems",
")",
",",
"null",
")",... | Binds the values specified in the collection contained within
<code>selectableItems</code> (which will be wrapped in a
{@link ValueHolder} to a {@link ShuttleList}, with any user selection
being placed in the form property referred to by
<code>selectionFormProperty</code>. Each item in the list will be
rendered as a St... | [
"Binds",
"the",
"values",
"specified",
"in",
"the",
"collection",
"contained",
"within",
"<code",
">",
"selectableItems<",
"/",
"code",
">",
"(",
"which",
"will",
"be",
"wrapped",
"in",
"a",
"{",
"@link",
"ValueHolder",
"}",
"to",
"a",
"{",
"@link",
"Shutt... | train | https://github.com/lievendoclo/Valkyrie-RCP/blob/6aad6e640b348cda8f3b0841f6e42025233f1eb8/valkyrie-rcp-core/src/main/java/org/valkyriercp/form/binding/swing/SwingBindingFactory.java#L414-L416 |
google/j2objc | jre_emul/android/platform/external/icu/android_icu4j/src/main/java/android/icu/lang/UCharacter.java | UCharacter.toTitleCase | public static String toTitleCase(ULocale locale, String str,
BreakIterator titleIter) {
"""
<p>Returns the titlecase version of the argument string.
<p>Position for titlecasing is determined by the argument break
iterator, hence the user can customize his break iterator for
a specialized titlecasing... | java | public static String toTitleCase(ULocale locale, String str,
BreakIterator titleIter) {
return toTitleCase(locale, str, titleIter, 0);
} | [
"public",
"static",
"String",
"toTitleCase",
"(",
"ULocale",
"locale",
",",
"String",
"str",
",",
"BreakIterator",
"titleIter",
")",
"{",
"return",
"toTitleCase",
"(",
"locale",
",",
"str",
",",
"titleIter",
",",
"0",
")",
";",
"}"
] | <p>Returns the titlecase version of the argument string.
<p>Position for titlecasing is determined by the argument break
iterator, hence the user can customize his break iterator for
a specialized titlecasing. In this case only the forward iteration
needs to be implemented.
If the break iterator passed in is null, the ... | [
"<p",
">",
"Returns",
"the",
"titlecase",
"version",
"of",
"the",
"argument",
"string",
".",
"<p",
">",
"Position",
"for",
"titlecasing",
"is",
"determined",
"by",
"the",
"argument",
"break",
"iterator",
"hence",
"the",
"user",
"can",
"customize",
"his",
"br... | train | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/external/icu/android_icu4j/src/main/java/android/icu/lang/UCharacter.java#L4490-L4493 |
alkacon/opencms-core | src/org/opencms/db/generic/CmsVfsDriver.java | CmsVfsDriver.internalCreateUrlNameMappingEntry | protected CmsUrlNameMappingEntry internalCreateUrlNameMappingEntry(ResultSet resultSet) throws SQLException {
"""
Creates an URL name mapping entry from a result set.<p>
@param resultSet a result set
@return the URL name mapping entry created from the result set
@throws SQLException if something goes wrong
... | java | protected CmsUrlNameMappingEntry internalCreateUrlNameMappingEntry(ResultSet resultSet) throws SQLException {
String name = resultSet.getString(1);
CmsUUID structureId = new CmsUUID(resultSet.getString(2));
int state = resultSet.getInt(3);
long dateChanged = resultSet.getLong(4);
... | [
"protected",
"CmsUrlNameMappingEntry",
"internalCreateUrlNameMappingEntry",
"(",
"ResultSet",
"resultSet",
")",
"throws",
"SQLException",
"{",
"String",
"name",
"=",
"resultSet",
".",
"getString",
"(",
"1",
")",
";",
"CmsUUID",
"structureId",
"=",
"new",
"CmsUUID",
... | Creates an URL name mapping entry from a result set.<p>
@param resultSet a result set
@return the URL name mapping entry created from the result set
@throws SQLException if something goes wrong | [
"Creates",
"an",
"URL",
"name",
"mapping",
"entry",
"from",
"a",
"result",
"set",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/db/generic/CmsVfsDriver.java#L3739-L3747 |
xwiki/xwiki-commons | xwiki-commons-core/xwiki-commons-extension/xwiki-commons-extension-api/src/main/java/org/xwiki/extension/internal/ExtensionUtils.java | ExtensionUtils.importProperty | public static String importProperty(MutableExtension extension, String propertySuffix, String def) {
"""
Delete and return the value of the passed special property.
@param extension the extension from which to extract custom property
@param propertySuffix the property suffix
@param def the default value
@ret... | java | public static String importProperty(MutableExtension extension, String propertySuffix, String def)
{
return StringUtils.defaultString(importProperty(extension, propertySuffix), def);
} | [
"public",
"static",
"String",
"importProperty",
"(",
"MutableExtension",
"extension",
",",
"String",
"propertySuffix",
",",
"String",
"def",
")",
"{",
"return",
"StringUtils",
".",
"defaultString",
"(",
"importProperty",
"(",
"extension",
",",
"propertySuffix",
")",... | Delete and return the value of the passed special property.
@param extension the extension from which to extract custom property
@param propertySuffix the property suffix
@param def the default value
@return the value or {@code def} if none was found
@since 8.3M1 | [
"Delete",
"and",
"return",
"the",
"value",
"of",
"the",
"passed",
"special",
"property",
"."
] | train | https://github.com/xwiki/xwiki-commons/blob/5374d8c6d966588c1eac7392c83da610dfb9f129/xwiki-commons-core/xwiki-commons-extension/xwiki-commons-extension-api/src/main/java/org/xwiki/extension/internal/ExtensionUtils.java#L176-L179 |
joelittlejohn/jsonschema2pojo | jsonschema2pojo-ant/src/main/java/org/jsonschema2pojo/ant/Jsonschema2PojoTask.java | Jsonschema2PojoTask.buildExtendedClassloader | private ClassLoader buildExtendedClassloader() {
"""
Build a classloader using the additional elements specified in
<code>classpath</code> and <code>classpathRef</code>.
@return a new classloader that includes the extra path elements found in
the <code>classpath</code> and <code>classpathRef</code> config
va... | java | private ClassLoader buildExtendedClassloader() {
final List<URL> classpathUrls = new ArrayList<>();
for (String pathElement : getClasspath().list()) {
try {
classpathUrls.add(new File(pathElement).toURI().toURL());
} catch (MalformedURLException e) {
... | [
"private",
"ClassLoader",
"buildExtendedClassloader",
"(",
")",
"{",
"final",
"List",
"<",
"URL",
">",
"classpathUrls",
"=",
"new",
"ArrayList",
"<>",
"(",
")",
";",
"for",
"(",
"String",
"pathElement",
":",
"getClasspath",
"(",
")",
".",
"list",
"(",
")",... | Build a classloader using the additional elements specified in
<code>classpath</code> and <code>classpathRef</code>.
@return a new classloader that includes the extra path elements found in
the <code>classpath</code> and <code>classpathRef</code> config
values | [
"Build",
"a",
"classloader",
"using",
"the",
"additional",
"elements",
"specified",
"in",
"<code",
">",
"classpath<",
"/",
"code",
">",
"and",
"<code",
">",
"classpathRef<",
"/",
"code",
">",
"."
] | train | https://github.com/joelittlejohn/jsonschema2pojo/blob/0552b80db93214eb186e4ae45b40866cc1e7eb84/jsonschema2pojo-ant/src/main/java/org/jsonschema2pojo/ant/Jsonschema2PojoTask.java#L252-L270 |
xvik/generics-resolver | src/main/java/ru/vyarus/java/generics/resolver/util/GenericsUtils.java | GenericsUtils.getReturnClass | public static Class<?> getReturnClass(final Method method, final Map<String, Type> generics) {
"""
Called to properly resolve return type of root finder or inherited finder method.
Supposed to return enough type info to detect return type (collection, array or plain object).
<p>
Note: may return primitive becau... | java | public static Class<?> getReturnClass(final Method method, final Map<String, Type> generics) {
final Type returnType = method.getGenericReturnType();
return resolveClass(returnType, generics);
} | [
"public",
"static",
"Class",
"<",
"?",
">",
"getReturnClass",
"(",
"final",
"Method",
"method",
",",
"final",
"Map",
"<",
"String",
",",
"Type",
">",
"generics",
")",
"{",
"final",
"Type",
"returnType",
"=",
"method",
".",
"getGenericReturnType",
"(",
")",... | Called to properly resolve return type of root finder or inherited finder method.
Supposed to return enough type info to detect return type (collection, array or plain object).
<p>
Note: may return primitive because it might be important to differentiate actual value.
Use {@link TypeUtils#wrapPrimitive(Class)} to box p... | [
"Called",
"to",
"properly",
"resolve",
"return",
"type",
"of",
"root",
"finder",
"or",
"inherited",
"finder",
"method",
".",
"Supposed",
"to",
"return",
"enough",
"type",
"info",
"to",
"detect",
"return",
"type",
"(",
"collection",
"array",
"or",
"plain",
"o... | train | https://github.com/xvik/generics-resolver/blob/d7d9d2783265df1178230e8f0b7cb6d853b67a7b/src/main/java/ru/vyarus/java/generics/resolver/util/GenericsUtils.java#L70-L73 |
codeprimate-software/cp-elements | src/main/java/org/cp/elements/lang/Assert.java | Assert.isAssignableTo | public static void isAssignableTo(Class<?> from, Class<?> to, Supplier<String> message) {
"""
Asserts that the {@link Class 'from' class type} is assignable to the {@link Class 'to' class type}.
The assertion holds if and only if the {@link Class 'from' class type} is the same as or a subclass
of the {@link Cl... | java | public static void isAssignableTo(Class<?> from, Class<?> to, Supplier<String> message) {
if (isNotAssignableTo(from, to)) {
throw new ClassCastException(message.get());
}
} | [
"public",
"static",
"void",
"isAssignableTo",
"(",
"Class",
"<",
"?",
">",
"from",
",",
"Class",
"<",
"?",
">",
"to",
",",
"Supplier",
"<",
"String",
">",
"message",
")",
"{",
"if",
"(",
"isNotAssignableTo",
"(",
"from",
",",
"to",
")",
")",
"{",
"... | Asserts that the {@link Class 'from' class type} is assignable to the {@link Class 'to' class type}.
The assertion holds if and only if the {@link Class 'from' class type} is the same as or a subclass
of the {@link Class 'to' class type}.
@param from {@link Class class type} being evaluated for assignment compatibili... | [
"Asserts",
"that",
"the",
"{",
"@link",
"Class",
"from",
"class",
"type",
"}",
"is",
"assignable",
"to",
"the",
"{",
"@link",
"Class",
"to",
"class",
"type",
"}",
"."
] | train | https://github.com/codeprimate-software/cp-elements/blob/f2163c149fbbef05015e688132064ebcac7c49ab/src/main/java/org/cp/elements/lang/Assert.java#L563-L567 |
JRebirth/JRebirth | org.jrebirth.af/core/src/main/java/org/jrebirth/af/core/resource/image/ImageBuilder.java | ImageBuilder.loadImage | private Image loadImage(final String resourceName, final boolean skipImagesFolder) {
"""
Load an image.
@param resourceName the name of the image, path must be separated by '/'
@param skipImagesFolder skip imagesFolder prefix addition
@return the image loaded
"""
Image image = null;
... | java | private Image loadImage(final String resourceName, final boolean skipImagesFolder) {
Image image = null;
final List<String> imagePaths = skipImagesFolder ? Collections.singletonList("") : ResourceParameters.IMAGE_FOLDER.get();
for (int i = 0; i < imagePaths.size() && image == null; i++) {
... | [
"private",
"Image",
"loadImage",
"(",
"final",
"String",
"resourceName",
",",
"final",
"boolean",
"skipImagesFolder",
")",
"{",
"Image",
"image",
"=",
"null",
";",
"final",
"List",
"<",
"String",
">",
"imagePaths",
"=",
"skipImagesFolder",
"?",
"Collections",
... | Load an image.
@param resourceName the name of the image, path must be separated by '/'
@param skipImagesFolder skip imagesFolder prefix addition
@return the image loaded | [
"Load",
"an",
"image",
"."
] | train | https://github.com/JRebirth/JRebirth/blob/93f4fc087b83c73db540333b9686e97b4cec694d/org.jrebirth.af/core/src/main/java/org/jrebirth/af/core/resource/image/ImageBuilder.java#L138-L157 |
oasp/oasp4j | modules/basic/src/main/java/io/oasp/module/basic/common/api/config/SimpleConfigProperties.java | SimpleConfigProperties.ofHierarchicalMap | public static ConfigProperties ofHierarchicalMap(String key, Map<String, Object> map) {
"""
Converts a hierarchical {@link Map} of configuration values to {@link ConfigProperties}. E.g. the hierarchical map
<code>{"foo"={"bar"={"some"="my-value", "other"="magic-value"}}}</code> would result in {@link ConfigProper... | java | public static ConfigProperties ofHierarchicalMap(String key, Map<String, Object> map) {
SimpleConfigProperties root = new SimpleConfigProperties(key);
root.fromHierarchicalMap(map);
return root;
} | [
"public",
"static",
"ConfigProperties",
"ofHierarchicalMap",
"(",
"String",
"key",
",",
"Map",
"<",
"String",
",",
"Object",
">",
"map",
")",
"{",
"SimpleConfigProperties",
"root",
"=",
"new",
"SimpleConfigProperties",
"(",
"key",
")",
";",
"root",
".",
"fromH... | Converts a hierarchical {@link Map} of configuration values to {@link ConfigProperties}. E.g. the hierarchical map
<code>{"foo"={"bar"={"some"="my-value", "other"="magic-value"}}}</code> would result in {@link ConfigProperties}
{@code myRoot} such that
<code>myRoot.{@link #getChild(String...) getChild}("foo", "bar").{@... | [
"Converts",
"a",
"hierarchical",
"{",
"@link",
"Map",
"}",
"of",
"configuration",
"values",
"to",
"{",
"@link",
"ConfigProperties",
"}",
".",
"E",
".",
"g",
".",
"the",
"hierarchical",
"map",
"<code",
">",
"{",
"foo",
"=",
"{",
"bar",
"=",
"{",
"some",... | train | https://github.com/oasp/oasp4j/blob/03f90132699fad95e52ec8efa54aa391f8d3c7e4/modules/basic/src/main/java/io/oasp/module/basic/common/api/config/SimpleConfigProperties.java#L362-L367 |
logic-ng/LogicNG | src/main/java/org/logicng/formulas/PBConstraint.java | PBConstraint.evaluateCoeffs | static Tristate evaluateCoeffs(final int minValue, final int maxValue, final int rhs, final CType comparator) {
"""
Internal helper for checking if a given coefficient-sum min- and max-value can comply with a given right-hand-side
according to this PBConstraint's comparator.
@param minValue the minimum coeffic... | java | static Tristate evaluateCoeffs(final int minValue, final int maxValue, final int rhs, final CType comparator) {
int status = 0;
if (rhs >= minValue)
status++;
if (rhs > minValue)
status++;
if (rhs >= maxValue)
status++;
if (rhs > maxValue)
status++;
switch (comparator) {... | [
"static",
"Tristate",
"evaluateCoeffs",
"(",
"final",
"int",
"minValue",
",",
"final",
"int",
"maxValue",
",",
"final",
"int",
"rhs",
",",
"final",
"CType",
"comparator",
")",
"{",
"int",
"status",
"=",
"0",
";",
"if",
"(",
"rhs",
">=",
"minValue",
")",
... | Internal helper for checking if a given coefficient-sum min- and max-value can comply with a given right-hand-side
according to this PBConstraint's comparator.
@param minValue the minimum coefficient sum
@param maxValue the maximum coefficient sum
@param rhs the right-hand-side
@param comparator the comparat... | [
"Internal",
"helper",
"for",
"checking",
"if",
"a",
"given",
"coefficient",
"-",
"sum",
"min",
"-",
"and",
"max",
"-",
"value",
"can",
"comply",
"with",
"a",
"given",
"right",
"-",
"hand",
"-",
"side",
"according",
"to",
"this",
"PBConstraint",
"s",
"com... | train | https://github.com/logic-ng/LogicNG/blob/bb9eb88a768be4be8e02a76cfc4a59e6c3fb7f2e/src/main/java/org/logicng/formulas/PBConstraint.java#L170-L195 |
apache/incubator-gobblin | gobblin-api/src/main/java/org/apache/gobblin/source/workunit/Extract.java | Extract.addDeltaField | @Deprecated
public void addDeltaField(String... deltaFieldName) {
"""
Add more delta fields to the existing set of delta fields.
@param deltaFieldName delta field names
@deprecated It is recommended to add delta fields in {@code WorkUnit} instead of {@code Extract}.
"""
StringBuilder sb = new StringB... | java | @Deprecated
public void addDeltaField(String... deltaFieldName) {
StringBuilder sb = new StringBuilder(getProp(ConfigurationKeys.EXTRACT_DELTA_FIELDS_KEY, ""));
Joiner.on(",").appendTo(sb, deltaFieldName);
setProp(ConfigurationKeys.EXTRACT_DELTA_FIELDS_KEY, sb.toString());
} | [
"@",
"Deprecated",
"public",
"void",
"addDeltaField",
"(",
"String",
"...",
"deltaFieldName",
")",
"{",
"StringBuilder",
"sb",
"=",
"new",
"StringBuilder",
"(",
"getProp",
"(",
"ConfigurationKeys",
".",
"EXTRACT_DELTA_FIELDS_KEY",
",",
"\"\"",
")",
")",
";",
"Jo... | Add more delta fields to the existing set of delta fields.
@param deltaFieldName delta field names
@deprecated It is recommended to add delta fields in {@code WorkUnit} instead of {@code Extract}. | [
"Add",
"more",
"delta",
"fields",
"to",
"the",
"existing",
"set",
"of",
"delta",
"fields",
"."
] | train | https://github.com/apache/incubator-gobblin/blob/f029b4c0fea0fe4aa62f36dda2512344ff708bae/gobblin-api/src/main/java/org/apache/gobblin/source/workunit/Extract.java#L286-L291 |
lastaflute/lastaflute | src/main/java/org/lastaflute/core/mail/LaTypicalPostcard.java | LaTypicalPostcard.pushUlterior | public void pushUlterior(String key, Object value) {
"""
Push element of ulterior parameter. <br>
Basically unused in mailflute, this is for extension by application.
@param key The key of the element. (NotNull)
@param value The value of the element. (NotNull)
"""
assertArgumentNotNull("key", key);
... | java | public void pushUlterior(String key, Object value) {
assertArgumentNotNull("key", key);
assertArgumentNotNull("value", value);
postcard.pushUlterior(key, value);
} | [
"public",
"void",
"pushUlterior",
"(",
"String",
"key",
",",
"Object",
"value",
")",
"{",
"assertArgumentNotNull",
"(",
"\"key\"",
",",
"key",
")",
";",
"assertArgumentNotNull",
"(",
"\"value\"",
",",
"value",
")",
";",
"postcard",
".",
"pushUlterior",
"(",
... | Push element of ulterior parameter. <br>
Basically unused in mailflute, this is for extension by application.
@param key The key of the element. (NotNull)
@param value The value of the element. (NotNull) | [
"Push",
"element",
"of",
"ulterior",
"parameter",
".",
"<br",
">",
"Basically",
"unused",
"in",
"mailflute",
"this",
"is",
"for",
"extension",
"by",
"application",
"."
] | train | https://github.com/lastaflute/lastaflute/blob/17b56dda8322e4c6d79043532c1dda917d6b60a8/src/main/java/org/lastaflute/core/mail/LaTypicalPostcard.java#L287-L291 |
FudanNLP/fnlp | fnlp-core/src/main/java/org/fnlp/nlp/cn/ner/TimeNormalizer.java | TimeNormalizer.TimeEx | private TimeUnit[] TimeEx(String tar,String timebase) {
"""
有基准时间输入的时间表达式识别
这是时间表达式识别的主方法,
通过已经构建的正则表达式对字符串进行识别,并按照预先定义的基准时间进行规范化
将所有别识别并进行规范化的时间表达式进行返回,
时间表达式通过TimeUnit类进行定义
@param String 输入文本字符串
@param String 输入基准时间
@return TimeUnit[] 时间表达式类型数组
"""
Matcher match;
int startline=-1,endline=-... | java | private TimeUnit[] TimeEx(String tar,String timebase)
{
Matcher match;
int startline=-1,endline=-1;
String [] temp = new String[99];
int rpointer=0;
TimeUnit[] Time_Result = null;
match=patterns.matcher(tar);
boolean startmark=true;
while(match.find())
{
startline=match.start();
... | [
"private",
"TimeUnit",
"[",
"]",
"TimeEx",
"(",
"String",
"tar",
",",
"String",
"timebase",
")",
"{",
"Matcher",
"match",
";",
"int",
"startline",
"=",
"-",
"1",
",",
"endline",
"=",
"-",
"1",
";",
"String",
"[",
"]",
"temp",
"=",
"new",
"String",
... | 有基准时间输入的时间表达式识别
这是时间表达式识别的主方法,
通过已经构建的正则表达式对字符串进行识别,并按照预先定义的基准时间进行规范化
将所有别识别并进行规范化的时间表达式进行返回,
时间表达式通过TimeUnit类进行定义
@param String 输入文本字符串
@param String 输入基准时间
@return TimeUnit[] 时间表达式类型数组 | [
"有基准时间输入的时间表达式识别"
] | train | https://github.com/FudanNLP/fnlp/blob/ce258f3e4a5add2ba0b5e4cbac7cab2190af6659/fnlp-core/src/main/java/org/fnlp/nlp/cn/ner/TimeNormalizer.java#L169-L217 |
eBay/xcelite | src/main/java/com/ebay/xcelite/Xcelite.java | Xcelite.write | public void write(File file) {
"""
Saves data to a new file.
@param file the file to save the data into
"""
FileOutputStream out = null;
try {
out = new FileOutputStream(file, false);
workbook.write(out);
} catch (FileNotFoundException e) {
throw new RuntimeException(e);
... | java | public void write(File file) {
FileOutputStream out = null;
try {
out = new FileOutputStream(file, false);
workbook.write(out);
} catch (FileNotFoundException e) {
throw new RuntimeException(e);
} catch (IOException e) {
new RuntimeException(e);
} finally {
if... | [
"public",
"void",
"write",
"(",
"File",
"file",
")",
"{",
"FileOutputStream",
"out",
"=",
"null",
";",
"try",
"{",
"out",
"=",
"new",
"FileOutputStream",
"(",
"file",
",",
"false",
")",
";",
"workbook",
".",
"write",
"(",
"out",
")",
";",
"}",
"catch... | Saves data to a new file.
@param file the file to save the data into | [
"Saves",
"data",
"to",
"a",
"new",
"file",
"."
] | train | https://github.com/eBay/xcelite/blob/0362f4cf9c5b8dee73e8ec00a860f0fef0f0c2e1/src/main/java/com/ebay/xcelite/Xcelite.java#L123-L140 |
kotcrab/vis-ui | ui/src/main/java/com/kotcrab/vis/ui/util/form/SimpleFormValidator.java | SimpleFormValidator.valueGreaterThan | public FormInputValidator valueGreaterThan (VisValidatableTextField field, String errorMsg, float value) {
"""
Validates if entered text is greater than entered number <p>
Can be used in combination with {@link #integerNumber(VisValidatableTextField, String)} to only allows integers.
"""
return valueGreater... | java | public FormInputValidator valueGreaterThan (VisValidatableTextField field, String errorMsg, float value) {
return valueGreaterThan(field, errorMsg, value, false);
} | [
"public",
"FormInputValidator",
"valueGreaterThan",
"(",
"VisValidatableTextField",
"field",
",",
"String",
"errorMsg",
",",
"float",
"value",
")",
"{",
"return",
"valueGreaterThan",
"(",
"field",
",",
"errorMsg",
",",
"value",
",",
"false",
")",
";",
"}"
] | Validates if entered text is greater than entered number <p>
Can be used in combination with {@link #integerNumber(VisValidatableTextField, String)} to only allows integers. | [
"Validates",
"if",
"entered",
"text",
"is",
"greater",
"than",
"entered",
"number",
"<p",
">",
"Can",
"be",
"used",
"in",
"combination",
"with",
"{"
] | train | https://github.com/kotcrab/vis-ui/blob/3b68f82d94ae32bffa2a3399c63f432e0f4908e0/ui/src/main/java/com/kotcrab/vis/ui/util/form/SimpleFormValidator.java#L125-L127 |
finmath/finmath-lib | src/main/java6/net/finmath/functions/AnalyticFormulas.java | AnalyticFormulas.bachelierOptionImpliedVolatility | public static double bachelierOptionImpliedVolatility(
double forward,
double optionMaturity,
double optionStrike,
double payoffUnit,
double optionValue) {
"""
Calculates the Bachelier option implied volatility of a call, i.e., the payoff
<p><i>max(S(T)-K,0)</i></p>, where <i>S</i> follows a normal... | java | public static double bachelierOptionImpliedVolatility(
double forward,
double optionMaturity,
double optionStrike,
double payoffUnit,
double optionValue)
{
if(forward == optionStrike) {
return optionValue / Math.sqrt(optionMaturity / Math.PI / 2.0) / payoffUnit;
}
// Limit the maximum number o... | [
"public",
"static",
"double",
"bachelierOptionImpliedVolatility",
"(",
"double",
"forward",
",",
"double",
"optionMaturity",
",",
"double",
"optionStrike",
",",
"double",
"payoffUnit",
",",
"double",
"optionValue",
")",
"{",
"if",
"(",
"forward",
"==",
"optionStrike... | Calculates the Bachelier option implied volatility of a call, i.e., the payoff
<p><i>max(S(T)-K,0)</i></p>, where <i>S</i> follows a normal process with constant volatility.
@param forward The forward of the underlying.
@param optionMaturity The option maturity T.
@param optionStrike The option strike. If the option s... | [
"Calculates",
"the",
"Bachelier",
"option",
"implied",
"volatility",
"of",
"a",
"call",
"i",
".",
"e",
".",
"the",
"payoff",
"<p",
">",
"<i",
">",
"max",
"(",
"S",
"(",
"T",
")",
"-",
"K",
"0",
")",
"<",
"/",
"i",
">",
"<",
"/",
"p",
">",
"wh... | train | https://github.com/finmath/finmath-lib/blob/a3c067d52dd33feb97d851df6cab130e4116759f/src/main/java6/net/finmath/functions/AnalyticFormulas.java#L860-L893 |
Alluxio/alluxio | shell/src/main/java/alluxio/cli/fsadmin/report/UfsCommand.java | UfsCommand.getAlignFormat | private static String getAlignFormat(Map<String, MountPointInfo> mountTable) {
"""
Gets the align format according to the longest mount point/under storage path.
@param mountTable the mount table to get information from
@return the align format for printing mounted info
"""
int mountPointLength = mountTa... | java | private static String getAlignFormat(Map<String, MountPointInfo> mountTable) {
int mountPointLength = mountTable.entrySet().stream().map(w -> w.getKey().length())
.max(Comparator.comparing(Integer::intValue)).get();
int usfLength = mountTable.entrySet().stream().map(w -> w.getValue().getUfsUri().length(... | [
"private",
"static",
"String",
"getAlignFormat",
"(",
"Map",
"<",
"String",
",",
"MountPointInfo",
">",
"mountTable",
")",
"{",
"int",
"mountPointLength",
"=",
"mountTable",
".",
"entrySet",
"(",
")",
".",
"stream",
"(",
")",
".",
"map",
"(",
"w",
"->",
... | Gets the align format according to the longest mount point/under storage path.
@param mountTable the mount table to get information from
@return the align format for printing mounted info | [
"Gets",
"the",
"align",
"format",
"according",
"to",
"the",
"longest",
"mount",
"point",
"/",
"under",
"storage",
"path",
"."
] | train | https://github.com/Alluxio/alluxio/blob/af38cf3ab44613355b18217a3a4d961f8fec3a10/shell/src/main/java/alluxio/cli/fsadmin/report/UfsCommand.java#L84-L93 |
lightblueseas/vintage-time | src/main/java/de/alpharogroup/date/CalculateDateExtensions.java | CalculateDateExtensions.addMinutes | public static Date addMinutes(final Date date, final int addMinutes) {
"""
Adds minutes to the given Date object and returns it. Note: you can add negative values too
for get date in past.
@param date
The Date object to add the minutes.
@param addMinutes
The days to add.
@return The resulted Date object.
... | java | public static Date addMinutes(final Date date, final int addMinutes)
{
final Calendar dateOnCalendar = Calendar.getInstance();
dateOnCalendar.setTime(date);
dateOnCalendar.add(Calendar.MINUTE, addMinutes);
return dateOnCalendar.getTime();
} | [
"public",
"static",
"Date",
"addMinutes",
"(",
"final",
"Date",
"date",
",",
"final",
"int",
"addMinutes",
")",
"{",
"final",
"Calendar",
"dateOnCalendar",
"=",
"Calendar",
".",
"getInstance",
"(",
")",
";",
"dateOnCalendar",
".",
"setTime",
"(",
"date",
")"... | Adds minutes to the given Date object and returns it. Note: you can add negative values too
for get date in past.
@param date
The Date object to add the minutes.
@param addMinutes
The days to add.
@return The resulted Date object. | [
"Adds",
"minutes",
"to",
"the",
"given",
"Date",
"object",
"and",
"returns",
"it",
".",
"Note",
":",
"you",
"can",
"add",
"negative",
"values",
"too",
"for",
"get",
"date",
"in",
"past",
"."
] | train | https://github.com/lightblueseas/vintage-time/blob/fbf201e679d9f9b92e7b5771f3eea1413cc2e113/src/main/java/de/alpharogroup/date/CalculateDateExtensions.java#L110-L116 |
belaban/JGroups | src/org/jgroups/util/Table.java | Table.getMissing | public SeqnoList getMissing(int max_msgs) {
"""
Returns a list of missing messages
@param max_msgs If > 0, the max number of missing messages to be returned (oldest first), else no limit
@return A SeqnoList of missing messages, or null if no messages are missing
"""
lock.lock();
try {
... | java | public SeqnoList getMissing(int max_msgs) {
lock.lock();
try {
if(size == 0)
return null;
long start_seqno=getHighestDeliverable() +1;
int capacity=(int)(hr - start_seqno);
int max_size=max_msgs > 0? Math.min(max_msgs, capacity) : capacity;... | [
"public",
"SeqnoList",
"getMissing",
"(",
"int",
"max_msgs",
")",
"{",
"lock",
".",
"lock",
"(",
")",
";",
"try",
"{",
"if",
"(",
"size",
"==",
"0",
")",
"return",
"null",
";",
"long",
"start_seqno",
"=",
"getHighestDeliverable",
"(",
")",
"+",
"1",
... | Returns a list of missing messages
@param max_msgs If > 0, the max number of missing messages to be returned (oldest first), else no limit
@return A SeqnoList of missing messages, or null if no messages are missing | [
"Returns",
"a",
"list",
"of",
"missing",
"messages"
] | train | https://github.com/belaban/JGroups/blob/bd3ca786aa57fed41dfbc10a94b1281e388be03b/src/org/jgroups/util/Table.java#L667-L685 |
facebookarchive/hive-dwrf | hive-dwrf-shims/src/main/java/org/apache/hadoop/hive/ql/io/slice/Slice.java | Slice.setInt | public void setInt(int index, int value) {
"""
Sets the specified 32-bit integer at the specified absolute
{@code index} in this buffer.
@throws IndexOutOfBoundsException if the specified {@code index} is less than {@code 0} or
{@code index + 4} is greater than {@code this.length()}
"""
checkIndex... | java | public void setInt(int index, int value)
{
checkIndexLength(index, SizeOf.SIZE_OF_INT);
unsafe.putInt(base, address + index, value);
} | [
"public",
"void",
"setInt",
"(",
"int",
"index",
",",
"int",
"value",
")",
"{",
"checkIndexLength",
"(",
"index",
",",
"SizeOf",
".",
"SIZE_OF_INT",
")",
";",
"unsafe",
".",
"putInt",
"(",
"base",
",",
"address",
"+",
"index",
",",
"value",
")",
";",
... | Sets the specified 32-bit integer at the specified absolute
{@code index} in this buffer.
@throws IndexOutOfBoundsException if the specified {@code index} is less than {@code 0} or
{@code index + 4} is greater than {@code this.length()} | [
"Sets",
"the",
"specified",
"32",
"-",
"bit",
"integer",
"at",
"the",
"specified",
"absolute",
"{",
"@code",
"index",
"}",
"in",
"this",
"buffer",
"."
] | train | https://github.com/facebookarchive/hive-dwrf/blob/a7b4fcf28a57e006a2fc041d40cf7e5ad16e6b45/hive-dwrf-shims/src/main/java/org/apache/hadoop/hive/ql/io/slice/Slice.java#L433-L437 |
Azure/azure-sdk-for-java | cognitiveservices/data-plane/vision/contentmoderator/src/main/java/com/microsoft/azure/cognitiveservices/vision/contentmoderator/implementation/ImageModerationsImpl.java | ImageModerationsImpl.oCRMethodAsync | public Observable<OCR> oCRMethodAsync(String language, OCRMethodOptionalParameter oCRMethodOptionalParameter) {
"""
Returns any text found in the image for the language specified. If no language is specified in input then the detection defaults to English.
@param language Language of the terms.
@param oCRMetho... | java | public Observable<OCR> oCRMethodAsync(String language, OCRMethodOptionalParameter oCRMethodOptionalParameter) {
return oCRMethodWithServiceResponseAsync(language, oCRMethodOptionalParameter).map(new Func1<ServiceResponse<OCR>, OCR>() {
@Override
public OCR call(ServiceResponse<OCR> respo... | [
"public",
"Observable",
"<",
"OCR",
">",
"oCRMethodAsync",
"(",
"String",
"language",
",",
"OCRMethodOptionalParameter",
"oCRMethodOptionalParameter",
")",
"{",
"return",
"oCRMethodWithServiceResponseAsync",
"(",
"language",
",",
"oCRMethodOptionalParameter",
")",
".",
"m... | Returns any text found in the image for the language specified. If no language is specified in input then the detection defaults to English.
@param language Language of the terms.
@param oCRMethodOptionalParameter the object representing the optional parameters to be set before calling this API
@throws IllegalArgument... | [
"Returns",
"any",
"text",
"found",
"in",
"the",
"image",
"for",
"the",
"language",
"specified",
".",
"If",
"no",
"language",
"is",
"specified",
"in",
"input",
"then",
"the",
"detection",
"defaults",
"to",
"English",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/cognitiveservices/data-plane/vision/contentmoderator/src/main/java/com/microsoft/azure/cognitiveservices/vision/contentmoderator/implementation/ImageModerationsImpl.java#L295-L302 |
OpenLiberty/open-liberty | dev/com.ibm.ws.messaging.runtime/src/com/ibm/ws/sib/processor/impl/PubSubOutputHandler.java | PubSubOutputHandler.createControlNotFlushed | private ControlNotFlushed createControlNotFlushed(SIBUuid8 target, SIBUuid12 stream, long reqID)
throws SIResourceException {
"""
Creates a NOTFLUSHED message for sending
@param target The target cellule (er ME) for the message.
@param stream The UUID of the stream the message should be sent on.
@param re... | java | private ControlNotFlushed createControlNotFlushed(SIBUuid8 target, SIBUuid12 stream, long reqID)
throws SIResourceException
{
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.entry(tc, "createControlNotFlushed", new Object[] {target, stream, new Long(reqID)});
ControlNotFlushe... | [
"private",
"ControlNotFlushed",
"createControlNotFlushed",
"(",
"SIBUuid8",
"target",
",",
"SIBUuid12",
"stream",
",",
"long",
"reqID",
")",
"throws",
"SIResourceException",
"{",
"if",
"(",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
"&&",
"tc",
".",
"... | Creates a NOTFLUSHED message for sending
@param target The target cellule (er ME) for the message.
@param stream The UUID of the stream the message should be sent on.
@param reqID The request ID that the message answers.
@return the new NOTFLUSHED message.
@throws SIResourceException if the message can't be created. | [
"Creates",
"a",
"NOTFLUSHED",
"message",
"for",
"sending"
] | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.messaging.runtime/src/com/ibm/ws/sib/processor/impl/PubSubOutputHandler.java#L1439-L1504 |
liferay/com-liferay-commerce | commerce-discount-service/src/main/java/com/liferay/commerce/discount/service/persistence/impl/CommerceDiscountRelPersistenceImpl.java | CommerceDiscountRelPersistenceImpl.removeByCN_CPK | @Override
public void removeByCN_CPK(long classNameId, long classPK) {
"""
Removes all the commerce discount rels where classNameId = ? and classPK = ? from the database.
@param classNameId the class name ID
@param classPK the class pk
"""
for (CommerceDiscountRel commerceDiscountRel : findByCN_... | java | @Override
public void removeByCN_CPK(long classNameId, long classPK) {
for (CommerceDiscountRel commerceDiscountRel : findByCN_CPK(
classNameId, classPK, QueryUtil.ALL_POS, QueryUtil.ALL_POS, null)) {
remove(commerceDiscountRel);
}
} | [
"@",
"Override",
"public",
"void",
"removeByCN_CPK",
"(",
"long",
"classNameId",
",",
"long",
"classPK",
")",
"{",
"for",
"(",
"CommerceDiscountRel",
"commerceDiscountRel",
":",
"findByCN_CPK",
"(",
"classNameId",
",",
"classPK",
",",
"QueryUtil",
".",
"ALL_POS",
... | Removes all the commerce discount rels where classNameId = ? and classPK = ? from the database.
@param classNameId the class name ID
@param classPK the class pk | [
"Removes",
"all",
"the",
"commerce",
"discount",
"rels",
"where",
"classNameId",
"=",
"?",
";",
"and",
"classPK",
"=",
"?",
";",
"from",
"the",
"database",
"."
] | train | https://github.com/liferay/com-liferay-commerce/blob/9e54362d7f59531fc684016ba49ee7cdc3a2f22b/commerce-discount-service/src/main/java/com/liferay/commerce/discount/service/persistence/impl/CommerceDiscountRelPersistenceImpl.java#L1658-L1664 |
alibaba/jstorm | jstorm-core/src/main/java/com/alibaba/jstorm/cluster/Common.java | Common.acker_inputs | public static Map<GlobalStreamId, Grouping> acker_inputs(StormTopology topology) {
"""
Generate acker's input Map<GlobalStreamId, Grouping>
for spout <GlobalStreamId(spoutId, ACKER_INIT_STREAM_ID), ...> for
bolt <GlobalStreamId(boltId, ACKER_ACK_STREAM_ID), ...> <GlobalStreamId(boltId,
ACKER_FAIL_STREAM_ID), ... | java | public static Map<GlobalStreamId, Grouping> acker_inputs(StormTopology topology) {
Map<GlobalStreamId, Grouping> spout_inputs = new HashMap<>();
Map<String, SpoutSpec> spout_ids = topology.get_spouts();
for (Entry<String, SpoutSpec> spout : spout_ids.entrySet()) {
String id = spout.g... | [
"public",
"static",
"Map",
"<",
"GlobalStreamId",
",",
"Grouping",
">",
"acker_inputs",
"(",
"StormTopology",
"topology",
")",
"{",
"Map",
"<",
"GlobalStreamId",
",",
"Grouping",
">",
"spout_inputs",
"=",
"new",
"HashMap",
"<>",
"(",
")",
";",
"Map",
"<",
... | Generate acker's input Map<GlobalStreamId, Grouping>
for spout <GlobalStreamId(spoutId, ACKER_INIT_STREAM_ID), ...> for
bolt <GlobalStreamId(boltId, ACKER_ACK_STREAM_ID), ...> <GlobalStreamId(boltId,
ACKER_FAIL_STREAM_ID), ...> | [
"Generate",
"acker",
"s",
"input",
"Map<GlobalStreamId",
"Grouping",
">"
] | train | https://github.com/alibaba/jstorm/blob/5d6cde22dbca7df3d6e6830bf94f98a6639ab559/jstorm-core/src/main/java/com/alibaba/jstorm/cluster/Common.java#L427-L459 |
kotcrab/vis-ui | ui/src/main/java/com/kotcrab/vis/ui/util/ToastManager.java | ToastManager.show | public void show (final Toast toast, float timeSec) {
"""
Displays toast. Toast will be displayed for given amount of seconds.
"""
Table toastMainTable = toast.getMainTable();
if (toastMainTable.getStage() != null) {
remove(toast);
}
toasts.add(toast);
toast.setToastManager(this);
toast.fadeIn(... | java | public void show (final Toast toast, float timeSec) {
Table toastMainTable = toast.getMainTable();
if (toastMainTable.getStage() != null) {
remove(toast);
}
toasts.add(toast);
toast.setToastManager(this);
toast.fadeIn();
toastMainTable.pack();
root.addActor(toastMainTable);
updateToastsPositions(... | [
"public",
"void",
"show",
"(",
"final",
"Toast",
"toast",
",",
"float",
"timeSec",
")",
"{",
"Table",
"toastMainTable",
"=",
"toast",
".",
"getMainTable",
"(",
")",
";",
"if",
"(",
"toastMainTable",
".",
"getStage",
"(",
")",
"!=",
"null",
")",
"{",
"r... | Displays toast. Toast will be displayed for given amount of seconds. | [
"Displays",
"toast",
".",
"Toast",
"will",
"be",
"displayed",
"for",
"given",
"amount",
"of",
"seconds",
"."
] | train | https://github.com/kotcrab/vis-ui/blob/3b68f82d94ae32bffa2a3399c63f432e0f4908e0/ui/src/main/java/com/kotcrab/vis/ui/util/ToastManager.java#L126-L151 |
googleapis/google-cloud-java | google-cloud-clients/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/admin/v2/BigtableTableAdminClient.java | BigtableTableAdminClient.dropRowRangeAsync | @SuppressWarnings("WeakerAccess")
public ApiFuture<Void> dropRowRangeAsync(String tableId, String rowKeyPrefix) {
"""
Drops rows by the specified key prefix and tableId asynchronously
<p>Please note that this method is considered part of the admin API and is rate limited.
<p>Sample code:
<pre>{@code
Ap... | java | @SuppressWarnings("WeakerAccess")
public ApiFuture<Void> dropRowRangeAsync(String tableId, String rowKeyPrefix) {
return dropRowRangeAsync(tableId, ByteString.copyFromUtf8(rowKeyPrefix));
} | [
"@",
"SuppressWarnings",
"(",
"\"WeakerAccess\"",
")",
"public",
"ApiFuture",
"<",
"Void",
">",
"dropRowRangeAsync",
"(",
"String",
"tableId",
",",
"String",
"rowKeyPrefix",
")",
"{",
"return",
"dropRowRangeAsync",
"(",
"tableId",
",",
"ByteString",
".",
"copyFrom... | Drops rows by the specified key prefix and tableId asynchronously
<p>Please note that this method is considered part of the admin API and is rate limited.
<p>Sample code:
<pre>{@code
ApiFuture<Void> dropFuture = client.dropRowRangeAsync("my-table", "prefix");
ApiFutures.addCallback(
dropFuture,
new ApiFutureCallbac... | [
"Drops",
"rows",
"by",
"the",
"specified",
"key",
"prefix",
"and",
"tableId",
"asynchronously"
] | train | https://github.com/googleapis/google-cloud-java/blob/d2f0bc64a53049040fe9c9d338b12fab3dd1ad6a/google-cloud-clients/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/admin/v2/BigtableTableAdminClient.java#L644-L647 |
moparisthebest/beehive | beehive-netui-tags/src/main/java/org/apache/beehive/netui/databinding/datagrid/runtime/util/JspFunctions.java | JspFunctions.isSortedDescending | public static boolean isSortedDescending(SortModel sortModel, String sortExpression) {
"""
Given a sort expression, check to see if the sort expression is sorted descending in a data grid's
{@link SortModel}.
@param sortModel a grid's sort model
@param sortExpression the sort expression
@return return <code>tr... | java | public static boolean isSortedDescending(SortModel sortModel, String sortExpression) {
if(sortModel == null || sortExpression == null)
return false;
Sort sort = sortModel.lookupSort(sortExpression);
if(sort != null && sort.getDirection() == SortDirection.DESCENDING)
retu... | [
"public",
"static",
"boolean",
"isSortedDescending",
"(",
"SortModel",
"sortModel",
",",
"String",
"sortExpression",
")",
"{",
"if",
"(",
"sortModel",
"==",
"null",
"||",
"sortExpression",
"==",
"null",
")",
"return",
"false",
";",
"Sort",
"sort",
"=",
"sortMo... | Given a sort expression, check to see if the sort expression is sorted descending in a data grid's
{@link SortModel}.
@param sortModel a grid's sort model
@param sortExpression the sort expression
@return return <code>true</code> if a {@link Sort} is found whose sort expression
matches the sort expression given here an... | [
"Given",
"a",
"sort",
"expression",
"check",
"to",
"see",
"if",
"the",
"sort",
"expression",
"is",
"sorted",
"descending",
"in",
"a",
"data",
"grid",
"s",
"{"
] | train | https://github.com/moparisthebest/beehive/blob/4246a0cc40ce3c05f1a02c2da2653ac622703d77/beehive-netui-tags/src/main/java/org/apache/beehive/netui/databinding/datagrid/runtime/util/JspFunctions.java#L75-L83 |
fabric8io/docker-maven-plugin | src/main/java/io/fabric8/maven/docker/assembly/DockerAssemblyManager.java | DockerAssemblyManager.createDockerTarArchive | public File createDockerTarArchive(String imageName, MojoParameters params, BuildImageConfiguration buildConfig, Logger log)
throws MojoExecutionException {
"""
Create an docker tar archive from the given configuration which can be send to the Docker host for
creating the image.
@param imageName Na... | java | public File createDockerTarArchive(String imageName, MojoParameters params, BuildImageConfiguration buildConfig, Logger log)
throws MojoExecutionException {
return createDockerTarArchive(imageName, params, buildConfig, log, null);
} | [
"public",
"File",
"createDockerTarArchive",
"(",
"String",
"imageName",
",",
"MojoParameters",
"params",
",",
"BuildImageConfiguration",
"buildConfig",
",",
"Logger",
"log",
")",
"throws",
"MojoExecutionException",
"{",
"return",
"createDockerTarArchive",
"(",
"imageName"... | Create an docker tar archive from the given configuration which can be send to the Docker host for
creating the image.
@param imageName Name of the image to create (used for creating build directories)
@param params Mojos parameters (used for finding the directories)
@param buildConfig configuration for how to build t... | [
"Create",
"an",
"docker",
"tar",
"archive",
"from",
"the",
"given",
"configuration",
"which",
"can",
"be",
"send",
"to",
"the",
"Docker",
"host",
"for",
"creating",
"the",
"image",
"."
] | train | https://github.com/fabric8io/docker-maven-plugin/blob/70ce4f56125d8efb8ddcf2ad4dbb5d6e2c7642b3/src/main/java/io/fabric8/maven/docker/assembly/DockerAssemblyManager.java#L88-L91 |
podio/podio-java | src/main/java/com/podio/tag/TagAPI.java | TagAPI.updateTags | public void updateTags(Reference reference, Collection<String> tags) {
"""
Update the tags on the objects
@param reference
The object the tags should be updated on
@param tags
The tags that should now be set on the object
"""
getResourceFactory()
.getApiResource("/tag/" + reference.toURLFragment())... | java | public void updateTags(Reference reference, Collection<String> tags) {
getResourceFactory()
.getApiResource("/tag/" + reference.toURLFragment())
.entity(tags, MediaType.APPLICATION_JSON_TYPE).put();
} | [
"public",
"void",
"updateTags",
"(",
"Reference",
"reference",
",",
"Collection",
"<",
"String",
">",
"tags",
")",
"{",
"getResourceFactory",
"(",
")",
".",
"getApiResource",
"(",
"\"/tag/\"",
"+",
"reference",
".",
"toURLFragment",
"(",
")",
")",
".",
"enti... | Update the tags on the objects
@param reference
The object the tags should be updated on
@param tags
The tags that should now be set on the object | [
"Update",
"the",
"tags",
"on",
"the",
"objects"
] | train | https://github.com/podio/podio-java/blob/a520b23bac118c957ce02cdd8ff42a6c7d17b49a/src/main/java/com/podio/tag/TagAPI.java#L65-L69 |
reactor/reactor-netty | src/main/java/reactor/netty/udp/UdpClient.java | UdpClient.runOn | public final UdpClient runOn(LoopResources channelResources, InternetProtocolFamily family) {
"""
Run IO loops on a supplied {@link EventLoopGroup} from the {@link LoopResources}
container.
@param channelResources a {@link LoopResources} accepting native runtime
expectation and returning an eventLoopGroup.
@... | java | public final UdpClient runOn(LoopResources channelResources, InternetProtocolFamily family) {
return new UdpClientRunOn(this, channelResources, false, family);
} | [
"public",
"final",
"UdpClient",
"runOn",
"(",
"LoopResources",
"channelResources",
",",
"InternetProtocolFamily",
"family",
")",
"{",
"return",
"new",
"UdpClientRunOn",
"(",
"this",
",",
"channelResources",
",",
"false",
",",
"family",
")",
";",
"}"
] | Run IO loops on a supplied {@link EventLoopGroup} from the {@link LoopResources}
container.
@param channelResources a {@link LoopResources} accepting native runtime
expectation and returning an eventLoopGroup.
@param family a specific {@link InternetProtocolFamily} to run with
@return a new {@link UdpClient} | [
"Run",
"IO",
"loops",
"on",
"a",
"supplied",
"{",
"@link",
"EventLoopGroup",
"}",
"from",
"the",
"{",
"@link",
"LoopResources",
"}",
"container",
"."
] | train | https://github.com/reactor/reactor-netty/blob/4ed14316e1d7fca3cecd18d6caa5f2251e159e49/src/main/java/reactor/netty/udp/UdpClient.java#L353-L355 |
phax/ph-commons | ph-jaxb/src/main/java/com/helger/jaxb/JAXBMarshallerHelper.java | JAXBMarshallerHelper.setEncoding | public static void setEncoding (@Nonnull final Marshaller aMarshaller, @Nullable final Charset aEncoding) {
"""
Set the standard property for the encoding charset.
@param aMarshaller
The marshaller to set the property. May not be <code>null</code>.
@param aEncoding
the value to be set
"""
setEncoding... | java | public static void setEncoding (@Nonnull final Marshaller aMarshaller, @Nullable final Charset aEncoding)
{
setEncoding (aMarshaller, aEncoding == null ? null : aEncoding.name ());
} | [
"public",
"static",
"void",
"setEncoding",
"(",
"@",
"Nonnull",
"final",
"Marshaller",
"aMarshaller",
",",
"@",
"Nullable",
"final",
"Charset",
"aEncoding",
")",
"{",
"setEncoding",
"(",
"aMarshaller",
",",
"aEncoding",
"==",
"null",
"?",
"null",
":",
"aEncodi... | Set the standard property for the encoding charset.
@param aMarshaller
The marshaller to set the property. May not be <code>null</code>.
@param aEncoding
the value to be set | [
"Set",
"the",
"standard",
"property",
"for",
"the",
"encoding",
"charset",
"."
] | train | https://github.com/phax/ph-commons/blob/d28c03565f44a0b804d96028d0969f9bb38c4313/ph-jaxb/src/main/java/com/helger/jaxb/JAXBMarshallerHelper.java#L98-L101 |
roboconf/roboconf-platform | core/roboconf-core/src/main/java/net/roboconf/core/utils/MavenUtils.java | MavenUtils.findMavenUrlForRoboconf | public static String findMavenUrlForRoboconf( String artifactId, String version )
throws IOException {
"""
Finds the URL of a Roboconf (JAR) Maven artifact.
@param artifactId an artifact ID (not null)
@param version a version (not null)
@return an URL if the resolution worked, null if it was not found
@throws... | java | public static String findMavenUrlForRoboconf( String artifactId, String version )
throws IOException {
return findMavenUrl( "net.roboconf", artifactId, version, "jar" );
} | [
"public",
"static",
"String",
"findMavenUrlForRoboconf",
"(",
"String",
"artifactId",
",",
"String",
"version",
")",
"throws",
"IOException",
"{",
"return",
"findMavenUrl",
"(",
"\"net.roboconf\"",
",",
"artifactId",
",",
"version",
",",
"\"jar\"",
")",
";",
"}"
] | Finds the URL of a Roboconf (JAR) Maven artifact.
@param artifactId an artifact ID (not null)
@param version a version (not null)
@return an URL if the resolution worked, null if it was not found
@throws IOException | [
"Finds",
"the",
"URL",
"of",
"a",
"Roboconf",
"(",
"JAR",
")",
"Maven",
"artifact",
"."
] | train | https://github.com/roboconf/roboconf-platform/blob/add54eead479effb138d0ff53a2d637902b82702/core/roboconf-core/src/main/java/net/roboconf/core/utils/MavenUtils.java#L56-L59 |
google/error-prone | check_api/src/main/java/com/google/errorprone/matchers/Matchers.java | Matchers.hasMethod | public static Matcher<ClassTree> hasMethod(final Matcher<MethodTree> methodMatcher) {
"""
Matches a class in which at least one method matches the given methodMatcher.
@param methodMatcher A matcher on MethodTrees to run against all methods in this class.
@return True if some method in the class matches the gi... | java | public static Matcher<ClassTree> hasMethod(final Matcher<MethodTree> methodMatcher) {
return new Matcher<ClassTree>() {
@Override
public boolean matches(ClassTree t, VisitorState state) {
for (Tree member : t.getMembers()) {
if (member instanceof MethodTree) {
if (methodMat... | [
"public",
"static",
"Matcher",
"<",
"ClassTree",
">",
"hasMethod",
"(",
"final",
"Matcher",
"<",
"MethodTree",
">",
"methodMatcher",
")",
"{",
"return",
"new",
"Matcher",
"<",
"ClassTree",
">",
"(",
")",
"{",
"@",
"Override",
"public",
"boolean",
"matches",
... | Matches a class in which at least one method matches the given methodMatcher.
@param methodMatcher A matcher on MethodTrees to run against all methods in this class.
@return True if some method in the class matches the given methodMatcher. | [
"Matches",
"a",
"class",
"in",
"which",
"at",
"least",
"one",
"method",
"matches",
"the",
"given",
"methodMatcher",
"."
] | train | https://github.com/google/error-prone/blob/fe2e3cc2cf1958cb7c487bfe89852bb4c225ba9d/check_api/src/main/java/com/google/errorprone/matchers/Matchers.java#L1049-L1063 |
RestComm/media-core | sdp/src/main/java/org/restcomm/media/core/sdp/SdpParserPipeline.java | SdpParserPipeline.addAttributeParser | public void addAttributeParser(String type, SdpParser<? extends AttributeField> parser) {
"""
Adds an attribute parser to the pipeline.
@param parser
The parser to be registered
"""
synchronized (this.attributeParsers) {
this.attributeParsers.put(type, parser);
}
} | java | public void addAttributeParser(String type, SdpParser<? extends AttributeField> parser) {
synchronized (this.attributeParsers) {
this.attributeParsers.put(type, parser);
}
} | [
"public",
"void",
"addAttributeParser",
"(",
"String",
"type",
",",
"SdpParser",
"<",
"?",
"extends",
"AttributeField",
">",
"parser",
")",
"{",
"synchronized",
"(",
"this",
".",
"attributeParsers",
")",
"{",
"this",
".",
"attributeParsers",
".",
"put",
"(",
... | Adds an attribute parser to the pipeline.
@param parser
The parser to be registered | [
"Adds",
"an",
"attribute",
"parser",
"to",
"the",
"pipeline",
"."
] | train | https://github.com/RestComm/media-core/blob/07b8703343708599f60af66bae62aded77ee81b5/sdp/src/main/java/org/restcomm/media/core/sdp/SdpParserPipeline.java#L168-L172 |
stephenc/java-iso-tools | loop-fs-iso-impl/src/main/java/com/github/stephenc/javaisotools/loopfs/iso9660/Iso9660VolumeDescriptorSet.java | Iso9660VolumeDescriptorSet.deserializeCommon | private void deserializeCommon(byte[] descriptor) throws IOException {
"""
Read the information common to primary and secondary volume descriptors.
@param descriptor the volume descriptor bytes
@throws IOException
"""
this.systemIdentifier = Util.getAChars(descriptor, 9, 32, this.encoding);
... | java | private void deserializeCommon(byte[] descriptor) throws IOException {
this.systemIdentifier = Util.getAChars(descriptor, 9, 32, this.encoding);
this.volumeIdentifier = Util.getDChars(descriptor, 41, 32, this.encoding);
this.volumeSetIdentifier = Util.getDChars(descriptor, 191, 128, this.encodin... | [
"private",
"void",
"deserializeCommon",
"(",
"byte",
"[",
"]",
"descriptor",
")",
"throws",
"IOException",
"{",
"this",
".",
"systemIdentifier",
"=",
"Util",
".",
"getAChars",
"(",
"descriptor",
",",
"9",
",",
"32",
",",
"this",
".",
"encoding",
")",
";",
... | Read the information common to primary and secondary volume descriptors.
@param descriptor the volume descriptor bytes
@throws IOException | [
"Read",
"the",
"information",
"common",
"to",
"primary",
"and",
"secondary",
"volume",
"descriptors",
"."
] | train | https://github.com/stephenc/java-iso-tools/blob/828c50b02eb311a14dde0dab43462a0d0c9dfb06/loop-fs-iso-impl/src/main/java/com/github/stephenc/javaisotools/loopfs/iso9660/Iso9660VolumeDescriptorSet.java#L194-L199 |
jhg023/SimpleNet | src/main/java/simplenet/packet/Packet.java | Packet.putInt | public Packet putInt(int i, ByteOrder order) {
"""
Writes a single {@code int} with the specified {@link ByteOrder} to this {@link Packet}'s payload.
@param i An {@code int}.
@param order The internal byte order of the {@code int}.
@return The {@link Packet} to allow for chained writes.
"""
va... | java | public Packet putInt(int i, ByteOrder order) {
var buffer = HEAP_BUFFER_POOL.take(Integer.BYTES);
var array = buffer.putInt(order == ByteOrder.LITTLE_ENDIAN ? Integer.reverseBytes(i) : i).array();
try {
return enqueue(Arrays.copyOfRange(array, 0, Integer.BYTES));
} f... | [
"public",
"Packet",
"putInt",
"(",
"int",
"i",
",",
"ByteOrder",
"order",
")",
"{",
"var",
"buffer",
"=",
"HEAP_BUFFER_POOL",
".",
"take",
"(",
"Integer",
".",
"BYTES",
")",
";",
"var",
"array",
"=",
"buffer",
".",
"putInt",
"(",
"order",
"==",
"ByteOr... | Writes a single {@code int} with the specified {@link ByteOrder} to this {@link Packet}'s payload.
@param i An {@code int}.
@param order The internal byte order of the {@code int}.
@return The {@link Packet} to allow for chained writes. | [
"Writes",
"a",
"single",
"{",
"@code",
"int",
"}",
"with",
"the",
"specified",
"{",
"@link",
"ByteOrder",
"}",
"to",
"this",
"{",
"@link",
"Packet",
"}",
"s",
"payload",
"."
] | train | https://github.com/jhg023/SimpleNet/blob/a5b55cbfe1768c6a28874f12adac3c748f2b509a/src/main/java/simplenet/packet/Packet.java#L230-L239 |
sirensolutions/siren-join | src/main/java/solutions/siren/join/action/coordinate/execution/FilterJoinVisitor.java | FilterJoinVisitor.recordMetadata | protected CoordinateSearchMetadata.Action recordMetadata(FilterJoinNode node, FilterJoinNode parent) {
"""
Records metadata of each terms by query actions. This must be called before
converting the filter join into a field data terms query.
<br>
Returns the created action, so that subclasses, e.g., {@link Cache... | java | protected CoordinateSearchMetadata.Action recordMetadata(FilterJoinNode node, FilterJoinNode parent) {
FilterJoinTerms terms = node.getTerms();
final String[] fromIndices = node.getLookupIndices();
final String[] fromTypes = node.getLookupTypes();
final String[] toIndices = parent == null ? null : pare... | [
"protected",
"CoordinateSearchMetadata",
".",
"Action",
"recordMetadata",
"(",
"FilterJoinNode",
"node",
",",
"FilterJoinNode",
"parent",
")",
"{",
"FilterJoinTerms",
"terms",
"=",
"node",
".",
"getTerms",
"(",
")",
";",
"final",
"String",
"[",
"]",
"fromIndices",... | Records metadata of each terms by query actions. This must be called before
converting the filter join into a field data terms query.
<br>
Returns the created action, so that subclasses, e.g., {@link CachedFilterJoinVisitor}, can extend it. | [
"Records",
"metadata",
"of",
"each",
"terms",
"by",
"query",
"actions",
".",
"This",
"must",
"be",
"called",
"before",
"converting",
"the",
"filter",
"join",
"into",
"a",
"field",
"data",
"terms",
"query",
".",
"<br",
">",
"Returns",
"the",
"created",
"act... | train | https://github.com/sirensolutions/siren-join/blob/cba1111b209ce6f72ab7750d5488a573a6c77fe5/src/main/java/solutions/siren/join/action/coordinate/execution/FilterJoinVisitor.java#L231-L253 |
Netflix/zuul | zuul-core/src/main/java/com/netflix/zuul/message/http/HttpQueryParams.java | HttpQueryParams.set | public void set(String name, String value) {
"""
Replace any/all entries with this key, with this single entry.
@param name
@param value
"""
delegate.removeAll(name);
delegate.put(name, value);
} | java | public void set(String name, String value)
{
delegate.removeAll(name);
delegate.put(name, value);
} | [
"public",
"void",
"set",
"(",
"String",
"name",
",",
"String",
"value",
")",
"{",
"delegate",
".",
"removeAll",
"(",
"name",
")",
";",
"delegate",
".",
"put",
"(",
"name",
",",
"value",
")",
";",
"}"
] | Replace any/all entries with this key, with this single entry.
@param name
@param value | [
"Replace",
"any",
"/",
"all",
"entries",
"with",
"this",
"key",
"with",
"this",
"single",
"entry",
"."
] | train | https://github.com/Netflix/zuul/blob/01bc777cf05e3522d37c9ed902ae13eb38a19692/zuul-core/src/main/java/com/netflix/zuul/message/http/HttpQueryParams.java#L147-L151 |
networknt/light-4j | metrics/src/main/java/io/dropwizard/metrics/InstrumentedExecutors.java | InstrumentedExecutors.privilegedThreadFactory | public static InstrumentedThreadFactory privilegedThreadFactory(MetricRegistry registry, String name) {
"""
Returns an instrumented thread factory used to create new threads that
have the same permissions as the current thread.
<p>
This factory creates threads with the same settings as {@link
Executors#default... | java | public static InstrumentedThreadFactory privilegedThreadFactory(MetricRegistry registry, String name) {
return new InstrumentedThreadFactory(Executors.privilegedThreadFactory(), registry, name);
} | [
"public",
"static",
"InstrumentedThreadFactory",
"privilegedThreadFactory",
"(",
"MetricRegistry",
"registry",
",",
"String",
"name",
")",
"{",
"return",
"new",
"InstrumentedThreadFactory",
"(",
"Executors",
".",
"privilegedThreadFactory",
"(",
")",
",",
"registry",
","... | Returns an instrumented thread factory used to create new threads that
have the same permissions as the current thread.
<p>
This factory creates threads with the same settings as {@link
Executors#defaultThreadFactory}, additionally setting the
AccessControlContext and contextClassLoader of new threads to
be the same as... | [
"Returns",
"an",
"instrumented",
"thread",
"factory",
"used",
"to",
"create",
"new",
"threads",
"that",
"have",
"the",
"same",
"permissions",
"as",
"the",
"current",
"thread",
".",
"<p",
">",
"This",
"factory",
"creates",
"threads",
"with",
"the",
"same",
"s... | train | https://github.com/networknt/light-4j/blob/2a60257c60663684c8f6dc8b5ea3cf184e534db6/metrics/src/main/java/io/dropwizard/metrics/InstrumentedExecutors.java#L547-L549 |
h2oai/h2o-3 | h2o-core/src/main/java/water/jdbc/SQLManager.java | SQLManager.buildSelectSingleRowSql | static String buildSelectSingleRowSql(String databaseType, String table, String columns) {
"""
Builds SQL SELECT to retrieve single row from a table based on type of database
@param databaseType
@param table
@param columns
@return String SQL SELECT statement
"""
switch(databaseType) {
case SQL... | java | static String buildSelectSingleRowSql(String databaseType, String table, String columns) {
switch(databaseType) {
case SQL_SERVER_DB_TYPE: //syntax supported since SQLServer 2008
return "SELECT TOP(1) " + columns + " FROM " + table;
case ORACLE_DB_TYPE:
return "SELECT " + columns + " F... | [
"static",
"String",
"buildSelectSingleRowSql",
"(",
"String",
"databaseType",
",",
"String",
"table",
",",
"String",
"columns",
")",
"{",
"switch",
"(",
"databaseType",
")",
"{",
"case",
"SQL_SERVER_DB_TYPE",
":",
"//syntax supported since SQLServer 2008",
"return",
"... | Builds SQL SELECT to retrieve single row from a table based on type of database
@param databaseType
@param table
@param columns
@return String SQL SELECT statement | [
"Builds",
"SQL",
"SELECT",
"to",
"retrieve",
"single",
"row",
"from",
"a",
"table",
"based",
"on",
"type",
"of",
"database"
] | train | https://github.com/h2oai/h2o-3/blob/845eb49dfeaadf638b6e2f779d82fac996391fad/h2o-core/src/main/java/water/jdbc/SQLManager.java#L308-L323 |
mapfish/mapfish-print | core/src/main/java/org/mapfish/print/servlet/job/impl/PrintJobEntryImpl.java | PrintJobEntryImpl.configureAccess | public final void configureAccess(final Template template, final ApplicationContext context) {
"""
Configure the access permissions required to access this print job.
@param template the containing print template which should have sufficient information to
configure the access.
@param context the application ... | java | public final void configureAccess(final Template template, final ApplicationContext context) {
final Configuration configuration = template.getConfiguration();
AndAccessAssertion accessAssertion = context.getBean(AndAccessAssertion.class);
accessAssertion.setPredicates(configuration.getAccessAs... | [
"public",
"final",
"void",
"configureAccess",
"(",
"final",
"Template",
"template",
",",
"final",
"ApplicationContext",
"context",
")",
"{",
"final",
"Configuration",
"configuration",
"=",
"template",
".",
"getConfiguration",
"(",
")",
";",
"AndAccessAssertion",
"ac... | Configure the access permissions required to access this print job.
@param template the containing print template which should have sufficient information to
configure the access.
@param context the application context | [
"Configure",
"the",
"access",
"permissions",
"required",
"to",
"access",
"this",
"print",
"job",
"."
] | train | https://github.com/mapfish/mapfish-print/blob/25a452cb39f592bd8a53b20db1037703898e1e22/core/src/main/java/org/mapfish/print/servlet/job/impl/PrintJobEntryImpl.java#L144-L150 |
kuali/kc-s2sgen | coeus-s2sgen-impl/src/main/java/org/kuali/coeus/s2sgen/impl/generate/support/GlobalLibraryV2_0Generator.java | GlobalLibraryV2_0Generator.getStateCodeDataType | public StateCodeDataType.Enum getStateCodeDataType(String countryAlternateCode, String stateName) {
"""
Create a StateCodeDataType.Enum as defined in UniversalCodes 2.0 from the
given name of the state.
@param stateName
The state name
@return The StateCodeDataType type corresponding to the given State code.
... | java | public StateCodeDataType.Enum getStateCodeDataType(String countryAlternateCode, String stateName) {
StateCodeDataType.Enum stateCodeDataType = null;
StateContract state = s2SLocationService.getStateFromName(countryAlternateCode, stateName);
if (state != null) {
StringBuilder stateDetail = new StringBuilder();
... | [
"public",
"StateCodeDataType",
".",
"Enum",
"getStateCodeDataType",
"(",
"String",
"countryAlternateCode",
",",
"String",
"stateName",
")",
"{",
"StateCodeDataType",
".",
"Enum",
"stateCodeDataType",
"=",
"null",
";",
"StateContract",
"state",
"=",
"s2SLocationService",... | Create a StateCodeDataType.Enum as defined in UniversalCodes 2.0 from the
given name of the state.
@param stateName
The state name
@return The StateCodeDataType type corresponding to the given State code. | [
"Create",
"a",
"StateCodeDataType",
".",
"Enum",
"as",
"defined",
"in",
"UniversalCodes",
"2",
".",
"0",
"from",
"the",
"given",
"name",
"of",
"the",
"state",
"."
] | train | https://github.com/kuali/kc-s2sgen/blob/2886380e1e3cb8bdd732ba99b2afa6ffc630bb37/coeus-s2sgen-impl/src/main/java/org/kuali/coeus/s2sgen/impl/generate/support/GlobalLibraryV2_0Generator.java#L83-L99 |
Netflix/conductor | mysql-persistence/src/main/java/com/netflix/conductor/dao/mysql/Query.java | Query.executeAndFetch | public <V> V executeAndFetch(ResultSetHandler<V> handler) {
"""
Execute the query and pass the {@link ResultSet} to the given handler.
@param handler The {@link ResultSetHandler} to execute.
@param <V> The return type of this method.
@return The results of {@link ResultSetHandler#apply(ResultSet)}.
"""
... | java | public <V> V executeAndFetch(ResultSetHandler<V> handler) {
try (ResultSet rs = executeQuery()) {
return handler.apply(rs);
} catch (SQLException ex) {
throw new ApplicationException(Code.BACKEND_ERROR, ex);
}
} | [
"public",
"<",
"V",
">",
"V",
"executeAndFetch",
"(",
"ResultSetHandler",
"<",
"V",
">",
"handler",
")",
"{",
"try",
"(",
"ResultSet",
"rs",
"=",
"executeQuery",
"(",
")",
")",
"{",
"return",
"handler",
".",
"apply",
"(",
"rs",
")",
";",
"}",
"catch"... | Execute the query and pass the {@link ResultSet} to the given handler.
@param handler The {@link ResultSetHandler} to execute.
@param <V> The return type of this method.
@return The results of {@link ResultSetHandler#apply(ResultSet)}. | [
"Execute",
"the",
"query",
"and",
"pass",
"the",
"{",
"@link",
"ResultSet",
"}",
"to",
"the",
"given",
"handler",
"."
] | train | https://github.com/Netflix/conductor/blob/78fae0ed9ddea22891f9eebb96a2ec0b2783dca0/mysql-persistence/src/main/java/com/netflix/conductor/dao/mysql/Query.java#L418-L424 |
eclipse/xtext-extras | org.eclipse.xtext.xbase/src/org/eclipse/xtext/xbase/scoping/batch/AbstractSessionBasedExecutableScope.java | AbstractSessionBasedExecutableScope.processFeatureNames | @Override
protected void processFeatureNames(QualifiedName name, NameAcceptor acceptor) {
"""
From a given name, other variants are computed, e.g. the name may be a property name
such as a prefix may be added to the name. Or it may be an operator such as the original
method name should be used, too, to find a d... | java | @Override
protected void processFeatureNames(QualifiedName name, NameAcceptor acceptor) {
QualifiedName methodName = operatorMapping == null? null : operatorMapping.getMethodName(name);
if (methodName != null) {
acceptor.accept(methodName.toString(), 2);
QualifiedName simpleOperator = operatorMapping.getSimp... | [
"@",
"Override",
"protected",
"void",
"processFeatureNames",
"(",
"QualifiedName",
"name",
",",
"NameAcceptor",
"acceptor",
")",
"{",
"QualifiedName",
"methodName",
"=",
"operatorMapping",
"==",
"null",
"?",
"null",
":",
"operatorMapping",
".",
"getMethodName",
"(",... | From a given name, other variants are computed, e.g. the name may be a property name
such as a prefix may be added to the name. Or it may be an operator such as the original
method name should be used, too, to find a declaration. | [
"From",
"a",
"given",
"name",
"other",
"variants",
"are",
"computed",
"e",
".",
"g",
".",
"the",
"name",
"may",
"be",
"a",
"property",
"name",
"such",
"as",
"a",
"prefix",
"may",
"be",
"added",
"to",
"the",
"name",
".",
"Or",
"it",
"may",
"be",
"an... | train | https://github.com/eclipse/xtext-extras/blob/451359541295323a29f5855e633f770cec02069a/org.eclipse.xtext.xbase/src/org/eclipse/xtext/xbase/scoping/batch/AbstractSessionBasedExecutableScope.java#L36-L52 |
logic-ng/LogicNG | src/main/java/org/logicng/backbones/BackboneGeneration.java | BackboneGeneration.computePositive | public static Backbone computePositive(final Collection<Formula> formulas) {
"""
Computes the positive backbone variables for a given collection of formulas.
@param formulas the given collection of formulas
@return the positive backbone or {@code null} if the formula is UNSAT
"""
return compute(formu... | java | public static Backbone computePositive(final Collection<Formula> formulas) {
return compute(formulas, allVariablesInFormulas(formulas), BackboneType.ONLY_POSITIVE);
} | [
"public",
"static",
"Backbone",
"computePositive",
"(",
"final",
"Collection",
"<",
"Formula",
">",
"formulas",
")",
"{",
"return",
"compute",
"(",
"formulas",
",",
"allVariablesInFormulas",
"(",
"formulas",
")",
",",
"BackboneType",
".",
"ONLY_POSITIVE",
")",
"... | Computes the positive backbone variables for a given collection of formulas.
@param formulas the given collection of formulas
@return the positive backbone or {@code null} if the formula is UNSAT | [
"Computes",
"the",
"positive",
"backbone",
"variables",
"for",
"a",
"given",
"collection",
"of",
"formulas",
"."
] | train | https://github.com/logic-ng/LogicNG/blob/bb9eb88a768be4be8e02a76cfc4a59e6c3fb7f2e/src/main/java/org/logicng/backbones/BackboneGeneration.java#L173-L175 |
h2oai/h2o-3 | h2o-core/src/main/java/water/parser/ParseUUID.java | ParseUUID.attemptUUIDParseLow | private static Long attemptUUIDParseLow(BufferedString str) {
"""
(and return Long.MIN_VALUE but this is a valid long return value).
"""
final byte[] buf = str.getBuffer();
int i=str.getOffset();
if( i+36 > buf.length ) return markBad(str);
long lo=0;
lo = get2(lo,buf,(i+=2)-2);
lo = ge... | java | private static Long attemptUUIDParseLow(BufferedString str) {
final byte[] buf = str.getBuffer();
int i=str.getOffset();
if( i+36 > buf.length ) return markBad(str);
long lo=0;
lo = get2(lo,buf,(i+=2)-2);
lo = get2(lo,buf,(i+=2)-2);
lo = get2(lo,buf,(i+=2)-2);
lo = get2(lo,buf,(i+=2)-2);... | [
"private",
"static",
"Long",
"attemptUUIDParseLow",
"(",
"BufferedString",
"str",
")",
"{",
"final",
"byte",
"[",
"]",
"buf",
"=",
"str",
".",
"getBuffer",
"(",
")",
";",
"int",
"i",
"=",
"str",
".",
"getOffset",
"(",
")",
";",
"if",
"(",
"i",
"+",
... | (and return Long.MIN_VALUE but this is a valid long return value). | [
"(",
"and",
"return",
"Long",
".",
"MIN_VALUE",
"but",
"this",
"is",
"a",
"valid",
"long",
"return",
"value",
")",
"."
] | train | https://github.com/h2oai/h2o-3/blob/845eb49dfeaadf638b6e2f779d82fac996391fad/h2o-core/src/main/java/water/parser/ParseUUID.java#L55-L70 |
looly/hutool | hutool-core/src/main/java/cn/hutool/core/exceptions/ExceptionUtil.java | ExceptionUtil.isCausedBy | @SuppressWarnings("unchecked")
public static boolean isCausedBy(Throwable throwable, Class<? extends Exception>... causeClasses) {
"""
判断是否由指定异常类引起
@param throwable 异常
@param causeClasses 定义的引起异常的类
@return 是否由指定异常类引起
@since 4.1.13
"""
return null != getCausedBy(throwable, causeClasses);
} | java | @SuppressWarnings("unchecked")
public static boolean isCausedBy(Throwable throwable, Class<? extends Exception>... causeClasses) {
return null != getCausedBy(throwable, causeClasses);
} | [
"@",
"SuppressWarnings",
"(",
"\"unchecked\"",
")",
"public",
"static",
"boolean",
"isCausedBy",
"(",
"Throwable",
"throwable",
",",
"Class",
"<",
"?",
"extends",
"Exception",
">",
"...",
"causeClasses",
")",
"{",
"return",
"null",
"!=",
"getCausedBy",
"(",
"t... | 判断是否由指定异常类引起
@param throwable 异常
@param causeClasses 定义的引起异常的类
@return 是否由指定异常类引起
@since 4.1.13 | [
"判断是否由指定异常类引起"
] | train | https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-core/src/main/java/cn/hutool/core/exceptions/ExceptionUtil.java#L221-L224 |
hankcs/HanLP | src/main/java/com/hankcs/hanlp/dependency/nnparser/Matrix.java | Matrix.times | public Matrix times(Matrix B) {
"""
Linear algebraic matrix multiplication, A * B
@param B another matrix
@return Matrix product, A * B
@throws IllegalArgumentException Matrix inner dimensions must agree.
"""
if (B.m != n)
{
throw new IllegalArgumentException("Matrix inner dime... | java | public Matrix times(Matrix B)
{
if (B.m != n)
{
throw new IllegalArgumentException("Matrix inner dimensions must agree.");
}
Matrix X = new Matrix(m, B.n);
double[][] C = X.getArray();
double[] Bcolj = new double[n];
for (int j = 0; j < B.n; j++)
... | [
"public",
"Matrix",
"times",
"(",
"Matrix",
"B",
")",
"{",
"if",
"(",
"B",
".",
"m",
"!=",
"n",
")",
"{",
"throw",
"new",
"IllegalArgumentException",
"(",
"\"Matrix inner dimensions must agree.\"",
")",
";",
"}",
"Matrix",
"X",
"=",
"new",
"Matrix",
"(",
... | Linear algebraic matrix multiplication, A * B
@param B another matrix
@return Matrix product, A * B
@throws IllegalArgumentException Matrix inner dimensions must agree. | [
"Linear",
"algebraic",
"matrix",
"multiplication",
"A",
"*",
"B"
] | train | https://github.com/hankcs/HanLP/blob/a538d0722ab2e4980a9dcd9ea40324fc3ddba7ce/src/main/java/com/hankcs/hanlp/dependency/nnparser/Matrix.java#L941-L968 |
micronaut-projects/micronaut-core | cli/src/main/groovy/io/micronaut/cli/io/support/UrlResource.java | UrlResource.createRelative | public Resource createRelative(String relativePath) {
"""
This implementation creates a UrlResource, applying the given path
relative to the path of the underlying URL of this resource descriptor.
@param relativePath The path
@return The resource for the path
@see java.net.URL#URL(java.net.URL, String)
"... | java | public Resource createRelative(String relativePath) {
if (relativePath.startsWith("/")) {
relativePath = relativePath.substring(1);
}
try {
return new UrlResource(new URL(url, relativePath));
} catch (MalformedURLException e) {
return null;
}
... | [
"public",
"Resource",
"createRelative",
"(",
"String",
"relativePath",
")",
"{",
"if",
"(",
"relativePath",
".",
"startsWith",
"(",
"\"/\"",
")",
")",
"{",
"relativePath",
"=",
"relativePath",
".",
"substring",
"(",
"1",
")",
";",
"}",
"try",
"{",
"return"... | This implementation creates a UrlResource, applying the given path
relative to the path of the underlying URL of this resource descriptor.
@param relativePath The path
@return The resource for the path
@see java.net.URL#URL(java.net.URL, String) | [
"This",
"implementation",
"creates",
"a",
"UrlResource",
"applying",
"the",
"given",
"path",
"relative",
"to",
"the",
"path",
"of",
"the",
"underlying",
"URL",
"of",
"this",
"resource",
"descriptor",
"."
] | train | https://github.com/micronaut-projects/micronaut-core/blob/c31f5b03ce0eb88c2f6470710987db03b8967d5c/cli/src/main/groovy/io/micronaut/cli/io/support/UrlResource.java#L178-L187 |
rometools/rome | rome-modules/src/main/java/com/rometools/modules/mediarss/io/MediaModuleGenerator.java | MediaModuleGenerator.generateResponses | private void generateResponses(final Metadata m, final Element e) {
"""
Generation of responses tag.
@param m source
@param e element to attach new element to
"""
if (m.getResponses() == null || m.getResponses().length == 0) {
return;
}
final Element responsesElements = ... | java | private void generateResponses(final Metadata m, final Element e) {
if (m.getResponses() == null || m.getResponses().length == 0) {
return;
}
final Element responsesElements = new Element("responses", NS);
for (final String response : m.getResponses()) {
addNotNul... | [
"private",
"void",
"generateResponses",
"(",
"final",
"Metadata",
"m",
",",
"final",
"Element",
"e",
")",
"{",
"if",
"(",
"m",
".",
"getResponses",
"(",
")",
"==",
"null",
"||",
"m",
".",
"getResponses",
"(",
")",
".",
"length",
"==",
"0",
")",
"{",
... | Generation of responses tag.
@param m source
@param e element to attach new element to | [
"Generation",
"of",
"responses",
"tag",
"."
] | train | https://github.com/rometools/rome/blob/5fcf0b1a9a6cdedbe253a45ad9468c54a0f97010/rome-modules/src/main/java/com/rometools/modules/mediarss/io/MediaModuleGenerator.java#L493-L502 |
Azure/azure-sdk-for-java | sql/resource-manager/v2014_04_01/src/main/java/com/microsoft/azure/management/sql/v2014_04_01/implementation/DatabasesInner.java | DatabasesInner.pauseAsync | public Observable<Void> pauseAsync(String resourceGroupName, String serverName, String databaseName) {
"""
Pauses a data warehouse.
@param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal.
@param serverName ... | java | public Observable<Void> pauseAsync(String resourceGroupName, String serverName, String databaseName) {
return pauseWithServiceResponseAsync(resourceGroupName, serverName, databaseName).map(new Func1<ServiceResponse<Void>, Void>() {
@Override
public Void call(ServiceResponse<Void> respons... | [
"public",
"Observable",
"<",
"Void",
">",
"pauseAsync",
"(",
"String",
"resourceGroupName",
",",
"String",
"serverName",
",",
"String",
"databaseName",
")",
"{",
"return",
"pauseWithServiceResponseAsync",
"(",
"resourceGroupName",
",",
"serverName",
",",
"databaseName... | Pauses a data warehouse.
@param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal.
@param serverName The name of the server.
@param databaseName The name of the data warehouse to pause.
@throws IllegalArgumentExcepti... | [
"Pauses",
"a",
"data",
"warehouse",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/sql/resource-manager/v2014_04_01/src/main/java/com/microsoft/azure/management/sql/v2014_04_01/implementation/DatabasesInner.java#L196-L203 |
stripe/stripe-java | src/main/java/com/stripe/net/MultipartProcessor.java | MultipartProcessor.addFileField | public void addFileField(String name, String fileName, InputStream inputStream)
throws IOException {
"""
Adds a file field to the multipart message, but takes in an InputStream instead of
just a file to read bytes from.
@param name Field name
@param fileName Name of the "file" being upload... | java | public void addFileField(String name, String fileName, InputStream inputStream)
throws IOException {
writer.append("--").append(boundary).append(LINE_BREAK);
writer.append("Content-Disposition: form-data; name=\"").append(name)
.append("\"; filename=\"").append(fileName).append("\"").append(LI... | [
"public",
"void",
"addFileField",
"(",
"String",
"name",
",",
"String",
"fileName",
",",
"InputStream",
"inputStream",
")",
"throws",
"IOException",
"{",
"writer",
".",
"append",
"(",
"\"--\"",
")",
".",
"append",
"(",
"boundary",
")",
".",
"append",
"(",
... | Adds a file field to the multipart message, but takes in an InputStream instead of
just a file to read bytes from.
@param name Field name
@param fileName Name of the "file" being uploaded.
@param inputStream Stream of bytes to use in place of a file.
@throws IOException Thrown when writing / reading f... | [
"Adds",
"a",
"file",
"field",
"to",
"the",
"multipart",
"message",
"but",
"takes",
"in",
"an",
"InputStream",
"instead",
"of",
"just",
"a",
"file",
"to",
"read",
"bytes",
"from",
"."
] | train | https://github.com/stripe/stripe-java/blob/acfa8becef3e73bfe3e9d8880bea3f3f30dadeac/src/main/java/com/stripe/net/MultipartProcessor.java#L64-L80 |
greese/dasein-persist | src/main/java/org/dasein/persist/PersistentFactory.java | PersistentFactory.find | public Collection<T> find(String field, Object val) throws PersistenceException {
"""
Executes a search that may return multiple values. The specified field
must have been set up by a call to @{link #addSearch(String,Class)}.
@param field the field being searched on
@param val the value being searched against
... | java | public Collection<T> find(String field, Object val) throws PersistenceException {
logger.debug("enter - find(String,Object");
try {
return find(field, val, null);
}
finally {
logger.debug("exit - find(String,Object)");
}
} | [
"public",
"Collection",
"<",
"T",
">",
"find",
"(",
"String",
"field",
",",
"Object",
"val",
")",
"throws",
"PersistenceException",
"{",
"logger",
".",
"debug",
"(",
"\"enter - find(String,Object\"",
")",
";",
"try",
"{",
"return",
"find",
"(",
"field",
",",... | Executes a search that may return multiple values. The specified field
must have been set up by a call to @{link #addSearch(String,Class)}.
@param field the field being searched on
@param val the value being searched against
@return a list of objects that match the criteria
@throws PersistenceException an error occurre... | [
"Executes",
"a",
"search",
"that",
"may",
"return",
"multiple",
"values",
".",
"The",
"specified",
"field",
"must",
"have",
"been",
"set",
"up",
"by",
"a",
"call",
"to"
] | train | https://github.com/greese/dasein-persist/blob/1104621ad1670a45488b093b984ec1db4c7be781/src/main/java/org/dasein/persist/PersistentFactory.java#L1355-L1363 |
forge/javaee-descriptors | impl/src/main/java/org/jboss/shrinkwrap/descriptor/impl/persistence20/PersistenceDescriptorImpl.java | PersistenceDescriptorImpl.addNamespace | public PersistenceDescriptor addNamespace(String name, String value) {
"""
Adds a new namespace
@return the current instance of <code>PersistenceDescriptor</code>
"""
model.attribute(name, value);
return this;
} | java | public PersistenceDescriptor addNamespace(String name, String value)
{
model.attribute(name, value);
return this;
} | [
"public",
"PersistenceDescriptor",
"addNamespace",
"(",
"String",
"name",
",",
"String",
"value",
")",
"{",
"model",
".",
"attribute",
"(",
"name",
",",
"value",
")",
";",
"return",
"this",
";",
"}"
] | Adds a new namespace
@return the current instance of <code>PersistenceDescriptor</code> | [
"Adds",
"a",
"new",
"namespace"
] | train | https://github.com/forge/javaee-descriptors/blob/cb914330a1a0b04bfc1d0f199bd9cde3bbf0b3ed/impl/src/main/java/org/jboss/shrinkwrap/descriptor/impl/persistence20/PersistenceDescriptorImpl.java#L83-L87 |
prestodb/presto | presto-accumulo/src/main/java/com/facebook/presto/accumulo/conf/AccumuloTableProperties.java | AccumuloTableProperties.getLocalityGroups | public static Optional<Map<String, Set<String>>> getLocalityGroups(Map<String, Object> tableProperties) {
"""
Gets the configured locality groups for the table, or Optional.empty() if not set.
<p>
All strings are lowercase.
@param tableProperties The map of table properties
@return Optional map of locality g... | java | public static Optional<Map<String, Set<String>>> getLocalityGroups(Map<String, Object> tableProperties)
{
requireNonNull(tableProperties);
@SuppressWarnings("unchecked")
String groupStr = (String) tableProperties.get(LOCALITY_GROUPS);
if (groupStr == null) {
return Optio... | [
"public",
"static",
"Optional",
"<",
"Map",
"<",
"String",
",",
"Set",
"<",
"String",
">",
">",
">",
"getLocalityGroups",
"(",
"Map",
"<",
"String",
",",
"Object",
">",
"tableProperties",
")",
"{",
"requireNonNull",
"(",
"tableProperties",
")",
";",
"@",
... | Gets the configured locality groups for the table, or Optional.empty() if not set.
<p>
All strings are lowercase.
@param tableProperties The map of table properties
@return Optional map of locality groups | [
"Gets",
"the",
"configured",
"locality",
"groups",
"for",
"the",
"table",
"or",
"Optional",
".",
"empty",
"()",
"if",
"not",
"set",
".",
"<p",
">",
"All",
"strings",
"are",
"lowercase",
"."
] | train | https://github.com/prestodb/presto/blob/89de5e379d8f85e139d292b0add8c537a2a01a88/presto-accumulo/src/main/java/com/facebook/presto/accumulo/conf/AccumuloTableProperties.java#L177-L208 |
alibaba/ARouter | arouter-api/src/main/java/com/alibaba/android/arouter/facade/Postcard.java | Postcard.withCharSequence | public Postcard withCharSequence(@Nullable String key, @Nullable CharSequence value) {
"""
Inserts a CharSequence value into the mapping of this Bundle, replacing
any existing value for the given key. Either key or value may be null.
@param key a String, or null
@param value a CharSequence, or null
@retur... | java | public Postcard withCharSequence(@Nullable String key, @Nullable CharSequence value) {
mBundle.putCharSequence(key, value);
return this;
} | [
"public",
"Postcard",
"withCharSequence",
"(",
"@",
"Nullable",
"String",
"key",
",",
"@",
"Nullable",
"CharSequence",
"value",
")",
"{",
"mBundle",
".",
"putCharSequence",
"(",
"key",
",",
"value",
")",
";",
"return",
"this",
";",
"}"
] | Inserts a CharSequence value into the mapping of this Bundle, replacing
any existing value for the given key. Either key or value may be null.
@param key a String, or null
@param value a CharSequence, or null
@return current | [
"Inserts",
"a",
"CharSequence",
"value",
"into",
"the",
"mapping",
"of",
"this",
"Bundle",
"replacing",
"any",
"existing",
"value",
"for",
"the",
"given",
"key",
".",
"Either",
"key",
"or",
"value",
"may",
"be",
"null",
"."
] | train | https://github.com/alibaba/ARouter/blob/1a06912a6e14a57112db1204b43f81c43d721732/arouter-api/src/main/java/com/alibaba/android/arouter/facade/Postcard.java#L361-L364 |
sai-pullabhotla/catatumbo | src/main/java/com/jmethods/catatumbo/impl/Unmarshaller.java | Unmarshaller.unmarshalWithExplodedStrategy | private void unmarshalWithExplodedStrategy(EmbeddedMetadata embeddedMetadata, Object target)
throws Throwable {
"""
Unmarshals the embedded field represented by the given embedded metadata.
@param embeddedMetadata
the embedded metadata
@param target
the target object that needs to be updated
@throws T... | java | private void unmarshalWithExplodedStrategy(EmbeddedMetadata embeddedMetadata, Object target)
throws Throwable {
Object embeddedObject = initializeEmbedded(embeddedMetadata, target);
for (PropertyMetadata propertyMetadata : embeddedMetadata.getPropertyMetadataCollection()) {
unmarshalProperty(propert... | [
"private",
"void",
"unmarshalWithExplodedStrategy",
"(",
"EmbeddedMetadata",
"embeddedMetadata",
",",
"Object",
"target",
")",
"throws",
"Throwable",
"{",
"Object",
"embeddedObject",
"=",
"initializeEmbedded",
"(",
"embeddedMetadata",
",",
"target",
")",
";",
"for",
"... | Unmarshals the embedded field represented by the given embedded metadata.
@param embeddedMetadata
the embedded metadata
@param target
the target object that needs to be updated
@throws Throwable
propagated | [
"Unmarshals",
"the",
"embedded",
"field",
"represented",
"by",
"the",
"given",
"embedded",
"metadata",
"."
] | train | https://github.com/sai-pullabhotla/catatumbo/blob/96d4c6dce3a5009624f7112a398406914dd19165/src/main/java/com/jmethods/catatumbo/impl/Unmarshaller.java#L240-L254 |
hibernate/hibernate-ogm | infinispan-embedded/src/main/java/org/hibernate/ogm/datastore/infinispan/persistencestrategy/impl/LocalCacheManager.java | LocalCacheManager.injectTransactionManager | private static Configuration injectTransactionManager(TransactionManagerLookupDelegator transactionManagerLookupDelegator, Configuration configuration) {
"""
Inject our TransactionManager lookup delegate for transactional caches ONLY!
<p>
injecting one in a non-transactional cache will have side-effects on other... | java | private static Configuration injectTransactionManager(TransactionManagerLookupDelegator transactionManagerLookupDelegator, Configuration configuration) {
if ( configuration.transaction().transactionMode() == TransactionMode.TRANSACTIONAL ) {
ConfigurationBuilder builder = new ConfigurationBuilder().read( configura... | [
"private",
"static",
"Configuration",
"injectTransactionManager",
"(",
"TransactionManagerLookupDelegator",
"transactionManagerLookupDelegator",
",",
"Configuration",
"configuration",
")",
"{",
"if",
"(",
"configuration",
".",
"transaction",
"(",
")",
".",
"transactionMode",
... | Inject our TransactionManager lookup delegate for transactional caches ONLY!
<p>
injecting one in a non-transactional cache will have side-effects on other configuration settings.
@return an updated version of the configuration | [
"Inject",
"our",
"TransactionManager",
"lookup",
"delegate",
"for",
"transactional",
"caches",
"ONLY!",
"<p",
">",
"injecting",
"one",
"in",
"a",
"non",
"-",
"transactional",
"cache",
"will",
"have",
"side",
"-",
"effects",
"on",
"other",
"configuration",
"setti... | train | https://github.com/hibernate/hibernate-ogm/blob/9ea971df7c27277029006a6f748d8272fb1d69d2/infinispan-embedded/src/main/java/org/hibernate/ogm/datastore/infinispan/persistencestrategy/impl/LocalCacheManager.java#L172-L180 |
javactic/javactic | src/main/java/com/github/javactic/Accumulation.java | Accumulation.withGood | public static <A, B, ERR, RESULT> Or<RESULT, Every<ERR>> withGood(
Or<? extends A, ? extends Every<? extends ERR>> a,
Or<? extends B, ? extends Every<? extends ERR>> b,
BiFunction<? super A, ? super B, ? extends RESULT> function) {
"""
Combines two accumulating Or into a single one using the given func... | java | public static <A, B, ERR, RESULT> Or<RESULT, Every<ERR>> withGood(
Or<? extends A, ? extends Every<? extends ERR>> a,
Or<? extends B, ? extends Every<? extends ERR>> b,
BiFunction<? super A, ? super B, ? extends RESULT> function) {
if (allGood(a, b))
return Good.of(function.apply(a.get(), b.get())... | [
"public",
"static",
"<",
"A",
",",
"B",
",",
"ERR",
",",
"RESULT",
">",
"Or",
"<",
"RESULT",
",",
"Every",
"<",
"ERR",
">",
">",
"withGood",
"(",
"Or",
"<",
"?",
"extends",
"A",
",",
"?",
"extends",
"Every",
"<",
"?",
"extends",
"ERR",
">",
">"... | Combines two accumulating Or into a single one using the given function.
The resulting Or will be a Good if both Ors are Goods, otherwise it will
be a Bad containing every error in the Bads.
@param <A> the success type of the first Or
@param <B> the success type of the second Or
@param <ERR> the error typ... | [
"Combines",
"two",
"accumulating",
"Or",
"into",
"a",
"single",
"one",
"using",
"the",
"given",
"function",
".",
"The",
"resulting",
"Or",
"will",
"be",
"a",
"Good",
"if",
"both",
"Ors",
"are",
"Goods",
"otherwise",
"it",
"will",
"be",
"a",
"Bad",
"conta... | train | https://github.com/javactic/javactic/blob/dfa040062178c259c3067fd9b59cb4498022d8bc/src/main/java/com/github/javactic/Accumulation.java#L236-L245 |
TheHortonMachine/hortonmachine | extras/sideprojects/gpextras/src/main/java/org/hortonmachine/gpextras/tiles/MapsforgeTilesGenerator.java | MapsforgeTilesGenerator.getTile4LatLon | public <T> T getTile4LatLon( double lon, double lat, int zoom, Class<T> adaptee ) throws IOException {
"""
Get tile data for a given lat/lon/zoomlevel.
@param lon the WGS84 longitude.
@param lat the WGS84 latitude.
@param zoom the zoomlevel
@param adaptee the class to adapt to.
@return the generated data.
... | java | public <T> T getTile4LatLon( double lon, double lat, int zoom, Class<T> adaptee ) throws IOException {
final int ty = MercatorProjection.latitudeToTileY(lat, (byte) zoom);
final int tx = MercatorProjection.longitudeToTileX(lon, (byte) zoom);
return getTile4TileCoordinate(ty, tx, zoom, adaptee);
... | [
"public",
"<",
"T",
">",
"T",
"getTile4LatLon",
"(",
"double",
"lon",
",",
"double",
"lat",
",",
"int",
"zoom",
",",
"Class",
"<",
"T",
">",
"adaptee",
")",
"throws",
"IOException",
"{",
"final",
"int",
"ty",
"=",
"MercatorProjection",
".",
"latitudeToTi... | Get tile data for a given lat/lon/zoomlevel.
@param lon the WGS84 longitude.
@param lat the WGS84 latitude.
@param zoom the zoomlevel
@param adaptee the class to adapt to.
@return the generated data.
@throws IOException | [
"Get",
"tile",
"data",
"for",
"a",
"given",
"lat",
"/",
"lon",
"/",
"zoomlevel",
"."
] | train | https://github.com/TheHortonMachine/hortonmachine/blob/d2b436bbdf951dc1fda56096a42dbc0eae4d35a5/extras/sideprojects/gpextras/src/main/java/org/hortonmachine/gpextras/tiles/MapsforgeTilesGenerator.java#L153-L157 |
cverges/expect4j | src/main/java/expect4j/Expect4j.java | Expect4j.expect | public int expect(String pattern) throws MalformedPatternException, Exception {
"""
Attempts to detect the provided pattern as an exact match.
@param pattern the pattern to find in the reader stream
@return the number of times the pattern is found,
or an error code
@throws MalformedPatternException if the patt... | java | public int expect(String pattern) throws MalformedPatternException, Exception {
logger.trace("Searching for '" + pattern + "' in the reader stream");
return expect(pattern, null);
} | [
"public",
"int",
"expect",
"(",
"String",
"pattern",
")",
"throws",
"MalformedPatternException",
",",
"Exception",
"{",
"logger",
".",
"trace",
"(",
"\"Searching for '\"",
"+",
"pattern",
"+",
"\"' in the reader stream\"",
")",
";",
"return",
"expect",
"(",
"patte... | Attempts to detect the provided pattern as an exact match.
@param pattern the pattern to find in the reader stream
@return the number of times the pattern is found,
or an error code
@throws MalformedPatternException if the pattern is invalid
@throws Exception if a generic error is encountered | [
"Attempts",
"to",
"detect",
"the",
"provided",
"pattern",
"as",
"an",
"exact",
"match",
"."
] | train | https://github.com/cverges/expect4j/blob/97b1da9b7bd231344cd7b7ce26d14caf8bb16cd6/src/main/java/expect4j/Expect4j.java#L261-L264 |
alexruiz/fest-reflect | src/main/java/org/fest/reflect/constructor/ConstructorInvoker.java | ConstructorInvoker.newInstance | public T newInstance(@NotNull Object... args) {
"""
Invokes the constructor of the specified type with the given arguments.
<p/>
Examples:
<pre>
// import static {@link org.fest.reflect.core.Reflection#constructor() org.fest.reflect.core.Reflection.constructor};
// Equivalent to 'Person p = new Person()'
P... | java | public T newInstance(@NotNull Object... args) {
Constructor<T> c = constructor;
boolean accessible = constructor.isAccessible();
try {
makeAccessible(c);
return c.newInstance(args);
} catch (Throwable t) {
Throwable cause = targetOf(t);
if (cause instanceof RuntimeException) {
... | [
"public",
"T",
"newInstance",
"(",
"@",
"NotNull",
"Object",
"...",
"args",
")",
"{",
"Constructor",
"<",
"T",
">",
"c",
"=",
"constructor",
";",
"boolean",
"accessible",
"=",
"constructor",
".",
"isAccessible",
"(",
")",
";",
"try",
"{",
"makeAccessible",... | Invokes the constructor of the specified type with the given arguments.
<p/>
Examples:
<pre>
// import static {@link org.fest.reflect.core.Reflection#constructor() org.fest.reflect.core.Reflection.constructor};
// Equivalent to 'Person p = new Person()'
Person p = {@link org.fest.reflect.core.Reflection#constructor() ... | [
"Invokes",
"the",
"constructor",
"of",
"the",
"specified",
"type",
"with",
"the",
"given",
"arguments",
".",
"<p",
"/",
">",
"Examples",
":",
"<pre",
">",
"//",
"import",
"static",
"{",
"@link",
"org",
".",
"fest",
".",
"reflect",
".",
"core",
".",
"Re... | train | https://github.com/alexruiz/fest-reflect/blob/6db30716808633ef880e439b3dc6602ecb3f1b08/src/main/java/org/fest/reflect/constructor/ConstructorInvoker.java#L69-L84 |
wisdom-framework/wisdom | core/wisdom-maven-plugin/src/main/java/org/wisdom/maven/osgi/ProjectScanner.java | ProjectScanner.getLocalResources | public Set<String> getLocalResources(boolean test) {
"""
Gets the list of resource files from {@literal src/main/resources} or {@literal src/test/resources}.
This method scans for all files that are not classes from {@literal target/classes} or {@literal
target/test-classes}. The distinction is made according to... | java | public Set<String> getLocalResources(boolean test) {
Set<String> resources = new LinkedHashSet<>();
File classes = getClassesDirectory();
if (test) {
classes = new File(basedir, "target/test-classes");
}
if (classes.isDirectory()) {
DirectoryScanner scanne... | [
"public",
"Set",
"<",
"String",
">",
"getLocalResources",
"(",
"boolean",
"test",
")",
"{",
"Set",
"<",
"String",
">",
"resources",
"=",
"new",
"LinkedHashSet",
"<>",
"(",
")",
";",
"File",
"classes",
"=",
"getClassesDirectory",
"(",
")",
";",
"if",
"(",... | Gets the list of resource files from {@literal src/main/resources} or {@literal src/test/resources}.
This method scans for all files that are not classes from {@literal target/classes} or {@literal
target/test-classes}. The distinction is made according to the value of {@code test}.
@param test whether or not we analy... | [
"Gets",
"the",
"list",
"of",
"resource",
"files",
"from",
"{",
"@literal",
"src",
"/",
"main",
"/",
"resources",
"}",
"or",
"{",
"@literal",
"src",
"/",
"test",
"/",
"resources",
"}",
".",
"This",
"method",
"scans",
"for",
"all",
"files",
"that",
"are"... | train | https://github.com/wisdom-framework/wisdom/blob/a35b6431200fec56b178c0ff60837ed73fd7874d/core/wisdom-maven-plugin/src/main/java/org/wisdom/maven/osgi/ProjectScanner.java#L114-L131 |
Netflix/conductor | core/src/main/java/com/netflix/conductor/core/execution/WorkflowExecutor.java | WorkflowExecutor.getActiveDomain | @VisibleForTesting
String getActiveDomain(String taskType, String[] domains) {
"""
Gets the active domain from the list of domains where the task is to be queued.
The domain list must be ordered.
In sequence, check if any worker has polled for last `activeWorkerLastPollInSecs` seconds, if so that is the Acti... | java | @VisibleForTesting
String getActiveDomain(String taskType, String[] domains) {
if (domains == null || domains.length == 0) {
return null;
}
return Arrays.stream(domains)
.filter(domain -> !domain.equalsIgnoreCase("NO_DOMAIN"))
.map(domain -> execu... | [
"@",
"VisibleForTesting",
"String",
"getActiveDomain",
"(",
"String",
"taskType",
",",
"String",
"[",
"]",
"domains",
")",
"{",
"if",
"(",
"domains",
"==",
"null",
"||",
"domains",
".",
"length",
"==",
"0",
")",
"{",
"return",
"null",
";",
"}",
"return",... | Gets the active domain from the list of domains where the task is to be queued.
The domain list must be ordered.
In sequence, check if any worker has polled for last `activeWorkerLastPollInSecs` seconds, if so that is the Active domain.
When no active domains are found:
<li> If NO_DOMAIN token is provided, return null.... | [
"Gets",
"the",
"active",
"domain",
"from",
"the",
"list",
"of",
"domains",
"where",
"the",
"task",
"is",
"to",
"be",
"queued",
".",
"The",
"domain",
"list",
"must",
"be",
"ordered",
".",
"In",
"sequence",
"check",
"if",
"any",
"worker",
"has",
"polled",
... | train | https://github.com/Netflix/conductor/blob/78fae0ed9ddea22891f9eebb96a2ec0b2783dca0/core/src/main/java/com/netflix/conductor/core/execution/WorkflowExecutor.java#L1099-L1113 |
google/error-prone | check_api/src/main/java/com/google/errorprone/matchers/Matchers.java | Matchers.methodHasParameters | public static Matcher<MethodTree> methodHasParameters(
final List<Matcher<VariableTree>> variableMatcher) {
"""
Matches an AST node that represents a method declaration, based on the list of
variableMatchers. Applies the variableMatcher at index n to the parameter at index n and
returns true iff they all m... | java | public static Matcher<MethodTree> methodHasParameters(
final List<Matcher<VariableTree>> variableMatcher) {
return new Matcher<MethodTree>() {
@Override
public boolean matches(MethodTree methodTree, VisitorState state) {
if (methodTree.getParameters().size() != variableMatcher.size()) {
... | [
"public",
"static",
"Matcher",
"<",
"MethodTree",
">",
"methodHasParameters",
"(",
"final",
"List",
"<",
"Matcher",
"<",
"VariableTree",
">",
">",
"variableMatcher",
")",
"{",
"return",
"new",
"Matcher",
"<",
"MethodTree",
">",
"(",
")",
"{",
"@",
"Override"... | Matches an AST node that represents a method declaration, based on the list of
variableMatchers. Applies the variableMatcher at index n to the parameter at index n and
returns true iff they all match. Returns false if the number of variableMatchers provided does
not match the number of parameters.
<p>If you pass no va... | [
"Matches",
"an",
"AST",
"node",
"that",
"represents",
"a",
"method",
"declaration",
"based",
"on",
"the",
"list",
"of",
"variableMatchers",
".",
"Applies",
"the",
"variableMatcher",
"at",
"index",
"n",
"to",
"the",
"parameter",
"at",
"index",
"n",
"and",
"re... | train | https://github.com/google/error-prone/blob/fe2e3cc2cf1958cb7c487bfe89852bb4c225ba9d/check_api/src/main/java/com/google/errorprone/matchers/Matchers.java#L988-L1005 |
j-easy/easy-random | easy-random-core/src/main/java/org/jeasy/random/EasyRandomParameters.java | EasyRandomParameters.dateRange | public EasyRandomParameters dateRange(final LocalDate min, final LocalDate max) {
"""
Set the date range.
@param min date
@param max date
@return the current {@link EasyRandomParameters} instance for method chaining
"""
if (min.isAfter(max)) {
throw new IllegalArgumentException("Min da... | java | public EasyRandomParameters dateRange(final LocalDate min, final LocalDate max) {
if (min.isAfter(max)) {
throw new IllegalArgumentException("Min date should be before max date");
}
setDateRange(new Range<>(min, max));
return this;
} | [
"public",
"EasyRandomParameters",
"dateRange",
"(",
"final",
"LocalDate",
"min",
",",
"final",
"LocalDate",
"max",
")",
"{",
"if",
"(",
"min",
".",
"isAfter",
"(",
"max",
")",
")",
"{",
"throw",
"new",
"IllegalArgumentException",
"(",
"\"Min date should be befor... | Set the date range.
@param min date
@param max date
@return the current {@link EasyRandomParameters} instance for method chaining | [
"Set",
"the",
"date",
"range",
"."
] | train | https://github.com/j-easy/easy-random/blob/816b0d6a74c7288af111e70ae1b0b57d7fe3b59d/easy-random-core/src/main/java/org/jeasy/random/EasyRandomParameters.java#L455-L461 |
google/j2objc | jre_emul/android/platform/libcore/ojluni/src/main/java/java/util/ArrayList.java | ArrayList.removeRange | protected void removeRange(int fromIndex, int toIndex) {
"""
Removes from this list all of the elements whose index is between
{@code fromIndex}, inclusive, and {@code toIndex}, exclusive.
Shifts any succeeding elements to the left (reduces their index).
This call shortens the list by {@code (toIndex - fromInde... | java | protected void removeRange(int fromIndex, int toIndex) {
// Android-changed: Throw an IOOBE if toIndex < fromIndex as documented.
// All the other cases (negative indices, or indices greater than the size
// will be thrown by System#arrayCopy.
if (toIndex < fromIndex) {
throw... | [
"protected",
"void",
"removeRange",
"(",
"int",
"fromIndex",
",",
"int",
"toIndex",
")",
"{",
"// Android-changed: Throw an IOOBE if toIndex < fromIndex as documented.",
"// All the other cases (negative indices, or indices greater than the size",
"// will be thrown by System#arrayCopy.",
... | Removes from this list all of the elements whose index is between
{@code fromIndex}, inclusive, and {@code toIndex}, exclusive.
Shifts any succeeding elements to the left (reduces their index).
This call shortens the list by {@code (toIndex - fromIndex)} elements.
(If {@code toIndex==fromIndex}, this operation has no e... | [
"Removes",
"from",
"this",
"list",
"all",
"of",
"the",
"elements",
"whose",
"index",
"is",
"between",
"{",
"@code",
"fromIndex",
"}",
"inclusive",
"and",
"{",
"@code",
"toIndex",
"}",
"exclusive",
".",
"Shifts",
"any",
"succeeding",
"elements",
"to",
"the",
... | train | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/libcore/ojluni/src/main/java/java/util/ArrayList.java#L643-L662 |
alkacon/opencms-core | src/org/opencms/publish/CmsPublishManager.java | CmsPublishManager.mergePublishLists | public CmsPublishList mergePublishLists(CmsObject cms, CmsPublishList pubList1, CmsPublishList pubList2)
throws CmsException {
"""
Returns a new publish list that contains all resources of both given publish lists.<p>
@param cms the cms request context
@param pubList1 the first publish list
@param pubList... | java | public CmsPublishList mergePublishLists(CmsObject cms, CmsPublishList pubList1, CmsPublishList pubList2)
throws CmsException {
return m_securityManager.mergePublishLists(cms.getRequestContext(), pubList1, pubList2);
} | [
"public",
"CmsPublishList",
"mergePublishLists",
"(",
"CmsObject",
"cms",
",",
"CmsPublishList",
"pubList1",
",",
"CmsPublishList",
"pubList2",
")",
"throws",
"CmsException",
"{",
"return",
"m_securityManager",
".",
"mergePublishLists",
"(",
"cms",
".",
"getRequestConte... | Returns a new publish list that contains all resources of both given publish lists.<p>
@param cms the cms request context
@param pubList1 the first publish list
@param pubList2 the second publish list
@return a new publish list that contains all resources of both given publish lists
@throws CmsException if something... | [
"Returns",
"a",
"new",
"publish",
"list",
"that",
"contains",
"all",
"resources",
"of",
"both",
"given",
"publish",
"lists",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/publish/CmsPublishManager.java#L509-L513 |
alkacon/opencms-core | src/org/opencms/ui/apps/CmsDefaultAppButtonProvider.java | CmsDefaultAppButtonProvider.createAppIconButton | public static Button createAppIconButton(I_CmsWorkplaceAppConfiguration appConfig, Locale locale) {
"""
Creates a properly styled button for the given app, without adding a click handler or checking visibility settings.<p>
@param appConfig the app configuration
@param locale the locale
@return the button co... | java | public static Button createAppIconButton(I_CmsWorkplaceAppConfiguration appConfig, Locale locale) {
return createIconButton(
appConfig.getName(locale),
appConfig.getHelpText(locale),
appConfig.getIcon(),
appConfig.getButtonStyle());
} | [
"public",
"static",
"Button",
"createAppIconButton",
"(",
"I_CmsWorkplaceAppConfiguration",
"appConfig",
",",
"Locale",
"locale",
")",
"{",
"return",
"createIconButton",
"(",
"appConfig",
".",
"getName",
"(",
"locale",
")",
",",
"appConfig",
".",
"getHelpText",
"(",... | Creates a properly styled button for the given app, without adding a click handler or checking visibility settings.<p>
@param appConfig the app configuration
@param locale the locale
@return the button component | [
"Creates",
"a",
"properly",
"styled",
"button",
"for",
"the",
"given",
"app",
"without",
"adding",
"a",
"click",
"handler",
"or",
"checking",
"visibility",
"settings",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/ui/apps/CmsDefaultAppButtonProvider.java#L177-L184 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.