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 |
|---|---|---|---|---|---|---|---|---|---|---|
UrielCh/ovh-java-sdk | ovh-java-sdk-order/src/main/java/net/minidev/ovh/api/ApiOvhOrder.java | ApiOvhOrder.telephony_spare_new_GET | public OvhOrder telephony_spare_new_GET(String brand, String mondialRelayId, Long quantity, Long shippingContactId) throws IOException {
"""
Get prices and contracts information
REST: GET /order/telephony/spare/new
@param shippingContactId [required] Shipping contact information id from /me entry point
@param... | java | public OvhOrder telephony_spare_new_GET(String brand, String mondialRelayId, Long quantity, Long shippingContactId) throws IOException {
String qPath = "/order/telephony/spare/new";
StringBuilder sb = path(qPath);
query(sb, "brand", brand);
query(sb, "mondialRelayId", mondialRelayId);
query(sb, "quantity", qu... | [
"public",
"OvhOrder",
"telephony_spare_new_GET",
"(",
"String",
"brand",
",",
"String",
"mondialRelayId",
",",
"Long",
"quantity",
",",
"Long",
"shippingContactId",
")",
"throws",
"IOException",
"{",
"String",
"qPath",
"=",
"\"/order/telephony/spare/new\"",
";",
"Stri... | Get prices and contracts information
REST: GET /order/telephony/spare/new
@param shippingContactId [required] Shipping contact information id from /me entry point
@param brand [required] Spare phone brand model
@param mondialRelayId [required] Use /supply/mondialRelay entry point to specify a relay point and ignore sh... | [
"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#L6064-L6073 |
apache/flink | flink-runtime/src/main/java/org/apache/flink/runtime/operators/DataSinkTask.java | DataSinkTask.initInputReaders | @SuppressWarnings("unchecked")
private void initInputReaders() throws Exception {
"""
Initializes the input readers of the DataSinkTask.
@throws RuntimeException
Thrown in case of invalid task input configuration.
"""
int numGates = 0;
// ---------------- create the input readers --------------------... | java | @SuppressWarnings("unchecked")
private void initInputReaders() throws Exception {
int numGates = 0;
// ---------------- create the input readers ---------------------
// in case where a logical input unions multiple physical inputs, create a union reader
final int groupSize = this.config.getGroupSize(0);
nu... | [
"@",
"SuppressWarnings",
"(",
"\"unchecked\"",
")",
"private",
"void",
"initInputReaders",
"(",
")",
"throws",
"Exception",
"{",
"int",
"numGates",
"=",
"0",
";",
"// ---------------- create the input readers ---------------------",
"// in case where a logical input unions mul... | Initializes the input readers of the DataSinkTask.
@throws RuntimeException
Thrown in case of invalid task input configuration. | [
"Initializes",
"the",
"input",
"readers",
"of",
"the",
"DataSinkTask",
"."
] | train | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-runtime/src/main/java/org/apache/flink/runtime/operators/DataSinkTask.java#L360-L390 |
apache/reef | lang/java/reef-applications/reef-vortex/src/main/java/org/apache/reef/vortex/driver/RunningWorkers.java | RunningWorkers.cancelTasklet | void cancelTasklet(final boolean mayInterruptIfRunning, final int taskletId) {
"""
Concurrency: Called by multiple threads.
Parameter: Same taskletId can come in multiple times.
"""
lock.lock();
try {
// This is not ideal since we are using a linear time search on all the workers.
final St... | java | void cancelTasklet(final boolean mayInterruptIfRunning, final int taskletId) {
lock.lock();
try {
// This is not ideal since we are using a linear time search on all the workers.
final String workerId = getWhereTaskletWasScheduledTo(taskletId);
if (workerId == null) {
// launchTasklet ... | [
"void",
"cancelTasklet",
"(",
"final",
"boolean",
"mayInterruptIfRunning",
",",
"final",
"int",
"taskletId",
")",
"{",
"lock",
".",
"lock",
"(",
")",
";",
"try",
"{",
"// This is not ideal since we are using a linear time search on all the workers.",
"final",
"String",
... | Concurrency: Called by multiple threads.
Parameter: Same taskletId can come in multiple times. | [
"Concurrency",
":",
"Called",
"by",
"multiple",
"threads",
".",
"Parameter",
":",
"Same",
"taskletId",
"can",
"come",
"in",
"multiple",
"times",
"."
] | train | https://github.com/apache/reef/blob/e2c47121cde21108a602c560cf76565a40d0e916/lang/java/reef-applications/reef-vortex/src/main/java/org/apache/reef/vortex/driver/RunningWorkers.java#L186-L204 |
j-a-w-r/jawr-main-repo | jawr/jawr-core/src/main/java/net/jawr/web/resource/bundle/generator/variant/css/CssSkinGenerator.java | CssSkinGenerator.updateLocaleVariants | private void updateLocaleVariants(ResourceBrowser rsBrowser, String path, Set<String> localeVariants) {
"""
Update the locale variants from the directory path given in parameter
@param rsBrowser
the resource browser
@param path
the skin path
@param localeVariants
the set of locale variants to update
""... | java | private void updateLocaleVariants(ResourceBrowser rsBrowser, String path, Set<String> localeVariants) {
Set<String> skinPaths = rsBrowser.getResourceNames(path);
for (Iterator<String> itSkinPath = skinPaths.iterator(); itSkinPath.hasNext();) {
String skinPath = path + itSkinPath.next();
if (rsBrowser.isDirec... | [
"private",
"void",
"updateLocaleVariants",
"(",
"ResourceBrowser",
"rsBrowser",
",",
"String",
"path",
",",
"Set",
"<",
"String",
">",
"localeVariants",
")",
"{",
"Set",
"<",
"String",
">",
"skinPaths",
"=",
"rsBrowser",
".",
"getResourceNames",
"(",
"path",
"... | Update the locale variants from the directory path given in parameter
@param rsBrowser
the resource browser
@param path
the skin path
@param localeVariants
the set of locale variants to update | [
"Update",
"the",
"locale",
"variants",
"from",
"the",
"directory",
"path",
"given",
"in",
"parameter"
] | train | https://github.com/j-a-w-r/jawr-main-repo/blob/5381f6acf461cd2502593c67a77bd6ef9eab848d/jawr/jawr-core/src/main/java/net/jawr/web/resource/bundle/generator/variant/css/CssSkinGenerator.java#L573-L585 |
Waikato/moa | moa/src/main/java/moa/core/Utils.java | Utils.roundDouble | public static /*@pure@*/ double roundDouble(double value,int afterDecimalPoint) {
"""
Rounds a double to the given number of decimal places.
@param value the double value
@param afterDecimalPoint the number of digits after the decimal point
@return the double rounded to the given precision
"""
double... | java | public static /*@pure@*/ double roundDouble(double value,int afterDecimalPoint) {
double mask = Math.pow(10.0, (double)afterDecimalPoint);
return (double)(Math.round(value * mask)) / mask;
} | [
"public",
"static",
"/*@pure@*/",
"double",
"roundDouble",
"(",
"double",
"value",
",",
"int",
"afterDecimalPoint",
")",
"{",
"double",
"mask",
"=",
"Math",
".",
"pow",
"(",
"10.0",
",",
"(",
"double",
")",
"afterDecimalPoint",
")",
";",
"return",
"(",
"do... | Rounds a double to the given number of decimal places.
@param value the double value
@param afterDecimalPoint the number of digits after the decimal point
@return the double rounded to the given precision | [
"Rounds",
"a",
"double",
"to",
"the",
"given",
"number",
"of",
"decimal",
"places",
"."
] | train | https://github.com/Waikato/moa/blob/395982e5100bfe75a3a4d26115462ce2cc74cbb0/moa/src/main/java/moa/core/Utils.java#L1307-L1312 |
mozilla/rhino | src/org/mozilla/javascript/Parser.java | Parser.createDestructuringAssignment | Node createDestructuringAssignment(int type, Node left, Node right) {
"""
Given a destructuring assignment with a left hand side parsed
as an array or object literal and a right hand side expression,
rewrite as a series of assignments to the variables defined in
left from property accesses to the expression on ... | java | Node createDestructuringAssignment(int type, Node left, Node right)
{
String tempName = currentScriptOrFn.getNextTempName();
Node result = destructuringAssignmentHelper(type, left, right,
tempName);
Node comma = result.getLastChild();
comma.addChildToBack(createName(tempN... | [
"Node",
"createDestructuringAssignment",
"(",
"int",
"type",
",",
"Node",
"left",
",",
"Node",
"right",
")",
"{",
"String",
"tempName",
"=",
"currentScriptOrFn",
".",
"getNextTempName",
"(",
")",
";",
"Node",
"result",
"=",
"destructuringAssignmentHelper",
"(",
... | Given a destructuring assignment with a left hand side parsed
as an array or object literal and a right hand side expression,
rewrite as a series of assignments to the variables defined in
left from property accesses to the expression on the right.
@param type declaration type: Token.VAR or Token.LET or -1
@param left ... | [
"Given",
"a",
"destructuring",
"assignment",
"with",
"a",
"left",
"hand",
"side",
"parsed",
"as",
"an",
"array",
"or",
"object",
"literal",
"and",
"a",
"right",
"hand",
"side",
"expression",
"rewrite",
"as",
"a",
"series",
"of",
"assignments",
"to",
"the",
... | train | https://github.com/mozilla/rhino/blob/fa8a86df11d37623f5faa8d445a5876612bc47b0/src/org/mozilla/javascript/Parser.java#L3996-L4004 |
apache/incubator-gobblin | gobblin-modules/gobblin-sql/src/main/java/org/apache/gobblin/source/jdbc/SqlQueryUtils.java | SqlQueryUtils.addPredicate | public static String addPredicate(String query, String predicateCond) {
"""
Add a new predicate(filter condition) to the query. The method will add a "where" clause if
none exists. Otherwise, it will add the condition as a conjunction (and).
<b>Note that this method is rather limited. It works only if there ar... | java | public static String addPredicate(String query, String predicateCond) {
if (Strings.isNullOrEmpty(predicateCond)) {
return query;
}
String normalizedQuery = query.toLowerCase().trim();
checkArgument(normalizedQuery.contains(" from "),
"query does not contain 'from': " + query);
... | [
"public",
"static",
"String",
"addPredicate",
"(",
"String",
"query",
",",
"String",
"predicateCond",
")",
"{",
"if",
"(",
"Strings",
".",
"isNullOrEmpty",
"(",
"predicateCond",
")",
")",
"{",
"return",
"query",
";",
"}",
"String",
"normalizedQuery",
"=",
"q... | Add a new predicate(filter condition) to the query. The method will add a "where" clause if
none exists. Otherwise, it will add the condition as a conjunction (and).
<b>Note that this method is rather limited. It works only if there are no other clauses after
"where"</b>
@param query the query string to mod... | [
"Add",
"a",
"new",
"predicate",
"(",
"filter",
"condition",
")",
"to",
"the",
"query",
".",
"The",
"method",
"will",
"add",
"a",
"where",
"clause",
"if",
"none",
"exists",
".",
"Otherwise",
"it",
"will",
"add",
"the",
"condition",
"as",
"a",
"conjunction... | train | https://github.com/apache/incubator-gobblin/blob/f029b4c0fea0fe4aa62f36dda2512344ff708bae/gobblin-modules/gobblin-sql/src/main/java/org/apache/gobblin/source/jdbc/SqlQueryUtils.java#L43-L63 |
exoplatform/jcr | exo.jcr.component.webdav/src/main/java/org/exoplatform/services/jcr/webdav/command/deltav/ReportCommand.java | ReportCommand.getProperties | protected Set<QName> getProperties(HierarchicalProperty body) {
"""
Returns the list of properties.
@param body request body
@return the list of properties
"""
HashSet<QName> properties = new HashSet<QName>();
HierarchicalProperty prop = body.getChild(new QName("DAV:", "prop"));
if (... | java | protected Set<QName> getProperties(HierarchicalProperty body)
{
HashSet<QName> properties = new HashSet<QName>();
HierarchicalProperty prop = body.getChild(new QName("DAV:", "prop"));
if (prop == null)
{
return properties;
}
for (int i = 0; i < prop.getChildre... | [
"protected",
"Set",
"<",
"QName",
">",
"getProperties",
"(",
"HierarchicalProperty",
"body",
")",
"{",
"HashSet",
"<",
"QName",
">",
"properties",
"=",
"new",
"HashSet",
"<",
"QName",
">",
"(",
")",
";",
"HierarchicalProperty",
"prop",
"=",
"body",
".",
"g... | Returns the list of properties.
@param body request body
@return the list of properties | [
"Returns",
"the",
"list",
"of",
"properties",
"."
] | train | https://github.com/exoplatform/jcr/blob/3e7f9ee1b5683640d73a4316fb4b0ad5eac5b8a2/exo.jcr.component.webdav/src/main/java/org/exoplatform/services/jcr/webdav/command/deltav/ReportCommand.java#L123-L140 |
nyla-solutions/nyla | nyla.solutions.core/src/main/java/nyla/solutions/core/util/Debugger.java | Debugger.printInfo | public static void printInfo(Object caller, Object message) {
"""
Print an INFO message
@param caller the calling object
@param message the INFO message
"""
StringBuilder text = new StringBuilder();
Class<?> c = callerBuilder(caller, text);
if(message instanceof Throwable)
getLog(c).info... | java | public static void printInfo(Object caller, Object message)
{
StringBuilder text = new StringBuilder();
Class<?> c = callerBuilder(caller, text);
if(message instanceof Throwable)
getLog(c).info(text.append(stackTrace((Throwable)message)));
else
getLog(c).info(text.append(message));
} | [
"public",
"static",
"void",
"printInfo",
"(",
"Object",
"caller",
",",
"Object",
"message",
")",
"{",
"StringBuilder",
"text",
"=",
"new",
"StringBuilder",
"(",
")",
";",
"Class",
"<",
"?",
">",
"c",
"=",
"callerBuilder",
"(",
"caller",
",",
"text",
")",... | Print an INFO message
@param caller the calling object
@param message the INFO message | [
"Print",
"an",
"INFO",
"message"
] | train | https://github.com/nyla-solutions/nyla/blob/38d5b843c76eae9762bbca20453ed0f0ad8412a9/nyla.solutions.core/src/main/java/nyla/solutions/core/util/Debugger.java#L492-L504 |
google/error-prone | check_api/src/main/java/com/google/errorprone/fixes/SuggestedFixes.java | SuggestedFixes.addSuppressWarnings | @Nullable
public static Fix addSuppressWarnings(VisitorState state, String warningToSuppress) {
"""
Returns a fix that adds a {@code @SuppressWarnings(warningToSuppress)} to the closest
suppressible element to the node pointed at by {@code state.getPath()}.
@see #addSuppressWarnings(VisitorState, String, Str... | java | @Nullable
public static Fix addSuppressWarnings(VisitorState state, String warningToSuppress) {
return addSuppressWarnings(state, warningToSuppress, null);
} | [
"@",
"Nullable",
"public",
"static",
"Fix",
"addSuppressWarnings",
"(",
"VisitorState",
"state",
",",
"String",
"warningToSuppress",
")",
"{",
"return",
"addSuppressWarnings",
"(",
"state",
",",
"warningToSuppress",
",",
"null",
")",
";",
"}"
] | Returns a fix that adds a {@code @SuppressWarnings(warningToSuppress)} to the closest
suppressible element to the node pointed at by {@code state.getPath()}.
@see #addSuppressWarnings(VisitorState, String, String) | [
"Returns",
"a",
"fix",
"that",
"adds",
"a",
"{",
"@code",
"@SuppressWarnings",
"(",
"warningToSuppress",
")",
"}",
"to",
"the",
"closest",
"suppressible",
"element",
"to",
"the",
"node",
"pointed",
"at",
"by",
"{",
"@code",
"state",
".",
"getPath",
"()",
"... | train | https://github.com/google/error-prone/blob/fe2e3cc2cf1958cb7c487bfe89852bb4c225ba9d/check_api/src/main/java/com/google/errorprone/fixes/SuggestedFixes.java#L549-L552 |
kristiankime/FCollections | src/main/java/com/artclod/common/collect/ArrayFList.java | ArrayFList.mkString | public String mkString(String start, String sep, String end) {
"""
Looping without creating in iterator is faster so we reimplement some methods for speed
"""
StringBuilder ret = new StringBuilder(start);
for (int i = 0; i < inner.size(); i++) {
ret.append(inner.get(i));
if (i != (inner.size() - 1)) ... | java | public String mkString(String start, String sep, String end) {
StringBuilder ret = new StringBuilder(start);
for (int i = 0; i < inner.size(); i++) {
ret.append(inner.get(i));
if (i != (inner.size() - 1)) {
ret.append(sep);
}
}
return ret.append(end).toString();
} | [
"public",
"String",
"mkString",
"(",
"String",
"start",
",",
"String",
"sep",
",",
"String",
"end",
")",
"{",
"StringBuilder",
"ret",
"=",
"new",
"StringBuilder",
"(",
"start",
")",
";",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
"<",
"inner",
".",
... | Looping without creating in iterator is faster so we reimplement some methods for speed | [
"Looping",
"without",
"creating",
"in",
"iterator",
"is",
"faster",
"so",
"we",
"reimplement",
"some",
"methods",
"for",
"speed"
] | train | https://github.com/kristiankime/FCollections/blob/a72eccf3c91ab855b72bedb2f6c1c9ad1499710a/src/main/java/com/artclod/common/collect/ArrayFList.java#L109-L118 |
omalley/hadoop-gpl-compression | src/java/com/hadoop/mapreduce/LzoTextInputFormat.java | LzoTextInputFormat.readIndex | private LzoIndex readIndex(Path file, FileSystem fs) throws IOException {
"""
Read the index of the lzo file.
@param split
Read the index of this file.
@param fs
The index file is on this file system.
@throws IOException
"""
FSDataInputStream indexIn = null;
try {
Path indexFile = new Path... | java | private LzoIndex readIndex(Path file, FileSystem fs) throws IOException {
FSDataInputStream indexIn = null;
try {
Path indexFile = new Path(file.toString() + LZO_INDEX_SUFFIX);
if (!fs.exists(indexFile)) {
// return empty index, fall back to the unsplittable mode
return new LzoIndex(... | [
"private",
"LzoIndex",
"readIndex",
"(",
"Path",
"file",
",",
"FileSystem",
"fs",
")",
"throws",
"IOException",
"{",
"FSDataInputStream",
"indexIn",
"=",
"null",
";",
"try",
"{",
"Path",
"indexFile",
"=",
"new",
"Path",
"(",
"file",
".",
"toString",
"(",
"... | Read the index of the lzo file.
@param split
Read the index of this file.
@param fs
The index file is on this file system.
@throws IOException | [
"Read",
"the",
"index",
"of",
"the",
"lzo",
"file",
"."
] | train | https://github.com/omalley/hadoop-gpl-compression/blob/64ab3eb60fffac2a4d77680d506b34b02fcc3d7e/src/java/com/hadoop/mapreduce/LzoTextInputFormat.java#L156-L178 |
m-m-m/util | nls/src/main/java/net/sf/mmm/util/nls/base/AbstractNlsBundleFactory.java | AbstractNlsBundleFactory.createHandler | protected InvocationHandler createHandler(Class<? extends NlsBundle> bundleInterface) {
"""
This method creates a new {@link InvocationHandler} for the given {@code bundleInterface}.
@param bundleInterface is the {@link Class} reflecting the {@link NlsBundle} interface.
@return the {@link InvocationHandler} fo... | java | protected InvocationHandler createHandler(Class<? extends NlsBundle> bundleInterface) {
String bundleName = NlsBundleHelper.getInstance().getQualifiedLocation(bundleInterface);
NlsBundleOptions options = getBundleOptions(bundleInterface);
return new NlsBundleInvocationHandler(bundleInterface, bundleName, o... | [
"protected",
"InvocationHandler",
"createHandler",
"(",
"Class",
"<",
"?",
"extends",
"NlsBundle",
">",
"bundleInterface",
")",
"{",
"String",
"bundleName",
"=",
"NlsBundleHelper",
".",
"getInstance",
"(",
")",
".",
"getQualifiedLocation",
"(",
"bundleInterface",
")... | This method creates a new {@link InvocationHandler} for the given {@code bundleInterface}.
@param bundleInterface is the {@link Class} reflecting the {@link NlsBundle} interface.
@return the {@link InvocationHandler} for the given {@code bundleInterface}. | [
"This",
"method",
"creates",
"a",
"new",
"{",
"@link",
"InvocationHandler",
"}",
"for",
"the",
"given",
"{",
"@code",
"bundleInterface",
"}",
"."
] | train | https://github.com/m-m-m/util/blob/f0e4e084448f8dfc83ca682a9e1618034a094ce6/nls/src/main/java/net/sf/mmm/util/nls/base/AbstractNlsBundleFactory.java#L186-L191 |
datumbox/datumbox-framework | datumbox-framework-common/src/main/java/com/datumbox/framework/common/dataobjects/TransposeDataCollection2D.java | TransposeDataCollection2D.put | public final TransposeDataCollection put(Object key, TransposeDataCollection value) {
"""
Adds a particular key-value into the internal map. It returns the previous
value which was associated with that key.
@param key
@param value
@return
"""
return internalData.put(key, value);
} | java | public final TransposeDataCollection put(Object key, TransposeDataCollection value) {
return internalData.put(key, value);
} | [
"public",
"final",
"TransposeDataCollection",
"put",
"(",
"Object",
"key",
",",
"TransposeDataCollection",
"value",
")",
"{",
"return",
"internalData",
".",
"put",
"(",
"key",
",",
"value",
")",
";",
"}"
] | Adds a particular key-value into the internal map. It returns the previous
value which was associated with that key.
@param key
@param value
@return | [
"Adds",
"a",
"particular",
"key",
"-",
"value",
"into",
"the",
"internal",
"map",
".",
"It",
"returns",
"the",
"previous",
"value",
"which",
"was",
"associated",
"with",
"that",
"key",
"."
] | train | https://github.com/datumbox/datumbox-framework/blob/909dff0476e80834f05ecdde0624dd2390e9b0ca/datumbox-framework-common/src/main/java/com/datumbox/framework/common/dataobjects/TransposeDataCollection2D.java#L79-L81 |
sarl/sarl | main/coreplugins/io.sarl.lang/src/io/sarl/lang/typesystem/SARLTypeComputer.java | SARLTypeComputer._computeTypes | protected void _computeTypes(SarlAssertExpression object, ITypeComputationState state) {
"""
Compute the type of an assert expression.
@param object the expression.
@param state the state of the type resolver.
"""
state.withExpectation(getTypeForName(Boolean.class, state)).computeTypes(object.getConditio... | java | protected void _computeTypes(SarlAssertExpression object, ITypeComputationState state) {
state.withExpectation(getTypeForName(Boolean.class, state)).computeTypes(object.getCondition());
} | [
"protected",
"void",
"_computeTypes",
"(",
"SarlAssertExpression",
"object",
",",
"ITypeComputationState",
"state",
")",
"{",
"state",
".",
"withExpectation",
"(",
"getTypeForName",
"(",
"Boolean",
".",
"class",
",",
"state",
")",
")",
".",
"computeTypes",
"(",
... | Compute the type of an assert expression.
@param object the expression.
@param state the state of the type resolver. | [
"Compute",
"the",
"type",
"of",
"an",
"assert",
"expression",
"."
] | train | https://github.com/sarl/sarl/blob/ca00ff994598c730339972def4e19a60e0b8cace/main/coreplugins/io.sarl.lang/src/io/sarl/lang/typesystem/SARLTypeComputer.java#L191-L193 |
Jasig/uPortal | uPortal-utils/uPortal-utils-core/src/main/java/org/apereo/portal/utils/ResourceUtils.java | ResourceUtils.getResourceUri | public static String getResourceUri(Resource resource) {
"""
First tries {@link Resource#getURI()} and if that fails with a FileNotFoundException then
{@link Resource#getDescription()} is returned.
"""
try {
return resource.getURI().toString();
} catch (FileNotFoundException e) {
... | java | public static String getResourceUri(Resource resource) {
try {
return resource.getURI().toString();
} catch (FileNotFoundException e) {
return resource.getDescription();
} catch (IOException e) {
throw new RuntimeException("Could not create URI for resource: "... | [
"public",
"static",
"String",
"getResourceUri",
"(",
"Resource",
"resource",
")",
"{",
"try",
"{",
"return",
"resource",
".",
"getURI",
"(",
")",
".",
"toString",
"(",
")",
";",
"}",
"catch",
"(",
"FileNotFoundException",
"e",
")",
"{",
"return",
"resource... | First tries {@link Resource#getURI()} and if that fails with a FileNotFoundException then
{@link Resource#getDescription()} is returned. | [
"First",
"tries",
"{"
] | train | https://github.com/Jasig/uPortal/blob/c1986542abb9acd214268f2df21c6305ad2f262b/uPortal-utils/uPortal-utils-core/src/main/java/org/apereo/portal/utils/ResourceUtils.java#L29-L37 |
Carbonado/Carbonado | src/main/java/com/amazon/carbonado/raw/KeyDecoder.java | KeyDecoder.decodeFloatObjDesc | public static Float decodeFloatObjDesc(byte[] src, int srcOffset)
throws CorruptEncodingException {
"""
Decodes a Float object from exactly 4 bytes.
@param src source of encoded bytes
@param srcOffset offset into source array
@return Float object or null
"""
int bits = DataDecoder.decode... | java | public static Float decodeFloatObjDesc(byte[] src, int srcOffset)
throws CorruptEncodingException
{
int bits = DataDecoder.decodeFloatBits(src, srcOffset);
if (bits >= 0) {
bits ^= 0x7fffffff;
}
return bits == 0x7fffffff ? null : Float.intBitsToFloat(bits);... | [
"public",
"static",
"Float",
"decodeFloatObjDesc",
"(",
"byte",
"[",
"]",
"src",
",",
"int",
"srcOffset",
")",
"throws",
"CorruptEncodingException",
"{",
"int",
"bits",
"=",
"DataDecoder",
".",
"decodeFloatBits",
"(",
"src",
",",
"srcOffset",
")",
";",
"if",
... | Decodes a Float object from exactly 4 bytes.
@param src source of encoded bytes
@param srcOffset offset into source array
@return Float object or null | [
"Decodes",
"a",
"Float",
"object",
"from",
"exactly",
"4",
"bytes",
"."
] | train | https://github.com/Carbonado/Carbonado/blob/eee29b365a61c8f03e1a1dc6bed0692e6b04b1db/src/main/java/com/amazon/carbonado/raw/KeyDecoder.java#L293-L301 |
jlinn/quartz-redis-jobstore | src/main/java/net/joelinn/quartz/jobstore/AbstractRedisStorage.java | AbstractRedisStorage.resumeJob | public void resumeJob(JobKey jobKey, T jedis) throws JobPersistenceException {
"""
Resume (un-pause) the <code>{@link org.quartz.Job}</code> with the given key.
@param jobKey the key of the job to be resumed
@param jedis a thread-safe Redis connection
"""
for (OperableTrigger trigger : getTriggersFor... | java | public void resumeJob(JobKey jobKey, T jedis) throws JobPersistenceException {
for (OperableTrigger trigger : getTriggersForJob(jobKey, jedis)) {
resumeTrigger(trigger.getKey(), jedis);
}
} | [
"public",
"void",
"resumeJob",
"(",
"JobKey",
"jobKey",
",",
"T",
"jedis",
")",
"throws",
"JobPersistenceException",
"{",
"for",
"(",
"OperableTrigger",
"trigger",
":",
"getTriggersForJob",
"(",
"jobKey",
",",
"jedis",
")",
")",
"{",
"resumeTrigger",
"(",
"tri... | Resume (un-pause) the <code>{@link org.quartz.Job}</code> with the given key.
@param jobKey the key of the job to be resumed
@param jedis a thread-safe Redis connection | [
"Resume",
"(",
"un",
"-",
"pause",
")",
"the",
"<code",
">",
"{"
] | train | https://github.com/jlinn/quartz-redis-jobstore/blob/be9a52ee776d8a09866fe99fd9718bc13a0cb992/src/main/java/net/joelinn/quartz/jobstore/AbstractRedisStorage.java#L617-L621 |
geomajas/geomajas-project-client-gwt2 | plugin/tilebasedlayer/impl/src/main/java/org/geomajas/gwt2/plugin/tilebasedlayer/client/TileBasedLayerClient.java | TileBasedLayerClient.createOsmLayer | @Deprecated
public OsmLayer createOsmLayer(String id, TileConfiguration conf, String url) {
"""
Create a new OSM layer with an URL to an OSM tile service.
<p/>
The URL should have placeholders for the x- and y-coordinate and tile level in the form of {x}, {y}, {z}.
The file extension of the tiles should be par... | java | @Deprecated
public OsmLayer createOsmLayer(String id, TileConfiguration conf, String url) {
OsmLayer layer = new OsmLayer(id, conf);
layer.addUrl(url);
return layer;
} | [
"@",
"Deprecated",
"public",
"OsmLayer",
"createOsmLayer",
"(",
"String",
"id",
",",
"TileConfiguration",
"conf",
",",
"String",
"url",
")",
"{",
"OsmLayer",
"layer",
"=",
"new",
"OsmLayer",
"(",
"id",
",",
"conf",
")",
";",
"layer",
".",
"addUrl",
"(",
... | Create a new OSM layer with an URL to an OSM tile service.
<p/>
The URL should have placeholders for the x- and y-coordinate and tile level in the form of {x}, {y}, {z}.
The file extension of the tiles should be part of the URL.
@param id The unique ID of the layer.
@param conf The tile configuration.
@param url Th... | [
"Create",
"a",
"new",
"OSM",
"layer",
"with",
"an",
"URL",
"to",
"an",
"OSM",
"tile",
"service",
".",
"<p",
"/",
">",
"The",
"URL",
"should",
"have",
"placeholders",
"for",
"the",
"x",
"-",
"and",
"y",
"-",
"coordinate",
"and",
"tile",
"level",
"in",... | train | https://github.com/geomajas/geomajas-project-client-gwt2/blob/bd8d7904e861fa80522eed7b83c4ea99844180c7/plugin/tilebasedlayer/impl/src/main/java/org/geomajas/gwt2/plugin/tilebasedlayer/client/TileBasedLayerClient.java#L169-L174 |
ksclarke/freelib-utils | src/main/java/info/freelibrary/util/FileUtils.java | FileUtils.copyMetadata | private static void copyMetadata(final File aFile, final Element aElement) {
"""
Copy file metadata into the supplied file element.
@param aFile A file to extract metadata from
@param aElement A destination element for the file metadata
"""
final SimpleDateFormat formatter = new SimpleDateFormat(DA... | java | private static void copyMetadata(final File aFile, final Element aElement) {
final SimpleDateFormat formatter = new SimpleDateFormat(DATE_FORMAT, Locale.US);
final StringBuilder permissions = new StringBuilder();
final Date date = new Date(aFile.lastModified());
aElement.setAttribute(FI... | [
"private",
"static",
"void",
"copyMetadata",
"(",
"final",
"File",
"aFile",
",",
"final",
"Element",
"aElement",
")",
"{",
"final",
"SimpleDateFormat",
"formatter",
"=",
"new",
"SimpleDateFormat",
"(",
"DATE_FORMAT",
",",
"Locale",
".",
"US",
")",
";",
"final"... | Copy file metadata into the supplied file element.
@param aFile A file to extract metadata from
@param aElement A destination element for the file metadata | [
"Copy",
"file",
"metadata",
"into",
"the",
"supplied",
"file",
"element",
"."
] | train | https://github.com/ksclarke/freelib-utils/blob/54e822ae4c11b3d74793fd82a1a535ffafffaf45/src/main/java/info/freelibrary/util/FileUtils.java#L862-L879 |
jdereg/java-util | src/main/java/com/cedarsoftware/util/UrlUtilities.java | UrlUtilities.getContentFromUrl | @Deprecated
public static byte[] getContentFromUrl(String url, Map inCookies, Map outCookies, Proxy proxy, SSLSocketFactory factory, HostnameVerifier verifier) {
"""
Get content from the passed in URL. This code will open a connection to
the passed in server, fetch the requested content, and return it as a
... | java | @Deprecated
public static byte[] getContentFromUrl(String url, Map inCookies, Map outCookies, Proxy proxy, SSLSocketFactory factory, HostnameVerifier verifier)
{
return getContentFromUrl(url, inCookies, outCookies, true);
} | [
"@",
"Deprecated",
"public",
"static",
"byte",
"[",
"]",
"getContentFromUrl",
"(",
"String",
"url",
",",
"Map",
"inCookies",
",",
"Map",
"outCookies",
",",
"Proxy",
"proxy",
",",
"SSLSocketFactory",
"factory",
",",
"HostnameVerifier",
"verifier",
")",
"{",
"re... | Get content from the passed in URL. This code will open a connection to
the passed in server, fetch the requested content, and return it as a
byte[].
Anyone using the proxy calls such as this one should have that managed by the jvm with -D parameters:
http.proxyHost
http.proxyPort (default: 80)
http.nonProxyHosts (sh... | [
"Get",
"content",
"from",
"the",
"passed",
"in",
"URL",
".",
"This",
"code",
"will",
"open",
"a",
"connection",
"to",
"the",
"passed",
"in",
"server",
"fetch",
"the",
"requested",
"content",
"and",
"return",
"it",
"as",
"a",
"byte",
"[]",
"."
] | train | https://github.com/jdereg/java-util/blob/a2dce61aed16d6454ee575174dda1ba6bff0015c/src/main/java/com/cedarsoftware/util/UrlUtilities.java#L804-L808 |
UrielCh/ovh-java-sdk | ovh-java-sdk-telephony/src/main/java/net/minidev/ovh/api/ApiOvhTelephony.java | ApiOvhTelephony.billingAccount_line_serviceName_click2CallUser_id_changePassword_POST | public void billingAccount_line_serviceName_click2CallUser_id_changePassword_POST(String billingAccount, String serviceName, Long id, String password) throws IOException {
"""
Change the password of the click2call user
REST: POST /telephony/{billingAccount}/line/{serviceName}/click2CallUser/{id}/changePassword
... | java | public void billingAccount_line_serviceName_click2CallUser_id_changePassword_POST(String billingAccount, String serviceName, Long id, String password) throws IOException {
String qPath = "/telephony/{billingAccount}/line/{serviceName}/click2CallUser/{id}/changePassword";
StringBuilder sb = path(qPath, billingAccoun... | [
"public",
"void",
"billingAccount_line_serviceName_click2CallUser_id_changePassword_POST",
"(",
"String",
"billingAccount",
",",
"String",
"serviceName",
",",
"Long",
"id",
",",
"String",
"password",
")",
"throws",
"IOException",
"{",
"String",
"qPath",
"=",
"\"/telephony... | Change the password of the click2call user
REST: POST /telephony/{billingAccount}/line/{serviceName}/click2CallUser/{id}/changePassword
@param password [required] The password
@param billingAccount [required] The name of your billingAccount
@param serviceName [required]
@param id [required] Id of the object | [
"Change",
"the",
"password",
"of",
"the",
"click2call",
"user"
] | train | https://github.com/UrielCh/ovh-java-sdk/blob/6d531a40e56e09701943e334c25f90f640c55701/ovh-java-sdk-telephony/src/main/java/net/minidev/ovh/api/ApiOvhTelephony.java#L871-L877 |
i-net-software/jlessc | src/com/inet/lib/less/UrlUtils.java | UrlUtils.dataUri | static void dataUri( CssFormatter formatter, String relativeUrlStr, final String urlString, String type ) throws IOException {
"""
Implementation of the function data-uri.
@param formatter current formatter
@param relativeUrlStr relative URL of the less script. Is used as base URL
@param urlString the url par... | java | static void dataUri( CssFormatter formatter, String relativeUrlStr, final String urlString, String type ) throws IOException {
String urlStr = removeQuote( urlString );
InputStream input;
try {
input = formatter.getReaderFactory().openStream( formatter.getBaseURL(), urlStr, relativeU... | [
"static",
"void",
"dataUri",
"(",
"CssFormatter",
"formatter",
",",
"String",
"relativeUrlStr",
",",
"final",
"String",
"urlString",
",",
"String",
"type",
")",
"throws",
"IOException",
"{",
"String",
"urlStr",
"=",
"removeQuote",
"(",
"urlString",
")",
";",
"... | Implementation of the function data-uri.
@param formatter current formatter
@param relativeUrlStr relative URL of the less script. Is used as base URL
@param urlString the url parameter of the function
@param type the mime type
@throws IOException If any I/O errors occur on reading the content | [
"Implementation",
"of",
"the",
"function",
"data",
"-",
"uri",
"."
] | train | https://github.com/i-net-software/jlessc/blob/15b13e1637f6cc2e4d72df021e23ee0ca8d5e629/src/com/inet/lib/less/UrlUtils.java#L171-L207 |
OpenLiberty/open-liberty | dev/com.ibm.ws.dynacache/src/com/ibm/ws/cache/InvalidationAuditDaemon.java | InvalidationAuditDaemon.filterExternalCacheFragment | public ExternalInvalidation filterExternalCacheFragment(String cacheName, ExternalInvalidation externalCacheFragment) {
"""
This ensures that the specified ExternalCacheFragment has not
been invalidated.
@param externalCacheFragment The unfiltered ExternalCacheFragment.
@return The filtered ExternalCacheFragm... | java | public ExternalInvalidation filterExternalCacheFragment(String cacheName, ExternalInvalidation externalCacheFragment) {
InvalidationTableList invalidationTableList = getInvalidationTableList(cacheName);
try {
invalidationTableList.readWriteLock.readLock().lock();
return internalFilterExternalCacheFragment(cac... | [
"public",
"ExternalInvalidation",
"filterExternalCacheFragment",
"(",
"String",
"cacheName",
",",
"ExternalInvalidation",
"externalCacheFragment",
")",
"{",
"InvalidationTableList",
"invalidationTableList",
"=",
"getInvalidationTableList",
"(",
"cacheName",
")",
";",
"try",
"... | This ensures that the specified ExternalCacheFragment has not
been invalidated.
@param externalCacheFragment The unfiltered ExternalCacheFragment.
@return The filtered ExternalCacheFragment. | [
"This",
"ensures",
"that",
"the",
"specified",
"ExternalCacheFragment",
"has",
"not",
"been",
"invalidated",
"."
] | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.dynacache/src/com/ibm/ws/cache/InvalidationAuditDaemon.java#L256-L264 |
UrielCh/ovh-java-sdk | ovh-java-sdk-me/src/main/java/net/minidev/ovh/api/ApiOvhMe.java | ApiOvhMe.telephony_settings_GET | public OvhSettings telephony_settings_GET() throws IOException {
"""
Get the telephony settings linked to the customer account
REST: GET /me/telephony/settings
"""
String qPath = "/me/telephony/settings";
StringBuilder sb = path(qPath);
String resp = exec(qPath, "GET", sb.toString(), null);
return c... | java | public OvhSettings telephony_settings_GET() throws IOException {
String qPath = "/me/telephony/settings";
StringBuilder sb = path(qPath);
String resp = exec(qPath, "GET", sb.toString(), null);
return convertTo(resp, OvhSettings.class);
} | [
"public",
"OvhSettings",
"telephony_settings_GET",
"(",
")",
"throws",
"IOException",
"{",
"String",
"qPath",
"=",
"\"/me/telephony/settings\"",
";",
"StringBuilder",
"sb",
"=",
"path",
"(",
"qPath",
")",
";",
"String",
"resp",
"=",
"exec",
"(",
"qPath",
",",
... | Get the telephony settings linked to the customer account
REST: GET /me/telephony/settings | [
"Get",
"the",
"telephony",
"settings",
"linked",
"to",
"the",
"customer",
"account"
] | train | https://github.com/UrielCh/ovh-java-sdk/blob/6d531a40e56e09701943e334c25f90f640c55701/ovh-java-sdk-me/src/main/java/net/minidev/ovh/api/ApiOvhMe.java#L1801-L1806 |
deeplearning4j/deeplearning4j | nd4j/nd4j-backends/nd4j-api-parent/nd4j-api/src/main/java/org/nd4j/linalg/compression/CompressedDataBuffer.java | CompressedDataBuffer.readUnknown | public static DataBuffer readUnknown(DataInputStream s, AllocationMode allocMode, long length, DataType type) {
"""
Drop-in replacement wrapper for BaseDataBuffer.read() method, aware of CompressedDataBuffer
@param s
@return
"""
// if buffer is uncompressed, it'll be valid buffer, so we'll just retur... | java | public static DataBuffer readUnknown(DataInputStream s, AllocationMode allocMode, long length, DataType type) {
// if buffer is uncompressed, it'll be valid buffer, so we'll just return it
if (type != DataType.COMPRESSED) {
DataBuffer buffer = Nd4j.createBuffer(type, length, false);
... | [
"public",
"static",
"DataBuffer",
"readUnknown",
"(",
"DataInputStream",
"s",
",",
"AllocationMode",
"allocMode",
",",
"long",
"length",
",",
"DataType",
"type",
")",
"{",
"// if buffer is uncompressed, it'll be valid buffer, so we'll just return it",
"if",
"(",
"type",
"... | Drop-in replacement wrapper for BaseDataBuffer.read() method, aware of CompressedDataBuffer
@param s
@return | [
"Drop",
"-",
"in",
"replacement",
"wrapper",
"for",
"BaseDataBuffer",
".",
"read",
"()",
"method",
"aware",
"of",
"CompressedDataBuffer"
] | train | https://github.com/deeplearning4j/deeplearning4j/blob/effce52f2afd7eeb53c5bcca699fcd90bd06822f/nd4j/nd4j-backends/nd4j-api-parent/nd4j-api/src/main/java/org/nd4j/linalg/compression/CompressedDataBuffer.java#L97-L129 |
JetBrains/xodus | openAPI/src/main/java/jetbrains/exodus/env/EnvironmentConfig.java | EnvironmentConfig.setGcStartIn | public EnvironmentConfig setGcStartIn(final int startInMillis) throws InvalidSettingException {
"""
Sets the number of milliseconds which the database garbage collector is postponed for after the
{@linkplain Environment} is created. Default value is {@code 10000}.
<p>Mutable at runtime: no
@param startInMilli... | java | public EnvironmentConfig setGcStartIn(final int startInMillis) throws InvalidSettingException {
if (startInMillis < 0) {
throw new InvalidSettingException("GC can't be postponed for that number of milliseconds: " + startInMillis);
}
return setSetting(GC_START_IN, startInMillis);
... | [
"public",
"EnvironmentConfig",
"setGcStartIn",
"(",
"final",
"int",
"startInMillis",
")",
"throws",
"InvalidSettingException",
"{",
"if",
"(",
"startInMillis",
"<",
"0",
")",
"{",
"throw",
"new",
"InvalidSettingException",
"(",
"\"GC can't be postponed for that number of ... | Sets the number of milliseconds which the database garbage collector is postponed for after the
{@linkplain Environment} is created. Default value is {@code 10000}.
<p>Mutable at runtime: no
@param startInMillis number of milliseconds which the database garbage collector should be postponed for after the
{@linkplain E... | [
"Sets",
"the",
"number",
"of",
"milliseconds",
"which",
"the",
"database",
"garbage",
"collector",
"is",
"postponed",
"for",
"after",
"the",
"{",
"@linkplain",
"Environment",
"}",
"is",
"created",
".",
"Default",
"value",
"is",
"{",
"@code",
"10000",
"}",
".... | train | https://github.com/JetBrains/xodus/blob/7b3476c4e81db66f9c7529148c761605cc8eea6d/openAPI/src/main/java/jetbrains/exodus/env/EnvironmentConfig.java#L1822-L1827 |
maxirosson/jdroid-android | jdroid-android-google-inappbilling/src/main/java/com/jdroid/android/google/inappbilling/client/utils/Security.java | Security.verify | public static boolean verify(PublicKey publicKey, String signedData, String signature) {
"""
Verifies that the signature from the server matches the computed signature on the data.
Returns true if the data is correctly signed.
@param publicKey public key associated with the developer account
@param signedData... | java | public static boolean verify(PublicKey publicKey, String signedData, String signature) {
byte[] signatureBytes;
try {
signatureBytes = Base64.decode(signature, Base64.DEFAULT);
} catch (IllegalArgumentException e) {
LOGGER.error("Base64 decoding failed.");
return false;
}
try {
Signature sig = Sig... | [
"public",
"static",
"boolean",
"verify",
"(",
"PublicKey",
"publicKey",
",",
"String",
"signedData",
",",
"String",
"signature",
")",
"{",
"byte",
"[",
"]",
"signatureBytes",
";",
"try",
"{",
"signatureBytes",
"=",
"Base64",
".",
"decode",
"(",
"signature",
... | Verifies that the signature from the server matches the computed signature on the data.
Returns true if the data is correctly signed.
@param publicKey public key associated with the developer account
@param signedData signed data from server
@param signature server signature
@return true if the data and signature matc... | [
"Verifies",
"that",
"the",
"signature",
"from",
"the",
"server",
"matches",
"the",
"computed",
"signature",
"on",
"the",
"data",
".",
"Returns",
"true",
"if",
"the",
"data",
"is",
"correctly",
"signed",
"."
] | train | https://github.com/maxirosson/jdroid-android/blob/1ba9cae56a16fa36bdb2c9c04379853f0300707f/jdroid-android-google-inappbilling/src/main/java/com/jdroid/android/google/inappbilling/client/utils/Security.java#L89-L114 |
classgraph/classgraph | src/main/java/io/github/classgraph/ModuleReaderProxy.java | ModuleReaderProxy.openOrRead | private Object openOrRead(final String path, final boolean open) throws SecurityException {
"""
Use the proxied ModuleReader to open the named resource as an InputStream.
@param path
The path to the resource to open.
@param open
if true, call moduleReader.open(name).get() (returning an InputStream), otherwis... | java | private Object openOrRead(final String path, final boolean open) throws SecurityException {
final String methodName = open ? "open" : "read";
final Object /* Optional<InputStream> */ optionalInputStream = ReflectionUtils.invokeMethod(moduleReader,
methodName, String.class, path, /* throw... | [
"private",
"Object",
"openOrRead",
"(",
"final",
"String",
"path",
",",
"final",
"boolean",
"open",
")",
"throws",
"SecurityException",
"{",
"final",
"String",
"methodName",
"=",
"open",
"?",
"\"open\"",
":",
"\"read\"",
";",
"final",
"Object",
"/* Optional<Inpu... | Use the proxied ModuleReader to open the named resource as an InputStream.
@param path
The path to the resource to open.
@param open
if true, call moduleReader.open(name).get() (returning an InputStream), otherwise call
moduleReader.read(name).get() (returning a ByteBuffer).
@return An {@link InputStream} for the cont... | [
"Use",
"the",
"proxied",
"ModuleReader",
"to",
"open",
"the",
"named",
"resource",
"as",
"an",
"InputStream",
"."
] | train | https://github.com/classgraph/classgraph/blob/c8c8b2ca1eb76339f69193fdac33d735c864215c/src/main/java/io/github/classgraph/ModuleReaderProxy.java#L134-L147 |
jferard/fastods | fastods/src/main/java/com/github/jferard/fastods/odselement/StylesContainer.java | StylesContainer.addChildCellStyle | public TableCellStyle addChildCellStyle(final TableCellStyle style, final DataStyle dataStyle) {
"""
Add a child style that mixes the cell style with a data style to the container
@param style the cell style
@param dataStyle the data style
@return the mixed cell style
"""
final ChildCellStyle ... | java | public TableCellStyle addChildCellStyle(final TableCellStyle style, final DataStyle dataStyle) {
final ChildCellStyle childKey = new ChildCellStyle(style, dataStyle);
TableCellStyle anonymousStyle = this.anonymousStyleByChildCellStyle.get(childKey);
if (anonymousStyle == null) {
this... | [
"public",
"TableCellStyle",
"addChildCellStyle",
"(",
"final",
"TableCellStyle",
"style",
",",
"final",
"DataStyle",
"dataStyle",
")",
"{",
"final",
"ChildCellStyle",
"childKey",
"=",
"new",
"ChildCellStyle",
"(",
"style",
",",
"dataStyle",
")",
";",
"TableCellStyle... | Add a child style that mixes the cell style with a data style to the container
@param style the cell style
@param dataStyle the data style
@return the mixed cell style | [
"Add",
"a",
"child",
"style",
"that",
"mixes",
"the",
"cell",
"style",
"with",
"a",
"data",
"style",
"to",
"the",
"container"
] | train | https://github.com/jferard/fastods/blob/a034d173083ffa602dc525699b97f753082eaef9/fastods/src/main/java/com/github/jferard/fastods/odselement/StylesContainer.java#L124-L143 |
JoeKerouac/utils | src/main/java/com/joe/utils/secure/impl/SymmetryCipher.java | SymmetryCipher.buildInstance | public static CipherUtil buildInstance(Algorithms algorithms, byte[] keySpec) {
"""
SymmetryCipher构造器
@param algorithms 算法
@param keySpec keySpec
@return CipherUtil
"""
SecretKey key = KeyTools.buildKey(algorithms, keySpec);
return new SymmetryCipher(algorithms, key);
} | java | public static CipherUtil buildInstance(Algorithms algorithms, byte[] keySpec) {
SecretKey key = KeyTools.buildKey(algorithms, keySpec);
return new SymmetryCipher(algorithms, key);
} | [
"public",
"static",
"CipherUtil",
"buildInstance",
"(",
"Algorithms",
"algorithms",
",",
"byte",
"[",
"]",
"keySpec",
")",
"{",
"SecretKey",
"key",
"=",
"KeyTools",
".",
"buildKey",
"(",
"algorithms",
",",
"keySpec",
")",
";",
"return",
"new",
"SymmetryCipher"... | SymmetryCipher构造器
@param algorithms 算法
@param keySpec keySpec
@return CipherUtil | [
"SymmetryCipher构造器"
] | train | https://github.com/JoeKerouac/utils/blob/45e1b2dc4d736956674fc4dcbe6cf84eaee69278/src/main/java/com/joe/utils/secure/impl/SymmetryCipher.java#L84-L87 |
apache/groovy | src/main/java/org/codehaus/groovy/ast/tools/WideningCategories.java | WideningCategories.lowestUpperBound | public static ClassNode lowestUpperBound(ClassNode a, ClassNode b) {
"""
Given two class nodes, returns the first common supertype, or the class itself
if there are equal. For example, Double and Float would return Number, while
Set and String would return Object.
This method is not guaranteed to return a cla... | java | public static ClassNode lowestUpperBound(ClassNode a, ClassNode b) {
ClassNode lub = lowestUpperBound(a, b, null, null);
if (lub==null || !lub.isUsingGenerics()) return lub;
// types may be parameterized. If so, we must ensure that generic type arguments
// are made compatible
i... | [
"public",
"static",
"ClassNode",
"lowestUpperBound",
"(",
"ClassNode",
"a",
",",
"ClassNode",
"b",
")",
"{",
"ClassNode",
"lub",
"=",
"lowestUpperBound",
"(",
"a",
",",
"b",
",",
"null",
",",
"null",
")",
";",
"if",
"(",
"lub",
"==",
"null",
"||",
"!",... | Given two class nodes, returns the first common supertype, or the class itself
if there are equal. For example, Double and Float would return Number, while
Set and String would return Object.
This method is not guaranteed to return a class node which corresponds to a
real type. For example, if two types have more than... | [
"Given",
"two",
"class",
"nodes",
"returns",
"the",
"first",
"common",
"supertype",
"or",
"the",
"class",
"itself",
"if",
"there",
"are",
"equal",
".",
"For",
"example",
"Double",
"and",
"Float",
"would",
"return",
"Number",
"while",
"Set",
"and",
"String",
... | train | https://github.com/apache/groovy/blob/71cf20addb611bb8d097a59e395fd20bc7f31772/src/main/java/org/codehaus/groovy/ast/tools/WideningCategories.java#L209-L240 |
mikepenz/FastAdapter | app/src/main/java/com/mikepenz/fastadapter/app/items/ImageItem.java | ImageItem.animateHeart | public void animateHeart(View imageLovedOn, View imageLovedOff, boolean on) {
"""
helper method to animate the heart view
@param imageLovedOn
@param imageLovedOff
@param on
"""
imageLovedOn.setVisibility(View.VISIBLE);
imageLovedOff.setVisibility(View.VISIBLE);
if (Build.VERSION.S... | java | public void animateHeart(View imageLovedOn, View imageLovedOff, boolean on) {
imageLovedOn.setVisibility(View.VISIBLE);
imageLovedOff.setVisibility(View.VISIBLE);
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.HONEYCOMB_MR1) {
viewPropertyStartCompat(imageLovedOff.animate().scaleX... | [
"public",
"void",
"animateHeart",
"(",
"View",
"imageLovedOn",
",",
"View",
"imageLovedOff",
",",
"boolean",
"on",
")",
"{",
"imageLovedOn",
".",
"setVisibility",
"(",
"View",
".",
"VISIBLE",
")",
";",
"imageLovedOff",
".",
"setVisibility",
"(",
"View",
".",
... | helper method to animate the heart view
@param imageLovedOn
@param imageLovedOff
@param on | [
"helper",
"method",
"to",
"animate",
"the",
"heart",
"view"
] | train | https://github.com/mikepenz/FastAdapter/blob/3b2412abe001ba58422e0125846b704d4dba4ae9/app/src/main/java/com/mikepenz/fastadapter/app/items/ImageItem.java#L136-L144 |
BorderTech/wcomponents | wcomponents-core/src/main/java/com/github/bordertech/wcomponents/subordinate/builder/ExpressionBuilder.java | ExpressionBuilder.notEquals | public ExpressionBuilder notEquals(final SubordinateTrigger trigger, final Object compare) {
"""
Appends a not equals test to the condition.
@param trigger the trigger field.
@param compare the value to use in the compare.
@return this ExpressionBuilder.
"""
BooleanExpression exp = new CompareExpression... | java | public ExpressionBuilder notEquals(final SubordinateTrigger trigger, final Object compare) {
BooleanExpression exp = new CompareExpression(CompareType.NOT_EQUAL, trigger, compare);
appendExpression(exp);
return this;
} | [
"public",
"ExpressionBuilder",
"notEquals",
"(",
"final",
"SubordinateTrigger",
"trigger",
",",
"final",
"Object",
"compare",
")",
"{",
"BooleanExpression",
"exp",
"=",
"new",
"CompareExpression",
"(",
"CompareType",
".",
"NOT_EQUAL",
",",
"trigger",
",",
"compare",... | Appends a not equals test to the condition.
@param trigger the trigger field.
@param compare the value to use in the compare.
@return this ExpressionBuilder. | [
"Appends",
"a",
"not",
"equals",
"test",
"to",
"the",
"condition",
"."
] | train | https://github.com/BorderTech/wcomponents/blob/d1a2b2243270067db030feb36ca74255aaa94436/wcomponents-core/src/main/java/com/github/bordertech/wcomponents/subordinate/builder/ExpressionBuilder.java#L77-L82 |
galaxyproject/blend4j | src/main/java/com/github/jmchilton/blend4j/BaseClient.java | BaseClient.deleteResponse | protected ClientResponse deleteResponse(final WebResource webResource, final boolean checkResponse) {
"""
Gets the response for a DELETE request.
@param webResource The {@link WebResource} to send the request to.
@param checkResponse True if an exception should be thrown on failure, false otherwise.
@return The... | java | protected ClientResponse deleteResponse(final WebResource webResource, final boolean checkResponse) {
final ClientResponse response = webResource.accept(MediaType.APPLICATION_JSON).delete(ClientResponse.class);
if(checkResponse) {
this.checkResponse(response);
}
return response;
} | [
"protected",
"ClientResponse",
"deleteResponse",
"(",
"final",
"WebResource",
"webResource",
",",
"final",
"boolean",
"checkResponse",
")",
"{",
"final",
"ClientResponse",
"response",
"=",
"webResource",
".",
"accept",
"(",
"MediaType",
".",
"APPLICATION_JSON",
")",
... | Gets the response for a DELETE request.
@param webResource The {@link WebResource} to send the request to.
@param checkResponse True if an exception should be thrown on failure, false otherwise.
@return The {@link ClientResponse} for this request.
@throws ResponseException If the response was not successful. | [
"Gets",
"the",
"response",
"for",
"a",
"DELETE",
"request",
"."
] | train | https://github.com/galaxyproject/blend4j/blob/a2ec4e412be40013bb88a3a2cf2478abd19ce162/src/main/java/com/github/jmchilton/blend4j/BaseClient.java#L105-L111 |
deeplearning4j/deeplearning4j | nd4j/nd4j-backends/nd4j-api-parent/nd4j-api/src/main/java/org/nd4j/linalg/api/shape/Shape.java | Shape.shapeEquals | public static boolean shapeEquals(int[] shape1, int[] shape2) {
"""
Returns whether 2 shapes are equals by checking for dimension semantics
as well as array equality
@param shape1 the first shape for comparison
@param shape2 the second shape for comparison
@return whether the shapes are equivalent
"""
... | java | public static boolean shapeEquals(int[] shape1, int[] shape2) {
if (isColumnVectorShape(shape1) && isColumnVectorShape(shape2)) {
return Arrays.equals(shape1, shape2);
}
if (isRowVectorShape(shape1) && isRowVectorShape(shape2)) {
int[] shape1Comp = squeeze(shape1);
... | [
"public",
"static",
"boolean",
"shapeEquals",
"(",
"int",
"[",
"]",
"shape1",
",",
"int",
"[",
"]",
"shape2",
")",
"{",
"if",
"(",
"isColumnVectorShape",
"(",
"shape1",
")",
"&&",
"isColumnVectorShape",
"(",
"shape2",
")",
")",
"{",
"return",
"Arrays",
"... | Returns whether 2 shapes are equals by checking for dimension semantics
as well as array equality
@param shape1 the first shape for comparison
@param shape2 the second shape for comparison
@return whether the shapes are equivalent | [
"Returns",
"whether",
"2",
"shapes",
"are",
"equals",
"by",
"checking",
"for",
"dimension",
"semantics",
"as",
"well",
"as",
"array",
"equality"
] | train | https://github.com/deeplearning4j/deeplearning4j/blob/effce52f2afd7eeb53c5bcca699fcd90bd06822f/nd4j/nd4j-backends/nd4j-api-parent/nd4j-api/src/main/java/org/nd4j/linalg/api/shape/Shape.java#L1494-L1521 |
lessthanoptimal/BoofCV | main/boofcv-geo/src/main/java/boofcv/abst/geo/bundle/SceneStructureMetric.java | SceneStructureMetric.setCamera | public void setCamera(int which , boolean fixed , BundleAdjustmentCamera model ) {
"""
Specifies the camera model being used.
@param which Which camera is being specified
@param fixed If these parameters are constant or not
@param model The camera model
"""
cameras[which].known = fixed;
cameras[which].... | java | public void setCamera(int which , boolean fixed , BundleAdjustmentCamera model ) {
cameras[which].known = fixed;
cameras[which].model = model;
} | [
"public",
"void",
"setCamera",
"(",
"int",
"which",
",",
"boolean",
"fixed",
",",
"BundleAdjustmentCamera",
"model",
")",
"{",
"cameras",
"[",
"which",
"]",
".",
"known",
"=",
"fixed",
";",
"cameras",
"[",
"which",
"]",
".",
"model",
"=",
"model",
";",
... | Specifies the camera model being used.
@param which Which camera is being specified
@param fixed If these parameters are constant or not
@param model The camera model | [
"Specifies",
"the",
"camera",
"model",
"being",
"used",
"."
] | train | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-geo/src/main/java/boofcv/abst/geo/bundle/SceneStructureMetric.java#L135-L138 |
mapbox/mapbox-java | services-turf/src/main/java/com/mapbox/turf/TurfAssertions.java | TurfAssertions.geojsonType | public static void geojsonType(GeoJson value, String type, String name) {
"""
Enforce expectations about types of GeoJson objects for Turf.
@param value any GeoJson object
@param type expected GeoJson type
@param name name of calling function
@see <a href="http://turfjs.org/docs/#geojsontype">Turf geojsonT... | java | public static void geojsonType(GeoJson value, String type, String name) {
if (type == null || type.length() == 0 || name == null || name.length() == 0) {
throw new TurfException("Type and name required");
}
if (value == null || !value.type().equals(type)) {
throw new TurfException("Invalid input... | [
"public",
"static",
"void",
"geojsonType",
"(",
"GeoJson",
"value",
",",
"String",
"type",
",",
"String",
"name",
")",
"{",
"if",
"(",
"type",
"==",
"null",
"||",
"type",
".",
"length",
"(",
")",
"==",
"0",
"||",
"name",
"==",
"null",
"||",
"name",
... | Enforce expectations about types of GeoJson objects for Turf.
@param value any GeoJson object
@param type expected GeoJson type
@param name name of calling function
@see <a href="http://turfjs.org/docs/#geojsontype">Turf geojsonType documentation</a>
@since 1.2.0 | [
"Enforce",
"expectations",
"about",
"types",
"of",
"GeoJson",
"objects",
"for",
"Turf",
"."
] | train | https://github.com/mapbox/mapbox-java/blob/c0be138f462f91441388584c668f3760ba0e18e2/services-turf/src/main/java/com/mapbox/turf/TurfAssertions.java#L44-L52 |
kuali/ojb-1.0.4 | src/xdoclet/java/src/xdoclet/modules/ojb/CommaListIterator.java | CommaListIterator.sameLists | public static boolean sameLists(String list1, String list2) {
"""
Compares the two comma-separated lists.
@param list1 The first list
@param list2 The second list
@return <code>true</code> if the lists are equal
"""
return new CommaListIterator(list1).equals(new CommaListIterator(list2));
} | java | public static boolean sameLists(String list1, String list2)
{
return new CommaListIterator(list1).equals(new CommaListIterator(list2));
} | [
"public",
"static",
"boolean",
"sameLists",
"(",
"String",
"list1",
",",
"String",
"list2",
")",
"{",
"return",
"new",
"CommaListIterator",
"(",
"list1",
")",
".",
"equals",
"(",
"new",
"CommaListIterator",
"(",
"list2",
")",
")",
";",
"}"
] | Compares the two comma-separated lists.
@param list1 The first list
@param list2 The second list
@return <code>true</code> if the lists are equal | [
"Compares",
"the",
"two",
"comma",
"-",
"separated",
"lists",
"."
] | train | https://github.com/kuali/ojb-1.0.4/blob/9a544372f67ce965f662cdc71609dd03683c8f04/src/xdoclet/java/src/xdoclet/modules/ojb/CommaListIterator.java#L143-L146 |
UrielCh/ovh-java-sdk | ovh-java-sdk-order/src/main/java/net/minidev/ovh/api/ApiOvhOrder.java | ApiOvhOrder.dedicatedCloud_serviceName_upgradeRessource_duration_GET | public OvhOrder dedicatedCloud_serviceName_upgradeRessource_duration_GET(String serviceName, String duration, OvhUpgradeTypeEnum upgradeType, Long upgradedRessourceId, OvhUpgradeRessourceTypeEnum upgradedRessourceType) throws IOException {
"""
Get prices and contracts information
REST: GET /order/dedicatedCloud... | java | public OvhOrder dedicatedCloud_serviceName_upgradeRessource_duration_GET(String serviceName, String duration, OvhUpgradeTypeEnum upgradeType, Long upgradedRessourceId, OvhUpgradeRessourceTypeEnum upgradedRessourceType) throws IOException {
String qPath = "/order/dedicatedCloud/{serviceName}/upgradeRessource/{duration... | [
"public",
"OvhOrder",
"dedicatedCloud_serviceName_upgradeRessource_duration_GET",
"(",
"String",
"serviceName",
",",
"String",
"duration",
",",
"OvhUpgradeTypeEnum",
"upgradeType",
",",
"Long",
"upgradedRessourceId",
",",
"OvhUpgradeRessourceTypeEnum",
"upgradedRessourceType",
")... | Get prices and contracts information
REST: GET /order/dedicatedCloud/{serviceName}/upgradeRessource/{duration}
@param upgradedRessourceType [required] The type of ressource you want to upgrade.
@param upgradedRessourceId [required] The id of a particular ressource you want to upgrade in your Private Cloud (useless for... | [
"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#L5755-L5763 |
validator/validator | src/nu/validator/xml/HtmlSerializer.java | HtmlSerializer.endElement | @Override
public void endElement(String namespaceURI, String localName, String qName)
throws SAXException {
"""
Writes an end tag if the element is an XHTML element and is not an empty
element in HTML 4.01 Strict.
@param namespaceURI
the XML namespace
@param localName
the element name in the... | java | @Override
public void endElement(String namespaceURI, String localName, String qName)
throws SAXException {
try {
if (XHTML_NS.equals(namespaceURI)
&& Arrays.binarySearch(emptyElements, localName) < 0) {
this.writer.write("</");
thi... | [
"@",
"Override",
"public",
"void",
"endElement",
"(",
"String",
"namespaceURI",
",",
"String",
"localName",
",",
"String",
"qName",
")",
"throws",
"SAXException",
"{",
"try",
"{",
"if",
"(",
"XHTML_NS",
".",
"equals",
"(",
"namespaceURI",
")",
"&&",
"Arrays"... | Writes an end tag if the element is an XHTML element and is not an empty
element in HTML 4.01 Strict.
@param namespaceURI
the XML namespace
@param localName
the element name in the namespace
@param qName
ignored
@throws SAXException
if there are IO problems | [
"Writes",
"an",
"end",
"tag",
"if",
"the",
"element",
"is",
"an",
"XHTML",
"element",
"and",
"is",
"not",
"an",
"empty",
"element",
"in",
"HTML",
"4",
".",
"01",
"Strict",
"."
] | train | https://github.com/validator/validator/blob/c7b7f85b3a364df7d9944753fb5b2cd0ce642889/src/nu/validator/xml/HtmlSerializer.java#L205-L218 |
box/box-java-sdk | src/main/java/com/box/sdk/BoxFile.java | BoxFile.getInfoWithRepresentations | public BoxFile.Info getInfoWithRepresentations(String representationHints, String... fields) {
"""
Gets information about this item including a specified set of representations.
@see <a href=https://developer.box.com/reference#section-x-rep-hints-header>X-Rep-Hints Header</a>
@param representationHints hints f... | java | public BoxFile.Info getInfoWithRepresentations(String representationHints, String... fields) {
if (representationHints.matches(Representation.X_REP_HINTS_PATTERN)) {
//Since the user intends to get representations, add it to fields, even if user has missed it
Set<String> fieldsSet = new ... | [
"public",
"BoxFile",
".",
"Info",
"getInfoWithRepresentations",
"(",
"String",
"representationHints",
",",
"String",
"...",
"fields",
")",
"{",
"if",
"(",
"representationHints",
".",
"matches",
"(",
"Representation",
".",
"X_REP_HINTS_PATTERN",
")",
")",
"{",
"//S... | Gets information about this item including a specified set of representations.
@see <a href=https://developer.box.com/reference#section-x-rep-hints-header>X-Rep-Hints Header</a>
@param representationHints hints for representations to be retrieved
@param fields the fields to retrieve.
@return info about this item conta... | [
"Gets",
"information",
"about",
"this",
"item",
"including",
"a",
"specified",
"set",
"of",
"representations",
".",
"@see",
"<a",
"href",
"=",
"https",
":",
"//",
"developer",
".",
"box",
".",
"com",
"/",
"reference#section",
"-",
"x",
"-",
"rep",
"-",
"... | train | https://github.com/box/box-java-sdk/blob/35b4ba69417f9d6a002c19dfaab57527750ef349/src/main/java/com/box/sdk/BoxFile.java#L474-L491 |
alkacon/opencms-core | src/org/opencms/util/CmsHtmlStripper.java | CmsHtmlStripper.addPreserveTags | public void addPreserveTags(final String tagList, final char separator) {
"""
Convenience method for adding several tags to preserve
in form of a delimiter-separated String.<p>
The String will be <code>{@link CmsStringUtil#splitAsList(String, char, boolean)}</code>
with <code>tagList</code> as the first argum... | java | public void addPreserveTags(final String tagList, final char separator) {
List<String> tags = CmsStringUtil.splitAsList(tagList, separator, true);
addPreserveTagList(tags);
} | [
"public",
"void",
"addPreserveTags",
"(",
"final",
"String",
"tagList",
",",
"final",
"char",
"separator",
")",
"{",
"List",
"<",
"String",
">",
"tags",
"=",
"CmsStringUtil",
".",
"splitAsList",
"(",
"tagList",
",",
"separator",
",",
"true",
")",
";",
"add... | Convenience method for adding several tags to preserve
in form of a delimiter-separated String.<p>
The String will be <code>{@link CmsStringUtil#splitAsList(String, char, boolean)}</code>
with <code>tagList</code> as the first argument, <code>separator</code> as the
second argument and the third argument set to true (... | [
"Convenience",
"method",
"for",
"adding",
"several",
"tags",
"to",
"preserve",
"in",
"form",
"of",
"a",
"delimiter",
"-",
"separated",
"String",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/util/CmsHtmlStripper.java#L140-L144 |
jcuda/jcusparse | JCusparseJava/src/main/java/jcuda/jcusparse/JCusparse.java | JCusparse.cusparseCdotci | public static int cusparseCdotci(
cusparseHandle handle,
int nnz,
Pointer xVal,
Pointer xInd,
Pointer y,
Pointer resultDevHostPtr,
int idxBase) {
"""
Description: dot product of complex conjugate of a sparse vector x
and a dense vector y.
""... | java | public static int cusparseCdotci(
cusparseHandle handle,
int nnz,
Pointer xVal,
Pointer xInd,
Pointer y,
Pointer resultDevHostPtr,
int idxBase)
{
return checkResult(cusparseCdotciNative(handle, nnz, xVal, xInd, y, resultDevHostPtr, idxBa... | [
"public",
"static",
"int",
"cusparseCdotci",
"(",
"cusparseHandle",
"handle",
",",
"int",
"nnz",
",",
"Pointer",
"xVal",
",",
"Pointer",
"xInd",
",",
"Pointer",
"y",
",",
"Pointer",
"resultDevHostPtr",
",",
"int",
"idxBase",
")",
"{",
"return",
"checkResult",
... | Description: dot product of complex conjugate of a sparse vector x
and a dense vector y. | [
"Description",
":",
"dot",
"product",
"of",
"complex",
"conjugate",
"of",
"a",
"sparse",
"vector",
"x",
"and",
"a",
"dense",
"vector",
"y",
"."
] | train | https://github.com/jcuda/jcusparse/blob/7687a62a4ef6b76cb91cf7da93d4cf5ade96a791/JCusparseJava/src/main/java/jcuda/jcusparse/JCusparse.java#L812-L822 |
authlete/authlete-java-common | src/main/java/com/authlete/common/util/TypedProperties.java | TypedProperties.setEnum | public <TEnum extends Enum<TEnum>> void setEnum(Enum<?> key, TEnum value) {
"""
Equivalent to {@link #setEnum(String, Enum)
setEnum}{@code (key.name(), value)}.
If {@code key} is null, nothing is done.
"""
if (key == null)
{
return;
}
setEnum(key.name(), value);
... | java | public <TEnum extends Enum<TEnum>> void setEnum(Enum<?> key, TEnum value)
{
if (key == null)
{
return;
}
setEnum(key.name(), value);
} | [
"public",
"<",
"TEnum",
"extends",
"Enum",
"<",
"TEnum",
">",
">",
"void",
"setEnum",
"(",
"Enum",
"<",
"?",
">",
"key",
",",
"TEnum",
"value",
")",
"{",
"if",
"(",
"key",
"==",
"null",
")",
"{",
"return",
";",
"}",
"setEnum",
"(",
"key",
".",
... | Equivalent to {@link #setEnum(String, Enum)
setEnum}{@code (key.name(), value)}.
If {@code key} is null, nothing is done. | [
"Equivalent",
"to",
"{"
] | train | https://github.com/authlete/authlete-java-common/blob/49c94c483713cbf5a04d805ff7dbd83766c9c964/src/main/java/com/authlete/common/util/TypedProperties.java#L772-L780 |
UrielCh/ovh-java-sdk | ovh-java-sdk-router/src/main/java/net/minidev/ovh/api/ApiOvhRouter.java | ApiOvhRouter.serviceName_vpn_id_PUT | public void serviceName_vpn_id_PUT(String serviceName, Long id, OvhVpn body) throws IOException {
"""
Alter this object properties
REST: PUT /router/{serviceName}/vpn/{id}
@param body [required] New object properties
@param serviceName [required] The internal name of your Router offer
@param id [required]
... | java | public void serviceName_vpn_id_PUT(String serviceName, Long id, OvhVpn body) throws IOException {
String qPath = "/router/{serviceName}/vpn/{id}";
StringBuilder sb = path(qPath, serviceName, id);
exec(qPath, "PUT", sb.toString(), body);
} | [
"public",
"void",
"serviceName_vpn_id_PUT",
"(",
"String",
"serviceName",
",",
"Long",
"id",
",",
"OvhVpn",
"body",
")",
"throws",
"IOException",
"{",
"String",
"qPath",
"=",
"\"/router/{serviceName}/vpn/{id}\"",
";",
"StringBuilder",
"sb",
"=",
"path",
"(",
"qPat... | Alter this object properties
REST: PUT /router/{serviceName}/vpn/{id}
@param body [required] New object properties
@param serviceName [required] The internal name of your Router offer
@param id [required] | [
"Alter",
"this",
"object",
"properties"
] | train | https://github.com/UrielCh/ovh-java-sdk/blob/6d531a40e56e09701943e334c25f90f640c55701/ovh-java-sdk-router/src/main/java/net/minidev/ovh/api/ApiOvhRouter.java#L90-L94 |
datacleaner/DataCleaner | components/pattern-finder/src/main/java/org/datacleaner/beans/stringpattern/PatternFinder.java | PatternFinder.run | public void run(final R row, final String value, final int distinctCount) {
"""
This method should be invoked by the user of the PatternFinder. Invoke it
for each value in your dataset. Repeated values are handled correctly but
if available it is more efficient to handle only the distinct values and
their corre... | java | public void run(final R row, final String value, final int distinctCount) {
final List<Token> tokens;
try {
tokens = _tokenizer.tokenize(value);
} catch (final RuntimeException e) {
throw new IllegalStateException("Error occurred while tokenizing value: " + value, e);
... | [
"public",
"void",
"run",
"(",
"final",
"R",
"row",
",",
"final",
"String",
"value",
",",
"final",
"int",
"distinctCount",
")",
"{",
"final",
"List",
"<",
"Token",
">",
"tokens",
";",
"try",
"{",
"tokens",
"=",
"_tokenizer",
".",
"tokenize",
"(",
"value... | This method should be invoked by the user of the PatternFinder. Invoke it
for each value in your dataset. Repeated values are handled correctly but
if available it is more efficient to handle only the distinct values and
their corresponding distinct counts.
@param row
the row containing the value
@param value
the stri... | [
"This",
"method",
"should",
"be",
"invoked",
"by",
"the",
"user",
"of",
"the",
"PatternFinder",
".",
"Invoke",
"it",
"for",
"each",
"value",
"in",
"your",
"dataset",
".",
"Repeated",
"values",
"are",
"handled",
"correctly",
"but",
"if",
"available",
"it",
... | train | https://github.com/datacleaner/DataCleaner/blob/9aa01fdac3560cef51c55df3cb2ac5c690b57639/components/pattern-finder/src/main/java/org/datacleaner/beans/stringpattern/PatternFinder.java#L71-L106 |
Baidu-AIP/java-sdk | src/main/java/com/baidu/aip/kg/AipKnowledgeGraphic.java | AipKnowledgeGraphic.getTaskStatus | public JSONObject getTaskStatus(int id, HashMap<String, String> options) {
"""
查询任务状态接口
查询指定的任务的最新执行状态
@param id - 任务ID
@param options - 可选参数对象,key: value都为string类型
options - options列表:
@return JSONObject
"""
AipRequest request = new AipRequest();
preOperation(request);
... | java | public JSONObject getTaskStatus(int id, HashMap<String, String> options) {
AipRequest request = new AipRequest();
preOperation(request);
request.addBody("id", id);
if (options != null) {
request.addBody(options);
}
request.setUri(KnowledgeGraphicConst... | [
"public",
"JSONObject",
"getTaskStatus",
"(",
"int",
"id",
",",
"HashMap",
"<",
"String",
",",
"String",
">",
"options",
")",
"{",
"AipRequest",
"request",
"=",
"new",
"AipRequest",
"(",
")",
";",
"preOperation",
"(",
"request",
")",
";",
"request",
".",
... | 查询任务状态接口
查询指定的任务的最新执行状态
@param id - 任务ID
@param options - 可选参数对象,key: value都为string类型
options - options列表:
@return JSONObject | [
"查询任务状态接口",
"查询指定的任务的最新执行状态"
] | train | https://github.com/Baidu-AIP/java-sdk/blob/16bb8b7bb8f9bbcb7c8af62d0a67a1e79eecad90/src/main/java/com/baidu/aip/kg/AipKnowledgeGraphic.java#L167-L178 |
OpenLiberty/open-liberty | dev/com.ibm.ws.webcontainer.security/src/com/ibm/ws/webcontainer/security/ReferrerURLCookieHandler.java | ReferrerURLCookieHandler.getReferrerURLFromCookies | @Sensitive
public String getReferrerURLFromCookies(HttpServletRequest req, String cookieName) {
"""
Retrieve the referrer URL from the HttpServletRequest's cookies.
This will decode the URL and restore the host name if it was removed.
@param req
@return referrerURL
"""
Cookie[] cookies = req.g... | java | @Sensitive
public String getReferrerURLFromCookies(HttpServletRequest req, String cookieName) {
Cookie[] cookies = req.getCookies();
String referrerURL = CookieHelper.getCookieValue(cookies, cookieName);
if (referrerURL != null) {
StringBuffer URL = req.getRequestURL();
... | [
"@",
"Sensitive",
"public",
"String",
"getReferrerURLFromCookies",
"(",
"HttpServletRequest",
"req",
",",
"String",
"cookieName",
")",
"{",
"Cookie",
"[",
"]",
"cookies",
"=",
"req",
".",
"getCookies",
"(",
")",
";",
"String",
"referrerURL",
"=",
"CookieHelper",... | Retrieve the referrer URL from the HttpServletRequest's cookies.
This will decode the URL and restore the host name if it was removed.
@param req
@return referrerURL | [
"Retrieve",
"the",
"referrer",
"URL",
"from",
"the",
"HttpServletRequest",
"s",
"cookies",
".",
"This",
"will",
"decode",
"the",
"URL",
"and",
"restore",
"the",
"host",
"name",
"if",
"it",
"was",
"removed",
"."
] | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.webcontainer.security/src/com/ibm/ws/webcontainer/security/ReferrerURLCookieHandler.java#L50-L60 |
mozilla/rhino | src/org/mozilla/javascript/ScriptableObject.java | ScriptableObject.deleteProperty | public static boolean deleteProperty(Scriptable obj, String name) {
"""
Removes the property from an object or its prototype chain.
<p>
Searches for a property with <code>name</code> in obj or
its prototype chain. If it is found, the object's delete
method is called.
@param obj a JavaScript object
@param nam... | java | public static boolean deleteProperty(Scriptable obj, String name)
{
Scriptable base = getBase(obj, name);
if (base == null)
return true;
base.delete(name);
return !base.has(name, obj);
} | [
"public",
"static",
"boolean",
"deleteProperty",
"(",
"Scriptable",
"obj",
",",
"String",
"name",
")",
"{",
"Scriptable",
"base",
"=",
"getBase",
"(",
"obj",
",",
"name",
")",
";",
"if",
"(",
"base",
"==",
"null",
")",
"return",
"true",
";",
"base",
".... | Removes the property from an object or its prototype chain.
<p>
Searches for a property with <code>name</code> in obj or
its prototype chain. If it is found, the object's delete
method is called.
@param obj a JavaScript object
@param name a property name
@return true if the property doesn't exist or was successfully re... | [
"Removes",
"the",
"property",
"from",
"an",
"object",
"or",
"its",
"prototype",
"chain",
".",
"<p",
">",
"Searches",
"for",
"a",
"property",
"with",
"<code",
">",
"name<",
"/",
"code",
">",
"in",
"obj",
"or",
"its",
"prototype",
"chain",
".",
"If",
"it... | train | https://github.com/mozilla/rhino/blob/fa8a86df11d37623f5faa8d445a5876612bc47b0/src/org/mozilla/javascript/ScriptableObject.java#L2579-L2586 |
bushidowallet/bushido-java-service | bushido-service-lib/src/main/java/com/bccapi/bitlib/model/CompactInt.java | CompactInt.toBytes | public static byte[] toBytes(long value) {
"""
Turn a long value into an array of bytes containing the CompactInt
representation.
@param value
The value to turn into an array of bytes.
@return an array of bytes.
"""
if (isLessThan(value, 253)) {
return new byte[] { (byte) value };
} ... | java | public static byte[] toBytes(long value) {
if (isLessThan(value, 253)) {
return new byte[] { (byte) value };
} else if (isLessThan(value, 65536)) {
return new byte[] { (byte) 253, (byte) (value), (byte) (value >> 8) };
} else if (isLessThan(value, 4294967295L)) {
byte[] byte... | [
"public",
"static",
"byte",
"[",
"]",
"toBytes",
"(",
"long",
"value",
")",
"{",
"if",
"(",
"isLessThan",
"(",
"value",
",",
"253",
")",
")",
"{",
"return",
"new",
"byte",
"[",
"]",
"{",
"(",
"byte",
")",
"value",
"}",
";",
"}",
"else",
"if",
"... | Turn a long value into an array of bytes containing the CompactInt
representation.
@param value
The value to turn into an array of bytes.
@return an array of bytes. | [
"Turn",
"a",
"long",
"value",
"into",
"an",
"array",
"of",
"bytes",
"containing",
"the",
"CompactInt",
"representation",
"."
] | train | https://github.com/bushidowallet/bushido-java-service/blob/e1a0157527e57459b509718044d2df44084876a2/bushido-service-lib/src/main/java/com/bccapi/bitlib/model/CompactInt.java#L97-L114 |
ReactiveX/RxJavaAsyncUtil | src/main/java/rx/util/async/operators/LatchedObserver.java | LatchedObserver.createIndexed | public static <T> LatchedObserver<T> createIndexed(Action2<? super T, ? super Integer> onNext) {
"""
Create a LatchedObserver with the given indexed callback function(s).
"""
return createIndexed(onNext, new CountDownLatch(1));
} | java | public static <T> LatchedObserver<T> createIndexed(Action2<? super T, ? super Integer> onNext) {
return createIndexed(onNext, new CountDownLatch(1));
} | [
"public",
"static",
"<",
"T",
">",
"LatchedObserver",
"<",
"T",
">",
"createIndexed",
"(",
"Action2",
"<",
"?",
"super",
"T",
",",
"?",
"super",
"Integer",
">",
"onNext",
")",
"{",
"return",
"createIndexed",
"(",
"onNext",
",",
"new",
"CountDownLatch",
"... | Create a LatchedObserver with the given indexed callback function(s). | [
"Create",
"a",
"LatchedObserver",
"with",
"the",
"given",
"indexed",
"callback",
"function",
"(",
"s",
")",
"."
] | train | https://github.com/ReactiveX/RxJavaAsyncUtil/blob/6294e1da30e639df79f76399906229314c14e74d/src/main/java/rx/util/async/operators/LatchedObserver.java#L165-L167 |
konmik/nucleus | nucleus/src/main/java/nucleus/view/NucleusLayout.java | NucleusLayout.getActivity | public Activity getActivity() {
"""
Returns the unwrapped activity of the view or throws an exception.
@return an unwrapped activity
"""
Context context = getContext();
while (!(context instanceof Activity) && context instanceof ContextWrapper)
context = ((ContextWrapper) context... | java | public Activity getActivity() {
Context context = getContext();
while (!(context instanceof Activity) && context instanceof ContextWrapper)
context = ((ContextWrapper) context).getBaseContext();
if (!(context instanceof Activity))
throw new IllegalStateException("Expected... | [
"public",
"Activity",
"getActivity",
"(",
")",
"{",
"Context",
"context",
"=",
"getContext",
"(",
")",
";",
"while",
"(",
"!",
"(",
"context",
"instanceof",
"Activity",
")",
"&&",
"context",
"instanceof",
"ContextWrapper",
")",
"context",
"=",
"(",
"(",
"C... | Returns the unwrapped activity of the view or throws an exception.
@return an unwrapped activity | [
"Returns",
"the",
"unwrapped",
"activity",
"of",
"the",
"view",
"or",
"throws",
"an",
"exception",
"."
] | train | https://github.com/konmik/nucleus/blob/b161484a2bbf66a7896a8c1f61fa7187856ca5f7/nucleus/src/main/java/nucleus/view/NucleusLayout.java#L76-L83 |
mygreen/super-csv-annotation | src/main/java/com/github/mygreen/supercsv/io/AbstractCsvAnnotationBeanWriter.java | AbstractCsvAnnotationBeanWriter.extractBeanValues | protected void extractBeanValues(final Object source, final String[] nameMapping) throws SuperCsvReflectionException {
"""
Extracts the bean values, using the supplied name mapping array.
@param source
the bean
@param nameMapping
the name mapping
@throws NullPointerException
if source or nameMapping are nu... | java | protected void extractBeanValues(final Object source, final String[] nameMapping) throws SuperCsvReflectionException {
Objects.requireNonNull(nameMapping, "the nameMapping array can't be null as it's used to map from fields to columns");
beanValues.clear();
for( ... | [
"protected",
"void",
"extractBeanValues",
"(",
"final",
"Object",
"source",
",",
"final",
"String",
"[",
"]",
"nameMapping",
")",
"throws",
"SuperCsvReflectionException",
"{",
"Objects",
".",
"requireNonNull",
"(",
"nameMapping",
",",
"\"the nameMapping array can't be n... | Extracts the bean values, using the supplied name mapping array.
@param source
the bean
@param nameMapping
the name mapping
@throws NullPointerException
if source or nameMapping are null
@throws SuperCsvReflectionException
if there was a reflection exception extracting the bean value | [
"Extracts",
"the",
"bean",
"values",
"using",
"the",
"supplied",
"name",
"mapping",
"array",
"."
] | train | https://github.com/mygreen/super-csv-annotation/blob/9910320cb6dc143be972c7d10d9ab5ffb09c3b84/src/main/java/com/github/mygreen/supercsv/io/AbstractCsvAnnotationBeanWriter.java#L183-L209 |
raydac/java-comment-preprocessor | jcp/src/main/java/com/igormaznitsa/meta/common/utils/Assertions.java | Assertions.assertNull | public static <T> T assertNull(@Nullable final String failMessage, @Nullable final T object) {
"""
Assert that value is null
@param <T> type of the object to check
@param failMessage the message to be provided for failure, can be null
@param object the object to check
@return the same input para... | java | public static <T> T assertNull(@Nullable final String failMessage, @Nullable final T object) {
if (object != null) {
final String txt = failMessage == null ? "Object must be NULL" : failMessage;
final AssertionError error = new AssertionError(txt);
MetaErrorListeners.fireError(txt, error);
t... | [
"public",
"static",
"<",
"T",
">",
"T",
"assertNull",
"(",
"@",
"Nullable",
"final",
"String",
"failMessage",
",",
"@",
"Nullable",
"final",
"T",
"object",
")",
"{",
"if",
"(",
"object",
"!=",
"null",
")",
"{",
"final",
"String",
"txt",
"=",
"failMessa... | Assert that value is null
@param <T> type of the object to check
@param failMessage the message to be provided for failure, can be null
@param object the object to check
@return the same input parameter if all is ok
@throws AssertionError it will be thrown if the value is not null
@since 1.1.0 | [
"Assert",
"that",
"value",
"is",
"null"
] | train | https://github.com/raydac/java-comment-preprocessor/blob/83ac87b575ac084914d77695a8c8673de3b8300c/jcp/src/main/java/com/igormaznitsa/meta/common/utils/Assertions.java#L90-L98 |
landawn/AbacusUtil | src/com/landawn/abacus/android/util/SQLiteExecutor.java | SQLiteExecutor.toList | static <T> List<T> toList(Class<T> targetClass, Cursor cursor) {
"""
Returns values from all rows associated with the specified <code>targetClass</code> if the specified <code>targetClass</code> is an entity class, otherwise, only returns values from first column.
@param targetClass entity class or specific col... | java | static <T> List<T> toList(Class<T> targetClass, Cursor cursor) {
return toList(targetClass, cursor, 0, Integer.MAX_VALUE);
} | [
"static",
"<",
"T",
">",
"List",
"<",
"T",
">",
"toList",
"(",
"Class",
"<",
"T",
">",
"targetClass",
",",
"Cursor",
"cursor",
")",
"{",
"return",
"toList",
"(",
"targetClass",
",",
"cursor",
",",
"0",
",",
"Integer",
".",
"MAX_VALUE",
")",
";",
"}... | Returns values from all rows associated with the specified <code>targetClass</code> if the specified <code>targetClass</code> is an entity class, otherwise, only returns values from first column.
@param targetClass entity class or specific column type.
@param cursor
@return | [
"Returns",
"values",
"from",
"all",
"rows",
"associated",
"with",
"the",
"specified",
"<code",
">",
"targetClass<",
"/",
"code",
">",
"if",
"the",
"specified",
"<code",
">",
"targetClass<",
"/",
"code",
">",
"is",
"an",
"entity",
"class",
"otherwise",
"only"... | train | https://github.com/landawn/AbacusUtil/blob/544b7720175d15e9329f83dd22a8cc5fa4515e12/src/com/landawn/abacus/android/util/SQLiteExecutor.java#L269-L271 |
line/centraldogma | server/src/main/java/com/linecorp/centraldogma/server/PluginGroup.java | PluginGroup.loadPlugins | @Nullable
static PluginGroup loadPlugins(ClassLoader classLoader, PluginTarget target, CentralDogmaConfig config) {
"""
Returns a new {@link PluginGroup} which holds the {@link Plugin}s loaded from the classpath.
{@code null} is returned if there is no {@link Plugin} whose target equals to the specified
{@co... | java | @Nullable
static PluginGroup loadPlugins(ClassLoader classLoader, PluginTarget target, CentralDogmaConfig config) {
requireNonNull(classLoader, "classLoader");
requireNonNull(target, "target");
requireNonNull(config, "config");
final ServiceLoader<Plugin> loader = ServiceLoader.load... | [
"@",
"Nullable",
"static",
"PluginGroup",
"loadPlugins",
"(",
"ClassLoader",
"classLoader",
",",
"PluginTarget",
"target",
",",
"CentralDogmaConfig",
"config",
")",
"{",
"requireNonNull",
"(",
"classLoader",
",",
"\"classLoader\"",
")",
";",
"requireNonNull",
"(",
"... | Returns a new {@link PluginGroup} which holds the {@link Plugin}s loaded from the classpath.
{@code null} is returned if there is no {@link Plugin} whose target equals to the specified
{@code target}.
@param classLoader which is used to load the {@link Plugin}s
@param target the {@link PluginTarget} which would be loa... | [
"Returns",
"a",
"new",
"{",
"@link",
"PluginGroup",
"}",
"which",
"holds",
"the",
"{",
"@link",
"Plugin",
"}",
"s",
"loaded",
"from",
"the",
"classpath",
".",
"{",
"@code",
"null",
"}",
"is",
"returned",
"if",
"there",
"is",
"no",
"{",
"@link",
"Plugin... | train | https://github.com/line/centraldogma/blob/b9e46c67fbc26628c2186ce2f46e7fb303c831e9/server/src/main/java/com/linecorp/centraldogma/server/PluginGroup.java#L75-L96 |
deeplearning4j/deeplearning4j | nd4j/nd4j-backends/nd4j-api-parent/nd4j-api/src/main/java/org/nd4j/autodiff/samediff/ops/SDBaseOps.java | SDBaseOps.reverseSequence | public SDVariable reverseSequence(String name, SDVariable x, SDVariable seq_lengths, int seqDim, int batchDim) {
"""
Reverse sequence op: for each slice along dimension seqDimension, the first seqLength values are reversed
@param name Name of the output variable
@param x Input variable
@param... | java | public SDVariable reverseSequence(String name, SDVariable x, SDVariable seq_lengths, int seqDim, int batchDim) {
SDVariable ret = f().reverseSequence(x, seq_lengths, seqDim, batchDim);
return updateVariableNameAndReference(ret, name);
} | [
"public",
"SDVariable",
"reverseSequence",
"(",
"String",
"name",
",",
"SDVariable",
"x",
",",
"SDVariable",
"seq_lengths",
",",
"int",
"seqDim",
",",
"int",
"batchDim",
")",
"{",
"SDVariable",
"ret",
"=",
"f",
"(",
")",
".",
"reverseSequence",
"(",
"x",
"... | Reverse sequence op: for each slice along dimension seqDimension, the first seqLength values are reversed
@param name Name of the output variable
@param x Input variable
@param seq_lengths Length of the sequences
@param seqDim Sequence dimension
@param batchDim Batch dimension
@return Reversed... | [
"Reverse",
"sequence",
"op",
":",
"for",
"each",
"slice",
"along",
"dimension",
"seqDimension",
"the",
"first",
"seqLength",
"values",
"are",
"reversed"
] | train | https://github.com/deeplearning4j/deeplearning4j/blob/effce52f2afd7eeb53c5bcca699fcd90bd06822f/nd4j/nd4j-backends/nd4j-api-parent/nd4j-api/src/main/java/org/nd4j/autodiff/samediff/ops/SDBaseOps.java#L1889-L1892 |
jeremybrooks/jinx | src/main/java/net/jeremybrooks/jinx/api/StatsApi.java | StatsApi.getPhotosetStats | public Stats getPhotosetStats(Date date, String photosetId) throws JinxException {
"""
Get the number of views on a photoset for a given date.
This method requires authentication with 'read' permission.
@param date stats will be returned for this date. Required.
@param photosetId id of the photoset to... | java | public Stats getPhotosetStats(Date date, String photosetId) throws JinxException {
JinxUtils.validateParams(date, photosetId);
Map<String, String> params = new TreeMap<>();
params.put("method", "flickr.stats.getPhotosetStats");
params.put("date", JinxUtils.formatDateAsYMD(date));
params.put("photose... | [
"public",
"Stats",
"getPhotosetStats",
"(",
"Date",
"date",
",",
"String",
"photosetId",
")",
"throws",
"JinxException",
"{",
"JinxUtils",
".",
"validateParams",
"(",
"date",
",",
"photosetId",
")",
";",
"Map",
"<",
"String",
",",
"String",
">",
"params",
"=... | Get the number of views on a photoset for a given date.
This method requires authentication with 'read' permission.
@param date stats will be returned for this date. Required.
@param photosetId id of the photoset to get stats for. Required.
@return number of views on a photoset for a given date.
@throws JinxExc... | [
"Get",
"the",
"number",
"of",
"views",
"on",
"a",
"photoset",
"for",
"a",
"given",
"date",
"."
] | train | https://github.com/jeremybrooks/jinx/blob/ab7a4b7462d08bcbfd9b98bd3f5029771c20f6c6/src/main/java/net/jeremybrooks/jinx/api/StatsApi.java#L310-L317 |
RobotiumTech/robotium | robotium-solo/src/main/java/com/robotium/solo/ViewFetcher.java | ViewFetcher.areViewsIdentical | private boolean areViewsIdentical(View firstView, View secondView) {
"""
Compares if the specified views are identical. This is used instead of View.compare
as it always returns false in cases where the View tree is refreshed.
@param firstView the first view
@param secondView the second view
@return true if ... | java | private boolean areViewsIdentical(View firstView, View secondView){
if(firstView.getId() != secondView.getId() || !firstView.getClass().isAssignableFrom(secondView.getClass())){
return false;
}
if (firstView.getParent() != null && firstView.getParent() instanceof View &&
secondView.getParent() != null &&... | [
"private",
"boolean",
"areViewsIdentical",
"(",
"View",
"firstView",
",",
"View",
"secondView",
")",
"{",
"if",
"(",
"firstView",
".",
"getId",
"(",
")",
"!=",
"secondView",
".",
"getId",
"(",
")",
"||",
"!",
"firstView",
".",
"getClass",
"(",
")",
".",
... | Compares if the specified views are identical. This is used instead of View.compare
as it always returns false in cases where the View tree is refreshed.
@param firstView the first view
@param secondView the second view
@return true if views are equal | [
"Compares",
"if",
"the",
"specified",
"views",
"are",
"identical",
".",
"This",
"is",
"used",
"instead",
"of",
"View",
".",
"compare",
"as",
"it",
"always",
"returns",
"false",
"in",
"cases",
"where",
"the",
"View",
"tree",
"is",
"refreshed",
"."
] | train | https://github.com/RobotiumTech/robotium/blob/75e567c38f26a6a87dc8bef90b3886a20e28d291/robotium-solo/src/main/java/com/robotium/solo/ViewFetcher.java#L534-L546 |
Crab2died/Excel4J | src/main/java/com/github/crab2died/ExcelUtils.java | ExcelUtils.noTemplateSheet2Excel | public void noTemplateSheet2Excel(List<NoTemplateSheetWrapper> sheets, String targetPath)
throws Excel4JException, IOException {
"""
无模板、基于注解、多sheet数据
@param sheets 待导出sheet数据
@param targetPath 生成的Excel输出全路径
@throws Excel4JException 异常
@throws IOException 异常
"""
try (OutputS... | java | public void noTemplateSheet2Excel(List<NoTemplateSheetWrapper> sheets, String targetPath)
throws Excel4JException, IOException {
try (OutputStream fos = new FileOutputStream(targetPath);
Workbook workbook = exportExcelNoTemplateHandler(sheets, true)) {
workbook.write(fos);
... | [
"public",
"void",
"noTemplateSheet2Excel",
"(",
"List",
"<",
"NoTemplateSheetWrapper",
">",
"sheets",
",",
"String",
"targetPath",
")",
"throws",
"Excel4JException",
",",
"IOException",
"{",
"try",
"(",
"OutputStream",
"fos",
"=",
"new",
"FileOutputStream",
"(",
"... | 无模板、基于注解、多sheet数据
@param sheets 待导出sheet数据
@param targetPath 生成的Excel输出全路径
@throws Excel4JException 异常
@throws IOException 异常 | [
"无模板、基于注解、多sheet数据"
] | train | https://github.com/Crab2died/Excel4J/blob/2ab0a3b8226a69ff868c3ead6e724f3a774f5f77/src/main/java/com/github/crab2died/ExcelUtils.java#L1128-L1135 |
couchbase/couchbase-java-client | src/main/java/com/couchbase/client/java/query/dsl/functions/DateFunctions.java | DateFunctions.millisToStr | public static Expression millisToStr(String expression, String format) {
"""
Returned expression results in the string in the supported format to which
the UNIX milliseconds has been converted.
"""
return millisToStr(x(expression), format);
} | java | public static Expression millisToStr(String expression, String format) {
return millisToStr(x(expression), format);
} | [
"public",
"static",
"Expression",
"millisToStr",
"(",
"String",
"expression",
",",
"String",
"format",
")",
"{",
"return",
"millisToStr",
"(",
"x",
"(",
"expression",
")",
",",
"format",
")",
";",
"}"
] | Returned expression results in the string in the supported format to which
the UNIX milliseconds has been converted. | [
"Returned",
"expression",
"results",
"in",
"the",
"string",
"in",
"the",
"supported",
"format",
"to",
"which",
"the",
"UNIX",
"milliseconds",
"has",
"been",
"converted",
"."
] | train | https://github.com/couchbase/couchbase-java-client/blob/f36a0ee0c66923bdde47838ca543e50cbaa99e14/src/main/java/com/couchbase/client/java/query/dsl/functions/DateFunctions.java#L243-L245 |
micronaut-projects/micronaut-core | inject/src/main/java/io/micronaut/inject/annotation/AnnotationMetadataSupport.java | AnnotationMetadataSupport.registerDefaultValues | static void registerDefaultValues(String annotation, Map<String, Object> defaultValues) {
"""
Registers default values for the given annotation and values.
@param annotation The annotation
@param defaultValues The default values
"""
if (StringUtils.isNotEmpty(annotation)) {
ANNOTATION_D... | java | static void registerDefaultValues(String annotation, Map<String, Object> defaultValues) {
if (StringUtils.isNotEmpty(annotation)) {
ANNOTATION_DEFAULTS.put(annotation.intern(), defaultValues);
}
} | [
"static",
"void",
"registerDefaultValues",
"(",
"String",
"annotation",
",",
"Map",
"<",
"String",
",",
"Object",
">",
"defaultValues",
")",
"{",
"if",
"(",
"StringUtils",
".",
"isNotEmpty",
"(",
"annotation",
")",
")",
"{",
"ANNOTATION_DEFAULTS",
".",
"put",
... | Registers default values for the given annotation and values.
@param annotation The annotation
@param defaultValues The default values | [
"Registers",
"default",
"values",
"for",
"the",
"given",
"annotation",
"and",
"values",
"."
] | train | https://github.com/micronaut-projects/micronaut-core/blob/c31f5b03ce0eb88c2f6470710987db03b8967d5c/inject/src/main/java/io/micronaut/inject/annotation/AnnotationMetadataSupport.java#L166-L170 |
elki-project/elki | elki-index-various/src/main/java/de/lmu/ifi/dbs/elki/index/invertedlist/InMemoryInvertedIndex.java | InMemoryInvertedIndex.naiveQuery | private double naiveQuery(V obj, WritableDoubleDataStore scores, HashSetModifiableDBIDs cands) {
"""
Query the most similar objects, abstract version.
@param obj Query object
@param scores Score storage (must be initialized with zeros!)
@param cands Non-zero objects set (must be empty)
@return Result
"""... | java | private double naiveQuery(V obj, WritableDoubleDataStore scores, HashSetModifiableDBIDs cands) {
if(obj instanceof SparseNumberVector) {
return naiveQuerySparse((SparseNumberVector) obj, scores, cands);
}
else {
return naiveQueryDense(obj, scores, cands);
}
} | [
"private",
"double",
"naiveQuery",
"(",
"V",
"obj",
",",
"WritableDoubleDataStore",
"scores",
",",
"HashSetModifiableDBIDs",
"cands",
")",
"{",
"if",
"(",
"obj",
"instanceof",
"SparseNumberVector",
")",
"{",
"return",
"naiveQuerySparse",
"(",
"(",
"SparseNumberVecto... | Query the most similar objects, abstract version.
@param obj Query object
@param scores Score storage (must be initialized with zeros!)
@param cands Non-zero objects set (must be empty)
@return Result | [
"Query",
"the",
"most",
"similar",
"objects",
"abstract",
"version",
"."
] | train | https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-index-various/src/main/java/de/lmu/ifi/dbs/elki/index/invertedlist/InMemoryInvertedIndex.java#L239-L246 |
UrielCh/ovh-java-sdk | ovh-java-sdk-licensevirtuozzo/src/main/java/net/minidev/ovh/api/ApiOvhLicensevirtuozzo.java | ApiOvhLicensevirtuozzo.orderableVersions_GET | public ArrayList<OvhVirtuozzoOrderConfiguration> orderableVersions_GET(String ip) throws IOException {
"""
Get the orderable Virtuozzo versions
REST: GET /license/virtuozzo/orderableVersions
@param ip [required] Your license Ip
"""
String qPath = "/license/virtuozzo/orderableVersions";
StringBuilder sb... | java | public ArrayList<OvhVirtuozzoOrderConfiguration> orderableVersions_GET(String ip) throws IOException {
String qPath = "/license/virtuozzo/orderableVersions";
StringBuilder sb = path(qPath);
query(sb, "ip", ip);
String resp = exec(qPath, "GET", sb.toString(), null);
return convertTo(resp, t4);
} | [
"public",
"ArrayList",
"<",
"OvhVirtuozzoOrderConfiguration",
">",
"orderableVersions_GET",
"(",
"String",
"ip",
")",
"throws",
"IOException",
"{",
"String",
"qPath",
"=",
"\"/license/virtuozzo/orderableVersions\"",
";",
"StringBuilder",
"sb",
"=",
"path",
"(",
"qPath",... | Get the orderable Virtuozzo versions
REST: GET /license/virtuozzo/orderableVersions
@param ip [required] Your license Ip | [
"Get",
"the",
"orderable",
"Virtuozzo",
"versions"
] | train | https://github.com/UrielCh/ovh-java-sdk/blob/6d531a40e56e09701943e334c25f90f640c55701/ovh-java-sdk-licensevirtuozzo/src/main/java/net/minidev/ovh/api/ApiOvhLicensevirtuozzo.java#L257-L263 |
indeedeng/util | util-core/src/main/java/com/indeed/util/core/sort/Quicksortables.java | Quicksortables.heapSort | public static void heapSort(Quicksortable q, int size) {
"""
sorts the elements in q using the heapsort method
@param q The quicksortable to heapsort.
@param size The size of the quicksortable.
"""
q = reverseQuicksortable(q);
makeHeap(q, size);
sortheap(q, size);
} | java | public static void heapSort(Quicksortable q, int size) {
q = reverseQuicksortable(q);
makeHeap(q, size);
sortheap(q, size);
} | [
"public",
"static",
"void",
"heapSort",
"(",
"Quicksortable",
"q",
",",
"int",
"size",
")",
"{",
"q",
"=",
"reverseQuicksortable",
"(",
"q",
")",
";",
"makeHeap",
"(",
"q",
",",
"size",
")",
";",
"sortheap",
"(",
"q",
",",
"size",
")",
";",
"}"
] | sorts the elements in q using the heapsort method
@param q The quicksortable to heapsort.
@param size The size of the quicksortable. | [
"sorts",
"the",
"elements",
"in",
"q",
"using",
"the",
"heapsort",
"method"
] | train | https://github.com/indeedeng/util/blob/332008426cf14b57e7fc3e817d9423e3f84fb922/util-core/src/main/java/com/indeed/util/core/sort/Quicksortables.java#L241-L245 |
dnsjava/dnsjava | org/xbill/DNS/ReverseMap.java | ReverseMap.fromAddress | public static Name
fromAddress(String addr, int family) throws UnknownHostException {
"""
Creates a reverse map name corresponding to an address contained in
a String.
@param addr The address from which to build a name.
@return The name corresponding to the address in the reverse map.
@throws UnknownHostExcept... | java | public static Name
fromAddress(String addr, int family) throws UnknownHostException {
byte [] array = Address.toByteArray(addr, family);
if (array == null)
throw new UnknownHostException("Invalid IP address");
return fromAddress(array);
} | [
"public",
"static",
"Name",
"fromAddress",
"(",
"String",
"addr",
",",
"int",
"family",
")",
"throws",
"UnknownHostException",
"{",
"byte",
"[",
"]",
"array",
"=",
"Address",
".",
"toByteArray",
"(",
"addr",
",",
"family",
")",
";",
"if",
"(",
"array",
"... | Creates a reverse map name corresponding to an address contained in
a String.
@param addr The address from which to build a name.
@return The name corresponding to the address in the reverse map.
@throws UnknownHostException The string does not contain a valid address. | [
"Creates",
"a",
"reverse",
"map",
"name",
"corresponding",
"to",
"an",
"address",
"contained",
"in",
"a",
"String",
"."
] | train | https://github.com/dnsjava/dnsjava/blob/d97b6a0685d59143372bb392ab591dd8dd840b61/org/xbill/DNS/ReverseMap.java#L105-L111 |
lukin0110/poeditor-java | src/main/java/be/lukin/poeditor/POEditorClient.java | POEditorClient.addContributor | public boolean addContributor(String projectId, String name, String email, String language) {
"""
Add/create a contributor for a language of a project
@param projectId id of the project
@param name name of the contributor
@param email email of the contributor
@param language language for the contributor
@re... | java | public boolean addContributor(String projectId, String name, String email, String language){
ResponseWrapper wrapper = service.addProjectMember(Action.ADD_CONTRIBUTOR, apiKey, projectId, name, email, language, 0);
ApiUtils.checkResponse(wrapper.response);
return "200".equals(wrapper.response.cod... | [
"public",
"boolean",
"addContributor",
"(",
"String",
"projectId",
",",
"String",
"name",
",",
"String",
"email",
",",
"String",
"language",
")",
"{",
"ResponseWrapper",
"wrapper",
"=",
"service",
".",
"addProjectMember",
"(",
"Action",
".",
"ADD_CONTRIBUTOR",
"... | Add/create a contributor for a language of a project
@param projectId id of the project
@param name name of the contributor
@param email email of the contributor
@param language language for the contributor
@return boolean if the contributor has been added | [
"Add",
"/",
"create",
"a",
"contributor",
"for",
"a",
"language",
"of",
"a",
"project"
] | train | https://github.com/lukin0110/poeditor-java/blob/42a2cd3136da1276b29a57a483c94050cc7d1d01/src/main/java/be/lukin/poeditor/POEditorClient.java#L197-L201 |
alkacon/opencms-core | src/org/opencms/widgets/A_CmsAdeGalleryWidget.java | A_CmsAdeGalleryWidget.getWidgetConfiguration | protected CmsGalleryWidgetConfiguration getWidgetConfiguration(
CmsObject cms,
CmsMessages messages,
I_CmsWidgetParameter param) {
"""
Returns the widget configuration.<p>
@param cms an initialized instance of a CmsObject
@param messages the dialog where the widget is used on
@param pa... | java | protected CmsGalleryWidgetConfiguration getWidgetConfiguration(
CmsObject cms,
CmsMessages messages,
I_CmsWidgetParameter param) {
if (m_widgetConfiguration == null) {
m_widgetConfiguration = new CmsGalleryWidgetConfiguration(cms, messages, param, getConfiguration());
... | [
"protected",
"CmsGalleryWidgetConfiguration",
"getWidgetConfiguration",
"(",
"CmsObject",
"cms",
",",
"CmsMessages",
"messages",
",",
"I_CmsWidgetParameter",
"param",
")",
"{",
"if",
"(",
"m_widgetConfiguration",
"==",
"null",
")",
"{",
"m_widgetConfiguration",
"=",
"ne... | Returns the widget configuration.<p>
@param cms an initialized instance of a CmsObject
@param messages the dialog where the widget is used on
@param param the widget parameter to generate the widget for
@return the widget configuration | [
"Returns",
"the",
"widget",
"configuration",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/widgets/A_CmsAdeGalleryWidget.java#L451-L460 |
Azure/azure-sdk-for-java | network/resource-manager/v2017_10_01/src/main/java/com/microsoft/azure/management/network/v2017_10_01/implementation/VirtualNetworkPeeringsInner.java | VirtualNetworkPeeringsInner.beginCreateOrUpdate | public VirtualNetworkPeeringInner beginCreateOrUpdate(String resourceGroupName, String virtualNetworkName, String virtualNetworkPeeringName, VirtualNetworkPeeringInner virtualNetworkPeeringParameters) {
"""
Creates or updates a peering in the specified virtual network.
@param resourceGroupName The name of the r... | java | public VirtualNetworkPeeringInner beginCreateOrUpdate(String resourceGroupName, String virtualNetworkName, String virtualNetworkPeeringName, VirtualNetworkPeeringInner virtualNetworkPeeringParameters) {
return beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, virtualNetworkName, virtualNetworkPeeri... | [
"public",
"VirtualNetworkPeeringInner",
"beginCreateOrUpdate",
"(",
"String",
"resourceGroupName",
",",
"String",
"virtualNetworkName",
",",
"String",
"virtualNetworkPeeringName",
",",
"VirtualNetworkPeeringInner",
"virtualNetworkPeeringParameters",
")",
"{",
"return",
"beginCrea... | Creates or updates a peering in the specified virtual network.
@param resourceGroupName The name of the resource group.
@param virtualNetworkName The name of the virtual network.
@param virtualNetworkPeeringName The name of the peering.
@param virtualNetworkPeeringParameters Parameters supplied to the create or update... | [
"Creates",
"or",
"updates",
"a",
"peering",
"in",
"the",
"specified",
"virtual",
"network",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/network/resource-manager/v2017_10_01/src/main/java/com/microsoft/azure/management/network/v2017_10_01/implementation/VirtualNetworkPeeringsInner.java#L444-L446 |
revapi/revapi | revapi/src/main/java/org/revapi/AnalysisResult.java | AnalysisResult.fakeFailure | public static AnalysisResult fakeFailure(Exception failure) {
"""
Similar to {@link #fakeSuccess()}, this returns a failed analysis result without the need to run any analysis.
@param failure the failure to report
@return a "fake" failed analysis result
"""
return new AnalysisResult(failure, new Ex... | java | public static AnalysisResult fakeFailure(Exception failure) {
return new AnalysisResult(failure, new Extensions(Collections.emptyMap(), Collections.emptyMap(),
Collections.emptyMap(), Collections.emptyMap()));
} | [
"public",
"static",
"AnalysisResult",
"fakeFailure",
"(",
"Exception",
"failure",
")",
"{",
"return",
"new",
"AnalysisResult",
"(",
"failure",
",",
"new",
"Extensions",
"(",
"Collections",
".",
"emptyMap",
"(",
")",
",",
"Collections",
".",
"emptyMap",
"(",
")... | Similar to {@link #fakeSuccess()}, this returns a failed analysis result without the need to run any analysis.
@param failure the failure to report
@return a "fake" failed analysis result | [
"Similar",
"to",
"{",
"@link",
"#fakeSuccess",
"()",
"}",
"this",
"returns",
"a",
"failed",
"analysis",
"result",
"without",
"the",
"need",
"to",
"run",
"any",
"analysis",
"."
] | train | https://github.com/revapi/revapi/blob/e070b136d977441ab96fdce067a13e7e0423295b/revapi/src/main/java/org/revapi/AnalysisResult.java#L69-L72 |
aws/aws-sdk-java | aws-java-sdk-core/src/main/java/com/amazonaws/util/RuntimeHttpUtils.java | RuntimeHttpUtils.fetchFile | @SuppressWarnings("deprecation")
public static InputStream fetchFile(
final URI uri,
final ClientConfiguration config) throws IOException {
"""
Fetches a file from the URI given and returns an input stream to it.
@param uri the uri of the file to fetch
@param config optional configu... | java | @SuppressWarnings("deprecation")
public static InputStream fetchFile(
final URI uri,
final ClientConfiguration config) throws IOException {
HttpParams httpClientParams = new BasicHttpParams();
HttpProtocolParams.setUserAgent(
httpClientParams, getUserAgent(co... | [
"@",
"SuppressWarnings",
"(",
"\"deprecation\"",
")",
"public",
"static",
"InputStream",
"fetchFile",
"(",
"final",
"URI",
"uri",
",",
"final",
"ClientConfiguration",
"config",
")",
"throws",
"IOException",
"{",
"HttpParams",
"httpClientParams",
"=",
"new",
"BasicHt... | Fetches a file from the URI given and returns an input stream to it.
@param uri the uri of the file to fetch
@param config optional configuration overrides
@return an InputStream containing the retrieved data
@throws IOException on error | [
"Fetches",
"a",
"file",
"from",
"the",
"URI",
"given",
"and",
"returns",
"an",
"input",
"stream",
"to",
"it",
"."
] | train | https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-core/src/main/java/com/amazonaws/util/RuntimeHttpUtils.java#L60-L109 |
Azure/azure-sdk-for-java | batch/data-plane/src/main/java/com/microsoft/azure/batch/PoolOperations.java | PoolOperations.enableAutoScale | public void enableAutoScale(String poolId, String autoScaleFormula) throws BatchErrorException, IOException {
"""
Enables automatic scaling on the specified pool.
@param poolId
The ID of the pool.
@param autoScaleFormula
The formula for the desired number of compute nodes in the pool.
@throws BatchErrorExce... | java | public void enableAutoScale(String poolId, String autoScaleFormula) throws BatchErrorException, IOException {
enableAutoScale(poolId, autoScaleFormula, null, null);
} | [
"public",
"void",
"enableAutoScale",
"(",
"String",
"poolId",
",",
"String",
"autoScaleFormula",
")",
"throws",
"BatchErrorException",
",",
"IOException",
"{",
"enableAutoScale",
"(",
"poolId",
",",
"autoScaleFormula",
",",
"null",
",",
"null",
")",
";",
"}"
] | Enables automatic scaling on the specified pool.
@param poolId
The ID of the pool.
@param autoScaleFormula
The formula for the desired number of compute nodes in the pool.
@throws BatchErrorException
Exception thrown when an error response is received from the
Batch service.
@throws IOException
Exception thrown when t... | [
"Enables",
"automatic",
"scaling",
"on",
"the",
"specified",
"pool",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/batch/data-plane/src/main/java/com/microsoft/azure/batch/PoolOperations.java#L690-L692 |
googleapis/google-cloud-java | google-cloud-clients/google-cloud-dataproc/src/main/java/com/google/cloud/dataproc/v1/JobControllerClient.java | JobControllerClient.submitJob | public final Job submitJob(String projectId, String region, Job job) {
"""
Submits a job to a cluster.
<p>Sample code:
<pre><code>
try (JobControllerClient jobControllerClient = JobControllerClient.create()) {
String projectId = "";
String region = "";
Job job = Job.newBuilder().build();
Job response = ... | java | public final Job submitJob(String projectId, String region, Job job) {
SubmitJobRequest request =
SubmitJobRequest.newBuilder().setProjectId(projectId).setRegion(region).setJob(job).build();
return submitJob(request);
} | [
"public",
"final",
"Job",
"submitJob",
"(",
"String",
"projectId",
",",
"String",
"region",
",",
"Job",
"job",
")",
"{",
"SubmitJobRequest",
"request",
"=",
"SubmitJobRequest",
".",
"newBuilder",
"(",
")",
".",
"setProjectId",
"(",
"projectId",
")",
".",
"se... | Submits a job to a cluster.
<p>Sample code:
<pre><code>
try (JobControllerClient jobControllerClient = JobControllerClient.create()) {
String projectId = "";
String region = "";
Job job = Job.newBuilder().build();
Job response = jobControllerClient.submitJob(projectId, region, job);
}
</code></pre>
@param projectId ... | [
"Submits",
"a",
"job",
"to",
"a",
"cluster",
"."
] | train | https://github.com/googleapis/google-cloud-java/blob/d2f0bc64a53049040fe9c9d338b12fab3dd1ad6a/google-cloud-clients/google-cloud-dataproc/src/main/java/com/google/cloud/dataproc/v1/JobControllerClient.java#L179-L184 |
powermock/powermock | powermock-api/powermock-api-support/src/main/java/org/powermock/api/support/Stubber.java | Stubber.stubMethod | public static void stubMethod(Class<?> declaringClass, String methodName, Object returnObject) {
"""
Add a method that should be intercepted and return another value (
{@code returnObject}) (i.e. the method is stubbed).
"""
if (declaringClass == null) {
throw new IllegalArgumentException("declaringClass ... | java | public static void stubMethod(Class<?> declaringClass, String methodName, Object returnObject) {
if (declaringClass == null) {
throw new IllegalArgumentException("declaringClass cannot be null");
}
if (methodName == null || methodName.length() == 0) {
throw new IllegalArgumentException("methodName cannot be... | [
"public",
"static",
"void",
"stubMethod",
"(",
"Class",
"<",
"?",
">",
"declaringClass",
",",
"String",
"methodName",
",",
"Object",
"returnObject",
")",
"{",
"if",
"(",
"declaringClass",
"==",
"null",
")",
"{",
"throw",
"new",
"IllegalArgumentException",
"(",... | Add a method that should be intercepted and return another value (
{@code returnObject}) (i.e. the method is stubbed). | [
"Add",
"a",
"method",
"that",
"should",
"be",
"intercepted",
"and",
"return",
"another",
"value",
"(",
"{"
] | train | https://github.com/powermock/powermock/blob/e8cd68026c284c6a7efe66959809eeebd8d1f9ad/powermock-api/powermock-api-support/src/main/java/org/powermock/api/support/Stubber.java#L38-L55 |
OpenLiberty/open-liberty | dev/com.ibm.ws.kernel.feature.cmdline/src/com/ibm/ws/kernel/feature/internal/generator/ManifestFileProcessor.java | ManifestFileProcessor.getUsrProductFeatureDefinitions | private Map<String, ProvisioningFeatureDefinition> getUsrProductFeatureDefinitions() {
"""
Retrieves a Map of feature definitions in default usr product extension location
@return Null if the user directory cannot be found. An empty map if the features manifests cannot
be found. A Map of product extension feat... | java | private Map<String, ProvisioningFeatureDefinition> getUsrProductFeatureDefinitions() {
Map<String, ProvisioningFeatureDefinition> features = null;
File userDir = Utils.getUserDir();
if (userDir != null && userDir.exists()) {
File userFeatureDir = new File(userDir, USER_FEATURE_DIR);
... | [
"private",
"Map",
"<",
"String",
",",
"ProvisioningFeatureDefinition",
">",
"getUsrProductFeatureDefinitions",
"(",
")",
"{",
"Map",
"<",
"String",
",",
"ProvisioningFeatureDefinition",
">",
"features",
"=",
"null",
";",
"File",
"userDir",
"=",
"Utils",
".",
"getU... | Retrieves a Map of feature definitions in default usr product extension location
@return Null if the user directory cannot be found. An empty map if the features manifests cannot
be found. A Map of product extension features if all goes well. | [
"Retrieves",
"a",
"Map",
"of",
"feature",
"definitions",
"in",
"default",
"usr",
"product",
"extension",
"location"
] | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.kernel.feature.cmdline/src/com/ibm/ws/kernel/feature/internal/generator/ManifestFileProcessor.java#L287-L313 |
xetorthio/jedis | src/main/java/redis/clients/jedis/BinaryJedis.java | BinaryJedis.sismember | @Override
public Boolean sismember(final byte[] key, final byte[] member) {
"""
Return true if member is a member of the set stored at key, otherwise false is returned.
<p>
Time complexity O(1)
@param key
@param member
@return Boolean reply, specifically: true if the element is a member of the set false if ... | java | @Override
public Boolean sismember(final byte[] key, final byte[] member) {
checkIsInMultiOrPipeline();
client.sismember(key, member);
return client.getIntegerReply() == 1;
} | [
"@",
"Override",
"public",
"Boolean",
"sismember",
"(",
"final",
"byte",
"[",
"]",
"key",
",",
"final",
"byte",
"[",
"]",
"member",
")",
"{",
"checkIsInMultiOrPipeline",
"(",
")",
";",
"client",
".",
"sismember",
"(",
"key",
",",
"member",
")",
";",
"r... | Return true if member is a member of the set stored at key, otherwise false is returned.
<p>
Time complexity O(1)
@param key
@param member
@return Boolean reply, specifically: true if the element is a member of the set false if the element
is not a member of the set OR if the key does not exist | [
"Return",
"true",
"if",
"member",
"is",
"a",
"member",
"of",
"the",
"set",
"stored",
"at",
"key",
"otherwise",
"false",
"is",
"returned",
".",
"<p",
">",
"Time",
"complexity",
"O",
"(",
"1",
")"
] | train | https://github.com/xetorthio/jedis/blob/ef4ab403f9d8fd88bd05092fea96de2e9db0bede/src/main/java/redis/clients/jedis/BinaryJedis.java#L1496-L1501 |
looly/hutool | hutool-cron/src/main/java/cn/hutool/cron/Scheduler.java | Scheduler.schedule | public String schedule(String pattern, Task task) {
"""
新增Task,使用随机UUID
@param pattern {@link CronPattern}对应的String表达式
@param task {@link Task}
@return ID
"""
String id = UUID.randomUUID().toString();
schedule(id, pattern, task);
return id;
} | java | public String schedule(String pattern, Task task) {
String id = UUID.randomUUID().toString();
schedule(id, pattern, task);
return id;
} | [
"public",
"String",
"schedule",
"(",
"String",
"pattern",
",",
"Task",
"task",
")",
"{",
"String",
"id",
"=",
"UUID",
".",
"randomUUID",
"(",
")",
".",
"toString",
"(",
")",
";",
"schedule",
"(",
"id",
",",
"pattern",
",",
"task",
")",
";",
"return",... | 新增Task,使用随机UUID
@param pattern {@link CronPattern}对应的String表达式
@param task {@link Task}
@return ID | [
"新增Task,使用随机UUID"
] | train | https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-cron/src/main/java/cn/hutool/cron/Scheduler.java#L217-L221 |
primefaces/primefaces | src/main/java/org/primefaces/component/imagecropper/ImageCropperRenderer.java | ImageCropperRenderer.getImageResource | private Resource getImageResource(FacesContext facesContext, ImageCropper imageCropper) {
"""
Attempt to obtain the resource from the server by parsing the valueExpression of the image attribute. Returns null
if the valueExpression is not of the form #{resource['path/to/resource']} or #{resource['library:name']}.... | java | private Resource getImageResource(FacesContext facesContext, ImageCropper imageCropper) {
Resource resource = null;
ValueExpression imageValueExpression = imageCropper.getValueExpression(ImageCropper.PropertyKeys.image.toString());
if (imageValueExpression != null) {
String imageVa... | [
"private",
"Resource",
"getImageResource",
"(",
"FacesContext",
"facesContext",
",",
"ImageCropper",
"imageCropper",
")",
"{",
"Resource",
"resource",
"=",
"null",
";",
"ValueExpression",
"imageValueExpression",
"=",
"imageCropper",
".",
"getValueExpression",
"(",
"Imag... | Attempt to obtain the resource from the server by parsing the valueExpression of the image attribute. Returns null
if the valueExpression is not of the form #{resource['path/to/resource']} or #{resource['library:name']}. Otherwise
returns the value obtained by ResourceHandler.createResource(). | [
"Attempt",
"to",
"obtain",
"the",
"resource",
"from",
"the",
"server",
"by",
"parsing",
"the",
"valueExpression",
"of",
"the",
"image",
"attribute",
".",
"Returns",
"null",
"if",
"the",
"valueExpression",
"is",
"not",
"of",
"the",
"form",
"#",
"{",
"resource... | train | https://github.com/primefaces/primefaces/blob/b8cdd5ed395d09826e40e3302d6b14901d3ef4e7/src/main/java/org/primefaces/component/imagecropper/ImageCropperRenderer.java#L237-L276 |
looly/hutool | hutool-db/src/main/java/cn/hutool/db/sql/SqlExecutor.java | SqlExecutor.executeForGeneratedKey | public static Long executeForGeneratedKey(Connection conn, String sql, Object... params) throws SQLException {
"""
执行非查询语句,返回主键<br>
发查询语句包括 插入、更新、删除<br>
此方法不会关闭Connection
@param conn 数据库连接对象
@param sql SQL
@param params 参数
@return 主键
@throws SQLException SQL执行异常
"""
PreparedStatement ps = null;
Re... | java | public static Long executeForGeneratedKey(Connection conn, String sql, Object... params) throws SQLException {
PreparedStatement ps = null;
ResultSet rs = null;
try {
ps = StatementUtil.prepareStatement(conn, sql, params);
ps.executeUpdate();
rs = ps.getGeneratedKeys();
if (rs != null && rs.next()) {
... | [
"public",
"static",
"Long",
"executeForGeneratedKey",
"(",
"Connection",
"conn",
",",
"String",
"sql",
",",
"Object",
"...",
"params",
")",
"throws",
"SQLException",
"{",
"PreparedStatement",
"ps",
"=",
"null",
";",
"ResultSet",
"rs",
"=",
"null",
";",
"try",
... | 执行非查询语句,返回主键<br>
发查询语句包括 插入、更新、删除<br>
此方法不会关闭Connection
@param conn 数据库连接对象
@param sql SQL
@param params 参数
@return 主键
@throws SQLException SQL执行异常 | [
"执行非查询语句,返回主键<br",
">",
"发查询语句包括",
"插入、更新、删除<br",
">",
"此方法不会关闭Connection"
] | train | https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-db/src/main/java/cn/hutool/db/sql/SqlExecutor.java#L132-L151 |
alkacon/opencms-core | src/org/opencms/relations/CmsCategoryService.java | CmsCategoryService.addResourceToCategory | public void addResourceToCategory(CmsObject cms, String resourceName, CmsCategory category) throws CmsException {
"""
Adds a resource identified by the given resource name to the given category.<p>
The resource has to be locked.<p>
@param cms the current cms context
@param resourceName the site relative pat... | java | public void addResourceToCategory(CmsObject cms, String resourceName, CmsCategory category) throws CmsException {
if (readResourceCategories(cms, cms.readResource(resourceName, CmsResourceFilter.IGNORE_EXPIRATION)).contains(
category)) {
return;
}
String sitePath = cms.g... | [
"public",
"void",
"addResourceToCategory",
"(",
"CmsObject",
"cms",
",",
"String",
"resourceName",
",",
"CmsCategory",
"category",
")",
"throws",
"CmsException",
"{",
"if",
"(",
"readResourceCategories",
"(",
"cms",
",",
"cms",
".",
"readResource",
"(",
"resourceN... | Adds a resource identified by the given resource name to the given category.<p>
The resource has to be locked.<p>
@param cms the current cms context
@param resourceName the site relative path to the resource to add
@param category the category to add the resource to
@throws CmsException if something goes wrong | [
"Adds",
"a",
"resource",
"identified",
"by",
"the",
"given",
"resource",
"name",
"to",
"the",
"given",
"category",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/relations/CmsCategoryService.java#L102-L119 |
heroku/heroku.jar | heroku-api/src/main/java/com/heroku/api/request/log/LogStreamResponse.java | LogStreamResponse.openStream | public InputStream openStream() {
"""
Creates a {@link URLConnection} to logplex. SSL verification is not used because Logplex's certificate is not signed by an authority that exists
in the standard java keystore.
@return input stream
"""
try {
URLConnection urlConnection = logStreamURL.o... | java | public InputStream openStream() {
try {
URLConnection urlConnection = logStreamURL.openConnection();
if (urlConnection instanceof HttpsURLConnection) {
HttpsURLConnection https = (HttpsURLConnection) urlConnection;
https.setSSLSocketFactory(Heroku.sslConte... | [
"public",
"InputStream",
"openStream",
"(",
")",
"{",
"try",
"{",
"URLConnection",
"urlConnection",
"=",
"logStreamURL",
".",
"openConnection",
"(",
")",
";",
"if",
"(",
"urlConnection",
"instanceof",
"HttpsURLConnection",
")",
"{",
"HttpsURLConnection",
"https",
... | Creates a {@link URLConnection} to logplex. SSL verification is not used because Logplex's certificate is not signed by an authority that exists
in the standard java keystore.
@return input stream | [
"Creates",
"a",
"{"
] | train | https://github.com/heroku/heroku.jar/blob/d9e52991293159498c10c498c6f91fcdd637378e/heroku-api/src/main/java/com/heroku/api/request/log/LogStreamResponse.java#L39-L53 |
looly/hutool | hutool-core/src/main/java/cn/hutool/core/io/FileUtil.java | FileUtil.writeUtf8String | public static File writeUtf8String(String content, File file) throws IORuntimeException {
"""
将String写入文件,覆盖模式,字符集为UTF-8
@param content 写入的内容
@param file 文件
@return 写入的文件
@throws IORuntimeException IO异常
"""
return writeString(content, file, CharsetUtil.CHARSET_UTF_8);
} | java | public static File writeUtf8String(String content, File file) throws IORuntimeException {
return writeString(content, file, CharsetUtil.CHARSET_UTF_8);
} | [
"public",
"static",
"File",
"writeUtf8String",
"(",
"String",
"content",
",",
"File",
"file",
")",
"throws",
"IORuntimeException",
"{",
"return",
"writeString",
"(",
"content",
",",
"file",
",",
"CharsetUtil",
".",
"CHARSET_UTF_8",
")",
";",
"}"
] | 将String写入文件,覆盖模式,字符集为UTF-8
@param content 写入的内容
@param file 文件
@return 写入的文件
@throws IORuntimeException IO异常 | [
"将String写入文件,覆盖模式,字符集为UTF",
"-",
"8"
] | train | https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-core/src/main/java/cn/hutool/core/io/FileUtil.java#L2707-L2709 |
kiegroup/drools | drools-compiler/src/main/java/org/drools/compiler/builder/impl/KnowledgeBuilderImpl.java | KnowledgeBuilderImpl.addPackageFromDrl | public void addPackageFromDrl(final Reader reader,
final Resource sourceResource) throws DroolsParserException,
IOException {
"""
Load a rule package from DRL source and associate all loaded artifacts
with the given resource.
@param reader
@param sourceResource th... | java | public void addPackageFromDrl(final Reader reader,
final Resource sourceResource) throws DroolsParserException,
IOException {
this.resource = sourceResource;
final DrlParser parser = new DrlParser(configuration.getLanguageLevel());
final PackageDescr... | [
"public",
"void",
"addPackageFromDrl",
"(",
"final",
"Reader",
"reader",
",",
"final",
"Resource",
"sourceResource",
")",
"throws",
"DroolsParserException",
",",
"IOException",
"{",
"this",
".",
"resource",
"=",
"sourceResource",
";",
"final",
"DrlParser",
"parser",... | Load a rule package from DRL source and associate all loaded artifacts
with the given resource.
@param reader
@param sourceResource the source resource for the read artifacts
@throws DroolsParserException
@throws IOException | [
"Load",
"a",
"rule",
"package",
"from",
"DRL",
"source",
"and",
"associate",
"all",
"loaded",
"artifacts",
"with",
"the",
"given",
"resource",
"."
] | train | https://github.com/kiegroup/drools/blob/22b0275d6dbe93070b8090948502cf46eda543c4/drools-compiler/src/main/java/org/drools/compiler/builder/impl/KnowledgeBuilderImpl.java#L358-L373 |
michael-rapp/AndroidMaterialValidation | library/src/main/java/de/mrapp/android/validation/Validators.java | Validators.notEmpty | public static Validator<CharSequence> notEmpty(@NonNull final Context context,
@StringRes final int resourceId) {
"""
Creates and returns a validator, which allows to validate texts to ensure, that they are not
empty.
@param context
The context, which should ... | java | public static Validator<CharSequence> notEmpty(@NonNull final Context context,
@StringRes final int resourceId) {
return new NotEmptyValidator(context, resourceId);
} | [
"public",
"static",
"Validator",
"<",
"CharSequence",
">",
"notEmpty",
"(",
"@",
"NonNull",
"final",
"Context",
"context",
",",
"@",
"StringRes",
"final",
"int",
"resourceId",
")",
"{",
"return",
"new",
"NotEmptyValidator",
"(",
"context",
",",
"resourceId",
"... | Creates and returns a validator, which allows to validate texts to ensure, that they are not
empty.
@param context
The context, which should be used to retrieve the error message, as an instance of
the class {@link Context}. The context may not be null
@param resourceId
The resource ID of the string resource, which co... | [
"Creates",
"and",
"returns",
"a",
"validator",
"which",
"allows",
"to",
"validate",
"texts",
"to",
"ensure",
"that",
"they",
"are",
"not",
"empty",
"."
] | train | https://github.com/michael-rapp/AndroidMaterialValidation/blob/ac8693baeac7abddf2e38a47da4c1849d4661a8b/library/src/main/java/de/mrapp/android/validation/Validators.java#L372-L375 |
alkacon/opencms-core | src/org/opencms/db/CmsDriverManager.java | CmsDriverManager.updateLastLoginDate | public void updateLastLoginDate(CmsDbContext dbc, CmsUser user) throws CmsException {
"""
Updates the last login date on the given user to the current time.<p>
@param dbc the current database context
@param user the user to be updated
@throws CmsException if operation was not successful
"""
m_m... | java | public void updateLastLoginDate(CmsDbContext dbc, CmsUser user) throws CmsException {
m_monitor.clearUserCache(user);
// set the last login time to the current time
user.setLastlogin(System.currentTimeMillis());
dbc.setAttribute(ATTRIBUTE_LOGIN, user.getName());
getUserDriver(db... | [
"public",
"void",
"updateLastLoginDate",
"(",
"CmsDbContext",
"dbc",
",",
"CmsUser",
"user",
")",
"throws",
"CmsException",
"{",
"m_monitor",
".",
"clearUserCache",
"(",
"user",
")",
";",
"// set the last login time to the current time",
"user",
".",
"setLastlogin",
"... | Updates the last login date on the given user to the current time.<p>
@param dbc the current database context
@param user the user to be updated
@throws CmsException if operation was not successful | [
"Updates",
"the",
"last",
"login",
"date",
"on",
"the",
"given",
"user",
"to",
"the",
"current",
"time",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/db/CmsDriverManager.java#L9399-L9426 |
kochedykov/jlibmodbus | src/com/intelligt/modbus/jlibmodbus/msg/ModbusRequestBuilder.java | ModbusRequestBuilder.buildDiagnostics | public ModbusRequest buildDiagnostics(DiagnosticsSubFunctionCode subFunctionCode, int serverAddress, int data) throws ModbusNumberException {
"""
The function uses a sub-function code field in the query to define the type of test to
be performed. The server echoes both the function code and sub-function code in a... | java | public ModbusRequest buildDiagnostics(DiagnosticsSubFunctionCode subFunctionCode, int serverAddress, int data) throws ModbusNumberException {
DiagnosticsRequest request = new DiagnosticsRequest();
request.setServerAddress(serverAddress);
request.setSubFunctionCode(subFunctionCode);
reque... | [
"public",
"ModbusRequest",
"buildDiagnostics",
"(",
"DiagnosticsSubFunctionCode",
"subFunctionCode",
",",
"int",
"serverAddress",
",",
"int",
"data",
")",
"throws",
"ModbusNumberException",
"{",
"DiagnosticsRequest",
"request",
"=",
"new",
"DiagnosticsRequest",
"(",
")",
... | The function uses a sub-function code field in the query to define the type of test to
be performed. The server echoes both the function code and sub-function code in a normal
response. Some of the diagnostics cause data to be returned from the remote device in the
data field of a normal response.
@param subFunctionCo... | [
"The",
"function",
"uses",
"a",
"sub",
"-",
"function",
"code",
"field",
"in",
"the",
"query",
"to",
"define",
"the",
"type",
"of",
"test",
"to",
"be",
"performed",
".",
"The",
"server",
"echoes",
"both",
"the",
"function",
"code",
"and",
"sub",
"-",
"... | train | https://github.com/kochedykov/jlibmodbus/blob/197cb39e2649e61a6fe3cb7dc91a701d847e14be/src/com/intelligt/modbus/jlibmodbus/msg/ModbusRequestBuilder.java#L185-L191 |
google/j2objc | jre_emul/android/platform/external/icu/android_icu4j/src/main/java/android/icu/text/Transliterator.java | Transliterator.registerAlias | public static void registerAlias(String aliasID, String realID) {
"""
Register an ID as an alias of another ID. Instantiating
alias ID produces the same result as instantiating the original ID.
This is generally used to create short aliases of compound IDs.
<p>Because ICU may choose to cache Transliterator o... | java | public static void registerAlias(String aliasID, String realID) {
registry.put(aliasID, realID, true);
} | [
"public",
"static",
"void",
"registerAlias",
"(",
"String",
"aliasID",
",",
"String",
"realID",
")",
"{",
"registry",
".",
"put",
"(",
"aliasID",
",",
"realID",
",",
"true",
")",
";",
"}"
] | Register an ID as an alias of another ID. Instantiating
alias ID produces the same result as instantiating the original ID.
This is generally used to create short aliases of compound IDs.
<p>Because ICU may choose to cache Transliterator objects internally, this must
be called at application startup, prior to any cal... | [
"Register",
"an",
"ID",
"as",
"an",
"alias",
"of",
"another",
"ID",
".",
"Instantiating",
"alias",
"ID",
"produces",
"the",
"same",
"result",
"as",
"instantiating",
"the",
"original",
"ID",
".",
"This",
"is",
"generally",
"used",
"to",
"create",
"short",
"... | train | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/external/icu/android_icu4j/src/main/java/android/icu/text/Transliterator.java#L1731-L1733 |
icode/ameba | src/main/java/ameba/websocket/sockjs/frame/SockJsFrame.java | SockJsFrame.messageFrame | public static SockJsFrame messageFrame(SockJsMessageCodec codec, String... messages) {
"""
<p>messageFrame.</p>
@param codec a {@link ameba.websocket.sockjs.frame.SockJsMessageCodec} object.
@param messages a {@link java.lang.String} object.
@return a {@link ameba.websocket.sockjs.frame.SockJsFrame} object... | java | public static SockJsFrame messageFrame(SockJsMessageCodec codec, String... messages) {
String encoded = codec.encode(messages);
return new SockJsFrame(encoded);
} | [
"public",
"static",
"SockJsFrame",
"messageFrame",
"(",
"SockJsMessageCodec",
"codec",
",",
"String",
"...",
"messages",
")",
"{",
"String",
"encoded",
"=",
"codec",
".",
"encode",
"(",
"messages",
")",
";",
"return",
"new",
"SockJsFrame",
"(",
"encoded",
")",... | <p>messageFrame.</p>
@param codec a {@link ameba.websocket.sockjs.frame.SockJsMessageCodec} object.
@param messages a {@link java.lang.String} object.
@return a {@link ameba.websocket.sockjs.frame.SockJsFrame} object. | [
"<p",
">",
"messageFrame",
".",
"<",
"/",
"p",
">"
] | train | https://github.com/icode/ameba/blob/9d4956e935898e41331b2745e400ef869cd265e0/src/main/java/ameba/websocket/sockjs/frame/SockJsFrame.java#L86-L89 |
TheHortonMachine/hortonmachine | hmachine/src/main/java/org/hortonmachine/hmachine/modules/demmanipulation/pitfiller/OmsPitfiller.java | OmsPitfiller.addPitToStack | private void addPitToStack( int row, int col ) {
"""
Adds a pit position to the stack.
@param row the row of the pit.
@param col the col of the pit.
"""
currentPitsCount = currentPitsCount + 1;
if (currentPitsCount >= pitsStackSize) {
pitsStackSize = (int) (pitsStackSize + nCols... | java | private void addPitToStack( int row, int col ) {
currentPitsCount = currentPitsCount + 1;
if (currentPitsCount >= pitsStackSize) {
pitsStackSize = (int) (pitsStackSize + nCols * nRows * .1) + 2;
currentPitRows = realloc(currentPitRows, pitsStackSize);
currentPitCols =... | [
"private",
"void",
"addPitToStack",
"(",
"int",
"row",
",",
"int",
"col",
")",
"{",
"currentPitsCount",
"=",
"currentPitsCount",
"+",
"1",
";",
"if",
"(",
"currentPitsCount",
">=",
"pitsStackSize",
")",
"{",
"pitsStackSize",
"=",
"(",
"int",
")",
"(",
"pit... | Adds a pit position to the stack.
@param row the row of the pit.
@param col the col of the pit. | [
"Adds",
"a",
"pit",
"position",
"to",
"the",
"stack",
"."
] | train | https://github.com/TheHortonMachine/hortonmachine/blob/d2b436bbdf951dc1fda56096a42dbc0eae4d35a5/hmachine/src/main/java/org/hortonmachine/hmachine/modules/demmanipulation/pitfiller/OmsPitfiller.java#L457-L468 |
apache/incubator-druid | sql/src/main/java/org/apache/druid/sql/calcite/expression/ExtractionFns.java | ExtractionFns.fromQueryGranularity | public static ExtractionFn fromQueryGranularity(final Granularity queryGranularity) {
"""
Converts a QueryGranularity to an extractionFn, if possible. This is the inverse of
{@link #toQueryGranularity(ExtractionFn)}. This will always return a non-null extractionFn if
queryGranularity is non-null.
@param query... | java | public static ExtractionFn fromQueryGranularity(final Granularity queryGranularity)
{
if (queryGranularity == null) {
return null;
} else {
return new TimeFormatExtractionFn(null, null, null, queryGranularity, true);
}
} | [
"public",
"static",
"ExtractionFn",
"fromQueryGranularity",
"(",
"final",
"Granularity",
"queryGranularity",
")",
"{",
"if",
"(",
"queryGranularity",
"==",
"null",
")",
"{",
"return",
"null",
";",
"}",
"else",
"{",
"return",
"new",
"TimeFormatExtractionFn",
"(",
... | Converts a QueryGranularity to an extractionFn, if possible. This is the inverse of
{@link #toQueryGranularity(ExtractionFn)}. This will always return a non-null extractionFn if
queryGranularity is non-null.
@param queryGranularity granularity
@return extractionFn, or null if queryGranularity is null | [
"Converts",
"a",
"QueryGranularity",
"to",
"an",
"extractionFn",
"if",
"possible",
".",
"This",
"is",
"the",
"inverse",
"of",
"{",
"@link",
"#toQueryGranularity",
"(",
"ExtractionFn",
")",
"}",
".",
"This",
"will",
"always",
"return",
"a",
"non",
"-",
"null"... | train | https://github.com/apache/incubator-druid/blob/f776b9408962b9006cfcfe4d6c1794751972cc8e/sql/src/main/java/org/apache/druid/sql/calcite/expression/ExtractionFns.java#L62-L69 |
haraldk/TwelveMonkeys | common/common-lang/src/main/java/com/twelvemonkeys/lang/StringUtil.java | StringUtil.toCSVString | public static String toCSVString(Object[] pStringArray, String pDelimiterString) {
"""
Converts a string array to a string separated by the given delimiter.
@param pStringArray the string array
@param pDelimiterString the delimiter string
@return string of delimiter separated values
@throws IllegalArgume... | java | public static String toCSVString(Object[] pStringArray, String pDelimiterString) {
if (pStringArray == null) {
return "";
}
if (pDelimiterString == null) {
throw new IllegalArgumentException("delimiter == null");
}
StringBuilder buffer = new Strin... | [
"public",
"static",
"String",
"toCSVString",
"(",
"Object",
"[",
"]",
"pStringArray",
",",
"String",
"pDelimiterString",
")",
"{",
"if",
"(",
"pStringArray",
"==",
"null",
")",
"{",
"return",
"\"\"",
";",
"}",
"if",
"(",
"pDelimiterString",
"==",
"null",
"... | Converts a string array to a string separated by the given delimiter.
@param pStringArray the string array
@param pDelimiterString the delimiter string
@return string of delimiter separated values
@throws IllegalArgumentException if {@code pDelimiterString == null} | [
"Converts",
"a",
"string",
"array",
"to",
"a",
"string",
"separated",
"by",
"the",
"given",
"delimiter",
"."
] | train | https://github.com/haraldk/TwelveMonkeys/blob/7fad4d5cd8cb3a6728c7fd3f28a7b84d8ce0101d/common/common-lang/src/main/java/com/twelvemonkeys/lang/StringUtil.java#L1589-L1607 |
FudanNLP/fnlp | fnlp-core/src/main/java/org/fnlp/nlp/cn/tag/AbstractTagger.java | AbstractTagger.tagFile | public void tagFile(String input,String output,String sep) {
"""
序列标注方法,输入输出为文件
@param input 输入文件 UTF8编码
@param output 输出文件 UTF8编码
"""
String s = tagFile(input,"\n");
try {
OutputStreamWriter writer = new OutputStreamWriter(new FileOutputStream(
output), "utf-8");
BufferedWriter bw = new... | java | public void tagFile(String input,String output,String sep){
String s = tagFile(input,"\n");
try {
OutputStreamWriter writer = new OutputStreamWriter(new FileOutputStream(
output), "utf-8");
BufferedWriter bw = new BufferedWriter(writer);
bw.write(s);
bw.close();
} catch (Exception e) {
... | [
"public",
"void",
"tagFile",
"(",
"String",
"input",
",",
"String",
"output",
",",
"String",
"sep",
")",
"{",
"String",
"s",
"=",
"tagFile",
"(",
"input",
",",
"\"\\n\"",
")",
";",
"try",
"{",
"OutputStreamWriter",
"writer",
"=",
"new",
"OutputStreamWriter... | 序列标注方法,输入输出为文件
@param input 输入文件 UTF8编码
@param output 输出文件 UTF8编码 | [
"序列标注方法,输入输出为文件"
] | train | https://github.com/FudanNLP/fnlp/blob/ce258f3e4a5add2ba0b5e4cbac7cab2190af6659/fnlp-core/src/main/java/org/fnlp/nlp/cn/tag/AbstractTagger.java#L126-L138 |
xwiki/xwiki-commons | xwiki-commons-tools/xwiki-commons-tool-extension-plugin/src/main/java/org/xwiki/tool/extension/internal/MavenBuildExtensionRepository.java | MavenBuildExtensionRepository.openStream | @Override
public InputStream openStream(org.eclipse.aether.artifact.Artifact artifact) throws IOException {
"""
{@inheritDoc}
<p>
Override standard {@link #openStream(org.eclipse.aether.artifact.Artifact)} to reuse running Maven session which
is much faster.
@see org.xwiki.extension.repository.aether.int... | java | @Override
public InputStream openStream(org.eclipse.aether.artifact.Artifact artifact) throws IOException
{
XWikiRepositorySystemSession session = createRepositorySystemSession();
List<RemoteRepository> repositories = newResolutionRepositories(session);
// /////////////////////////////... | [
"@",
"Override",
"public",
"InputStream",
"openStream",
"(",
"org",
".",
"eclipse",
".",
"aether",
".",
"artifact",
".",
"Artifact",
"artifact",
")",
"throws",
"IOException",
"{",
"XWikiRepositorySystemSession",
"session",
"=",
"createRepositorySystemSession",
"(",
... | {@inheritDoc}
<p>
Override standard {@link #openStream(org.eclipse.aether.artifact.Artifact)} to reuse running Maven session which
is much faster.
@see org.xwiki.extension.repository.aether.internal.AetherExtensionRepository#openStream(org.eclipse.aether.artifact.Artifact) | [
"{",
"@inheritDoc",
"}",
"<p",
">",
"Override",
"standard",
"{",
"@link",
"#openStream",
"(",
"org",
".",
"eclipse",
".",
"aether",
".",
"artifact",
".",
"Artifact",
")",
"}",
"to",
"reuse",
"running",
"Maven",
"session",
"which",
"is",
"much",
"faster",
... | train | https://github.com/xwiki/xwiki-commons/blob/5374d8c6d966588c1eac7392c83da610dfb9f129/xwiki-commons-tools/xwiki-commons-tool-extension-plugin/src/main/java/org/xwiki/tool/extension/internal/MavenBuildExtensionRepository.java#L94-L118 |
wildfly/wildfly-core | patching/src/main/java/org/jboss/as/patching/runner/IdentityPatchContext.java | IdentityPatchContext.createRollbackElement | protected static PatchElement createRollbackElement(final PatchEntry entry) {
"""
Create a patch element for the rollback patch.
@param entry the entry
@return the new patch element
"""
final PatchElement patchElement = entry.element;
final String patchId;
final Patch.PatchType patc... | java | protected static PatchElement createRollbackElement(final PatchEntry entry) {
final PatchElement patchElement = entry.element;
final String patchId;
final Patch.PatchType patchType = patchElement.getProvider().getPatchType();
if (patchType == Patch.PatchType.CUMULATIVE) {
pat... | [
"protected",
"static",
"PatchElement",
"createRollbackElement",
"(",
"final",
"PatchEntry",
"entry",
")",
"{",
"final",
"PatchElement",
"patchElement",
"=",
"entry",
".",
"element",
";",
"final",
"String",
"patchId",
";",
"final",
"Patch",
".",
"PatchType",
"patch... | Create a patch element for the rollback patch.
@param entry the entry
@return the new patch element | [
"Create",
"a",
"patch",
"element",
"for",
"the",
"rollback",
"patch",
"."
] | train | https://github.com/wildfly/wildfly-core/blob/cfaf0479dcbb2d320a44c5374b93b944ec39fade/patching/src/main/java/org/jboss/as/patching/runner/IdentityPatchContext.java#L940-L950 |
alkacon/opencms-core | src/org/opencms/jsp/CmsJspNavBuilder.java | CmsJspNavBuilder.getDefaultFile | @Deprecated
public static String getDefaultFile(CmsObject cms, String folder) {
"""
Returns the full name (including VFS path) of the default file for this navigation element
or <code>null</code> if the navigation element is not a folder.<p>
The default file of a folder is determined by the value of the pr... | java | @Deprecated
public static String getDefaultFile(CmsObject cms, String folder) {
if (folder.endsWith("/")) {
try {
CmsResource defaultFile = cms.readDefaultFile(folder);
if (defaultFile != null) {
return cms.getSitePath(defaultFile);
... | [
"@",
"Deprecated",
"public",
"static",
"String",
"getDefaultFile",
"(",
"CmsObject",
"cms",
",",
"String",
"folder",
")",
"{",
"if",
"(",
"folder",
".",
"endsWith",
"(",
"\"/\"",
")",
")",
"{",
"try",
"{",
"CmsResource",
"defaultFile",
"=",
"cms",
".",
"... | Returns the full name (including VFS path) of the default file for this navigation element
or <code>null</code> if the navigation element is not a folder.<p>
The default file of a folder is determined by the value of the property
<code>default-file</code> or the system wide property setting.<p>
@param cms the CMS obj... | [
"Returns",
"the",
"full",
"name",
"(",
"including",
"VFS",
"path",
")",
"of",
"the",
"default",
"file",
"for",
"this",
"navigation",
"element",
"or",
"<code",
">",
"null<",
"/",
"code",
">",
"if",
"the",
"navigation",
"element",
"is",
"not",
"a",
"folder... | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/jsp/CmsJspNavBuilder.java#L202-L217 |
geomajas/geomajas-project-hammer-gwt | hammer-gwt/src/main/java/org/geomajas/hammergwt/client/HammerWidget.java | HammerWidget.setOption | @Api
public <T> void setOption(GestureOption<T> option, T value) {
"""
Change initial settings of this widget.
@param option {@link org.geomajas.hammergwt.client.option.GestureOption}
@param value T look at {@link org.geomajas.hammergwt.client.option.GestureOptions}
interface for all possible types
@param... | java | @Api
public <T> void setOption(GestureOption<T> option, T value) {
hammertime.setOption(option, value);
} | [
"@",
"Api",
"public",
"<",
"T",
">",
"void",
"setOption",
"(",
"GestureOption",
"<",
"T",
">",
"option",
",",
"T",
"value",
")",
"{",
"hammertime",
".",
"setOption",
"(",
"option",
",",
"value",
")",
";",
"}"
] | Change initial settings of this widget.
@param option {@link org.geomajas.hammergwt.client.option.GestureOption}
@param value T look at {@link org.geomajas.hammergwt.client.option.GestureOptions}
interface for all possible types
@param <T>
@since 1.0.0 | [
"Change",
"initial",
"settings",
"of",
"this",
"widget",
"."
] | train | https://github.com/geomajas/geomajas-project-hammer-gwt/blob/bc764171bed55e5a9eced72f0078ec22b8105b62/hammer-gwt/src/main/java/org/geomajas/hammergwt/client/HammerWidget.java#L81-L84 |
alkacon/opencms-core | src/org/opencms/widgets/serialdate/CmsSerialDateValue.java | CmsSerialDateValue.readOptionalUUID | private CmsUUID readOptionalUUID(JSONObject json, String key) {
"""
Read an optional uuid stored as JSON string.
@param json the JSON object to readfrom.
@param key the key for the UUID in the provided JSON object.
@return the uuid, or <code>null</code> if the uuid can not be read.
"""
String id = ... | java | private CmsUUID readOptionalUUID(JSONObject json, String key) {
String id = readOptionalString(json, key, null);
if (null != id) {
try {
CmsUUID uuid = CmsUUID.valueOf(id);
return uuid;
} catch (NumberFormatException e) {
LOG.debug... | [
"private",
"CmsUUID",
"readOptionalUUID",
"(",
"JSONObject",
"json",
",",
"String",
"key",
")",
"{",
"String",
"id",
"=",
"readOptionalString",
"(",
"json",
",",
"key",
",",
"null",
")",
";",
"if",
"(",
"null",
"!=",
"id",
")",
"{",
"try",
"{",
"CmsUUI... | Read an optional uuid stored as JSON string.
@param json the JSON object to readfrom.
@param key the key for the UUID in the provided JSON object.
@return the uuid, or <code>null</code> if the uuid can not be read. | [
"Read",
"an",
"optional",
"uuid",
"stored",
"as",
"JSON",
"string",
"."
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/widgets/serialdate/CmsSerialDateValue.java#L405-L417 |
azkaban/azkaban | az-core/src/main/java/azkaban/utils/PropsUtils.java | PropsUtils.getPropertyDiff | public static String getPropertyDiff(Props oldProps, Props newProps) {
"""
The difference between old and new Props
@param oldProps old Props
@param newProps new Props
@return string formatted difference
"""
final StringBuilder builder = new StringBuilder("");
// oldProps can not be null during ... | java | public static String getPropertyDiff(Props oldProps, Props newProps) {
final StringBuilder builder = new StringBuilder("");
// oldProps can not be null during the below comparison process.
if (oldProps == null) {
oldProps = new Props();
}
if (newProps == null) {
newProps = new Props()... | [
"public",
"static",
"String",
"getPropertyDiff",
"(",
"Props",
"oldProps",
",",
"Props",
"newProps",
")",
"{",
"final",
"StringBuilder",
"builder",
"=",
"new",
"StringBuilder",
"(",
"\"\"",
")",
";",
"// oldProps can not be null during the below comparison process.",
"i... | The difference between old and new Props
@param oldProps old Props
@param newProps new Props
@return string formatted difference | [
"The",
"difference",
"between",
"old",
"and",
"new",
"Props"
] | train | https://github.com/azkaban/azkaban/blob/d258ea7d6e66807c6eff79c5325d6d3443618dff/az-core/src/main/java/azkaban/utils/PropsUtils.java#L441-L483 |
google/error-prone-javac | src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/HtmlSerialFieldWriter.java | HtmlSerialFieldWriter.addMemberDescription | public void addMemberDescription(VariableElement field, DocTree serialFieldTag, Content contentTree) {
"""
Add the description text for this member represented by the tag.
@param serialFieldTag the field to document (represented by tag)
@param contentTree the tree to which the deprecated info will be added
... | java | public void addMemberDescription(VariableElement field, DocTree serialFieldTag, Content contentTree) {
CommentHelper ch = utils.getCommentHelper(field);
List<? extends DocTree> description = ch.getDescription(configuration, serialFieldTag);
if (!description.isEmpty()) {
Content seria... | [
"public",
"void",
"addMemberDescription",
"(",
"VariableElement",
"field",
",",
"DocTree",
"serialFieldTag",
",",
"Content",
"contentTree",
")",
"{",
"CommentHelper",
"ch",
"=",
"utils",
".",
"getCommentHelper",
"(",
"field",
")",
";",
"List",
"<",
"?",
"extends... | Add the description text for this member represented by the tag.
@param serialFieldTag the field to document (represented by tag)
@param contentTree the tree to which the deprecated info will be added | [
"Add",
"the",
"description",
"text",
"for",
"this",
"member",
"represented",
"by",
"the",
"tag",
"."
] | train | https://github.com/google/error-prone-javac/blob/a53d069bbdb2c60232ed3811c19b65e41c3e60e0/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/HtmlSerialFieldWriter.java#L177-L185 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.