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 |
|---|---|---|---|---|---|---|---|---|---|---|
exoplatform/jcr | exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/xpath/XPathQueryBuilder.java | XPathQueryBuilder.assignValue | private void assignValue(SimpleNode node, RelationQueryNode queryNode) {
"""
Assigns a value to the <code>queryNode</code>.
@param node must be of type string, decimal, double or integer; otherwise
an InvalidQueryException is added to {@link #exceptions}.
@param queryNode current node in the query tree.
... | java | private void assignValue(SimpleNode node, RelationQueryNode queryNode) {
if (node.getId() == JJTSTRINGLITERAL) {
queryNode.setStringValue(unescapeQuotes(node.getValue()));
} else if (node.getId() == JJTDECIMALLITERAL) {
queryNode.setDoubleValue(Double.parseDouble(node.getValue())... | [
"private",
"void",
"assignValue",
"(",
"SimpleNode",
"node",
",",
"RelationQueryNode",
"queryNode",
")",
"{",
"if",
"(",
"node",
".",
"getId",
"(",
")",
"==",
"JJTSTRINGLITERAL",
")",
"{",
"queryNode",
".",
"setStringValue",
"(",
"unescapeQuotes",
"(",
"node",... | Assigns a value to the <code>queryNode</code>.
@param node must be of type string, decimal, double or integer; otherwise
an InvalidQueryException is added to {@link #exceptions}.
@param queryNode current node in the query tree. | [
"Assigns",
"a",
"value",
"to",
"the",
"<code",
">",
"queryNode<",
"/",
"code",
">",
"."
] | train | https://github.com/exoplatform/jcr/blob/3e7f9ee1b5683640d73a4316fb4b0ad5eac5b8a2/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/xpath/XPathQueryBuilder.java#L765-L783 |
marvinlabs/android-intents | library/src/main/java/com/marvinlabs/intents/GeoIntents.java | GeoIntents.newNavigationIntent | public static Intent newNavigationIntent(String address) {
"""
Intent that should allow opening a map showing the given address (if it exists)
@param address The address to search
@return the intent
"""
StringBuilder sb = new StringBuilder();
sb.append("google.navigation:q=");
Stri... | java | public static Intent newNavigationIntent(String address) {
StringBuilder sb = new StringBuilder();
sb.append("google.navigation:q=");
String addressEncoded = Uri.encode(address);
sb.append(addressEncoded);
return new Intent(Intent.ACTION_VIEW, Uri.parse(sb.toString()));
} | [
"public",
"static",
"Intent",
"newNavigationIntent",
"(",
"String",
"address",
")",
"{",
"StringBuilder",
"sb",
"=",
"new",
"StringBuilder",
"(",
")",
";",
"sb",
".",
"append",
"(",
"\"google.navigation:q=\"",
")",
";",
"String",
"addressEncoded",
"=",
"Uri",
... | Intent that should allow opening a map showing the given address (if it exists)
@param address The address to search
@return the intent | [
"Intent",
"that",
"should",
"allow",
"opening",
"a",
"map",
"showing",
"the",
"given",
"address",
"(",
"if",
"it",
"exists",
")"
] | train | https://github.com/marvinlabs/android-intents/blob/33e79c825188b6a97601869522533cc825801f6e/library/src/main/java/com/marvinlabs/intents/GeoIntents.java#L98-L106 |
JetBrains/xodus | vfs/src/main/java/jetbrains/exodus/vfs/VirtualFileSystem.java | VirtualFileSystem.createFile | @NotNull
public File createFile(@NotNull final Transaction txn, @NotNull String path) {
"""
Creates new file inside specified {@linkplain Transaction} with specified path and returns
the {@linkplain File} instance.
@param txn {@linkplain Transaction} instance
@param path file path
@return new {@linkplai... | java | @NotNull
public File createFile(@NotNull final Transaction txn, @NotNull String path) {
return doCreateFile(txn, fileDescriptorSequence.getAndIncrement(), path);
} | [
"@",
"NotNull",
"public",
"File",
"createFile",
"(",
"@",
"NotNull",
"final",
"Transaction",
"txn",
",",
"@",
"NotNull",
"String",
"path",
")",
"{",
"return",
"doCreateFile",
"(",
"txn",
",",
"fileDescriptorSequence",
".",
"getAndIncrement",
"(",
")",
",",
"... | Creates new file inside specified {@linkplain Transaction} with specified path and returns
the {@linkplain File} instance.
@param txn {@linkplain Transaction} instance
@param path file path
@return new {@linkplain File}
@throws FileExistsException if a {@linkplain File} with specified path already exists
@see #create... | [
"Creates",
"new",
"file",
"inside",
"specified",
"{",
"@linkplain",
"Transaction",
"}",
"with",
"specified",
"path",
"and",
"returns",
"the",
"{",
"@linkplain",
"File",
"}",
"instance",
"."
] | train | https://github.com/JetBrains/xodus/blob/7b3476c4e81db66f9c7529148c761605cc8eea6d/vfs/src/main/java/jetbrains/exodus/vfs/VirtualFileSystem.java#L207-L210 |
networknt/light-4j | dump/src/main/java/com/networknt/dump/CookiesDumper.java | CookiesDumper.dumpRequest | @Override
public void dumpRequest(Map<String, Object> result) {
"""
impl of dumping request cookies to result
@param result A map you want to put dump information to
"""
Map<String, Cookie> cookiesMap = exchange.getRequestCookies();
dumpCookies(cookiesMap, "requestCookies");
this.p... | java | @Override
public void dumpRequest(Map<String, Object> result) {
Map<String, Cookie> cookiesMap = exchange.getRequestCookies();
dumpCookies(cookiesMap, "requestCookies");
this.putDumpInfoTo(result);
} | [
"@",
"Override",
"public",
"void",
"dumpRequest",
"(",
"Map",
"<",
"String",
",",
"Object",
">",
"result",
")",
"{",
"Map",
"<",
"String",
",",
"Cookie",
">",
"cookiesMap",
"=",
"exchange",
".",
"getRequestCookies",
"(",
")",
";",
"dumpCookies",
"(",
"co... | impl of dumping request cookies to result
@param result A map you want to put dump information to | [
"impl",
"of",
"dumping",
"request",
"cookies",
"to",
"result"
] | train | https://github.com/networknt/light-4j/blob/2a60257c60663684c8f6dc8b5ea3cf184e534db6/dump/src/main/java/com/networknt/dump/CookiesDumper.java#L38-L44 |
albfernandez/itext2 | src/main/java/com/lowagie/text/Section.java | Section.setNumbers | private void setNumbers(int number, ArrayList numbers) {
"""
Sets the number of this section.
@param number the number of this section
@param numbers an <CODE>ArrayList</CODE>, containing the numbers of the Parent
"""
this.numbers = new ArrayList();
this.numbers.add(Integer.valueOf(number... | java | private void setNumbers(int number, ArrayList numbers) {
this.numbers = new ArrayList();
this.numbers.add(Integer.valueOf(number));
this.numbers.addAll(numbers);
} | [
"private",
"void",
"setNumbers",
"(",
"int",
"number",
",",
"ArrayList",
"numbers",
")",
"{",
"this",
".",
"numbers",
"=",
"new",
"ArrayList",
"(",
")",
";",
"this",
".",
"numbers",
".",
"add",
"(",
"Integer",
".",
"valueOf",
"(",
"number",
")",
")",
... | Sets the number of this section.
@param number the number of this section
@param numbers an <CODE>ArrayList</CODE>, containing the numbers of the Parent | [
"Sets",
"the",
"number",
"of",
"this",
"section",
"."
] | train | https://github.com/albfernandez/itext2/blob/438fc1899367fd13dfdfa8dfdca9a3c1a7783b84/src/main/java/com/lowagie/text/Section.java#L670-L674 |
carewebframework/carewebframework-core | org.carewebframework.shell/src/main/java/org/carewebframework/shell/layout/LayoutParser.java | LayoutParser.parseAction | private void parseAction(Element node, LayoutTrigger parent) {
"""
Parse a trigger action node.
@param node The DOM node.
@param parent The parent layout trigger.
"""
new LayoutTriggerAction(parent, getDefinition(null, node));
} | java | private void parseAction(Element node, LayoutTrigger parent) {
new LayoutTriggerAction(parent, getDefinition(null, node));
} | [
"private",
"void",
"parseAction",
"(",
"Element",
"node",
",",
"LayoutTrigger",
"parent",
")",
"{",
"new",
"LayoutTriggerAction",
"(",
"parent",
",",
"getDefinition",
"(",
"null",
",",
"node",
")",
")",
";",
"}"
] | Parse a trigger action node.
@param node The DOM node.
@param parent The parent layout trigger. | [
"Parse",
"a",
"trigger",
"action",
"node",
"."
] | train | https://github.com/carewebframework/carewebframework-core/blob/fa3252d4f7541dbe151b92c3d4f6f91433cd1673/org.carewebframework.shell/src/main/java/org/carewebframework/shell/layout/LayoutParser.java#L324-L326 |
elki-project/elki | elki-outlier/src/main/java/de/lmu/ifi/dbs/elki/algorithm/outlier/subspace/OUTRES.java | OUTRES.subsetNeighborhoodQuery | private DoubleDBIDList subsetNeighborhoodQuery(DoubleDBIDList neighc, DBIDRef dbid, PrimitiveDistanceFunction<? super NumberVector> df, double adjustedEps, KernelDensityEstimator kernel, ModifiableDoubleDBIDList n) {
"""
Refine neighbors within a subset.
@param neighc Neighbor candidates
@param dbid Query obje... | java | private DoubleDBIDList subsetNeighborhoodQuery(DoubleDBIDList neighc, DBIDRef dbid, PrimitiveDistanceFunction<? super NumberVector> df, double adjustedEps, KernelDensityEstimator kernel, ModifiableDoubleDBIDList n) {
n.clear();
NumberVector query = kernel.relation.get(dbid);
for(DoubleDBIDListIter neighbor ... | [
"private",
"DoubleDBIDList",
"subsetNeighborhoodQuery",
"(",
"DoubleDBIDList",
"neighc",
",",
"DBIDRef",
"dbid",
",",
"PrimitiveDistanceFunction",
"<",
"?",
"super",
"NumberVector",
">",
"df",
",",
"double",
"adjustedEps",
",",
"KernelDensityEstimator",
"kernel",
",",
... | Refine neighbors within a subset.
@param neighc Neighbor candidates
@param dbid Query object
@param df distance function
@param adjustedEps Epsilon range
@param kernel Kernel
@param n Output list
@return Neighbors of neighbor object | [
"Refine",
"neighbors",
"within",
"a",
"subset",
"."
] | train | https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-outlier/src/main/java/de/lmu/ifi/dbs/elki/algorithm/outlier/subspace/OUTRES.java#L228-L239 |
igniterealtime/Smack | smack-extensions/src/main/java/org/jivesoftware/smackx/pubsub/Node.java | Node.getAffiliationsAsOwner | public List<Affiliation> getAffiliationsAsOwner()
throws NoResponseException, XMPPErrorException, NotConnectedException, InterruptedException {
"""
Retrieve the affiliation list for this node as owner.
@return list of entities whose affiliation is not 'none'.
@throws NoResponseException
@t... | java | public List<Affiliation> getAffiliationsAsOwner()
throws NoResponseException, XMPPErrorException, NotConnectedException, InterruptedException {
return getAffiliationsAsOwner(null, null);
} | [
"public",
"List",
"<",
"Affiliation",
">",
"getAffiliationsAsOwner",
"(",
")",
"throws",
"NoResponseException",
",",
"XMPPErrorException",
",",
"NotConnectedException",
",",
"InterruptedException",
"{",
"return",
"getAffiliationsAsOwner",
"(",
"null",
",",
"null",
")",
... | Retrieve the affiliation list for this node as owner.
@return list of entities whose affiliation is not 'none'.
@throws NoResponseException
@throws XMPPErrorException
@throws NotConnectedException
@throws InterruptedException
@see #getAffiliations(List, Collection)
@since 4.2 | [
"Retrieve",
"the",
"affiliation",
"list",
"for",
"this",
"node",
"as",
"owner",
"."
] | train | https://github.com/igniterealtime/Smack/blob/870756997faec1e1bfabfac0cd6c2395b04da873/smack-extensions/src/main/java/org/jivesoftware/smackx/pubsub/Node.java#L295-L299 |
GCRC/nunaliit | nunaliit2-multimedia/src/main/java/ca/carleton/gcrc/olkit/multimedia/apachePDFBox/imageio/ImageIOUtil.java | ImageIOUtil.writeImage | @Deprecated
public static boolean writeImage(BufferedImage image, String formatName, String filename,
int dpi) throws IOException {
"""
Writes a buffered image to a file using the given image format. See
{@link #writeImage(BufferedImage image, String formatName,
OutputStream output, int dpi, floa... | java | @Deprecated
public static boolean writeImage(BufferedImage image, String formatName, String filename,
int dpi) throws IOException
{
File file = new File(filename + "." + formatName);
FileOutputStream output = new FileOutputStream(file);
try
{
return writeI... | [
"@",
"Deprecated",
"public",
"static",
"boolean",
"writeImage",
"(",
"BufferedImage",
"image",
",",
"String",
"formatName",
",",
"String",
"filename",
",",
"int",
"dpi",
")",
"throws",
"IOException",
"{",
"File",
"file",
"=",
"new",
"File",
"(",
"filename",
... | Writes a buffered image to a file using the given image format. See
{@link #writeImage(BufferedImage image, String formatName,
OutputStream output, int dpi, float quality)} for more details.
@param image the image to be written
@param formatName the target format (ex. "png") which is also the suffix
for the filename
@... | [
"Writes",
"a",
"buffered",
"image",
"to",
"a",
"file",
"using",
"the",
"given",
"image",
"format",
".",
"See",
"{",
"@link",
"#writeImage",
"(",
"BufferedImage",
"image",
"String",
"formatName",
"OutputStream",
"output",
"int",
"dpi",
"float",
"quality",
")",
... | train | https://github.com/GCRC/nunaliit/blob/0b4abfc64eef2eb8b94f852ce697de2e851d8e67/nunaliit2-multimedia/src/main/java/ca/carleton/gcrc/olkit/multimedia/apachePDFBox/imageio/ImageIOUtil.java#L114-L128 |
palatable/lambda | src/main/java/com/jnape/palatable/lambda/adt/Try.java | Try.ensuring | public final Try<T, A> ensuring(CheckedRunnable<T> runnable) {
"""
Run the provided runnable regardless of whether this is a success or a failure (the {@link Try} analog to
<code>finally</code>.
<p>
If the runnable runs successfully, the result is preserved as is. If the runnable itself throws, and the result
... | java | public final Try<T, A> ensuring(CheckedRunnable<T> runnable) {
return match(t -> peek2(t::addSuppressed, __ -> {}, trying(runnable))
.biMapL(constantly(t))
.flatMap(constantly(failure(t))),
a -> trying(runnable).fmap(constantly(a)));... | [
"public",
"final",
"Try",
"<",
"T",
",",
"A",
">",
"ensuring",
"(",
"CheckedRunnable",
"<",
"T",
">",
"runnable",
")",
"{",
"return",
"match",
"(",
"t",
"->",
"peek2",
"(",
"t",
"::",
"addSuppressed",
",",
"__",
"->",
"{",
"}",
",",
"trying",
"(",
... | Run the provided runnable regardless of whether this is a success or a failure (the {@link Try} analog to
<code>finally</code>.
<p>
If the runnable runs successfully, the result is preserved as is. If the runnable itself throws, and the result
was a success, the result becomes a failure over the newly-thrown {@link Thr... | [
"Run",
"the",
"provided",
"runnable",
"regardless",
"of",
"whether",
"this",
"is",
"a",
"success",
"or",
"a",
"failure",
"(",
"the",
"{",
"@link",
"Try",
"}",
"analog",
"to",
"<code",
">",
"finally<",
"/",
"code",
">",
".",
"<p",
">",
"If",
"the",
"r... | train | https://github.com/palatable/lambda/blob/b643ba836c5916d1d8193822e5efb4e7b40c489a/src/main/java/com/jnape/palatable/lambda/adt/Try.java#L75-L80 |
iobeam/iobeam-client-java | src/main/java/com/iobeam/api/client/Iobeam.java | Iobeam._addDataWithoutLock | private void _addDataWithoutLock(String seriesName, DataPoint dataPoint) {
"""
/* A lock should always be acquired before calling this method!
"""
if (dataStore == null) {
dataStore = new Import(deviceId, projectId);
}
dataStore.addDataPoint(seriesName, dataPoint);
... | java | private void _addDataWithoutLock(String seriesName, DataPoint dataPoint) {
if (dataStore == null) {
dataStore = new Import(deviceId, projectId);
}
dataStore.addDataPoint(seriesName, dataPoint);
DataStore store = seriesToBatch.get(seriesName);
if (store == null) {
... | [
"private",
"void",
"_addDataWithoutLock",
"(",
"String",
"seriesName",
",",
"DataPoint",
"dataPoint",
")",
"{",
"if",
"(",
"dataStore",
"==",
"null",
")",
"{",
"dataStore",
"=",
"new",
"Import",
"(",
"deviceId",
",",
"projectId",
")",
";",
"}",
"dataStore",
... | /* A lock should always be acquired before calling this method! | [
"/",
"*",
"A",
"lock",
"should",
"always",
"be",
"acquired",
"before",
"calling",
"this",
"method!"
] | train | https://github.com/iobeam/iobeam-client-java/blob/06e7aeb2a313503392358a3671de7d28628d0e33/src/main/java/com/iobeam/api/client/Iobeam.java#L731-L744 |
intuit/QuickBooks-V3-Java-SDK | ipp-v3-java-devkit/src/main/java/com/intuit/ipp/interceptors/HTTPBatchClientConnectionInterceptor.java | HTTPBatchClientConnectionInterceptor.extractURI | private URI extractURI(RequestElements intuitRequest) throws FMSException {
"""
Returns URI instance which will be used as a connection source
@param intuitRequest
@return URI
@throws FMSException
"""
URI uri = null;
try {
uri = new URI(intuitRequest.getRequestParameters().get(R... | java | private URI extractURI(RequestElements intuitRequest) throws FMSException
{
URI uri = null;
try {
uri = new URI(intuitRequest.getRequestParameters().get(RequestElements.REQ_PARAM_RESOURCE_URL));
} catch (URISyntaxException e) {
throw new FMSException("URISyntaxExcept... | [
"private",
"URI",
"extractURI",
"(",
"RequestElements",
"intuitRequest",
")",
"throws",
"FMSException",
"{",
"URI",
"uri",
"=",
"null",
";",
"try",
"{",
"uri",
"=",
"new",
"URI",
"(",
"intuitRequest",
".",
"getRequestParameters",
"(",
")",
".",
"get",
"(",
... | Returns URI instance which will be used as a connection source
@param intuitRequest
@return URI
@throws FMSException | [
"Returns",
"URI",
"instance",
"which",
"will",
"be",
"used",
"as",
"a",
"connection",
"source"
] | train | https://github.com/intuit/QuickBooks-V3-Java-SDK/blob/59f988d0776d46620d0b34711c411b2b5b1da06b/ipp-v3-java-devkit/src/main/java/com/intuit/ipp/interceptors/HTTPBatchClientConnectionInterceptor.java#L253-L263 |
fuinorg/units4j | src/main/java/org/fuin/units4j/AssertUsage.java | AssertUsage.assertMethodsNotUsed | public static final void assertMethodsNotUsed(final File classesDir, final FileFilter filter, final List<MCAMethod> methodsToFind) {
"""
Asserts that a set of methods is not used.
@param classesDir
Directory with the ".class" files to check - Cannot be <code>null</code> and must be a valid directory.
@param f... | java | public static final void assertMethodsNotUsed(final File classesDir, final FileFilter filter, final List<MCAMethod> methodsToFind) {
Utils4J.checkNotNull("classesDir", classesDir);
Utils4J.checkValidDir(classesDir);
Utils4J.checkNotNull("methodsToFind", methodsToFind);
final Meth... | [
"public",
"static",
"final",
"void",
"assertMethodsNotUsed",
"(",
"final",
"File",
"classesDir",
",",
"final",
"FileFilter",
"filter",
",",
"final",
"List",
"<",
"MCAMethod",
">",
"methodsToFind",
")",
"{",
"Utils4J",
".",
"checkNotNull",
"(",
"\"classesDir\"",
... | Asserts that a set of methods is not used.
@param classesDir
Directory with the ".class" files to check - Cannot be <code>null</code> and must be a valid directory.
@param filter
File filter or NULL (process all '*.class' files).
@param methodsToFind
List of methods to find - Cannot be NULL. | [
"Asserts",
"that",
"a",
"set",
"of",
"methods",
"is",
"not",
"used",
"."
] | train | https://github.com/fuinorg/units4j/blob/29383e30b0f9c246b309e734df9cc63dc5d5499e/src/main/java/org/fuin/units4j/AssertUsage.java#L70-L89 |
jbundle/jbundle | base/base/src/main/java/org/jbundle/base/util/BaseApplication.java | BaseApplication.getDatabase | public Database getDatabase(String strDBName, int iDatabaseType, Map<String, Object> properties) {
"""
Given the name, either get the open database, or open a new one.
@param strDBName The name of the database.
@param iDatabaseType The type of database/table.
@return The database (new or current).
"""
... | java | public Database getDatabase(String strDBName, int iDatabaseType, Map<String, Object> properties)
{
return m_databaseCollection.getDatabase(strDBName, iDatabaseType, properties);
} | [
"public",
"Database",
"getDatabase",
"(",
"String",
"strDBName",
",",
"int",
"iDatabaseType",
",",
"Map",
"<",
"String",
",",
"Object",
">",
"properties",
")",
"{",
"return",
"m_databaseCollection",
".",
"getDatabase",
"(",
"strDBName",
",",
"iDatabaseType",
","... | Given the name, either get the open database, or open a new one.
@param strDBName The name of the database.
@param iDatabaseType The type of database/table.
@return The database (new or current). | [
"Given",
"the",
"name",
"either",
"get",
"the",
"open",
"database",
"or",
"open",
"a",
"new",
"one",
"."
] | train | https://github.com/jbundle/jbundle/blob/4037fcfa85f60c7d0096c453c1a3cd573c2b0abc/base/base/src/main/java/org/jbundle/base/util/BaseApplication.java#L211-L214 |
sagiegurari/fax4j | src/main/java/org/fax4j/spi/http/ApacheHTTPClient.java | ApacheHTTPClient.createURL | protected String createURL(HTTPRequest httpRequest,HTTPClientConfiguration configuration) {
"""
This function creates the full URL from the provided values.
@param httpRequest
The HTTP request to send
@param configuration
HTTP client configuration
@return The full URL
"""
//init buffer
... | java | protected String createURL(HTTPRequest httpRequest,HTTPClientConfiguration configuration)
{
//init buffer
StringBuilder buffer=new StringBuilder(100);
//create URL
String resource=httpRequest.getResource();
this.appendBaseURL(buffer,resource,configuration);
String pa... | [
"protected",
"String",
"createURL",
"(",
"HTTPRequest",
"httpRequest",
",",
"HTTPClientConfiguration",
"configuration",
")",
"{",
"//init buffer",
"StringBuilder",
"buffer",
"=",
"new",
"StringBuilder",
"(",
"100",
")",
";",
"//create URL",
"String",
"resource",
"=",
... | This function creates the full URL from the provided values.
@param httpRequest
The HTTP request to send
@param configuration
HTTP client configuration
@return The full URL | [
"This",
"function",
"creates",
"the",
"full",
"URL",
"from",
"the",
"provided",
"values",
"."
] | train | https://github.com/sagiegurari/fax4j/blob/42fa51acabe7bf279e27ab3dd1cf76146b27955f/src/main/java/org/fax4j/spi/http/ApacheHTTPClient.java#L232-L245 |
BBN-E/bue-common-open | common-core-open/src/main/java/com/bbn/bue/common/temporal/IntervalUtils.java | IntervalUtils.minus | public static Interval minus(final Interval interval, final Period period) {
"""
Move both the start and end of an {@link Interval} into the past by the duration of
{@code period}.
"""
return new Interval(interval.getStart().minus(period),
interval.getEnd().minus(period));
} | java | public static Interval minus(final Interval interval, final Period period) {
return new Interval(interval.getStart().minus(period),
interval.getEnd().minus(period));
} | [
"public",
"static",
"Interval",
"minus",
"(",
"final",
"Interval",
"interval",
",",
"final",
"Period",
"period",
")",
"{",
"return",
"new",
"Interval",
"(",
"interval",
".",
"getStart",
"(",
")",
".",
"minus",
"(",
"period",
")",
",",
"interval",
".",
"g... | Move both the start and end of an {@link Interval} into the past by the duration of
{@code period}. | [
"Move",
"both",
"the",
"start",
"and",
"end",
"of",
"an",
"{"
] | train | https://github.com/BBN-E/bue-common-open/blob/d618652674d647867306e2e4b987a21b7c29c015/common-core-open/src/main/java/com/bbn/bue/common/temporal/IntervalUtils.java#L19-L22 |
QSFT/Doradus | doradus-server/src/main/java/com/dell/doradus/service/taskmanager/TaskManagerService.java | TaskManagerService.attemptToExecuteTask | private void attemptToExecuteTask(ApplicationDefinition appDef, Task task, TaskRecord taskRecord) {
"""
Attempt to start the given task by creating claim and see if we win it.
"""
Tenant tenant = Tenant.getTenant(appDef);
String taskID = taskRecord.getTaskID();
String claimID = "_claim/... | java | private void attemptToExecuteTask(ApplicationDefinition appDef, Task task, TaskRecord taskRecord) {
Tenant tenant = Tenant.getTenant(appDef);
String taskID = taskRecord.getTaskID();
String claimID = "_claim/" + taskID;
long claimStamp = System.currentTimeMillis();
writeTaskClaim(... | [
"private",
"void",
"attemptToExecuteTask",
"(",
"ApplicationDefinition",
"appDef",
",",
"Task",
"task",
",",
"TaskRecord",
"taskRecord",
")",
"{",
"Tenant",
"tenant",
"=",
"Tenant",
".",
"getTenant",
"(",
"appDef",
")",
";",
"String",
"taskID",
"=",
"taskRecord"... | Attempt to start the given task by creating claim and see if we win it. | [
"Attempt",
"to",
"start",
"the",
"given",
"task",
"by",
"creating",
"claim",
"and",
"see",
"if",
"we",
"win",
"it",
"."
] | train | https://github.com/QSFT/Doradus/blob/ad64d3c37922eefda68ec8869ef089c1ca604b70/doradus-server/src/main/java/com/dell/doradus/service/taskmanager/TaskManagerService.java#L398-L409 |
jbundle/jbundle | base/base/src/main/java/org/jbundle/base/field/BooleanField.java | BooleanField.doSetData | public int doSetData(Object vpData, boolean bDisplayOption, int moveMode) {
"""
Move this physical binary data to this field.
@param data The physical data to move to this field (must be the Boolean class).
@param bDisplayOption If true, display after setting the data.
@param iMoveMode The type of move.
@retur... | java | public int doSetData(Object vpData, boolean bDisplayOption, int moveMode)
{
if ((vpData != null) && (!(vpData instanceof Boolean)))
return DBConstants.ERROR_RETURN;
return super.doSetData(vpData, bDisplayOption, moveMode);
} | [
"public",
"int",
"doSetData",
"(",
"Object",
"vpData",
",",
"boolean",
"bDisplayOption",
",",
"int",
"moveMode",
")",
"{",
"if",
"(",
"(",
"vpData",
"!=",
"null",
")",
"&&",
"(",
"!",
"(",
"vpData",
"instanceof",
"Boolean",
")",
")",
")",
"return",
"DB... | Move this physical binary data to this field.
@param data The physical data to move to this field (must be the Boolean class).
@param bDisplayOption If true, display after setting the data.
@param iMoveMode The type of move.
@return an error code (0 if success). | [
"Move",
"this",
"physical",
"binary",
"data",
"to",
"this",
"field",
"."
] | train | https://github.com/jbundle/jbundle/blob/4037fcfa85f60c7d0096c453c1a3cd573c2b0abc/base/base/src/main/java/org/jbundle/base/field/BooleanField.java#L280-L285 |
Ashok-Varma/BottomNavigation | bottom-navigation-bar/src/main/java/com/ashokvarma/bottomnavigation/utils/Utils.java | Utils.fetchContextColor | public static int fetchContextColor(Context context, int androidAttribute) {
"""
This method can be extended to get all android attributes color, string, dimension ...etc
@param context used to fetch android attribute
@param androidAttribute attribute codes like R.attr.colorAccent
@return in this cas... | java | public static int fetchContextColor(Context context, int androidAttribute) {
TypedValue typedValue = new TypedValue();
TypedArray a = context.obtainStyledAttributes(typedValue.data, new int[]{androidAttribute});
int color = a.getColor(0, 0);
a.recycle();
return color;
} | [
"public",
"static",
"int",
"fetchContextColor",
"(",
"Context",
"context",
",",
"int",
"androidAttribute",
")",
"{",
"TypedValue",
"typedValue",
"=",
"new",
"TypedValue",
"(",
")",
";",
"TypedArray",
"a",
"=",
"context",
".",
"obtainStyledAttributes",
"(",
"type... | This method can be extended to get all android attributes color, string, dimension ...etc
@param context used to fetch android attribute
@param androidAttribute attribute codes like R.attr.colorAccent
@return in this case color of android attribute | [
"This",
"method",
"can",
"be",
"extended",
"to",
"get",
"all",
"android",
"attributes",
"color",
"string",
"dimension",
"...",
"etc"
] | train | https://github.com/Ashok-Varma/BottomNavigation/blob/a5c486a6dfa1ebe7049e2e025e0d967111ecfd0b/bottom-navigation-bar/src/main/java/com/ashokvarma/bottomnavigation/utils/Utils.java#L42-L51 |
hamcrest/hamcrest-junit | src/main/java/org/hamcrest/junit/ErrorCollector.java | ErrorCollector.checkThat | public <T> void checkThat(final String reason, final T value, final Matcher<T> matcher) {
"""
Adds a failure with the given {@code reason}
to the table if {@code matcher} does not match {@code value}.
Execution continues, but the test will fail at the end if the match fails.
"""
checkSucceeds(new Cal... | java | public <T> void checkThat(final String reason, final T value, final Matcher<T> matcher) {
checkSucceeds(new Callable<Object>() {
public Object call() throws Exception {
assertThat(reason, value, matcher);
return value;
}
});
} | [
"public",
"<",
"T",
">",
"void",
"checkThat",
"(",
"final",
"String",
"reason",
",",
"final",
"T",
"value",
",",
"final",
"Matcher",
"<",
"T",
">",
"matcher",
")",
"{",
"checkSucceeds",
"(",
"new",
"Callable",
"<",
"Object",
">",
"(",
")",
"{",
"publ... | Adds a failure with the given {@code reason}
to the table if {@code matcher} does not match {@code value}.
Execution continues, but the test will fail at the end if the match fails. | [
"Adds",
"a",
"failure",
"with",
"the",
"given",
"{"
] | train | https://github.com/hamcrest/hamcrest-junit/blob/5e02d55230b560f255433bcc490afaeda9e1a043/src/main/java/org/hamcrest/junit/ErrorCollector.java#L63-L70 |
jbundle/jbundle | thin/base/screen/screen/src/main/java/org/jbundle/thin/base/screen/BaseApplet.java | BaseApplet.pushBrowserHistory | public void pushBrowserHistory(String strHistory, String browserTitle, boolean bPushToBrowser) {
"""
Push this command onto the history stack.
@param strHistory The history command to push onto the stack.
"""
if (bPushToBrowser)
if (this.getBrowserManager() != null)
this.ge... | java | public void pushBrowserHistory(String strHistory, String browserTitle, boolean bPushToBrowser)
{
if (bPushToBrowser)
if (this.getBrowserManager() != null)
this.getBrowserManager().pushBrowserHistory(strHistory, browserTitle); // Let browser know about the new screen
} | [
"public",
"void",
"pushBrowserHistory",
"(",
"String",
"strHistory",
",",
"String",
"browserTitle",
",",
"boolean",
"bPushToBrowser",
")",
"{",
"if",
"(",
"bPushToBrowser",
")",
"if",
"(",
"this",
".",
"getBrowserManager",
"(",
")",
"!=",
"null",
")",
"this",
... | Push this command onto the history stack.
@param strHistory The history command to push onto the stack. | [
"Push",
"this",
"command",
"onto",
"the",
"history",
"stack",
"."
] | train | https://github.com/jbundle/jbundle/blob/4037fcfa85f60c7d0096c453c1a3cd573c2b0abc/thin/base/screen/screen/src/main/java/org/jbundle/thin/base/screen/BaseApplet.java#L1249-L1254 |
erlang/otp | lib/jinterface/java_src/com/ericsson/otp/erlang/OtpInputStream.java | OtpInputStream.read_ref | public OtpErlangRef read_ref() throws OtpErlangDecodeException {
"""
Read an Erlang reference from the stream.
@return the value of the reference
@exception OtpErlangDecodeException
if the next term in the stream is not an Erlang reference.
"""
String node;
int id;
int creation;
... | java | public OtpErlangRef read_ref() throws OtpErlangDecodeException {
String node;
int id;
int creation;
int tag;
tag = read1skip_version();
switch (tag) {
case OtpExternal.refTag:
node = read_atom();
id = read4BE() & 0x3ffff; // 18 bits
... | [
"public",
"OtpErlangRef",
"read_ref",
"(",
")",
"throws",
"OtpErlangDecodeException",
"{",
"String",
"node",
";",
"int",
"id",
";",
"int",
"creation",
";",
"int",
"tag",
";",
"tag",
"=",
"read1skip_version",
"(",
")",
";",
"switch",
"(",
"tag",
")",
"{",
... | Read an Erlang reference from the stream.
@return the value of the reference
@exception OtpErlangDecodeException
if the next term in the stream is not an Erlang reference. | [
"Read",
"an",
"Erlang",
"reference",
"from",
"the",
"stream",
"."
] | train | https://github.com/erlang/otp/blob/ac6084fd83240355f72e94adbf303e57832d1fab/lib/jinterface/java_src/com/ericsson/otp/erlang/OtpInputStream.java#L1018-L1056 |
apache/flink | flink-table/flink-table-runtime-blink/src/main/java/org/apache/flink/table/runtime/functions/SqlFunctionUtils.java | SqlFunctionUtils.splitIndex | public static String splitIndex(String str, String separator, int index) {
"""
Split target string with custom separator and pick the index-th(start with 0) result.
@param str target string.
@param separator custom separator.
@param index index of the result which you want.
@return the string at th... | java | public static String splitIndex(String str, String separator, int index) {
if (index < 0) {
return null;
}
String[] values = StringUtils.splitByWholeSeparatorPreserveAllTokens(str, separator);
if (index >= values.length) {
return null;
} else {
return values[index];
}
} | [
"public",
"static",
"String",
"splitIndex",
"(",
"String",
"str",
",",
"String",
"separator",
",",
"int",
"index",
")",
"{",
"if",
"(",
"index",
"<",
"0",
")",
"{",
"return",
"null",
";",
"}",
"String",
"[",
"]",
"values",
"=",
"StringUtils",
".",
"s... | Split target string with custom separator and pick the index-th(start with 0) result.
@param str target string.
@param separator custom separator.
@param index index of the result which you want.
@return the string at the index of split results. | [
"Split",
"target",
"string",
"with",
"custom",
"separator",
"and",
"pick",
"the",
"index",
"-",
"th",
"(",
"start",
"with",
"0",
")",
"result",
"."
] | train | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-table/flink-table-runtime-blink/src/main/java/org/apache/flink/table/runtime/functions/SqlFunctionUtils.java#L310-L320 |
igniterealtime/Smack | smack-omemo/src/main/java/org/jivesoftware/smackx/omemo/OmemoService.java | OmemoService.refreshDeviceList | OmemoCachedDeviceList refreshDeviceList(XMPPConnection connection, OmemoDevice userDevice, BareJid contact)
throws InterruptedException, PubSubException.NotALeafNodeException, XMPPException.XMPPErrorException,
SmackException.NotConnectedException, SmackException.NoResponseException {
"""
Re... | java | OmemoCachedDeviceList refreshDeviceList(XMPPConnection connection, OmemoDevice userDevice, BareJid contact)
throws InterruptedException, PubSubException.NotALeafNodeException, XMPPException.XMPPErrorException,
SmackException.NotConnectedException, SmackException.NoResponseException {
// ... | [
"OmemoCachedDeviceList",
"refreshDeviceList",
"(",
"XMPPConnection",
"connection",
",",
"OmemoDevice",
"userDevice",
",",
"BareJid",
"contact",
")",
"throws",
"InterruptedException",
",",
"PubSubException",
".",
"NotALeafNodeException",
",",
"XMPPException",
".",
"XMPPError... | Refresh and merge device list of contact.
@param connection authenticated XMPP connection
@param userDevice our OmemoDevice
@param contact contact we want to fetch the deviceList from
@return cached device list after refresh.
@throws InterruptedException
@throws PubSubException.NotALeafNodeException
@throws XMPPExcep... | [
"Refresh",
"and",
"merge",
"device",
"list",
"of",
"contact",
"."
] | train | https://github.com/igniterealtime/Smack/blob/870756997faec1e1bfabfac0cd6c2395b04da873/smack-omemo/src/main/java/org/jivesoftware/smackx/omemo/OmemoService.java#L729-L746 |
albfernandez/javadbf | src/main/java/com/linuxense/javadbf/DBFUtils.java | DBFUtils.readNumericStoredAsText | public static Number readNumericStoredAsText(DataInputStream dataInput, int length) throws IOException {
"""
Reads a number from a stream,
@param dataInput the stream data
@param length the legth of the number
@return The number as a Number (BigDecimal)
@throws IOException if an IO error happens
@throws EOFEx... | java | public static Number readNumericStoredAsText(DataInputStream dataInput, int length) throws IOException {
try {
byte t_float[] = new byte[length];
int readed = dataInput.read(t_float);
if (readed != length) {
throw new EOFException("failed to read:" + length + " bytes");
}
t_float = DBFUtils.removeS... | [
"public",
"static",
"Number",
"readNumericStoredAsText",
"(",
"DataInputStream",
"dataInput",
",",
"int",
"length",
")",
"throws",
"IOException",
"{",
"try",
"{",
"byte",
"t_float",
"[",
"]",
"=",
"new",
"byte",
"[",
"length",
"]",
";",
"int",
"readed",
"=",... | Reads a number from a stream,
@param dataInput the stream data
@param length the legth of the number
@return The number as a Number (BigDecimal)
@throws IOException if an IO error happens
@throws EOFException if reached end of file before length bytes | [
"Reads",
"a",
"number",
"from",
"a",
"stream"
] | train | https://github.com/albfernandez/javadbf/blob/ac9867b46786cb055bce9323e2cf074365207693/src/main/java/com/linuxense/javadbf/DBFUtils.java#L62-L83 |
Ordinastie/MalisisCore | src/main/java/net/malisis/core/client/gui/render/GuiRenderer.java | GuiRenderer.drawItemStack | public void drawItemStack(ItemStack itemStack, int x, int y, String label) {
"""
Draws an itemStack to the GUI at the specified coordinates with a custom label.
@param itemStack the item stack
@param x the x
@param y the y
@param label the label
"""
drawItemStack(itemStack, x, y, label, null, true);
} | java | public void drawItemStack(ItemStack itemStack, int x, int y, String label)
{
drawItemStack(itemStack, x, y, label, null, true);
} | [
"public",
"void",
"drawItemStack",
"(",
"ItemStack",
"itemStack",
",",
"int",
"x",
",",
"int",
"y",
",",
"String",
"label",
")",
"{",
"drawItemStack",
"(",
"itemStack",
",",
"x",
",",
"y",
",",
"label",
",",
"null",
",",
"true",
")",
";",
"}"
] | Draws an itemStack to the GUI at the specified coordinates with a custom label.
@param itemStack the item stack
@param x the x
@param y the y
@param label the label | [
"Draws",
"an",
"itemStack",
"to",
"the",
"GUI",
"at",
"the",
"specified",
"coordinates",
"with",
"a",
"custom",
"label",
"."
] | train | https://github.com/Ordinastie/MalisisCore/blob/4f8e1fa462d5c372fc23414482ba9f429881cc54/src/main/java/net/malisis/core/client/gui/render/GuiRenderer.java#L398-L401 |
m-m-m/util | collection/src/main/java/net/sf/mmm/util/collection/base/AbstractClassHierarchyMap.java | AbstractClassHierarchyMap.isPreferable | protected boolean isPreferable(E element, Class<?> elementType, E existing, Class<?> currentType) {
"""
This method determines if the given {@code element} should be {@link #get(Class) associated} with
{@code currentType} in preference to the element {@code existing} that is already registered and will be replace... | java | protected boolean isPreferable(E element, Class<?> elementType, E existing, Class<?> currentType) {
return false;
} | [
"protected",
"boolean",
"isPreferable",
"(",
"E",
"element",
",",
"Class",
"<",
"?",
">",
"elementType",
",",
"E",
"existing",
",",
"Class",
"<",
"?",
">",
"currentType",
")",
"{",
"return",
"false",
";",
"}"
] | This method determines if the given {@code element} should be {@link #get(Class) associated} with
{@code currentType} in preference to the element {@code existing} that is already registered and will be replaced
according to the result of this method.
@param element is the element to register.
@param elementType is th... | [
"This",
"method",
"determines",
"if",
"the",
"given",
"{",
"@code",
"element",
"}",
"should",
"be",
"{",
"@link",
"#get",
"(",
"Class",
")",
"associated",
"}",
"with",
"{",
"@code",
"currentType",
"}",
"in",
"preference",
"to",
"the",
"element",
"{",
"@c... | train | https://github.com/m-m-m/util/blob/f0e4e084448f8dfc83ca682a9e1618034a094ce6/collection/src/main/java/net/sf/mmm/util/collection/base/AbstractClassHierarchyMap.java#L69-L72 |
bugsnag/bugsnag-java | bugsnag/src/main/java/com/bugsnag/Report.java | Report.setDeviceInfo | @Deprecated
public Report setDeviceInfo(String key, Object value) {
"""
Set device information on the report.
@param key the key of device info to add
@param value the value of device info to add
@return the modified report
@deprecated use {@link #addToTab(String, String, Object)} instead
"""
... | java | @Deprecated
public Report setDeviceInfo(String key, Object value) {
diagnostics.device.put(key, value);
return this;
} | [
"@",
"Deprecated",
"public",
"Report",
"setDeviceInfo",
"(",
"String",
"key",
",",
"Object",
"value",
")",
"{",
"diagnostics",
".",
"device",
".",
"put",
"(",
"key",
",",
"value",
")",
";",
"return",
"this",
";",
"}"
] | Set device information on the report.
@param key the key of device info to add
@param value the value of device info to add
@return the modified report
@deprecated use {@link #addToTab(String, String, Object)} instead | [
"Set",
"device",
"information",
"on",
"the",
"report",
"."
] | train | https://github.com/bugsnag/bugsnag-java/blob/11817d63949bcf2b2b6b765a1d37305cdec356f2/bugsnag/src/main/java/com/bugsnag/Report.java#L259-L263 |
intive-FDV/DynamicJasper | src/main/java/ar/com/fdvs/dj/domain/chart/builder/DJBarChartBuilder.java | DJBarChartBuilder.addSerie | public DJBarChartBuilder addSerie(AbstractColumn column, String label) {
"""
Adds the specified serie column to the dataset with custom label.
@param column the serie column
@param label column the custom label
"""
getDataset().addSerie(column, label);
return this;
} | java | public DJBarChartBuilder addSerie(AbstractColumn column, String label) {
getDataset().addSerie(column, label);
return this;
} | [
"public",
"DJBarChartBuilder",
"addSerie",
"(",
"AbstractColumn",
"column",
",",
"String",
"label",
")",
"{",
"getDataset",
"(",
")",
".",
"addSerie",
"(",
"column",
",",
"label",
")",
";",
"return",
"this",
";",
"}"
] | Adds the specified serie column to the dataset with custom label.
@param column the serie column
@param label column the custom label | [
"Adds",
"the",
"specified",
"serie",
"column",
"to",
"the",
"dataset",
"with",
"custom",
"label",
"."
] | train | https://github.com/intive-FDV/DynamicJasper/blob/63919574cc401ae40574d13129f628e66d1682a3/src/main/java/ar/com/fdvs/dj/domain/chart/builder/DJBarChartBuilder.java#L366-L369 |
quattor/pan | panc/src/main/java/org/quattor/pan/CompilerStatistics.java | CompilerStatistics.updateMaximum | private static void updateMaximum(AtomicLong counter, long currentValue) {
"""
Compares the current value against the value of the counter and updates
the counter if the current value is greater. This is done in a way to
ensure that no updates are lost.
@param counter
AtomicLong counter to update
@param cur... | java | private static void updateMaximum(AtomicLong counter, long currentValue) {
boolean unset = true;
long counterValue = counter.get();
while ((currentValue > counterValue) && unset) {
unset = !counter.compareAndSet(counterValue, currentValue);
counterValue = counter.get();
}
} | [
"private",
"static",
"void",
"updateMaximum",
"(",
"AtomicLong",
"counter",
",",
"long",
"currentValue",
")",
"{",
"boolean",
"unset",
"=",
"true",
";",
"long",
"counterValue",
"=",
"counter",
".",
"get",
"(",
")",
";",
"while",
"(",
"(",
"currentValue",
"... | Compares the current value against the value of the counter and updates
the counter if the current value is greater. This is done in a way to
ensure that no updates are lost.
@param counter
AtomicLong counter to update
@param currentValue
current value of the counter | [
"Compares",
"the",
"current",
"value",
"against",
"the",
"value",
"of",
"the",
"counter",
"and",
"updates",
"the",
"counter",
"if",
"the",
"current",
"value",
"is",
"greater",
".",
"This",
"is",
"done",
"in",
"a",
"way",
"to",
"ensure",
"that",
"no",
"up... | train | https://github.com/quattor/pan/blob/009934a603dd0c08d3fa4bb7d9389c380a916f54/panc/src/main/java/org/quattor/pan/CompilerStatistics.java#L153-L160 |
Azure/azure-sdk-for-java | policyinsights/resource-manager/v2018_04_04/src/main/java/com/microsoft/azure/management/policyinsights/v2018_04_04/implementation/PolicyStatesInner.java | PolicyStatesInner.summarizeForResourceGroup | public SummarizeResultsInner summarizeForResourceGroup(String subscriptionId, String resourceGroupName, QueryOptions queryOptions) {
"""
Summarizes policy states for the resources under the resource group.
@param subscriptionId Microsoft Azure subscription ID.
@param resourceGroupName Resource group name.
@pa... | java | public SummarizeResultsInner summarizeForResourceGroup(String subscriptionId, String resourceGroupName, QueryOptions queryOptions) {
return summarizeForResourceGroupWithServiceResponseAsync(subscriptionId, resourceGroupName, queryOptions).toBlocking().single().body();
} | [
"public",
"SummarizeResultsInner",
"summarizeForResourceGroup",
"(",
"String",
"subscriptionId",
",",
"String",
"resourceGroupName",
",",
"QueryOptions",
"queryOptions",
")",
"{",
"return",
"summarizeForResourceGroupWithServiceResponseAsync",
"(",
"subscriptionId",
",",
"resour... | Summarizes policy states for the resources under the resource group.
@param subscriptionId Microsoft Azure subscription ID.
@param resourceGroupName Resource group name.
@param queryOptions Additional parameters for the operation
@throws IllegalArgumentException thrown if parameters fail the validation
@throws QueryFa... | [
"Summarizes",
"policy",
"states",
"for",
"the",
"resources",
"under",
"the",
"resource",
"group",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/policyinsights/resource-manager/v2018_04_04/src/main/java/com/microsoft/azure/management/policyinsights/v2018_04_04/implementation/PolicyStatesInner.java#L1186-L1188 |
google/error-prone-javac | src/jdk.compiler/share/classes/com/sun/tools/javac/code/TypeAnnotations.java | TypeAnnotations.annotationTargetType | public AnnotationType annotationTargetType(Attribute.Compound a, Symbol s) {
"""
Determine whether an annotation is a declaration annotation,
a type annotation, or both.
"""
List<Attribute> targets = annotationTargets(a.type.tsym);
return (targets == null) ?
AnnotationType.DECL... | java | public AnnotationType annotationTargetType(Attribute.Compound a, Symbol s) {
List<Attribute> targets = annotationTargets(a.type.tsym);
return (targets == null) ?
AnnotationType.DECLARATION :
targets.stream()
.map(attr -> targetToAnnotationType(attr... | [
"public",
"AnnotationType",
"annotationTargetType",
"(",
"Attribute",
".",
"Compound",
"a",
",",
"Symbol",
"s",
")",
"{",
"List",
"<",
"Attribute",
">",
"targets",
"=",
"annotationTargets",
"(",
"a",
".",
"type",
".",
"tsym",
")",
";",
"return",
"(",
"targ... | Determine whether an annotation is a declaration annotation,
a type annotation, or both. | [
"Determine",
"whether",
"an",
"annotation",
"is",
"a",
"declaration",
"annotation",
"a",
"type",
"annotation",
"or",
"both",
"."
] | train | https://github.com/google/error-prone-javac/blob/a53d069bbdb2c60232ed3811c19b65e41c3e60e0/src/jdk.compiler/share/classes/com/sun/tools/javac/code/TypeAnnotations.java#L173-L180 |
google/closure-compiler | src/com/google/javascript/jscomp/RemoveUnusedCode.java | RemoveUnusedCode.traverseObjectDefinePropertiesLiteral | private void traverseObjectDefinePropertiesLiteral(Node propertyDefinitions, Scope scope) {
"""
Traverse the object literal passed as the second argument to `Object.defineProperties()`.
"""
for (Node property = propertyDefinitions.getFirstChild();
property != null;
property = property.getNe... | java | private void traverseObjectDefinePropertiesLiteral(Node propertyDefinitions, Scope scope) {
for (Node property = propertyDefinitions.getFirstChild();
property != null;
property = property.getNext()) {
if (property.isQuotedString()) {
// Quoted property name counts as a reference to the... | [
"private",
"void",
"traverseObjectDefinePropertiesLiteral",
"(",
"Node",
"propertyDefinitions",
",",
"Scope",
"scope",
")",
"{",
"for",
"(",
"Node",
"property",
"=",
"propertyDefinitions",
".",
"getFirstChild",
"(",
")",
";",
"property",
"!=",
"null",
";",
"proper... | Traverse the object literal passed as the second argument to `Object.defineProperties()`. | [
"Traverse",
"the",
"object",
"literal",
"passed",
"as",
"the",
"second",
"argument",
"to",
"Object",
".",
"defineProperties",
"()",
"."
] | train | https://github.com/google/closure-compiler/blob/d81e36740f6a9e8ac31a825ee8758182e1dc5aae/src/com/google/javascript/jscomp/RemoveUnusedCode.java#L682-L706 |
alkacon/opencms-core | src-gwt/org/opencms/gwt/client/ui/contextmenu/CmsShowWorkplace.java | CmsShowWorkplace.getContextMenuCommand | public static I_CmsContextMenuCommand getContextMenuCommand() {
"""
Returns the context menu command according to
{@link org.opencms.gwt.client.ui.contextmenu.I_CmsHasContextMenuCommand}.<p>
@return the context menu command
"""
return new I_CmsContextMenuCommand() {
public void execut... | java | public static I_CmsContextMenuCommand getContextMenuCommand() {
return new I_CmsContextMenuCommand() {
public void execute(CmsUUID structureId, I_CmsContextMenuHandler handler, CmsContextMenuEntryBean bean) {
openWorkplace(structureId, false);
}
public A_C... | [
"public",
"static",
"I_CmsContextMenuCommand",
"getContextMenuCommand",
"(",
")",
"{",
"return",
"new",
"I_CmsContextMenuCommand",
"(",
")",
"{",
"public",
"void",
"execute",
"(",
"CmsUUID",
"structureId",
",",
"I_CmsContextMenuHandler",
"handler",
",",
"CmsContextMenuE... | Returns the context menu command according to
{@link org.opencms.gwt.client.ui.contextmenu.I_CmsHasContextMenuCommand}.<p>
@return the context menu command | [
"Returns",
"the",
"context",
"menu",
"command",
"according",
"to",
"{",
"@link",
"org",
".",
"opencms",
".",
"gwt",
".",
"client",
".",
"ui",
".",
"contextmenu",
".",
"I_CmsHasContextMenuCommand",
"}",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src-gwt/org/opencms/gwt/client/ui/contextmenu/CmsShowWorkplace.java#L58-L80 |
CenturyLinkCloud/mdw | mdw-services/src/com/centurylink/mdw/service/data/event/EventHandlerCache.java | EventHandlerCache.getPathExternalEvents | public static List<ExternalEvent> getPathExternalEvents(String bucket) {
"""
returns the cached path-based external event
@param bucket
@return Cached Item
"""
if (myPathCache.get(bucket) != null)
return myPathCache.get(bucket);
else if (bucket.indexOf('/') > 0) { // We could hav... | java | public static List<ExternalEvent> getPathExternalEvents(String bucket){
if (myPathCache.get(bucket) != null)
return myPathCache.get(bucket);
else if (bucket.indexOf('/') > 0) { // We could have a sub-path
return getPathExternalEvents(bucket.substring(0, bucket.lastIndexOf('/')))... | [
"public",
"static",
"List",
"<",
"ExternalEvent",
">",
"getPathExternalEvents",
"(",
"String",
"bucket",
")",
"{",
"if",
"(",
"myPathCache",
".",
"get",
"(",
"bucket",
")",
"!=",
"null",
")",
"return",
"myPathCache",
".",
"get",
"(",
"bucket",
")",
";",
... | returns the cached path-based external event
@param bucket
@return Cached Item | [
"returns",
"the",
"cached",
"path",
"-",
"based",
"external",
"event"
] | train | https://github.com/CenturyLinkCloud/mdw/blob/91167fe65a25a5d7022cdcf8b0fae8506f5b87ce/mdw-services/src/com/centurylink/mdw/service/data/event/EventHandlerCache.java#L78-L85 |
krummas/DrizzleJDBC | src/main/java/org/drizzle/jdbc/DrizzlePreparedStatement.java | DrizzlePreparedStatement.setURL | public void setURL(final int parameterIndex, final URL x) throws SQLException {
"""
Sets the designated parameter to the given <code>java.net.URL</code> value. The driver converts this to an SQL
<code>DATALINK</code> value when it sends it to the database.
@param parameterIndex the first parameter is 1, the se... | java | public void setURL(final int parameterIndex, final URL x) throws SQLException {
setParameter(parameterIndex, new StringParameter(x.toString()));
} | [
"public",
"void",
"setURL",
"(",
"final",
"int",
"parameterIndex",
",",
"final",
"URL",
"x",
")",
"throws",
"SQLException",
"{",
"setParameter",
"(",
"parameterIndex",
",",
"new",
"StringParameter",
"(",
"x",
".",
"toString",
"(",
")",
")",
")",
";",
"}"
] | Sets the designated parameter to the given <code>java.net.URL</code> value. The driver converts this to an SQL
<code>DATALINK</code> value when it sends it to the database.
@param parameterIndex the first parameter is 1, the second is 2, ...
@param x the <code>java.net.URL</code> object to be set
@throws ... | [
"Sets",
"the",
"designated",
"parameter",
"to",
"the",
"given",
"<code",
">",
"java",
".",
"net",
".",
"URL<",
"/",
"code",
">",
"value",
".",
"The",
"driver",
"converts",
"this",
"to",
"an",
"SQL",
"<code",
">",
"DATALINK<",
"/",
"code",
">",
"value",... | train | https://github.com/krummas/DrizzleJDBC/blob/716f31fd71f3cc289edf69844d8117deb86d98d6/src/main/java/org/drizzle/jdbc/DrizzlePreparedStatement.java#L466-L468 |
alkacon/opencms-core | src/org/opencms/ui/apps/user/CmsUserTable.java | CmsUserTable.addUserToContainer | protected void addUserToContainer(IndexedContainer container, CmsUser user) {
"""
Adds given user to given IndexedContainer.<p>
@param container to add the user to
@param user to add
"""
if (m_blackList.contains(user)) {
return;
}
Item item = container.addItem(user);
... | java | protected void addUserToContainer(IndexedContainer container, CmsUser user) {
if (m_blackList.contains(user)) {
return;
}
Item item = container.addItem(user);
fillItem(item, user);
} | [
"protected",
"void",
"addUserToContainer",
"(",
"IndexedContainer",
"container",
",",
"CmsUser",
"user",
")",
"{",
"if",
"(",
"m_blackList",
".",
"contains",
"(",
"user",
")",
")",
"{",
"return",
";",
"}",
"Item",
"item",
"=",
"container",
".",
"addItem",
... | Adds given user to given IndexedContainer.<p>
@param container to add the user to
@param user to add | [
"Adds",
"given",
"user",
"to",
"given",
"IndexedContainer",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/ui/apps/user/CmsUserTable.java#L1017-L1024 |
hortonworks/dstream | dstream-nifi/src/main/java/io/dstream/nifi/AbstractDStreamProcessor.java | AbstractDStreamProcessor.installConfiguration | private String installConfiguration(String configurationName, InputStream confFileInputStream) {
"""
Will generate execution configuration and add it to the classpath
@param context
"""
String outputPath;
try {
File confDir = new File(System.getProperty("java.io.tmpdir") + "/dstream_" + UUID.randomUUID... | java | private String installConfiguration(String configurationName, InputStream confFileInputStream){
String outputPath;
try {
File confDir = new File(System.getProperty("java.io.tmpdir") + "/dstream_" + UUID.randomUUID());
confDir.mkdirs();
File executionConfig = new File(confDir, configurationName);
executi... | [
"private",
"String",
"installConfiguration",
"(",
"String",
"configurationName",
",",
"InputStream",
"confFileInputStream",
")",
"{",
"String",
"outputPath",
";",
"try",
"{",
"File",
"confDir",
"=",
"new",
"File",
"(",
"System",
".",
"getProperty",
"(",
"\"java.io... | Will generate execution configuration and add it to the classpath
@param context | [
"Will",
"generate",
"execution",
"configuration",
"and",
"add",
"it",
"to",
"the",
"classpath"
] | train | https://github.com/hortonworks/dstream/blob/3a106c0f14725b028fe7fe2dbc660406d9a5f142/dstream-nifi/src/main/java/io/dstream/nifi/AbstractDStreamProcessor.java#L233-L256 |
Ordinastie/MalisisCore | src/main/java/net/malisis/core/renderer/font/MalisisFont.java | MalisisFont.clipString | public String clipString(String str, int width, FontOptions options, boolean appendPeriods) {
"""
Clips a string to fit in the specified width.
@param str the str
@param width the width
@param options the options
@param appendPeriods the append periods
@return the string
"""
str = processString(str, o... | java | public String clipString(String str, int width, FontOptions options, boolean appendPeriods)
{
str = processString(str, options);
if (appendPeriods)
width -= 4;
int pos = (int) getCharPosition(str, options, width, 0);
return str.substring(0, pos) + (pos < str.length() && appendPeriods ? "..." : "");
} | [
"public",
"String",
"clipString",
"(",
"String",
"str",
",",
"int",
"width",
",",
"FontOptions",
"options",
",",
"boolean",
"appendPeriods",
")",
"{",
"str",
"=",
"processString",
"(",
"str",
",",
"options",
")",
";",
"if",
"(",
"appendPeriods",
")",
"widt... | Clips a string to fit in the specified width.
@param str the str
@param width the width
@param options the options
@param appendPeriods the append periods
@return the string | [
"Clips",
"a",
"string",
"to",
"fit",
"in",
"the",
"specified",
"width",
"."
] | train | https://github.com/Ordinastie/MalisisCore/blob/4f8e1fa462d5c372fc23414482ba9f429881cc54/src/main/java/net/malisis/core/renderer/font/MalisisFont.java#L440-L448 |
lessthanoptimal/BoofCV | main/boofcv-recognition/src/main/java/boofcv/alg/fiducial/square/FiducialSquareGenerator.java | FiducialSquareGenerator.generate | public void generate( long value , int gridWidth ) {
"""
Renders a binary square fiducial
@param value Value encoded in the fiducial
@param gridWidth number of cells wide the grid is
"""
renderer.init();
drawBorder();
double whiteBorder = whiteBorderDoc /markerWidth;
double X0 = whiteBorder+black... | java | public void generate( long value , int gridWidth ) {
renderer.init();
drawBorder();
double whiteBorder = whiteBorderDoc /markerWidth;
double X0 = whiteBorder+blackBorder;
double Y0 = whiteBorder+blackBorder;
double bw = (1.0-2*X0)/gridWidth;
// Draw the black corner used to ID the orientation
square... | [
"public",
"void",
"generate",
"(",
"long",
"value",
",",
"int",
"gridWidth",
")",
"{",
"renderer",
".",
"init",
"(",
")",
";",
"drawBorder",
"(",
")",
";",
"double",
"whiteBorder",
"=",
"whiteBorderDoc",
"/",
"markerWidth",
";",
"double",
"X0",
"=",
"whi... | Renders a binary square fiducial
@param value Value encoded in the fiducial
@param gridWidth number of cells wide the grid is | [
"Renders",
"a",
"binary",
"square",
"fiducial"
] | train | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-recognition/src/main/java/boofcv/alg/fiducial/square/FiducialSquareGenerator.java#L92-L133 |
jglobus/JGlobus | gridftp/src/main/java/org/globus/ftp/GridFTPClient.java | GridFTPClient.setDataChannelAuthentication | public void setDataChannelAuthentication(DataChannelAuthentication type)
throws IOException,
ServerException {
"""
Sets data channel authentication mode (DCAU)
@param type for 2-party transfer must be
DataChannelAuthentication.SELF or DataChannelAuthentication.NONE
"""
Comma... | java | public void setDataChannelAuthentication(DataChannelAuthentication type)
throws IOException,
ServerException {
Command cmd = new Command("DCAU", type.toFtpCmdArgument());
try{
controlChannel.execute(cmd);
} catch (UnexpectedReplyCodeException urce) {
... | [
"public",
"void",
"setDataChannelAuthentication",
"(",
"DataChannelAuthentication",
"type",
")",
"throws",
"IOException",
",",
"ServerException",
"{",
"Command",
"cmd",
"=",
"new",
"Command",
"(",
"\"DCAU\"",
",",
"type",
".",
"toFtpCmdArgument",
"(",
")",
")",
";... | Sets data channel authentication mode (DCAU)
@param type for 2-party transfer must be
DataChannelAuthentication.SELF or DataChannelAuthentication.NONE | [
"Sets",
"data",
"channel",
"authentication",
"mode",
"(",
"DCAU",
")"
] | train | https://github.com/jglobus/JGlobus/blob/e14f6f6636544fd84298f9cec749d626ea971930/gridftp/src/main/java/org/globus/ftp/GridFTPClient.java#L792-L813 |
Azure/azure-sdk-for-java | batch/data-plane/src/main/java/com/microsoft/azure/batch/protocol/implementation/ComputeNodesImpl.java | ComputeNodesImpl.getRemoteDesktopAsync | public Observable<InputStream> getRemoteDesktopAsync(String poolId, String nodeId) {
"""
Gets the Remote Desktop Protocol file for the specified compute node.
Before you can access a node by using the RDP file, you must create a user account on the node. This API can only be invoked on pools created with a cloud ... | java | public Observable<InputStream> getRemoteDesktopAsync(String poolId, String nodeId) {
return getRemoteDesktopWithServiceResponseAsync(poolId, nodeId).map(new Func1<ServiceResponseWithHeaders<InputStream, ComputeNodeGetRemoteDesktopHeaders>, InputStream>() {
@Override
public InputStream ca... | [
"public",
"Observable",
"<",
"InputStream",
">",
"getRemoteDesktopAsync",
"(",
"String",
"poolId",
",",
"String",
"nodeId",
")",
"{",
"return",
"getRemoteDesktopWithServiceResponseAsync",
"(",
"poolId",
",",
"nodeId",
")",
".",
"map",
"(",
"new",
"Func1",
"<",
"... | Gets the Remote Desktop Protocol file for the specified compute node.
Before you can access a node by using the RDP file, you must create a user account on the node. This API can only be invoked on pools created with a cloud service configuration. For pools created with a virtual machine configuration, see the GetRemot... | [
"Gets",
"the",
"Remote",
"Desktop",
"Protocol",
"file",
"for",
"the",
"specified",
"compute",
"node",
".",
"Before",
"you",
"can",
"access",
"a",
"node",
"by",
"using",
"the",
"RDP",
"file",
"you",
"must",
"create",
"a",
"user",
"account",
"on",
"the",
"... | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/batch/data-plane/src/main/java/com/microsoft/azure/batch/protocol/implementation/ComputeNodesImpl.java#L2183-L2190 |
alkacon/opencms-core | src/org/opencms/jsp/CmsJspTagInfo.java | CmsJspTagInfo.getDescriptionInfo | public static String getDescriptionInfo(CmsFlexController controller, HttpServletRequest req) {
"""
Returns the description of a page delivered from OpenCms, usually used for the <code>description</code> metatag of
a HTML page.<p>
If no description information has been found, the empty String "" is returned.<p... | java | public static String getDescriptionInfo(CmsFlexController controller, HttpServletRequest req) {
String result = null;
CmsObject cms = controller.getCmsObject();
try {
CmsJspStandardContextBean contextBean = CmsJspStandardContextBean.getInstance(req);
if (contextBean.is... | [
"public",
"static",
"String",
"getDescriptionInfo",
"(",
"CmsFlexController",
"controller",
",",
"HttpServletRequest",
"req",
")",
"{",
"String",
"result",
"=",
"null",
";",
"CmsObject",
"cms",
"=",
"controller",
".",
"getCmsObject",
"(",
")",
";",
"try",
"{",
... | Returns the description of a page delivered from OpenCms, usually used for the <code>description</code> metatag of
a HTML page.<p>
If no description information has been found, the empty String "" is returned.<p>
@param controller the current OpenCms request controller
@param req the current request
@return the desc... | [
"Returns",
"the",
"description",
"of",
"a",
"page",
"delivered",
"from",
"OpenCms",
"usually",
"used",
"for",
"the",
"<code",
">",
"description<",
"/",
"code",
">",
"metatag",
"of",
"a",
"HTML",
"page",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/jsp/CmsJspTagInfo.java#L136-L165 |
openengsb/openengsb | components/services/src/main/java/org/openengsb/core/services/internal/security/ldap/LdapUtils.java | LdapUtils.concatDn | public static Dn concatDn(String rdnAttribute, String rdnValue, Dn basedn) {
"""
Returns a {@link Dn} consisting of baseDn extended by an Rdn of type rdnAttribute and value rdnValue.
"""
try {
Rdn rdn = new Rdn(rdnAttribute, rdnValue);
return basedn.add(rdn);
} catch (Ld... | java | public static Dn concatDn(String rdnAttribute, String rdnValue, Dn basedn) {
try {
Rdn rdn = new Rdn(rdnAttribute, rdnValue);
return basedn.add(rdn);
} catch (LdapInvalidDnException e) {
throw new LdapRuntimeException(e);
}
} | [
"public",
"static",
"Dn",
"concatDn",
"(",
"String",
"rdnAttribute",
",",
"String",
"rdnValue",
",",
"Dn",
"basedn",
")",
"{",
"try",
"{",
"Rdn",
"rdn",
"=",
"new",
"Rdn",
"(",
"rdnAttribute",
",",
"rdnValue",
")",
";",
"return",
"basedn",
".",
"add",
... | Returns a {@link Dn} consisting of baseDn extended by an Rdn of type rdnAttribute and value rdnValue. | [
"Returns",
"a",
"{"
] | train | https://github.com/openengsb/openengsb/blob/d39058000707f617cd405629f9bc7f17da7b414a/components/services/src/main/java/org/openengsb/core/services/internal/security/ldap/LdapUtils.java#L42-L49 |
square/picasso | picasso/src/main/java/com/squareup/picasso3/Picasso.java | Picasso.cancelRequest | public void cancelRequest(@NonNull RemoteViews remoteViews, @IdRes int viewId) {
"""
Cancel any existing requests for the specified {@link RemoteViews} target with the given {@code
viewId}.
"""
// checkMain() is called from cancelExistingRequest()
checkNotNull(remoteViews, "remoteViews == null");
... | java | public void cancelRequest(@NonNull RemoteViews remoteViews, @IdRes int viewId) {
// checkMain() is called from cancelExistingRequest()
checkNotNull(remoteViews, "remoteViews == null");
cancelExistingRequest(new RemoteViewsAction.RemoteViewsTarget(remoteViews, viewId));
} | [
"public",
"void",
"cancelRequest",
"(",
"@",
"NonNull",
"RemoteViews",
"remoteViews",
",",
"@",
"IdRes",
"int",
"viewId",
")",
"{",
"// checkMain() is called from cancelExistingRequest()",
"checkNotNull",
"(",
"remoteViews",
",",
"\"remoteViews == null\"",
")",
";",
"ca... | Cancel any existing requests for the specified {@link RemoteViews} target with the given {@code
viewId}. | [
"Cancel",
"any",
"existing",
"requests",
"for",
"the",
"specified",
"{"
] | train | https://github.com/square/picasso/blob/89f55b76e3be2b65e5997b7698f782f16f8547e3/picasso/src/main/java/com/squareup/picasso3/Picasso.java#L230-L234 |
xmlunit/xmlunit | xmlunit-core/src/main/java/org/xmlunit/diff/XPathContext.java | XPathContext.appendChildren | public void appendChildren(Iterable<? extends NodeInfo> children) {
"""
Adds knowledge about the current node's children appending to
the knowledge already present.
"""
Level current = path.getLast();
int comments, pis, texts;
comments = pis = texts = 0;
Map<String, Integer> el... | java | public void appendChildren(Iterable<? extends NodeInfo> children) {
Level current = path.getLast();
int comments, pis, texts;
comments = pis = texts = 0;
Map<String, Integer> elements = new HashMap<String, Integer>();
for (Level l : current.children) {
String childNa... | [
"public",
"void",
"appendChildren",
"(",
"Iterable",
"<",
"?",
"extends",
"NodeInfo",
">",
"children",
")",
"{",
"Level",
"current",
"=",
"path",
".",
"getLast",
"(",
")",
";",
"int",
"comments",
",",
"pis",
",",
"texts",
";",
"comments",
"=",
"pis",
"... | Adds knowledge about the current node's children appending to
the knowledge already present. | [
"Adds",
"knowledge",
"about",
"the",
"current",
"node",
"s",
"children",
"appending",
"to",
"the",
"knowledge",
"already",
"present",
"."
] | train | https://github.com/xmlunit/xmlunit/blob/fe3d701d43f57ee83dcba336e4c1555619d3084b/xmlunit-core/src/main/java/org/xmlunit/diff/XPathContext.java#L145-L191 |
Jasig/uPortal | uPortal-api/uPortal-api-internal/src/main/java/org/apereo/portal/portlets/login/LoginPortletHelper.java | LoginPortletHelper.getSelectedProfile | public String getSelectedProfile(PortletRequest request) {
"""
Get the profile that should be pre-selected in the local login form.
@param request
@return
"""
// if a profile selection exists in the session, use it
final PortletSession session = request.getPortletSession();
String ... | java | public String getSelectedProfile(PortletRequest request) {
// if a profile selection exists in the session, use it
final PortletSession session = request.getPortletSession();
String profileName =
(String)
session.getAttribute(
... | [
"public",
"String",
"getSelectedProfile",
"(",
"PortletRequest",
"request",
")",
"{",
"// if a profile selection exists in the session, use it",
"final",
"PortletSession",
"session",
"=",
"request",
".",
"getPortletSession",
"(",
")",
";",
"String",
"profileName",
"=",
"(... | Get the profile that should be pre-selected in the local login form.
@param request
@return | [
"Get",
"the",
"profile",
"that",
"should",
"be",
"pre",
"-",
"selected",
"in",
"the",
"local",
"login",
"form",
"."
] | train | https://github.com/Jasig/uPortal/blob/c1986542abb9acd214268f2df21c6305ad2f262b/uPortal-api/uPortal-api-internal/src/main/java/org/apereo/portal/portlets/login/LoginPortletHelper.java#L69-L99 |
jfinal/jfinal | src/main/java/com/jfinal/plugin/redis/Cache.java | Cache.zscore | public Double zscore(Object key, Object member) {
"""
返回有序集 key 中,成员 member 的 score 值。
如果 member 元素不是有序集 key 的成员,或 key 不存在,返回 nil 。
"""
Jedis jedis = getJedis();
try {
return jedis.zscore(keyToBytes(key), valueToBytes(member));
}
finally {close(jedis);}
} | java | public Double zscore(Object key, Object member) {
Jedis jedis = getJedis();
try {
return jedis.zscore(keyToBytes(key), valueToBytes(member));
}
finally {close(jedis);}
} | [
"public",
"Double",
"zscore",
"(",
"Object",
"key",
",",
"Object",
"member",
")",
"{",
"Jedis",
"jedis",
"=",
"getJedis",
"(",
")",
";",
"try",
"{",
"return",
"jedis",
".",
"zscore",
"(",
"keyToBytes",
"(",
"key",
")",
",",
"valueToBytes",
"(",
"member... | 返回有序集 key 中,成员 member 的 score 值。
如果 member 元素不是有序集 key 的成员,或 key 不存在,返回 nil 。 | [
"返回有序集",
"key",
"中,成员",
"member",
"的",
"score",
"值。",
"如果",
"member",
"元素不是有序集",
"key",
"的成员,或",
"key",
"不存在,返回",
"nil",
"。"
] | train | https://github.com/jfinal/jfinal/blob/fc07f0f5d56e85ccd3cfcdd587b56b8dd9c663e9/src/main/java/com/jfinal/plugin/redis/Cache.java#L1143-L1149 |
jenkinsci/jenkins | core/src/main/java/jenkins/InitReactorRunner.java | InitReactorRunner.buildReactorListener | private ReactorListener buildReactorListener() throws IOException {
"""
Aggregates all the listeners into one and returns it.
<p>
At this point plugins are not loaded yet, so we fall back to the META-INF/services look up to discover implementations.
As such there's no way for plugins to participate into this ... | java | private ReactorListener buildReactorListener() throws IOException {
List<ReactorListener> r = Lists.newArrayList(ServiceLoader.load(InitReactorListener.class, Thread.currentThread().getContextClassLoader()));
r.add(new ReactorListener() {
final Level level = Level.parse( Configuration.getStr... | [
"private",
"ReactorListener",
"buildReactorListener",
"(",
")",
"throws",
"IOException",
"{",
"List",
"<",
"ReactorListener",
">",
"r",
"=",
"Lists",
".",
"newArrayList",
"(",
"ServiceLoader",
".",
"load",
"(",
"InitReactorListener",
".",
"class",
",",
"Thread",
... | Aggregates all the listeners into one and returns it.
<p>
At this point plugins are not loaded yet, so we fall back to the META-INF/services look up to discover implementations.
As such there's no way for plugins to participate into this process. | [
"Aggregates",
"all",
"the",
"listeners",
"into",
"one",
"and",
"returns",
"it",
"."
] | train | https://github.com/jenkinsci/jenkins/blob/44c4d3989232082c254d27ae360aa810669f44b7/core/src/main/java/jenkins/InitReactorRunner.java#L62-L90 |
hageldave/ImagingKit | ImagingKit_Core/src/main/java/hageldave/imagingkit/core/util/ImagingKitUtils.java | ImagingKitUtils.requireAreaInImageBounds | public static void requireAreaInImageBounds(final int xStart, final int yStart, final int width, final int height, ImgBase<?> img) {
"""
Throws an {@link IllegalArgumentException} when the specified area
is not within the bounds of the specified image, or if the area
is not positive.
This is used for parameter ... | java | public static void requireAreaInImageBounds(final int xStart, final int yStart, final int width, final int height, ImgBase<?> img){
if( width <= 0 || height <= 0 ||
xStart < 0 || yStart < 0 ||
xStart+width > img.getWidth() || yStart+height > img.getHeight() )
{
throw new IllegalArgumentException(String.... | [
"public",
"static",
"void",
"requireAreaInImageBounds",
"(",
"final",
"int",
"xStart",
",",
"final",
"int",
"yStart",
",",
"final",
"int",
"width",
",",
"final",
"int",
"height",
",",
"ImgBase",
"<",
"?",
">",
"img",
")",
"{",
"if",
"(",
"width",
"<=",
... | Throws an {@link IllegalArgumentException} when the specified area
is not within the bounds of the specified image, or if the area
is not positive.
This is used for parameter evaluation.
@param xStart left boundary of the area
@param yStart top boundary of the area
@param width of the area
@param height of the area
@p... | [
"Throws",
"an",
"{",
"@link",
"IllegalArgumentException",
"}",
"when",
"the",
"specified",
"area",
"is",
"not",
"within",
"the",
"bounds",
"of",
"the",
"specified",
"image",
"or",
"if",
"the",
"area",
"is",
"not",
"positive",
".",
"This",
"is",
"used",
"fo... | train | https://github.com/hageldave/ImagingKit/blob/3837c7d550a12cf4dc5718b644ced94b97f52668/ImagingKit_Core/src/main/java/hageldave/imagingkit/core/util/ImagingKitUtils.java#L50-L59 |
apache/flink | flink-core/src/main/java/org/apache/flink/types/StringValue.java | StringValue.setValue | public void setValue(CharSequence value, int offset, int len) {
"""
Sets the value of the StringValue to a substring of the given string.
@param value The new string value.
@param offset The position to start the substring.
@param len The length of the substring.
"""
checkNotNull(value);
if (offset < ... | java | public void setValue(CharSequence value, int offset, int len) {
checkNotNull(value);
if (offset < 0 || len < 0 || offset > value.length() - len) {
throw new IndexOutOfBoundsException("offset: " + offset + " len: " + len + " value.len: " + len);
}
ensureSize(len);
this.len = len;
for (int i = 0; i < le... | [
"public",
"void",
"setValue",
"(",
"CharSequence",
"value",
",",
"int",
"offset",
",",
"int",
"len",
")",
"{",
"checkNotNull",
"(",
"value",
")",
";",
"if",
"(",
"offset",
"<",
"0",
"||",
"len",
"<",
"0",
"||",
"offset",
">",
"value",
".",
"length",
... | Sets the value of the StringValue to a substring of the given string.
@param value The new string value.
@param offset The position to start the substring.
@param len The length of the substring. | [
"Sets",
"the",
"value",
"of",
"the",
"StringValue",
"to",
"a",
"substring",
"of",
"the",
"given",
"string",
"."
] | train | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-core/src/main/java/org/apache/flink/types/StringValue.java#L184-L196 |
kubernetes-client/java | util/src/main/java/io/kubernetes/client/util/Yaml.java | Yaml.dumpAll | public static void dumpAll(Iterator<? extends Object> data, Writer output) {
"""
Takes an Iterator of YAML API objects and writes a YAML String representing all of them.
@param data The list of YAML API objects.
@param output The writer to output the YAML String to.
"""
getSnakeYaml().dumpAll(data, out... | java | public static void dumpAll(Iterator<? extends Object> data, Writer output) {
getSnakeYaml().dumpAll(data, output);
} | [
"public",
"static",
"void",
"dumpAll",
"(",
"Iterator",
"<",
"?",
"extends",
"Object",
">",
"data",
",",
"Writer",
"output",
")",
"{",
"getSnakeYaml",
"(",
")",
".",
"dumpAll",
"(",
"data",
",",
"output",
")",
";",
"}"
] | Takes an Iterator of YAML API objects and writes a YAML String representing all of them.
@param data The list of YAML API objects.
@param output The writer to output the YAML String to. | [
"Takes",
"an",
"Iterator",
"of",
"YAML",
"API",
"objects",
"and",
"writes",
"a",
"YAML",
"String",
"representing",
"all",
"of",
"them",
"."
] | train | https://github.com/kubernetes-client/java/blob/7413e98bd904f09d1ad00fb60e8c6ff787f3f560/util/src/main/java/io/kubernetes/client/util/Yaml.java#L316-L318 |
alkacon/opencms-core | src/org/opencms/db/CmsSecurityManager.java | CmsSecurityManager.deleteAliases | public void deleteAliases(CmsRequestContext context, CmsAliasFilter filter) throws CmsException {
"""
Deletes alias entries matching a filter.<p>
@param context the request context
@param filter the alias filter
@throws CmsException if something goes wrong
"""
CmsDbContext dbc = m_dbContextFact... | java | public void deleteAliases(CmsRequestContext context, CmsAliasFilter filter) throws CmsException {
CmsDbContext dbc = m_dbContextFactory.getDbContext(context);
try {
m_driverManager.deleteAliases(dbc, context.getCurrentProject(), filter);
} catch (Exception e) {
dbc.repor... | [
"public",
"void",
"deleteAliases",
"(",
"CmsRequestContext",
"context",
",",
"CmsAliasFilter",
"filter",
")",
"throws",
"CmsException",
"{",
"CmsDbContext",
"dbc",
"=",
"m_dbContextFactory",
".",
"getDbContext",
"(",
"context",
")",
";",
"try",
"{",
"m_driverManager... | Deletes alias entries matching a filter.<p>
@param context the request context
@param filter the alias filter
@throws CmsException if something goes wrong | [
"Deletes",
"alias",
"entries",
"matching",
"a",
"filter",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/db/CmsSecurityManager.java#L1259-L1270 |
brianwhu/xillium | base/src/main/java/org/xillium/base/beans/Beans.java | Beans.valueOf | @Deprecated
public static <T> T valueOf(Class<T> type, String value) {
"""
Converts a String representation into a value of a given type. This method calls
{@code valueOf(type, value, null)}.
@param <T> the target class
@param type the target class
@param value the string to convert
@return the converte... | java | @Deprecated
public static <T> T valueOf(Class<T> type, String value) {
return valueOf(type, value, null);
} | [
"@",
"Deprecated",
"public",
"static",
"<",
"T",
">",
"T",
"valueOf",
"(",
"Class",
"<",
"T",
">",
"type",
",",
"String",
"value",
")",
"{",
"return",
"valueOf",
"(",
"type",
",",
"value",
",",
"null",
")",
";",
"}"
] | Converts a String representation into a value of a given type. This method calls
{@code valueOf(type, value, null)}.
@param <T> the target class
@param type the target class
@param value the string to convert
@return the converted value
@throws IllegalArgumentException if all conversion attempts fail | [
"Converts",
"a",
"String",
"representation",
"into",
"a",
"value",
"of",
"a",
"given",
"type",
".",
"This",
"method",
"calls",
"{",
"@code",
"valueOf",
"(",
"type",
"value",
"null",
")",
"}",
"."
] | train | https://github.com/brianwhu/xillium/blob/e8dbf8cb6589fa1031a0bfcdcb58cb03d2ba7799/base/src/main/java/org/xillium/base/beans/Beans.java#L514-L517 |
awslabs/amazon-sqs-java-messaging-lib | src/main/java/com/amazon/sqs/javamessaging/AmazonSQSMessagingClientWrapper.java | AmazonSQSMessagingClientWrapper.createQueue | public CreateQueueResult createQueue(CreateQueueRequest createQueueRequest) throws JMSException {
"""
Calls <code>createQueue</code> to create the queue with the provided queue attributes
if any, and wraps <code>AmazonClientException</code>
@param createQueueRequest
Container for the necessary parameters to e... | java | public CreateQueueResult createQueue(CreateQueueRequest createQueueRequest) throws JMSException {
try {
prepareRequest(createQueueRequest);
return amazonSQSClient.createQueue(createQueueRequest);
} catch (AmazonClientException e) {
throw handleException(e, "createQueu... | [
"public",
"CreateQueueResult",
"createQueue",
"(",
"CreateQueueRequest",
"createQueueRequest",
")",
"throws",
"JMSException",
"{",
"try",
"{",
"prepareRequest",
"(",
"createQueueRequest",
")",
";",
"return",
"amazonSQSClient",
".",
"createQueue",
"(",
"createQueueRequest"... | Calls <code>createQueue</code> to create the queue with the provided queue attributes
if any, and wraps <code>AmazonClientException</code>
@param createQueueRequest
Container for the necessary parameters to execute the
createQueue service method on AmazonSQS.
@return The response from the createQueue service method, a... | [
"Calls",
"<code",
">",
"createQueue<",
"/",
"code",
">",
"to",
"create",
"the",
"queue",
"with",
"the",
"provided",
"queue",
"attributes",
"if",
"any",
"and",
"wraps",
"<code",
">",
"AmazonClientException<",
"/",
"code",
">"
] | train | https://github.com/awslabs/amazon-sqs-java-messaging-lib/blob/efa716d34d51ef1c5572790626cdb795419cb342/src/main/java/com/amazon/sqs/javamessaging/AmazonSQSMessagingClientWrapper.java#L326-L333 |
ibm-bluemix-mobile-services/bms-clientsdk-android-core | lib/src/main/java/com/ibm/mobilefirstplatform/clientsdk/android/security/mca/internal/AuthorizationRequestManager.java | AuthorizationRequestManager.startHandleChallenges | private void startHandleChallenges(JSONObject jsonChallenges, Response response) {
"""
Handles authentication challenges.
@param jsonChallenges Collection of challenges.
@param response Server response.
"""
ArrayList<String> challenges = getRealmsFromJson(jsonChallenges);
MCAAuthoriz... | java | private void startHandleChallenges(JSONObject jsonChallenges, Response response) {
ArrayList<String> challenges = getRealmsFromJson(jsonChallenges);
MCAAuthorizationManager authManager = (MCAAuthorizationManager) BMSClient.getInstance().getAuthorizationManager();
if (isAuthorizationRequired(re... | [
"private",
"void",
"startHandleChallenges",
"(",
"JSONObject",
"jsonChallenges",
",",
"Response",
"response",
")",
"{",
"ArrayList",
"<",
"String",
">",
"challenges",
"=",
"getRealmsFromJson",
"(",
"jsonChallenges",
")",
";",
"MCAAuthorizationManager",
"authManager",
... | Handles authentication challenges.
@param jsonChallenges Collection of challenges.
@param response Server response. | [
"Handles",
"authentication",
"challenges",
"."
] | train | https://github.com/ibm-bluemix-mobile-services/bms-clientsdk-android-core/blob/8db4f00d0d564792397bfc0e5bd57d52a238b858/lib/src/main/java/com/ibm/mobilefirstplatform/clientsdk/android/security/mca/internal/AuthorizationRequestManager.java#L413-L431 |
google/j2objc | jre_emul/android/platform/libcore/luni/src/main/java/org/xml/sax/helpers/NewInstance.java | NewInstance.newInstance | static Object newInstance (ClassLoader classLoader, String className)
throws ClassNotFoundException, IllegalAccessException,
InstantiationException {
"""
Creates a new instance of the specified class name
Package private so this code is not exposed at the API level.
"""
Class dri... | java | static Object newInstance (ClassLoader classLoader, String className)
throws ClassNotFoundException, IllegalAccessException,
InstantiationException
{
Class driverClass;
if (classLoader == null) {
driverClass = Class.forName(className);
} else {
dri... | [
"static",
"Object",
"newInstance",
"(",
"ClassLoader",
"classLoader",
",",
"String",
"className",
")",
"throws",
"ClassNotFoundException",
",",
"IllegalAccessException",
",",
"InstantiationException",
"{",
"Class",
"driverClass",
";",
"if",
"(",
"classLoader",
"==",
"... | Creates a new instance of the specified class name
Package private so this code is not exposed at the API level. | [
"Creates",
"a",
"new",
"instance",
"of",
"the",
"specified",
"class",
"name"
] | train | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/libcore/luni/src/main/java/org/xml/sax/helpers/NewInstance.java#L41-L52 |
couchbase/couchbase-java-client | src/main/java/com/couchbase/client/java/cluster/api/RestBuilder.java | RestBuilder.withHeader | public RestBuilder withHeader(String key, Object value) {
"""
Adds an HTTP header to the request. Using a key twice will result
in the last value being used for a given header.
@param key the header name (see HttpHeaders.Names for standard names).
@param value the header value (see HttpHeaders.Values for stan... | java | public RestBuilder withHeader(String key, Object value) {
delegate.withHeader(key, value);
return this;
} | [
"public",
"RestBuilder",
"withHeader",
"(",
"String",
"key",
",",
"Object",
"value",
")",
"{",
"delegate",
".",
"withHeader",
"(",
"key",
",",
"value",
")",
";",
"return",
"this",
";",
"}"
] | Adds an HTTP header to the request. Using a key twice will result
in the last value being used for a given header.
@param key the header name (see HttpHeaders.Names for standard names).
@param value the header value (see HttpHeaders.Values for standard values). | [
"Adds",
"an",
"HTTP",
"header",
"to",
"the",
"request",
".",
"Using",
"a",
"key",
"twice",
"will",
"result",
"in",
"the",
"last",
"value",
"being",
"used",
"for",
"a",
"given",
"header",
"."
] | train | https://github.com/couchbase/couchbase-java-client/blob/f36a0ee0c66923bdde47838ca543e50cbaa99e14/src/main/java/com/couchbase/client/java/cluster/api/RestBuilder.java#L90-L93 |
webmetrics/browsermob-proxy | src/main/java/org/browsermob/proxy/jetty/jetty/Server.java | Server.addWebApplications | public WebApplicationContext[] addWebApplications(String host,
String webapps)
throws IOException {
"""
Add Web Applications.
Add auto webapplications to the server. The name of the
webapp directory or war is used as the context name. If the
webapp ... | java | public WebApplicationContext[] addWebApplications(String host,
String webapps)
throws IOException
{
return addWebApplications(host,webapps,null,false);
} | [
"public",
"WebApplicationContext",
"[",
"]",
"addWebApplications",
"(",
"String",
"host",
",",
"String",
"webapps",
")",
"throws",
"IOException",
"{",
"return",
"addWebApplications",
"(",
"host",
",",
"webapps",
",",
"null",
",",
"false",
")",
";",
"}"
] | Add Web Applications.
Add auto webapplications to the server. The name of the
webapp directory or war is used as the context name. If the
webapp matches the rootWebApp it is added as the "/" context.
@param host Virtual host name or null
@param webapps Directory file name or URL to look for auto webapplication.
@excep... | [
"Add",
"Web",
"Applications",
".",
"Add",
"auto",
"webapplications",
"to",
"the",
"server",
".",
"The",
"name",
"of",
"the",
"webapp",
"directory",
"or",
"war",
"is",
"used",
"as",
"the",
"context",
"name",
".",
"If",
"the",
"webapp",
"matches",
"the",
"... | train | https://github.com/webmetrics/browsermob-proxy/blob/a9252e62246ac33d55d51b993ba1159404e7d389/src/main/java/org/browsermob/proxy/jetty/jetty/Server.java#L290-L295 |
mike10004/common-helper | native-helper/src/main/java/com/github/mike10004/nativehelper/subprocess/StreamConduit.java | StreamConduit.createProcessOutputPump | private void createProcessOutputPump(InputStream is, OutputStream os) {
"""
Create the pump to handle process output.
@param is the <code>InputStream</code>.
@param os the <code>OutputStream</code>.
"""
outputThread = createPump(is, os, CLOSE_STDOUT_AND_STDERR_INSTREAMS_WHEN_EXHAUSTED);
} | java | private void createProcessOutputPump(InputStream is, OutputStream os) {
outputThread = createPump(is, os, CLOSE_STDOUT_AND_STDERR_INSTREAMS_WHEN_EXHAUSTED);
} | [
"private",
"void",
"createProcessOutputPump",
"(",
"InputStream",
"is",
",",
"OutputStream",
"os",
")",
"{",
"outputThread",
"=",
"createPump",
"(",
"is",
",",
"os",
",",
"CLOSE_STDOUT_AND_STDERR_INSTREAMS_WHEN_EXHAUSTED",
")",
";",
"}"
] | Create the pump to handle process output.
@param is the <code>InputStream</code>.
@param os the <code>OutputStream</code>. | [
"Create",
"the",
"pump",
"to",
"handle",
"process",
"output",
"."
] | train | https://github.com/mike10004/common-helper/blob/744f82d9b0768a9ad9c63a57a37ab2c93bf408f4/native-helper/src/main/java/com/github/mike10004/nativehelper/subprocess/StreamConduit.java#L190-L192 |
dain/leveldb | leveldb/src/main/java/org/iq80/leveldb/util/Slice.java | Slice.getBytes | public void getBytes(int index, ByteBuffer destination) {
"""
Transfers this buffer's data to the specified destination starting at
the specified absolute {@code index} until the destination's position
reaches its limit.
@throws IndexOutOfBoundsException if the specified {@code index} is less than {@code 0} o... | java | public void getBytes(int index, ByteBuffer destination)
{
checkPositionIndex(index, this.length);
index += offset;
destination.put(data, index, Math.min(length, destination.remaining()));
} | [
"public",
"void",
"getBytes",
"(",
"int",
"index",
",",
"ByteBuffer",
"destination",
")",
"{",
"checkPositionIndex",
"(",
"index",
",",
"this",
".",
"length",
")",
";",
"index",
"+=",
"offset",
";",
"destination",
".",
"put",
"(",
"data",
",",
"index",
"... | Transfers this buffer's data to the specified destination starting at
the specified absolute {@code index} until the destination's position
reaches its limit.
@throws IndexOutOfBoundsException if the specified {@code index} is less than {@code 0} or
if {@code index + dst.remaining()} is greater than
{@code this.capaci... | [
"Transfers",
"this",
"buffer",
"s",
"data",
"to",
"the",
"specified",
"destination",
"starting",
"at",
"the",
"specified",
"absolute",
"{",
"@code",
"index",
"}",
"until",
"the",
"destination",
"s",
"position",
"reaches",
"its",
"limit",
"."
] | train | https://github.com/dain/leveldb/blob/7994065b48eada2ef29e7fefd172c2ad1e0110eb/leveldb/src/main/java/org/iq80/leveldb/util/Slice.java#L242-L247 |
ginere/ginere-base | src/main/java/eu/ginere/base/util/lang/MapOfLists.java | MapOfLists.put | public void put(K key,V value) {
"""
This add the element value at the end of the list pointed by key
"""
List<V> list;
if (map.containsKey(key)){
list=(List<V>)map.get(key);
} else {
list=new Vector<V>();
map.put(key,list);
}
list.add(value);
} | java | public void put(K key,V value){
List<V> list;
if (map.containsKey(key)){
list=(List<V>)map.get(key);
} else {
list=new Vector<V>();
map.put(key,list);
}
list.add(value);
} | [
"public",
"void",
"put",
"(",
"K",
"key",
",",
"V",
"value",
")",
"{",
"List",
"<",
"V",
">",
"list",
";",
"if",
"(",
"map",
".",
"containsKey",
"(",
"key",
")",
")",
"{",
"list",
"=",
"(",
"List",
"<",
"V",
">",
")",
"map",
".",
"get",
"("... | This add the element value at the end of the list pointed by key | [
"This",
"add",
"the",
"element",
"value",
"at",
"the",
"end",
"of",
"the",
"list",
"pointed",
"by",
"key"
] | train | https://github.com/ginere/ginere-base/blob/b1cc1c5834bd8a31df475c6f3fc0ee51273c5a24/src/main/java/eu/ginere/base/util/lang/MapOfLists.java#L35-L44 |
netscaler/nitro | src/main/java/com/citrix/netscaler/nitro/resource/config/cs/csvserver_binding.java | csvserver_binding.get | public static csvserver_binding get(nitro_service service, String name) throws Exception {
"""
Use this API to fetch csvserver_binding resource of given name .
"""
csvserver_binding obj = new csvserver_binding();
obj.set_name(name);
csvserver_binding response = (csvserver_binding) obj.get_resource(servic... | java | public static csvserver_binding get(nitro_service service, String name) throws Exception{
csvserver_binding obj = new csvserver_binding();
obj.set_name(name);
csvserver_binding response = (csvserver_binding) obj.get_resource(service);
return response;
} | [
"public",
"static",
"csvserver_binding",
"get",
"(",
"nitro_service",
"service",
",",
"String",
"name",
")",
"throws",
"Exception",
"{",
"csvserver_binding",
"obj",
"=",
"new",
"csvserver_binding",
"(",
")",
";",
"obj",
".",
"set_name",
"(",
"name",
")",
";",
... | Use this API to fetch csvserver_binding resource of given name . | [
"Use",
"this",
"API",
"to",
"fetch",
"csvserver_binding",
"resource",
"of",
"given",
"name",
"."
] | train | https://github.com/netscaler/nitro/blob/2a98692dcf4e4ec430c7d7baab8382e4ba5a35e4/src/main/java/com/citrix/netscaler/nitro/resource/config/cs/csvserver_binding.java#L268-L273 |
alkacon/opencms-core | src/org/opencms/gwt/CmsTemplateFinder.java | CmsTemplateFinder.getTemplateBean | private CmsClientTemplateBean getTemplateBean(CmsObject cms, CmsResource resource) throws CmsException {
"""
Returns a bean representing the given template resource.<p>
@param cms the cms context to use for VFS operations
@param resource the template resource
@return bean representing the given template res... | java | private CmsClientTemplateBean getTemplateBean(CmsObject cms, CmsResource resource) throws CmsException {
CmsProperty titleProp = cms.readPropertyObject(resource, CmsPropertyDefinition.PROPERTY_TITLE, false);
CmsProperty descProp = cms.readPropertyObject(resource, CmsPropertyDefinition.PROPERTY_DESCRIPT... | [
"private",
"CmsClientTemplateBean",
"getTemplateBean",
"(",
"CmsObject",
"cms",
",",
"CmsResource",
"resource",
")",
"throws",
"CmsException",
"{",
"CmsProperty",
"titleProp",
"=",
"cms",
".",
"readPropertyObject",
"(",
"resource",
",",
"CmsPropertyDefinition",
".",
"... | Returns a bean representing the given template resource.<p>
@param cms the cms context to use for VFS operations
@param resource the template resource
@return bean representing the given template resource
@throws CmsException if something goes wrong | [
"Returns",
"a",
"bean",
"representing",
"the",
"given",
"template",
"resource",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/gwt/CmsTemplateFinder.java#L126-L148 |
primefaces/primefaces | src/main/java/org/primefaces/util/WidgetBuilder.java | WidgetBuilder.selectorAttr | public WidgetBuilder selectorAttr(String name, String value) throws IOException {
"""
This should only be used internally if the selector is directly used by jQuery on the client.
If PFS is used and specified by the user, {@link #attr(java.lang.String, java.lang.String)} should be used
as the users have to escap... | java | public WidgetBuilder selectorAttr(String name, String value) throws IOException {
if (value != null) {
ResponseWriter rw = context.getResponseWriter();
rw.write(",");
rw.write(name);
rw.write(":\"");
rw.write(ComponentUtils.escapeSelector(value));
... | [
"public",
"WidgetBuilder",
"selectorAttr",
"(",
"String",
"name",
",",
"String",
"value",
")",
"throws",
"IOException",
"{",
"if",
"(",
"value",
"!=",
"null",
")",
"{",
"ResponseWriter",
"rw",
"=",
"context",
".",
"getResponseWriter",
"(",
")",
";",
"rw",
... | This should only be used internally if the selector is directly used by jQuery on the client.
If PFS is used and specified by the user, {@link #attr(java.lang.String, java.lang.String)} should be used
as the users have to escape colons like @(myForm\:myId).
@param name
@param value
@return
@throws IOException | [
"This",
"should",
"only",
"be",
"used",
"internally",
"if",
"the",
"selector",
"is",
"directly",
"used",
"by",
"jQuery",
"on",
"the",
"client",
".",
"If",
"PFS",
"is",
"used",
"and",
"specified",
"by",
"the",
"user",
"{",
"@link",
"#attr",
"(",
"java",
... | train | https://github.com/primefaces/primefaces/blob/b8cdd5ed395d09826e40e3302d6b14901d3ef4e7/src/main/java/org/primefaces/util/WidgetBuilder.java#L128-L139 |
google/error-prone-javac | src/jdk.javadoc/share/classes/com/sun/tools/doclets/internal/toolkit/builders/MethodBuilder.java | MethodBuilder.buildTagInfo | public void buildTagInfo(XMLNode node, Content methodDocTree) {
"""
Build the tag information.
@param node the XML element that specifies which components to document
@param methodDocTree the content tree to which the documentation will be added
"""
writer.addTags((MethodDoc) methods.get(currentMet... | java | public void buildTagInfo(XMLNode node, Content methodDocTree) {
writer.addTags((MethodDoc) methods.get(currentMethodIndex),
methodDocTree);
} | [
"public",
"void",
"buildTagInfo",
"(",
"XMLNode",
"node",
",",
"Content",
"methodDocTree",
")",
"{",
"writer",
".",
"addTags",
"(",
"(",
"MethodDoc",
")",
"methods",
".",
"get",
"(",
"currentMethodIndex",
")",
",",
"methodDocTree",
")",
";",
"}"
] | Build the tag information.
@param node the XML element that specifies which components to document
@param methodDocTree the content tree to which the documentation will be added | [
"Build",
"the",
"tag",
"information",
"."
] | train | https://github.com/google/error-prone-javac/blob/a53d069bbdb2c60232ed3811c19b65e41c3e60e0/src/jdk.javadoc/share/classes/com/sun/tools/doclets/internal/toolkit/builders/MethodBuilder.java#L229-L232 |
steveohara/j2mod | src/main/java/com/ghgande/j2mod/modbus/io/ModbusRTUTransport.java | ModbusRTUTransport.readResponseIn | protected ModbusResponse readResponseIn() throws ModbusIOException {
"""
readResponse - Read the bytes for the response from the slave.
@return a <tt>ModbusRespose</tt>
@throws com.ghgande.j2mod.modbus.ModbusIOException If the response cannot be read from the socket/port
"""
boolean done;
... | java | protected ModbusResponse readResponseIn() throws ModbusIOException {
boolean done;
ModbusResponse response;
int dlength;
try {
do {
// 1. read to function code, create request and read function
// specific bytes
synchronized (b... | [
"protected",
"ModbusResponse",
"readResponseIn",
"(",
")",
"throws",
"ModbusIOException",
"{",
"boolean",
"done",
";",
"ModbusResponse",
"response",
";",
"int",
"dlength",
";",
"try",
"{",
"do",
"{",
"// 1. read to function code, create request and read function",
"// spe... | readResponse - Read the bytes for the response from the slave.
@return a <tt>ModbusRespose</tt>
@throws com.ghgande.j2mod.modbus.ModbusIOException If the response cannot be read from the socket/port | [
"readResponse",
"-",
"Read",
"the",
"bytes",
"for",
"the",
"response",
"from",
"the",
"slave",
"."
] | train | https://github.com/steveohara/j2mod/blob/67162c55d7c02564e50211a9df06b8314953b5f2/src/main/java/com/ghgande/j2mod/modbus/io/ModbusRTUTransport.java#L406-L466 |
lucee/Lucee | core/src/main/java/lucee/commons/management/MemoryInfo.java | MemoryInfo.deepMemoryUsageOfAll | public static long deepMemoryUsageOfAll(Instrumentation inst, final Collection<? extends java.lang.Object> objs, final int referenceFilter) throws IOException {
"""
Returns an estimation, in bytes, of the memory usage of the given objects plus (recursively)
objects referenced via non-static references from any of... | java | public static long deepMemoryUsageOfAll(Instrumentation inst, final Collection<? extends java.lang.Object> objs, final int referenceFilter) throws IOException {
long total = 0L;
final Set<Integer> counted = new HashSet<Integer>(objs.size() * 4);
for (final Object o: objs) {
total += deepMemoryUsageOf0(inst, cou... | [
"public",
"static",
"long",
"deepMemoryUsageOfAll",
"(",
"Instrumentation",
"inst",
",",
"final",
"Collection",
"<",
"?",
"extends",
"java",
".",
"lang",
".",
"Object",
">",
"objs",
",",
"final",
"int",
"referenceFilter",
")",
"throws",
"IOException",
"{",
"lo... | Returns an estimation, in bytes, of the memory usage of the given objects plus (recursively)
objects referenced via non-static references from any of those objects. Which references are
traversed depends on the VisibilityFilter passed in. If two or more of the given objects
reference the same Object X, then the memory ... | [
"Returns",
"an",
"estimation",
"in",
"bytes",
"of",
"the",
"memory",
"usage",
"of",
"the",
"given",
"objects",
"plus",
"(",
"recursively",
")",
"objects",
"referenced",
"via",
"non",
"-",
"static",
"references",
"from",
"any",
"of",
"those",
"objects",
".",
... | train | https://github.com/lucee/Lucee/blob/29b153fc4e126e5edb97da937f2ee2e231b87593/core/src/main/java/lucee/commons/management/MemoryInfo.java#L129-L136 |
LGoodDatePicker/LGoodDatePicker | Project/src/main/java/com/github/lgooddatepicker/optionalusertools/PickerUtilities.java | PickerUtilities.localTimeToString | public static String localTimeToString(LocalTime time, String emptyTimeString) {
"""
localTimeToString, This will return the supplied time as a string. If the time is null, this
will return the value of emptyTimeString.
Time values will be output in one of the following ISO-8601 formats: "HH:mm", "HH:mm:ss",
... | java | public static String localTimeToString(LocalTime time, String emptyTimeString) {
return (time == null) ? emptyTimeString : time.toString();
} | [
"public",
"static",
"String",
"localTimeToString",
"(",
"LocalTime",
"time",
",",
"String",
"emptyTimeString",
")",
"{",
"return",
"(",
"time",
"==",
"null",
")",
"?",
"emptyTimeString",
":",
"time",
".",
"toString",
"(",
")",
";",
"}"
] | localTimeToString, This will return the supplied time as a string. If the time is null, this
will return the value of emptyTimeString.
Time values will be output in one of the following ISO-8601 formats: "HH:mm", "HH:mm:ss",
"HH:mm:ss.SSS", "HH:mm:ss.SSSSSS", "HH:mm:ss.SSSSSSSSS".
The format used will be the shortest... | [
"localTimeToString",
"This",
"will",
"return",
"the",
"supplied",
"time",
"as",
"a",
"string",
".",
"If",
"the",
"time",
"is",
"null",
"this",
"will",
"return",
"the",
"value",
"of",
"emptyTimeString",
"."
] | train | https://github.com/LGoodDatePicker/LGoodDatePicker/blob/c7df05a5fe382e1e08a6237e9391d8dc5fd48692/Project/src/main/java/com/github/lgooddatepicker/optionalusertools/PickerUtilities.java#L220-L222 |
eclipse/xtext-extras | org.eclipse.xtext.xbase/src/org/eclipse/xtext/xbase/jvmmodel/JvmTypesBuilder.java | JvmTypesBuilder.translateAnnotationsTo | @Deprecated
public void translateAnnotationsTo(/* @Nullable */ Iterable<? extends XAnnotation> annotations, /* @Nullable */ JvmAnnotationTarget target) {
"""
Translates {@link XAnnotation XAnnotations} to {@link JvmAnnotationReference JvmAnnotationReferences}
and adds them to the given {@link JvmAnnotationTarget... | java | @Deprecated
public void translateAnnotationsTo(/* @Nullable */ Iterable<? extends XAnnotation> annotations, /* @Nullable */ JvmAnnotationTarget target) {
addAnnotations(target, annotations);
} | [
"@",
"Deprecated",
"public",
"void",
"translateAnnotationsTo",
"(",
"/* @Nullable */",
"Iterable",
"<",
"?",
"extends",
"XAnnotation",
">",
"annotations",
",",
"/* @Nullable */",
"JvmAnnotationTarget",
"target",
")",
"{",
"addAnnotations",
"(",
"target",
",",
"annotat... | Translates {@link XAnnotation XAnnotations} to {@link JvmAnnotationReference JvmAnnotationReferences}
and adds them to the given {@link JvmAnnotationTarget}.
@param target the annotation target. If <code>null</code> this method does nothing.
@param annotations the annotations. If <code>null</code> this method does not... | [
"Translates",
"{",
"@link",
"XAnnotation",
"XAnnotations",
"}",
"to",
"{",
"@link",
"JvmAnnotationReference",
"JvmAnnotationReferences",
"}",
"and",
"adds",
"them",
"to",
"the",
"given",
"{",
"@link",
"JvmAnnotationTarget",
"}",
"."
] | train | https://github.com/eclipse/xtext-extras/blob/451359541295323a29f5855e633f770cec02069a/org.eclipse.xtext.xbase/src/org/eclipse/xtext/xbase/jvmmodel/JvmTypesBuilder.java#L1387-L1390 |
xwiki/xwiki-commons | xwiki-commons-core/xwiki-commons-component/xwiki-commons-component-default/src/main/java/org/xwiki/component/annotation/ComponentAnnotationLoader.java | ComponentAnnotationLoader.getDeclaredComponents | public List<ComponentDeclaration> getDeclaredComponents(InputStream componentListStream) throws IOException {
"""
Get all components listed in the passed resource stream. The format is:
{@code (priority level):(fully qualified component implementation name)}.
@param componentListStream the stream to parse
@re... | java | public List<ComponentDeclaration> getDeclaredComponents(InputStream componentListStream) throws IOException
{
List<ComponentDeclaration> annotatedClassNames = new ArrayList<>();
// Read all components definition from the URL
// Always force UTF-8 as the encoding, since these files are read ... | [
"public",
"List",
"<",
"ComponentDeclaration",
">",
"getDeclaredComponents",
"(",
"InputStream",
"componentListStream",
")",
"throws",
"IOException",
"{",
"List",
"<",
"ComponentDeclaration",
">",
"annotatedClassNames",
"=",
"new",
"ArrayList",
"<>",
"(",
")",
";",
... | Get all components listed in the passed resource stream. The format is:
{@code (priority level):(fully qualified component implementation name)}.
@param componentListStream the stream to parse
@return the list of component declaration (implementation class names and priorities)
@throws IOException in case of an error ... | [
"Get",
"all",
"components",
"listed",
"in",
"the",
"passed",
"resource",
"stream",
".",
"The",
"format",
"is",
":",
"{",
"@code",
"(",
"priority",
"level",
")",
":",
"(",
"fully",
"qualified",
"component",
"implementation",
"name",
")",
"}",
"."
] | train | https://github.com/xwiki/xwiki-commons/blob/5374d8c6d966588c1eac7392c83da610dfb9f129/xwiki-commons-core/xwiki-commons-component/xwiki-commons-component-default/src/main/java/org/xwiki/component/annotation/ComponentAnnotationLoader.java#L497-L527 |
code4everything/util | src/main/java/com/zhazhapan/util/ReflectUtils.java | ReflectUtils.invokeMethodUseBasicType | public static Object invokeMethodUseBasicType(Object object, String methodName, Object[] parameters) throws NoSuchMethodException, InvocationTargetException, IllegalAccessException {
"""
调用方法
@param object 对象
@param methodName 方法名
@param parameters 参数
@return 方法返回的结果
@throws NoSuchMethodException 异常
@t... | java | public static Object invokeMethodUseBasicType(Object object, String methodName, Object[] parameters) throws NoSuchMethodException, InvocationTargetException, IllegalAccessException {
return invokeMethod(object, methodName, getBasicTypes(parameters), parameters);
} | [
"public",
"static",
"Object",
"invokeMethodUseBasicType",
"(",
"Object",
"object",
",",
"String",
"methodName",
",",
"Object",
"[",
"]",
"parameters",
")",
"throws",
"NoSuchMethodException",
",",
"InvocationTargetException",
",",
"IllegalAccessException",
"{",
"return",... | 调用方法
@param object 对象
@param methodName 方法名
@param parameters 参数
@return 方法返回的结果
@throws NoSuchMethodException 异常
@throws InvocationTargetException 异常
@throws IllegalAccessException 异常 | [
"调用方法"
] | train | https://github.com/code4everything/util/blob/1fc9f0ead1108f4d7208ba7c000df4244f708418/src/main/java/com/zhazhapan/util/ReflectUtils.java#L118-L120 |
aboutsip/sipstack | sipstack-example/src/main/java/io/sipstack/example/netty/sip/proxy/ProxyHandler.java | ProxyHandler.proxyTo | private void proxyTo(final SipURI destination, final SipRequest msg) {
"""
Whenever we proxy a request we must also add a Via-header, which essentially says that the
request went "via this network address using this protocol". The {@link ViaHeader}s are used
for responses to find their way back the exact same pa... | java | private void proxyTo(final SipURI destination, final SipRequest msg) {
final Connection connection = this.stack.connect(destination.getHost(), destination.getPort());
final ViaHeader via =
ViaHeader.with().host("127.0.0.1").port(5060).transportUDP().branch(ViaHeader.generateBranch()).bui... | [
"private",
"void",
"proxyTo",
"(",
"final",
"SipURI",
"destination",
",",
"final",
"SipRequest",
"msg",
")",
"{",
"final",
"Connection",
"connection",
"=",
"this",
".",
"stack",
".",
"connect",
"(",
"destination",
".",
"getHost",
"(",
")",
",",
"destination"... | Whenever we proxy a request we must also add a Via-header, which essentially says that the
request went "via this network address using this protocol". The {@link ViaHeader}s are used
for responses to find their way back the exact same path as the request took.
@param destination
@param msg | [
"Whenever",
"we",
"proxy",
"a",
"request",
"we",
"must",
"also",
"add",
"a",
"Via",
"-",
"header",
"which",
"essentially",
"says",
"that",
"the",
"request",
"went",
"via",
"this",
"network",
"address",
"using",
"this",
"protocol",
".",
"The",
"{",
"@link",... | train | https://github.com/aboutsip/sipstack/blob/33f2db1d580738f0385687b0429fab0630118f42/sipstack-example/src/main/java/io/sipstack/example/netty/sip/proxy/ProxyHandler.java#L82-L88 |
elki-project/elki | elki-core-math/src/main/java/de/lmu/ifi/dbs/elki/math/MathUtil.java | MathUtil.ipowi | public static int ipowi(int x, int p) {
"""
Fast loop for computing {@code pow(x, p)}
for {@code p >= 0} integer and x integer.
@param x Base
@param p Exponent
@return {@code pow(x, p)}
"""
if(p <= 2) {
return (int) FastMath.powFast(x, p);
}
int tmp = x, ret = (p & 1) == 1 ? x : 1;
... | java | public static int ipowi(int x, int p) {
if(p <= 2) {
return (int) FastMath.powFast(x, p);
}
int tmp = x, ret = (p & 1) == 1 ? x : 1;
while(true) {
tmp *= tmp;
p >>= 1;
if(p == 1) {
return ret * tmp;
}
if((p & 1) != 0) {
ret *= tmp;
}
}
} | [
"public",
"static",
"int",
"ipowi",
"(",
"int",
"x",
",",
"int",
"p",
")",
"{",
"if",
"(",
"p",
"<=",
"2",
")",
"{",
"return",
"(",
"int",
")",
"FastMath",
".",
"powFast",
"(",
"x",
",",
"p",
")",
";",
"}",
"int",
"tmp",
"=",
"x",
",",
"ret... | Fast loop for computing {@code pow(x, p)}
for {@code p >= 0} integer and x integer.
@param x Base
@param p Exponent
@return {@code pow(x, p)} | [
"Fast",
"loop",
"for",
"computing",
"{",
"@code",
"pow",
"(",
"x",
"p",
")",
"}",
"for",
"{",
"@code",
"p",
">",
"=",
"0",
"}",
"integer",
"and",
"x",
"integer",
"."
] | train | https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-core-math/src/main/java/de/lmu/ifi/dbs/elki/math/MathUtil.java#L567-L582 |
gallandarakhneorg/afc | core/inputoutput/src/main/java/org/arakhne/afc/inputoutput/xml/XMLUtil.java | XMLUtil.readXMLFragment | public static DocumentFragment readXMLFragment(String file, boolean skipRoot)
throws IOException, SAXException, ParserConfigurationException {
"""
Read an XML fragment from an XML file.
The XML file is well-formed. It means that the fragment will contains a single element: the root element
within the input fi... | java | public static DocumentFragment readXMLFragment(String file, boolean skipRoot)
throws IOException, SAXException, ParserConfigurationException {
assert file != null : AssertMessages.notNullParameter();
try (FileInputStream fis = new FileInputStream(file)) {
return readXMLFragment(fis, skipRoot);
}
} | [
"public",
"static",
"DocumentFragment",
"readXMLFragment",
"(",
"String",
"file",
",",
"boolean",
"skipRoot",
")",
"throws",
"IOException",
",",
"SAXException",
",",
"ParserConfigurationException",
"{",
"assert",
"file",
"!=",
"null",
":",
"AssertMessages",
".",
"no... | Read an XML fragment from an XML file.
The XML file is well-formed. It means that the fragment will contains a single element: the root element
within the input file.
@param file is the file to read
@param skipRoot if {@code true} the root element itself is not part of the fragment, and the children
of the root elemen... | [
"Read",
"an",
"XML",
"fragment",
"from",
"an",
"XML",
"file",
".",
"The",
"XML",
"file",
"is",
"well",
"-",
"formed",
".",
"It",
"means",
"that",
"the",
"fragment",
"will",
"contains",
"a",
"single",
"element",
":",
"the",
"root",
"element",
"within",
... | train | https://github.com/gallandarakhneorg/afc/blob/0c7d2e1ddefd4167ef788416d970a6c1ef6f8bbb/core/inputoutput/src/main/java/org/arakhne/afc/inputoutput/xml/XMLUtil.java#L2118-L2124 |
netty/netty | codec-http/src/main/java/io/netty/handler/codec/http/HttpHeaders.java | HttpHeaders.setHost | @Deprecated
public static void setHost(HttpMessage message, String value) {
"""
@deprecated Use {@link #set(CharSequence, Object)} instead.
@see #setHost(HttpMessage, CharSequence)
"""
message.headers().set(HttpHeaderNames.HOST, value);
} | java | @Deprecated
public static void setHost(HttpMessage message, String value) {
message.headers().set(HttpHeaderNames.HOST, value);
} | [
"@",
"Deprecated",
"public",
"static",
"void",
"setHost",
"(",
"HttpMessage",
"message",
",",
"String",
"value",
")",
"{",
"message",
".",
"headers",
"(",
")",
".",
"set",
"(",
"HttpHeaderNames",
".",
"HOST",
",",
"value",
")",
";",
"}"
] | @deprecated Use {@link #set(CharSequence, Object)} instead.
@see #setHost(HttpMessage, CharSequence) | [
"@deprecated",
"Use",
"{",
"@link",
"#set",
"(",
"CharSequence",
"Object",
")",
"}",
"instead",
"."
] | train | https://github.com/netty/netty/blob/ba06eafa1c1824bd154f1a380019e7ea2edf3c4c/codec-http/src/main/java/io/netty/handler/codec/http/HttpHeaders.java#L1024-L1027 |
contentful/contentful-management.java | src/main/java/com/contentful/java/cma/model/CMAEntry.java | CMAEntry.setField | public CMAEntry setField(String key, String locale, Object value) {
"""
Creates a new field with the given {@code value}.
If a field named {@code key} already exists it will be replaced.
@param key field key
@param locale locale
@param value value
@return this {@code CMAEntry}
"""
if (fields == ... | java | public CMAEntry setField(String key, String locale, Object value) {
if (fields == null) {
fields = new LinkedHashMap<String, LinkedHashMap<String, Object>>();
}
LinkedHashMap<String, Object> field = fields.get(key);
if (field == null) {
field = new LinkedHashMap<String, Object>();
}
... | [
"public",
"CMAEntry",
"setField",
"(",
"String",
"key",
",",
"String",
"locale",
",",
"Object",
"value",
")",
"{",
"if",
"(",
"fields",
"==",
"null",
")",
"{",
"fields",
"=",
"new",
"LinkedHashMap",
"<",
"String",
",",
"LinkedHashMap",
"<",
"String",
","... | Creates a new field with the given {@code value}.
If a field named {@code key} already exists it will be replaced.
@param key field key
@param locale locale
@param value value
@return this {@code CMAEntry} | [
"Creates",
"a",
"new",
"field",
"with",
"the",
"given",
"{",
"@code",
"value",
"}",
".",
"If",
"a",
"field",
"named",
"{",
"@code",
"key",
"}",
"already",
"exists",
"it",
"will",
"be",
"replaced",
"."
] | train | https://github.com/contentful/contentful-management.java/blob/ca310fb9ea9577fcff0ca57949ab7c2315fa2534/src/main/java/com/contentful/java/cma/model/CMAEntry.java#L99-L112 |
aws/aws-sdk-java | aws-java-sdk-codestar/src/main/java/com/amazonaws/services/codestar/model/ListTagsForProjectResult.java | ListTagsForProjectResult.withTags | public ListTagsForProjectResult withTags(java.util.Map<String, String> tags) {
"""
<p>
The tags for the project.
</p>
@param tags
The tags for the project.
@return Returns a reference to this object so that method calls can be chained together.
"""
setTags(tags);
return this;
} | java | public ListTagsForProjectResult withTags(java.util.Map<String, String> tags) {
setTags(tags);
return this;
} | [
"public",
"ListTagsForProjectResult",
"withTags",
"(",
"java",
".",
"util",
".",
"Map",
"<",
"String",
",",
"String",
">",
"tags",
")",
"{",
"setTags",
"(",
"tags",
")",
";",
"return",
"this",
";",
"}"
] | <p>
The tags for the project.
</p>
@param tags
The tags for the project.
@return Returns a reference to this object so that method calls can be chained together. | [
"<p",
">",
"The",
"tags",
"for",
"the",
"project",
".",
"<",
"/",
"p",
">"
] | train | https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-codestar/src/main/java/com/amazonaws/services/codestar/model/ListTagsForProjectResult.java#L74-L77 |
GoogleCloudPlatform/appengine-pipelines | java/src/main/java/com/google/appengine/tools/pipeline/impl/PipelineManager.java | PipelineManager.registerNewJobRecord | public static JobRecord registerNewJobRecord(UpdateSpec updateSpec, JobSetting[] settings,
JobRecord generatorJob, String graphGUID, Job<?> jobInstance, Object[] params) {
"""
Creates a new JobRecord with its associated Barriers and Slots. Also
creates new {@link HandleSlotFilledTask} for any inputs to the ... | java | public static JobRecord registerNewJobRecord(UpdateSpec updateSpec, JobSetting[] settings,
JobRecord generatorJob, String graphGUID, Job<?> jobInstance, Object[] params) {
JobRecord jobRecord;
if (generatorJob == null) {
// Root Job
if (graphGUID != null) {
throw new IllegalArgumentExc... | [
"public",
"static",
"JobRecord",
"registerNewJobRecord",
"(",
"UpdateSpec",
"updateSpec",
",",
"JobSetting",
"[",
"]",
"settings",
",",
"JobRecord",
"generatorJob",
",",
"String",
"graphGUID",
",",
"Job",
"<",
"?",
">",
"jobInstance",
",",
"Object",
"[",
"]",
... | Creates a new JobRecord with its associated Barriers and Slots. Also
creates new {@link HandleSlotFilledTask} for any inputs to the Job that are
immediately specified. Registers all newly created objects with the
provided {@code UpdateSpec} for later saving.
<p>
This method is called when starting a new Pipeline, in wh... | [
"Creates",
"a",
"new",
"JobRecord",
"with",
"its",
"associated",
"Barriers",
"and",
"Slots",
".",
"Also",
"creates",
"new",
"{",
"@link",
"HandleSlotFilledTask",
"}",
"for",
"any",
"inputs",
"to",
"the",
"Job",
"that",
"are",
"immediately",
"specified",
".",
... | train | https://github.com/GoogleCloudPlatform/appengine-pipelines/blob/277394648dac3e8214677af898935d07399ac8e1/java/src/main/java/com/google/appengine/tools/pipeline/impl/PipelineManager.java#L147-L160 |
lettuce-io/lettuce-core | src/main/java/io/lettuce/core/ExceptionFactory.java | ExceptionFactory.createTimeoutException | public static RedisCommandTimeoutException createTimeoutException(String message, Duration timeout) {
"""
Create a {@link RedisCommandTimeoutException} with a detail message given the message and timeout.
@param message the detail message.
@param timeout the timeout value.
@return the {@link RedisCommandTimeo... | java | public static RedisCommandTimeoutException createTimeoutException(String message, Duration timeout) {
return new RedisCommandTimeoutException(
String.format("%s. Command timed out after %s", message, formatTimeout(timeout)));
} | [
"public",
"static",
"RedisCommandTimeoutException",
"createTimeoutException",
"(",
"String",
"message",
",",
"Duration",
"timeout",
")",
"{",
"return",
"new",
"RedisCommandTimeoutException",
"(",
"String",
".",
"format",
"(",
"\"%s. Command timed out after %s\"",
",",
"me... | Create a {@link RedisCommandTimeoutException} with a detail message given the message and timeout.
@param message the detail message.
@param timeout the timeout value.
@return the {@link RedisCommandTimeoutException}. | [
"Create",
"a",
"{",
"@link",
"RedisCommandTimeoutException",
"}",
"with",
"a",
"detail",
"message",
"given",
"the",
"message",
"and",
"timeout",
"."
] | train | https://github.com/lettuce-io/lettuce-core/blob/b6de74e384dea112e3656684ca3f50cdfd6c8e0d/src/main/java/io/lettuce/core/ExceptionFactory.java#L61-L64 |
javagl/ND | nd-tuples/src/main/java/de/javagl/nd/tuples/d/DoubleTuples.java | DoubleTuples.normalizeElements | public static MutableDoubleTuple normalizeElements(
DoubleTuple t, double min, double max, MutableDoubleTuple result) {
"""
Normalize the elements of the given tuple, so that its minimum and
maximum elements match the given minimum and maximum values.
@param t The input tuple
@param min The minimum v... | java | public static MutableDoubleTuple normalizeElements(
DoubleTuple t, double min, double max, MutableDoubleTuple result)
{
return rescaleElements(t, min(t), max(t), min, max, result);
} | [
"public",
"static",
"MutableDoubleTuple",
"normalizeElements",
"(",
"DoubleTuple",
"t",
",",
"double",
"min",
",",
"double",
"max",
",",
"MutableDoubleTuple",
"result",
")",
"{",
"return",
"rescaleElements",
"(",
"t",
",",
"min",
"(",
"t",
")",
",",
"max",
"... | Normalize the elements of the given tuple, so that its minimum and
maximum elements match the given minimum and maximum values.
@param t The input tuple
@param min The minimum value
@param max The maximum value
@param result The tuple that will store the result
@return The result tuple
@throws IllegalArgumentException... | [
"Normalize",
"the",
"elements",
"of",
"the",
"given",
"tuple",
"so",
"that",
"its",
"minimum",
"and",
"maximum",
"elements",
"match",
"the",
"given",
"minimum",
"and",
"maximum",
"values",
"."
] | train | https://github.com/javagl/ND/blob/bcb655aaf5fc88af6194f73a27cca079186ff559/nd-tuples/src/main/java/de/javagl/nd/tuples/d/DoubleTuples.java#L1595-L1599 |
hazelcast/hazelcast | hazelcast/src/main/java/com/hazelcast/internal/util/concurrent/ConcurrentConveyor.java | ConcurrentConveyor.drainTo | public final int drainTo(int queueIndex, Collection<? super E> drain) {
"""
Drains a batch of items from the queue at the supplied index into the
supplied collection.
@return the number of items drained
"""
return drain(queues[queueIndex], drain, Integer.MAX_VALUE);
} | java | public final int drainTo(int queueIndex, Collection<? super E> drain) {
return drain(queues[queueIndex], drain, Integer.MAX_VALUE);
} | [
"public",
"final",
"int",
"drainTo",
"(",
"int",
"queueIndex",
",",
"Collection",
"<",
"?",
"super",
"E",
">",
"drain",
")",
"{",
"return",
"drain",
"(",
"queues",
"[",
"queueIndex",
"]",
",",
"drain",
",",
"Integer",
".",
"MAX_VALUE",
")",
";",
"}"
] | Drains a batch of items from the queue at the supplied index into the
supplied collection.
@return the number of items drained | [
"Drains",
"a",
"batch",
"of",
"items",
"from",
"the",
"queue",
"at",
"the",
"supplied",
"index",
"into",
"the",
"supplied",
"collection",
"."
] | train | https://github.com/hazelcast/hazelcast/blob/8c4bc10515dbbfb41a33e0302c0caedf3cda1baf/hazelcast/src/main/java/com/hazelcast/internal/util/concurrent/ConcurrentConveyor.java#L287-L289 |
square/okhttp | mockwebserver/src/main/java/okhttp3/mockwebserver/MockResponse.java | MockResponse.setChunkedBody | public MockResponse setChunkedBody(String body, int maxChunkSize) {
"""
Sets the response body to the UTF-8 encoded bytes of {@code body}, chunked every {@code
maxChunkSize} bytes.
"""
return setChunkedBody(new Buffer().writeUtf8(body), maxChunkSize);
} | java | public MockResponse setChunkedBody(String body, int maxChunkSize) {
return setChunkedBody(new Buffer().writeUtf8(body), maxChunkSize);
} | [
"public",
"MockResponse",
"setChunkedBody",
"(",
"String",
"body",
",",
"int",
"maxChunkSize",
")",
"{",
"return",
"setChunkedBody",
"(",
"new",
"Buffer",
"(",
")",
".",
"writeUtf8",
"(",
"body",
")",
",",
"maxChunkSize",
")",
";",
"}"
] | Sets the response body to the UTF-8 encoded bytes of {@code body}, chunked every {@code
maxChunkSize} bytes. | [
"Sets",
"the",
"response",
"body",
"to",
"the",
"UTF",
"-",
"8",
"encoded",
"bytes",
"of",
"{"
] | train | https://github.com/square/okhttp/blob/a8c65a822dd6cadd2de7d115bf94adf312e67868/mockwebserver/src/main/java/okhttp3/mockwebserver/MockResponse.java#L225-L227 |
netty/netty | codec-http2/src/main/java/io/netty/handler/codec/http2/Http2CodecUtil.java | Http2CodecUtil.toByteBuf | public static ByteBuf toByteBuf(ChannelHandlerContext ctx, Throwable cause) {
"""
Creates a buffer containing the error message from the given exception. If the cause is
{@code null} returns an empty buffer.
"""
if (cause == null || cause.getMessage() == null) {
return Unpooled.EMPTY_BUFFE... | java | public static ByteBuf toByteBuf(ChannelHandlerContext ctx, Throwable cause) {
if (cause == null || cause.getMessage() == null) {
return Unpooled.EMPTY_BUFFER;
}
return ByteBufUtil.writeUtf8(ctx.alloc(), cause.getMessage());
} | [
"public",
"static",
"ByteBuf",
"toByteBuf",
"(",
"ChannelHandlerContext",
"ctx",
",",
"Throwable",
"cause",
")",
"{",
"if",
"(",
"cause",
"==",
"null",
"||",
"cause",
".",
"getMessage",
"(",
")",
"==",
"null",
")",
"{",
"return",
"Unpooled",
".",
"EMPTY_BU... | Creates a buffer containing the error message from the given exception. If the cause is
{@code null} returns an empty buffer. | [
"Creates",
"a",
"buffer",
"containing",
"the",
"error",
"message",
"from",
"the",
"given",
"exception",
".",
"If",
"the",
"cause",
"is",
"{"
] | train | https://github.com/netty/netty/blob/ba06eafa1c1824bd154f1a380019e7ea2edf3c4c/codec-http2/src/main/java/io/netty/handler/codec/http2/Http2CodecUtil.java#L187-L193 |
Azure/azure-sdk-for-java | containerregistry/resource-manager/v2018_09_01/src/main/java/com/microsoft/azure/management/containerregistry/v2018_09_01/implementation/WebhooksInner.java | WebhooksInner.listAsync | public Observable<Page<WebhookInner>> listAsync(final String resourceGroupName, final String registryName) {
"""
Lists all the webhooks for the specified container registry.
@param resourceGroupName The name of the resource group to which the container registry belongs.
@param registryName The name of the cont... | java | public Observable<Page<WebhookInner>> listAsync(final String resourceGroupName, final String registryName) {
return listWithServiceResponseAsync(resourceGroupName, registryName)
.map(new Func1<ServiceResponse<Page<WebhookInner>>, Page<WebhookInner>>() {
@Override
publ... | [
"public",
"Observable",
"<",
"Page",
"<",
"WebhookInner",
">",
">",
"listAsync",
"(",
"final",
"String",
"resourceGroupName",
",",
"final",
"String",
"registryName",
")",
"{",
"return",
"listWithServiceResponseAsync",
"(",
"resourceGroupName",
",",
"registryName",
"... | Lists all the webhooks for the specified container registry.
@param resourceGroupName The name of the resource group to which the container registry belongs.
@param registryName The name of the container registry.
@throws IllegalArgumentException thrown if parameters fail the validation
@return the observable to the P... | [
"Lists",
"all",
"the",
"webhooks",
"for",
"the",
"specified",
"container",
"registry",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/containerregistry/resource-manager/v2018_09_01/src/main/java/com/microsoft/azure/management/containerregistry/v2018_09_01/implementation/WebhooksInner.java#L791-L799 |
apache/flink | flink-core/src/main/java/org/apache/flink/util/IOUtils.java | IOUtils.copyBytes | public static void copyBytes(final InputStream in, final OutputStream out, final boolean close) throws IOException {
"""
Copies from one stream to another.
@param in
InputStream to read from
@param out
OutputStream to write to
@param close
whether or not close the InputStream and OutputStream at the
end. ... | java | public static void copyBytes(final InputStream in, final OutputStream out, final boolean close) throws IOException {
copyBytes(in, out, BLOCKSIZE, close);
} | [
"public",
"static",
"void",
"copyBytes",
"(",
"final",
"InputStream",
"in",
",",
"final",
"OutputStream",
"out",
",",
"final",
"boolean",
"close",
")",
"throws",
"IOException",
"{",
"copyBytes",
"(",
"in",
",",
"out",
",",
"BLOCKSIZE",
",",
"close",
")",
"... | Copies from one stream to another.
@param in
InputStream to read from
@param out
OutputStream to write to
@param close
whether or not close the InputStream and OutputStream at the
end. The streams are closed in the finally clause.
@throws IOException
thrown if an I/O error occurs while copying | [
"Copies",
"from",
"one",
"stream",
"to",
"another",
"."
] | train | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-core/src/main/java/org/apache/flink/util/IOUtils.java#L107-L109 |
telly/groundy | library/src/main/java/com/telly/groundy/TaskResult.java | TaskResult.add | public TaskResult add(String key, String[] value) {
"""
Inserts a String array value into the mapping of this Bundle, replacing any existing value for
the given key. Either key or value may be null.
@param key a String, or null
@param value a String array object, or null
"""
mBundle.putStringArray(ke... | java | public TaskResult add(String key, String[] value) {
mBundle.putStringArray(key, value);
return this;
} | [
"public",
"TaskResult",
"add",
"(",
"String",
"key",
",",
"String",
"[",
"]",
"value",
")",
"{",
"mBundle",
".",
"putStringArray",
"(",
"key",
",",
"value",
")",
";",
"return",
"this",
";",
"}"
] | Inserts a String array value into the mapping of this Bundle, replacing any existing value for
the given key. Either key or value may be null.
@param key a String, or null
@param value a String array object, or null | [
"Inserts",
"a",
"String",
"array",
"value",
"into",
"the",
"mapping",
"of",
"this",
"Bundle",
"replacing",
"any",
"existing",
"value",
"for",
"the",
"given",
"key",
".",
"Either",
"key",
"or",
"value",
"may",
"be",
"null",
"."
] | train | https://github.com/telly/groundy/blob/e90baf9901a8be20b348bd1575d5ad782560cec8/library/src/main/java/com/telly/groundy/TaskResult.java#L372-L375 |
carewebframework/carewebframework-core | org.carewebframework.help-parent/org.carewebframework.help.core/src/main/java/org/carewebframework/help/viewer/HelpUtil.java | HelpUtil.setViewerMode | public static void setViewerMode(Page page, HelpViewerMode mode) {
"""
Sets the help viewer mode for the specified page. If different from the previous mode and a
viewer for this page exists, the viewer will be removed and recreated on the next request.
@param page The target page.
@param mode The help viewer... | java | public static void setViewerMode(Page page, HelpViewerMode mode) {
if (getViewerMode(page) != mode) {
removeViewer(page, true);
}
page.setAttribute(EMBEDDED_ATTRIB, mode);
} | [
"public",
"static",
"void",
"setViewerMode",
"(",
"Page",
"page",
",",
"HelpViewerMode",
"mode",
")",
"{",
"if",
"(",
"getViewerMode",
"(",
"page",
")",
"!=",
"mode",
")",
"{",
"removeViewer",
"(",
"page",
",",
"true",
")",
";",
"}",
"page",
".",
"setA... | Sets the help viewer mode for the specified page. If different from the previous mode and a
viewer for this page exists, the viewer will be removed and recreated on the next request.
@param page The target page.
@param mode The help viewer mode. | [
"Sets",
"the",
"help",
"viewer",
"mode",
"for",
"the",
"specified",
"page",
".",
"If",
"different",
"from",
"the",
"previous",
"mode",
"and",
"a",
"viewer",
"for",
"this",
"page",
"exists",
"the",
"viewer",
"will",
"be",
"removed",
"and",
"recreated",
"on"... | train | https://github.com/carewebframework/carewebframework-core/blob/fa3252d4f7541dbe151b92c3d4f6f91433cd1673/org.carewebframework.help-parent/org.carewebframework.help.core/src/main/java/org/carewebframework/help/viewer/HelpUtil.java#L106-L112 |
mapbox/mapbox-java | services-turf/src/main/java/com/mapbox/turf/TurfConversion.java | TurfConversion.convertLength | public static double convertLength(@FloatRange(from = 0) double distance,
@NonNull @TurfUnitCriteria String originalUnit,
@Nullable @TurfUnitCriteria String finalUnit) {
"""
Converts a distance to a different unit specified.
@param distan... | java | public static double convertLength(@FloatRange(from = 0) double distance,
@NonNull @TurfUnitCriteria String originalUnit,
@Nullable @TurfUnitCriteria String finalUnit) {
if (finalUnit == null) {
finalUnit = TurfConstants.UNIT_DEFAULT;
... | [
"public",
"static",
"double",
"convertLength",
"(",
"@",
"FloatRange",
"(",
"from",
"=",
"0",
")",
"double",
"distance",
",",
"@",
"NonNull",
"@",
"TurfUnitCriteria",
"String",
"originalUnit",
",",
"@",
"Nullable",
"@",
"TurfUnitCriteria",
"String",
"finalUnit",... | Converts a distance to a different unit specified.
@param distance the distance to be converted
@param originalUnit of the distance, must be one of the units defined in
{@link TurfUnitCriteria}
@param finalUnit returned unit, {@link TurfConstants#UNIT_DEFAULT} if not specified
@return the converted distance
@si... | [
"Converts",
"a",
"distance",
"to",
"a",
"different",
"unit",
"specified",
"."
] | train | https://github.com/mapbox/mapbox-java/blob/c0be138f462f91441388584c668f3760ba0e18e2/services-turf/src/main/java/com/mapbox/turf/TurfConversion.java#L158-L165 |
EasyinnovaSL/Tiff-Library-4J | src/main/java/com/easyinnova/tiff/model/ValidationResult.java | ValidationResult.iaddWarning | private void iaddWarning(String desc, String value, String loc) {
"""
Adds a warning.
@param desc warning description
@param value the value that caused the warning
@param loc the location
"""
if (!validate) return;
ValidationEvent ve = new ValidationEvent(desc, value, loc);
warnings.add(ve);
... | java | private void iaddWarning(String desc, String value, String loc) {
if (!validate) return;
ValidationEvent ve = new ValidationEvent(desc, value, loc);
warnings.add(ve);
} | [
"private",
"void",
"iaddWarning",
"(",
"String",
"desc",
",",
"String",
"value",
",",
"String",
"loc",
")",
"{",
"if",
"(",
"!",
"validate",
")",
"return",
";",
"ValidationEvent",
"ve",
"=",
"new",
"ValidationEvent",
"(",
"desc",
",",
"value",
",",
"loc"... | Adds a warning.
@param desc warning description
@param value the value that caused the warning
@param loc the location | [
"Adds",
"a",
"warning",
"."
] | train | https://github.com/EasyinnovaSL/Tiff-Library-4J/blob/682605d3ed207a66213278c054c98f1b909472b7/src/main/java/com/easyinnova/tiff/model/ValidationResult.java#L92-L96 |
j256/ormlite-core | src/main/java/com/j256/ormlite/dao/DaoManager.java | DaoManager.createDaoFromConfig | private static <D, T> D createDaoFromConfig(ConnectionSource connectionSource, Class<T> clazz) throws SQLException {
"""
Creates the DAO if we have config information cached and caches the DAO.
"""
// no loaded configs
if (configMap == null) {
return null;
}
@SuppressWarnings("unchecked")
Databas... | java | private static <D, T> D createDaoFromConfig(ConnectionSource connectionSource, Class<T> clazz) throws SQLException {
// no loaded configs
if (configMap == null) {
return null;
}
@SuppressWarnings("unchecked")
DatabaseTableConfig<T> config = (DatabaseTableConfig<T>) configMap.get(clazz);
// if we don't c... | [
"private",
"static",
"<",
"D",
",",
"T",
">",
"D",
"createDaoFromConfig",
"(",
"ConnectionSource",
"connectionSource",
",",
"Class",
"<",
"T",
">",
"clazz",
")",
"throws",
"SQLException",
"{",
"// no loaded configs",
"if",
"(",
"configMap",
"==",
"null",
")",
... | Creates the DAO if we have config information cached and caches the DAO. | [
"Creates",
"the",
"DAO",
"if",
"we",
"have",
"config",
"information",
"cached",
"and",
"caches",
"the",
"DAO",
"."
] | train | https://github.com/j256/ormlite-core/blob/154d85bbb9614a0ea65a012251257831fb4fba21/src/main/java/com/j256/ormlite/dao/DaoManager.java#L334-L352 |
hibernate/hibernate-ogm | infinispan-remote/src/main/java/org/hibernate/ogm/datastore/infinispanremote/configuration/impl/InfinispanRemoteConfiguration.java | InfinispanRemoteConfiguration.setAdditionalProperties | private void setAdditionalProperties(Map<?, ?> configurationMap, ConfigurationPropertyReader propertyReader, Properties hotRodConfiguration) {
"""
Set the properties defined using the prefix {@link InfinispanRemoteProperties#HOT_ROD_CLIENT_PREFIX}
@param configurationMap contains all the properties defined for ... | java | private void setAdditionalProperties(Map<?, ?> configurationMap, ConfigurationPropertyReader propertyReader, Properties hotRodConfiguration) {
// Programmatic properties override the resource file
for ( Entry<?, ?> property : configurationMap.entrySet() ) {
String key = (String) property.getKey();
if ( key.st... | [
"private",
"void",
"setAdditionalProperties",
"(",
"Map",
"<",
"?",
",",
"?",
">",
"configurationMap",
",",
"ConfigurationPropertyReader",
"propertyReader",
",",
"Properties",
"hotRodConfiguration",
")",
"{",
"// Programmatic properties override the resource file",
"for",
"... | Set the properties defined using the prefix {@link InfinispanRemoteProperties#HOT_ROD_CLIENT_PREFIX}
@param configurationMap contains all the properties defined for OGM
@param propertyReader read the value of a property
@param hotRodConfiguration the Hot Rod configuration to update | [
"Set",
"the",
"properties",
"defined",
"using",
"the",
"prefix",
"{",
"@link",
"InfinispanRemoteProperties#HOT_ROD_CLIENT_PREFIX",
"}"
] | train | https://github.com/hibernate/hibernate-ogm/blob/9ea971df7c27277029006a6f748d8272fb1d69d2/infinispan-remote/src/main/java/org/hibernate/ogm/datastore/infinispanremote/configuration/impl/InfinispanRemoteConfiguration.java#L294-L307 |
davidcarboni-archive/httpino | src/main/java/com/github/davidcarboni/httpino/Http.java | Http.postJson | public <T> Response<T> postJson(Endpoint endpoint, Object requestMessage, Class<T> responseClass, NameValuePair... headers) throws IOException {
"""
Sends a POST request and returns the response.
@param endpoint The endpoint to send the request to.
@param requestMessage A message to send in the request b... | java | public <T> Response<T> postJson(Endpoint endpoint, Object requestMessage, Class<T> responseClass, NameValuePair... headers) throws IOException {
if (requestMessage == null) {
return post(endpoint, responseClass, headers);
} // deal with null case
// Create the request
HttpPo... | [
"public",
"<",
"T",
">",
"Response",
"<",
"T",
">",
"postJson",
"(",
"Endpoint",
"endpoint",
",",
"Object",
"requestMessage",
",",
"Class",
"<",
"T",
">",
"responseClass",
",",
"NameValuePair",
"...",
"headers",
")",
"throws",
"IOException",
"{",
"if",
"("... | Sends a POST request and returns the response.
@param endpoint The endpoint to send the request to.
@param requestMessage A message to send in the request body. Can be null.
@param responseClass The class to deserialise the Json response to. Can be null if no response message is expected.
@param headers ... | [
"Sends",
"a",
"POST",
"request",
"and",
"returns",
"the",
"response",
"."
] | train | https://github.com/davidcarboni-archive/httpino/blob/a78c91874e6d9b2e452cf3aa68d4fea804d977ca/src/main/java/com/github/davidcarboni/httpino/Http.java#L133-L150 |
Alluxio/alluxio | shell/src/main/java/alluxio/cli/fsadmin/FileSystemAdminShellUtils.java | FileSystemAdminShellUtils.checkMasterClientService | public static void checkMasterClientService(AlluxioConfiguration alluxioConf) throws IOException {
"""
Checks if the master client service is available.
Throws an exception if fails to determine that the master client service is running.
@param alluxioConf Alluxio configuration
"""
try (CloseableResour... | java | public static void checkMasterClientService(AlluxioConfiguration alluxioConf) throws IOException {
try (CloseableResource<FileSystemMasterClient> client =
FileSystemContext.create(ClientContext.create(alluxioConf))
.acquireMasterClientResource()) {
InetSocketAddress address = client.get().getA... | [
"public",
"static",
"void",
"checkMasterClientService",
"(",
"AlluxioConfiguration",
"alluxioConf",
")",
"throws",
"IOException",
"{",
"try",
"(",
"CloseableResource",
"<",
"FileSystemMasterClient",
">",
"client",
"=",
"FileSystemContext",
".",
"create",
"(",
"ClientCon... | Checks if the master client service is available.
Throws an exception if fails to determine that the master client service is running.
@param alluxioConf Alluxio configuration | [
"Checks",
"if",
"the",
"master",
"client",
"service",
"is",
"available",
".",
"Throws",
"an",
"exception",
"if",
"fails",
"to",
"determine",
"that",
"the",
"master",
"client",
"service",
"is",
"running",
"."
] | train | https://github.com/Alluxio/alluxio/blob/af38cf3ab44613355b18217a3a4d961f8fec3a10/shell/src/main/java/alluxio/cli/fsadmin/FileSystemAdminShellUtils.java#L58-L71 |
augustd/burp-suite-utils | src/main/java/com/codemagi/burp/Utils.java | Utils.urlEncode | public static String urlEncode(String input) {
"""
URL encodes an input String using the UTF-8 character set
(IExtensionHelpers class uses LATIN-1)
@param input The String to encode
@return The URL-encoded String
"""
try {
return URLEncoder.encode(input, "UTF-8");
} catch (Unsu... | java | public static String urlEncode(String input) {
try {
return URLEncoder.encode(input, "UTF-8");
} catch (UnsupportedEncodingException ex) {
throw new AssertionError("UTF-8 not supported", ex);
}
} | [
"public",
"static",
"String",
"urlEncode",
"(",
"String",
"input",
")",
"{",
"try",
"{",
"return",
"URLEncoder",
".",
"encode",
"(",
"input",
",",
"\"UTF-8\"",
")",
";",
"}",
"catch",
"(",
"UnsupportedEncodingException",
"ex",
")",
"{",
"throw",
"new",
"As... | URL encodes an input String using the UTF-8 character set
(IExtensionHelpers class uses LATIN-1)
@param input The String to encode
@return The URL-encoded String | [
"URL",
"encodes",
"an",
"input",
"String",
"using",
"the",
"UTF",
"-",
"8",
"character",
"set",
"(",
"IExtensionHelpers",
"class",
"uses",
"LATIN",
"-",
"1",
")"
] | train | https://github.com/augustd/burp-suite-utils/blob/5e34a6b9147f5705382f98049dd9e4f387b78629/src/main/java/com/codemagi/burp/Utils.java#L320-L326 |
devnied/Bit-lib4j | src/main/java/fr/devnied/bitlib/BytesUtils.java | BytesUtils.byteArrayToInt | public static int byteArrayToInt(final byte[] byteArray, final int startPos, final int length) {
"""
Method used to convert byte array to int
@param byteArray
byte array to convert
@param startPos
start position in array in the
@param length
length of data
@return int value of byte array
"""
if (by... | java | public static int byteArrayToInt(final byte[] byteArray, final int startPos, final int length) {
if (byteArray == null) {
throw new IllegalArgumentException("Parameter 'byteArray' cannot be null");
}
if (length <= 0 || length > 4) {
throw new IllegalArgumentException("Length must be between 1 and 4. Le... | [
"public",
"static",
"int",
"byteArrayToInt",
"(",
"final",
"byte",
"[",
"]",
"byteArray",
",",
"final",
"int",
"startPos",
",",
"final",
"int",
"length",
")",
"{",
"if",
"(",
"byteArray",
"==",
"null",
")",
"{",
"throw",
"new",
"IllegalArgumentException",
... | Method used to convert byte array to int
@param byteArray
byte array to convert
@param startPos
start position in array in the
@param length
length of data
@return int value of byte array | [
"Method",
"used",
"to",
"convert",
"byte",
"array",
"to",
"int"
] | train | https://github.com/devnied/Bit-lib4j/blob/bdfa79fd12e7e3d5cf1196291825ef1bb12a1ee0/src/main/java/fr/devnied/bitlib/BytesUtils.java#L85-L100 |
wmdietl/jsr308-langtools | src/share/classes/com/sun/tools/doclets/formats/html/AbstractIndexWriter.java | AbstractIndexWriter.addDescription | protected void addDescription(PackageDoc pkg, Content dlTree) {
"""
Add one line summary comment for the package.
@param pkg the package to be documented
@param dlTree the content tree to which the description will be added
"""
Content link = getPackageLink(pkg, new StringContent(Util.getPackageNam... | java | protected void addDescription(PackageDoc pkg, Content dlTree) {
Content link = getPackageLink(pkg, new StringContent(Util.getPackageName(pkg)));
Content dt = HtmlTree.DT(link);
dt.addContent(" - ");
dt.addContent(getResource("doclet.package"));
dt.addContent(" " + pkg.name());
... | [
"protected",
"void",
"addDescription",
"(",
"PackageDoc",
"pkg",
",",
"Content",
"dlTree",
")",
"{",
"Content",
"link",
"=",
"getPackageLink",
"(",
"pkg",
",",
"new",
"StringContent",
"(",
"Util",
".",
"getPackageName",
"(",
"pkg",
")",
")",
")",
";",
"Con... | Add one line summary comment for the package.
@param pkg the package to be documented
@param dlTree the content tree to which the description will be added | [
"Add",
"one",
"line",
"summary",
"comment",
"for",
"the",
"package",
"."
] | train | https://github.com/wmdietl/jsr308-langtools/blob/8812d28c20f4de070a0dd6de1b45602431379834/src/share/classes/com/sun/tools/doclets/formats/html/AbstractIndexWriter.java#L124-L134 |
elastic/elasticsearch-hadoop | mr/src/main/java/org/elasticsearch/hadoop/serialization/bulk/PerEntityPoolingMetadataExtractor.java | PerEntityPoolingMetadataExtractor._createExtractorFor | private FieldExtractor _createExtractorFor(Metadata metadata) {
"""
If a metadata tag is unsupported for this version of Elasticsearch then a
"""
// Boot metadata tags that are not supported in this version of Elasticsearch
if (version.onOrAfter(EsMajorVersion.V_6_X)) {
// 6.0 Remov... | java | private FieldExtractor _createExtractorFor(Metadata metadata) {
// Boot metadata tags that are not supported in this version of Elasticsearch
if (version.onOrAfter(EsMajorVersion.V_6_X)) {
// 6.0 Removed support for TTL and Timestamp metadata on index and update requests.
switch ... | [
"private",
"FieldExtractor",
"_createExtractorFor",
"(",
"Metadata",
"metadata",
")",
"{",
"// Boot metadata tags that are not supported in this version of Elasticsearch",
"if",
"(",
"version",
".",
"onOrAfter",
"(",
"EsMajorVersion",
".",
"V_6_X",
")",
")",
"{",
"// 6.0 Re... | If a metadata tag is unsupported for this version of Elasticsearch then a | [
"If",
"a",
"metadata",
"tag",
"is",
"unsupported",
"for",
"this",
"version",
"of",
"Elasticsearch",
"then",
"a"
] | train | https://github.com/elastic/elasticsearch-hadoop/blob/f3acaba268ff96efae8eb946088c748c777c22cc/mr/src/main/java/org/elasticsearch/hadoop/serialization/bulk/PerEntityPoolingMetadataExtractor.java#L117-L129 |
apache/flink | flink-examples/flink-examples-batch/src/main/java/org/apache/flink/examples/java/relational/util/WebLogDataGenerator.java | WebLogDataGenerator.genRanks | private static void genRanks(int noDocs, String path) {
"""
Generates the files for the ranks relation. The ranks entries apply the
following format: <br />
<code>Rank | URL | Average Duration |\n</code>
@param noDocs
Number of entries in the documents relation
@param path
Output path for the ranks relatio... | java | private static void genRanks(int noDocs, String path) {
Random rand = new Random(Calendar.getInstance().getTimeInMillis());
try (BufferedWriter fw = new BufferedWriter(new FileWriter(path))) {
for (int i = 0; i < noDocs; i++) {
// Rank
StringBuilder rank = new StringBuilder(rand.nextInt(100) + "|");
... | [
"private",
"static",
"void",
"genRanks",
"(",
"int",
"noDocs",
",",
"String",
"path",
")",
"{",
"Random",
"rand",
"=",
"new",
"Random",
"(",
"Calendar",
".",
"getInstance",
"(",
")",
".",
"getTimeInMillis",
"(",
")",
")",
";",
"try",
"(",
"BufferedWriter... | Generates the files for the ranks relation. The ranks entries apply the
following format: <br />
<code>Rank | URL | Average Duration |\n</code>
@param noDocs
Number of entries in the documents relation
@param path
Output path for the ranks relation | [
"Generates",
"the",
"files",
"for",
"the",
"ranks",
"relation",
".",
"The",
"ranks",
"entries",
"apply",
"the",
"following",
"format",
":",
"<br",
"/",
">",
"<code",
">",
"Rank",
"|",
"URL",
"|",
"Average",
"Duration",
"|",
"\\",
"n<",
"/",
"code",
">"... | train | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-examples/flink-examples-batch/src/main/java/org/apache/flink/examples/java/relational/util/WebLogDataGenerator.java#L136-L154 |
googleads/googleads-java-lib | examples/admanager_axis/src/main/java/admanager/axis/v201811/nativestyleservice/GetAllNativeStyles.java | GetAllNativeStyles.runExample | public static void runExample(AdManagerServices adManagerServices, AdManagerSession session)
throws RemoteException {
"""
Runs the example.
@param adManagerServices the services factory.
@param session the session.
@throws ApiException if the API request failed with one or more service errors.
@throws ... | java | public static void runExample(AdManagerServices adManagerServices, AdManagerSession session)
throws RemoteException {
NativeStyleServiceInterface nativeStyleService =
adManagerServices.get(session, NativeStyleServiceInterface.class);
// Create a statement to select native styles.
StatementBui... | [
"public",
"static",
"void",
"runExample",
"(",
"AdManagerServices",
"adManagerServices",
",",
"AdManagerSession",
"session",
")",
"throws",
"RemoteException",
"{",
"NativeStyleServiceInterface",
"nativeStyleService",
"=",
"adManagerServices",
".",
"get",
"(",
"session",
"... | Runs the example.
@param adManagerServices the services factory.
@param session the session.
@throws ApiException if the API request failed with one or more service errors.
@throws RemoteException if the API request failed due to other errors. | [
"Runs",
"the",
"example",
"."
] | train | https://github.com/googleads/googleads-java-lib/blob/967957cc4f6076514e3a7926fe653e4f1f7cc9c9/examples/admanager_axis/src/main/java/admanager/axis/v201811/nativestyleservice/GetAllNativeStyles.java#L51-L82 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.