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 |
|---|---|---|---|---|---|---|---|---|---|---|
Azure/azure-sdk-for-java | cognitiveservices/data-plane/vision/computervision/src/main/java/com/microsoft/azure/cognitiveservices/vision/computervision/implementation/ComputerVisionImpl.java | ComputerVisionImpl.recognizeText | public void recognizeText(String url, TextRecognitionMode mode) {
"""
Recognize Text operation. When you use the Recognize Text interface, the response contains a field called 'Operation-Location'. The 'Operation-Location' field contains the URL that you must use for your Get Recognize Text Operation Result operat... | java | public void recognizeText(String url, TextRecognitionMode mode) {
recognizeTextWithServiceResponseAsync(url, mode).toBlocking().single().body();
} | [
"public",
"void",
"recognizeText",
"(",
"String",
"url",
",",
"TextRecognitionMode",
"mode",
")",
"{",
"recognizeTextWithServiceResponseAsync",
"(",
"url",
",",
"mode",
")",
".",
"toBlocking",
"(",
")",
".",
"single",
"(",
")",
".",
"body",
"(",
")",
";",
... | Recognize Text operation. When you use the Recognize Text interface, the response contains a field called 'Operation-Location'. The 'Operation-Location' field contains the URL that you must use for your Get Recognize Text Operation Result operation.
@param mode Type of text to recognize. Possible values include: 'Hand... | [
"Recognize",
"Text",
"operation",
".",
"When",
"you",
"use",
"the",
"Recognize",
"Text",
"interface",
"the",
"response",
"contains",
"a",
"field",
"called",
"Operation",
"-",
"Location",
".",
"The",
"Operation",
"-",
"Location",
"field",
"contains",
"the",
"UR... | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/cognitiveservices/data-plane/vision/computervision/src/main/java/com/microsoft/azure/cognitiveservices/vision/computervision/implementation/ComputerVisionImpl.java#L1326-L1328 |
op4j/op4j | src/main/java/org/op4j/functions/FnCalendar.java | FnCalendar.toStr | public static final Function<Calendar,String> toStr(final DateStyle dateStyle, final TimeStyle timeStyle) {
"""
<p>
Converts the target Calendar into a String using the specified date ({@link DateStyle})
and time ({@link TimeStyle}) styles.
</p>
@param dateStyle the date style to be used
@param timeStyle th... | java | public static final Function<Calendar,String> toStr(final DateStyle dateStyle, final TimeStyle timeStyle) {
return new ToString(dateStyle, timeStyle);
} | [
"public",
"static",
"final",
"Function",
"<",
"Calendar",
",",
"String",
">",
"toStr",
"(",
"final",
"DateStyle",
"dateStyle",
",",
"final",
"TimeStyle",
"timeStyle",
")",
"{",
"return",
"new",
"ToString",
"(",
"dateStyle",
",",
"timeStyle",
")",
";",
"}"
] | <p>
Converts the target Calendar into a String using the specified date ({@link DateStyle})
and time ({@link TimeStyle}) styles.
</p>
@param dateStyle the date style to be used
@param timeStyle the time style to be used
@return the String representation of the Calendar. | [
"<p",
">",
"Converts",
"the",
"target",
"Calendar",
"into",
"a",
"String",
"using",
"the",
"specified",
"date",
"(",
"{",
"@link",
"DateStyle",
"}",
")",
"and",
"time",
"(",
"{",
"@link",
"TimeStyle",
"}",
")",
"styles",
".",
"<",
"/",
"p",
">"
] | train | https://github.com/op4j/op4j/blob/b577596dfe462089d3dd169666defc6de7ad289a/src/main/java/org/op4j/functions/FnCalendar.java#L422-L424 |
hageldave/ImagingKit | ImagingKit_Fourier/src/main/java/hageldave/imagingkit/fourier/Fourier.java | Fourier.inverseTransform | public static ColorImg inverseTransform(ColorImg target, ComplexImg fourier, int channel) {
"""
Executes the inverse Fourier transforms on the specified {@link ComplexImg} that corresponds
to a specific channel of a {@link ColorImg} defined by the channel argument.
The resulting transform will be stored in the s... | java | public static ColorImg inverseTransform(ColorImg target, ComplexImg fourier, int channel) {
Dimension dim = fourier.getDimension();
// if no target was specified create a new one
if(target == null) {
target = new ColorImg(dim, channel==ColorImg.channel_a);
}
// continue sanity checks
sanityCheckInverse_t... | [
"public",
"static",
"ColorImg",
"inverseTransform",
"(",
"ColorImg",
"target",
",",
"ComplexImg",
"fourier",
",",
"int",
"channel",
")",
"{",
"Dimension",
"dim",
"=",
"fourier",
".",
"getDimension",
"(",
")",
";",
"// if no target was specified create a new one",
"i... | Executes the inverse Fourier transforms on the specified {@link ComplexImg} that corresponds
to a specific channel of a {@link ColorImg} defined by the channel argument.
The resulting transform will be stored in the specified channel of the specified target.
If target is null a new ColorImg will be created and returned... | [
"Executes",
"the",
"inverse",
"Fourier",
"transforms",
"on",
"the",
"specified",
"{",
"@link",
"ComplexImg",
"}",
"that",
"corresponds",
"to",
"a",
"specific",
"channel",
"of",
"a",
"{",
"@link",
"ColorImg",
"}",
"defined",
"by",
"the",
"channel",
"argument",
... | train | https://github.com/hageldave/ImagingKit/blob/3837c7d550a12cf4dc5718b644ced94b97f52668/ImagingKit_Fourier/src/main/java/hageldave/imagingkit/fourier/Fourier.java#L139-L161 |
google/j2objc | jre_emul/android/platform/external/icu/android_icu4j/src/main/java/android/icu/text/CompactDecimalDataCache.java | CompactDecimalDataCache.calculateDivisor | private static long calculateDivisor(long power10, int numZeros) {
"""
Calculate a divisor based on the magnitude and number of zeros in the
template string.
@param power10
@param numZeros
@return
"""
// We craft our divisor such that when we divide by it, we get a
// number with the same n... | java | private static long calculateDivisor(long power10, int numZeros) {
// We craft our divisor such that when we divide by it, we get a
// number with the same number of digits as zeros found in the
// plural variant templates. If our magnitude is 10000 and we have
// two 0's in our plural v... | [
"private",
"static",
"long",
"calculateDivisor",
"(",
"long",
"power10",
",",
"int",
"numZeros",
")",
"{",
"// We craft our divisor such that when we divide by it, we get a",
"// number with the same number of digits as zeros found in the",
"// plural variant templates. If our magnitude ... | Calculate a divisor based on the magnitude and number of zeros in the
template string.
@param power10
@param numZeros
@return | [
"Calculate",
"a",
"divisor",
"based",
"on",
"the",
"magnitude",
"and",
"number",
"of",
"zeros",
"in",
"the",
"template",
"string",
"."
] | train | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/external/icu/android_icu4j/src/main/java/android/icu/text/CompactDecimalDataCache.java#L381-L393 |
groupon/monsoon | intf/src/main/java/com/groupon/lex/metrics/resolver/NamedResolverMap.java | NamedResolverMap.getBooleanOrDefault | public boolean getBooleanOrDefault(int key, boolean dfl) {
"""
Return the boolean value indicated by the given numeric key.
@param key The key of the value to return.
@param dfl The default value to return, if the key is absent.
@return The boolean value stored under the given key, or dfl.
@throws IllegalArg... | java | public boolean getBooleanOrDefault(int key, boolean dfl) {
Any3<Boolean, Integer, String> value = data.getOrDefault(Any2.<Integer, String>left(key), Any3.<Boolean, Integer, String>create1(dfl));
return value.get1().orElseThrow(() -> new IllegalArgumentException("expected boolean argument for param " + k... | [
"public",
"boolean",
"getBooleanOrDefault",
"(",
"int",
"key",
",",
"boolean",
"dfl",
")",
"{",
"Any3",
"<",
"Boolean",
",",
"Integer",
",",
"String",
">",
"value",
"=",
"data",
".",
"getOrDefault",
"(",
"Any2",
".",
"<",
"Integer",
",",
"String",
">",
... | Return the boolean value indicated by the given numeric key.
@param key The key of the value to return.
@param dfl The default value to return, if the key is absent.
@return The boolean value stored under the given key, or dfl.
@throws IllegalArgumentException if the value is present, but not a
boolean. | [
"Return",
"the",
"boolean",
"value",
"indicated",
"by",
"the",
"given",
"numeric",
"key",
"."
] | train | https://github.com/groupon/monsoon/blob/eb68d72ba4c01fe018dc981097dbee033908f5c7/intf/src/main/java/com/groupon/lex/metrics/resolver/NamedResolverMap.java#L45-L48 |
apache/flink | flink-runtime/src/main/java/org/apache/flink/runtime/checkpoint/StateAssignmentOperation.java | StateAssignmentOperation.checkParallelismPreconditions | private static void checkParallelismPreconditions(OperatorState operatorState, ExecutionJobVertex executionJobVertex) {
"""
Verifies conditions in regards to parallelism and maxParallelism that must be met when restoring state.
@param operatorState state to restore
@param executionJobVertex task for which... | java | private static void checkParallelismPreconditions(OperatorState operatorState, ExecutionJobVertex executionJobVertex) {
//----------------------------------------max parallelism preconditions-------------------------------------
if (operatorState.getMaxParallelism() < executionJobVertex.getParallelism()) {
thro... | [
"private",
"static",
"void",
"checkParallelismPreconditions",
"(",
"OperatorState",
"operatorState",
",",
"ExecutionJobVertex",
"executionJobVertex",
")",
"{",
"//----------------------------------------max parallelism preconditions-------------------------------------",
"if",
"(",
"op... | Verifies conditions in regards to parallelism and maxParallelism that must be met when restoring state.
@param operatorState state to restore
@param executionJobVertex task for which the state should be restored | [
"Verifies",
"conditions",
"in",
"regards",
"to",
"parallelism",
"and",
"maxParallelism",
"that",
"must",
"be",
"met",
"when",
"restoring",
"state",
"."
] | train | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-runtime/src/main/java/org/apache/flink/runtime/checkpoint/StateAssignmentOperation.java#L510-L541 |
lucee/Lucee | core/src/main/java/lucee/commons/io/SystemUtil.java | SystemUtil.getSystemPropOrEnvVar | public static String getSystemPropOrEnvVar(String name, String defaultValue) {
"""
returns a system setting by either a Java property name or a System environment variable
@param name - either a lowercased Java property name (e.g. lucee.controller.disabled) or an
UPPERCASED Environment variable name ((e.g. LUC... | java | public static String getSystemPropOrEnvVar(String name, String defaultValue) {
// env
String value = System.getenv(name);
if (!StringUtil.isEmpty(value)) return value;
// prop
value = System.getProperty(name);
if (!StringUtil.isEmpty(value)) return value;
// env 2
name = convertSystemPropToEnvVar(name);
valu... | [
"public",
"static",
"String",
"getSystemPropOrEnvVar",
"(",
"String",
"name",
",",
"String",
"defaultValue",
")",
"{",
"// env",
"String",
"value",
"=",
"System",
".",
"getenv",
"(",
"name",
")",
";",
"if",
"(",
"!",
"StringUtil",
".",
"isEmpty",
"(",
"val... | returns a system setting by either a Java property name or a System environment variable
@param name - either a lowercased Java property name (e.g. lucee.controller.disabled) or an
UPPERCASED Environment variable name ((e.g. LUCEE_CONTROLLER_DISABLED))
@param defaultValue - value to return if the neither the property ... | [
"returns",
"a",
"system",
"setting",
"by",
"either",
"a",
"Java",
"property",
"name",
"or",
"a",
"System",
"environment",
"variable"
] | train | https://github.com/lucee/Lucee/blob/29b153fc4e126e5edb97da937f2ee2e231b87593/core/src/main/java/lucee/commons/io/SystemUtil.java#L1165-L1180 |
apache/groovy | subprojects/groovy-sql/src/main/java/groovy/sql/Sql.java | Sql.executeInsert | public List<GroovyRowResult> executeInsert(Map params, String sql, List<String> keyColumnNames) throws SQLException {
"""
A variant of {@link #executeInsert(String, List, List)}
useful when providing the named parameters as named arguments.
This variant allows you to receive the values of any auto-generated colu... | java | public List<GroovyRowResult> executeInsert(Map params, String sql, List<String> keyColumnNames) throws SQLException {
return executeInsert(sql, singletonList(params), keyColumnNames);
} | [
"public",
"List",
"<",
"GroovyRowResult",
">",
"executeInsert",
"(",
"Map",
"params",
",",
"String",
"sql",
",",
"List",
"<",
"String",
">",
"keyColumnNames",
")",
"throws",
"SQLException",
"{",
"return",
"executeInsert",
"(",
"sql",
",",
"singletonList",
"(",... | A variant of {@link #executeInsert(String, List, List)}
useful when providing the named parameters as named arguments.
This variant allows you to receive the values of any auto-generated columns,
such as an autoincrement ID field (or fields) when you know the column name(s) of the ID field(s).
@param params a ... | [
"A",
"variant",
"of",
"{",
"@link",
"#executeInsert",
"(",
"String",
"List",
"List",
")",
"}",
"useful",
"when",
"providing",
"the",
"named",
"parameters",
"as",
"named",
"arguments",
".",
"This",
"variant",
"allows",
"you",
"to",
"receive",
"the",
"values",... | train | https://github.com/apache/groovy/blob/71cf20addb611bb8d097a59e395fd20bc7f31772/subprojects/groovy-sql/src/main/java/groovy/sql/Sql.java#L2736-L2738 |
kuali/ojb-1.0.4 | src/java/org/apache/ojb/odmg/locking/ReadCommittedStrategy.java | ReadCommittedStrategy.checkWrite | public boolean checkWrite(TransactionImpl tx, Object obj) {
"""
checks whether the specified Object obj is write-locked by Transaction tx.
@param tx the transaction
@param obj the Object to be checked
@return true if lock exists, else false
"""
LockEntry writer = getWriter(obj);
if (writer... | java | public boolean checkWrite(TransactionImpl tx, Object obj)
{
LockEntry writer = getWriter(obj);
if (writer == null)
return false;
else if (writer.isOwnedBy(tx))
return true;
else
return false;
} | [
"public",
"boolean",
"checkWrite",
"(",
"TransactionImpl",
"tx",
",",
"Object",
"obj",
")",
"{",
"LockEntry",
"writer",
"=",
"getWriter",
"(",
"obj",
")",
";",
"if",
"(",
"writer",
"==",
"null",
")",
"return",
"false",
";",
"else",
"if",
"(",
"writer",
... | checks whether the specified Object obj is write-locked by Transaction tx.
@param tx the transaction
@param obj the Object to be checked
@return true if lock exists, else false | [
"checks",
"whether",
"the",
"specified",
"Object",
"obj",
"is",
"write",
"-",
"locked",
"by",
"Transaction",
"tx",
"."
] | train | https://github.com/kuali/ojb-1.0.4/blob/9a544372f67ce965f662cdc71609dd03683c8f04/src/java/org/apache/ojb/odmg/locking/ReadCommittedStrategy.java#L176-L185 |
pravega/pravega | controller/src/main/java/io/pravega/controller/metrics/StreamMetrics.java | StreamMetrics.createStream | public void createStream(String scope, String streamName, int minNumSegments, Duration latency) {
"""
This method increments the global and Stream-specific counters of Stream creations, initializes other
stream-specific metrics and reports the latency of the operation.
@param scope Scope.
@param s... | java | public void createStream(String scope, String streamName, int minNumSegments, Duration latency) {
DYNAMIC_LOGGER.incCounterValue(CREATE_STREAM, 1);
DYNAMIC_LOGGER.reportGaugeValue(OPEN_TRANSACTIONS, 0, streamTags(scope, streamName));
DYNAMIC_LOGGER.reportGaugeValue(SEGMENTS_COUNT, minNumSegments... | [
"public",
"void",
"createStream",
"(",
"String",
"scope",
",",
"String",
"streamName",
",",
"int",
"minNumSegments",
",",
"Duration",
"latency",
")",
"{",
"DYNAMIC_LOGGER",
".",
"incCounterValue",
"(",
"CREATE_STREAM",
",",
"1",
")",
";",
"DYNAMIC_LOGGER",
".",
... | This method increments the global and Stream-specific counters of Stream creations, initializes other
stream-specific metrics and reports the latency of the operation.
@param scope Scope.
@param streamName Name of the Stream.
@param minNumSegments Initial number of segments for the Stream.
@param... | [
"This",
"method",
"increments",
"the",
"global",
"and",
"Stream",
"-",
"specific",
"counters",
"of",
"Stream",
"creations",
"initializes",
"other",
"stream",
"-",
"specific",
"metrics",
"and",
"reports",
"the",
"latency",
"of",
"the",
"operation",
"."
] | train | https://github.com/pravega/pravega/blob/6e24df7470669b3956a07018f52b2c6b3c2a3503/controller/src/main/java/io/pravega/controller/metrics/StreamMetrics.java#L58-L66 |
Azure/azure-sdk-for-java | keyvault/data-plane/azure-keyvault/src/main/java/com/microsoft/azure/keyvault/implementation/KeyVaultClientBaseImpl.java | KeyVaultClientBaseImpl.updateCertificateIssuerAsync | public Observable<IssuerBundle> updateCertificateIssuerAsync(String vaultBaseUrl, String issuerName) {
"""
Updates the specified certificate issuer.
The UpdateCertificateIssuer operation performs an update on the specified certificate issuer entity. This operation requires the certificates/setissuers permission.
... | java | public Observable<IssuerBundle> updateCertificateIssuerAsync(String vaultBaseUrl, String issuerName) {
return updateCertificateIssuerWithServiceResponseAsync(vaultBaseUrl, issuerName).map(new Func1<ServiceResponse<IssuerBundle>, IssuerBundle>() {
@Override
public IssuerBundle call(Servic... | [
"public",
"Observable",
"<",
"IssuerBundle",
">",
"updateCertificateIssuerAsync",
"(",
"String",
"vaultBaseUrl",
",",
"String",
"issuerName",
")",
"{",
"return",
"updateCertificateIssuerWithServiceResponseAsync",
"(",
"vaultBaseUrl",
",",
"issuerName",
")",
".",
"map",
... | Updates the specified certificate issuer.
The UpdateCertificateIssuer operation performs an update on the specified certificate issuer entity. This operation requires the certificates/setissuers permission.
@param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net.
@param issuerName The name of t... | [
"Updates",
"the",
"specified",
"certificate",
"issuer",
".",
"The",
"UpdateCertificateIssuer",
"operation",
"performs",
"an",
"update",
"on",
"the",
"specified",
"certificate",
"issuer",
"entity",
".",
"This",
"operation",
"requires",
"the",
"certificates",
"/",
"se... | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/keyvault/data-plane/azure-keyvault/src/main/java/com/microsoft/azure/keyvault/implementation/KeyVaultClientBaseImpl.java#L6137-L6144 |
lucee/Lucee | core/src/main/java/lucee/commons/lang/StringUtil.java | StringUtil.replaceMap | public static String replaceMap(String input, Map map, boolean ignoreCase) throws PageException {
"""
this is the public entry point for the replaceMap() method
@param input - the string on which the replacements should be performed.
@param map - a java.util.Map with key/value pairs where the key is the substr... | java | public static String replaceMap(String input, Map map, boolean ignoreCase) throws PageException {
return replaceMap(input, map, ignoreCase, true);
} | [
"public",
"static",
"String",
"replaceMap",
"(",
"String",
"input",
",",
"Map",
"map",
",",
"boolean",
"ignoreCase",
")",
"throws",
"PageException",
"{",
"return",
"replaceMap",
"(",
"input",
",",
"map",
",",
"ignoreCase",
",",
"true",
")",
";",
"}"
] | this is the public entry point for the replaceMap() method
@param input - the string on which the replacements should be performed.
@param map - a java.util.Map with key/value pairs where the key is the substring to find and the
value is the substring with which to replace the matched key
@param ignoreCase - if true t... | [
"this",
"is",
"the",
"public",
"entry",
"point",
"for",
"the",
"replaceMap",
"()",
"method"
] | train | https://github.com/lucee/Lucee/blob/29b153fc4e126e5edb97da937f2ee2e231b87593/core/src/main/java/lucee/commons/lang/StringUtil.java#L1324-L1327 |
javagl/ND | nd-tuples/src/main/java/de/javagl/nd/tuples/d/DoubleTupleCollections.java | DoubleTupleCollections.getSize | private static int getSize(Tuple t, Iterable<? extends Tuple> tuples) {
"""
Returns the size of the given tuple. If the given tuple is
<code>null</code>, then the size of the first tuple of the
given sequence is returned. If this first tuple is <code>null</code>,
or the given sequence is empty, then -1 is retur... | java | private static int getSize(Tuple t, Iterable<? extends Tuple> tuples)
{
if (t != null)
{
return t.getSize();
}
Iterator<? extends Tuple> iterator = tuples.iterator();
if (iterator.hasNext())
{
Tuple first = iterator.next();
... | [
"private",
"static",
"int",
"getSize",
"(",
"Tuple",
"t",
",",
"Iterable",
"<",
"?",
"extends",
"Tuple",
">",
"tuples",
")",
"{",
"if",
"(",
"t",
"!=",
"null",
")",
"{",
"return",
"t",
".",
"getSize",
"(",
")",
";",
"}",
"Iterator",
"<",
"?",
"ex... | Returns the size of the given tuple. If the given tuple is
<code>null</code>, then the size of the first tuple of the
given sequence is returned. If this first tuple is <code>null</code>,
or the given sequence is empty, then -1 is returned.
@param t The tuple
@param tuples The tuples
@return The size | [
"Returns",
"the",
"size",
"of",
"the",
"given",
"tuple",
".",
"If",
"the",
"given",
"tuple",
"is",
"<code",
">",
"null<",
"/",
"code",
">",
"then",
"the",
"size",
"of",
"the",
"first",
"tuple",
"of",
"the",
"given",
"sequence",
"is",
"returned",
".",
... | train | https://github.com/javagl/ND/blob/bcb655aaf5fc88af6194f73a27cca079186ff559/nd-tuples/src/main/java/de/javagl/nd/tuples/d/DoubleTupleCollections.java#L290-L306 |
apache/flink | flink-table/flink-table-runtime-blink/src/main/java/org/apache/flink/table/util/SegmentsUtil.java | SegmentsUtil.setShort | public static void setShort(MemorySegment[] segments, int offset, short value) {
"""
set short from segments.
@param segments target segments.
@param offset value offset.
"""
if (inFirstSegment(segments, offset, 2)) {
segments[0].putShort(offset, value);
} else {
setShortMultiSegments(segments, o... | java | public static void setShort(MemorySegment[] segments, int offset, short value) {
if (inFirstSegment(segments, offset, 2)) {
segments[0].putShort(offset, value);
} else {
setShortMultiSegments(segments, offset, value);
}
} | [
"public",
"static",
"void",
"setShort",
"(",
"MemorySegment",
"[",
"]",
"segments",
",",
"int",
"offset",
",",
"short",
"value",
")",
"{",
"if",
"(",
"inFirstSegment",
"(",
"segments",
",",
"offset",
",",
"2",
")",
")",
"{",
"segments",
"[",
"0",
"]",
... | set short from segments.
@param segments target segments.
@param offset value offset. | [
"set",
"short",
"from",
"segments",
"."
] | train | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-table/flink-table-runtime-blink/src/main/java/org/apache/flink/table/util/SegmentsUtil.java#L826-L832 |
pierre/serialization | hadoop/src/main/java/com/ning/metrics/serialization/hadoop/pig/SmileStorage.java | SmileStorage.prepareToRead | @Override
public void prepareToRead(final RecordReader reader, final PigSplit split) throws IOException {
"""
Initializes LoadFunc for reading data. This will be called during execution
before any calls to getNext. The RecordReader needs to be passed here because
it has been instantiated for a particular I... | java | @Override
public void prepareToRead(final RecordReader reader, final PigSplit split) throws IOException
{
this.reader = reader;
this.split = split;
} | [
"@",
"Override",
"public",
"void",
"prepareToRead",
"(",
"final",
"RecordReader",
"reader",
",",
"final",
"PigSplit",
"split",
")",
"throws",
"IOException",
"{",
"this",
".",
"reader",
"=",
"reader",
";",
"this",
".",
"split",
"=",
"split",
";",
"}"
] | Initializes LoadFunc for reading data. This will be called during execution
before any calls to getNext. The RecordReader needs to be passed here because
it has been instantiated for a particular InputSplit.
@param reader {@link org.apache.hadoop.mapreduce.RecordReader} to be used by this instance of the LoadFunc
@p... | [
"Initializes",
"LoadFunc",
"for",
"reading",
"data",
".",
"This",
"will",
"be",
"called",
"during",
"execution",
"before",
"any",
"calls",
"to",
"getNext",
".",
"The",
"RecordReader",
"needs",
"to",
"be",
"passed",
"here",
"because",
"it",
"has",
"been",
"in... | train | https://github.com/pierre/serialization/blob/b15b7c749ba78bfe94dce8fc22f31b30b2e6830b/hadoop/src/main/java/com/ning/metrics/serialization/hadoop/pig/SmileStorage.java#L138-L143 |
Azure/azure-sdk-for-java | network/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/network/v2018_04_01/implementation/ApplicationGatewaysInner.java | ApplicationGatewaysInner.beginUpdateTags | public ApplicationGatewayInner beginUpdateTags(String resourceGroupName, String applicationGatewayName) {
"""
Updates the specified application gateway tags.
@param resourceGroupName The name of the resource group.
@param applicationGatewayName The name of the application gateway.
@throws IllegalArgumentExcep... | java | public ApplicationGatewayInner beginUpdateTags(String resourceGroupName, String applicationGatewayName) {
return beginUpdateTagsWithServiceResponseAsync(resourceGroupName, applicationGatewayName).toBlocking().single().body();
} | [
"public",
"ApplicationGatewayInner",
"beginUpdateTags",
"(",
"String",
"resourceGroupName",
",",
"String",
"applicationGatewayName",
")",
"{",
"return",
"beginUpdateTagsWithServiceResponseAsync",
"(",
"resourceGroupName",
",",
"applicationGatewayName",
")",
".",
"toBlocking",
... | Updates the specified application gateway tags.
@param resourceGroupName The name of the resource group.
@param applicationGatewayName The name of the application gateway.
@throws IllegalArgumentException thrown if parameters fail the validation
@throws CloudException thrown if the request is rejected by server
@throw... | [
"Updates",
"the",
"specified",
"application",
"gateway",
"tags",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/network/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/network/v2018_04_01/implementation/ApplicationGatewaysInner.java#L716-L718 |
padrig64/ValidationFramework | validationframework-swing/src/main/java/com/google/code/validationframework/swing/decoration/utils/IconUtils.java | IconUtils.loadImageIcon | public static ImageIcon loadImageIcon(final String iconName, final Class<?> clazz) {
"""
Loads an image icon from a resource file.
@param iconName Name of the resource file to be loaded.
@param clazz Class for which the resource exists.
@return Image icon if it could be loaded, null otherwise.
"""
... | java | public static ImageIcon loadImageIcon(final String iconName, final Class<?> clazz) {
ImageIcon icon = null;
if (iconName != null) {
final URL iconResource = clazz.getResource(iconName);
if (iconResource == null) {
LOGGER.error("Icon could not be loaded: '" + icon... | [
"public",
"static",
"ImageIcon",
"loadImageIcon",
"(",
"final",
"String",
"iconName",
",",
"final",
"Class",
"<",
"?",
">",
"clazz",
")",
"{",
"ImageIcon",
"icon",
"=",
"null",
";",
"if",
"(",
"iconName",
"!=",
"null",
")",
"{",
"final",
"URL",
"iconReso... | Loads an image icon from a resource file.
@param iconName Name of the resource file to be loaded.
@param clazz Class for which the resource exists.
@return Image icon if it could be loaded, null otherwise. | [
"Loads",
"an",
"image",
"icon",
"from",
"a",
"resource",
"file",
"."
] | train | https://github.com/padrig64/ValidationFramework/blob/2dd3c7b3403993db366d24a927645f467ccd1dda/validationframework-swing/src/main/java/com/google/code/validationframework/swing/decoration/utils/IconUtils.java#L68-L82 |
goldmansachs/gs-collections | collections/src/main/java/com/gs/collections/impl/utility/Iterate.java | Iterate.detectIndex | public static <T> int detectIndex(Iterable<T> iterable, Predicate<? super T> predicate) {
"""
Searches for the first occurrence where the predicate evaluates to true, returns -1 if the predicate does not evaluate to true.
"""
if (iterable instanceof ArrayList<?>)
{
return ArrayListI... | java | public static <T> int detectIndex(Iterable<T> iterable, Predicate<? super T> predicate)
{
if (iterable instanceof ArrayList<?>)
{
return ArrayListIterate.detectIndex((ArrayList<T>) iterable, predicate);
}
if (iterable instanceof List<?>)
{
return ListI... | [
"public",
"static",
"<",
"T",
">",
"int",
"detectIndex",
"(",
"Iterable",
"<",
"T",
">",
"iterable",
",",
"Predicate",
"<",
"?",
"super",
"T",
">",
"predicate",
")",
"{",
"if",
"(",
"iterable",
"instanceof",
"ArrayList",
"<",
"?",
">",
")",
"{",
"ret... | Searches for the first occurrence where the predicate evaluates to true, returns -1 if the predicate does not evaluate to true. | [
"Searches",
"for",
"the",
"first",
"occurrence",
"where",
"the",
"predicate",
"evaluates",
"to",
"true",
"returns",
"-",
"1",
"if",
"the",
"predicate",
"does",
"not",
"evaluate",
"to",
"true",
"."
] | train | https://github.com/goldmansachs/gs-collections/blob/fa8bf3e103689efa18bca2ab70203e71cde34b52/collections/src/main/java/com/gs/collections/impl/utility/Iterate.java#L2357-L2372 |
apache/fluo | modules/api/src/main/java/org/apache/fluo/api/data/Bytes.java | Bytes.compareTo | @Override
public final int compareTo(Bytes other) {
"""
Compares this to the passed bytes, byte by byte, returning a negative, zero, or positive result
if the first sequence is less than, equal to, or greater than the second. The comparison is
performed starting with the first byte of each sequence, and procee... | java | @Override
public final int compareTo(Bytes other) {
if (this == other) {
return 0;
} else {
return compareToUnchecked(other.data, other.offset, other.length);
}
} | [
"@",
"Override",
"public",
"final",
"int",
"compareTo",
"(",
"Bytes",
"other",
")",
"{",
"if",
"(",
"this",
"==",
"other",
")",
"{",
"return",
"0",
";",
"}",
"else",
"{",
"return",
"compareToUnchecked",
"(",
"other",
".",
"data",
",",
"other",
".",
"... | Compares this to the passed bytes, byte by byte, returning a negative, zero, or positive result
if the first sequence is less than, equal to, or greater than the second. The comparison is
performed starting with the first byte of each sequence, and proceeds until a pair of bytes
differs, or one sequence runs out of byt... | [
"Compares",
"this",
"to",
"the",
"passed",
"bytes",
"byte",
"by",
"byte",
"returning",
"a",
"negative",
"zero",
"or",
"positive",
"result",
"if",
"the",
"first",
"sequence",
"is",
"less",
"than",
"equal",
"to",
"or",
"greater",
"than",
"the",
"second",
"."... | train | https://github.com/apache/fluo/blob/8e06204d4167651e2d3b5219b8c1397644e6ba6e/modules/api/src/main/java/org/apache/fluo/api/data/Bytes.java#L198-L205 |
datastax/java-driver | core/src/main/java/com/datastax/oss/driver/internal/core/type/codec/registry/CachingCodecRegistry.java | CachingCodecRegistry.codecFor | protected <JavaTypeT> TypeCodec<JavaTypeT> codecFor(
GenericType<JavaTypeT> javaType, boolean isJavaCovariant) {
"""
Not exposed publicly, (isJavaCovariant=true) is only used for internal recursion
"""
LOG.trace(
"[{}] Looking up codec for Java type {} (covariant = {})",
logPrefix,
... | java | protected <JavaTypeT> TypeCodec<JavaTypeT> codecFor(
GenericType<JavaTypeT> javaType, boolean isJavaCovariant) {
LOG.trace(
"[{}] Looking up codec for Java type {} (covariant = {})",
logPrefix,
javaType,
isJavaCovariant);
for (TypeCodec<?> primitiveCodec : primitiveCodecs) ... | [
"protected",
"<",
"JavaTypeT",
">",
"TypeCodec",
"<",
"JavaTypeT",
">",
"codecFor",
"(",
"GenericType",
"<",
"JavaTypeT",
">",
"javaType",
",",
"boolean",
"isJavaCovariant",
")",
"{",
"LOG",
".",
"trace",
"(",
"\"[{}] Looking up codec for Java type {} (covariant = {})... | Not exposed publicly, (isJavaCovariant=true) is only used for internal recursion | [
"Not",
"exposed",
"publicly",
"(",
"isJavaCovariant",
"=",
"true",
")",
"is",
"only",
"used",
"for",
"internal",
"recursion"
] | train | https://github.com/datastax/java-driver/blob/612a63f2525618e2020e86c9ad75ab37adba6132/core/src/main/java/com/datastax/oss/driver/internal/core/type/codec/registry/CachingCodecRegistry.java#L220-L240 |
Azure/azure-sdk-for-java | containerinstance/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2018_02_01_preview/implementation/ContainerGroupsInner.java | ContainerGroupsInner.beginCreateOrUpdate | public ContainerGroupInner beginCreateOrUpdate(String resourceGroupName, String containerGroupName, ContainerGroupInner containerGroup) {
"""
Create or update container groups.
Create or update container groups with specified configurations.
@param resourceGroupName The name of the resource group.
@param cont... | java | public ContainerGroupInner beginCreateOrUpdate(String resourceGroupName, String containerGroupName, ContainerGroupInner containerGroup) {
return beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, containerGroupName, containerGroup).toBlocking().single().body();
} | [
"public",
"ContainerGroupInner",
"beginCreateOrUpdate",
"(",
"String",
"resourceGroupName",
",",
"String",
"containerGroupName",
",",
"ContainerGroupInner",
"containerGroup",
")",
"{",
"return",
"beginCreateOrUpdateWithServiceResponseAsync",
"(",
"resourceGroupName",
",",
"cont... | Create or update container groups.
Create or update container groups with specified configurations.
@param resourceGroupName The name of the resource group.
@param containerGroupName The name of the container group.
@param containerGroup The properties of the container group to be created or updated.
@throws IllegalAr... | [
"Create",
"or",
"update",
"container",
"groups",
".",
"Create",
"or",
"update",
"container",
"groups",
"with",
"specified",
"configurations",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/containerinstance/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2018_02_01_preview/implementation/ContainerGroupsInner.java#L522-L524 |
hazelcast/hazelcast | hazelcast/src/main/java/com/hazelcast/util/JsonUtil.java | JsonUtil.getInt | public static int getInt(JsonObject object, String field, int defaultValue) {
"""
Returns a field in a Json object as an int.
@param object the Json Object
@param field the field in the Json object to return
@param defaultValue a default value for the field if the field value is null
@return the Json field v... | java | public static int getInt(JsonObject object, String field, int defaultValue) {
final JsonValue value = object.get(field);
if (value == null || value.isNull()) {
return defaultValue;
} else {
return value.asInt();
}
} | [
"public",
"static",
"int",
"getInt",
"(",
"JsonObject",
"object",
",",
"String",
"field",
",",
"int",
"defaultValue",
")",
"{",
"final",
"JsonValue",
"value",
"=",
"object",
".",
"get",
"(",
"field",
")",
";",
"if",
"(",
"value",
"==",
"null",
"||",
"v... | Returns a field in a Json object as an int.
@param object the Json Object
@param field the field in the Json object to return
@param defaultValue a default value for the field if the field value is null
@return the Json field value as an int | [
"Returns",
"a",
"field",
"in",
"a",
"Json",
"object",
"as",
"an",
"int",
"."
] | train | https://github.com/hazelcast/hazelcast/blob/8c4bc10515dbbfb41a33e0302c0caedf3cda1baf/hazelcast/src/main/java/com/hazelcast/util/JsonUtil.java#L59-L66 |
mikepenz/FastAdapter | library-core/src/main/java/com/mikepenz/fastadapter/FastAdapter.java | FastAdapter.onBindViewHolder | @Override
public void onBindViewHolder(RecyclerView.ViewHolder holder, int position, List<Object> payloads) {
"""
Binds the data to the created ViewHolder and sets the listeners to the holder.itemView
@param holder the viewHolder we bind the data on
@param position the global position
@param payloads th... | java | @Override
public void onBindViewHolder(RecyclerView.ViewHolder holder, int position, List<Object> payloads) {
//we do not want the binding to happen twice (the legacyBindViewMode
if (!mLegacyBindViewMode) {
if (mVerbose)
Log.v(TAG, "onBindViewHolder: " + position + "/" + ... | [
"@",
"Override",
"public",
"void",
"onBindViewHolder",
"(",
"RecyclerView",
".",
"ViewHolder",
"holder",
",",
"int",
"position",
",",
"List",
"<",
"Object",
">",
"payloads",
")",
"{",
"//we do not want the binding to happen twice (the legacyBindViewMode",
"if",
"(",
"... | Binds the data to the created ViewHolder and sets the listeners to the holder.itemView
@param holder the viewHolder we bind the data on
@param position the global position
@param payloads the payloads for the bindViewHolder event containing data which allows to improve view animating | [
"Binds",
"the",
"data",
"to",
"the",
"created",
"ViewHolder",
"and",
"sets",
"the",
"listeners",
"to",
"the",
"holder",
".",
"itemView"
] | train | https://github.com/mikepenz/FastAdapter/blob/3b2412abe001ba58422e0125846b704d4dba4ae9/library-core/src/main/java/com/mikepenz/fastadapter/FastAdapter.java#L733-L745 |
Carbonado/Carbonado | src/main/java/com/amazon/carbonado/repo/sleepycat/BDBRepositoryBuilder.java | BDBRepositoryBuilder.setCompressor | public void setCompressor(String type, String compressionType) {
"""
Set the compressor for the given class, overriding a custom StorableCodecFactory.
@param type Storable to compress.
@param compressionType String representation of type of
compression. Available options are "NONE" for no compression or "GZIP... | java | public void setCompressor(String type, String compressionType) {
mStorableCodecFactory = null;
compressionType = compressionType.toUpperCase();
if (mCompressionMap == null) {
mCompressionMap = new HashMap<String, CompressionType>();
}
CompressionType compressionEnum =... | [
"public",
"void",
"setCompressor",
"(",
"String",
"type",
",",
"String",
"compressionType",
")",
"{",
"mStorableCodecFactory",
"=",
"null",
";",
"compressionType",
"=",
"compressionType",
".",
"toUpperCase",
"(",
")",
";",
"if",
"(",
"mCompressionMap",
"==",
"nu... | Set the compressor for the given class, overriding a custom StorableCodecFactory.
@param type Storable to compress.
@param compressionType String representation of type of
compression. Available options are "NONE" for no compression or "GZIP"
for gzip compression | [
"Set",
"the",
"compressor",
"for",
"the",
"given",
"class",
"overriding",
"a",
"custom",
"StorableCodecFactory",
"."
] | train | https://github.com/Carbonado/Carbonado/blob/eee29b365a61c8f03e1a1dc6bed0692e6b04b1db/src/main/java/com/amazon/carbonado/repo/sleepycat/BDBRepositoryBuilder.java#L1061-L1071 |
mnlipp/jgrapes | org.jgrapes.http/src/org/jgrapes/http/ResponseCreationSupport.java | ResponseCreationSupport.resourceInfo | @SuppressWarnings("PMD.EmptyCatchBlock")
public static ResourceInfo resourceInfo(URL resource) {
"""
Attempts to lookup the additional resource information for the
given URL.
If a {@link URL} references a file, it is easy to find out if
the resource referenced is a directory and to get its last
modificat... | java | @SuppressWarnings("PMD.EmptyCatchBlock")
public static ResourceInfo resourceInfo(URL resource) {
try {
Path path = Paths.get(resource.toURI());
return new ResourceInfo(Files.isDirectory(path),
Files.getLastModifiedTime(path).toInstant()
.with(Chron... | [
"@",
"SuppressWarnings",
"(",
"\"PMD.EmptyCatchBlock\"",
")",
"public",
"static",
"ResourceInfo",
"resourceInfo",
"(",
"URL",
"resource",
")",
"{",
"try",
"{",
"Path",
"path",
"=",
"Paths",
".",
"get",
"(",
"resource",
".",
"toURI",
"(",
")",
")",
";",
"re... | Attempts to lookup the additional resource information for the
given URL.
If a {@link URL} references a file, it is easy to find out if
the resource referenced is a directory and to get its last
modification time. Getting the same information
for a {@link URL} that references resources in a jar is a bit
more difficult... | [
"Attempts",
"to",
"lookup",
"the",
"additional",
"resource",
"information",
"for",
"the",
"given",
"URL",
"."
] | train | https://github.com/mnlipp/jgrapes/blob/8b5d874935d84c34a52d3e3d3745e869b5203fa0/org.jgrapes.http/src/org/jgrapes/http/ResponseCreationSupport.java#L265-L299 |
OpenLiberty/open-liberty | dev/com.ibm.ws.jdbc.management.j2ee/src/com/ibm/ws/jdbc/management/j2ee/internal/JDBCResourceMBeanImpl.java | JDBCResourceMBeanImpl.setDataSourceChild | protected JDBCDataSourceMBeanImpl setDataSourceChild(String key, JDBCDataSourceMBeanImpl ds) {
"""
setDataSourceChild add a child of type JDBCDataSourceMBeanImpl to this MBean.
@param key the String value which will be used as the key for the JDBCDataSourceMBeanImpl item
@param ds the JDBCDataSourceMBeanImpl v... | java | protected JDBCDataSourceMBeanImpl setDataSourceChild(String key, JDBCDataSourceMBeanImpl ds) {
return dataSourceMBeanChildrenList.put(key, ds);
} | [
"protected",
"JDBCDataSourceMBeanImpl",
"setDataSourceChild",
"(",
"String",
"key",
",",
"JDBCDataSourceMBeanImpl",
"ds",
")",
"{",
"return",
"dataSourceMBeanChildrenList",
".",
"put",
"(",
"key",
",",
"ds",
")",
";",
"}"
] | setDataSourceChild add a child of type JDBCDataSourceMBeanImpl to this MBean.
@param key the String value which will be used as the key for the JDBCDataSourceMBeanImpl item
@param ds the JDBCDataSourceMBeanImpl value to be associated with the specified key
@return The previous value associated with key, or null if the... | [
"setDataSourceChild",
"add",
"a",
"child",
"of",
"type",
"JDBCDataSourceMBeanImpl",
"to",
"this",
"MBean",
"."
] | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.jdbc.management.j2ee/src/com/ibm/ws/jdbc/management/j2ee/internal/JDBCResourceMBeanImpl.java#L234-L236 |
looly/hutool | hutool-http/src/main/java/cn/hutool/http/HttpUtil.java | HttpUtil.downloadString | public static String downloadString(String url, Charset customCharset) {
"""
下载远程文本
@param url 请求的url
@param customCharset 自定义的字符集,可以使用{@link CharsetUtil#charset} 方法转换
@return 文本
"""
return downloadString(url, customCharset, null);
} | java | public static String downloadString(String url, Charset customCharset) {
return downloadString(url, customCharset, null);
} | [
"public",
"static",
"String",
"downloadString",
"(",
"String",
"url",
",",
"Charset",
"customCharset",
")",
"{",
"return",
"downloadString",
"(",
"url",
",",
"customCharset",
",",
"null",
")",
";",
"}"
] | 下载远程文本
@param url 请求的url
@param customCharset 自定义的字符集,可以使用{@link CharsetUtil#charset} 方法转换
@return 文本 | [
"下载远程文本"
] | train | https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-http/src/main/java/cn/hutool/http/HttpUtil.java#L225-L227 |
ziccardi/jnrpe | jnrpe-plugins/src/main/java/it/jnrpe/plugin/utils/HttpUtils.java | HttpUtils.doGET | public static String doGET(final URL url, final Properties requestProps, final Integer timeout, boolean includeHeaders, boolean ignoreBody)
throws Exception {
"""
Do a http get request and return response
@param url target url
@param requestProps props to be requested
@param timeout connection tim... | java | public static String doGET(final URL url, final Properties requestProps, final Integer timeout, boolean includeHeaders, boolean ignoreBody)
throws Exception {
return doRequest(url, requestProps, timeout, includeHeaders, ignoreBody, "GET");
} | [
"public",
"static",
"String",
"doGET",
"(",
"final",
"URL",
"url",
",",
"final",
"Properties",
"requestProps",
",",
"final",
"Integer",
"timeout",
",",
"boolean",
"includeHeaders",
",",
"boolean",
"ignoreBody",
")",
"throws",
"Exception",
"{",
"return",
"doReque... | Do a http get request and return response
@param url target url
@param requestProps props to be requested
@param timeout connection timeout
@param includeHeaders whether to include headers or not
@param ignoreBody whether to ignore body content or not
@return server answer
@throws Exception on any connection | [
"Do",
"a",
"http",
"get",
"request",
"and",
"return",
"response"
] | train | https://github.com/ziccardi/jnrpe/blob/ac9046355851136994388442b01ba4063305f9c4/jnrpe-plugins/src/main/java/it/jnrpe/plugin/utils/HttpUtils.java#L48-L51 |
gliga/ekstazi | ekstazi-maven-plugin/src/main/java/org/ekstazi/maven/AbstractEkstaziMojo.java | AbstractEkstaziMojo.extractParamValue | protected String extractParamValue(Plugin plugin, String paramName) throws MojoExecutionException {
"""
Locate paramName in the given (surefire) plugin. Returns value
of the file.
"""
Xpp3Dom configuration = (Xpp3Dom) plugin.getConfiguration();
if (configuration == null) {
return n... | java | protected String extractParamValue(Plugin plugin, String paramName) throws MojoExecutionException {
Xpp3Dom configuration = (Xpp3Dom) plugin.getConfiguration();
if (configuration == null) {
return null;
}
Xpp3Dom paramDom = configuration.getChild(paramName);
return pa... | [
"protected",
"String",
"extractParamValue",
"(",
"Plugin",
"plugin",
",",
"String",
"paramName",
")",
"throws",
"MojoExecutionException",
"{",
"Xpp3Dom",
"configuration",
"=",
"(",
"Xpp3Dom",
")",
"plugin",
".",
"getConfiguration",
"(",
")",
";",
"if",
"(",
"con... | Locate paramName in the given (surefire) plugin. Returns value
of the file. | [
"Locate",
"paramName",
"in",
"the",
"given",
"(",
"surefire",
")",
"plugin",
".",
"Returns",
"value",
"of",
"the",
"file",
"."
] | train | https://github.com/gliga/ekstazi/blob/5bf4d39a13305afe62f8b8d2d7b4c573d37d42a1/ekstazi-maven-plugin/src/main/java/org/ekstazi/maven/AbstractEkstaziMojo.java#L162-L169 |
sriharshachilakapati/WebGL4J | webgl4j/src/main/java/com/shc/webgl4j/client/WebGL10.java | WebGL10.glBufferSubData | public static void glBufferSubData(int target, int offset, int size, short[] data) {
"""
<p>{@code glBufferSubData} redefines some or all of the data store for the buffer object currently bound to
{@code target}. Data starting at byte offset {@code offset} and extending for {@code size} bytes is copied to the
da... | java | public static void glBufferSubData(int target, int offset, int size, short[] data)
{
checkContextCompatibility();
Int16Array dataBuffer = Int16ArrayNative.create(data.length);
dataBuffer.set(data);
nglBufferSubData(target, offset, size, dataBuffer);
} | [
"public",
"static",
"void",
"glBufferSubData",
"(",
"int",
"target",
",",
"int",
"offset",
",",
"int",
"size",
",",
"short",
"[",
"]",
"data",
")",
"{",
"checkContextCompatibility",
"(",
")",
";",
"Int16Array",
"dataBuffer",
"=",
"Int16ArrayNative",
".",
"cr... | <p>{@code glBufferSubData} redefines some or all of the data store for the buffer object currently bound to
{@code target}. Data starting at byte offset {@code offset} and extending for {@code size} bytes is copied to the
data store from the memory pointed to by {@code data}. An error is thrown if {@code offset} and {@... | [
"<p",
">",
"{",
"@code",
"glBufferSubData",
"}",
"redefines",
"some",
"or",
"all",
"of",
"the",
"data",
"store",
"for",
"the",
"buffer",
"object",
"currently",
"bound",
"to",
"{",
"@code",
"target",
"}",
".",
"Data",
"starting",
"at",
"byte",
"offset",
"... | train | https://github.com/sriharshachilakapati/WebGL4J/blob/7daa425300b08b338b50cef2935289849c92d415/webgl4j/src/main/java/com/shc/webgl4j/client/WebGL10.java#L1131-L1137 |
aws/aws-sdk-java | aws-java-sdk-iot/src/main/java/com/amazonaws/services/iot/model/CreateAuthorizerRequest.java | CreateAuthorizerRequest.withTokenSigningPublicKeys | public CreateAuthorizerRequest withTokenSigningPublicKeys(java.util.Map<String, String> tokenSigningPublicKeys) {
"""
<p>
The public keys used to verify the digital signature returned by your custom authentication service.
</p>
@param tokenSigningPublicKeys
The public keys used to verify the digital signatur... | java | public CreateAuthorizerRequest withTokenSigningPublicKeys(java.util.Map<String, String> tokenSigningPublicKeys) {
setTokenSigningPublicKeys(tokenSigningPublicKeys);
return this;
} | [
"public",
"CreateAuthorizerRequest",
"withTokenSigningPublicKeys",
"(",
"java",
".",
"util",
".",
"Map",
"<",
"String",
",",
"String",
">",
"tokenSigningPublicKeys",
")",
"{",
"setTokenSigningPublicKeys",
"(",
"tokenSigningPublicKeys",
")",
";",
"return",
"this",
";",... | <p>
The public keys used to verify the digital signature returned by your custom authentication service.
</p>
@param tokenSigningPublicKeys
The public keys used to verify the digital signature returned by your custom authentication service.
@return Returns a reference to this object so that method calls can be chained... | [
"<p",
">",
"The",
"public",
"keys",
"used",
"to",
"verify",
"the",
"digital",
"signature",
"returned",
"by",
"your",
"custom",
"authentication",
"service",
".",
"<",
"/",
"p",
">"
] | train | https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-iot/src/main/java/com/amazonaws/services/iot/model/CreateAuthorizerRequest.java#L209-L212 |
Erudika/para | para-client/src/main/java/com/erudika/para/client/ParaClient.java | ParaClient.isLinked | public boolean isLinked(ParaObject obj, String type2, String id2) {
"""
Checks if this object is linked to another.
@param type2 the other type
@param id2 the other id
@param obj the object to execute this method on
@return true if the two are linked
"""
if (obj == null || obj.getId() == null || type2 ==... | java | public boolean isLinked(ParaObject obj, String type2, String id2) {
if (obj == null || obj.getId() == null || type2 == null || id2 == null) {
return false;
}
String url = Utils.formatMessage("{0}/links/{1}/{2}", obj.getObjectURI(), type2, id2);
Boolean result = getEntity(invokeGet(url, null), Boolean.class);... | [
"public",
"boolean",
"isLinked",
"(",
"ParaObject",
"obj",
",",
"String",
"type2",
",",
"String",
"id2",
")",
"{",
"if",
"(",
"obj",
"==",
"null",
"||",
"obj",
".",
"getId",
"(",
")",
"==",
"null",
"||",
"type2",
"==",
"null",
"||",
"id2",
"==",
"n... | Checks if this object is linked to another.
@param type2 the other type
@param id2 the other id
@param obj the object to execute this method on
@return true if the two are linked | [
"Checks",
"if",
"this",
"object",
"is",
"linked",
"to",
"another",
"."
] | train | https://github.com/Erudika/para/blob/5ba096c477042ea7b18e9a0e8b5b1ee0f5bd6ce9/para-client/src/main/java/com/erudika/para/client/ParaClient.java#L998-L1005 |
micronaut-projects/micronaut-core | core/src/main/java/io/micronaut/core/bind/annotation/AbstractAnnotatedArgumentBinder.java | AbstractAnnotatedArgumentBinder.doBind | @SuppressWarnings("unchecked")
protected BindingResult<T> doBind(
ArgumentConversionContext<T> context,
ConvertibleValues<?> values,
String annotationValue) {
"""
Do binding.
@param context context
@param values values
@param annotationValue annotationValue
@retur... | java | @SuppressWarnings("unchecked")
protected BindingResult<T> doBind(
ArgumentConversionContext<T> context,
ConvertibleValues<?> values,
String annotationValue) {
return doConvert(doResolve(context, values, annotationValue), context);
} | [
"@",
"SuppressWarnings",
"(",
"\"unchecked\"",
")",
"protected",
"BindingResult",
"<",
"T",
">",
"doBind",
"(",
"ArgumentConversionContext",
"<",
"T",
">",
"context",
",",
"ConvertibleValues",
"<",
"?",
">",
"values",
",",
"String",
"annotationValue",
")",
"{",
... | Do binding.
@param context context
@param values values
@param annotationValue annotationValue
@return result | [
"Do",
"binding",
"."
] | train | https://github.com/micronaut-projects/micronaut-core/blob/c31f5b03ce0eb88c2f6470710987db03b8967d5c/core/src/main/java/io/micronaut/core/bind/annotation/AbstractAnnotatedArgumentBinder.java#L60-L67 |
liferay/com-liferay-commerce | commerce-product-service/src/main/java/com/liferay/commerce/product/service/persistence/impl/CPOptionPersistenceImpl.java | CPOptionPersistenceImpl.findByG_K | @Override
public CPOption findByG_K(long groupId, String key)
throws NoSuchCPOptionException {
"""
Returns the cp option where groupId = ? and key = ? or throws a {@link NoSuchCPOptionException} if it could not be found.
@param groupId the group ID
@param key the key
@return the matching cp option
... | java | @Override
public CPOption findByG_K(long groupId, String key)
throws NoSuchCPOptionException {
CPOption cpOption = fetchByG_K(groupId, key);
if (cpOption == null) {
StringBundler msg = new StringBundler(6);
msg.append(_NO_SUCH_ENTITY_WITH_KEY);
msg.append("groupId=");
msg.append(groupId);
msg.... | [
"@",
"Override",
"public",
"CPOption",
"findByG_K",
"(",
"long",
"groupId",
",",
"String",
"key",
")",
"throws",
"NoSuchCPOptionException",
"{",
"CPOption",
"cpOption",
"=",
"fetchByG_K",
"(",
"groupId",
",",
"key",
")",
";",
"if",
"(",
"cpOption",
"==",
"nu... | Returns the cp option where groupId = ? and key = ? or throws a {@link NoSuchCPOptionException} if it could not be found.
@param groupId the group ID
@param key the key
@return the matching cp option
@throws NoSuchCPOptionException if a matching cp option could not be found | [
"Returns",
"the",
"cp",
"option",
"where",
"groupId",
"=",
"?",
";",
"and",
"key",
"=",
"?",
";",
"or",
"throws",
"a",
"{",
"@link",
"NoSuchCPOptionException",
"}",
"if",
"it",
"could",
"not",
"be",
"found",
"."
] | train | https://github.com/liferay/com-liferay-commerce/blob/9e54362d7f59531fc684016ba49ee7cdc3a2f22b/commerce-product-service/src/main/java/com/liferay/commerce/product/service/persistence/impl/CPOptionPersistenceImpl.java#L1992-L2018 |
Azure/azure-sdk-for-java | keyvault/data-plane/azure-keyvault/src/main/java/com/microsoft/azure/keyvault/implementation/KeyVaultClientBaseImpl.java | KeyVaultClientBaseImpl.getSecret | public SecretBundle getSecret(String vaultBaseUrl, String secretName, String secretVersion) {
"""
Get a specified secret from a given key vault.
The GET operation is applicable to any secret stored in Azure Key Vault. This operation requires the secrets/get permission.
@param vaultBaseUrl The vault name, for e... | java | public SecretBundle getSecret(String vaultBaseUrl, String secretName, String secretVersion) {
return getSecretWithServiceResponseAsync(vaultBaseUrl, secretName, secretVersion).toBlocking().single().body();
} | [
"public",
"SecretBundle",
"getSecret",
"(",
"String",
"vaultBaseUrl",
",",
"String",
"secretName",
",",
"String",
"secretVersion",
")",
"{",
"return",
"getSecretWithServiceResponseAsync",
"(",
"vaultBaseUrl",
",",
"secretName",
",",
"secretVersion",
")",
".",
"toBlock... | Get a specified secret from a given key vault.
The GET operation is applicable to any secret stored in Azure Key Vault. This operation requires the secrets/get permission.
@param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net.
@param secretName The name of the secret.
@param secretVersion The... | [
"Get",
"a",
"specified",
"secret",
"from",
"a",
"given",
"key",
"vault",
".",
"The",
"GET",
"operation",
"is",
"applicable",
"to",
"any",
"secret",
"stored",
"in",
"Azure",
"Key",
"Vault",
".",
"This",
"operation",
"requires",
"the",
"secrets",
"/",
"get",... | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/keyvault/data-plane/azure-keyvault/src/main/java/com/microsoft/azure/keyvault/implementation/KeyVaultClientBaseImpl.java#L3828-L3830 |
rundeck/rundeck | core/src/main/java/com/dtolabs/rundeck/core/execution/impl/common/DefaultFileCopierUtil.java | DefaultFileCopierUtil.writeTempFile | @Override
public File writeTempFile(
ExecutionContext context, File original, InputStream input,
String script
) throws FileCopierException {
"""
Write the file, stream, or text to a local temp file and return the file
@param context context
@param original source file, or null
... | java | @Override
public File writeTempFile(
ExecutionContext context, File original, InputStream input,
String script
) throws FileCopierException {
File tempfile = null;
try {
tempfile = ScriptfileUtils.createTempFile(context.getFramework());
} catch (IOExc... | [
"@",
"Override",
"public",
"File",
"writeTempFile",
"(",
"ExecutionContext",
"context",
",",
"File",
"original",
",",
"InputStream",
"input",
",",
"String",
"script",
")",
"throws",
"FileCopierException",
"{",
"File",
"tempfile",
"=",
"null",
";",
"try",
"{",
... | Write the file, stream, or text to a local temp file and return the file
@param context context
@param original source file, or null
@param input source inputstream or null
@param script source text, or null
@return temp file, this file should later be cleaned up by calling
{@link com.dtolabs.rundeck.core.execution.scr... | [
"Write",
"the",
"file",
"stream",
"or",
"text",
"to",
"a",
"local",
"temp",
"file",
"and",
"return",
"the",
"file"
] | train | https://github.com/rundeck/rundeck/blob/8070f774f55bffaa1118ff0c03aea319d40a9668/core/src/main/java/com/dtolabs/rundeck/core/execution/impl/common/DefaultFileCopierUtil.java#L427-L440 |
elki-project/elki | elki-core-util/src/main/java/de/lmu/ifi/dbs/elki/utilities/Util.java | Util.mixHashCodes | public static int mixHashCodes(int hash1, int hash2, int hash3) {
"""
Mix multiple hashcodes into one.
@param hash1 First hashcode to mix
@param hash2 Second hashcode to mix
@param hash3 Third hashcode to mix
@return Mixed hash code
"""
long result = hash1 * HASHPRIME + hash2;
return (int) (resul... | java | public static int mixHashCodes(int hash1, int hash2, int hash3) {
long result = hash1 * HASHPRIME + hash2;
return (int) (result * HASHPRIME + hash3);
} | [
"public",
"static",
"int",
"mixHashCodes",
"(",
"int",
"hash1",
",",
"int",
"hash2",
",",
"int",
"hash3",
")",
"{",
"long",
"result",
"=",
"hash1",
"*",
"HASHPRIME",
"+",
"hash2",
";",
"return",
"(",
"int",
")",
"(",
"result",
"*",
"HASHPRIME",
"+",
... | Mix multiple hashcodes into one.
@param hash1 First hashcode to mix
@param hash2 Second hashcode to mix
@param hash3 Third hashcode to mix
@return Mixed hash code | [
"Mix",
"multiple",
"hashcodes",
"into",
"one",
"."
] | train | https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-core-util/src/main/java/de/lmu/ifi/dbs/elki/utilities/Util.java#L64-L67 |
Azure/azure-sdk-for-java | cosmosdb/resource-manager/v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/implementation/DatabaseAccountsInner.java | DatabaseAccountsInner.beginOfflineRegion | public void beginOfflineRegion(String resourceGroupName, String accountName, String region) {
"""
Offline the specified region for the specified Azure Cosmos DB database account.
@param resourceGroupName Name of an Azure resource group.
@param accountName Cosmos DB database account name.
@param region Cosmos ... | java | public void beginOfflineRegion(String resourceGroupName, String accountName, String region) {
beginOfflineRegionWithServiceResponseAsync(resourceGroupName, accountName, region).toBlocking().single().body();
} | [
"public",
"void",
"beginOfflineRegion",
"(",
"String",
"resourceGroupName",
",",
"String",
"accountName",
",",
"String",
"region",
")",
"{",
"beginOfflineRegionWithServiceResponseAsync",
"(",
"resourceGroupName",
",",
"accountName",
",",
"region",
")",
".",
"toBlocking"... | Offline the specified region for the specified Azure Cosmos DB database account.
@param resourceGroupName Name of an Azure resource group.
@param accountName Cosmos DB database account name.
@param region Cosmos DB region, with spaces between words and each word capitalized.
@throws IllegalArgumentException thrown if ... | [
"Offline",
"the",
"specified",
"region",
"for",
"the",
"specified",
"Azure",
"Cosmos",
"DB",
"database",
"account",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/cosmosdb/resource-manager/v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/implementation/DatabaseAccountsInner.java#L1361-L1363 |
guardtime/ksi-java-sdk | ksi-common/src/main/java/com/guardtime/ksi/util/Util.java | Util.copyData | public static int copyData(InputStream in, OutputStream out) throws IOException {
"""
Copies all available data from {@code in} to {@code out}.
<p>
Allocates a temporary memory buffer of {@link #DEFAULT_BUFFER_SIZE} bytes for this.
</p>
@param in
input stream to copy data from.
@param out
output stream to... | java | public static int copyData(InputStream in, OutputStream out) throws IOException {
return copyData(in, out, -1, DEFAULT_BUFFER_SIZE);
} | [
"public",
"static",
"int",
"copyData",
"(",
"InputStream",
"in",
",",
"OutputStream",
"out",
")",
"throws",
"IOException",
"{",
"return",
"copyData",
"(",
"in",
",",
"out",
",",
"-",
"1",
",",
"DEFAULT_BUFFER_SIZE",
")",
";",
"}"
] | Copies all available data from {@code in} to {@code out}.
<p>
Allocates a temporary memory buffer of {@link #DEFAULT_BUFFER_SIZE} bytes for this.
</p>
@param in
input stream to copy data from.
@param out
output stream to copy data to.
@return The number of bytes actually copied.
@throws IOException
if one is thrown ... | [
"Copies",
"all",
"available",
"data",
"from",
"{",
"@code",
"in",
"}",
"to",
"{",
"@code",
"out",
"}",
".",
"<p",
">",
"Allocates",
"a",
"temporary",
"memory",
"buffer",
"of",
"{",
"@link",
"#DEFAULT_BUFFER_SIZE",
"}",
"bytes",
"for",
"this",
".",
"<",
... | train | https://github.com/guardtime/ksi-java-sdk/blob/b2cd877050f0f392657c724452318d10a1002171/ksi-common/src/main/java/com/guardtime/ksi/util/Util.java#L573-L575 |
Azure/azure-sdk-for-java | sql/resource-manager/v2014_04_01/src/main/java/com/microsoft/azure/management/sql/v2014_04_01/implementation/DatabaseAdvisorsInner.java | DatabaseAdvisorsInner.get | public AdvisorInner get(String resourceGroupName, String serverName, String databaseName, String advisorName) {
"""
Returns details of a Database Advisor.
@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 port... | java | public AdvisorInner get(String resourceGroupName, String serverName, String databaseName, String advisorName) {
return getWithServiceResponseAsync(resourceGroupName, serverName, databaseName, advisorName).toBlocking().single().body();
} | [
"public",
"AdvisorInner",
"get",
"(",
"String",
"resourceGroupName",
",",
"String",
"serverName",
",",
"String",
"databaseName",
",",
"String",
"advisorName",
")",
"{",
"return",
"getWithServiceResponseAsync",
"(",
"resourceGroupName",
",",
"serverName",
",",
"databas... | Returns details of a Database Advisor.
@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 database.
@param advisorName The name of ... | [
"Returns",
"details",
"of",
"a",
"Database",
"Advisor",
"."
] | 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/DatabaseAdvisorsInner.java#L176-L178 |
Stratio/stratio-cassandra | src/java/org/apache/cassandra/utils/btree/NodeBuilder.java | NodeBuilder.toNode | Object[] toNode() {
"""
builds a new root BTree node - must be called on root of operation
"""
assert buildKeyPosition <= FAN_FACTOR && (buildKeyPosition > 0 || copyFrom.length > 0) : buildKeyPosition;
return buildFromRange(0, buildKeyPosition, isLeaf(copyFrom), false);
} | java | Object[] toNode()
{
assert buildKeyPosition <= FAN_FACTOR && (buildKeyPosition > 0 || copyFrom.length > 0) : buildKeyPosition;
return buildFromRange(0, buildKeyPosition, isLeaf(copyFrom), false);
} | [
"Object",
"[",
"]",
"toNode",
"(",
")",
"{",
"assert",
"buildKeyPosition",
"<=",
"FAN_FACTOR",
"&&",
"(",
"buildKeyPosition",
">",
"0",
"||",
"copyFrom",
".",
"length",
">",
"0",
")",
":",
"buildKeyPosition",
";",
"return",
"buildFromRange",
"(",
"0",
",",... | builds a new root BTree node - must be called on root of operation | [
"builds",
"a",
"new",
"root",
"BTree",
"node",
"-",
"must",
"be",
"called",
"on",
"root",
"of",
"operation"
] | train | https://github.com/Stratio/stratio-cassandra/blob/f6416b43ad5309083349ad56266450fa8c6a2106/src/java/org/apache/cassandra/utils/btree/NodeBuilder.java#L265-L269 |
paypal/SeLion | client/src/main/java/com/paypal/selion/platform/asserts/SeLionAsserts.java | SeLionAsserts.assertEquals | public static void assertEquals(Object actual, Object expected, String message) {
"""
assertEquals method is used to assert based on actual and expected values and provide a Pass result for a same
match.assertEquals will yield a Fail result for a mismatch and abort the test case.
@param actual
- Actual value ... | java | public static void assertEquals(Object actual, Object expected, String message) {
hardAssert.assertEquals(actual, expected, message);
} | [
"public",
"static",
"void",
"assertEquals",
"(",
"Object",
"actual",
",",
"Object",
"expected",
",",
"String",
"message",
")",
"{",
"hardAssert",
".",
"assertEquals",
"(",
"actual",
",",
"expected",
",",
"message",
")",
";",
"}"
] | assertEquals method is used to assert based on actual and expected values and provide a Pass result for a same
match.assertEquals will yield a Fail result for a mismatch and abort the test case.
@param actual
- Actual value obtained from executing a test
@param expected
- Expected value for the test to pass.
@param me... | [
"assertEquals",
"method",
"is",
"used",
"to",
"assert",
"based",
"on",
"actual",
"and",
"expected",
"values",
"and",
"provide",
"a",
"Pass",
"result",
"for",
"a",
"same",
"match",
".",
"assertEquals",
"will",
"yield",
"a",
"Fail",
"result",
"for",
"a",
"mi... | train | https://github.com/paypal/SeLion/blob/694d12d0df76db48d0360b16192770c6a4fbdfd2/client/src/main/java/com/paypal/selion/platform/asserts/SeLionAsserts.java#L455-L457 |
lievendoclo/Valkyrie-RCP | valkyrie-rcp-core/src/main/java/org/valkyriercp/util/GuiStandardUtils.java | GuiStandardUtils.createDebugBorder | public static void createDebugBorder(JComponent c, Color color) {
"""
Useful debug function to place a colored, line border around a component
for layout management debugging.
@param c
the component
@param color
the border color
"""
if (color == null) {
color = Color.BLACK;
}... | java | public static void createDebugBorder(JComponent c, Color color) {
if (color == null) {
color = Color.BLACK;
}
c.setBorder(BorderFactory.createLineBorder(color));
} | [
"public",
"static",
"void",
"createDebugBorder",
"(",
"JComponent",
"c",
",",
"Color",
"color",
")",
"{",
"if",
"(",
"color",
"==",
"null",
")",
"{",
"color",
"=",
"Color",
".",
"BLACK",
";",
"}",
"c",
".",
"setBorder",
"(",
"BorderFactory",
".",
"crea... | Useful debug function to place a colored, line border around a component
for layout management debugging.
@param c
the component
@param color
the border color | [
"Useful",
"debug",
"function",
"to",
"place",
"a",
"colored",
"line",
"border",
"around",
"a",
"component",
"for",
"layout",
"management",
"debugging",
"."
] | train | https://github.com/lievendoclo/Valkyrie-RCP/blob/6aad6e640b348cda8f3b0841f6e42025233f1eb8/valkyrie-rcp-core/src/main/java/org/valkyriercp/util/GuiStandardUtils.java#L289-L294 |
mapcode-foundation/mapcode-java | src/main/java/com/mapcode/MapcodeCodec.java | MapcodeCodec.decodeToRectangle | @Nonnull
public static Rectangle decodeToRectangle(@Nonnull final String mapcode)
throws UnknownMapcodeException, IllegalArgumentException, UnknownPrecisionFormatException {
"""
Decode a mapcode to a Rectangle, which defines the valid zone for a mapcode. The boundaries of the
mapcode zone are incl... | java | @Nonnull
public static Rectangle decodeToRectangle(@Nonnull final String mapcode)
throws UnknownMapcodeException, IllegalArgumentException, UnknownPrecisionFormatException {
return decodeToRectangle(mapcode, Territory.AAA);
} | [
"@",
"Nonnull",
"public",
"static",
"Rectangle",
"decodeToRectangle",
"(",
"@",
"Nonnull",
"final",
"String",
"mapcode",
")",
"throws",
"UnknownMapcodeException",
",",
"IllegalArgumentException",
",",
"UnknownPrecisionFormatException",
"{",
"return",
"decodeToRectangle",
... | Decode a mapcode to a Rectangle, which defines the valid zone for a mapcode. The boundaries of the
mapcode zone are inclusive for the South and West borders and exclusive for the North and East borders.
This is essentially the same call as a 'decode', except it returns a rectangle, rather than its center point.
@param... | [
"Decode",
"a",
"mapcode",
"to",
"a",
"Rectangle",
"which",
"defines",
"the",
"valid",
"zone",
"for",
"a",
"mapcode",
".",
"The",
"boundaries",
"of",
"the",
"mapcode",
"zone",
"are",
"inclusive",
"for",
"the",
"South",
"and",
"West",
"borders",
"and",
"excl... | train | https://github.com/mapcode-foundation/mapcode-java/blob/f12d4d9fbd460472ac0fff1f702f2ac716bc0ab8/src/main/java/com/mapcode/MapcodeCodec.java#L350-L354 |
kuali/ojb-1.0.4 | src/java/org/apache/ojb/broker/util/BrokerHelper.java | BrokerHelper.assertValidPkForDelete | public boolean assertValidPkForDelete(ClassDescriptor cld, Object obj) {
"""
returns true if the primary key fields are valid for delete, else false.
PK fields are valid if each of them contains a valid non-null value
@param cld the ClassDescriptor
@param obj the object
@return boolean
"""
if(!Pro... | java | public boolean assertValidPkForDelete(ClassDescriptor cld, Object obj)
{
if(!ProxyHelper.isProxy(obj))
{
FieldDescriptor fieldDescriptors[] = cld.getPkFields();
int fieldDescriptorSize = fieldDescriptors.length;
for(int i = 0; i < fieldDescriptorSize; i++)
... | [
"public",
"boolean",
"assertValidPkForDelete",
"(",
"ClassDescriptor",
"cld",
",",
"Object",
"obj",
")",
"{",
"if",
"(",
"!",
"ProxyHelper",
".",
"isProxy",
"(",
"obj",
")",
")",
"{",
"FieldDescriptor",
"fieldDescriptors",
"[",
"]",
"=",
"cld",
".",
"getPkFi... | returns true if the primary key fields are valid for delete, else false.
PK fields are valid if each of them contains a valid non-null value
@param cld the ClassDescriptor
@param obj the object
@return boolean | [
"returns",
"true",
"if",
"the",
"primary",
"key",
"fields",
"are",
"valid",
"for",
"delete",
"else",
"false",
".",
"PK",
"fields",
"are",
"valid",
"if",
"each",
"of",
"them",
"contains",
"a",
"valid",
"non",
"-",
"null",
"value"
] | train | https://github.com/kuali/ojb-1.0.4/blob/9a544372f67ce965f662cdc71609dd03683c8f04/src/java/org/apache/ojb/broker/util/BrokerHelper.java#L475-L492 |
MGunlogson/CuckooFilter4J | src/main/java/com/github/mgunlogson/cuckoofilter4j/RamUsageEstimator.java | RamUsageEstimator.humanReadableUnits | static String humanReadableUnits(long bytes) {
"""
Returns <code>size</code> in human-readable units (GB, MB, KB or bytes).
"""
return humanReadableUnits(bytes,
new DecimalFormat("0.#", DecimalFormatSymbols.getInstance(Locale.ROOT)));
} | java | static String humanReadableUnits(long bytes) {
return humanReadableUnits(bytes,
new DecimalFormat("0.#", DecimalFormatSymbols.getInstance(Locale.ROOT)));
} | [
"static",
"String",
"humanReadableUnits",
"(",
"long",
"bytes",
")",
"{",
"return",
"humanReadableUnits",
"(",
"bytes",
",",
"new",
"DecimalFormat",
"(",
"\"0.#\"",
",",
"DecimalFormatSymbols",
".",
"getInstance",
"(",
"Locale",
".",
"ROOT",
")",
")",
")",
";"... | Returns <code>size</code> in human-readable units (GB, MB, KB or bytes). | [
"Returns",
"<code",
">",
"size<",
"/",
"code",
">",
"in",
"human",
"-",
"readable",
"units",
"(",
"GB",
"MB",
"KB",
"or",
"bytes",
")",
"."
] | train | https://github.com/MGunlogson/CuckooFilter4J/blob/e8472aa150b201f05046d1c81cac5a5ca4348db8/src/main/java/com/github/mgunlogson/cuckoofilter4j/RamUsageEstimator.java#L386-L389 |
google/j2objc | jre_emul/android/platform/libcore/ojluni/src/main/java/java/net/Socks4Message.java | Socks4Message.getString | private String getString(int offset, int maxLength) {
"""
Get a String from the buffer at the offset given. The method reads until
it encounters a null value or reaches the maxLength given.
"""
int index = offset;
int lastIndex = index + maxLength;
while (index < lastIndex && (buffer[i... | java | private String getString(int offset, int maxLength) {
int index = offset;
int lastIndex = index + maxLength;
while (index < lastIndex && (buffer[index] != 0)) {
index++;
}
return new String(buffer, offset, index - offset, StandardCharsets.ISO_8859_1);
} | [
"private",
"String",
"getString",
"(",
"int",
"offset",
",",
"int",
"maxLength",
")",
"{",
"int",
"index",
"=",
"offset",
";",
"int",
"lastIndex",
"=",
"index",
"+",
"maxLength",
";",
"while",
"(",
"index",
"<",
"lastIndex",
"&&",
"(",
"buffer",
"[",
"... | Get a String from the buffer at the offset given. The method reads until
it encounters a null value or reaches the maxLength given. | [
"Get",
"a",
"String",
"from",
"the",
"buffer",
"at",
"the",
"offset",
"given",
".",
"The",
"method",
"reads",
"until",
"it",
"encounters",
"a",
"null",
"value",
"or",
"reaches",
"the",
"maxLength",
"given",
"."
] | train | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/libcore/ojluni/src/main/java/java/net/Socks4Message.java#L185-L192 |
apache/incubator-gobblin | gobblin-utility/src/main/java/org/apache/gobblin/util/HadoopUtils.java | HadoopUtils.renamePath | public static void renamePath(FileContext fc, Path oldName, Path newName) throws IOException {
"""
A wrapper around {@link FileContext#rename(Path, Path, Options.Rename...)}.
"""
renamePath(fc, oldName, newName, false);
} | java | public static void renamePath(FileContext fc, Path oldName, Path newName) throws IOException {
renamePath(fc, oldName, newName, false);
} | [
"public",
"static",
"void",
"renamePath",
"(",
"FileContext",
"fc",
",",
"Path",
"oldName",
",",
"Path",
"newName",
")",
"throws",
"IOException",
"{",
"renamePath",
"(",
"fc",
",",
"oldName",
",",
"newName",
",",
"false",
")",
";",
"}"
] | A wrapper around {@link FileContext#rename(Path, Path, Options.Rename...)}. | [
"A",
"wrapper",
"around",
"{"
] | train | https://github.com/apache/incubator-gobblin/blob/f029b4c0fea0fe4aa62f36dda2512344ff708bae/gobblin-utility/src/main/java/org/apache/gobblin/util/HadoopUtils.java#L243-L245 |
cdk/cdk | display/renderbasic/src/main/java/org/openscience/cdk/renderer/generators/standard/SelectionVisibility.java | SelectionVisibility.isSelected | static boolean isSelected(IChemObject object, RendererModel model) {
"""
Determine if an object is selected.
@param object the object
@return object is selected
"""
if (object.getProperty(StandardGenerator.HIGHLIGHT_COLOR) != null) return true;
if (model.getSelection() != null) return model... | java | static boolean isSelected(IChemObject object, RendererModel model) {
if (object.getProperty(StandardGenerator.HIGHLIGHT_COLOR) != null) return true;
if (model.getSelection() != null) return model.getSelection().contains(object);
return false;
} | [
"static",
"boolean",
"isSelected",
"(",
"IChemObject",
"object",
",",
"RendererModel",
"model",
")",
"{",
"if",
"(",
"object",
".",
"getProperty",
"(",
"StandardGenerator",
".",
"HIGHLIGHT_COLOR",
")",
"!=",
"null",
")",
"return",
"true",
";",
"if",
"(",
"mo... | Determine if an object is selected.
@param object the object
@return object is selected | [
"Determine",
"if",
"an",
"object",
"is",
"selected",
"."
] | train | https://github.com/cdk/cdk/blob/c3d0f16502bf08df50365fee392e11d7c9856657/display/renderbasic/src/main/java/org/openscience/cdk/renderer/generators/standard/SelectionVisibility.java#L99-L103 |
Wikidata/Wikidata-Toolkit | wdtk-datamodel/src/main/java/org/wikidata/wdtk/datamodel/helpers/EntityDocumentBuilder.java | EntityDocumentBuilder.withLabel | public T withLabel(String text, String languageCode) {
"""
Adds an additional label to the constructed document.
@param text
the text of the label
@param languageCode
the language code of the label
@return builder object to continue construction
"""
withLabel(factory.getMonolingualTextValue(text, lang... | java | public T withLabel(String text, String languageCode) {
withLabel(factory.getMonolingualTextValue(text, languageCode));
return getThis();
} | [
"public",
"T",
"withLabel",
"(",
"String",
"text",
",",
"String",
"languageCode",
")",
"{",
"withLabel",
"(",
"factory",
".",
"getMonolingualTextValue",
"(",
"text",
",",
"languageCode",
")",
")",
";",
"return",
"getThis",
"(",
")",
";",
"}"
] | Adds an additional label to the constructed document.
@param text
the text of the label
@param languageCode
the language code of the label
@return builder object to continue construction | [
"Adds",
"an",
"additional",
"label",
"to",
"the",
"constructed",
"document",
"."
] | train | https://github.com/Wikidata/Wikidata-Toolkit/blob/7732851dda47e1febff406fba27bfec023f4786e/wdtk-datamodel/src/main/java/org/wikidata/wdtk/datamodel/helpers/EntityDocumentBuilder.java#L123-L126 |
fernandospr/javapns-jdk16 | src/main/java/javapns/notification/PushNotificationPayload.java | PushNotificationPayload.combined | public static PushNotificationPayload combined(String message, int badge, String sound) {
"""
Create a pre-defined payload with a simple alert message, a badge and a sound.
@param message the alert message
@param badge the badge
@param sound the name of the sound
@return a ready-to-send payload
"""
if... | java | public static PushNotificationPayload combined(String message, int badge, String sound) {
if (message == null && badge < 0 && sound == null) throw new IllegalArgumentException("Must provide at least one non-null argument");
PushNotificationPayload payload = complex();
try {
if (message != null) payload.add... | [
"public",
"static",
"PushNotificationPayload",
"combined",
"(",
"String",
"message",
",",
"int",
"badge",
",",
"String",
"sound",
")",
"{",
"if",
"(",
"message",
"==",
"null",
"&&",
"badge",
"<",
"0",
"&&",
"sound",
"==",
"null",
")",
"throw",
"new",
"Il... | Create a pre-defined payload with a simple alert message, a badge and a sound.
@param message the alert message
@param badge the badge
@param sound the name of the sound
@return a ready-to-send payload | [
"Create",
"a",
"pre",
"-",
"defined",
"payload",
"with",
"a",
"simple",
"alert",
"message",
"a",
"badge",
"and",
"a",
"sound",
"."
] | train | https://github.com/fernandospr/javapns-jdk16/blob/84de6d9328ab01af92f77cc60c4554de02420909/src/main/java/javapns/notification/PushNotificationPayload.java#L80-L90 |
albfernandez/itext2 | src/main/java/com/lowagie/text/pdf/PdfCell.java | PdfCell.addImage | private float addImage(Image i, float left, float right, float extraHeight, int alignment) {
"""
Adds an image to this Cell.
@param i the image to add
@param left the left border
@param right the right border
@param extraHeight extra height to add above image
@param alignment horizo... | java | private float addImage(Image i, float left, float right, float extraHeight, int alignment) {
Image image = Image.getInstance(i);
if (image.getScaledWidth() > right - left) {
image.scaleToFit(right - left, Float.MAX_VALUE);
}
flushCurrentLine();
if (line == null) {
... | [
"private",
"float",
"addImage",
"(",
"Image",
"i",
",",
"float",
"left",
",",
"float",
"right",
",",
"float",
"extraHeight",
",",
"int",
"alignment",
")",
"{",
"Image",
"image",
"=",
"Image",
".",
"getInstance",
"(",
"i",
")",
";",
"if",
"(",
"image",
... | Adds an image to this Cell.
@param i the image to add
@param left the left border
@param right the right border
@param extraHeight extra height to add above image
@param alignment horizontal alignment (constant from Element class)
@return the height of the image | [
"Adds",
"an",
"image",
"to",
"this",
"Cell",
"."
] | train | https://github.com/albfernandez/itext2/blob/438fc1899367fd13dfdfa8dfdca9a3c1a7783b84/src/main/java/com/lowagie/text/pdf/PdfCell.java#L529-L553 |
zaproxy/zaproxy | src/org/apache/commons/httpclient/URI.java | URI.getRawCurrentHierPath | protected char[] getRawCurrentHierPath(char[] path) throws URIException {
"""
Get the raw-escaped current hierarchy level in the given path.
If the last namespace is a collection, the slash mark ('/') should be
ended with at the last character of the path string.
@param path the path
@return the current hier... | java | protected char[] getRawCurrentHierPath(char[] path) throws URIException {
if (_is_opaque_part) {
throw new URIException(URIException.PARSING, "no hierarchy level");
}
if (path == null) {
throw new URIException(URIException.PARSING, "empty path");
}
String... | [
"protected",
"char",
"[",
"]",
"getRawCurrentHierPath",
"(",
"char",
"[",
"]",
"path",
")",
"throws",
"URIException",
"{",
"if",
"(",
"_is_opaque_part",
")",
"{",
"throw",
"new",
"URIException",
"(",
"URIException",
".",
"PARSING",
",",
"\"no hierarchy level\"",... | Get the raw-escaped current hierarchy level in the given path.
If the last namespace is a collection, the slash mark ('/') should be
ended with at the last character of the path string.
@param path the path
@return the current hierarchy level
@throws URIException no hierarchy level | [
"Get",
"the",
"raw",
"-",
"escaped",
"current",
"hierarchy",
"level",
"in",
"the",
"given",
"path",
".",
"If",
"the",
"last",
"namespace",
"is",
"a",
"collection",
"the",
"slash",
"mark",
"(",
"/",
")",
"should",
"be",
"ended",
"with",
"at",
"the",
"la... | train | https://github.com/zaproxy/zaproxy/blob/0cbe5121f2ae1ecca222513d182759210c569bec/src/org/apache/commons/httpclient/URI.java#L2995-L3013 |
xwiki/xwiki-commons | xwiki-commons-core/xwiki-commons-crypto/xwiki-commons-crypto-pkix/src/main/java/org/xwiki/crypto/signer/internal/cms/BcStoreUtils.java | BcStoreUtils.getCertificateProvider | public static CertificateProvider getCertificateProvider(ComponentManager manager,
Collection<CertifiedPublicKey> certificates) throws GeneralSecurityException {
"""
Create a new store containing the given certificates and return it as a certificate provider.
@param manager the component manager.
@para... | java | public static CertificateProvider getCertificateProvider(ComponentManager manager,
Collection<CertifiedPublicKey> certificates) throws GeneralSecurityException
{
if (certificates == null || certificates.isEmpty()) {
return null;
}
Collection<X509CertificateHolder> certs ... | [
"public",
"static",
"CertificateProvider",
"getCertificateProvider",
"(",
"ComponentManager",
"manager",
",",
"Collection",
"<",
"CertifiedPublicKey",
">",
"certificates",
")",
"throws",
"GeneralSecurityException",
"{",
"if",
"(",
"certificates",
"==",
"null",
"||",
"ce... | Create a new store containing the given certificates and return it as a certificate provider.
@param manager the component manager.
@param certificates the certificates.
@return a certificate provider wrapping the collection of certificate.
@throws GeneralSecurityException if unable to initialize the provider. | [
"Create",
"a",
"new",
"store",
"containing",
"the",
"given",
"certificates",
"and",
"return",
"it",
"as",
"a",
"certificate",
"provider",
"."
] | train | https://github.com/xwiki/xwiki-commons/blob/5374d8c6d966588c1eac7392c83da610dfb9f129/xwiki-commons-core/xwiki-commons-crypto/xwiki-commons-crypto-pkix/src/main/java/org/xwiki/crypto/signer/internal/cms/BcStoreUtils.java#L102-L116 |
tbrooks8/Precipice | precipice-core/src/main/java/net/uncontended/precipice/GuardRail.java | GuardRail.releasePermits | public void releasePermits(long number, Result result, long startNanos, long nanoTime) {
"""
Release acquired permits with known result. Since there is a known result the result
count object and latency will be updated.
@param number of permits to release
@param result of the execution
@param startNa... | java | public void releasePermits(long number, Result result, long startNanos, long nanoTime) {
resultCounts.write(result, number, nanoTime);
resultLatency.write(result, number, nanoTime - startNanos, nanoTime);
for (BackPressure<Rejected> backPressure : backPressureList) {
backPressure.re... | [
"public",
"void",
"releasePermits",
"(",
"long",
"number",
",",
"Result",
"result",
",",
"long",
"startNanos",
",",
"long",
"nanoTime",
")",
"{",
"resultCounts",
".",
"write",
"(",
"result",
",",
"number",
",",
"nanoTime",
")",
";",
"resultLatency",
".",
"... | Release acquired permits with known result. Since there is a known result the result
count object and latency will be updated.
@param number of permits to release
@param result of the execution
@param startNanos of the execution
@param nanoTime currentInterval nano time | [
"Release",
"acquired",
"permits",
"with",
"known",
"result",
".",
"Since",
"there",
"is",
"a",
"known",
"result",
"the",
"result",
"count",
"object",
"and",
"latency",
"will",
"be",
"updated",
"."
] | train | https://github.com/tbrooks8/Precipice/blob/97fae467fd676b16a96b8d88b02569d8fc1f2681/precipice-core/src/main/java/net/uncontended/precipice/GuardRail.java#L152-L159 |
atomix/atomix | core/src/main/java/io/atomix/core/registry/ClasspathScanningRegistry.java | ClasspathScanningRegistry.newInstance | @SuppressWarnings("unchecked")
private static <T> T newInstance(Class<?> type) {
"""
Instantiates the given type using a no-argument constructor.
@param type the type to instantiate
@param <T> the generic type
@return the instantiated object
@throws ServiceException if the type cannot be instantiated
... | java | @SuppressWarnings("unchecked")
private static <T> T newInstance(Class<?> type) {
try {
return (T) type.newInstance();
} catch (InstantiationException | IllegalAccessException e) {
throw new ServiceException("Cannot instantiate service class " + type, e);
}
} | [
"@",
"SuppressWarnings",
"(",
"\"unchecked\"",
")",
"private",
"static",
"<",
"T",
">",
"T",
"newInstance",
"(",
"Class",
"<",
"?",
">",
"type",
")",
"{",
"try",
"{",
"return",
"(",
"T",
")",
"type",
".",
"newInstance",
"(",
")",
";",
"}",
"catch",
... | Instantiates the given type using a no-argument constructor.
@param type the type to instantiate
@param <T> the generic type
@return the instantiated object
@throws ServiceException if the type cannot be instantiated | [
"Instantiates",
"the",
"given",
"type",
"using",
"a",
"no",
"-",
"argument",
"constructor",
"."
] | train | https://github.com/atomix/atomix/blob/3a94b7c80576d762dd0d396d4645df07a0b37c31/core/src/main/java/io/atomix/core/registry/ClasspathScanningRegistry.java#L128-L135 |
jpush/jmessage-api-java-client | src/main/java/cn/jmessage/api/JMessageClient.java | JMessageClient.v2GetUserMessagesByCursor | public MessageListResult v2GetUserMessagesByCursor(String username, String cursor)
throws APIConnectionException, APIRequestException {
"""
Get user's message list with cursor, the cursor will effective in 120 seconds.
And will return same count of messages as first request.
@param username Necessary... | java | public MessageListResult v2GetUserMessagesByCursor(String username, String cursor)
throws APIConnectionException, APIRequestException {
return _reportClient.v2GetUserMessagesByCursor(username, cursor);
} | [
"public",
"MessageListResult",
"v2GetUserMessagesByCursor",
"(",
"String",
"username",
",",
"String",
"cursor",
")",
"throws",
"APIConnectionException",
",",
"APIRequestException",
"{",
"return",
"_reportClient",
".",
"v2GetUserMessagesByCursor",
"(",
"username",
",",
"cu... | Get user's message list with cursor, the cursor will effective in 120 seconds.
And will return same count of messages as first request.
@param username Necessary parameter.
@param cursor First request will return cursor
@return MessageListResult
@throws APIConnectionException connect exception
@throws APIRequestExcepti... | [
"Get",
"user",
"s",
"message",
"list",
"with",
"cursor",
"the",
"cursor",
"will",
"effective",
"in",
"120",
"seconds",
".",
"And",
"will",
"return",
"same",
"count",
"of",
"messages",
"as",
"first",
"request",
"."
] | train | https://github.com/jpush/jmessage-api-java-client/blob/767f5fb15e9fe5a546c00f6e68b64f6dd53c617c/src/main/java/cn/jmessage/api/JMessageClient.java#L982-L985 |
leadware/jpersistence-tools | jpersistence-tools-core/src/main/java/net/leadware/persistence/tools/core/dao/impl/JPAGenericDAORulesBasedImpl.java | JPAGenericDAORulesBasedImpl.validateEntityIntegrityConstraint | protected void validateEntityIntegrityConstraint(Object entity, DAOMode mode, DAOValidatorEvaluationTime validationTime) {
"""
Méthode de validation des contraintes d'integrités
@param entity Entité à valider
@param mode Mode DAO
@param validationTime Moment d'évaluation
"""
// Validation des contraint... | java | protected void validateEntityIntegrityConstraint(Object entity, DAOMode mode, DAOValidatorEvaluationTime validationTime) {
// Validation des contraintes d'integrites
JSR303ValidatorEngine.getDefaultInstance().validate(entity);
} | [
"protected",
"void",
"validateEntityIntegrityConstraint",
"(",
"Object",
"entity",
",",
"DAOMode",
"mode",
",",
"DAOValidatorEvaluationTime",
"validationTime",
")",
"{",
"// Validation des contraintes d'integrites\r",
"JSR303ValidatorEngine",
".",
"getDefaultInstance",
"(",
")"... | Méthode de validation des contraintes d'integrités
@param entity Entité à valider
@param mode Mode DAO
@param validationTime Moment d'évaluation | [
"Méthode",
"de",
"validation",
"des",
"contraintes",
"d",
"integrités"
] | train | https://github.com/leadware/jpersistence-tools/blob/4c15372993584579d7dbb9b23dd4c0c0fdc9e789/jpersistence-tools-core/src/main/java/net/leadware/persistence/tools/core/dao/impl/JPAGenericDAORulesBasedImpl.java#L791-L795 |
sagiegurari/fax4j | src/main/java/org/fax4j/spi/email/AbstractMailFaxClientSpi.java | AbstractMailFaxClientSpi.sendMail | protected void sendMail(FaxJob faxJob,Connection<MailResourcesHolder> mailConnection,Message message) {
"""
This function will send the mail message.
@param faxJob
The fax job object containing the needed information
@param mailConnection
The mail connection (will be released if not persistent)
@param ... | java | protected void sendMail(FaxJob faxJob,Connection<MailResourcesHolder> mailConnection,Message message)
{
if(message==null)
{
this.throwUnsupportedException();
}
else
{
//get holder
MailResourcesHolder mailResourcesHolder=mailConnection.getRe... | [
"protected",
"void",
"sendMail",
"(",
"FaxJob",
"faxJob",
",",
"Connection",
"<",
"MailResourcesHolder",
">",
"mailConnection",
",",
"Message",
"message",
")",
"{",
"if",
"(",
"message",
"==",
"null",
")",
"{",
"this",
".",
"throwUnsupportedException",
"(",
")... | This function will send the mail message.
@param faxJob
The fax job object containing the needed information
@param mailConnection
The mail connection (will be released if not persistent)
@param message
The message to send | [
"This",
"function",
"will",
"send",
"the",
"mail",
"message",
"."
] | train | https://github.com/sagiegurari/fax4j/blob/42fa51acabe7bf279e27ab3dd1cf76146b27955f/src/main/java/org/fax4j/spi/email/AbstractMailFaxClientSpi.java#L323-L372 |
sniffy/sniffy | sniffy-core/src/main/java/io/sniffy/LegacySpy.java | LegacySpy.expectAtLeast | @Deprecated
public C expectAtLeast(int allowedStatements, Threads threadMatcher, Query query) {
"""
Alias for {@link #expectBetween(int, int, Threads, Query)} with arguments {@code allowedStatements}, {@link Integer#MAX_VALUE}, {@code threads}, {@code queryType}
@since 2.2
"""
return expect(SqlQue... | java | @Deprecated
public C expectAtLeast(int allowedStatements, Threads threadMatcher, Query query) {
return expect(SqlQueries.minQueries(allowedStatements).threads(threadMatcher).type(adapter(query)));
} | [
"@",
"Deprecated",
"public",
"C",
"expectAtLeast",
"(",
"int",
"allowedStatements",
",",
"Threads",
"threadMatcher",
",",
"Query",
"query",
")",
"{",
"return",
"expect",
"(",
"SqlQueries",
".",
"minQueries",
"(",
"allowedStatements",
")",
".",
"threads",
"(",
... | Alias for {@link #expectBetween(int, int, Threads, Query)} with arguments {@code allowedStatements}, {@link Integer#MAX_VALUE}, {@code threads}, {@code queryType}
@since 2.2 | [
"Alias",
"for",
"{"
] | train | https://github.com/sniffy/sniffy/blob/7bdddb9593e6b6e9fe5c7c87519f864acbc3a5c0/sniffy-core/src/main/java/io/sniffy/LegacySpy.java#L521-L524 |
apache/flink | flink-streaming-java/src/main/java/org/apache/flink/streaming/api/datastream/WindowedStream.java | WindowedStream.process | @PublicEvolving
public <R> SingleOutputStreamOperator<R> process(ProcessWindowFunction<T, R, K, W> function) {
"""
Applies the given window function to each window. The window function is called for each
evaluation of the window for each key individually. The output of the window function is
interpreted as a re... | java | @PublicEvolving
public <R> SingleOutputStreamOperator<R> process(ProcessWindowFunction<T, R, K, W> function) {
TypeInformation<R> resultType = getProcessWindowFunctionReturnType(function, getInputType(), null);
return process(function, resultType);
} | [
"@",
"PublicEvolving",
"public",
"<",
"R",
">",
"SingleOutputStreamOperator",
"<",
"R",
">",
"process",
"(",
"ProcessWindowFunction",
"<",
"T",
",",
"R",
",",
"K",
",",
"W",
">",
"function",
")",
"{",
"TypeInformation",
"<",
"R",
">",
"resultType",
"=",
... | Applies the given window function to each window. The window function is called for each
evaluation of the window for each key individually. The output of the window function is
interpreted as a regular non-windowed stream.
<p>Note that this function requires that all data in the windows is buffered until the window
i... | [
"Applies",
"the",
"given",
"window",
"function",
"to",
"each",
"window",
".",
"The",
"window",
"function",
"is",
"called",
"for",
"each",
"evaluation",
"of",
"the",
"window",
"for",
"each",
"key",
"individually",
".",
"The",
"output",
"of",
"the",
"window",
... | train | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-streaming-java/src/main/java/org/apache/flink/streaming/api/datastream/WindowedStream.java#L1052-L1057 |
infinispan/infinispan | client/hotrod-client/src/main/java/org/infinispan/client/hotrod/event/ClientEvents.java | ClientEvents.addClientQueryListener | public static void addClientQueryListener(RemoteCache<?, ?> remoteCache, Object listener, Query query) {
"""
Register a client listener that uses a query DSL based filter. The listener is expected to be annotated such that
{@link org.infinispan.client.hotrod.annotation.ClientListener#useRawData} = true and {@link... | java | public static void addClientQueryListener(RemoteCache<?, ?> remoteCache, Object listener, Query query) {
ClientListener l = ReflectionUtil.getAnnotation(listener.getClass(), ClientListener.class);
if (l == null) {
throw log.missingClientListenerAnnotation(listener.getClass().getName());
}
... | [
"public",
"static",
"void",
"addClientQueryListener",
"(",
"RemoteCache",
"<",
"?",
",",
"?",
">",
"remoteCache",
",",
"Object",
"listener",
",",
"Query",
"query",
")",
"{",
"ClientListener",
"l",
"=",
"ReflectionUtil",
".",
"getAnnotation",
"(",
"listener",
"... | Register a client listener that uses a query DSL based filter. The listener is expected to be annotated such that
{@link org.infinispan.client.hotrod.annotation.ClientListener#useRawData} = true and {@link
org.infinispan.client.hotrod.annotation.ClientListener#filterFactoryName} and {@link
org.infinispan.client.hotrod.... | [
"Register",
"a",
"client",
"listener",
"that",
"uses",
"a",
"query",
"DSL",
"based",
"filter",
".",
"The",
"listener",
"is",
"expected",
"to",
"be",
"annotated",
"such",
"that",
"{",
"@link",
"org",
".",
"infinispan",
".",
"client",
".",
"hotrod",
".",
"... | train | https://github.com/infinispan/infinispan/blob/7c62b94886c3febb4774ae8376acf2baa0265ab5/client/hotrod-client/src/main/java/org/infinispan/client/hotrod/event/ClientEvents.java#L43-L59 |
grpc/grpc-java | netty/src/main/java/io/grpc/netty/NettyChannelBuilder.java | NettyChannelBuilder.enableKeepAlive | @Deprecated
public final NettyChannelBuilder enableKeepAlive(boolean enable, long keepAliveTime,
TimeUnit delayUnit, long keepAliveTimeout, TimeUnit timeoutUnit) {
"""
Enable keepalive with custom delay and timeout.
@deprecated Please use {@link #keepAliveTime} and {@link #keepAliveTimeout} instead
... | java | @Deprecated
public final NettyChannelBuilder enableKeepAlive(boolean enable, long keepAliveTime,
TimeUnit delayUnit, long keepAliveTimeout, TimeUnit timeoutUnit) {
if (enable) {
return keepAliveTime(keepAliveTime, delayUnit)
.keepAliveTimeout(keepAliveTimeout, timeoutUnit);
}
return ... | [
"@",
"Deprecated",
"public",
"final",
"NettyChannelBuilder",
"enableKeepAlive",
"(",
"boolean",
"enable",
",",
"long",
"keepAliveTime",
",",
"TimeUnit",
"delayUnit",
",",
"long",
"keepAliveTimeout",
",",
"TimeUnit",
"timeoutUnit",
")",
"{",
"if",
"(",
"enable",
")... | Enable keepalive with custom delay and timeout.
@deprecated Please use {@link #keepAliveTime} and {@link #keepAliveTimeout} instead | [
"Enable",
"keepalive",
"with",
"custom",
"delay",
"and",
"timeout",
"."
] | train | https://github.com/grpc/grpc-java/blob/973885457f9609de232d2553b82c67f6c3ff57bf/netty/src/main/java/io/grpc/netty/NettyChannelBuilder.java#L339-L347 |
JakeWharton/ActionBarSherlock | actionbarsherlock/src/com/actionbarsherlock/widget/SuggestionsAdapter.java | SuggestionsAdapter.getDrawableFromResourceValue | private Drawable getDrawableFromResourceValue(String drawableId) {
"""
Gets a drawable given a value provided by a suggestion provider.
This value could be just the string value of a resource id
(e.g., "2130837524"), in which case we will try to retrieve a drawable from
the provider's resources. If the value ... | java | private Drawable getDrawableFromResourceValue(String drawableId) {
if (drawableId == null || drawableId.length() == 0 || "0".equals(drawableId)) {
return null;
}
try {
// First, see if it's just an integer
int resourceId = Integer.parseInt(drawableId);
... | [
"private",
"Drawable",
"getDrawableFromResourceValue",
"(",
"String",
"drawableId",
")",
"{",
"if",
"(",
"drawableId",
"==",
"null",
"||",
"drawableId",
".",
"length",
"(",
")",
"==",
"0",
"||",
"\"0\"",
".",
"equals",
"(",
"drawableId",
")",
")",
"{",
"re... | Gets a drawable given a value provided by a suggestion provider.
This value could be just the string value of a resource id
(e.g., "2130837524"), in which case we will try to retrieve a drawable from
the provider's resources. If the value is not an integer, it is
treated as a Uri and opened with
{@link ContentResolver... | [
"Gets",
"a",
"drawable",
"given",
"a",
"value",
"provided",
"by",
"a",
"suggestion",
"provider",
"."
] | train | https://github.com/JakeWharton/ActionBarSherlock/blob/2c71339e756bcc0b1424c4525680549ba3a2dc97/actionbarsherlock/src/com/actionbarsherlock/widget/SuggestionsAdapter.java#L544-L579 |
inmite/android-validation-komensky | library/src/main/java/eu/inmite/android/lib/validations/form/FormValidator.java | FormValidator.registerViewAdapter | @SuppressWarnings("TryWithIdenticalCatches")
public static void registerViewAdapter(Class<? extends View> viewType, Class<? extends IFieldAdapter<? extends View,?>> adapterClass) {
"""
Register adapter that can be used to get value from view.
@param viewType type of view adapter is determined to get values from
... | java | @SuppressWarnings("TryWithIdenticalCatches")
public static void registerViewAdapter(Class<? extends View> viewType, Class<? extends IFieldAdapter<? extends View,?>> adapterClass) {
if (viewType == null || adapterClass == null) {
throw new IllegalArgumentException("arguments must not be null");
}
try {
Fie... | [
"@",
"SuppressWarnings",
"(",
"\"TryWithIdenticalCatches\"",
")",
"public",
"static",
"void",
"registerViewAdapter",
"(",
"Class",
"<",
"?",
"extends",
"View",
">",
"viewType",
",",
"Class",
"<",
"?",
"extends",
"IFieldAdapter",
"<",
"?",
"extends",
"View",
",",... | Register adapter that can be used to get value from view.
@param viewType type of view adapter is determined to get values from
@param adapterClass class of adapter to register
@throws IllegalArgumentException if adapterClass is null or viewType is null
@throws FormsValidationException when there is a problem when acc... | [
"Register",
"adapter",
"that",
"can",
"be",
"used",
"to",
"get",
"value",
"from",
"view",
".",
"@param",
"viewType",
"type",
"of",
"view",
"adapter",
"is",
"determined",
"to",
"get",
"values",
"from",
"@param",
"adapterClass",
"class",
"of",
"adapter",
"to",... | train | https://github.com/inmite/android-validation-komensky/blob/7c544f2d9f104a9800fcf4757eecb3caa8e76451/library/src/main/java/eu/inmite/android/lib/validations/form/FormValidator.java#L85-L98 |
phax/ph-masterdata | ph-masterdata/src/main/java/com/helger/masterdata/currency/CurrencyHelper.java | CurrencyHelper.parseValueFormat | @Nullable
public static BigDecimal parseValueFormat (@Nullable final ECurrency eCurrency,
@Nullable final String sTextValue,
@Nullable final BigDecimal aDefault) {
"""
Try to parse a string value formatted by the {@link Dec... | java | @Nullable
public static BigDecimal parseValueFormat (@Nullable final ECurrency eCurrency,
@Nullable final String sTextValue,
@Nullable final BigDecimal aDefault)
{
final PerCurrencySettings aPCS = getSettings (eCurrency);
... | [
"@",
"Nullable",
"public",
"static",
"BigDecimal",
"parseValueFormat",
"(",
"@",
"Nullable",
"final",
"ECurrency",
"eCurrency",
",",
"@",
"Nullable",
"final",
"String",
"sTextValue",
",",
"@",
"Nullable",
"final",
"BigDecimal",
"aDefault",
")",
"{",
"final",
"Pe... | Try to parse a string value formatted by the {@link DecimalFormat} object
returned from {@link #getValueFormat(ECurrency)}
@param eCurrency
The currency it is about. If <code>null</code> is provided
{@link #DEFAULT_CURRENCY} is used instead.
@param sTextValue
The string value. It will be trimmed, and the decimal separ... | [
"Try",
"to",
"parse",
"a",
"string",
"value",
"formatted",
"by",
"the",
"{",
"@link",
"DecimalFormat",
"}",
"object",
"returned",
"from",
"{",
"@link",
"#getValueFormat",
"(",
"ECurrency",
")",
"}"
] | train | https://github.com/phax/ph-masterdata/blob/ca5e0b03c735b30b47930c018bfb5e71f00d0ff4/ph-masterdata/src/main/java/com/helger/masterdata/currency/CurrencyHelper.java#L528-L546 |
alkacon/opencms-core | src/org/opencms/ade/configuration/CmsADEManager.java | CmsADEManager.internalLookupConfiguration | protected CmsADEConfigData internalLookupConfiguration(CmsObject cms, String rootPath) {
"""
Internal configuration lookup method.<p>
@param cms the cms context
@param rootPath the root path for which to look up the configuration
@return the configuration for the given path
"""
boolean online =... | java | protected CmsADEConfigData internalLookupConfiguration(CmsObject cms, String rootPath) {
boolean online = (null == cms) || isOnline(cms);
CmsADEConfigCacheState state = getCacheState(online);
return state.lookupConfiguration(rootPath);
} | [
"protected",
"CmsADEConfigData",
"internalLookupConfiguration",
"(",
"CmsObject",
"cms",
",",
"String",
"rootPath",
")",
"{",
"boolean",
"online",
"=",
"(",
"null",
"==",
"cms",
")",
"||",
"isOnline",
"(",
"cms",
")",
";",
"CmsADEConfigCacheState",
"state",
"=",... | Internal configuration lookup method.<p>
@param cms the cms context
@param rootPath the root path for which to look up the configuration
@return the configuration for the given path | [
"Internal",
"configuration",
"lookup",
"method",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/ade/configuration/CmsADEManager.java#L1457-L1462 |
advantageous/boon | reflekt/src/main/java/io/advantageous/boon/core/Str.java | Str.idx | public static char idx( String str, int index ) {
"""
Gets character at index
@param str string
@param index index
@return char at
"""
int i = calculateIndex( str.length(), index );
char c = str.charAt( i );
return c;
} | java | public static char idx( String str, int index ) {
int i = calculateIndex( str.length(), index );
char c = str.charAt( i );
return c;
} | [
"public",
"static",
"char",
"idx",
"(",
"String",
"str",
",",
"int",
"index",
")",
"{",
"int",
"i",
"=",
"calculateIndex",
"(",
"str",
".",
"length",
"(",
")",
",",
"index",
")",
";",
"char",
"c",
"=",
"str",
".",
"charAt",
"(",
"i",
")",
";",
... | Gets character at index
@param str string
@param index index
@return char at | [
"Gets",
"character",
"at",
"index"
] | train | https://github.com/advantageous/boon/blob/12712d376761aa3b33223a9f1716720ddb67cb5e/reflekt/src/main/java/io/advantageous/boon/core/Str.java#L185-L190 |
apache/incubator-druid | server/src/main/java/org/apache/druid/metadata/IndexerSQLMetadataStorageCoordinator.java | IndexerSQLMetadataStorageCoordinator.announceHistoricalSegments | @Override
public Set<DataSegment> announceHistoricalSegments(final Set<DataSegment> segments) throws IOException {
"""
Attempts to insert a set of segments to the database. Returns the set of segments actually added (segments
with identifiers already in the database will not be added).
@param segments set of... | java | @Override
public Set<DataSegment> announceHistoricalSegments(final Set<DataSegment> segments) throws IOException
{
final SegmentPublishResult result = announceHistoricalSegments(segments, null, null);
// Metadata transaction cannot fail because we are not trying to do one.
if (!result.isSuccess()) {
... | [
"@",
"Override",
"public",
"Set",
"<",
"DataSegment",
">",
"announceHistoricalSegments",
"(",
"final",
"Set",
"<",
"DataSegment",
">",
"segments",
")",
"throws",
"IOException",
"{",
"final",
"SegmentPublishResult",
"result",
"=",
"announceHistoricalSegments",
"(",
"... | Attempts to insert a set of segments to the database. Returns the set of segments actually added (segments
with identifiers already in the database will not be added).
@param segments set of segments to add
@return set of segments actually added | [
"Attempts",
"to",
"insert",
"a",
"set",
"of",
"segments",
"to",
"the",
"database",
".",
"Returns",
"the",
"set",
"of",
"segments",
"actually",
"added",
"(",
"segments",
"with",
"identifiers",
"already",
"in",
"the",
"database",
"will",
"not",
"be",
"added",
... | train | https://github.com/apache/incubator-druid/blob/f776b9408962b9006cfcfe4d6c1794751972cc8e/server/src/main/java/org/apache/druid/metadata/IndexerSQLMetadataStorageCoordinator.java#L236-L247 |
google/j2objc | jre_emul/android/platform/external/icu/android_icu4j/src/main/java/android/icu/impl/ICUBinary.java | ICUBinary.getData | public static ByteBuffer getData(ClassLoader loader, String resourceName, String itemPath) {
"""
Loads an ICU binary data file and returns it as a ByteBuffer.
The buffer contents is normally read-only, but its position etc. can be modified.
@param loader Used for loader.getResourceAsStream() unless the data is... | java | public static ByteBuffer getData(ClassLoader loader, String resourceName, String itemPath) {
return getData(loader, resourceName, itemPath, false);
} | [
"public",
"static",
"ByteBuffer",
"getData",
"(",
"ClassLoader",
"loader",
",",
"String",
"resourceName",
",",
"String",
"itemPath",
")",
"{",
"return",
"getData",
"(",
"loader",
",",
"resourceName",
",",
"itemPath",
",",
"false",
")",
";",
"}"
] | Loads an ICU binary data file and returns it as a ByteBuffer.
The buffer contents is normally read-only, but its position etc. can be modified.
@param loader Used for loader.getResourceAsStream() unless the data is found elsewhere.
@param resourceName Resource name for use with the loader.
@param itemPath Relative ICU... | [
"Loads",
"an",
"ICU",
"binary",
"data",
"file",
"and",
"returns",
"it",
"as",
"a",
"ByteBuffer",
".",
"The",
"buffer",
"contents",
"is",
"normally",
"read",
"-",
"only",
"but",
"its",
"position",
"etc",
".",
"can",
"be",
"modified",
"."
] | train | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/external/icu/android_icu4j/src/main/java/android/icu/impl/ICUBinary.java#L440-L442 |
spring-projects/spring-session-data-mongodb | src/main/java/org/springframework/session/data/mongo/ReactiveMongoOperationsSessionRepository.java | ReactiveMongoOperationsSessionRepository.deleteById | @Override
public Mono<Void> deleteById(String id) {
"""
Deletes the {@link MongoSession} with the given {@link MongoSession#getId()} or does nothing if the
{@link MongoSession} is not found.
@param id the {@link MongoSession#getId()} to delete
"""
return findSession(id)
.flatMap(document -> this.mo... | java | @Override
public Mono<Void> deleteById(String id) {
return findSession(id)
.flatMap(document -> this.mongoOperations.remove(document, this.collectionName).then(Mono.just(document)))
.map(document -> convertToSession(this.mongoSessionConverter, document))
.doOnSuccess(mongoSession -> publishEvent(new Ses... | [
"@",
"Override",
"public",
"Mono",
"<",
"Void",
">",
"deleteById",
"(",
"String",
"id",
")",
"{",
"return",
"findSession",
"(",
"id",
")",
".",
"flatMap",
"(",
"document",
"->",
"this",
".",
"mongoOperations",
".",
"remove",
"(",
"document",
",",
"this",... | Deletes the {@link MongoSession} with the given {@link MongoSession#getId()} or does nothing if the
{@link MongoSession} is not found.
@param id the {@link MongoSession#getId()} to delete | [
"Deletes",
"the",
"{",
"@link",
"MongoSession",
"}",
"with",
"the",
"given",
"{",
"@link",
"MongoSession#getId",
"()",
"}",
"or",
"does",
"nothing",
"if",
"the",
"{",
"@link",
"MongoSession",
"}",
"is",
"not",
"found",
"."
] | train | https://github.com/spring-projects/spring-session-data-mongodb/blob/c507bb2d2a9b52ea9846ffaf1ac7c71cb0e6690e/src/main/java/org/springframework/session/data/mongo/ReactiveMongoOperationsSessionRepository.java#L136-L144 |
michael-rapp/AndroidUtil | library/src/main/java/de/mrapp/android/util/ThemeUtil.java | ThemeUtil.getDrawable | public static Drawable getDrawable(@NonNull final Context context,
@AttrRes final int resourceId) {
"""
Obtains the drawable, which corresponds to a specific resource id, from a context's theme. If
the given resource id is invalid, a {@link NotFoundException} will be thrown.... | java | public static Drawable getDrawable(@NonNull final Context context,
@AttrRes final int resourceId) {
return getDrawable(context, -1, resourceId);
} | [
"public",
"static",
"Drawable",
"getDrawable",
"(",
"@",
"NonNull",
"final",
"Context",
"context",
",",
"@",
"AttrRes",
"final",
"int",
"resourceId",
")",
"{",
"return",
"getDrawable",
"(",
"context",
",",
"-",
"1",
",",
"resourceId",
")",
";",
"}"
] | Obtains the drawable, which corresponds to a specific resource id, from a context's theme. If
the given resource id is invalid, a {@link NotFoundException} will be thrown.
@param context
The context, which should be used, as an instance of the class {@link Context}. The
context may not be null
@param resourceId
The re... | [
"Obtains",
"the",
"drawable",
"which",
"corresponds",
"to",
"a",
"specific",
"resource",
"id",
"from",
"a",
"context",
"s",
"theme",
".",
"If",
"the",
"given",
"resource",
"id",
"is",
"invalid",
"a",
"{",
"@link",
"NotFoundException",
"}",
"will",
"be",
"t... | train | https://github.com/michael-rapp/AndroidUtil/blob/67ec0e5732344eeb4d946dd1f96d782939e449f4/library/src/main/java/de/mrapp/android/util/ThemeUtil.java#L537-L540 |
ttddyy/datasource-proxy | src/main/java/net/ttddyy/dsproxy/support/ProxyDataSourceBuilder.java | ProxyDataSourceBuilder.logSlowQueryByJUL | public ProxyDataSourceBuilder logSlowQueryByJUL(long thresholdTime, TimeUnit timeUnit) {
"""
Register {@link JULSlowQueryListener}.
@param thresholdTime slow query threshold time
@param timeUnit slow query threshold time unit
@return builder
@since 1.4.1
"""
return logSlowQueryByJUL(threshol... | java | public ProxyDataSourceBuilder logSlowQueryByJUL(long thresholdTime, TimeUnit timeUnit) {
return logSlowQueryByJUL(thresholdTime, timeUnit, null, null);
} | [
"public",
"ProxyDataSourceBuilder",
"logSlowQueryByJUL",
"(",
"long",
"thresholdTime",
",",
"TimeUnit",
"timeUnit",
")",
"{",
"return",
"logSlowQueryByJUL",
"(",
"thresholdTime",
",",
"timeUnit",
",",
"null",
",",
"null",
")",
";",
"}"
] | Register {@link JULSlowQueryListener}.
@param thresholdTime slow query threshold time
@param timeUnit slow query threshold time unit
@return builder
@since 1.4.1 | [
"Register",
"{",
"@link",
"JULSlowQueryListener",
"}",
"."
] | train | https://github.com/ttddyy/datasource-proxy/blob/62163ccf9a569a99aa3ad9f9151a32567447a62e/src/main/java/net/ttddyy/dsproxy/support/ProxyDataSourceBuilder.java#L439-L441 |
Azure/azure-sdk-for-java | sql/resource-manager/v2014_04_01/src/main/java/com/microsoft/azure/management/sql/v2014_04_01/implementation/ElasticPoolActivitiesInner.java | ElasticPoolActivitiesInner.listByElasticPool | public List<ElasticPoolActivityInner> listByElasticPool(String resourceGroupName, String serverName, String elasticPoolName) {
"""
Returns elastic pool activities.
@param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or... | java | public List<ElasticPoolActivityInner> listByElasticPool(String resourceGroupName, String serverName, String elasticPoolName) {
return listByElasticPoolWithServiceResponseAsync(resourceGroupName, serverName, elasticPoolName).toBlocking().single().body();
} | [
"public",
"List",
"<",
"ElasticPoolActivityInner",
">",
"listByElasticPool",
"(",
"String",
"resourceGroupName",
",",
"String",
"serverName",
",",
"String",
"elasticPoolName",
")",
"{",
"return",
"listByElasticPoolWithServiceResponseAsync",
"(",
"resourceGroupName",
",",
... | Returns elastic pool activities.
@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 elasticPoolName The name of the elastic pool for which to get the current ac... | [
"Returns",
"elastic",
"pool",
"activities",
"."
] | 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/ElasticPoolActivitiesInner.java#L72-L74 |
ivanceras/orm | src/main/java/com/ivanceras/db/server/util/ModelCurator.java | ModelCurator.crossOutLinkerTables | private void crossOutLinkerTables() {
"""
Remove a linker table present in the hasMany, then short circuit right away to the linked table
Linker tables contains composite primary keys of two tables
If each local column of the primary key is the primary of the table it is referring to
the this is a lookup tabl... | java | private void crossOutLinkerTables(){
String[] primaryKeys = model.getPrimaryAttributes();
if(primaryKeys != null && primaryKeys.length == 2){//there are only 2 primary keys
//if both primary keys look up to different table which is also a primary key
String[] hasOne = model.getHasOne();
String[] hasOneLoca... | [
"private",
"void",
"crossOutLinkerTables",
"(",
")",
"{",
"String",
"[",
"]",
"primaryKeys",
"=",
"model",
".",
"getPrimaryAttributes",
"(",
")",
";",
"if",
"(",
"primaryKeys",
"!=",
"null",
"&&",
"primaryKeys",
".",
"length",
"==",
"2",
")",
"{",
"//there... | Remove a linker table present in the hasMany, then short circuit right away to the linked table
Linker tables contains composite primary keys of two tables
If each local column of the primary key is the primary of the table it is referring to
the this is a lookup table
ie. product, product_category, category
Product ... | [
"Remove",
"a",
"linker",
"table",
"present",
"in",
"the",
"hasMany",
"then",
"short",
"circuit",
"right",
"away",
"to",
"the",
"linked",
"table"
] | train | https://github.com/ivanceras/orm/blob/e63213cb8abefd11df0e2d34b1c95477788e600e/src/main/java/com/ivanceras/db/server/util/ModelCurator.java#L282-L321 |
jeremylong/DependencyCheck | utils/src/main/java/org/owasp/dependencycheck/utils/ExpectedObjectInputStream.java | ExpectedObjectInputStream.resolveClass | @Override
protected Class<?> resolveClass(ObjectStreamClass desc) throws IOException, ClassNotFoundException {
"""
{@inheritDoc}
Only deserialize instances of expected classes by validating the class name prior to deserialization.
"""
if (!this.expected.contains(desc.getName())) {
th... | java | @Override
protected Class<?> resolveClass(ObjectStreamClass desc) throws IOException, ClassNotFoundException {
if (!this.expected.contains(desc.getName())) {
throw new InvalidClassException("Unexpected deserialization ", desc.getName());
}
return super.resolveClass(desc);
} | [
"@",
"Override",
"protected",
"Class",
"<",
"?",
">",
"resolveClass",
"(",
"ObjectStreamClass",
"desc",
")",
"throws",
"IOException",
",",
"ClassNotFoundException",
"{",
"if",
"(",
"!",
"this",
".",
"expected",
".",
"contains",
"(",
"desc",
".",
"getName",
"... | {@inheritDoc}
Only deserialize instances of expected classes by validating the class name prior to deserialization. | [
"{",
"@inheritDoc",
"}"
] | train | https://github.com/jeremylong/DependencyCheck/blob/6cc7690ea12e4ca1454210ceaa2e9a5523f0926c/utils/src/main/java/org/owasp/dependencycheck/utils/ExpectedObjectInputStream.java#L61-L67 |
google/j2objc | xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xpath/Expression.java | Expression.asIterator | public DTMIterator asIterator(XPathContext xctxt, int contextNode)
throws javax.xml.transform.TransformerException {
"""
Given an select expression and a context, evaluate the XPath
and return the resulting iterator.
@param xctxt The execution context.
@param contextNode The node that "." expresses.... | java | public DTMIterator asIterator(XPathContext xctxt, int contextNode)
throws javax.xml.transform.TransformerException
{
try
{
xctxt.pushCurrentNodeAndExpression(contextNode, contextNode);
return execute(xctxt).iter();
}
finally
{
xctxt.popCurrentNodeAndExpression();
... | [
"public",
"DTMIterator",
"asIterator",
"(",
"XPathContext",
"xctxt",
",",
"int",
"contextNode",
")",
"throws",
"javax",
".",
"xml",
".",
"transform",
".",
"TransformerException",
"{",
"try",
"{",
"xctxt",
".",
"pushCurrentNodeAndExpression",
"(",
"contextNode",
",... | Given an select expression and a context, evaluate the XPath
and return the resulting iterator.
@param xctxt The execution context.
@param contextNode The node that "." expresses.
@return A valid DTMIterator.
@throws TransformerException thrown if the active ProblemListener decides
the error condition is severe enou... | [
"Given",
"an",
"select",
"expression",
"and",
"a",
"context",
"evaluate",
"the",
"XPath",
"and",
"return",
"the",
"resulting",
"iterator",
"."
] | train | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xpath/Expression.java#L244-L258 |
google/truth | extensions/proto/src/main/java/com/google/common/truth/extensions/proto/MultimapWithProtoValuesSubject.java | MultimapWithProtoValuesSubject.usingDoubleToleranceForFieldsForValues | public MultimapWithProtoValuesFluentAssertion<M> usingDoubleToleranceForFieldsForValues(
double tolerance, Iterable<Integer> fieldNumbers) {
"""
Compares double fields with these explicitly specified top-level field numbers using the
provided absolute tolerance.
@param tolerance A finite, non-negative to... | java | public MultimapWithProtoValuesFluentAssertion<M> usingDoubleToleranceForFieldsForValues(
double tolerance, Iterable<Integer> fieldNumbers) {
return usingConfig(config.usingDoubleToleranceForFields(tolerance, fieldNumbers));
} | [
"public",
"MultimapWithProtoValuesFluentAssertion",
"<",
"M",
">",
"usingDoubleToleranceForFieldsForValues",
"(",
"double",
"tolerance",
",",
"Iterable",
"<",
"Integer",
">",
"fieldNumbers",
")",
"{",
"return",
"usingConfig",
"(",
"config",
".",
"usingDoubleToleranceForFi... | Compares double fields with these explicitly specified top-level field numbers using the
provided absolute tolerance.
@param tolerance A finite, non-negative tolerance. | [
"Compares",
"double",
"fields",
"with",
"these",
"explicitly",
"specified",
"top",
"-",
"level",
"field",
"numbers",
"using",
"the",
"provided",
"absolute",
"tolerance",
"."
] | train | https://github.com/google/truth/blob/60eceffd2e8c3297655d33ed87d965cf5af51108/extensions/proto/src/main/java/com/google/common/truth/extensions/proto/MultimapWithProtoValuesSubject.java#L575-L578 |
jbundle/jbundle | base/base/src/main/java/org/jbundle/base/db/event/NoDeleteModifyHandler.java | NoDeleteModifyHandler.init | public void init(Record record, boolean bNoDelete, boolean bNoModify) {
"""
Constructor.
@param record My owner (usually passed as null, and set on addListener in setOwner()).
""" // For this to work right, the booking number field needs a listener to re-select this file whenever it changes
m_bNoDel... | java | public void init(Record record, boolean bNoDelete, boolean bNoModify)
{ // For this to work right, the booking number field needs a listener to re-select this file whenever it changes
m_bNoDelete = bNoDelete;
m_bNoModify = bNoModify;
super.init(record);
} | [
"public",
"void",
"init",
"(",
"Record",
"record",
",",
"boolean",
"bNoDelete",
",",
"boolean",
"bNoModify",
")",
"{",
"// For this to work right, the booking number field needs a listener to re-select this file whenever it changes",
"m_bNoDelete",
"=",
"bNoDelete",
";",
"m_bNo... | Constructor.
@param record My owner (usually passed as null, and set on addListener in setOwner()). | [
"Constructor",
"."
] | train | https://github.com/jbundle/jbundle/blob/4037fcfa85f60c7d0096c453c1a3cd573c2b0abc/base/base/src/main/java/org/jbundle/base/db/event/NoDeleteModifyHandler.java#L59-L64 |
sonyxperiadev/gerrit-events | src/main/java/com/sonymobile/tools/gerrit/gerritevents/GerritJsonEventFactory.java | GerritJsonEventFactory.getBoolean | public static boolean getBoolean(JSONObject json, String key, boolean defaultValue) {
"""
Returns the value of a JSON property as a boolean if it exists and boolean value
otherwise returns the defaultValue.
@param json the JSONObject to check.
@param key the key.
@param defaultValue the value to return if the ... | java | public static boolean getBoolean(JSONObject json, String key, boolean defaultValue) {
if (json.containsKey(key)) {
boolean result;
try {
result = json.getBoolean(key);
} catch (JSONException ex) {
result = defaultValue;
}
... | [
"public",
"static",
"boolean",
"getBoolean",
"(",
"JSONObject",
"json",
",",
"String",
"key",
",",
"boolean",
"defaultValue",
")",
"{",
"if",
"(",
"json",
".",
"containsKey",
"(",
"key",
")",
")",
"{",
"boolean",
"result",
";",
"try",
"{",
"result",
"=",... | Returns the value of a JSON property as a boolean if it exists and boolean value
otherwise returns the defaultValue.
@param json the JSONObject to check.
@param key the key.
@param defaultValue the value to return if the key is missing or not boolean value.
@return the value for the key as a boolean. | [
"Returns",
"the",
"value",
"of",
"a",
"JSON",
"property",
"as",
"a",
"boolean",
"if",
"it",
"exists",
"and",
"boolean",
"value",
"otherwise",
"returns",
"the",
"defaultValue",
"."
] | train | https://github.com/sonyxperiadev/gerrit-events/blob/9a443d13dded85cc4709136ac33989f2bbb34fe2/src/main/java/com/sonymobile/tools/gerrit/gerritevents/GerritJsonEventFactory.java#L233-L245 |
versionone/VersionOne.SDK.Java.ObjectModel | src/main/java/com/versionone/om/Project.java | Project.createGoal | public Goal createGoal(String name, Map<String, Object> attributes) {
"""
Create a new Goal in this Project.
@param name The initial name of the Goal.
@param attributes additional attributes for the Goal.
@return A new Goal.
"""
return getInstance().create().goal(name, this, attributes);
... | java | public Goal createGoal(String name, Map<String, Object> attributes) {
return getInstance().create().goal(name, this, attributes);
} | [
"public",
"Goal",
"createGoal",
"(",
"String",
"name",
",",
"Map",
"<",
"String",
",",
"Object",
">",
"attributes",
")",
"{",
"return",
"getInstance",
"(",
")",
".",
"create",
"(",
")",
".",
"goal",
"(",
"name",
",",
"this",
",",
"attributes",
")",
"... | Create a new Goal in this Project.
@param name The initial name of the Goal.
@param attributes additional attributes for the Goal.
@return A new Goal. | [
"Create",
"a",
"new",
"Goal",
"in",
"this",
"Project",
"."
] | train | https://github.com/versionone/VersionOne.SDK.Java.ObjectModel/blob/59d35b67c849299631bca45ee94143237eb2ae1a/src/main/java/com/versionone/om/Project.java#L272-L274 |
h2oai/h2o-2 | src/main/java/water/fvec/CBSChunk.java | CBSChunk.clen | public static int clen(int values, int bpv) {
"""
Returns compressed len of the given array length if the value if represented by bpv-bits.
"""
int len = (values*bpv) >> 3;
return values*bpv % 8 == 0 ? len : len + 1;
} | java | public static int clen(int values, int bpv) {
int len = (values*bpv) >> 3;
return values*bpv % 8 == 0 ? len : len + 1;
} | [
"public",
"static",
"int",
"clen",
"(",
"int",
"values",
",",
"int",
"bpv",
")",
"{",
"int",
"len",
"=",
"(",
"values",
"*",
"bpv",
")",
">>",
"3",
";",
"return",
"values",
"*",
"bpv",
"%",
"8",
"==",
"0",
"?",
"len",
":",
"len",
"+",
"1",
";... | Returns compressed len of the given array length if the value if represented by bpv-bits. | [
"Returns",
"compressed",
"len",
"of",
"the",
"given",
"array",
"length",
"if",
"the",
"value",
"if",
"represented",
"by",
"bpv",
"-",
"bits",
"."
] | train | https://github.com/h2oai/h2o-2/blob/be350f3f2c2fb6f135cc07c41f83fd0e4f521ac1/src/main/java/water/fvec/CBSChunk.java#L84-L87 |
Esri/geometry-api-java | src/main/java/com/esri/core/geometry/MultiPathImpl.java | MultiPathImpl.closePathWithBezier | public void closePathWithBezier(Point2D controlPoint1, Point2D controlPoint2) {
"""
Closes last path of the MultiPathImpl with the Bezier Segment.
The start point of the Bezier is the last point of the path and the last
point of the bezier is the first point of the path.
"""
_touch();
if (isEmptyImpl()... | java | public void closePathWithBezier(Point2D controlPoint1, Point2D controlPoint2) {
_touch();
if (isEmptyImpl())
throw new GeometryException(
"Invalid call. This operation cannot be performed on an empty geometry.");
m_bPathStarted = false;
int pathIndex = m_paths.size() - 2;
byte pf = m_pathFlags.read(... | [
"public",
"void",
"closePathWithBezier",
"(",
"Point2D",
"controlPoint1",
",",
"Point2D",
"controlPoint2",
")",
"{",
"_touch",
"(",
")",
";",
"if",
"(",
"isEmptyImpl",
"(",
")",
")",
"throw",
"new",
"GeometryException",
"(",
"\"Invalid call. This operation cannot be... | Closes last path of the MultiPathImpl with the Bezier Segment.
The start point of the Bezier is the last point of the path and the last
point of the bezier is the first point of the path. | [
"Closes",
"last",
"path",
"of",
"the",
"MultiPathImpl",
"with",
"the",
"Bezier",
"Segment",
"."
] | train | https://github.com/Esri/geometry-api-java/blob/494da8ec953d76e7c6072afbc081abfe48ff07cf/src/main/java/com/esri/core/geometry/MultiPathImpl.java#L524-L564 |
kiegroup/jbpm | jbpm-query-jpa/src/main/java/org/jbpm/query/jpa/impl/QueryCriteriaUtil.java | QueryCriteriaUtil.getEntityField | protected <T> Expression getEntityField(CriteriaQuery<T> query, String listId, Attribute attr) {
"""
This method retrieves the entity "field" that can be used as the LHS of a {@link Predicate}
</p>
This method is overridden in some extended {@link QueryCriteriaUtil} implementations
@param query The {@link Cri... | java | protected <T> Expression getEntityField(CriteriaQuery<T> query, String listId, Attribute attr) {
return defaultGetEntityField(query, listId, attr);
} | [
"protected",
"<",
"T",
">",
"Expression",
"getEntityField",
"(",
"CriteriaQuery",
"<",
"T",
">",
"query",
",",
"String",
"listId",
",",
"Attribute",
"attr",
")",
"{",
"return",
"defaultGetEntityField",
"(",
"query",
",",
"listId",
",",
"attr",
")",
";",
"}... | This method retrieves the entity "field" that can be used as the LHS of a {@link Predicate}
</p>
This method is overridden in some extended {@link QueryCriteriaUtil} implementations
@param query The {@link CriteriaQuery} that we're building
@param listId The list id of the given {@link QueryCriteria}
@return An {@link... | [
"This",
"method",
"retrieves",
"the",
"entity",
"field",
"that",
"can",
"be",
"used",
"as",
"the",
"LHS",
"of",
"a",
"{",
"@link",
"Predicate",
"}",
"<",
"/",
"p",
">",
"This",
"method",
"is",
"overridden",
"in",
"some",
"extended",
"{",
"@link",
"Quer... | train | https://github.com/kiegroup/jbpm/blob/c3473c728aa382ebbea01e380c5e754a96647b82/jbpm-query-jpa/src/main/java/org/jbpm/query/jpa/impl/QueryCriteriaUtil.java#L443-L445 |
javalite/activejdbc | activejdbc/src/main/java/org/javalite/activejdbc/Configuration.java | Configuration.overrideFromEnvironmentVariables | private void overrideFromEnvironmentVariables() {
"""
Overrides current environment's connection spec from system properties.
"""
String url = System.getenv("ACTIVEJDBC.URL");
String user = System.getenv("ACTIVEJDBC.USER");
String password = System.getenv("ACTIVEJDBC.PASSWORD");
... | java | private void overrideFromEnvironmentVariables() {
String url = System.getenv("ACTIVEJDBC.URL");
String user = System.getenv("ACTIVEJDBC.USER");
String password = System.getenv("ACTIVEJDBC.PASSWORD");
String driver = System.getenv("ACTIVEJDBC.DRIVER");
if(!blank(url) && !blank... | [
"private",
"void",
"overrideFromEnvironmentVariables",
"(",
")",
"{",
"String",
"url",
"=",
"System",
".",
"getenv",
"(",
"\"ACTIVEJDBC.URL\"",
")",
";",
"String",
"user",
"=",
"System",
".",
"getenv",
"(",
"\"ACTIVEJDBC.USER\"",
")",
";",
"String",
"password",
... | Overrides current environment's connection spec from system properties. | [
"Overrides",
"current",
"environment",
"s",
"connection",
"spec",
"from",
"system",
"properties",
"."
] | train | https://github.com/javalite/activejdbc/blob/ffcf5457cace19622a8f71e856cbbbe9e7dd5fcc/activejdbc/src/main/java/org/javalite/activejdbc/Configuration.java#L137-L150 |
deeplearning4j/deeplearning4j | deeplearning4j/deeplearning4j-nn/src/main/java/org/deeplearning4j/nn/conf/layers/LayerValidation.java | LayerValidation.assertNInNOutSet | public static void assertNInNOutSet(String layerType, String layerName, long layerIndex, long nIn, long nOut) {
"""
Asserts that the layer nIn and nOut values are set for the layer
@param layerType Type of layer ("DenseLayer", etc)
@param layerName Name of the layer (may be null if not set)
@param lay... | java | public static void assertNInNOutSet(String layerType, String layerName, long layerIndex, long nIn, long nOut) {
if (nIn <= 0 || nOut <= 0) {
if (layerName == null)
layerName = "(name not set)";
throw new DL4JInvalidConfigException(layerType + " (index=" + layerIndex + ", ... | [
"public",
"static",
"void",
"assertNInNOutSet",
"(",
"String",
"layerType",
",",
"String",
"layerName",
",",
"long",
"layerIndex",
",",
"long",
"nIn",
",",
"long",
"nOut",
")",
"{",
"if",
"(",
"nIn",
"<=",
"0",
"||",
"nOut",
"<=",
"0",
")",
"{",
"if",
... | Asserts that the layer nIn and nOut values are set for the layer
@param layerType Type of layer ("DenseLayer", etc)
@param layerName Name of the layer (may be null if not set)
@param layerIndex Index of the layer
@param nIn nIn value
@param nOut nOut value | [
"Asserts",
"that",
"the",
"layer",
"nIn",
"and",
"nOut",
"values",
"are",
"set",
"for",
"the",
"layer"
] | train | https://github.com/deeplearning4j/deeplearning4j/blob/effce52f2afd7eeb53c5bcca699fcd90bd06822f/deeplearning4j/deeplearning4j-nn/src/main/java/org/deeplearning4j/nn/conf/layers/LayerValidation.java#L50-L57 |
Alexey1Gavrilov/ExpectIt | expectit-core/src/main/java/net/sf/expectit/filter/Filters.java | Filters.replaceInBuffer | public static Filter replaceInBuffer(final String regexp, final String replacement) {
"""
Equivalent to {@link #replaceInBuffer(java.util.regex.Pattern,
String)} but takes the regular expression
as string.
@param regexp the regular expression
@param replacement the string to be substituted for each matc... | java | public static Filter replaceInBuffer(final String regexp, final String replacement) {
return replaceInBuffer(Pattern.compile(regexp), replacement);
} | [
"public",
"static",
"Filter",
"replaceInBuffer",
"(",
"final",
"String",
"regexp",
",",
"final",
"String",
"replacement",
")",
"{",
"return",
"replaceInBuffer",
"(",
"Pattern",
".",
"compile",
"(",
"regexp",
")",
",",
"replacement",
")",
";",
"}"
] | Equivalent to {@link #replaceInBuffer(java.util.regex.Pattern,
String)} but takes the regular expression
as string.
@param regexp the regular expression
@param replacement the string to be substituted for each match
@return the filter | [
"Equivalent",
"to",
"{",
"@link",
"#replaceInBuffer",
"(",
"java",
".",
"util",
".",
"regex",
".",
"Pattern",
"String",
")",
"}",
"but",
"takes",
"the",
"regular",
"expression",
"as",
"string",
"."
] | train | https://github.com/Alexey1Gavrilov/ExpectIt/blob/5acbe1f8f895fe1dbd63e29bf3ab8e5bbf0873c3/expectit-core/src/main/java/net/sf/expectit/filter/Filters.java#L151-L153 |
orbisgis/h2gis | h2gis-functions/src/main/java/org/h2gis/functions/spatial/clean/MakeValidOp.java | MakeValidOp.nodeLineString | private Set<LineString> nodeLineString(Coordinate[] coords, GeometryFactory gf) {
"""
Nodes a LineString and returns a List of Noded LineString's. Used to
repare auto-intersecting LineString and Polygons. This method cannot
process CoordinateSequence. The noding process is limited to 3d
geometries.<br/>
Preser... | java | private Set<LineString> nodeLineString(Coordinate[] coords, GeometryFactory gf) {
MCIndexNoder noder = new MCIndexNoder();
noder.setSegmentIntersector(new IntersectionAdder(new RobustLineIntersector()));
List<NodedSegmentString> list = new ArrayList<>();
list.add(new NodedSegmentString(c... | [
"private",
"Set",
"<",
"LineString",
">",
"nodeLineString",
"(",
"Coordinate",
"[",
"]",
"coords",
",",
"GeometryFactory",
"gf",
")",
"{",
"MCIndexNoder",
"noder",
"=",
"new",
"MCIndexNoder",
"(",
")",
";",
"noder",
".",
"setSegmentIntersector",
"(",
"new",
... | Nodes a LineString and returns a List of Noded LineString's. Used to
repare auto-intersecting LineString and Polygons. This method cannot
process CoordinateSequence. The noding process is limited to 3d
geometries.<br/>
Preserves duplicate coordinates.
@param coords coordinate array to be noded
@param gf geometryFactor... | [
"Nodes",
"a",
"LineString",
"and",
"returns",
"a",
"List",
"of",
"Noded",
"LineString",
"s",
".",
"Used",
"to",
"repare",
"auto",
"-",
"intersecting",
"LineString",
"and",
"Polygons",
".",
"This",
"method",
"cannot",
"process",
"CoordinateSequence",
".",
"The"... | train | https://github.com/orbisgis/h2gis/blob/9cd70b447e6469cecbc2fc64b16774b59491df3b/h2gis-functions/src/main/java/org/h2gis/functions/spatial/clean/MakeValidOp.java#L647-L675 |
orbisgis/h2gis | h2gis-utilities/src/main/java/org/h2gis/utilities/TableLocation.java | TableLocation.quoteIdentifier | public static String quoteIdentifier(String identifier, boolean isH2DataBase) {
"""
Quote identifier only if necessary. Require database knowledge.
@param identifier Catalog,Schema,Table or Field name
@param isH2DataBase True if the quote is for H2, false if for POSTGRE
@return Quoted Identifier
"""
... | java | public static String quoteIdentifier(String identifier, boolean isH2DataBase) {
if((isH2DataBase && (Constants.H2_RESERVED_WORDS.contains(identifier.toUpperCase())
|| !H2_SPECIAL_NAME_PATTERN.matcher(identifier).find())) ||
(!isH2DataBase && (Constants.POSTGIS_RESERVED_WO... | [
"public",
"static",
"String",
"quoteIdentifier",
"(",
"String",
"identifier",
",",
"boolean",
"isH2DataBase",
")",
"{",
"if",
"(",
"(",
"isH2DataBase",
"&&",
"(",
"Constants",
".",
"H2_RESERVED_WORDS",
".",
"contains",
"(",
"identifier",
".",
"toUpperCase",
"(",... | Quote identifier only if necessary. Require database knowledge.
@param identifier Catalog,Schema,Table or Field name
@param isH2DataBase True if the quote is for H2, false if for POSTGRE
@return Quoted Identifier | [
"Quote",
"identifier",
"only",
"if",
"necessary",
".",
"Require",
"database",
"knowledge",
"."
] | train | https://github.com/orbisgis/h2gis/blob/9cd70b447e6469cecbc2fc64b16774b59491df3b/h2gis-utilities/src/main/java/org/h2gis/utilities/TableLocation.java#L96-L105 |
ironjacamar/ironjacamar | core/src/main/java/org/ironjacamar/core/tracer/Tracer.java | Tracer.getConnection | public static synchronized void getConnection(String poolName, Object mcp, Object cl, Object connection) {
"""
Get connection
@param poolName The name of the pool
@param mcp The managed connection pool
@param cl The connection listener
@param connection The connection
"""
log.tracef("%s", new TraceEv... | java | public static synchronized void getConnection(String poolName, Object mcp, Object cl, Object connection)
{
log.tracef("%s", new TraceEvent(poolName,
Integer.toHexString(System.identityHashCode(mcp)),
TraceEvent.GET_CONNECTION,
... | [
"public",
"static",
"synchronized",
"void",
"getConnection",
"(",
"String",
"poolName",
",",
"Object",
"mcp",
",",
"Object",
"cl",
",",
"Object",
"connection",
")",
"{",
"log",
".",
"tracef",
"(",
"\"%s\"",
",",
"new",
"TraceEvent",
"(",
"poolName",
",",
"... | Get connection
@param poolName The name of the pool
@param mcp The managed connection pool
@param cl The connection listener
@param connection The connection | [
"Get",
"connection"
] | train | https://github.com/ironjacamar/ironjacamar/blob/f0389ee7e62aa8b40ba09b251edad76d220ea796/core/src/main/java/org/ironjacamar/core/tracer/Tracer.java#L373-L380 |
eFaps/eFaps-Kernel | src/main/java/org/efaps/update/version/Application.java | Application.compileAll | public void compileAll(final String _userName,
final boolean _addRuntimeClassPath)
throws InstallationException {
"""
Compiles the ESJP's and all Cascade Styles Sheets within eFaps.
@param _userName name of logged in user for which the compile is done
(could be also <code>nul... | java | public void compileAll(final String _userName,
final boolean _addRuntimeClassPath)
throws InstallationException
{
if (Application.LOG.isInfoEnabled()) {
Application.LOG.info("..Compiling");
}
reloadCache();
try {
Context.be... | [
"public",
"void",
"compileAll",
"(",
"final",
"String",
"_userName",
",",
"final",
"boolean",
"_addRuntimeClassPath",
")",
"throws",
"InstallationException",
"{",
"if",
"(",
"Application",
".",
"LOG",
".",
"isInfoEnabled",
"(",
")",
")",
"{",
"Application",
".",... | Compiles the ESJP's and all Cascade Styles Sheets within eFaps.
@param _userName name of logged in user for which the compile is done
(could be also <code>null</code>)
@param _addRuntimeClassPath must the classpath from the runtime be added
to the classpath also
@throws InstallationException if reload cache of compile... | [
"Compiles",
"the",
"ESJP",
"s",
"and",
"all",
"Cascade",
"Styles",
"Sheets",
"within",
"eFaps",
"."
] | train | https://github.com/eFaps/eFaps-Kernel/blob/04b96548f518c2386a93f5ec2b9349f9b9063859/src/main/java/org/efaps/update/version/Application.java#L462-L488 |
DataSketches/sketches-core | src/main/java/com/yahoo/sketches/theta/UnionImpl.java | UnionImpl.heapifyInstance | static UnionImpl heapifyInstance(final Memory srcMem, final long seed) {
"""
Heapify a Union from a Memory Union object containing data.
Called by SetOperation.
@param srcMem The source Memory Union object.
<a href="{@docRoot}/resources/dictionary.html#mem">See Memory</a>
@param seed <a href="{@docRoot}/resour... | java | static UnionImpl heapifyInstance(final Memory srcMem, final long seed) {
Family.UNION.checkFamilyID(extractFamilyID(srcMem));
final UpdateSketch gadget = HeapQuickSelectSketch.heapifyInstance(srcMem, seed);
final UnionImpl unionImpl = new UnionImpl(gadget, seed);
unionImpl.unionThetaLong_ = extractUnion... | [
"static",
"UnionImpl",
"heapifyInstance",
"(",
"final",
"Memory",
"srcMem",
",",
"final",
"long",
"seed",
")",
"{",
"Family",
".",
"UNION",
".",
"checkFamilyID",
"(",
"extractFamilyID",
"(",
"srcMem",
")",
")",
";",
"final",
"UpdateSketch",
"gadget",
"=",
"H... | Heapify a Union from a Memory Union object containing data.
Called by SetOperation.
@param srcMem The source Memory Union object.
<a href="{@docRoot}/resources/dictionary.html#mem">See Memory</a>
@param seed <a href="{@docRoot}/resources/dictionary.html#seed">See seed</a>
@return this class | [
"Heapify",
"a",
"Union",
"from",
"a",
"Memory",
"Union",
"object",
"containing",
"data",
".",
"Called",
"by",
"SetOperation",
"."
] | train | https://github.com/DataSketches/sketches-core/blob/900c8c9668a1e2f1d54d453e956caad54702e540/src/main/java/com/yahoo/sketches/theta/UnionImpl.java#L119-L126 |
MenoData/Time4J | base/src/main/java/net/time4j/DayPeriod.java | DayPeriod.of | public static DayPeriod of(Map<PlainTime, String> timeToLabels) {
"""
/*[deutsch]
<p>Erzeugt eine Instanz, die auf benutzerdefinierten Daten beruht. </p>
@param timeToLabels map containing the day-periods where the keys represent starting points
and the values represent the associated labels intended for... | java | public static DayPeriod of(Map<PlainTime, String> timeToLabels) {
if (timeToLabels.isEmpty()) {
throw new IllegalArgumentException("Label map is empty.");
}
SortedMap<PlainTime, String> map = new TreeMap<>(timeToLabels);
for (PlainTime key : timeToLabels.keySet()) {
... | [
"public",
"static",
"DayPeriod",
"of",
"(",
"Map",
"<",
"PlainTime",
",",
"String",
">",
"timeToLabels",
")",
"{",
"if",
"(",
"timeToLabels",
".",
"isEmpty",
"(",
")",
")",
"{",
"throw",
"new",
"IllegalArgumentException",
"(",
"\"Label map is empty.\"",
")",
... | /*[deutsch]
<p>Erzeugt eine Instanz, die auf benutzerdefinierten Daten beruht. </p>
@param timeToLabels map containing the day-periods where the keys represent starting points
and the values represent the associated labels intended for representation
@return user-specific instance
@throws IllegalArgumentExcepti... | [
"/",
"*",
"[",
"deutsch",
"]",
"<p",
">",
"Erzeugt",
"eine",
"Instanz",
"die",
"auf",
"benutzerdefinierten",
"Daten",
"beruht",
".",
"<",
"/",
"p",
">"
] | train | https://github.com/MenoData/Time4J/blob/08b2eda6b2dbb140b92011cf7071bb087edd46a5/base/src/main/java/net/time4j/DayPeriod.java#L180-L199 |
segmentio/analytics-android | analytics/src/main/java/com/segment/analytics/internal/Utils.java | Utils.getDeviceId | @SuppressLint("HardwareIds")
public static String getDeviceId(Context context) {
"""
Creates a unique device id. Suppresses `HardwareIds` lint warnings as we don't use this ID for
identifying specific users. This is also what is required by the Segment spec.
"""
String androidId = getString(context.getC... | java | @SuppressLint("HardwareIds")
public static String getDeviceId(Context context) {
String androidId = getString(context.getContentResolver(), ANDROID_ID);
if (!isNullOrEmpty(androidId)
&& !"9774d56d682e549c".equals(androidId)
&& !"unknown".equals(androidId)
&& !"000000000000000".equals(a... | [
"@",
"SuppressLint",
"(",
"\"HardwareIds\"",
")",
"public",
"static",
"String",
"getDeviceId",
"(",
"Context",
"context",
")",
"{",
"String",
"androidId",
"=",
"getString",
"(",
"context",
".",
"getContentResolver",
"(",
")",
",",
"ANDROID_ID",
")",
";",
"if",... | Creates a unique device id. Suppresses `HardwareIds` lint warnings as we don't use this ID for
identifying specific users. This is also what is required by the Segment spec. | [
"Creates",
"a",
"unique",
"device",
"id",
".",
"Suppresses",
"HardwareIds",
"lint",
"warnings",
"as",
"we",
"don",
"t",
"use",
"this",
"ID",
"for",
"identifying",
"specific",
"users",
".",
"This",
"is",
"also",
"what",
"is",
"required",
"by",
"the",
"Segme... | train | https://github.com/segmentio/analytics-android/blob/93c7d5bb09b593440a2347a6089db3e9f74012da/analytics/src/main/java/com/segment/analytics/internal/Utils.java#L254-L281 |
carewebframework/carewebframework-core | org.carewebframework.api-parent/org.carewebframework.api.core/src/main/java/org/carewebframework/api/AppFramework.java | AppFramework.postProcessAfterInitialization | @Override
public Object postProcessAfterInitialization(Object bean, String beanName) throws BeansException {
"""
Automatically registers any container-managed bean with the framework.
@param bean Object to register.
@param beanName Name of the managed bean.
"""
registerObject(bean);
ret... | java | @Override
public Object postProcessAfterInitialization(Object bean, String beanName) throws BeansException {
registerObject(bean);
return bean;
} | [
"@",
"Override",
"public",
"Object",
"postProcessAfterInitialization",
"(",
"Object",
"bean",
",",
"String",
"beanName",
")",
"throws",
"BeansException",
"{",
"registerObject",
"(",
"bean",
")",
";",
"return",
"bean",
";",
"}"
] | Automatically registers any container-managed bean with the framework.
@param bean Object to register.
@param beanName Name of the managed bean. | [
"Automatically",
"registers",
"any",
"container",
"-",
"managed",
"bean",
"with",
"the",
"framework",
"."
] | train | https://github.com/carewebframework/carewebframework-core/blob/fa3252d4f7541dbe151b92c3d4f6f91433cd1673/org.carewebframework.api-parent/org.carewebframework.api.core/src/main/java/org/carewebframework/api/AppFramework.java#L197-L201 |
moparisthebest/beehive | beehive-netui-core/src/main/java/org/apache/beehive/netui/script/common/ImplicitObjectUtil.java | ImplicitObjectUtil.loadOutputFormBean | public static void loadOutputFormBean(ServletRequest request, Object bean) {
"""
Load the output form bean into the request.
@param request the request
@param bean the output form bean
"""
if(bean != null)
request.setAttribute(OUTPUT_FORM_BEAN_OBJECT_KEY, bean);
} | java | public static void loadOutputFormBean(ServletRequest request, Object bean) {
if(bean != null)
request.setAttribute(OUTPUT_FORM_BEAN_OBJECT_KEY, bean);
} | [
"public",
"static",
"void",
"loadOutputFormBean",
"(",
"ServletRequest",
"request",
",",
"Object",
"bean",
")",
"{",
"if",
"(",
"bean",
"!=",
"null",
")",
"request",
".",
"setAttribute",
"(",
"OUTPUT_FORM_BEAN_OBJECT_KEY",
",",
"bean",
")",
";",
"}"
] | Load the output form bean into the request.
@param request the request
@param bean the output form bean | [
"Load",
"the",
"output",
"form",
"bean",
"into",
"the",
"request",
"."
] | train | https://github.com/moparisthebest/beehive/blob/4246a0cc40ce3c05f1a02c2da2653ac622703d77/beehive-netui-core/src/main/java/org/apache/beehive/netui/script/common/ImplicitObjectUtil.java#L165-L168 |
xwiki/xwiki-commons | xwiki-commons-core/xwiki-commons-crypto/xwiki-commons-crypto-store/xwiki-commons-crypto-store-filesystem/src/main/java/org/xwiki/crypto/store/filesystem/internal/AbstractX509FileSystemStore.java | AbstractX509FileSystemStore.writeFooter | private static void writeFooter(BufferedWriter out, String type) throws IOException {
"""
Write a PEM like footer.
@param out the output buffered writer to write to.
@param type the type to be written in the footer.
@throws IOException on error.
"""
out.write(PEM_END + type + DASHES);
out.... | java | private static void writeFooter(BufferedWriter out, String type) throws IOException
{
out.write(PEM_END + type + DASHES);
out.newLine();
} | [
"private",
"static",
"void",
"writeFooter",
"(",
"BufferedWriter",
"out",
",",
"String",
"type",
")",
"throws",
"IOException",
"{",
"out",
".",
"write",
"(",
"PEM_END",
"+",
"type",
"+",
"DASHES",
")",
";",
"out",
".",
"newLine",
"(",
")",
";",
"}"
] | Write a PEM like footer.
@param out the output buffered writer to write to.
@param type the type to be written in the footer.
@throws IOException on error. | [
"Write",
"a",
"PEM",
"like",
"footer",
"."
] | train | https://github.com/xwiki/xwiki-commons/blob/5374d8c6d966588c1eac7392c83da610dfb9f129/xwiki-commons-core/xwiki-commons-crypto/xwiki-commons-crypto-store/xwiki-commons-crypto-store-filesystem/src/main/java/org/xwiki/crypto/store/filesystem/internal/AbstractX509FileSystemStore.java#L130-L134 |
deeplearning4j/deeplearning4j | nd4j/nd4j-backends/nd4j-api-parent/nd4j-api/src/main/java/org/nd4j/linalg/api/shape/Shape.java | Shape.getOffset | public static long getOffset(DataBuffer shapeInformation, int row, int col) {
"""
Get the offset of the specified [row,col] for the 2d array
@param shapeInformation Shape information
@param row Row index to get the offset for
@param col Column index to get the offset for
@r... | java | public static long getOffset(DataBuffer shapeInformation, int row, int col) {
int rank = rank(shapeInformation);
if (rank != 2)
throw new IllegalArgumentException(
"Cannot use this getOffset method on arrays of rank != 2 (rank is: " + rank + ")");
return getOffset... | [
"public",
"static",
"long",
"getOffset",
"(",
"DataBuffer",
"shapeInformation",
",",
"int",
"row",
",",
"int",
"col",
")",
"{",
"int",
"rank",
"=",
"rank",
"(",
"shapeInformation",
")",
";",
"if",
"(",
"rank",
"!=",
"2",
")",
"throw",
"new",
"IllegalArgu... | Get the offset of the specified [row,col] for the 2d array
@param shapeInformation Shape information
@param row Row index to get the offset for
@param col Column index to get the offset for
@return Buffer offset | [
"Get",
"the",
"offset",
"of",
"the",
"specified",
"[",
"row",
"col",
"]",
"for",
"the",
"2d",
"array"
] | train | https://github.com/deeplearning4j/deeplearning4j/blob/effce52f2afd7eeb53c5bcca699fcd90bd06822f/nd4j/nd4j-backends/nd4j-api-parent/nd4j-api/src/main/java/org/nd4j/linalg/api/shape/Shape.java#L991-L997 |
alkacon/opencms-core | src/org/opencms/util/CmsStringUtil.java | CmsStringUtil.countChar | public static int countChar(String s, char c) {
"""
Counts the occurrence of a given char in a given String.<p>
@param s the string
@param c the char to count
@return returns the count of occurrences of a given char in a given String
"""
int counter = 0;
for (int i = 0; i < s.length(); ... | java | public static int countChar(String s, char c) {
int counter = 0;
for (int i = 0; i < s.length(); i++) {
if (s.charAt(i) == c) {
counter++;
}
}
return counter;
} | [
"public",
"static",
"int",
"countChar",
"(",
"String",
"s",
",",
"char",
"c",
")",
"{",
"int",
"counter",
"=",
"0",
";",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
"<",
"s",
".",
"length",
"(",
")",
";",
"i",
"++",
")",
"{",
"if",
"(",
"s"... | Counts the occurrence of a given char in a given String.<p>
@param s the string
@param c the char to count
@return returns the count of occurrences of a given char in a given String | [
"Counts",
"the",
"occurrence",
"of",
"a",
"given",
"char",
"in",
"a",
"given",
"String",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/util/CmsStringUtil.java#L339-L348 |
wmdietl/jsr308-langtools | src/share/classes/com/sun/tools/javac/parser/JavacParser.java | JavacParser.arrayInitializer | JCExpression arrayInitializer(int newpos, JCExpression t) {
"""
ArrayInitializer = "{" [VariableInitializer {"," VariableInitializer}] [","] "}"
"""
accept(LBRACE);
ListBuffer<JCExpression> elems = new ListBuffer<JCExpression>();
if (token.kind == COMMA) {
nextToken();
... | java | JCExpression arrayInitializer(int newpos, JCExpression t) {
accept(LBRACE);
ListBuffer<JCExpression> elems = new ListBuffer<JCExpression>();
if (token.kind == COMMA) {
nextToken();
} else if (token.kind != RBRACE) {
elems.append(variableInitializer());
... | [
"JCExpression",
"arrayInitializer",
"(",
"int",
"newpos",
",",
"JCExpression",
"t",
")",
"{",
"accept",
"(",
"LBRACE",
")",
";",
"ListBuffer",
"<",
"JCExpression",
">",
"elems",
"=",
"new",
"ListBuffer",
"<",
"JCExpression",
">",
"(",
")",
";",
"if",
"(",
... | ArrayInitializer = "{" [VariableInitializer {"," VariableInitializer}] [","] "}" | [
"ArrayInitializer",
"=",
"{",
"[",
"VariableInitializer",
"{",
"VariableInitializer",
"}",
"]",
"[",
"]",
"}"
] | train | https://github.com/wmdietl/jsr308-langtools/blob/8812d28c20f4de070a0dd6de1b45602431379834/src/share/classes/com/sun/tools/javac/parser/JavacParser.java#L2286-L2301 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.