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 |
|---|---|---|---|---|---|---|---|---|---|---|
Viascom/groundwork | foxhttp/src/main/java/ch/viascom/groundwork/foxhttp/header/FoxHttpHeader.java | FoxHttpHeader.addHeader | public void addHeader(Map<String, String> entries) {
"""
Add a new map of header entries
@param entries map of header entries
"""
for (Map.Entry<String, String> entry : entries.entrySet()) {
headerEntries.add(new HeaderEntry(entry.getKey(), entry.getValue()));
}
} | java | public void addHeader(Map<String, String> entries) {
for (Map.Entry<String, String> entry : entries.entrySet()) {
headerEntries.add(new HeaderEntry(entry.getKey(), entry.getValue()));
}
} | [
"public",
"void",
"addHeader",
"(",
"Map",
"<",
"String",
",",
"String",
">",
"entries",
")",
"{",
"for",
"(",
"Map",
".",
"Entry",
"<",
"String",
",",
"String",
">",
"entry",
":",
"entries",
".",
"entrySet",
"(",
")",
")",
"{",
"headerEntries",
".",... | Add a new map of header entries
@param entries map of header entries | [
"Add",
"a",
"new",
"map",
"of",
"header",
"entries"
] | train | https://github.com/Viascom/groundwork/blob/d3f7d0df65e2e75861fc7db938090683f2cdf919/foxhttp/src/main/java/ch/viascom/groundwork/foxhttp/header/FoxHttpHeader.java#L51-L55 |
infinispan/infinispan | core/src/main/java/org/infinispan/interceptors/BaseAsyncInterceptor.java | BaseAsyncInterceptor.valueOrException | public static Object valueOrException(Object rv, Throwable throwable) throws Throwable {
"""
Return the value if {@code throwable != null}, throw the exception otherwise.
"""
if (throwable == null) {
return rv;
} else {
throw throwable;
}
} | java | public static Object valueOrException(Object rv, Throwable throwable) throws Throwable {
if (throwable == null) {
return rv;
} else {
throw throwable;
}
} | [
"public",
"static",
"Object",
"valueOrException",
"(",
"Object",
"rv",
",",
"Throwable",
"throwable",
")",
"throws",
"Throwable",
"{",
"if",
"(",
"throwable",
"==",
"null",
")",
"{",
"return",
"rv",
";",
"}",
"else",
"{",
"throw",
"throwable",
";",
"}",
... | Return the value if {@code throwable != null}, throw the exception otherwise. | [
"Return",
"the",
"value",
"if",
"{"
] | train | https://github.com/infinispan/infinispan/blob/7c62b94886c3febb4774ae8376acf2baa0265ab5/core/src/main/java/org/infinispan/interceptors/BaseAsyncInterceptor.java#L271-L277 |
jenetics/jenetics | jenetics/src/main/java/io/jenetics/engine/EvolutionResult.java | EvolutionResult.compareTo | @Override
public int compareTo(final EvolutionResult<G, C> other) {
"""
Compare {@code this} evolution result with another one, according the
populations best individual.
@param other the other evolution result to compare
@return a negative integer, zero, or a positive integer as this result
is less than, ... | java | @Override
public int compareTo(final EvolutionResult<G, C> other) {
return _optimize.compare(_best.get(), other._best.get());
} | [
"@",
"Override",
"public",
"int",
"compareTo",
"(",
"final",
"EvolutionResult",
"<",
"G",
",",
"C",
">",
"other",
")",
"{",
"return",
"_optimize",
".",
"compare",
"(",
"_best",
".",
"get",
"(",
")",
",",
"other",
".",
"_best",
".",
"get",
"(",
")",
... | Compare {@code this} evolution result with another one, according the
populations best individual.
@param other the other evolution result to compare
@return a negative integer, zero, or a positive integer as this result
is less than, equal to, or greater than the specified result. | [
"Compare",
"{",
"@code",
"this",
"}",
"evolution",
"result",
"with",
"another",
"one",
"according",
"the",
"populations",
"best",
"individual",
"."
] | train | https://github.com/jenetics/jenetics/blob/ee516770c65ef529b27deb283f071c85f344eff4/jenetics/src/main/java/io/jenetics/engine/EvolutionResult.java#L274-L277 |
apache/groovy | src/main/java/org/codehaus/groovy/runtime/DefaultGroovyMethods.java | DefaultGroovyMethods.collectEntries | public static <K, V> Map<K, V> collectEntries(Iterator<?> self) {
"""
A variant of collectEntries for Iterators using the identity closure as the transform.
@param self an Iterator
@return a Map of the transformed entries
@see #collectEntries(Iterable)
@since 1.8.7
"""
return collectEntries(self,... | java | public static <K, V> Map<K, V> collectEntries(Iterator<?> self) {
return collectEntries(self, Closure.IDENTITY);
} | [
"public",
"static",
"<",
"K",
",",
"V",
">",
"Map",
"<",
"K",
",",
"V",
">",
"collectEntries",
"(",
"Iterator",
"<",
"?",
">",
"self",
")",
"{",
"return",
"collectEntries",
"(",
"self",
",",
"Closure",
".",
"IDENTITY",
")",
";",
"}"
] | A variant of collectEntries for Iterators using the identity closure as the transform.
@param self an Iterator
@return a Map of the transformed entries
@see #collectEntries(Iterable)
@since 1.8.7 | [
"A",
"variant",
"of",
"collectEntries",
"for",
"Iterators",
"using",
"the",
"identity",
"closure",
"as",
"the",
"transform",
"."
] | train | https://github.com/apache/groovy/blob/71cf20addb611bb8d097a59e395fd20bc7f31772/src/main/java/org/codehaus/groovy/runtime/DefaultGroovyMethods.java#L4069-L4071 |
elki-project/elki | addons/xtree/src/main/java/de/lmu/ifi/dbs/elki/index/tree/spatial/rstarvariants/xtree/util/XSplitter.java | XSplitter.generateSplitSorting | private SplitSorting generateSplitSorting(int[] entrySorting, int limit) {
"""
Generate the split sorting for a given sorting of entry positions
using the given split position <code>limit</code>.
All entries referenced by <code>entrySorting</code> from <code>0</code> to
<code>limit-1</code> are put into the fir... | java | private SplitSorting generateSplitSorting(int[] entrySorting, int limit) {
List<SpatialEntry> sorting = new ArrayList<>();
for(int i = 0; i < node.getNumEntries(); i++) {
sorting.add(node.getEntry(entrySorting[i]));
}
return new SplitSorting(sorting, limit, splitAxis);
} | [
"private",
"SplitSorting",
"generateSplitSorting",
"(",
"int",
"[",
"]",
"entrySorting",
",",
"int",
"limit",
")",
"{",
"List",
"<",
"SpatialEntry",
">",
"sorting",
"=",
"new",
"ArrayList",
"<>",
"(",
")",
";",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i... | Generate the split sorting for a given sorting of entry positions
using the given split position <code>limit</code>.
All entries referenced by <code>entrySorting</code> from <code>0</code> to
<code>limit-1</code> are put into the first list (<code>ret[0]</code>), the
other entries are put into the second list (<code>re... | [
"Generate",
"the",
"split",
"sorting",
"for",
"a",
"given",
"sorting",
"of",
"entry",
"positions",
"using",
"the",
"given",
"split",
"position",
"<code",
">",
"limit<",
"/",
"code",
">",
".",
"All",
"entries",
"referenced",
"by",
"<code",
">",
"entrySorting<... | train | https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/addons/xtree/src/main/java/de/lmu/ifi/dbs/elki/index/tree/spatial/rstarvariants/xtree/util/XSplitter.java#L606-L612 |
wellner/jcarafe | jcarafe-core/src/main/java/cern/colt/list/ObjectArrayList.java | ObjectArrayList.beforeInsert | public void beforeInsert(int index, Object element) {
"""
Inserts the specified element before the specified position into the receiver.
Shifts the element currently at that position (if any) and
any subsequent elements to the right.
@param index index before which the specified element is to be inserted (mus... | java | public void beforeInsert(int index, Object element) {
// overridden for performance only.
if (index > size || index < 0)
throw new IndexOutOfBoundsException("Index: "+index+", Size: "+size);
ensureCapacity(size + 1);
System.arraycopy(elements, index, elements, index+1, size-index);
elements[index] = eleme... | [
"public",
"void",
"beforeInsert",
"(",
"int",
"index",
",",
"Object",
"element",
")",
"{",
"// overridden for performance only.\r",
"if",
"(",
"index",
">",
"size",
"||",
"index",
"<",
"0",
")",
"throw",
"new",
"IndexOutOfBoundsException",
"(",
"\"Index: \"",
"+... | Inserts the specified element before the specified position into the receiver.
Shifts the element currently at that position (if any) and
any subsequent elements to the right.
@param index index before which the specified element is to be inserted (must be in [0,size]).
@param element element to be inserted.
@exceptio... | [
"Inserts",
"the",
"specified",
"element",
"before",
"the",
"specified",
"position",
"into",
"the",
"receiver",
".",
"Shifts",
"the",
"element",
"currently",
"at",
"that",
"position",
"(",
"if",
"any",
")",
"and",
"any",
"subsequent",
"elements",
"to",
"the",
... | train | https://github.com/wellner/jcarafe/blob/ab8b0a83dbf600fe80c27711815c90bd3055b217/jcarafe-core/src/main/java/cern/colt/list/ObjectArrayList.java#L85-L93 |
jqm4gwt/jqm4gwt | library/src/main/java/com/sksamuel/jqm4gwt/toolbar/JQMHeader.java | JQMHeader.setLeftButton | public JQMButton setLeftButton(String text, JQMPage page) {
"""
Creates a new {@link JQMButton} with the given text and linking to the
given {@link JQMPage} and then sets that button in the left slot. Any
existing right button will be replaced.
@param text
the text for the button
@param page
the optional p... | java | public JQMButton setLeftButton(String text, JQMPage page) {
return setLeftButton(text, page, null);
} | [
"public",
"JQMButton",
"setLeftButton",
"(",
"String",
"text",
",",
"JQMPage",
"page",
")",
"{",
"return",
"setLeftButton",
"(",
"text",
",",
"page",
",",
"null",
")",
";",
"}"
] | Creates a new {@link JQMButton} with the given text and linking to the
given {@link JQMPage} and then sets that button in the left slot. Any
existing right button will be replaced.
@param text
the text for the button
@param page
the optional page for the button to link to, if null then
this button does not navigate by... | [
"Creates",
"a",
"new",
"{",
"@link",
"JQMButton",
"}",
"with",
"the",
"given",
"text",
"and",
"linking",
"to",
"the",
"given",
"{",
"@link",
"JQMPage",
"}",
"and",
"then",
"sets",
"that",
"button",
"in",
"the",
"left",
"slot",
".",
"Any",
"existing",
"... | train | https://github.com/jqm4gwt/jqm4gwt/blob/cf59958e9ba6d4b70f42507b2c77f10c2465085b/library/src/main/java/com/sksamuel/jqm4gwt/toolbar/JQMHeader.java#L184-L186 |
smartsheet-platform/smartsheet-java-sdk | src/main/java/com/smartsheet/api/internal/AbstractResources.java | AbstractResources.createResourceWithAttachment | protected <T> T createResourceWithAttachment(String path, Class<T> objectClass, T object, String partName,InputStream inputStream, String contentType, String attachmentName) throws SmartsheetException {
"""
Create a resource using Smartsheet REST API.
Exceptions:
IllegalArgumentException : if any argument is n... | java | protected <T> T createResourceWithAttachment(String path, Class<T> objectClass, T object, String partName,InputStream inputStream, String contentType, String attachmentName) throws SmartsheetException {
Util.throwIfNull(path, object);
Util.throwIfEmpty(path);
HttpRequest request;
final ... | [
"protected",
"<",
"T",
">",
"T",
"createResourceWithAttachment",
"(",
"String",
"path",
",",
"Class",
"<",
"T",
">",
"objectClass",
",",
"T",
"object",
",",
"String",
"partName",
",",
"InputStream",
"inputStream",
",",
"String",
"contentType",
",",
"String",
... | Create a resource using Smartsheet REST API.
Exceptions:
IllegalArgumentException : if any argument is null, or path is empty string
InvalidRequestException : if there is any problem with the REST API request
AuthorizationException : if there is any problem with the REST API authorization(access token)
ServiceUnavaila... | [
"Create",
"a",
"resource",
"using",
"Smartsheet",
"REST",
"API",
"."
] | train | https://github.com/smartsheet-platform/smartsheet-java-sdk/blob/f60e264412076271f83b65889ef9b891fad83df8/src/main/java/com/smartsheet/api/internal/AbstractResources.java#L337-L372 |
couchbase/couchbase-lite-java-core | src/main/java/com/couchbase/lite/replicator/ReplicationInternal.java | ReplicationInternal.compilePushReplicationFilter | public ReplicationFilter compilePushReplicationFilter() {
"""
Get replicator filter. If the replicator is a pull replicator,
calling this method will return null.
<p/>
This is equivalent to CBL_ReplicatorSettings's compilePushFilterForDatabase:status:.
"""
if (isPull())
return null;
... | java | public ReplicationFilter compilePushReplicationFilter() {
if (isPull())
return null;
if (filterName != null)
return db.getFilter(filterName);
else if (documentIDs != null && documentIDs.size() > 0) {
final List<String> docIDs = documentIDs;
return... | [
"public",
"ReplicationFilter",
"compilePushReplicationFilter",
"(",
")",
"{",
"if",
"(",
"isPull",
"(",
")",
")",
"return",
"null",
";",
"if",
"(",
"filterName",
"!=",
"null",
")",
"return",
"db",
".",
"getFilter",
"(",
"filterName",
")",
";",
"else",
"if"... | Get replicator filter. If the replicator is a pull replicator,
calling this method will return null.
<p/>
This is equivalent to CBL_ReplicatorSettings's compilePushFilterForDatabase:status:. | [
"Get",
"replicator",
"filter",
".",
"If",
"the",
"replicator",
"is",
"a",
"pull",
"replicator",
"calling",
"this",
"method",
"will",
"return",
"null",
".",
"<p",
"/",
">",
"This",
"is",
"equivalent",
"to",
"CBL_ReplicatorSettings",
"s",
"compilePushFilterForData... | train | https://github.com/couchbase/couchbase-lite-java-core/blob/3b275642e2d2f231fd155ad9def9c5e9eff3118e/src/main/java/com/couchbase/lite/replicator/ReplicationInternal.java#L1119-L1135 |
galan/commons | src/main/java/de/galan/commons/util/MessageBox.java | MessageBox.printBox | public static void printBox(String title, List<String> messageLines) {
"""
Prints a box with the given title and message lines to the logger, the title can be omitted.
"""
Say.info("{message}", generateBox(title, messageLines));
} | java | public static void printBox(String title, List<String> messageLines) {
Say.info("{message}", generateBox(title, messageLines));
} | [
"public",
"static",
"void",
"printBox",
"(",
"String",
"title",
",",
"List",
"<",
"String",
">",
"messageLines",
")",
"{",
"Say",
".",
"info",
"(",
"\"{message}\"",
",",
"generateBox",
"(",
"title",
",",
"messageLines",
")",
")",
";",
"}"
] | Prints a box with the given title and message lines to the logger, the title can be omitted. | [
"Prints",
"a",
"box",
"with",
"the",
"given",
"title",
"and",
"message",
"lines",
"to",
"the",
"logger",
"the",
"title",
"can",
"be",
"omitted",
"."
] | train | https://github.com/galan/commons/blob/45d2f36c69958d3f847e5fed66603ea629471822/src/main/java/de/galan/commons/util/MessageBox.java#L32-L34 |
sarl/sarl | main/externalmaven/io.sarl.maven.docs.generator/src/main/java/io/sarl/maven/docs/parser/SarlDocumentationParser.java | SarlDocumentationParser.extractValidationComponents | public void extractValidationComponents(CharSequence content, File inputFile,
Procedure1<Map<Tag, List<MutableTriple<File, Integer, String>>>> observer) {
"""
Read the given input content and extract validation components.
@param content the content to parse.
@param inputFile the name of the input file for... | java | public void extractValidationComponents(CharSequence content, File inputFile,
Procedure1<Map<Tag, List<MutableTriple<File, Integer, String>>>> observer) {
//
// STEP 1: Extract the raw text
//
final Map<Tag, List<MutableTriple<File, Integer, String>>> components = new TreeMap<>();
final ContentParser... | [
"public",
"void",
"extractValidationComponents",
"(",
"CharSequence",
"content",
",",
"File",
"inputFile",
",",
"Procedure1",
"<",
"Map",
"<",
"Tag",
",",
"List",
"<",
"MutableTriple",
"<",
"File",
",",
"Integer",
",",
"String",
">",
">",
">",
">",
"observer... | Read the given input content and extract validation components.
@param content the content to parse.
@param inputFile the name of the input file for locating included features and formatting error messages.
@param observer the oberserver to be called with extracted information. The parameter of the lambda maps
the tag... | [
"Read",
"the",
"given",
"input",
"content",
"and",
"extract",
"validation",
"components",
"."
] | train | https://github.com/sarl/sarl/blob/ca00ff994598c730339972def4e19a60e0b8cace/main/externalmaven/io.sarl.maven.docs.generator/src/main/java/io/sarl/maven/docs/parser/SarlDocumentationParser.java#L772-L815 |
livetribe/livetribe-slp | core/src/main/java/org/livetribe/slp/Attributes.java | Attributes.unescapeValue | public static String unescapeValue(String escapedValue) {
"""
Unescapes the given escaped value string following RFC 2608, 5.0.
<br />
For example, the string value <code>\3cA\3e</code> will be converted into the string
<code><A></code>.
@param escapedValue the value string to unescape
@return the une... | java | public static String unescapeValue(String escapedValue)
{
// Check that the escaped value does not contain reserved characters
checkEscaped(escapedValue, Value.reservedChars, false);
// Unescape the value
return unescape(escapedValue, Value.reservedChars);
} | [
"public",
"static",
"String",
"unescapeValue",
"(",
"String",
"escapedValue",
")",
"{",
"// Check that the escaped value does not contain reserved characters",
"checkEscaped",
"(",
"escapedValue",
",",
"Value",
".",
"reservedChars",
",",
"false",
")",
";",
"// Unescape the ... | Unescapes the given escaped value string following RFC 2608, 5.0.
<br />
For example, the string value <code>\3cA\3e</code> will be converted into the string
<code><A></code>.
@param escapedValue the value string to unescape
@return the unescaped value string
@see #escapeValue(String) | [
"Unescapes",
"the",
"given",
"escaped",
"value",
"string",
"following",
"RFC",
"2608",
"5",
".",
"0",
".",
"<br",
"/",
">",
"For",
"example",
"the",
"string",
"value",
"<code",
">",
"\\",
"3cA",
"\\",
"3e<",
"/",
"code",
">",
"will",
"be",
"converted",... | train | https://github.com/livetribe/livetribe-slp/blob/6cc13dbe81feab133fe3dd291ca081cbc6e1f591/core/src/main/java/org/livetribe/slp/Attributes.java#L385-L391 |
landawn/AbacusUtil | src/com/landawn/abacus/util/LongList.java | LongList.reduce | public <E extends Exception> long reduce(final long identity, final Try.LongBinaryOperator<E> accumulator) throws E {
"""
This is equivalent to:
<pre>
<code>
if (isEmpty()) {
return identity;
}
long result = identity;
for (int i = 0; i < size; i++) {
result = accumulator.applyAsLong(result, elementData... | java | public <E extends Exception> long reduce(final long identity, final Try.LongBinaryOperator<E> accumulator) throws E {
if (isEmpty()) {
return identity;
}
long result = identity;
for (int i = 0; i < size; i++) {
result = accumulator.applyAsLong(result, el... | [
"public",
"<",
"E",
"extends",
"Exception",
">",
"long",
"reduce",
"(",
"final",
"long",
"identity",
",",
"final",
"Try",
".",
"LongBinaryOperator",
"<",
"E",
">",
"accumulator",
")",
"throws",
"E",
"{",
"if",
"(",
"isEmpty",
"(",
")",
")",
"{",
"retur... | This is equivalent to:
<pre>
<code>
if (isEmpty()) {
return identity;
}
long result = identity;
for (int i = 0; i < size; i++) {
result = accumulator.applyAsLong(result, elementData[i]);
}
return result;
</code>
</pre>
@param identity
@param accumulator
@return | [
"This",
"is",
"equivalent",
"to",
":",
"<pre",
">",
"<code",
">",
"if",
"(",
"isEmpty",
"()",
")",
"{",
"return",
"identity",
";",
"}"
] | train | https://github.com/landawn/AbacusUtil/blob/544b7720175d15e9329f83dd22a8cc5fa4515e12/src/com/landawn/abacus/util/LongList.java#L1120-L1132 |
habernal/confusion-matrix | src/main/java/com/github/habernal/confusionmatrix/ConfusionMatrix.java | ConfusionMatrix.increaseValue | public void increaseValue(String goldValue, String observedValue, int times) {
"""
Increases value of goldValue x observedValue n times
@param goldValue exp
@param observedValue ac
@param times n-times
"""
allGoldLabels.add(goldValue);
allPredictedLabels.add(observedValue);
... | java | public void increaseValue(String goldValue, String observedValue, int times)
{
allGoldLabels.add(goldValue);
allPredictedLabels.add(observedValue);
for (int i = 0; i < times; i++) {
labelSeries.add(observedValue);
}
if (!map.containsKey(goldValue)) {
... | [
"public",
"void",
"increaseValue",
"(",
"String",
"goldValue",
",",
"String",
"observedValue",
",",
"int",
"times",
")",
"{",
"allGoldLabels",
".",
"add",
"(",
"goldValue",
")",
";",
"allPredictedLabels",
".",
"add",
"(",
"observedValue",
")",
";",
"for",
"(... | Increases value of goldValue x observedValue n times
@param goldValue exp
@param observedValue ac
@param times n-times | [
"Increases",
"value",
"of",
"goldValue",
"x",
"observedValue",
"n",
"times"
] | train | https://github.com/habernal/confusion-matrix/blob/d0310f0aeda0fa74a9d42bcb190db7250bf49ecc/src/main/java/com/github/habernal/confusionmatrix/ConfusionMatrix.java#L98-L123 |
bitcoinj/bitcoinj | core/src/main/java/org/bitcoinj/protocols/channels/StoredPaymentChannelClientStates.java | StoredPaymentChannelClientStates.putChannel | private void putChannel(final StoredClientChannel channel, boolean updateWallet) {
"""
Adds this channel and optionally notifies the wallet of an update to this extension (used during deserialize)
"""
lock.lock();
try {
mapChannels.put(channel.id, channel);
channelTimeou... | java | private void putChannel(final StoredClientChannel channel, boolean updateWallet) {
lock.lock();
try {
mapChannels.put(channel.id, channel);
channelTimeoutHandler.schedule(new TimerTask() {
@Override
public void run() {
try {
... | [
"private",
"void",
"putChannel",
"(",
"final",
"StoredClientChannel",
"channel",
",",
"boolean",
"updateWallet",
")",
"{",
"lock",
".",
"lock",
"(",
")",
";",
"try",
"{",
"mapChannels",
".",
"put",
"(",
"channel",
".",
"id",
",",
"channel",
")",
";",
"ch... | Adds this channel and optionally notifies the wallet of an update to this extension (used during deserialize) | [
"Adds",
"this",
"channel",
"and",
"optionally",
"notifies",
"the",
"wallet",
"of",
"an",
"update",
"to",
"this",
"extension",
"(",
"used",
"during",
"deserialize",
")"
] | train | https://github.com/bitcoinj/bitcoinj/blob/9cf13d29315014ed59cf4fc5944e5f227e8df9a6/core/src/main/java/org/bitcoinj/protocols/channels/StoredPaymentChannelClientStates.java#L214-L239 |
couchbase/couchbase-lite-java-core | src/main/java/com/couchbase/lite/support/action/Action.java | Action.moveAndReplaceFile | public static Action moveAndReplaceFile(String srcPath, String destPath, String tempDir) {
"""
Moves the file/directory to a new location, replacing anything that already exists there.
@param srcPath Source path
@param destPath Destination path to be replaced
@param tempDir Path to a temp directory used for bac... | java | public static Action moveAndReplaceFile(String srcPath, String destPath, String tempDir) {
Action seq = new Action();
seq.add(deleteFile(destPath, tempDir));
seq.add(moveFileToEmptyPath(srcPath, destPath));
return seq;
} | [
"public",
"static",
"Action",
"moveAndReplaceFile",
"(",
"String",
"srcPath",
",",
"String",
"destPath",
",",
"String",
"tempDir",
")",
"{",
"Action",
"seq",
"=",
"new",
"Action",
"(",
")",
";",
"seq",
".",
"add",
"(",
"deleteFile",
"(",
"destPath",
",",
... | Moves the file/directory to a new location, replacing anything that already exists there.
@param srcPath Source path
@param destPath Destination path to be replaced
@param tempDir Path to a temp directory used for backing out file deletion
@return A moveAndReplaceFile action | [
"Moves",
"the",
"file",
"/",
"directory",
"to",
"a",
"new",
"location",
"replacing",
"anything",
"that",
"already",
"exists",
"there",
"."
] | train | https://github.com/couchbase/couchbase-lite-java-core/blob/3b275642e2d2f231fd155ad9def9c5e9eff3118e/src/main/java/com/couchbase/lite/support/action/Action.java#L336-L341 |
blinkfox/zealot | src/main/java/com/blinkfox/zealot/core/ZealotKhala.java | ZealotKhala.orIn | public ZealotKhala orIn(String field, Object[] values) {
"""
生成带" OR "前缀的in范围查询的SQL片段.
@param field 数据库字段
@param values 数组的值
@return ZealotKhala实例
"""
return this.doIn(ZealotConst.OR_PREFIX, field, values, true, true);
} | java | public ZealotKhala orIn(String field, Object[] values) {
return this.doIn(ZealotConst.OR_PREFIX, field, values, true, true);
} | [
"public",
"ZealotKhala",
"orIn",
"(",
"String",
"field",
",",
"Object",
"[",
"]",
"values",
")",
"{",
"return",
"this",
".",
"doIn",
"(",
"ZealotConst",
".",
"OR_PREFIX",
",",
"field",
",",
"values",
",",
"true",
",",
"true",
")",
";",
"}"
] | 生成带" OR "前缀的in范围查询的SQL片段.
@param field 数据库字段
@param values 数组的值
@return ZealotKhala实例 | [
"生成带",
"OR",
"前缀的in范围查询的SQL片段",
"."
] | train | https://github.com/blinkfox/zealot/blob/21b00fa3e4ed42188eef3116d494e112e7a4194c/src/main/java/com/blinkfox/zealot/core/ZealotKhala.java#L1347-L1349 |
j-a-w-r/jawr-main-repo | jawr/jawr-core/src/main/java/net/jawr/web/servlet/JawrBinaryResourceRequestHandler.java | JawrBinaryResourceRequestHandler.addBinaryResourcePath | private void addBinaryResourcePath(BinaryResourcesHandler binRsHandler, String resourcePath) {
"""
Add an binary resource path to the binary map
@param binRsHandler
the image resources handler
@param resourcePath
the image path
"""
try {
String resultPath = CheckSumUtils.getCacheBustedUrl(resourceP... | java | private void addBinaryResourcePath(BinaryResourcesHandler binRsHandler, String resourcePath) {
try {
String resultPath = CheckSumUtils.getCacheBustedUrl(resourcePath, rsReaderHandler, jawrConfig);
binRsHandler.addMapping(resourcePath, resultPath);
bundleMapping.put(resourcePath, resultPath);
} catch (IOEx... | [
"private",
"void",
"addBinaryResourcePath",
"(",
"BinaryResourcesHandler",
"binRsHandler",
",",
"String",
"resourcePath",
")",
"{",
"try",
"{",
"String",
"resultPath",
"=",
"CheckSumUtils",
".",
"getCacheBustedUrl",
"(",
"resourcePath",
",",
"rsReaderHandler",
",",
"j... | Add an binary resource path to the binary map
@param binRsHandler
the image resources handler
@param resourcePath
the image path | [
"Add",
"an",
"binary",
"resource",
"path",
"to",
"the",
"binary",
"map"
] | train | https://github.com/j-a-w-r/jawr-main-repo/blob/5381f6acf461cd2502593c67a77bd6ef9eab848d/jawr/jawr-core/src/main/java/net/jawr/web/servlet/JawrBinaryResourceRequestHandler.java#L286-L298 |
alkacon/opencms-core | src/org/opencms/ui/CmsVaadinUtils.java | CmsVaadinUtils.getProjectsContainer | public static IndexedContainer getProjectsContainer(CmsObject cms, String captionPropertyName) {
"""
Returns the selectable projects container.<p>
@param cms the CMS context
@param captionPropertyName the name of the property used to store captions
@return the projects container
"""
IndexedCont... | java | public static IndexedContainer getProjectsContainer(CmsObject cms, String captionPropertyName) {
IndexedContainer result = new IndexedContainer();
result.addContainerProperty(captionPropertyName, String.class, null);
Locale locale = A_CmsUI.get().getLocale();
List<CmsProject> projects =... | [
"public",
"static",
"IndexedContainer",
"getProjectsContainer",
"(",
"CmsObject",
"cms",
",",
"String",
"captionPropertyName",
")",
"{",
"IndexedContainer",
"result",
"=",
"new",
"IndexedContainer",
"(",
")",
";",
"result",
".",
"addContainerProperty",
"(",
"captionPr... | Returns the selectable projects container.<p>
@param cms the CMS context
@param captionPropertyName the name of the property used to store captions
@return the projects container | [
"Returns",
"the",
"selectable",
"projects",
"container",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/ui/CmsVaadinUtils.java#L784-L808 |
codeprimate-software/cp-elements | src/main/java/org/cp/elements/util/CollectionUtils.java | CollectionUtils.containsAny | @NullSafe
public static boolean containsAny(Collection<?> collection, Object... elements) {
"""
Null-safe method to determine if any of the elements in the array are contained in the given {@link Collection}.
@param collection {@link Collection} to evaluate for containment of the array elements.
@param eleme... | java | @NullSafe
public static boolean containsAny(Collection<?> collection, Object... elements) {
for (Object element : nullSafeArray(elements)) {
if (nullSafeCollection(collection).contains(element)) {
return true;
}
}
return false;
} | [
"@",
"NullSafe",
"public",
"static",
"boolean",
"containsAny",
"(",
"Collection",
"<",
"?",
">",
"collection",
",",
"Object",
"...",
"elements",
")",
"{",
"for",
"(",
"Object",
"element",
":",
"nullSafeArray",
"(",
"elements",
")",
")",
"{",
"if",
"(",
"... | Null-safe method to determine if any of the elements in the array are contained in the given {@link Collection}.
@param collection {@link Collection} to evaluate for containment of the array elements.
@param elements array of elements to evaluate for containment in the {@link Collection}.
@return a boolean value indic... | [
"Null",
"-",
"safe",
"method",
"to",
"determine",
"if",
"any",
"of",
"the",
"elements",
"in",
"the",
"array",
"are",
"contained",
"in",
"the",
"given",
"{",
"@link",
"Collection",
"}",
"."
] | train | https://github.com/codeprimate-software/cp-elements/blob/f2163c149fbbef05015e688132064ebcac7c49ab/src/main/java/org/cp/elements/util/CollectionUtils.java#L253-L263 |
b3dgs/lionengine | lionengine-game/src/main/java/com/b3dgs/lionengine/game/feature/tile/TileGroupsConfig.java | TileGroupsConfig.importGroup | private static TileGroup importGroup(Xml nodeGroup) {
"""
Import the group from its node.
@param nodeGroup The group node (must not be <code>null</code>).
@return The imported group.
"""
final Collection<Xml> children = nodeGroup.getChildren(TileConfig.NODE_TILE);
final Collection<TileRef... | java | private static TileGroup importGroup(Xml nodeGroup)
{
final Collection<Xml> children = nodeGroup.getChildren(TileConfig.NODE_TILE);
final Collection<TileRef> tiles = new ArrayList<>(children.size());
for (final Xml nodeTileRef : children)
{
final TileRef tileRef =... | [
"private",
"static",
"TileGroup",
"importGroup",
"(",
"Xml",
"nodeGroup",
")",
"{",
"final",
"Collection",
"<",
"Xml",
">",
"children",
"=",
"nodeGroup",
".",
"getChildren",
"(",
"TileConfig",
".",
"NODE_TILE",
")",
";",
"final",
"Collection",
"<",
"TileRef",
... | Import the group from its node.
@param nodeGroup The group node (must not be <code>null</code>).
@return The imported group. | [
"Import",
"the",
"group",
"from",
"its",
"node",
"."
] | train | https://github.com/b3dgs/lionengine/blob/cac3d5578532cf11724a737b9f09e71bf9995ab2/lionengine-game/src/main/java/com/b3dgs/lionengine/game/feature/tile/TileGroupsConfig.java#L106-L121 |
orbisgis/h2gis | h2gis-functions/src/main/java/org/h2gis/functions/spatial/edit/ST_RemoveRepeatedPoints.java | ST_RemoveRepeatedPoints.removeDuplicateCoordinates | public static LinearRing removeDuplicateCoordinates(LinearRing linearRing, double tolerance) {
"""
Removes duplicated coordinates within a linearRing.
@param linearRing
@param tolerance to delete the coordinates
@return
"""
Coordinate[] coords = CoordinateUtils.removeRepeatedCoordinates(linearRing... | java | public static LinearRing removeDuplicateCoordinates(LinearRing linearRing, double tolerance) {
Coordinate[] coords = CoordinateUtils.removeRepeatedCoordinates(linearRing.getCoordinates(), tolerance, true);
return FACTORY.createLinearRing(coords);
} | [
"public",
"static",
"LinearRing",
"removeDuplicateCoordinates",
"(",
"LinearRing",
"linearRing",
",",
"double",
"tolerance",
")",
"{",
"Coordinate",
"[",
"]",
"coords",
"=",
"CoordinateUtils",
".",
"removeRepeatedCoordinates",
"(",
"linearRing",
".",
"getCoordinates",
... | Removes duplicated coordinates within a linearRing.
@param linearRing
@param tolerance to delete the coordinates
@return | [
"Removes",
"duplicated",
"coordinates",
"within",
"a",
"linearRing",
"."
] | train | https://github.com/orbisgis/h2gis/blob/9cd70b447e6469cecbc2fc64b16774b59491df3b/h2gis-functions/src/main/java/org/h2gis/functions/spatial/edit/ST_RemoveRepeatedPoints.java#L128-L131 |
line/armeria | core/src/main/java/com/linecorp/armeria/internal/annotation/AnnotatedHttpServiceFactory.java | AnnotatedHttpServiceFactory.findPattern | private static String findPattern(Method method, Set<Annotation> methodAnnotations) {
"""
Returns a specified path pattern. The path pattern might be specified by {@link Path} or
HTTP method annotations such as {@link Get} and {@link Post}.
"""
String pattern = findFirst(method, Path.class).map(Path::... | java | private static String findPattern(Method method, Set<Annotation> methodAnnotations) {
String pattern = findFirst(method, Path.class).map(Path::value)
.orElse(null);
for (Annotation a : methodAnnotations) {
final String p = (String) invoke... | [
"private",
"static",
"String",
"findPattern",
"(",
"Method",
"method",
",",
"Set",
"<",
"Annotation",
">",
"methodAnnotations",
")",
"{",
"String",
"pattern",
"=",
"findFirst",
"(",
"method",
",",
"Path",
".",
"class",
")",
".",
"map",
"(",
"Path",
"::",
... | Returns a specified path pattern. The path pattern might be specified by {@link Path} or
HTTP method annotations such as {@link Get} and {@link Post}. | [
"Returns",
"a",
"specified",
"path",
"pattern",
".",
"The",
"path",
"pattern",
"might",
"be",
"specified",
"by",
"{"
] | train | https://github.com/line/armeria/blob/67d29e019fd35a35f89c45cc8f9119ff9b12b44d/core/src/main/java/com/linecorp/armeria/internal/annotation/AnnotatedHttpServiceFactory.java#L559-L576 |
jMotif/SAX | src/main/java/net/seninp/jmotif/sax/TSProcessor.java | TSProcessor.seriesToString | public String seriesToString(double[] series, NumberFormat df) {
"""
Prettyfies the timeseries for screen output.
@param series the data.
@param df the number format to use.
@return The timeseries formatted for screen output.
"""
StringBuffer sb = new StringBuffer();
sb.append('[');
for (... | java | public String seriesToString(double[] series, NumberFormat df) {
StringBuffer sb = new StringBuffer();
sb.append('[');
for (double d : series) {
sb.append(df.format(d)).append(',');
}
sb.delete(sb.length() - 2, sb.length() - 1).append("]");
return sb.toString();
} | [
"public",
"String",
"seriesToString",
"(",
"double",
"[",
"]",
"series",
",",
"NumberFormat",
"df",
")",
"{",
"StringBuffer",
"sb",
"=",
"new",
"StringBuffer",
"(",
")",
";",
"sb",
".",
"append",
"(",
"'",
"'",
")",
";",
"for",
"(",
"double",
"d",
":... | Prettyfies the timeseries for screen output.
@param series the data.
@param df the number format to use.
@return The timeseries formatted for screen output. | [
"Prettyfies",
"the",
"timeseries",
"for",
"screen",
"output",
"."
] | train | https://github.com/jMotif/SAX/blob/39ee07a69facaa330def5130b8790aeda85f1061/src/main/java/net/seninp/jmotif/sax/TSProcessor.java#L461-L469 |
alkacon/opencms-core | src-gwt/org/opencms/gwt/client/ui/CmsNotification.java | CmsNotification.sendAlert | public void sendAlert(Type type, String message) {
"""
Sends a new blocking alert notification that can be closed by the user.<p>
@param type the notification type
@param message the message
"""
CmsNotificationMessage notificationMessage = new CmsNotificationMessage(Mode.BROADCAST, type, message);... | java | public void sendAlert(Type type, String message) {
CmsNotificationMessage notificationMessage = new CmsNotificationMessage(Mode.BROADCAST, type, message);
m_messages.add(notificationMessage);
if (hasWidget()) {
m_widget.addMessage(notificationMessage);
}
} | [
"public",
"void",
"sendAlert",
"(",
"Type",
"type",
",",
"String",
"message",
")",
"{",
"CmsNotificationMessage",
"notificationMessage",
"=",
"new",
"CmsNotificationMessage",
"(",
"Mode",
".",
"BROADCAST",
",",
"type",
",",
"message",
")",
";",
"m_messages",
"."... | Sends a new blocking alert notification that can be closed by the user.<p>
@param type the notification type
@param message the message | [
"Sends",
"a",
"new",
"blocking",
"alert",
"notification",
"that",
"can",
"be",
"closed",
"by",
"the",
"user",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src-gwt/org/opencms/gwt/client/ui/CmsNotification.java#L174-L181 |
jbundle/jbundle | thin/base/remote/src/main/java/org/jbundle/thin/base/remote/proxy/TableProxy.java | TableProxy.set | public void set(Object data, int iOpenMode) throws DBException, RemoteException {
"""
Update the current record.
@param The data to update.
@exception Exception File exception.
"""
BaseTransport transport = this.createProxyTransport(SET);
transport.addParam(DATA, data);
transport.addP... | java | public void set(Object data, int iOpenMode) throws DBException, RemoteException
{
BaseTransport transport = this.createProxyTransport(SET);
transport.addParam(DATA, data);
transport.addParam(OPEN_MODE, iOpenMode);
Object strReturn = transport.sendMessageAndGetReply();
Object ... | [
"public",
"void",
"set",
"(",
"Object",
"data",
",",
"int",
"iOpenMode",
")",
"throws",
"DBException",
",",
"RemoteException",
"{",
"BaseTransport",
"transport",
"=",
"this",
".",
"createProxyTransport",
"(",
"SET",
")",
";",
"transport",
".",
"addParam",
"(",... | Update the current record.
@param The data to update.
@exception Exception File exception. | [
"Update",
"the",
"current",
"record",
"."
] | train | https://github.com/jbundle/jbundle/blob/4037fcfa85f60c7d0096c453c1a3cd573c2b0abc/thin/base/remote/src/main/java/org/jbundle/thin/base/remote/proxy/TableProxy.java#L122-L130 |
aws/aws-sdk-java | aws-java-sdk-sagemaker/src/main/java/com/amazonaws/services/sagemaker/model/ContainerDefinition.java | ContainerDefinition.withEnvironment | public ContainerDefinition withEnvironment(java.util.Map<String, String> environment) {
"""
<p>
The environment variables to set in the Docker container. Each key and value in the <code>Environment</code>
string to string map can have length of up to 1024. We support up to 16 entries in the map.
</p>
@param ... | java | public ContainerDefinition withEnvironment(java.util.Map<String, String> environment) {
setEnvironment(environment);
return this;
} | [
"public",
"ContainerDefinition",
"withEnvironment",
"(",
"java",
".",
"util",
".",
"Map",
"<",
"String",
",",
"String",
">",
"environment",
")",
"{",
"setEnvironment",
"(",
"environment",
")",
";",
"return",
"this",
";",
"}"
] | <p>
The environment variables to set in the Docker container. Each key and value in the <code>Environment</code>
string to string map can have length of up to 1024. We support up to 16 entries in the map.
</p>
@param environment
The environment variables to set in the Docker container. Each key and value in the
<code>... | [
"<p",
">",
"The",
"environment",
"variables",
"to",
"set",
"in",
"the",
"Docker",
"container",
".",
"Each",
"key",
"and",
"value",
"in",
"the",
"<code",
">",
"Environment<",
"/",
"code",
">",
"string",
"to",
"string",
"map",
"can",
"have",
"length",
"of"... | train | https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-sagemaker/src/main/java/com/amazonaws/services/sagemaker/model/ContainerDefinition.java#L323-L326 |
eiichiro/gig | gig-appengine/src/main/java/org/eiichiro/gig/appengine/RatingConverter.java | RatingConverter.convertToType | @SuppressWarnings("rawtypes")
@Override
protected Object convertToType(Class type, Object value) throws Throwable {
"""
Converts the specified value to
{@code com.google.appengine.api.datastore.Rating}.
@see org.apache.commons.beanutils.converters.AbstractConverter#convertToType(java.lang.Class, java.lang.Ob... | java | @SuppressWarnings("rawtypes")
@Override
protected Object convertToType(Class type, Object value) throws Throwable {
try {
return new Rating(Integer.parseInt(value.toString()));
} catch (Exception e) {
throw new ConversionException(
"Cannot parse Rating value into integer [" + value + "]");
}
} | [
"@",
"SuppressWarnings",
"(",
"\"rawtypes\"",
")",
"@",
"Override",
"protected",
"Object",
"convertToType",
"(",
"Class",
"type",
",",
"Object",
"value",
")",
"throws",
"Throwable",
"{",
"try",
"{",
"return",
"new",
"Rating",
"(",
"Integer",
".",
"parseInt",
... | Converts the specified value to
{@code com.google.appengine.api.datastore.Rating}.
@see org.apache.commons.beanutils.converters.AbstractConverter#convertToType(java.lang.Class, java.lang.Object) | [
"Converts",
"the",
"specified",
"value",
"to",
"{",
"@code",
"com",
".",
"google",
".",
"appengine",
".",
"api",
".",
"datastore",
".",
"Rating",
"}",
"."
] | train | https://github.com/eiichiro/gig/blob/21181fb36a17d2154f989e5e8c6edbb39fc81900/gig-appengine/src/main/java/org/eiichiro/gig/appengine/RatingConverter.java#L39-L48 |
UrielCh/ovh-java-sdk | ovh-java-sdk-telephony/src/main/java/net/minidev/ovh/api/ApiOvhTelephony.java | ApiOvhTelephony.billingAccount_line_serviceName_phone_resetConfig_POST | public OvhResetPhoneInfo billingAccount_line_serviceName_phone_resetConfig_POST(String billingAccount, String serviceName, String ip) throws IOException {
"""
Reinitialize the phone configuration
REST: POST /telephony/{billingAccount}/line/{serviceName}/phone/resetConfig
@param ip [required] The public ip phon... | java | public OvhResetPhoneInfo billingAccount_line_serviceName_phone_resetConfig_POST(String billingAccount, String serviceName, String ip) throws IOException {
String qPath = "/telephony/{billingAccount}/line/{serviceName}/phone/resetConfig";
StringBuilder sb = path(qPath, billingAccount, serviceName);
HashMap<String,... | [
"public",
"OvhResetPhoneInfo",
"billingAccount_line_serviceName_phone_resetConfig_POST",
"(",
"String",
"billingAccount",
",",
"String",
"serviceName",
",",
"String",
"ip",
")",
"throws",
"IOException",
"{",
"String",
"qPath",
"=",
"\"/telephony/{billingAccount}/line/{serviceNa... | Reinitialize the phone configuration
REST: POST /telephony/{billingAccount}/line/{serviceName}/phone/resetConfig
@param ip [required] The public ip phone allowed for reset
@param billingAccount [required] The name of your billingAccount
@param serviceName [required] | [
"Reinitialize",
"the",
"phone",
"configuration"
] | train | https://github.com/UrielCh/ovh-java-sdk/blob/6d531a40e56e09701943e334c25f90f640c55701/ovh-java-sdk-telephony/src/main/java/net/minidev/ovh/api/ApiOvhTelephony.java#L1427-L1434 |
vlingo/vlingo-actors | src/main/java/io/vlingo/actors/Stage.java | Stage.actorFor | <T> T actorFor(final Class<T> protocol, final Definition definition, final Actor parent, final Supervisor maybeSupervisor, final Logger logger) {
"""
Answers the T protocol for the newly created Actor instance. (INTERNAL ONLY)
@param <T> the protocol type
@param protocol the {@code Class<T>} protocol of the Acto... | java | <T> T actorFor(final Class<T> protocol, final Definition definition, final Actor parent, final Supervisor maybeSupervisor, final Logger logger) {
ActorProtocolActor<T> actor = actorProtocolFor(protocol, definition, parent, null, null, maybeSupervisor, logger);
return actor.protocolActor();
} | [
"<",
"T",
">",
"T",
"actorFor",
"(",
"final",
"Class",
"<",
"T",
">",
"protocol",
",",
"final",
"Definition",
"definition",
",",
"final",
"Actor",
"parent",
",",
"final",
"Supervisor",
"maybeSupervisor",
",",
"final",
"Logger",
"logger",
")",
"{",
"ActorPr... | Answers the T protocol for the newly created Actor instance. (INTERNAL ONLY)
@param <T> the protocol type
@param protocol the {@code Class<T>} protocol of the Actor
@param definition the Definition of the Actor
@param parent the Actor parent of this Actor
@param maybeSupervisor the possible Supervisor of this Actor
@pa... | [
"Answers",
"the",
"T",
"protocol",
"for",
"the",
"newly",
"created",
"Actor",
"instance",
".",
"(",
"INTERNAL",
"ONLY",
")"
] | train | https://github.com/vlingo/vlingo-actors/blob/c7d046fd139c0490cf0fd2588d7dc2f792f13493/src/main/java/io/vlingo/actors/Stage.java#L386-L389 |
census-instrumentation/opencensus-java | api/src/main/java/io/opencensus/tags/TagContextBuilder.java | TagContextBuilder.putLocal | public final TagContextBuilder putLocal(TagKey key, TagValue value) {
"""
Adds a non-propagating tag to this {@code TagContextBuilder}.
<p>This is equivalent to calling {@code put(key, value,
TagMetadata.create(TagTtl.NO_PROPAGATION))}.
@param key the {@code TagKey} which will be set.
@param value the {@co... | java | public final TagContextBuilder putLocal(TagKey key, TagValue value) {
return put(key, value, METADATA_NO_PROPAGATION);
} | [
"public",
"final",
"TagContextBuilder",
"putLocal",
"(",
"TagKey",
"key",
",",
"TagValue",
"value",
")",
"{",
"return",
"put",
"(",
"key",
",",
"value",
",",
"METADATA_NO_PROPAGATION",
")",
";",
"}"
] | Adds a non-propagating tag to this {@code TagContextBuilder}.
<p>This is equivalent to calling {@code put(key, value,
TagMetadata.create(TagTtl.NO_PROPAGATION))}.
@param key the {@code TagKey} which will be set.
@param value the {@code TagValue} to set for the given key.
@return this
@since 0.21 | [
"Adds",
"a",
"non",
"-",
"propagating",
"tag",
"to",
"this",
"{",
"@code",
"TagContextBuilder",
"}",
"."
] | train | https://github.com/census-instrumentation/opencensus-java/blob/deefac9bed77e40a2297bff1ca5ec5aa48a5f755/api/src/main/java/io/opencensus/tags/TagContextBuilder.java#L78-L80 |
nguillaumin/slick2d-maven | slick2d-core/src/main/java/org/newdawn/slick/font/effects/EffectUtil.java | EffectUtil.booleanValue | static public Value booleanValue (String name, final boolean currentValue, final String description) {
"""
Prompts the user for boolean value
@param name The name of the dialog to show
@param currentValue The current value to be displayed
@param description The help text to provide
@return The value selected... | java | static public Value booleanValue (String name, final boolean currentValue, final String description) {
return new DefaultValue(name, String.valueOf(currentValue)) {
public void showDialog () {
JCheckBox checkBox = new JCheckBox();
checkBox.setSelected(currentValue);
if (showValueDialog(checkBox, d... | [
"static",
"public",
"Value",
"booleanValue",
"(",
"String",
"name",
",",
"final",
"boolean",
"currentValue",
",",
"final",
"String",
"description",
")",
"{",
"return",
"new",
"DefaultValue",
"(",
"name",
",",
"String",
".",
"valueOf",
"(",
"currentValue",
")",... | Prompts the user for boolean value
@param name The name of the dialog to show
@param currentValue The current value to be displayed
@param description The help text to provide
@return The value selected by the user | [
"Prompts",
"the",
"user",
"for",
"boolean",
"value"
] | train | https://github.com/nguillaumin/slick2d-maven/blob/8251f88a0ed6a70e726d2468842455cd1f80893f/slick2d-core/src/main/java/org/newdawn/slick/font/effects/EffectUtil.java#L130-L142 |
deeplearning4j/deeplearning4j | nd4j/nd4j-backends/nd4j-api-parent/nd4j-api/src/main/java/org/nd4j/autodiff/samediff/SameDiff.java | SameDiff.placeHolder | public SDVariable placeHolder(String name, org.nd4j.linalg.api.buffer.DataType dataType, long...shape) {
"""
Create a a placeholder variable. Placeholders are variables that expect an array to be provided during training
and inference.<br>
For example, the SDVariables for your input/features and labels should be... | java | public SDVariable placeHolder(String name, org.nd4j.linalg.api.buffer.DataType dataType, long...shape) {
SDVariable ret = new SDVariable(name, VariableType.PLACEHOLDER, this, shape, dataType, null);
variables.put(name, Variable.builder().name(name).variable(ret).build());
return ret;
} | [
"public",
"SDVariable",
"placeHolder",
"(",
"String",
"name",
",",
"org",
".",
"nd4j",
".",
"linalg",
".",
"api",
".",
"buffer",
".",
"DataType",
"dataType",
",",
"long",
"...",
"shape",
")",
"{",
"SDVariable",
"ret",
"=",
"new",
"SDVariable",
"(",
"name... | Create a a placeholder variable. Placeholders are variables that expect an array to be provided during training
and inference.<br>
For example, the SDVariables for your input/features and labels should be placeholders.<br>
See also: {@link VariableType}
@param name the name of the variable
@param dataType Data typ... | [
"Create",
"a",
"a",
"placeholder",
"variable",
".",
"Placeholders",
"are",
"variables",
"that",
"expect",
"an",
"array",
"to",
"be",
"provided",
"during",
"training",
"and",
"inference",
".",
"<br",
">",
"For",
"example",
"the",
"SDVariables",
"for",
"your",
... | train | https://github.com/deeplearning4j/deeplearning4j/blob/effce52f2afd7eeb53c5bcca699fcd90bd06822f/nd4j/nd4j-backends/nd4j-api-parent/nd4j-api/src/main/java/org/nd4j/autodiff/samediff/SameDiff.java#L2057-L2061 |
Azure/azure-sdk-for-java | mediaservices/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_06_01_preview/implementation/LiveEventsInner.java | LiveEventsInner.beginUpdateAsync | public Observable<LiveEventInner> beginUpdateAsync(String resourceGroupName, String accountName, String liveEventName, LiveEventInner parameters) {
"""
Updates a existing Live Event.
@param resourceGroupName The name of the resource group within the Azure subscription.
@param accountName The Media Services acc... | java | public Observable<LiveEventInner> beginUpdateAsync(String resourceGroupName, String accountName, String liveEventName, LiveEventInner parameters) {
return beginUpdateWithServiceResponseAsync(resourceGroupName, accountName, liveEventName, parameters).map(new Func1<ServiceResponse<LiveEventInner>, LiveEventInner>... | [
"public",
"Observable",
"<",
"LiveEventInner",
">",
"beginUpdateAsync",
"(",
"String",
"resourceGroupName",
",",
"String",
"accountName",
",",
"String",
"liveEventName",
",",
"LiveEventInner",
"parameters",
")",
"{",
"return",
"beginUpdateWithServiceResponseAsync",
"(",
... | Updates a existing Live Event.
@param resourceGroupName The name of the resource group within the Azure subscription.
@param accountName The Media Services account name.
@param liveEventName The name of the Live Event.
@param parameters Live Event properties needed for creation.
@throws IllegalArgumentException thrown... | [
"Updates",
"a",
"existing",
"Live",
"Event",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/mediaservices/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_06_01_preview/implementation/LiveEventsInner.java#L869-L876 |
elki-project/elki | elki-outlier/src/main/java/de/lmu/ifi/dbs/elki/algorithm/outlier/meta/RescaleMetaOutlierAlgorithm.java | RescaleMetaOutlierAlgorithm.getOutlierResult | private OutlierResult getOutlierResult(ResultHierarchy hier, Result result) {
"""
Find an OutlierResult to work with.
@param hier Result hierarchy
@param result Result object
@return Iterator to work with
"""
List<OutlierResult> ors = ResultUtil.filterResults(hier, result, OutlierResult.class);
if... | java | private OutlierResult getOutlierResult(ResultHierarchy hier, Result result) {
List<OutlierResult> ors = ResultUtil.filterResults(hier, result, OutlierResult.class);
if(!ors.isEmpty()) {
return ors.get(0);
}
throw new IllegalStateException("Comparison algorithm expected at least one outlier result.... | [
"private",
"OutlierResult",
"getOutlierResult",
"(",
"ResultHierarchy",
"hier",
",",
"Result",
"result",
")",
"{",
"List",
"<",
"OutlierResult",
">",
"ors",
"=",
"ResultUtil",
".",
"filterResults",
"(",
"hier",
",",
"result",
",",
"OutlierResult",
".",
"class",
... | Find an OutlierResult to work with.
@param hier Result hierarchy
@param result Result object
@return Iterator to work with | [
"Find",
"an",
"OutlierResult",
"to",
"work",
"with",
"."
] | train | https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-outlier/src/main/java/de/lmu/ifi/dbs/elki/algorithm/outlier/meta/RescaleMetaOutlierAlgorithm.java#L126-L132 |
loldevs/riotapi | rest/src/main/java/net/boreeas/riotapi/rest/ThrottledApiHandler.java | ThrottledApiHandler.getRunePagesMultipleUsers | public Future<Map<Integer, Set<RunePage>>> getRunePagesMultipleUsers(int... ids) {
"""
Retrieve runes pages for multiple users
@param ids The ids of the users
@return A map, mapping user ids to their respective runes pages
@see <a href=https://developer.riotgames.com/api/methods#!/620/1932>Official API document... | java | public Future<Map<Integer, Set<RunePage>>> getRunePagesMultipleUsers(int... ids) {
return new ApiFuture<>(() -> handler.getRunePagesMultipleUsers(ids));
} | [
"public",
"Future",
"<",
"Map",
"<",
"Integer",
",",
"Set",
"<",
"RunePage",
">",
">",
">",
"getRunePagesMultipleUsers",
"(",
"int",
"...",
"ids",
")",
"{",
"return",
"new",
"ApiFuture",
"<>",
"(",
"(",
")",
"->",
"handler",
".",
"getRunePagesMultipleUsers... | Retrieve runes pages for multiple users
@param ids The ids of the users
@return A map, mapping user ids to their respective runes pages
@see <a href=https://developer.riotgames.com/api/methods#!/620/1932>Official API documentation</a> | [
"Retrieve",
"runes",
"pages",
"for",
"multiple",
"users"
] | train | https://github.com/loldevs/riotapi/blob/0b8aac407aa5289845f249024f9732332855544f/rest/src/main/java/net/boreeas/riotapi/rest/ThrottledApiHandler.java#L1171-L1173 |
lucee/Lucee | core/src/main/java/lucee/runtime/type/util/ComponentUtil.java | ComponentUtil.getComponentPropertiesClass | public static Class getComponentPropertiesClass(Config config, String className, ASMProperty[] properties, Class extendsClass) throws PageException {
"""
/*
does not include the application context javasettings
@param pc
@param className
@param properties
@return
@throws PageException
"""
try ... | java | public static Class getComponentPropertiesClass(Config config, String className, ASMProperty[] properties, Class extendsClass) throws PageException {
try {
return _getComponentPropertiesClass(null, config, className, properties, extendsClass);
}
catch (Exception e) {
throw Caster.toPageException(e);
}
... | [
"public",
"static",
"Class",
"getComponentPropertiesClass",
"(",
"Config",
"config",
",",
"String",
"className",
",",
"ASMProperty",
"[",
"]",
"properties",
",",
"Class",
"extendsClass",
")",
"throws",
"PageException",
"{",
"try",
"{",
"return",
"_getComponentProper... | /*
does not include the application context javasettings
@param pc
@param className
@param properties
@return
@throws PageException | [
"/",
"*",
"does",
"not",
"include",
"the",
"application",
"context",
"javasettings"
] | train | https://github.com/lucee/Lucee/blob/29b153fc4e126e5edb97da937f2ee2e231b87593/core/src/main/java/lucee/runtime/type/util/ComponentUtil.java#L380-L387 |
jenkinsci/artifactory-plugin | src/main/java/org/jfrog/hudson/pipeline/declarative/utils/DeclarativePipelineUtils.java | DeclarativePipelineUtils.getArtifactoryServer | public static ArtifactoryServer getArtifactoryServer(Run build, FilePath ws, StepContext context, String serverId) throws IOException, InterruptedException {
"""
Get Artifactory server from global server configuration or from previous rtServer{...} scope.
@param build - Step's build.
@param ws - Step'... | java | public static ArtifactoryServer getArtifactoryServer(Run build, FilePath ws, StepContext context, String serverId) throws IOException, InterruptedException {
String buildNumber = BuildUniqueIdentifierHelper.getBuildNumber(build);
BuildDataFile buildDataFile = readBuildDataFile(ws, buildNumber, CreateSer... | [
"public",
"static",
"ArtifactoryServer",
"getArtifactoryServer",
"(",
"Run",
"build",
",",
"FilePath",
"ws",
",",
"StepContext",
"context",
",",
"String",
"serverId",
")",
"throws",
"IOException",
",",
"InterruptedException",
"{",
"String",
"buildNumber",
"=",
"Buil... | Get Artifactory server from global server configuration or from previous rtServer{...} scope.
@param build - Step's build.
@param ws - Step's workspace.
@param context - Step's context.
@param serverId - The server id. Can be defined from global server configuration or from previous rtServer{...} scope.
@ret... | [
"Get",
"Artifactory",
"server",
"from",
"global",
"server",
"configuration",
"or",
"from",
"previous",
"rtServer",
"{",
"...",
"}",
"scope",
"."
] | train | https://github.com/jenkinsci/artifactory-plugin/blob/f5fcfff6a5a50be5374813e49d1fe3aaf6422333/src/main/java/org/jfrog/hudson/pipeline/declarative/utils/DeclarativePipelineUtils.java#L70-L91 |
astrapi69/jaulp-wicket | jaulp-wicket-components/src/main/java/de/alpharogroup/wicket/components/i18n/content/ContentPanel.java | ContentPanel.newContentLabel | protected Component newContentLabel(final String id, final IModel<String> model) {
"""
Factory method for create a new {@link MultiLineLabel}. This method is invoked in the
constructor from the derived classes and can be overridden so users can provide their own
version of a new {@link MultiLineLabel}.
@param... | java | protected Component newContentLabel(final String id, final IModel<String> model)
{
return ComponentFactory.newMultiLineLabel(id, model);
} | [
"protected",
"Component",
"newContentLabel",
"(",
"final",
"String",
"id",
",",
"final",
"IModel",
"<",
"String",
">",
"model",
")",
"{",
"return",
"ComponentFactory",
".",
"newMultiLineLabel",
"(",
"id",
",",
"model",
")",
";",
"}"
] | Factory method for create a new {@link MultiLineLabel}. This method is invoked in the
constructor from the derived classes and can be overridden so users can provide their own
version of a new {@link MultiLineLabel}.
@param id
the id
@param model
the {@link IModel} of the {@link MultiLineLabel}.
@return the new {@link... | [
"Factory",
"method",
"for",
"create",
"a",
"new",
"{",
"@link",
"MultiLineLabel",
"}",
".",
"This",
"method",
"is",
"invoked",
"in",
"the",
"constructor",
"from",
"the",
"derived",
"classes",
"and",
"can",
"be",
"overridden",
"so",
"users",
"can",
"provide",... | train | https://github.com/astrapi69/jaulp-wicket/blob/85d74368d00abd9bb97659b5794e38c0f8a013d4/jaulp-wicket-components/src/main/java/de/alpharogroup/wicket/components/i18n/content/ContentPanel.java#L98-L101 |
hazelcast/hazelcast | hazelcast/src/main/java/com/hazelcast/internal/serialization/impl/SerializationUtil.java | SerializationUtil.writeNullableMap | public static <K, V> void writeNullableMap(Map<K, V> map, ObjectDataOutput out) throws IOException {
"""
Writes a map to given {@code ObjectDataOutput}.
@param map the map to serialize, can be {@code null}
@param out the output to write the map to
"""
// write true when the map ... | java | public static <K, V> void writeNullableMap(Map<K, V> map, ObjectDataOutput out) throws IOException {
// write true when the map is NOT null
out.writeBoolean(map != null);
if (map == null) {
return;
}
writeMap(map, out);
} | [
"public",
"static",
"<",
"K",
",",
"V",
">",
"void",
"writeNullableMap",
"(",
"Map",
"<",
"K",
",",
"V",
">",
"map",
",",
"ObjectDataOutput",
"out",
")",
"throws",
"IOException",
"{",
"// write true when the map is NOT null",
"out",
".",
"writeBoolean",
"(",
... | Writes a map to given {@code ObjectDataOutput}.
@param map the map to serialize, can be {@code null}
@param out the output to write the map to | [
"Writes",
"a",
"map",
"to",
"given",
"{",
"@code",
"ObjectDataOutput",
"}",
"."
] | train | https://github.com/hazelcast/hazelcast/blob/8c4bc10515dbbfb41a33e0302c0caedf3cda1baf/hazelcast/src/main/java/com/hazelcast/internal/serialization/impl/SerializationUtil.java#L155-L163 |
sirensolutions/siren-join | src/main/java/solutions/siren/join/common/Bytes.java | Bytes.writeBytesRef | public final static void writeBytesRef(BytesRef src, BytesRef dst) {
"""
Encodes a {@link BytesRef} into another {@link BytesRef}. Null and empty bytes arrays will be encoded
with a 0.
@see Bytes#readBytesRef(BytesRef, BytesRef)
"""
if (src == null) {
Bytes.writeVInt(dst, 0);
return;
}
... | java | public final static void writeBytesRef(BytesRef src, BytesRef dst) {
if (src == null) {
Bytes.writeVInt(dst, 0);
return;
}
Bytes.writeVInt(dst, src.length);
System.arraycopy(src.bytes, src.offset, dst.bytes, dst.offset, src.length);
dst.offset += src.length;
} | [
"public",
"final",
"static",
"void",
"writeBytesRef",
"(",
"BytesRef",
"src",
",",
"BytesRef",
"dst",
")",
"{",
"if",
"(",
"src",
"==",
"null",
")",
"{",
"Bytes",
".",
"writeVInt",
"(",
"dst",
",",
"0",
")",
";",
"return",
";",
"}",
"Bytes",
".",
"... | Encodes a {@link BytesRef} into another {@link BytesRef}. Null and empty bytes arrays will be encoded
with a 0.
@see Bytes#readBytesRef(BytesRef, BytesRef) | [
"Encodes",
"a",
"{"
] | train | https://github.com/sirensolutions/siren-join/blob/cba1111b209ce6f72ab7750d5488a573a6c77fe5/src/main/java/solutions/siren/join/common/Bytes.java#L134-L142 |
impossibl/stencil | engine/src/main/java/com/impossibl/stencil/engine/internal/StencilOperands.java | StencilOperands.narrowBigInteger | protected Number narrowBigInteger(Object lhs, Object rhs, BigInteger bigi) {
"""
Given a BigInteger, narrow it to an Integer or Long if it fits and the
arguments class allow it.
<p>
The rules are: if either arguments is a BigInteger, no narrowing will occur
if either arguments is a Long, no narrowing to Intege... | java | protected Number narrowBigInteger(Object lhs, Object rhs, BigInteger bigi) {
// coerce to long if possible
if (!(lhs instanceof BigInteger || rhs instanceof BigInteger) && bigi.compareTo(BIGI_LONG_MAX_VALUE) <= 0 && bigi.compareTo(BIGI_LONG_MIN_VALUE) >= 0) {
// coerce to int if possible
long l = bi... | [
"protected",
"Number",
"narrowBigInteger",
"(",
"Object",
"lhs",
",",
"Object",
"rhs",
",",
"BigInteger",
"bigi",
")",
"{",
"// coerce to long if possible",
"if",
"(",
"!",
"(",
"lhs",
"instanceof",
"BigInteger",
"||",
"rhs",
"instanceof",
"BigInteger",
")",
"&&... | Given a BigInteger, narrow it to an Integer or Long if it fits and the
arguments class allow it.
<p>
The rules are: if either arguments is a BigInteger, no narrowing will occur
if either arguments is a Long, no narrowing to Integer will occur
</p>
@param lhs
the left hand side operand that lead to the bigi result
@par... | [
"Given",
"a",
"BigInteger",
"narrow",
"it",
"to",
"an",
"Integer",
"or",
"Long",
"if",
"it",
"fits",
"and",
"the",
"arguments",
"class",
"allow",
"it",
".",
"<p",
">",
"The",
"rules",
"are",
":",
"if",
"either",
"arguments",
"is",
"a",
"BigInteger",
"n... | train | https://github.com/impossibl/stencil/blob/4aac1be605542b4248be95bf8916be4e2f755d1c/engine/src/main/java/com/impossibl/stencil/engine/internal/StencilOperands.java#L181-L193 |
phax/ph-commons | ph-datetime/src/main/java/com/helger/datetime/util/PDTHelper.java | PDTHelper.getEndWeekOfMonth | public static int getEndWeekOfMonth (@Nonnull final LocalDateTime aDT, @Nonnull final Locale aLocale) {
"""
Get the end-week number for the passed year and month.
@param aDT
The object to use year and month from.
@param aLocale
Locale to use. May not be <code>null</code>.
@return The end week number.
""... | java | public static int getEndWeekOfMonth (@Nonnull final LocalDateTime aDT, @Nonnull final Locale aLocale)
{
return getWeekOfWeekBasedYear (aDT.plusMonths (1).withDayOfMonth (1).minusDays (1), aLocale);
} | [
"public",
"static",
"int",
"getEndWeekOfMonth",
"(",
"@",
"Nonnull",
"final",
"LocalDateTime",
"aDT",
",",
"@",
"Nonnull",
"final",
"Locale",
"aLocale",
")",
"{",
"return",
"getWeekOfWeekBasedYear",
"(",
"aDT",
".",
"plusMonths",
"(",
"1",
")",
".",
"withDayOf... | Get the end-week number for the passed year and month.
@param aDT
The object to use year and month from.
@param aLocale
Locale to use. May not be <code>null</code>.
@return The end week number. | [
"Get",
"the",
"end",
"-",
"week",
"number",
"for",
"the",
"passed",
"year",
"and",
"month",
"."
] | train | https://github.com/phax/ph-commons/blob/d28c03565f44a0b804d96028d0969f9bb38c4313/ph-datetime/src/main/java/com/helger/datetime/util/PDTHelper.java#L231-L234 |
CloudSlang/cs-actions | cs-json/src/main/java/io/cloudslang/content/json/actions/MergeArrays.java | MergeArrays.execute | @Action(name = "Merge Arrays",
outputs = {
"""
This operation merge the contents of two JSON arrays. This operation does not modify either of the input arrays.
The result is the contents or array1 and array2, merged into a single array. The merge operation add into the result
the first array and then... | java | @Action(name = "Merge Arrays",
outputs = {
@Output(OutputNames.RETURN_RESULT),
@Output(OutputNames.RETURN_CODE),
@Output(OutputNames.EXCEPTION)
},
responses = {
@Response(text = ResponseNames.SUCCESS, fie... | [
"@",
"Action",
"(",
"name",
"=",
"\"Merge Arrays\"",
",",
"outputs",
"=",
"{",
"@",
"Output",
"(",
"OutputNames",
".",
"RETURN_RESULT",
")",
",",
"@",
"Output",
"(",
"OutputNames",
".",
"RETURN_CODE",
")",
",",
"@",
"Output",
"(",
"OutputNames",
".",
"EX... | This operation merge the contents of two JSON arrays. This operation does not modify either of the input arrays.
The result is the contents or array1 and array2, merged into a single array. The merge operation add into the result
the first array and then the second array.
@param array1 The string representation of a J... | [
"This",
"operation",
"merge",
"the",
"contents",
"of",
"two",
"JSON",
"arrays",
".",
"This",
"operation",
"does",
"not",
"modify",
"either",
"of",
"the",
"input",
"arrays",
".",
"The",
"result",
"is",
"the",
"contents",
"or",
"array1",
"and",
"array2",
"me... | train | https://github.com/CloudSlang/cs-actions/blob/9a1be1e99ad88286a6c153d5f2275df6ae1a57a1/cs-json/src/main/java/io/cloudslang/content/json/actions/MergeArrays.java#L72-L126 |
microfocus-idol/haven-search-components | idol/src/main/java/com/hp/autonomy/searchcomponents/idol/view/IdolViewServerServiceImpl.java | IdolViewServerServiceImpl.viewDocument | @Override
public void viewDocument(final IdolViewRequest request, final OutputStream outputStream) throws ViewDocumentNotFoundException, IOException {
"""
Provides an HTML rendering of the given IDOL document reference. This first performs a GetContent to make sure the
document exists, then reads the configur... | java | @Override
public void viewDocument(final IdolViewRequest request, final OutputStream outputStream) throws ViewDocumentNotFoundException, IOException {
final ViewConfig viewConfig = configService.getConfig().getViewConfig();
if (viewConfig.getViewingMode() == ViewingMode.UNIVERSAL) {
fin... | [
"@",
"Override",
"public",
"void",
"viewDocument",
"(",
"final",
"IdolViewRequest",
"request",
",",
"final",
"OutputStream",
"outputStream",
")",
"throws",
"ViewDocumentNotFoundException",
",",
"IOException",
"{",
"final",
"ViewConfig",
"viewConfig",
"=",
"configService... | Provides an HTML rendering of the given IDOL document reference. This first performs a GetContent to make sure the
document exists, then reads the configured reference field and passes the value of the field to ViewServer.
@param request options
@param outputStream The ViewServer output
@throws ViewDocumentNotFou... | [
"Provides",
"an",
"HTML",
"rendering",
"of",
"the",
"given",
"IDOL",
"document",
"reference",
".",
"This",
"first",
"performs",
"a",
"GetContent",
"to",
"make",
"sure",
"the",
"document",
"exists",
"then",
"reads",
"the",
"configured",
"reference",
"field",
"a... | train | https://github.com/microfocus-idol/haven-search-components/blob/6f5df74ba67ec0d3f86e73bc1dd0d6edd01a8e44/idol/src/main/java/com/hp/autonomy/searchcomponents/idol/view/IdolViewServerServiceImpl.java#L93-L144 |
apache/flink | flink-runtime/src/main/java/org/apache/flink/runtime/util/ConfigurationParserUtils.java | ConfigurationParserUtils.checkConfigParameter | public static void checkConfigParameter(boolean condition, Object parameter, String name, String errorMessage)
throws IllegalConfigurationException {
"""
Validates a condition for a config parameter and displays a standard exception, if the
the condition does not hold.
@param condition The condit... | java | public static void checkConfigParameter(boolean condition, Object parameter, String name, String errorMessage)
throws IllegalConfigurationException {
if (!condition) {
throw new IllegalConfigurationException("Invalid configuration value for " +
name + " : " + parameter + " - " + errorMessage);
}
} | [
"public",
"static",
"void",
"checkConfigParameter",
"(",
"boolean",
"condition",
",",
"Object",
"parameter",
",",
"String",
"name",
",",
"String",
"errorMessage",
")",
"throws",
"IllegalConfigurationException",
"{",
"if",
"(",
"!",
"condition",
")",
"{",
"throw",
... | Validates a condition for a config parameter and displays a standard exception, if the
the condition does not hold.
@param condition The condition that must hold. If the condition is false, an exception is thrown.
@param parameter The parameter value. Will be shown in the exception message.
@param ... | [
"Validates",
"a",
"condition",
"for",
"a",
"config",
"parameter",
"and",
"displays",
"a",
"standard",
"exception",
"if",
"the",
"the",
"condition",
"does",
"not",
"hold",
"."
] | train | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-runtime/src/main/java/org/apache/flink/runtime/util/ConfigurationParserUtils.java#L127-L133 |
phax/ph-commons | ph-commons/src/main/java/com/helger/commons/io/file/PathOperations.java | PathOperations.copyFile | @Nonnull
public static FileIOError copyFile (@Nonnull final Path aSourceFile, @Nonnull final Path aTargetFile) {
"""
Copies the source file to the target file.
@param aSourceFile
The source file to use. May not be <code>null</code>. Needs to be an
existing file.
@param aTargetFile
The destination files. M... | java | @Nonnull
public static FileIOError copyFile (@Nonnull final Path aSourceFile, @Nonnull final Path aTargetFile)
{
ValueEnforcer.notNull (aSourceFile, "SourceFile");
ValueEnforcer.notNull (aTargetFile, "TargetFile");
final Path aRealSourceFile = _getUnifiedPath (aSourceFile);
final Path aRealTargetFi... | [
"@",
"Nonnull",
"public",
"static",
"FileIOError",
"copyFile",
"(",
"@",
"Nonnull",
"final",
"Path",
"aSourceFile",
",",
"@",
"Nonnull",
"final",
"Path",
"aTargetFile",
")",
"{",
"ValueEnforcer",
".",
"notNull",
"(",
"aSourceFile",
",",
"\"SourceFile\"",
")",
... | Copies the source file to the target file.
@param aSourceFile
The source file to use. May not be <code>null</code>. Needs to be an
existing file.
@param aTargetFile
The destination files. May not be <code>null</code> and may not be
an existing file.
@return A non-<code>null</code> error code. | [
"Copies",
"the",
"source",
"file",
"to",
"the",
"target",
"file",
"."
] | train | https://github.com/phax/ph-commons/blob/d28c03565f44a0b804d96028d0969f9bb38c4313/ph-commons/src/main/java/com/helger/commons/io/file/PathOperations.java#L530-L564 |
rundeck/rundeck | core/src/main/java/com/dtolabs/utils/Mapper.java | Mapper.beanMap | public static Collection beanMap(String property, Iterator i) {
"""
Map dynamically using a bean property name.
@param property the name of a bean property
@param i an iterator of objects
@return collection
@throws ClassCastException if there is an error invoking the method on any object.
"""
... | java | public static Collection beanMap(String property, Iterator i) {
return beanMap(property, i, false);
} | [
"public",
"static",
"Collection",
"beanMap",
"(",
"String",
"property",
",",
"Iterator",
"i",
")",
"{",
"return",
"beanMap",
"(",
"property",
",",
"i",
",",
"false",
")",
";",
"}"
] | Map dynamically using a bean property name.
@param property the name of a bean property
@param i an iterator of objects
@return collection
@throws ClassCastException if there is an error invoking the method on any object. | [
"Map",
"dynamically",
"using",
"a",
"bean",
"property",
"name",
"."
] | train | https://github.com/rundeck/rundeck/blob/8070f774f55bffaa1118ff0c03aea319d40a9668/core/src/main/java/com/dtolabs/utils/Mapper.java#L672-L674 |
ModeShape/modeshape | modeshape-jcr/src/main/java/org/modeshape/jcr/query/optimize/PushSelectCriteria.java | PushSelectCriteria.pushTowardsOriginatingNode | protected boolean pushTowardsOriginatingNode( PlanNode criteriaNode,
PlanNode originatingNode ) {
"""
Push the criteria node as close to the originating node as possible. In general, the criteria node usually ends up being
moved to be a parent of the supplied orig... | java | protected boolean pushTowardsOriginatingNode( PlanNode criteriaNode,
PlanNode originatingNode ) {
// To keep things stable, 'originatingNode' should be the top-most SELECT (criteria) node above a SOURCE ...
while (originatingNode.getParent().getType() ==... | [
"protected",
"boolean",
"pushTowardsOriginatingNode",
"(",
"PlanNode",
"criteriaNode",
",",
"PlanNode",
"originatingNode",
")",
"{",
"// To keep things stable, 'originatingNode' should be the top-most SELECT (criteria) node above a SOURCE ...",
"while",
"(",
"originatingNode",
".",
"... | Push the criteria node as close to the originating node as possible. In general, the criteria node usually ends up being
moved to be a parent of the supplied originating node, except in a couple of cases:
<ul>
<li>There are already criteria nodes immediately above the originating node; in this case, the supplied criter... | [
"Push",
"the",
"criteria",
"node",
"as",
"close",
"to",
"the",
"originating",
"node",
"as",
"possible",
".",
"In",
"general",
"the",
"criteria",
"node",
"usually",
"ends",
"up",
"being",
"moved",
"to",
"be",
"a",
"parent",
"of",
"the",
"supplied",
"origina... | train | https://github.com/ModeShape/modeshape/blob/794cfdabb67a90f24629c4fff0424a6125f8f95b/modeshape-jcr/src/main/java/org/modeshape/jcr/query/optimize/PushSelectCriteria.java#L315-L330 |
twitter/hraven | hraven-etl/src/main/java/com/twitter/hraven/etl/JobHistoryFileParserBase.java | JobHistoryFileParserBase.calculateJobCost | public static double calculateJobCost(long mbMillis, double computeTco, long machineMemory) {
"""
calculates the cost of a job in current units
jobCost = thisJobMbMillis * computeTco / mbMillisInOneday
@param mb millis, compute tco, memory of the machine
"""
if ((machineMemory == 0L) || (computeTco == 0.... | java | public static double calculateJobCost(long mbMillis, double computeTco, long machineMemory) {
if ((machineMemory == 0L) || (computeTco == 0.0)) {
LOG.error("Unable to calculate job cost since machineMemory " + machineMemory
+ " or computeTco " + computeTco + " is 0; returning jobCost as 0");
r... | [
"public",
"static",
"double",
"calculateJobCost",
"(",
"long",
"mbMillis",
",",
"double",
"computeTco",
",",
"long",
"machineMemory",
")",
"{",
"if",
"(",
"(",
"machineMemory",
"==",
"0L",
")",
"||",
"(",
"computeTco",
"==",
"0.0",
")",
")",
"{",
"LOG",
... | calculates the cost of a job in current units
jobCost = thisJobMbMillis * computeTco / mbMillisInOneday
@param mb millis, compute tco, memory of the machine | [
"calculates",
"the",
"cost",
"of",
"a",
"job",
"in",
"current",
"units",
"jobCost",
"=",
"thisJobMbMillis",
"*",
"computeTco",
"/",
"mbMillisInOneday"
] | train | https://github.com/twitter/hraven/blob/e35996b6e2f016bcd18db0bad320be7c93d95208/hraven-etl/src/main/java/com/twitter/hraven/etl/JobHistoryFileParserBase.java#L236-L244 |
baasbox/Android-SDK | library/src/main/java/com/baasbox/android/BaasDocument.java | BaasDocument.fetchAll | public static RequestToken fetchAll(String collection, BaasHandler<List<BaasDocument>> handler) {
"""
Asynchronously retrieves the list of documents readable to the user in <code>collection</code>.
@param collection the collection to retrieve not <code>null</code>
@param handler a callback to be invoked wit... | java | public static RequestToken fetchAll(String collection, BaasHandler<List<BaasDocument>> handler) {
return fetchAll(collection, null, RequestOptions.DEFAULT, handler);
} | [
"public",
"static",
"RequestToken",
"fetchAll",
"(",
"String",
"collection",
",",
"BaasHandler",
"<",
"List",
"<",
"BaasDocument",
">",
">",
"handler",
")",
"{",
"return",
"fetchAll",
"(",
"collection",
",",
"null",
",",
"RequestOptions",
".",
"DEFAULT",
",",
... | Asynchronously retrieves the list of documents readable to the user in <code>collection</code>.
@param collection the collection to retrieve not <code>null</code>
@param handler a callback to be invoked with the result of the request
@return a {@link com.baasbox.android.RequestToken} to handle the asynchronous requ... | [
"Asynchronously",
"retrieves",
"the",
"list",
"of",
"documents",
"readable",
"to",
"the",
"user",
"in",
"<code",
">",
"collection<",
"/",
"code",
">",
"."
] | train | https://github.com/baasbox/Android-SDK/blob/6bb2203246b885b2ad63a7bfaf37c83caf15e0d8/library/src/main/java/com/baasbox/android/BaasDocument.java#L232-L234 |
apache/incubator-gobblin | gobblin-runtime/src/main/java/org/apache/gobblin/runtime/JobContext.java | JobContext.setTaskStagingDir | private void setTaskStagingDir() {
"""
If {@link ConfigurationKeys#WRITER_STAGING_DIR} (which is deprecated) is specified, use its value.
Otherwise, if {@link ConfigurationKeys#TASK_DATA_ROOT_DIR_KEY} is specified, use its value
plus {@link #TASK_STAGING_DIR_NAME}.
"""
if (this.jobState.contains(Config... | java | private void setTaskStagingDir() {
if (this.jobState.contains(ConfigurationKeys.WRITER_STAGING_DIR)) {
LOG.warn(String.format("Property %s is deprecated. No need to use it if %s is specified.",
ConfigurationKeys.WRITER_STAGING_DIR, ConfigurationKeys.TASK_DATA_ROOT_DIR_KEY));
} else {
Strin... | [
"private",
"void",
"setTaskStagingDir",
"(",
")",
"{",
"if",
"(",
"this",
".",
"jobState",
".",
"contains",
"(",
"ConfigurationKeys",
".",
"WRITER_STAGING_DIR",
")",
")",
"{",
"LOG",
".",
"warn",
"(",
"String",
".",
"format",
"(",
"\"Property %s is deprecated.... | If {@link ConfigurationKeys#WRITER_STAGING_DIR} (which is deprecated) is specified, use its value.
Otherwise, if {@link ConfigurationKeys#TASK_DATA_ROOT_DIR_KEY} is specified, use its value
plus {@link #TASK_STAGING_DIR_NAME}. | [
"If",
"{",
"@link",
"ConfigurationKeys#WRITER_STAGING_DIR",
"}",
"(",
"which",
"is",
"deprecated",
")",
"is",
"specified",
"use",
"its",
"value",
"."
] | train | https://github.com/apache/incubator-gobblin/blob/f029b4c0fea0fe4aa62f36dda2512344ff708bae/gobblin-runtime/src/main/java/org/apache/gobblin/runtime/JobContext.java#L345-L356 |
looly/hutool | hutool-core/src/main/java/cn/hutool/core/io/BufferUtil.java | BufferUtil.readLine | public static String readLine(ByteBuffer buffer, Charset charset) {
"""
读取一行,如果buffer中最后一部分并非完整一行,则返回null<br>
支持的换行符如下:
<pre>
1. \r\n
2. \n
</pre>
@param buffer ByteBuffer
@param charset 编码
@return 一行
"""
final int startPosition = buffer.position();
final int endPosition = lineEnd(buffer);
... | java | public static String readLine(ByteBuffer buffer, Charset charset) {
final int startPosition = buffer.position();
final int endPosition = lineEnd(buffer);
if (endPosition > startPosition) {
byte[] bs = readBytes(buffer, startPosition, endPosition);
return StrUtil.str(bs, charset);
} else if (endPos... | [
"public",
"static",
"String",
"readLine",
"(",
"ByteBuffer",
"buffer",
",",
"Charset",
"charset",
")",
"{",
"final",
"int",
"startPosition",
"=",
"buffer",
".",
"position",
"(",
")",
";",
"final",
"int",
"endPosition",
"=",
"lineEnd",
"(",
"buffer",
")",
"... | 读取一行,如果buffer中最后一部分并非完整一行,则返回null<br>
支持的换行符如下:
<pre>
1. \r\n
2. \n
</pre>
@param buffer ByteBuffer
@param charset 编码
@return 一行 | [
"读取一行,如果buffer中最后一部分并非完整一行,则返回null<br",
">",
"支持的换行符如下:"
] | train | https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-core/src/main/java/cn/hutool/core/io/BufferUtil.java#L204-L216 |
samskivert/pythagoras | src/main/java/pythagoras/f/MathUtil.java | MathUtil.angularDistance | public static float angularDistance (float a1, float a2) {
"""
Returns the (shortest) distance between two angles, assuming that both angles are in
[-pi, +pi].
"""
float ma1 = mirrorAngle(a1), ma2 = mirrorAngle(a2);
return Math.min(Math.abs(a1 - a2), Math.abs(ma1 - ma2));
} | java | public static float angularDistance (float a1, float a2) {
float ma1 = mirrorAngle(a1), ma2 = mirrorAngle(a2);
return Math.min(Math.abs(a1 - a2), Math.abs(ma1 - ma2));
} | [
"public",
"static",
"float",
"angularDistance",
"(",
"float",
"a1",
",",
"float",
"a2",
")",
"{",
"float",
"ma1",
"=",
"mirrorAngle",
"(",
"a1",
")",
",",
"ma2",
"=",
"mirrorAngle",
"(",
"a2",
")",
";",
"return",
"Math",
".",
"min",
"(",
"Math",
".",... | Returns the (shortest) distance between two angles, assuming that both angles are in
[-pi, +pi]. | [
"Returns",
"the",
"(",
"shortest",
")",
"distance",
"between",
"two",
"angles",
"assuming",
"that",
"both",
"angles",
"are",
"in",
"[",
"-",
"pi",
"+",
"pi",
"]",
"."
] | train | https://github.com/samskivert/pythagoras/blob/b8fea743ee8a7d742ad9c06ee4f11f50571fbd32/src/main/java/pythagoras/f/MathUtil.java#L127-L130 |
mgormley/pacaya | src/main/java/edu/jhu/pacaya/gm/model/VarSet.java | VarSet.getVarConfigAsArray | public void getVarConfigAsArray(int configIndex, int[] putInto) {
"""
this is the "no-allocation" version of the non-void method of the same name.
"""
if(putInto.length != this.size())
throw new IllegalArgumentException();
int i = putInto.length - 1;
for (int v=this.size()-1... | java | public void getVarConfigAsArray(int configIndex, int[] putInto) {
if(putInto.length != this.size())
throw new IllegalArgumentException();
int i = putInto.length - 1;
for (int v=this.size()-1; v >= 0; v--) {
Var var = this.get(v);
putInto[i--] = configIndex % v... | [
"public",
"void",
"getVarConfigAsArray",
"(",
"int",
"configIndex",
",",
"int",
"[",
"]",
"putInto",
")",
"{",
"if",
"(",
"putInto",
".",
"length",
"!=",
"this",
".",
"size",
"(",
")",
")",
"throw",
"new",
"IllegalArgumentException",
"(",
")",
";",
"int"... | this is the "no-allocation" version of the non-void method of the same name. | [
"this",
"is",
"the",
"no",
"-",
"allocation",
"version",
"of",
"the",
"non",
"-",
"void",
"method",
"of",
"the",
"same",
"name",
"."
] | train | https://github.com/mgormley/pacaya/blob/786294cbac7cc65dbc32210c10acc32ed0c69233/src/main/java/edu/jhu/pacaya/gm/model/VarSet.java#L140-L149 |
querydsl/querydsl | querydsl-sql/src/main/java/com/querydsl/sql/Configuration.java | Configuration.registerTableOverride | @Deprecated
public String registerTableOverride(String schema, String oldTable, String newTable) {
"""
Register a schema specific table override
@param schema schema of table
@param oldTable table to override
@param newTable override
@return previous override value
@deprecated Use {@link #setDynamicNa... | java | @Deprecated
public String registerTableOverride(String schema, String oldTable, String newTable) {
SchemaAndTable st = registerTableOverride(schema, oldTable, schema, newTable);
return st != null ? st.getTable() : null;
} | [
"@",
"Deprecated",
"public",
"String",
"registerTableOverride",
"(",
"String",
"schema",
",",
"String",
"oldTable",
",",
"String",
"newTable",
")",
"{",
"SchemaAndTable",
"st",
"=",
"registerTableOverride",
"(",
"schema",
",",
"oldTable",
",",
"schema",
",",
"ne... | Register a schema specific table override
@param schema schema of table
@param oldTable table to override
@param newTable override
@return previous override value
@deprecated Use {@link #setDynamicNameMapping(NameMapping)} instead. | [
"Register",
"a",
"schema",
"specific",
"table",
"override"
] | train | https://github.com/querydsl/querydsl/blob/2bf234caf78549813a1e0f44d9c30ecc5ef734e3/querydsl-sql/src/main/java/com/querydsl/sql/Configuration.java#L351-L355 |
zeroturnaround/zt-exec | src/main/java/org/zeroturnaround/exec/stream/PumpStreamHandler.java | PumpStreamHandler.createSystemInPump | protected Thread createSystemInPump(InputStream is, OutputStream os) {
"""
Creates a stream pumper to copy the given input stream to the given
output stream.
@param is the System.in input stream to copy from
@param os the output stream to copy into
@return the stream pumper thread
"""
inputStreamPump... | java | protected Thread createSystemInPump(InputStream is, OutputStream os) {
inputStreamPumper = new InputStreamPumper(is, os);
return newThread(inputStreamPumper);
} | [
"protected",
"Thread",
"createSystemInPump",
"(",
"InputStream",
"is",
",",
"OutputStream",
"os",
")",
"{",
"inputStreamPumper",
"=",
"new",
"InputStreamPumper",
"(",
"is",
",",
"os",
")",
";",
"return",
"newThread",
"(",
"inputStreamPumper",
")",
";",
"}"
] | Creates a stream pumper to copy the given input stream to the given
output stream.
@param is the System.in input stream to copy from
@param os the output stream to copy into
@return the stream pumper thread | [
"Creates",
"a",
"stream",
"pumper",
"to",
"copy",
"the",
"given",
"input",
"stream",
"to",
"the",
"given",
"output",
"stream",
"."
] | train | https://github.com/zeroturnaround/zt-exec/blob/6c3b93b99bf3c69c9f41d6350bf7707005b6a4cd/src/main/java/org/zeroturnaround/exec/stream/PumpStreamHandler.java#L350-L353 |
OpenLiberty/open-liberty | dev/com.ibm.ws.security.social/src/com/ibm/ws/security/social/twitter/TwitterEndpointServices.java | TwitterEndpointServices.computeSignature | public String computeSignature(String requestMethod, String targetUrl, Map<String, String> params) {
"""
Computes the signature for an oauth/request_token request per
{@link https://dev.twitter.com/oauth/overview/creating-signatures}.
Expects consumerSecret and tokenSecret to already be set to the desired values... | java | public String computeSignature(String requestMethod, String targetUrl, Map<String, String> params) {
return computeSignature(requestMethod, targetUrl, params, consumerSecret, tokenSecret);
} | [
"public",
"String",
"computeSignature",
"(",
"String",
"requestMethod",
",",
"String",
"targetUrl",
",",
"Map",
"<",
"String",
",",
"String",
">",
"params",
")",
"{",
"return",
"computeSignature",
"(",
"requestMethod",
",",
"targetUrl",
",",
"params",
",",
"co... | Computes the signature for an oauth/request_token request per
{@link https://dev.twitter.com/oauth/overview/creating-signatures}.
Expects consumerSecret and tokenSecret to already be set to the desired values.
@param requestMethod
@param targetUrl
@param params
@return | [
"Computes",
"the",
"signature",
"for",
"an",
"oauth",
"/",
"request_token",
"request",
"per",
"{",
"@link",
"https",
":",
"//",
"dev",
".",
"twitter",
".",
"com",
"/",
"oauth",
"/",
"overview",
"/",
"creating",
"-",
"signatures",
"}",
".",
"Expects",
"co... | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.security.social/src/com/ibm/ws/security/social/twitter/TwitterEndpointServices.java#L105-L107 |
infinispan/infinispan | client/hotrod-client/src/main/java/org/infinispan/client/hotrod/impl/operations/OperationsFactory.java | OperationsFactory.newPingOperation | public PingOperation newPingOperation(boolean releaseChannel) {
"""
Construct a ping request directed to a particular node.
@return a ping operation for a particular node
@param releaseChannel
"""
return new PingOperation(codec, topologyId, cfg, cacheNameBytes, channelFactory, releaseChannel, this);
... | java | public PingOperation newPingOperation(boolean releaseChannel) {
return new PingOperation(codec, topologyId, cfg, cacheNameBytes, channelFactory, releaseChannel, this);
} | [
"public",
"PingOperation",
"newPingOperation",
"(",
"boolean",
"releaseChannel",
")",
"{",
"return",
"new",
"PingOperation",
"(",
"codec",
",",
"topologyId",
",",
"cfg",
",",
"cacheNameBytes",
",",
"channelFactory",
",",
"releaseChannel",
",",
"this",
")",
";",
... | Construct a ping request directed to a particular node.
@return a ping operation for a particular node
@param releaseChannel | [
"Construct",
"a",
"ping",
"request",
"directed",
"to",
"a",
"particular",
"node",
"."
] | train | https://github.com/infinispan/infinispan/blob/7c62b94886c3febb4774ae8376acf2baa0265ab5/client/hotrod-client/src/main/java/org/infinispan/client/hotrod/impl/operations/OperationsFactory.java#L209-L211 |
alkacon/opencms-core | src/org/opencms/xml/containerpage/CmsContainerElementBean.java | CmsContainerElementBean.addFormatterSetting | public void addFormatterSetting(String containerName, String formatterId) {
"""
Adds a formatter setting.<p>
@param containerName the container name
@param formatterId the formatter id
"""
Map<String, String> newSettings = new HashMap<String, String>(m_individualSettings);
newSettings.put(... | java | public void addFormatterSetting(String containerName, String formatterId) {
Map<String, String> newSettings = new HashMap<String, String>(m_individualSettings);
newSettings.put(CmsFormatterConfig.getSettingsKeyForContainer(containerName), formatterId);
m_individualSettings = Collections.unmodif... | [
"public",
"void",
"addFormatterSetting",
"(",
"String",
"containerName",
",",
"String",
"formatterId",
")",
"{",
"Map",
"<",
"String",
",",
"String",
">",
"newSettings",
"=",
"new",
"HashMap",
"<",
"String",
",",
"String",
">",
"(",
"m_individualSettings",
")"... | Adds a formatter setting.<p>
@param containerName the container name
@param formatterId the formatter id | [
"Adds",
"a",
"formatter",
"setting",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/xml/containerpage/CmsContainerElementBean.java#L359-L374 |
jenkinsci/jenkins | core/src/main/java/hudson/Util.java | Util.displayIOException | public static void displayIOException(@Nonnull IOException e, @Nonnull TaskListener listener ) {
"""
On Windows, error messages for IOException aren't very helpful.
This method generates additional user-friendly error message to the listener
"""
String msg = getWin32ErrorMessage(e);
if(msg!=nu... | java | public static void displayIOException(@Nonnull IOException e, @Nonnull TaskListener listener ) {
String msg = getWin32ErrorMessage(e);
if(msg!=null)
listener.getLogger().println(msg);
} | [
"public",
"static",
"void",
"displayIOException",
"(",
"@",
"Nonnull",
"IOException",
"e",
",",
"@",
"Nonnull",
"TaskListener",
"listener",
")",
"{",
"String",
"msg",
"=",
"getWin32ErrorMessage",
"(",
"e",
")",
";",
"if",
"(",
"msg",
"!=",
"null",
")",
"li... | On Windows, error messages for IOException aren't very helpful.
This method generates additional user-friendly error message to the listener | [
"On",
"Windows",
"error",
"messages",
"for",
"IOException",
"aren",
"t",
"very",
"helpful",
".",
"This",
"method",
"generates",
"additional",
"user",
"-",
"friendly",
"error",
"message",
"to",
"the",
"listener"
] | train | https://github.com/jenkinsci/jenkins/blob/44c4d3989232082c254d27ae360aa810669f44b7/core/src/main/java/hudson/Util.java#L413-L417 |
axibase/atsd-api-java | src/main/java/com/axibase/tsd/model/data/series/Sample.java | Sample.ofIsoDouble | public static Sample ofIsoDouble(String isoDate, double numericValue) {
"""
Creates a new {@link Sample} with date in ISO 8061 format and double value specified
@param isoDate date in ISO 8061 format according
to <a href="https://www.ietf.org/rfc/rfc3339.txt">RFC3339</a>
@param numericValue the numeric... | java | public static Sample ofIsoDouble(String isoDate, double numericValue) {
return new Sample(null, isoDate, null, null)
.setNumericValueFromDouble(numericValue);
} | [
"public",
"static",
"Sample",
"ofIsoDouble",
"(",
"String",
"isoDate",
",",
"double",
"numericValue",
")",
"{",
"return",
"new",
"Sample",
"(",
"null",
",",
"isoDate",
",",
"null",
",",
"null",
")",
".",
"setNumericValueFromDouble",
"(",
"numericValue",
")",
... | Creates a new {@link Sample} with date in ISO 8061 format and double value specified
@param isoDate date in ISO 8061 format according
to <a href="https://www.ietf.org/rfc/rfc3339.txt">RFC3339</a>
@param numericValue the numeric value of the sample
@return the Sample with specified fields | [
"Creates",
"a",
"new",
"{",
"@link",
"Sample",
"}",
"with",
"date",
"in",
"ISO",
"8061",
"format",
"and",
"double",
"value",
"specified"
] | train | https://github.com/axibase/atsd-api-java/blob/63a0767d08b202dad2ebef4372ff947d6fba0246/src/main/java/com/axibase/tsd/model/data/series/Sample.java#L79-L82 |
google/j2objc | jre_emul/android/platform/libcore/ojluni/src/main/java/java/util/Scanner.java | Scanner.findWithinHorizon | public String findWithinHorizon(Pattern pattern, int horizon) {
"""
Attempts to find the next occurrence of the specified pattern.
<p>This method searches through the input up to the specified
search horizon, ignoring delimiters. If the pattern is found the
scanner advances past the input that matched and ret... | java | public String findWithinHorizon(Pattern pattern, int horizon) {
ensureOpen();
if (pattern == null)
throw new NullPointerException();
if (horizon < 0)
throw new IllegalArgumentException("horizon < 0");
clearCaches();
// Search for the pattern
while... | [
"public",
"String",
"findWithinHorizon",
"(",
"Pattern",
"pattern",
",",
"int",
"horizon",
")",
"{",
"ensureOpen",
"(",
")",
";",
"if",
"(",
"pattern",
"==",
"null",
")",
"throw",
"new",
"NullPointerException",
"(",
")",
";",
"if",
"(",
"horizon",
"<",
"... | Attempts to find the next occurrence of the specified pattern.
<p>This method searches through the input up to the specified
search horizon, ignoring delimiters. If the pattern is found the
scanner advances past the input that matched and returns the string
that matched the pattern. If no such pattern is detected then... | [
"Attempts",
"to",
"find",
"the",
"next",
"occurrence",
"of",
"the",
"specified",
"pattern",
"."
] | train | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/libcore/ojluni/src/main/java/java/util/Scanner.java#L1641-L1662 |
lessthanoptimal/BoofCV | integration/boofcv-android/examples/video/app/src/main/java/org/boofcv/video/GradientActivity.java | GradientActivity.renderBitmapImage | @Override
protected void renderBitmapImage(BitmapMode mode, ImageBase image) {
"""
Override the default behavior and colorize gradient instead of converting input image.
"""
switch( mode ) {
case UNSAFE: { // this application is configured to use double buffer and could ignore all other modes
Visuali... | java | @Override
protected void renderBitmapImage(BitmapMode mode, ImageBase image) {
switch( mode ) {
case UNSAFE: { // this application is configured to use double buffer and could ignore all other modes
VisualizeImageData.colorizeGradient(derivX, derivY, -1, bitmap, bitmapTmp);
} break;
case DOUBLE_BUFFER:... | [
"@",
"Override",
"protected",
"void",
"renderBitmapImage",
"(",
"BitmapMode",
"mode",
",",
"ImageBase",
"image",
")",
"{",
"switch",
"(",
"mode",
")",
"{",
"case",
"UNSAFE",
":",
"{",
"// this application is configured to use double buffer and could ignore all other modes... | Override the default behavior and colorize gradient instead of converting input image. | [
"Override",
"the",
"default",
"behavior",
"and",
"colorize",
"gradient",
"instead",
"of",
"converting",
"input",
"image",
"."
] | train | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/integration/boofcv-android/examples/video/app/src/main/java/org/boofcv/video/GradientActivity.java#L143-L164 |
OpenLiberty/open-liberty | dev/com.ibm.ws.ejbcontainer.core/src/com/ibm/ejs/container/activator/Activator.java | Activator.commitBean | public void commitBean(ContainerTx tx, BeanO bean) {
"""
Perform commit-time processing for the specified transaction and bean.
This method should be called for each bean which was participating in
a transaction which was successfully committed.
The transaction-local instance of the bean is removed from the c... | java | public void commitBean(ContainerTx tx, BeanO bean)
{
bean.getActivationStrategy().atCommit(tx, bean);
} | [
"public",
"void",
"commitBean",
"(",
"ContainerTx",
"tx",
",",
"BeanO",
"bean",
")",
"{",
"bean",
".",
"getActivationStrategy",
"(",
")",
".",
"atCommit",
"(",
"tx",
",",
"bean",
")",
";",
"}"
] | Perform commit-time processing for the specified transaction and bean.
This method should be called for each bean which was participating in
a transaction which was successfully committed.
The transaction-local instance of the bean is removed from the cache,
and any necessary reconciliation between that instance and t... | [
"Perform",
"commit",
"-",
"time",
"processing",
"for",
"the",
"specified",
"transaction",
"and",
"bean",
".",
"This",
"method",
"should",
"be",
"called",
"for",
"each",
"bean",
"which",
"was",
"participating",
"in",
"a",
"transaction",
"which",
"was",
"success... | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.ejbcontainer.core/src/com/ibm/ejs/container/activator/Activator.java#L387-L390 |
LAW-Unimi/BUbiNG | src/it/unimi/di/law/bubing/frontier/VisitStateSet.java | VisitStateSet.get | public VisitState get(final byte[] array, final int offset, final int length) {
"""
Returns the visit state associated to a given scheme+authority specified as a byte-array fragment, or {@code null}.
@param array a byte array.
@param offset the first valid byte in {@code array}.
@param length the number of va... | java | public VisitState get(final byte[] array, final int offset, final int length) {
// The starting point.
int pos = (int)(MurmurHash3.hash(array, offset, length) & mask);
// There's always an unused entry.
while(visitState[pos] != null) {
if (visitState[pos].schemeAuthority.length == length && equals(visitState... | [
"public",
"VisitState",
"get",
"(",
"final",
"byte",
"[",
"]",
"array",
",",
"final",
"int",
"offset",
",",
"final",
"int",
"length",
")",
"{",
"// The starting point.",
"int",
"pos",
"=",
"(",
"int",
")",
"(",
"MurmurHash3",
".",
"hash",
"(",
"array",
... | Returns the visit state associated to a given scheme+authority specified as a byte-array fragment, or {@code null}.
@param array a byte array.
@param offset the first valid byte in {@code array}.
@param length the number of valid elements in {@code array}.
@return the visit state associated to a given scheme+authority... | [
"Returns",
"the",
"visit",
"state",
"associated",
"to",
"a",
"given",
"scheme",
"+",
"authority",
"specified",
"as",
"a",
"byte",
"-",
"array",
"fragment",
"or",
"{",
"@code",
"null",
"}",
"."
] | train | https://github.com/LAW-Unimi/BUbiNG/blob/e148acc90031a4f3967422705a9fb07ddaf155e4/src/it/unimi/di/law/bubing/frontier/VisitStateSet.java#L167-L176 |
VoltDB/voltdb | src/hsqldb19b3/org/hsqldb_voltpatches/jdbc/JDBCResultSet.java | JDBCResultSet.updateBoolean | public void updateBoolean(int columnIndex, boolean x) throws SQLException {
"""
<!-- start generic documentation -->
Updates the designated column with a <code>boolean</code> value.
The updater methods are used to update column values in the
current row or the insert row. The updater methods do not
update the... | java | public void updateBoolean(int columnIndex, boolean x) throws SQLException {
Boolean value = x ? Boolean.TRUE
: Boolean.FALSE;
startUpdate(columnIndex);
preparedStatement.setParameter(columnIndex, value);
} | [
"public",
"void",
"updateBoolean",
"(",
"int",
"columnIndex",
",",
"boolean",
"x",
")",
"throws",
"SQLException",
"{",
"Boolean",
"value",
"=",
"x",
"?",
"Boolean",
".",
"TRUE",
":",
"Boolean",
".",
"FALSE",
";",
"startUpdate",
"(",
"columnIndex",
")",
";"... | <!-- start generic documentation -->
Updates the designated column with a <code>boolean</code> value.
The updater methods are used to update column values in the
current row or the insert row. The updater methods do not
update the underlying database; instead the <code>updateRow</code> or
<code>insertRow</code> method... | [
"<!",
"--",
"start",
"generic",
"documentation",
"--",
">",
"Updates",
"the",
"designated",
"column",
"with",
"a",
"<code",
">",
"boolean<",
"/",
"code",
">",
"value",
".",
"The",
"updater",
"methods",
"are",
"used",
"to",
"update",
"column",
"values",
"in... | train | https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/src/hsqldb19b3/org/hsqldb_voltpatches/jdbc/JDBCResultSet.java#L2649-L2656 |
att/AAF | cadi/core/src/main/java/com/att/cadi/AbsUserCache.java | AbsUserCache.addMiss | protected boolean addMiss(String key, byte[] bs) {
"""
Add miss to missMap. If Miss exists, or too many tries, returns false.
otherwise, returns true to allow another attempt.
@param key
@param bs
@return
"""
Miss miss = missMap.get(key);
if(miss==null) {
synchronized(missMap) {
missMap.put... | java | protected boolean addMiss(String key, byte[] bs) {
Miss miss = missMap.get(key);
if(miss==null) {
synchronized(missMap) {
missMap.put(key, new Miss(bs,clean==null?MIN_INTERVAL:clean.timeInterval));
}
return true;
}
return miss.add(bs);
} | [
"protected",
"boolean",
"addMiss",
"(",
"String",
"key",
",",
"byte",
"[",
"]",
"bs",
")",
"{",
"Miss",
"miss",
"=",
"missMap",
".",
"get",
"(",
"key",
")",
";",
"if",
"(",
"miss",
"==",
"null",
")",
"{",
"synchronized",
"(",
"missMap",
")",
"{",
... | Add miss to missMap. If Miss exists, or too many tries, returns false.
otherwise, returns true to allow another attempt.
@param key
@param bs
@return | [
"Add",
"miss",
"to",
"missMap",
".",
"If",
"Miss",
"exists",
"or",
"too",
"many",
"tries",
"returns",
"false",
"."
] | train | https://github.com/att/AAF/blob/090562e956c0035db972aafba844dc6d3fc948ee/cadi/core/src/main/java/com/att/cadi/AbsUserCache.java#L91-L100 |
evant/binding-collection-adapter | bindingcollectionadapter/src/main/java/me/tatarka/bindingcollectionadapter2/Utils.java | Utils.throwMissingVariable | static void throwMissingVariable(ViewDataBinding binding, int bindingVariable, @LayoutRes int layoutRes) {
"""
Helper to throw an exception when {@link androidx.databinding.ViewDataBinding#setVariable(int,
Object)} returns false.
"""
Context context = binding.getRoot().getContext();
Resources ... | java | static void throwMissingVariable(ViewDataBinding binding, int bindingVariable, @LayoutRes int layoutRes) {
Context context = binding.getRoot().getContext();
Resources resources = context.getResources();
String layoutName = resources.getResourceName(layoutRes);
String bindingVariableName ... | [
"static",
"void",
"throwMissingVariable",
"(",
"ViewDataBinding",
"binding",
",",
"int",
"bindingVariable",
",",
"@",
"LayoutRes",
"int",
"layoutRes",
")",
"{",
"Context",
"context",
"=",
"binding",
".",
"getRoot",
"(",
")",
".",
"getContext",
"(",
")",
";",
... | Helper to throw an exception when {@link androidx.databinding.ViewDataBinding#setVariable(int,
Object)} returns false. | [
"Helper",
"to",
"throw",
"an",
"exception",
"when",
"{"
] | train | https://github.com/evant/binding-collection-adapter/blob/f669eda0a7002128bb504dcba012c51531f1bedd/bindingcollectionadapter/src/main/java/me/tatarka/bindingcollectionadapter2/Utils.java#L38-L44 |
overturetool/overture | ide/ui/src/main/java/org/overture/ide/ui/internal/viewsupport/VdmElementImageProvider.java | VdmElementImageProvider.getCUResourceImageDescriptor | public ImageDescriptor getCUResourceImageDescriptor(IFile file, int flags) {
"""
Returns an image descriptor for a compilation unit not on the class path.
The descriptor includes overlays, if specified.
@param file
the cu resource file
@param flags
the image flags
@return returns the image descriptor
"... | java | public ImageDescriptor getCUResourceImageDescriptor(IFile file, int flags) {
Point size = useSmallSize(flags) ? SMALL_SIZE : BIG_SIZE;
return new VdmElementImageDescriptor(
VdmPluginImages.DESC_OBJS_CUNIT_RESOURCE, 0, size);
} | [
"public",
"ImageDescriptor",
"getCUResourceImageDescriptor",
"(",
"IFile",
"file",
",",
"int",
"flags",
")",
"{",
"Point",
"size",
"=",
"useSmallSize",
"(",
"flags",
")",
"?",
"SMALL_SIZE",
":",
"BIG_SIZE",
";",
"return",
"new",
"VdmElementImageDescriptor",
"(",
... | Returns an image descriptor for a compilation unit not on the class path.
The descriptor includes overlays, if specified.
@param file
the cu resource file
@param flags
the image flags
@return returns the image descriptor | [
"Returns",
"an",
"image",
"descriptor",
"for",
"a",
"compilation",
"unit",
"not",
"on",
"the",
"class",
"path",
".",
"The",
"descriptor",
"includes",
"overlays",
"if",
"specified",
"."
] | train | https://github.com/overturetool/overture/blob/83175dc6c24fa171cde4fcf61ecb648eba3bdbc1/ide/ui/src/main/java/org/overture/ide/ui/internal/viewsupport/VdmElementImageProvider.java#L577-L581 |
Whiley/WhileyCompiler | src/main/java/wyil/transform/VerificationConditionGenerator.java | VerificationConditionGenerator.translateFail | private Context translateFail(WyilFile.Stmt.Fail stmt, Context context) {
"""
Translate a fail statement. Execution should never reach such a statement.
Hence, we need to emit a verification condition to ensure this is the case.
@param stmt
@param context
@return
"""
Expr condition = new Expr.Constant(... | java | private Context translateFail(WyilFile.Stmt.Fail stmt, Context context) {
Expr condition = new Expr.Constant(new Value.Bool(false));
//
VerificationCondition verificationCondition = new VerificationCondition("possible panic", context.assumptions,
condition, stmt.getParent(WyilFile.Attribute.Span.class));
co... | [
"private",
"Context",
"translateFail",
"(",
"WyilFile",
".",
"Stmt",
".",
"Fail",
"stmt",
",",
"Context",
"context",
")",
"{",
"Expr",
"condition",
"=",
"new",
"Expr",
".",
"Constant",
"(",
"new",
"Value",
".",
"Bool",
"(",
"false",
")",
")",
";",
"//"... | Translate a fail statement. Execution should never reach such a statement.
Hence, we need to emit a verification condition to ensure this is the case.
@param stmt
@param context
@return | [
"Translate",
"a",
"fail",
"statement",
".",
"Execution",
"should",
"never",
"reach",
"such",
"a",
"statement",
".",
"Hence",
"we",
"need",
"to",
"emit",
"a",
"verification",
"condition",
"to",
"ensure",
"this",
"is",
"the",
"case",
"."
] | train | https://github.com/Whiley/WhileyCompiler/blob/680f8a657d3fc286f8cc422755988b6d74ab3f4c/src/main/java/wyil/transform/VerificationConditionGenerator.java#L824-L832 |
protostuff/protostuff | protostuff-msgpack/src/main/java/io/protostuff/MsgpackIOUtil.java | MsgpackIOUtil.parseListFrom | public static <T> List<T> parseListFrom(MessageUnpacker unpacker, Schema<T> schema, boolean numeric)
throws IOException {
"""
Parses the {@code messages} from the parser using the given {@code schema}.
"""
MsgpackParser parser = new MsgpackParser(unpacker, numeric);
MsgpackInput in... | java | public static <T> List<T> parseListFrom(MessageUnpacker unpacker, Schema<T> schema, boolean numeric)
throws IOException
{
MsgpackParser parser = new MsgpackParser(unpacker, numeric);
MsgpackInput input = new MsgpackInput(parser);
List<T> list = new ArrayList<T>();
whil... | [
"public",
"static",
"<",
"T",
">",
"List",
"<",
"T",
">",
"parseListFrom",
"(",
"MessageUnpacker",
"unpacker",
",",
"Schema",
"<",
"T",
">",
"schema",
",",
"boolean",
"numeric",
")",
"throws",
"IOException",
"{",
"MsgpackParser",
"parser",
"=",
"new",
"Msg... | Parses the {@code messages} from the parser using the given {@code schema}. | [
"Parses",
"the",
"{"
] | train | https://github.com/protostuff/protostuff/blob/af669cf089057d0ec83220266131ce411854af7b/protostuff-msgpack/src/main/java/io/protostuff/MsgpackIOUtil.java#L346-L368 |
infinispan/infinispan | commons/src/main/java/org/infinispan/commons/util/SaslUtils.java | SaslUtils.getSaslServerFactories | public static Iterator<SaslServerFactory> getSaslServerFactories(ClassLoader classLoader, boolean includeGlobal) {
"""
Returns an iterator of all of the registered {@code SaslServerFactory}s where the order is based on the
order of the Provider registration and/or class path order. Class path providers are liste... | java | public static Iterator<SaslServerFactory> getSaslServerFactories(ClassLoader classLoader, boolean includeGlobal) {
return getFactories(SaslServerFactory.class, classLoader, includeGlobal);
} | [
"public",
"static",
"Iterator",
"<",
"SaslServerFactory",
">",
"getSaslServerFactories",
"(",
"ClassLoader",
"classLoader",
",",
"boolean",
"includeGlobal",
")",
"{",
"return",
"getFactories",
"(",
"SaslServerFactory",
".",
"class",
",",
"classLoader",
",",
"includeGl... | Returns an iterator of all of the registered {@code SaslServerFactory}s where the order is based on the
order of the Provider registration and/or class path order. Class path providers are listed before
global providers; in the event of a name conflict, the class path provider is preferred.
@param classLoader the cla... | [
"Returns",
"an",
"iterator",
"of",
"all",
"of",
"the",
"registered",
"{",
"@code",
"SaslServerFactory",
"}",
"s",
"where",
"the",
"order",
"is",
"based",
"on",
"the",
"order",
"of",
"the",
"Provider",
"registration",
"and",
"/",
"or",
"class",
"path",
"ord... | train | https://github.com/infinispan/infinispan/blob/7c62b94886c3febb4774ae8376acf2baa0265ab5/commons/src/main/java/org/infinispan/commons/util/SaslUtils.java#L31-L33 |
groupon/odo | browsermob-proxy/src/main/java/com/groupon/odo/bmp/KeyStoreManager.java | KeyStoreManager.mapPublicKeys | public synchronized void mapPublicKeys(final PublicKey original, final PublicKey substitute) {
"""
Stores a public key mapping.
@param original
@param substitute
"""
_mappedPublicKeys.put(original, substitute);
if(persistImmediately) { persistPublicKeyMap(); }
} | java | public synchronized void mapPublicKeys(final PublicKey original, final PublicKey substitute)
{
_mappedPublicKeys.put(original, substitute);
if(persistImmediately) { persistPublicKeyMap(); }
} | [
"public",
"synchronized",
"void",
"mapPublicKeys",
"(",
"final",
"PublicKey",
"original",
",",
"final",
"PublicKey",
"substitute",
")",
"{",
"_mappedPublicKeys",
".",
"put",
"(",
"original",
",",
"substitute",
")",
";",
"if",
"(",
"persistImmediately",
")",
"{",... | Stores a public key mapping.
@param original
@param substitute | [
"Stores",
"a",
"public",
"key",
"mapping",
"."
] | train | https://github.com/groupon/odo/blob/3bae43d5eca8ace036775e5b2d3ed9af1a9ff9b1/browsermob-proxy/src/main/java/com/groupon/odo/bmp/KeyStoreManager.java#L935-L939 |
apache/groovy | src/main/java/org/codehaus/groovy/classgen/asm/BinaryIntExpressionHelper.java | BinaryIntExpressionHelper.writeStdCompare | protected boolean writeStdCompare(int type, boolean simulate) {
"""
writes a std compare. This involves the tokens IF_ICMPEQ, IF_ICMPNE,
IF_ICMPEQ, IF_ICMPNE, IF_ICMPGE, IF_ICMPGT, IF_ICMPLE and IF_ICMPLT
@param type the token type
@return true if a successful std compare write
"""
type = type-COMPA... | java | protected boolean writeStdCompare(int type, boolean simulate) {
type = type-COMPARE_NOT_EQUAL;
// look if really compare
if (type<0||type>7) return false;
if (!simulate) {
MethodVisitor mv = getController().getMethodVisitor();
OperandStack operandStack = getContr... | [
"protected",
"boolean",
"writeStdCompare",
"(",
"int",
"type",
",",
"boolean",
"simulate",
")",
"{",
"type",
"=",
"type",
"-",
"COMPARE_NOT_EQUAL",
";",
"// look if really compare",
"if",
"(",
"type",
"<",
"0",
"||",
"type",
">",
"7",
")",
"return",
"false",... | writes a std compare. This involves the tokens IF_ICMPEQ, IF_ICMPNE,
IF_ICMPEQ, IF_ICMPNE, IF_ICMPGE, IF_ICMPGT, IF_ICMPLE and IF_ICMPLT
@param type the token type
@return true if a successful std compare write | [
"writes",
"a",
"std",
"compare",
".",
"This",
"involves",
"the",
"tokens",
"IF_ICMPEQ",
"IF_ICMPNE",
"IF_ICMPEQ",
"IF_ICMPNE",
"IF_ICMPGE",
"IF_ICMPGT",
"IF_ICMPLE",
"and",
"IF_ICMPLT"
] | train | https://github.com/apache/groovy/blob/71cf20addb611bb8d097a59e395fd20bc7f31772/src/main/java/org/codehaus/groovy/classgen/asm/BinaryIntExpressionHelper.java#L145-L166 |
EasyinnovaSL/Tiff-Library-4J | src/main/java/com/easyinnova/tiff/profiles/BaselineProfile.java | BaselineProfile.CheckCMYK | private void CheckCMYK(IfdTags metadata, int n) {
"""
Check CMYK.
@param metadata the metadata
@param n the ifd number
"""
// Samples per pixel
if (!metadata.containsTagId(TiffTags.getTagId("SamplesPerPixel"))) {
validation.addErrorLoc("Missing Samples Per Pixel", "IFD" + n);
}
// Bi... | java | private void CheckCMYK(IfdTags metadata, int n) {
// Samples per pixel
if (!metadata.containsTagId(TiffTags.getTagId("SamplesPerPixel"))) {
validation.addErrorLoc("Missing Samples Per Pixel", "IFD" + n);
}
// BitsPerSample
if (!metadata.containsTagId(TiffTags.getTagId("BitsPerSample"))) {
... | [
"private",
"void",
"CheckCMYK",
"(",
"IfdTags",
"metadata",
",",
"int",
"n",
")",
"{",
"// Samples per pixel",
"if",
"(",
"!",
"metadata",
".",
"containsTagId",
"(",
"TiffTags",
".",
"getTagId",
"(",
"\"SamplesPerPixel\"",
")",
")",
")",
"{",
"validation",
"... | Check CMYK.
@param metadata the metadata
@param n the ifd number | [
"Check",
"CMYK",
"."
] | train | https://github.com/EasyinnovaSL/Tiff-Library-4J/blob/682605d3ed207a66213278c054c98f1b909472b7/src/main/java/com/easyinnova/tiff/profiles/BaselineProfile.java#L346-L356 |
authorjapps/zerocode | core/src/main/java/org/jsmart/zerocode/core/runner/ZeroCodePackageRunner.java | ZeroCodePackageRunner.describeChild | @Override
protected Description describeChild(ScenarioSpec child) {
"""
Returns a {@link Description} for {@code child}, which can be assumed to
be an element of the list returned by {@link ParentRunner#getChildren()}
@param child
"""
this.scenarioDescription = Description.createTestDescriptio... | java | @Override
protected Description describeChild(ScenarioSpec child) {
this.scenarioDescription = Description.createTestDescription(testClass, child.getScenarioName());
return scenarioDescription;
/*
* Commented for right click, fix and enable, Try with IntelliJ or Eclipse, see if it... | [
"@",
"Override",
"protected",
"Description",
"describeChild",
"(",
"ScenarioSpec",
"child",
")",
"{",
"this",
".",
"scenarioDescription",
"=",
"Description",
".",
"createTestDescription",
"(",
"testClass",
",",
"child",
".",
"getScenarioName",
"(",
")",
")",
";",
... | Returns a {@link Description} for {@code child}, which can be assumed to
be an element of the list returned by {@link ParentRunner#getChildren()}
@param child | [
"Returns",
"a",
"{",
"@link",
"Description",
"}",
"for",
"{",
"@code",
"child",
"}",
"which",
"can",
"be",
"assumed",
"to",
"be",
"an",
"element",
"of",
"the",
"list",
"returned",
"by",
"{",
"@link",
"ParentRunner#getChildren",
"()",
"}"
] | train | https://github.com/authorjapps/zerocode/blob/d66a3e8778d2eb5e4f0006bfcccfc0922ceb7cef/core/src/main/java/org/jsmart/zerocode/core/runner/ZeroCodePackageRunner.java#L113-L133 |
jhg023/SimpleNet | src/main/java/simplenet/packet/Packet.java | Packet.putString | public Packet putString(String s, Charset charset, ByteOrder order) {
"""
Writes a single {@link String} encoded with the specified {@link Charset} and {@link ByteOrder} to this
{@link Packet}'s payload.
<br><br>
A {@code short} is used to store the length of the {@link String} in the payload header, which impo... | java | public Packet putString(String s, Charset charset, ByteOrder order) {
var bytes = s.getBytes(charset);
putShort(bytes.length, order);
putBytes(bytes);
return this;
} | [
"public",
"Packet",
"putString",
"(",
"String",
"s",
",",
"Charset",
"charset",
",",
"ByteOrder",
"order",
")",
"{",
"var",
"bytes",
"=",
"s",
".",
"getBytes",
"(",
"charset",
")",
";",
"putShort",
"(",
"bytes",
".",
"length",
",",
"order",
")",
";",
... | Writes a single {@link String} encoded with the specified {@link Charset} and {@link ByteOrder} to this
{@link Packet}'s payload.
<br><br>
A {@code short} is used to store the length of the {@link String} in the payload header, which imposes a
maximum {@link String} length of {@code 65,535} with a {@link StandardCharse... | [
"Writes",
"a",
"single",
"{",
"@link",
"String",
"}",
"encoded",
"with",
"the",
"specified",
"{",
"@link",
"Charset",
"}",
"and",
"{",
"@link",
"ByteOrder",
"}",
"to",
"this",
"{",
"@link",
"Packet",
"}",
"s",
"payload",
".",
"<br",
">",
"<br",
">",
... | train | https://github.com/jhg023/SimpleNet/blob/a5b55cbfe1768c6a28874f12adac3c748f2b509a/src/main/java/simplenet/packet/Packet.java#L344-L349 |
googleapis/google-http-java-client | google-http-client/src/main/java/com/google/api/client/util/FieldInfo.java | FieldInfo.getFieldValue | public static Object getFieldValue(Field field, Object obj) {
"""
Returns the value of the given field in the given object using reflection.
"""
try {
return field.get(obj);
} catch (IllegalAccessException e) {
throw new IllegalArgumentException(e);
}
} | java | public static Object getFieldValue(Field field, Object obj) {
try {
return field.get(obj);
} catch (IllegalAccessException e) {
throw new IllegalArgumentException(e);
}
} | [
"public",
"static",
"Object",
"getFieldValue",
"(",
"Field",
"field",
",",
"Object",
"obj",
")",
"{",
"try",
"{",
"return",
"field",
".",
"get",
"(",
"obj",
")",
";",
"}",
"catch",
"(",
"IllegalAccessException",
"e",
")",
"{",
"throw",
"new",
"IllegalArg... | Returns the value of the given field in the given object using reflection. | [
"Returns",
"the",
"value",
"of",
"the",
"given",
"field",
"in",
"the",
"given",
"object",
"using",
"reflection",
"."
] | train | https://github.com/googleapis/google-http-java-client/blob/0988ae4e0f26a80f579b6adb2b276dd8254928de/google-http-client/src/main/java/com/google/api/client/util/FieldInfo.java#L246-L252 |
fabric8io/fabric8-forge | fabric8-forge-core/src/main/java/io/fabric8/forge/rest/main/RepositoryCache.java | RepositoryCache.getOrFindUserRepository | public RepositoryDTO getOrFindUserRepository(String user, String repositoryName, GitRepoClient repoClient) {
"""
Attempts to use the cache or performs a query for all the users repositories if its not present
"""
RepositoryDTO repository = getUserRepository(user, repositoryName);
if (repository... | java | public RepositoryDTO getOrFindUserRepository(String user, String repositoryName, GitRepoClient repoClient) {
RepositoryDTO repository = getUserRepository(user, repositoryName);
if (repository == null) {
List<RepositoryDTO> repositoryDTOs = repoClient.listRepositories();
updateUse... | [
"public",
"RepositoryDTO",
"getOrFindUserRepository",
"(",
"String",
"user",
",",
"String",
"repositoryName",
",",
"GitRepoClient",
"repoClient",
")",
"{",
"RepositoryDTO",
"repository",
"=",
"getUserRepository",
"(",
"user",
",",
"repositoryName",
")",
";",
"if",
"... | Attempts to use the cache or performs a query for all the users repositories if its not present | [
"Attempts",
"to",
"use",
"the",
"cache",
"or",
"performs",
"a",
"query",
"for",
"all",
"the",
"users",
"repositories",
"if",
"its",
"not",
"present"
] | train | https://github.com/fabric8io/fabric8-forge/blob/a59871bae4d5c5d3ece10f1e8758e73663087f19/fabric8-forge-core/src/main/java/io/fabric8/forge/rest/main/RepositoryCache.java#L53-L61 |
aws/aws-sdk-java | aws-java-sdk-medialive/src/main/java/com/amazonaws/services/medialive/model/StopChannelResult.java | StopChannelResult.withTags | public StopChannelResult withTags(java.util.Map<String, String> tags) {
"""
A collection of key-value pairs.
@param tags
A collection of key-value pairs.
@return Returns a reference to this object so that method calls can be chained together.
"""
setTags(tags);
return this;
} | java | public StopChannelResult withTags(java.util.Map<String, String> tags) {
setTags(tags);
return this;
} | [
"public",
"StopChannelResult",
"withTags",
"(",
"java",
".",
"util",
".",
"Map",
"<",
"String",
",",
"String",
">",
"tags",
")",
"{",
"setTags",
"(",
"tags",
")",
";",
"return",
"this",
";",
"}"
] | A collection of key-value pairs.
@param tags
A collection of key-value pairs.
@return Returns a reference to this object so that method calls can be chained together. | [
"A",
"collection",
"of",
"key",
"-",
"value",
"pairs",
"."
] | train | https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-medialive/src/main/java/com/amazonaws/services/medialive/model/StopChannelResult.java#L658-L661 |
comapi/comapi-chat-sdk-android | COMAPI/chat/src/main/java/com/comapi/chat/ComapiChatClient.java | ComapiChatClient.createProfileManager | public ProfileManager createProfileManager(@NonNull Context context) {
"""
Create ProfileManager to manage profile data.
@param context Application context.
@return ProfileManager to manage profile data.
"""
return new ProfileManager(context, client, new ObservableExecutor() {
@Overrid... | java | public ProfileManager createProfileManager(@NonNull Context context) {
return new ProfileManager(context, client, new ObservableExecutor() {
@Override
public <T> void execute(final Observable<T> obs) {
obs.subscribe(new Subscriber<T>() {
@Over... | [
"public",
"ProfileManager",
"createProfileManager",
"(",
"@",
"NonNull",
"Context",
"context",
")",
"{",
"return",
"new",
"ProfileManager",
"(",
"context",
",",
"client",
",",
"new",
"ObservableExecutor",
"(",
")",
"{",
"@",
"Override",
"public",
"<",
"T",
">"... | Create ProfileManager to manage profile data.
@param context Application context.
@return ProfileManager to manage profile data. | [
"Create",
"ProfileManager",
"to",
"manage",
"profile",
"data",
"."
] | train | https://github.com/comapi/comapi-chat-sdk-android/blob/388f37bfacb7793ce30c92ab70e5f32848bbe460/COMAPI/chat/src/main/java/com/comapi/chat/ComapiChatClient.java#L341-L364 |
jbundle/jbundle | thin/base/screen/grid/src/main/java/org/jbundle/thin/base/screen/grid/opt/JAltGridScreen.java | JAltGridScreen.init | public void init(Object parent, TableModel model) {
"""
Constructor.
@param parent Typically, you pass the BaseApplet as the parent.
@param record and the record or GridTableModel as the parent.
"""
super.init(parent, model);
this.setModel(model);
} | java | public void init(Object parent, TableModel model)
{
super.init(parent, model);
this.setModel(model);
} | [
"public",
"void",
"init",
"(",
"Object",
"parent",
",",
"TableModel",
"model",
")",
"{",
"super",
".",
"init",
"(",
"parent",
",",
"model",
")",
";",
"this",
".",
"setModel",
"(",
"model",
")",
";",
"}"
] | Constructor.
@param parent Typically, you pass the BaseApplet as the parent.
@param record and the record or GridTableModel as the parent. | [
"Constructor",
"."
] | train | https://github.com/jbundle/jbundle/blob/4037fcfa85f60c7d0096c453c1a3cd573c2b0abc/thin/base/screen/grid/src/main/java/org/jbundle/thin/base/screen/grid/opt/JAltGridScreen.java#L114-L118 |
unbescape/unbescape | src/main/java/org/unbescape/uri/UriEscape.java | UriEscape.unescapeUriQueryParam | public static void unescapeUriQueryParam(final String text, final Writer writer)
throws IOException {
"""
<p>
Perform am URI query parameter (name or value) <strong>unescape</strong> operation
on a <tt>String</tt> input using <tt>UTF-8</tt> as encoding, writing results to a <tt>Writer</tt>.
</p>
<p... | java | public static void unescapeUriQueryParam(final String text, final Writer writer)
throws IOException {
unescapeUriQueryParam(text, writer, DEFAULT_ENCODING);
} | [
"public",
"static",
"void",
"unescapeUriQueryParam",
"(",
"final",
"String",
"text",
",",
"final",
"Writer",
"writer",
")",
"throws",
"IOException",
"{",
"unescapeUriQueryParam",
"(",
"text",
",",
"writer",
",",
"DEFAULT_ENCODING",
")",
";",
"}"
] | <p>
Perform am URI query parameter (name or value) <strong>unescape</strong> operation
on a <tt>String</tt> input using <tt>UTF-8</tt> as encoding, writing results to a <tt>Writer</tt>.
</p>
<p>
This method will unescape every percent-encoded (<tt>%HH</tt>) sequences present in input,
even for those characters that do ... | [
"<p",
">",
"Perform",
"am",
"URI",
"query",
"parameter",
"(",
"name",
"or",
"value",
")",
"<strong",
">",
"unescape<",
"/",
"strong",
">",
"operation",
"on",
"a",
"<tt",
">",
"String<",
"/",
"tt",
">",
"input",
"using",
"<tt",
">",
"UTF",
"-",
"8<",
... | train | https://github.com/unbescape/unbescape/blob/ec5435fb3508c2eed25d8165dc27ded2602cae13/src/main/java/org/unbescape/uri/UriEscape.java#L1954-L1957 |
artikcloud/artikcloud-java | src/main/java/cloud/artik/api/WhitelistingApi.java | WhitelistingApi.getWhitelist | public WhitelistResultEnvelope getWhitelist(String dtid, Integer count, Integer offset) throws ApiException {
"""
Get whitelisted vdids of a device type.
Get whitelisted vdids of a device type.
@param dtid Device Type ID. (required)
@param count Max results count. (optional)
@param offset Result starting offse... | java | public WhitelistResultEnvelope getWhitelist(String dtid, Integer count, Integer offset) throws ApiException {
ApiResponse<WhitelistResultEnvelope> resp = getWhitelistWithHttpInfo(dtid, count, offset);
return resp.getData();
} | [
"public",
"WhitelistResultEnvelope",
"getWhitelist",
"(",
"String",
"dtid",
",",
"Integer",
"count",
",",
"Integer",
"offset",
")",
"throws",
"ApiException",
"{",
"ApiResponse",
"<",
"WhitelistResultEnvelope",
">",
"resp",
"=",
"getWhitelistWithHttpInfo",
"(",
"dtid",... | Get whitelisted vdids of a device type.
Get whitelisted vdids of a device type.
@param dtid Device Type ID. (required)
@param count Max results count. (optional)
@param offset Result starting offset. (optional)
@return WhitelistResultEnvelope
@throws ApiException If fail to call the API, e.g. server error or cannot des... | [
"Get",
"whitelisted",
"vdids",
"of",
"a",
"device",
"type",
".",
"Get",
"whitelisted",
"vdids",
"of",
"a",
"device",
"type",
"."
] | train | https://github.com/artikcloud/artikcloud-java/blob/412f447573e7796ab4f685c0bdd5eb76185a365c/src/main/java/cloud/artik/api/WhitelistingApi.java#L785-L788 |
beanshell/beanshell | src/main/java/bsh/NameSpace.java | NameSpace.getImportedMethod | protected BshMethod getImportedMethod(final String name, final Class<?>[] sig)
throws UtilEvalError {
"""
Gets the imported method.
@param name the name
@param sig the sig
@return the imported method
@throws UtilEvalError the util eval error
"""
// Try object imports
for (final ... | java | protected BshMethod getImportedMethod(final String name, final Class<?>[] sig)
throws UtilEvalError {
// Try object imports
for (final Object object : this.importedObjects) {
final Invocable method = Reflect.resolveJavaMethod(
object.getClass(), name, sig, fals... | [
"protected",
"BshMethod",
"getImportedMethod",
"(",
"final",
"String",
"name",
",",
"final",
"Class",
"<",
"?",
">",
"[",
"]",
"sig",
")",
"throws",
"UtilEvalError",
"{",
"// Try object imports",
"for",
"(",
"final",
"Object",
"object",
":",
"this",
".",
"im... | Gets the imported method.
@param name the name
@param sig the sig
@return the imported method
@throws UtilEvalError the util eval error | [
"Gets",
"the",
"imported",
"method",
"."
] | train | https://github.com/beanshell/beanshell/blob/fdddee3de948c9e6babb2d1337028f6fd0a2ba5c/src/main/java/bsh/NameSpace.java#L888-L905 |
webmetrics/browsermob-proxy | src/main/java/org/browsermob/proxy/jetty/util/LineInput.java | LineInput.readLine | public synchronized String readLine()
throws IOException {
"""
Read a line ended by CR, LF or CRLF.
The default or supplied encoding is used to convert bytes to
characters.
@return The line as a String or null for EOF.
@exception IOException
"""
int len=fillLine(_buf.length);
... | java | public synchronized String readLine()
throws IOException
{
int len=fillLine(_buf.length);
if (len<0)
return null;
String s=null;
if (_encoding==null)
s=new String(_buf,_mark,len);
else
{
try
{
... | [
"public",
"synchronized",
"String",
"readLine",
"(",
")",
"throws",
"IOException",
"{",
"int",
"len",
"=",
"fillLine",
"(",
"_buf",
".",
"length",
")",
";",
"if",
"(",
"len",
"<",
"0",
")",
"return",
"null",
";",
"String",
"s",
"=",
"null",
";",
"if"... | Read a line ended by CR, LF or CRLF.
The default or supplied encoding is used to convert bytes to
characters.
@return The line as a String or null for EOF.
@exception IOException | [
"Read",
"a",
"line",
"ended",
"by",
"CR",
"LF",
"or",
"CRLF",
".",
"The",
"default",
"or",
"supplied",
"encoding",
"is",
"used",
"to",
"convert",
"bytes",
"to",
"characters",
"."
] | train | https://github.com/webmetrics/browsermob-proxy/blob/a9252e62246ac33d55d51b993ba1159404e7d389/src/main/java/org/browsermob/proxy/jetty/util/LineInput.java#L180-L205 |
GenesysPureEngage/workspace-client-java | src/main/java/com/genesys/internal/workspace/api/StandardResponsesApi.java | StandardResponsesApi.renderStandardResponseFieldCodes | public ApiSuccessResponse renderStandardResponseFieldCodes(String id, RenderStandardResponseFieldCodesData renderStandardResponseFieldCodesData) throws ApiException {
"""
Replaces generic field codes of the Standard Response content with their actual values.
@param id id of the Standard Response (required)
@pa... | java | public ApiSuccessResponse renderStandardResponseFieldCodes(String id, RenderStandardResponseFieldCodesData renderStandardResponseFieldCodesData) throws ApiException {
ApiResponse<ApiSuccessResponse> resp = renderStandardResponseFieldCodesWithHttpInfo(id, renderStandardResponseFieldCodesData);
return res... | [
"public",
"ApiSuccessResponse",
"renderStandardResponseFieldCodes",
"(",
"String",
"id",
",",
"RenderStandardResponseFieldCodesData",
"renderStandardResponseFieldCodesData",
")",
"throws",
"ApiException",
"{",
"ApiResponse",
"<",
"ApiSuccessResponse",
">",
"resp",
"=",
"renderS... | Replaces generic field codes of the Standard Response content with their actual values.
@param id id of the Standard Response (required)
@param renderStandardResponseFieldCodesData (required)
@return ApiSuccessResponse
@throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response ... | [
"Replaces",
"generic",
"field",
"codes",
"of",
"the",
"Standard",
"Response",
"content",
"with",
"their",
"actual",
"values",
"."
] | train | https://github.com/GenesysPureEngage/workspace-client-java/blob/509fdd9e89b9359d012f9a72be95037a3cef53e6/src/main/java/com/genesys/internal/workspace/api/StandardResponsesApi.java#L1148-L1151 |
moparisthebest/beehive | beehive-controls/src/main/java/org/apache/beehive/controls/runtime/generator/AptMethod.java | AptMethod.getReturnType | public String getReturnType(HashMap<String,TypeMirror> bindingMap) {
"""
Returns the method return type, applying any formal type parameter bindings defined
by the provided map.
"""
if ( _methodDecl == null || _methodDecl.getReturnType() == null )
return "";
String returnT... | java | public String getReturnType(HashMap<String,TypeMirror> bindingMap)
{
if ( _methodDecl == null || _methodDecl.getReturnType() == null )
return "";
String returnType = _methodDecl.getReturnType().toString();
if (bindingMap != null && bindingMap.containsKey(returnType))
... | [
"public",
"String",
"getReturnType",
"(",
"HashMap",
"<",
"String",
",",
"TypeMirror",
">",
"bindingMap",
")",
"{",
"if",
"(",
"_methodDecl",
"==",
"null",
"||",
"_methodDecl",
".",
"getReturnType",
"(",
")",
"==",
"null",
")",
"return",
"\"\"",
";",
"Stri... | Returns the method return type, applying any formal type parameter bindings defined
by the provided map. | [
"Returns",
"the",
"method",
"return",
"type",
"applying",
"any",
"formal",
"type",
"parameter",
"bindings",
"defined",
"by",
"the",
"provided",
"map",
"."
] | train | https://github.com/moparisthebest/beehive/blob/4246a0cc40ce3c05f1a02c2da2653ac622703d77/beehive-controls/src/main/java/org/apache/beehive/controls/runtime/generator/AptMethod.java#L259-L269 |
joniles/mpxj | src/main/java/net/sf/mpxj/primavera/PrimaveraPMFileReader.java | PrimaveraPMFileReader.updateStructure | private int updateStructure(int id, Task task, Integer outlineLevel) {
"""
Iterates through the tasks setting the correct
outline level and ID values.
@param id current ID value
@param task current task
@param outlineLevel current outline level
@return next ID value
"""
task.setID(Integer.valueOf(... | java | private int updateStructure(int id, Task task, Integer outlineLevel)
{
task.setID(Integer.valueOf(id++));
task.setOutlineLevel(outlineLevel);
outlineLevel = Integer.valueOf(outlineLevel.intValue() + 1);
for (Task childTask : task.getChildTasks())
{
id = updateStructure(id, chil... | [
"private",
"int",
"updateStructure",
"(",
"int",
"id",
",",
"Task",
"task",
",",
"Integer",
"outlineLevel",
")",
"{",
"task",
".",
"setID",
"(",
"Integer",
".",
"valueOf",
"(",
"id",
"++",
")",
")",
";",
"task",
".",
"setOutlineLevel",
"(",
"outlineLevel... | Iterates through the tasks setting the correct
outline level and ID values.
@param id current ID value
@param task current task
@param outlineLevel current outline level
@return next ID value | [
"Iterates",
"through",
"the",
"tasks",
"setting",
"the",
"correct",
"outline",
"level",
"and",
"ID",
"values",
"."
] | train | https://github.com/joniles/mpxj/blob/143ea0e195da59cd108f13b3b06328e9542337e8/src/main/java/net/sf/mpxj/primavera/PrimaveraPMFileReader.java#L909-L919 |
apache/incubator-gobblin | gobblin-data-management/src/main/java/org/apache/gobblin/data/management/copy/hive/HiveTargetPathHelper.java | HiveTargetPathHelper.getTargetPath | public Path getTargetPath(Path sourcePath, FileSystem targetFs, Optional<Partition> partition, boolean isConcreteFile) {
"""
Compute the target {@link Path} for a file or directory copied by Hive distcp.
<p>
The target locations of data files for this table depend on the values of the resolved table root (e.g.... | java | public Path getTargetPath(Path sourcePath, FileSystem targetFs, Optional<Partition> partition, boolean isConcreteFile) {
if (this.relocateDataFiles) {
Preconditions.checkArgument(this.targetTableRoot.isPresent(), "Must define %s to relocate data files.",
COPY_TARGET_TABLE_ROOT);
Path path = th... | [
"public",
"Path",
"getTargetPath",
"(",
"Path",
"sourcePath",
",",
"FileSystem",
"targetFs",
",",
"Optional",
"<",
"Partition",
">",
"partition",
",",
"boolean",
"isConcreteFile",
")",
"{",
"if",
"(",
"this",
".",
"relocateDataFiles",
")",
"{",
"Preconditions",
... | Compute the target {@link Path} for a file or directory copied by Hive distcp.
<p>
The target locations of data files for this table depend on the values of the resolved table root (e.g.
the value of {@link #COPY_TARGET_TABLE_ROOT} with tokens replaced) and {@link #RELOCATE_DATA_FILES_KEY}:
* if {@link #RELOCATE_DATA_... | [
"Compute",
"the",
"target",
"{",
"@link",
"Path",
"}",
"for",
"a",
"file",
"or",
"directory",
"copied",
"by",
"Hive",
"distcp",
"."
] | train | https://github.com/apache/incubator-gobblin/blob/f029b4c0fea0fe4aa62f36dda2512344ff708bae/gobblin-data-management/src/main/java/org/apache/gobblin/data/management/copy/hive/HiveTargetPathHelper.java#L144-L187 |
shekhargulati/strman-java | src/main/java/strman/Strman.java | Strman.lastIndexOf | public static int lastIndexOf(final String value, final String needle) {
"""
This method returns the index within the calling String object of the last occurrence of the specified value, searching backwards from the offset.
Returns -1 if the value is not found. The search starts from the end and case sensitive.
... | java | public static int lastIndexOf(final String value, final String needle) {
validate(value, NULL_STRING_PREDICATE, NULL_STRING_MSG_SUPPLIER);
return lastIndexOf(value, needle, value.length(), true);
} | [
"public",
"static",
"int",
"lastIndexOf",
"(",
"final",
"String",
"value",
",",
"final",
"String",
"needle",
")",
"{",
"validate",
"(",
"value",
",",
"NULL_STRING_PREDICATE",
",",
"NULL_STRING_MSG_SUPPLIER",
")",
";",
"return",
"lastIndexOf",
"(",
"value",
",",
... | This method returns the index within the calling String object of the last occurrence of the specified value, searching backwards from the offset.
Returns -1 if the value is not found. The search starts from the end and case sensitive.
@param value The input String
@param needle The search String
@return Return posit... | [
"This",
"method",
"returns",
"the",
"index",
"within",
"the",
"calling",
"String",
"object",
"of",
"the",
"last",
"occurrence",
"of",
"the",
"specified",
"value",
"searching",
"backwards",
"from",
"the",
"offset",
".",
"Returns",
"-",
"1",
"if",
"the",
"valu... | train | https://github.com/shekhargulati/strman-java/blob/d0c2a10a6273fd6082f084e95156653ca55ce1be/src/main/java/strman/Strman.java#L614-L617 |
javamelody/javamelody | javamelody-swing/src/main/java/net/bull/javamelody/swing/table/MDefaultTableCellRenderer.java | MDefaultTableCellRenderer.adjustRowHeight | protected void adjustRowHeight(final JTable table, final Component component, final int row) {
"""
Ajustement de la hauteur de cette ligne en fonction de la taille du renderer (ex: la taille d'une icône ou d'un label html).
@param table
JTable
@param component
Component
@param row
int
"""
// Ajustem... | java | protected void adjustRowHeight(final JTable table, final Component component, final int row) {
// Ajustement de la hauteur de cette ligne en fonction de la taille du renderer
final int cellHeight = table.getRowHeight(row);
final int rendererHeight = component.getPreferredSize().height;
if (cellHeight < rend... | [
"protected",
"void",
"adjustRowHeight",
"(",
"final",
"JTable",
"table",
",",
"final",
"Component",
"component",
",",
"final",
"int",
"row",
")",
"{",
"// Ajustement de la hauteur de cette ligne en fonction de la taille du renderer\r",
"final",
"int",
"cellHeight",
"=",
"... | Ajustement de la hauteur de cette ligne en fonction de la taille du renderer (ex: la taille d'une icône ou d'un label html).
@param table
JTable
@param component
Component
@param row
int | [
"Ajustement",
"de",
"la",
"hauteur",
"de",
"cette",
"ligne",
"en",
"fonction",
"de",
"la",
"taille",
"du",
"renderer",
"(",
"ex",
":",
"la",
"taille",
"d",
"une",
"icône",
"ou",
"d",
"un",
"label",
"html",
")",
"."
] | train | https://github.com/javamelody/javamelody/blob/18ad583ddeb5dcadd797dfda295409c6983ffd71/javamelody-swing/src/main/java/net/bull/javamelody/swing/table/MDefaultTableCellRenderer.java#L44-L51 |
UrielCh/ovh-java-sdk | ovh-java-sdk-order/src/main/java/net/minidev/ovh/api/ApiOvhOrder.java | ApiOvhOrder.email_exchange_organizationName_service_exchangeService_upgrade_GET | public OvhOrder email_exchange_organizationName_service_exchangeService_upgrade_GET(String organizationName, String exchangeService) throws IOException {
"""
Get prices and contracts information
REST: GET /order/email/exchange/{organizationName}/service/{exchangeService}/upgrade
@param organizationName [requir... | java | public OvhOrder email_exchange_organizationName_service_exchangeService_upgrade_GET(String organizationName, String exchangeService) throws IOException {
String qPath = "/order/email/exchange/{organizationName}/service/{exchangeService}/upgrade";
StringBuilder sb = path(qPath, organizationName, exchangeService);
... | [
"public",
"OvhOrder",
"email_exchange_organizationName_service_exchangeService_upgrade_GET",
"(",
"String",
"organizationName",
",",
"String",
"exchangeService",
")",
"throws",
"IOException",
"{",
"String",
"qPath",
"=",
"\"/order/email/exchange/{organizationName}/service/{exchangeSe... | Get prices and contracts information
REST: GET /order/email/exchange/{organizationName}/service/{exchangeService}/upgrade
@param organizationName [required] The internal name of your exchange organization
@param exchangeService [required] The internal name of your exchange service | [
"Get",
"prices",
"and",
"contracts",
"information"
] | train | https://github.com/UrielCh/ovh-java-sdk/blob/6d531a40e56e09701943e334c25f90f640c55701/ovh-java-sdk-order/src/main/java/net/minidev/ovh/api/ApiOvhOrder.java#L3773-L3778 |
jnr/jnr-x86asm | src/main/java/jnr/x86asm/SerializerIntrinsics.java | SerializerIntrinsics.pcmpistrm | public final void pcmpistrm(XMMRegister dst, XMMRegister src, Immediate imm8) {
"""
Packed Compare Implicit Length Strings, Return Mask (SSE4.2).
"""
emitX86(INST_PCMPISTRM, dst, src, imm8);
} | java | public final void pcmpistrm(XMMRegister dst, XMMRegister src, Immediate imm8)
{
emitX86(INST_PCMPISTRM, dst, src, imm8);
} | [
"public",
"final",
"void",
"pcmpistrm",
"(",
"XMMRegister",
"dst",
",",
"XMMRegister",
"src",
",",
"Immediate",
"imm8",
")",
"{",
"emitX86",
"(",
"INST_PCMPISTRM",
",",
"dst",
",",
"src",
",",
"imm8",
")",
";",
"}"
] | Packed Compare Implicit Length Strings, Return Mask (SSE4.2). | [
"Packed",
"Compare",
"Implicit",
"Length",
"Strings",
"Return",
"Mask",
"(",
"SSE4",
".",
"2",
")",
"."
] | train | https://github.com/jnr/jnr-x86asm/blob/fdcf68fb3dae49e607a49e33399e3dad1ada5536/src/main/java/jnr/x86asm/SerializerIntrinsics.java#L6562-L6565 |
OpenLiberty/open-liberty | dev/com.ibm.ws.transport.http/src/com/ibm/ws/http/channel/internal/inbound/HttpInboundServiceContextImpl.java | HttpInboundServiceContextImpl.skipWhiteSpace | private int skipWhiteSpace(byte[] data, int start) {
"""
Skip whitespace found in the input data starting at the given index. It
will return an index value that points to the first non-space byte found
or end of data if it ran out.
@param data
@param start
@return int
"""
int index = start;
... | java | private int skipWhiteSpace(byte[] data, int start) {
int index = start;
while (index < data.length && (' ' == data[index] || '\t' == data[index])) {
index++;
}
return index;
} | [
"private",
"int",
"skipWhiteSpace",
"(",
"byte",
"[",
"]",
"data",
",",
"int",
"start",
")",
"{",
"int",
"index",
"=",
"start",
";",
"while",
"(",
"index",
"<",
"data",
".",
"length",
"&&",
"(",
"'",
"'",
"==",
"data",
"[",
"index",
"]",
"||",
"'... | Skip whitespace found in the input data starting at the given index. It
will return an index value that points to the first non-space byte found
or end of data if it ran out.
@param data
@param start
@return int | [
"Skip",
"whitespace",
"found",
"in",
"the",
"input",
"data",
"starting",
"at",
"the",
"given",
"index",
".",
"It",
"will",
"return",
"an",
"index",
"value",
"that",
"points",
"to",
"the",
"first",
"non",
"-",
"space",
"byte",
"found",
"or",
"end",
"of",
... | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.transport.http/src/com/ibm/ws/http/channel/internal/inbound/HttpInboundServiceContextImpl.java#L242-L248 |
sshtools/j2ssh-maverick | j2ssh-maverick/src/main/java/com/sshtools/ssh2/Ssh2Channel.java | Ssh2Channel.sendRequest | public boolean sendRequest(String requesttype, boolean wantreply,
byte[] requestdata, boolean isActivity) throws SshException {
"""
Sends a channel request. Many channels have extensions that are specific
to that particular channel type, an example of which is requesting a
pseudo terminal from an interactive ... | java | public boolean sendRequest(String requesttype, boolean wantreply,
byte[] requestdata, boolean isActivity) throws SshException {
synchronized (this) {
ByteArrayWriter msg = new ByteArrayWriter();
try {
msg.write(SSH_MSG_CHANNEL_REQUEST);
msg.writeInt(remoteid);
msg.writeString(requesttype);
m... | [
"public",
"boolean",
"sendRequest",
"(",
"String",
"requesttype",
",",
"boolean",
"wantreply",
",",
"byte",
"[",
"]",
"requestdata",
",",
"boolean",
"isActivity",
")",
"throws",
"SshException",
"{",
"synchronized",
"(",
"this",
")",
"{",
"ByteArrayWriter",
"msg"... | Sends a channel request. Many channels have extensions that are specific
to that particular channel type, an example of which is requesting a
pseudo terminal from an interactive session.
@param requesttype
the name of the request, for example "pty-req"
@param wantreply
specifies whether the remote side should send a
s... | [
"Sends",
"a",
"channel",
"request",
".",
"Many",
"channels",
"have",
"extensions",
"that",
"are",
"specific",
"to",
"that",
"particular",
"channel",
"type",
"an",
"example",
"of",
"which",
"is",
"requesting",
"a",
"pseudo",
"terminal",
"from",
"an",
"interacti... | train | https://github.com/sshtools/j2ssh-maverick/blob/ce11ceaf0aa0b129b54327a6891973e1e34689f7/j2ssh-maverick/src/main/java/com/sshtools/ssh2/Ssh2Channel.java#L767-L809 |
google/error-prone-javac | src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/HtmlDocletWriter.java | HtmlDocletWriter.pathString | protected DocPath pathString(PackageElement packageElement, DocPath name) {
"""
Return path to the given file name in the given package. So if the name
passed is "Object.html" and the name of the package is "java.lang", and
if the relative path is "../.." then returned string will be
"../../java/lang/Object.htm... | java | protected DocPath pathString(PackageElement packageElement, DocPath name) {
return pathToRoot.resolve(DocPath.forPackage(packageElement).resolve(name));
} | [
"protected",
"DocPath",
"pathString",
"(",
"PackageElement",
"packageElement",
",",
"DocPath",
"name",
")",
"{",
"return",
"pathToRoot",
".",
"resolve",
"(",
"DocPath",
".",
"forPackage",
"(",
"packageElement",
")",
".",
"resolve",
"(",
"name",
")",
")",
";",
... | Return path to the given file name in the given package. So if the name
passed is "Object.html" and the name of the package is "java.lang", and
if the relative path is "../.." then returned string will be
"../../java/lang/Object.html"
@param packageElement Package in which the file name is assumed to be.
@param name F... | [
"Return",
"path",
"to",
"the",
"given",
"file",
"name",
"in",
"the",
"given",
"package",
".",
"So",
"if",
"the",
"name",
"passed",
"is",
"Object",
".",
"html",
"and",
"the",
"name",
"of",
"the",
"package",
"is",
"java",
".",
"lang",
"and",
"if",
"the... | train | https://github.com/google/error-prone-javac/blob/a53d069bbdb2c60232ed3811c19b65e41c3e60e0/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/HtmlDocletWriter.java#L1074-L1076 |
seedstack/seed | specs/src/main/java/org/seedstack/seed/ClassConfiguration.java | ClassConfiguration.getOrDefault | public String getOrDefault(String key, String defaultValue) {
"""
Returns the value of a particular key (or the default value of the key doesn't exist).
@param key the key to retrieve the value of.
@param defaultValue the default value.
@return the value or the default value.
"""
return m... | java | public String getOrDefault(String key, String defaultValue) {
return map.getOrDefault(key, defaultValue);
} | [
"public",
"String",
"getOrDefault",
"(",
"String",
"key",
",",
"String",
"defaultValue",
")",
"{",
"return",
"map",
".",
"getOrDefault",
"(",
"key",
",",
"defaultValue",
")",
";",
"}"
] | Returns the value of a particular key (or the default value of the key doesn't exist).
@param key the key to retrieve the value of.
@param defaultValue the default value.
@return the value or the default value. | [
"Returns",
"the",
"value",
"of",
"a",
"particular",
"key",
"(",
"or",
"the",
"default",
"value",
"of",
"the",
"key",
"doesn",
"t",
"exist",
")",
"."
] | train | https://github.com/seedstack/seed/blob/d9cf33bfb2fffcdbb0976f4726e943acda90e828/specs/src/main/java/org/seedstack/seed/ClassConfiguration.java#L144-L146 |
PeterisP/LVTagger | src/main/java/edu/stanford/nlp/process/WordShapeClassifier.java | WordShapeClassifier.wordShapeChris2 | private static String wordShapeChris2(String s, boolean omitIfInBoundary, Collection<String> knownLCWords) {
"""
This one picks up on Dan2 ideas, but seeks to make less distinctions
mid sequence by sorting for long words, but to maintain extra
distinctions for short words. It exactly preserves the character shap... | java | private static String wordShapeChris2(String s, boolean omitIfInBoundary, Collection<String> knownLCWords) {
int len = s.length();
if (len <= BOUNDARY_SIZE * 2) {
return wordShapeChris2Short(s, len, knownLCWords);
} else {
return wordShapeChris2Long(s, omitIfInBoundary, len, knownLCWords);
... | [
"private",
"static",
"String",
"wordShapeChris2",
"(",
"String",
"s",
",",
"boolean",
"omitIfInBoundary",
",",
"Collection",
"<",
"String",
">",
"knownLCWords",
")",
"{",
"int",
"len",
"=",
"s",
".",
"length",
"(",
")",
";",
"if",
"(",
"len",
"<=",
"BOUN... | This one picks up on Dan2 ideas, but seeks to make less distinctions
mid sequence by sorting for long words, but to maintain extra
distinctions for short words. It exactly preserves the character shape
of the first and last 2 (i.e., BOUNDARY_SIZE) characters and then
will record shapes that occur between them (perhaps ... | [
"This",
"one",
"picks",
"up",
"on",
"Dan2",
"ideas",
"but",
"seeks",
"to",
"make",
"less",
"distinctions",
"mid",
"sequence",
"by",
"sorting",
"for",
"long",
"words",
"but",
"to",
"maintain",
"extra",
"distinctions",
"for",
"short",
"words",
".",
"It",
"ex... | train | https://github.com/PeterisP/LVTagger/blob/b3d44bab9ec07ace0d13612c448a6b7298c1f681/src/main/java/edu/stanford/nlp/process/WordShapeClassifier.java#L343-L350 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.