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 |
|---|---|---|---|---|---|---|---|---|---|---|
nmdp-bioinformatics/ngs | variant/src/main/java/org/nmdp/ngs/variant/vcf/VcfWriter.java | VcfWriter.writeColumnHeader | public static void writeColumnHeader(final List<VcfSample> samples, final PrintWriter writer) {
"""
Write VCF column header with the specified print writer.
@param samples zero or more VCF samples, must not be null
@param writer print writer to write VCF with, must not be null
"""
checkNotNull(samp... | java | public static void writeColumnHeader(final List<VcfSample> samples, final PrintWriter writer) {
checkNotNull(samples);
checkNotNull(writer);
StringBuilder sb = new StringBuilder("#CHROM\tPOS\tID\tREF\tALT\tQUAL\tFILTER\tINFO");
if (!samples.isEmpty()) {
sb.append("\tFORMAT")... | [
"public",
"static",
"void",
"writeColumnHeader",
"(",
"final",
"List",
"<",
"VcfSample",
">",
"samples",
",",
"final",
"PrintWriter",
"writer",
")",
"{",
"checkNotNull",
"(",
"samples",
")",
";",
"checkNotNull",
"(",
"writer",
")",
";",
"StringBuilder",
"sb",
... | Write VCF column header with the specified print writer.
@param samples zero or more VCF samples, must not be null
@param writer print writer to write VCF with, must not be null | [
"Write",
"VCF",
"column",
"header",
"with",
"the",
"specified",
"print",
"writer",
"."
] | train | https://github.com/nmdp-bioinformatics/ngs/blob/277627e4311313a80f5dc110b3185b0d7af32bd0/variant/src/main/java/org/nmdp/ngs/variant/vcf/VcfWriter.java#L86-L99 |
lucee/Lucee | core/src/main/java/lucee/runtime/text/xml/XMLCaster.java | XMLCaster.toNode | public static Node toNode(Document doc, Object o, short type) throws PageException {
"""
casts a value to a XML Object defined by type parameter
@param doc XML Document
@param o Object to cast
@param type type to cast to
@return XML Text Object
@throws PageException
"""
if (Node.TEXT_NODE == type) toT... | java | public static Node toNode(Document doc, Object o, short type) throws PageException {
if (Node.TEXT_NODE == type) toText(doc, o);
else if (Node.ATTRIBUTE_NODE == type) toAttr(doc, o);
else if (Node.COMMENT_NODE == type) toComment(doc, o);
else if (Node.ELEMENT_NODE == type) toElement(doc, o);
throw new Expression... | [
"public",
"static",
"Node",
"toNode",
"(",
"Document",
"doc",
",",
"Object",
"o",
",",
"short",
"type",
")",
"throws",
"PageException",
"{",
"if",
"(",
"Node",
".",
"TEXT_NODE",
"==",
"type",
")",
"toText",
"(",
"doc",
",",
"o",
")",
";",
"else",
"if... | casts a value to a XML Object defined by type parameter
@param doc XML Document
@param o Object to cast
@param type type to cast to
@return XML Text Object
@throws PageException | [
"casts",
"a",
"value",
"to",
"a",
"XML",
"Object",
"defined",
"by",
"type",
"parameter"
] | train | https://github.com/lucee/Lucee/blob/29b153fc4e126e5edb97da937f2ee2e231b87593/core/src/main/java/lucee/runtime/text/xml/XMLCaster.java#L406-L414 |
QSFT/Doradus | doradus-server/src/main/java/com/dell/doradus/service/db/cql/CQLService.java | CQLService.getPreparedQuery | public PreparedStatement getPreparedQuery(Query query, String storeName) {
"""
Get the {@link PreparedStatement} for the given {@link CQLStatementCache.Query} to
the given table name. If needed, the query statement is compiled and cached.
@param query Query statement type.
@param storeName Store (... | java | public PreparedStatement getPreparedQuery(Query query, String storeName) {
String tableName = storeToCQLName(storeName);
return m_statementCache.getPreparedQuery(tableName, query);
} | [
"public",
"PreparedStatement",
"getPreparedQuery",
"(",
"Query",
"query",
",",
"String",
"storeName",
")",
"{",
"String",
"tableName",
"=",
"storeToCQLName",
"(",
"storeName",
")",
";",
"return",
"m_statementCache",
".",
"getPreparedQuery",
"(",
"tableName",
",",
... | Get the {@link PreparedStatement} for the given {@link CQLStatementCache.Query} to
the given table name. If needed, the query statement is compiled and cached.
@param query Query statement type.
@param storeName Store (ColumnFamily) name.
@return PreparedStatement for requested table/query. | [
"Get",
"the",
"{",
"@link",
"PreparedStatement",
"}",
"for",
"the",
"given",
"{",
"@link",
"CQLStatementCache",
".",
"Query",
"}",
"to",
"the",
"given",
"table",
"name",
".",
"If",
"needed",
"the",
"query",
"statement",
"is",
"compiled",
"and",
"cached",
"... | train | https://github.com/QSFT/Doradus/blob/ad64d3c37922eefda68ec8869ef089c1ca604b70/doradus-server/src/main/java/com/dell/doradus/service/db/cql/CQLService.java#L249-L252 |
jmeetsma/Iglu-Util | src/main/java/org/ijsberg/iglu/util/misc/StringSupport.java | StringSupport.removeAll | public static String removeAll(String haystack, String ... needles) {
"""
removes all occurrences of needle in haystack
@param haystack input string
@param needles strings to remove
"""
return replaceAll(haystack, needles, ArraySupport.getFilledArray(new String[needles.length], ""));
} | java | public static String removeAll(String haystack, String ... needles) {
return replaceAll(haystack, needles, ArraySupport.getFilledArray(new String[needles.length], ""));
} | [
"public",
"static",
"String",
"removeAll",
"(",
"String",
"haystack",
",",
"String",
"...",
"needles",
")",
"{",
"return",
"replaceAll",
"(",
"haystack",
",",
"needles",
",",
"ArraySupport",
".",
"getFilledArray",
"(",
"new",
"String",
"[",
"needles",
".",
"... | removes all occurrences of needle in haystack
@param haystack input string
@param needles strings to remove | [
"removes",
"all",
"occurrences",
"of",
"needle",
"in",
"haystack"
] | train | https://github.com/jmeetsma/Iglu-Util/blob/971eb022115247b1e34dc26dd02e7e621e29e910/src/main/java/org/ijsberg/iglu/util/misc/StringSupport.java#L250-L252 |
ocelotds/ocelot | ocelot-processor/src/main/java/org/ocelotds/FileWriterServices.java | FileWriterServices.copyResourceToDir | public void copyResourceToDir(String path, String filename, String dir) {
"""
copy path/filename in dir
@param path
@param filename
@param dir
"""
String fullpath = path + ProcessorConstants.SEPARATORCHAR + filename;
messager.printMessage(Diagnostic.Kind.MANDATORY_WARNING, " javascript copy js : " + ful... | java | public void copyResourceToDir(String path, String filename, String dir) {
String fullpath = path + ProcessorConstants.SEPARATORCHAR + filename;
messager.printMessage(Diagnostic.Kind.MANDATORY_WARNING, " javascript copy js : " + fullpath + " to : "+dir);
try (Writer writer = getFileObjectWriter(dir, "org.ocelotds.... | [
"public",
"void",
"copyResourceToDir",
"(",
"String",
"path",
",",
"String",
"filename",
",",
"String",
"dir",
")",
"{",
"String",
"fullpath",
"=",
"path",
"+",
"ProcessorConstants",
".",
"SEPARATORCHAR",
"+",
"filename",
";",
"messager",
".",
"printMessage",
... | copy path/filename in dir
@param path
@param filename
@param dir | [
"copy",
"path",
"/",
"filename",
"in",
"dir"
] | train | https://github.com/ocelotds/ocelot/blob/5f0ac37afd8fa4dc9f7234a2aac8abbb522128e7/ocelot-processor/src/main/java/org/ocelotds/FileWriterServices.java#L56-L64 |
maven-nar/nar-maven-plugin | src/main/java/com/github/maven_nar/cpptasks/openwatcom/OpenWatcomCompiler.java | OpenWatcomCompiler.getDefineSwitch | @Override
protected final void getDefineSwitch(final StringBuffer buffer, final String define, final String value) {
"""
Get define switch.
@param buffer
StringBuffer buffer
@param define
String preprocessor macro
@param value
String value, may be null.
"""
OpenWatcomProcessor.getDefineSwitch(buf... | java | @Override
protected final void getDefineSwitch(final StringBuffer buffer, final String define, final String value) {
OpenWatcomProcessor.getDefineSwitch(buffer, define, value);
} | [
"@",
"Override",
"protected",
"final",
"void",
"getDefineSwitch",
"(",
"final",
"StringBuffer",
"buffer",
",",
"final",
"String",
"define",
",",
"final",
"String",
"value",
")",
"{",
"OpenWatcomProcessor",
".",
"getDefineSwitch",
"(",
"buffer",
",",
"define",
",... | Get define switch.
@param buffer
StringBuffer buffer
@param define
String preprocessor macro
@param value
String value, may be null. | [
"Get",
"define",
"switch",
"."
] | train | https://github.com/maven-nar/nar-maven-plugin/blob/3c622e2024296b4203431bbae3bde290a01dac00/src/main/java/com/github/maven_nar/cpptasks/openwatcom/OpenWatcomCompiler.java#L145-L148 |
JCTools/JCTools | jctools-core/src/main/java/org/jctools/queues/atomic/BaseMpscLinkedAtomicArrayQueue.java | BaseMpscLinkedAtomicArrayQueue.offerSlowPath | private int offerSlowPath(long mask, long pIndex, long producerLimit) {
"""
We do not inline resize into this method because we do not resize on fill.
"""
final long cIndex = lvConsumerIndex();
long bufferCapacity = getCurrentBufferCapacity(mask);
if (cIndex + bufferCapacity > pIndex) {... | java | private int offerSlowPath(long mask, long pIndex, long producerLimit) {
final long cIndex = lvConsumerIndex();
long bufferCapacity = getCurrentBufferCapacity(mask);
if (cIndex + bufferCapacity > pIndex) {
if (!casProducerLimit(producerLimit, cIndex + bufferCapacity)) {
... | [
"private",
"int",
"offerSlowPath",
"(",
"long",
"mask",
",",
"long",
"pIndex",
",",
"long",
"producerLimit",
")",
"{",
"final",
"long",
"cIndex",
"=",
"lvConsumerIndex",
"(",
")",
";",
"long",
"bufferCapacity",
"=",
"getCurrentBufferCapacity",
"(",
"mask",
")"... | We do not inline resize into this method because we do not resize on fill. | [
"We",
"do",
"not",
"inline",
"resize",
"into",
"this",
"method",
"because",
"we",
"do",
"not",
"resize",
"on",
"fill",
"."
] | train | https://github.com/JCTools/JCTools/blob/9250fe316ec84209cbba0a41682f341256df781e/jctools-core/src/main/java/org/jctools/queues/atomic/BaseMpscLinkedAtomicArrayQueue.java#L339-L362 |
MariaDB/mariadb-connector-j | src/main/java/org/mariadb/jdbc/MariaDbBlob.java | MariaDbBlob.setBinaryStream | public OutputStream setBinaryStream(final long pos) throws SQLException {
"""
Retrieves a stream that can be used to write to the <code>BLOB</code> value that this
<code>Blob</code> object represents. The stream begins at position <code>pos</code>. The
bytes written to the stream will overwrite the existing byt... | java | public OutputStream setBinaryStream(final long pos) throws SQLException {
if (pos < 1) {
throw ExceptionMapper.getSqlException("Invalid position in blob");
}
if (offset > 0) {
byte[] tmp = new byte[length];
System.arraycopy(data, offset, tmp, 0, length);
data = tmp;
offset = 0;... | [
"public",
"OutputStream",
"setBinaryStream",
"(",
"final",
"long",
"pos",
")",
"throws",
"SQLException",
"{",
"if",
"(",
"pos",
"<",
"1",
")",
"{",
"throw",
"ExceptionMapper",
".",
"getSqlException",
"(",
"\"Invalid position in blob\"",
")",
";",
"}",
"if",
"(... | Retrieves a stream that can be used to write to the <code>BLOB</code> value that this
<code>Blob</code> object represents. The stream begins at position <code>pos</code>. The
bytes written to the stream will overwrite the existing bytes in the <code>Blob</code> object
starting at the position <code>pos</code>. If the... | [
"Retrieves",
"a",
"stream",
"that",
"can",
"be",
"used",
"to",
"write",
"to",
"the",
"<code",
">",
"BLOB<",
"/",
"code",
">",
"value",
"that",
"this",
"<code",
">",
"Blob<",
"/",
"code",
">",
"object",
"represents",
".",
"The",
"stream",
"begins",
"at"... | train | https://github.com/MariaDB/mariadb-connector-j/blob/d148c7cd347c4680617be65d9e511b289d38a30b/src/main/java/org/mariadb/jdbc/MariaDbBlob.java#L388-L399 |
briandilley/jsonrpc4j | src/main/java/com/googlecode/jsonrpc4j/JsonRpcBasicServer.java | JsonRpcBasicServer.handleJsonNodeRequest | protected JsonError handleJsonNodeRequest(final JsonNode node, final OutputStream output) throws IOException {
"""
Handles the given {@link JsonNode} and writes the responses to the given {@link OutputStream}.
@param node the {@link JsonNode}
@param output the {@link OutputStream}
@return the error code, or... | java | protected JsonError handleJsonNodeRequest(final JsonNode node, final OutputStream output) throws IOException {
if (node.isArray()) {
return handleArray(ArrayNode.class.cast(node), output);
}
if (node.isObject()) {
return handleObject(ObjectNode.class.cast(node), output);
}
return this.writeAndFlushValue... | [
"protected",
"JsonError",
"handleJsonNodeRequest",
"(",
"final",
"JsonNode",
"node",
",",
"final",
"OutputStream",
"output",
")",
"throws",
"IOException",
"{",
"if",
"(",
"node",
".",
"isArray",
"(",
")",
")",
"{",
"return",
"handleArray",
"(",
"ArrayNode",
".... | Handles the given {@link JsonNode} and writes the responses to the given {@link OutputStream}.
@param node the {@link JsonNode}
@param output the {@link OutputStream}
@return the error code, or {@code 0} if none
@throws IOException on error | [
"Handles",
"the",
"given",
"{",
"@link",
"JsonNode",
"}",
"and",
"writes",
"the",
"responses",
"to",
"the",
"given",
"{",
"@link",
"OutputStream",
"}",
"."
] | train | https://github.com/briandilley/jsonrpc4j/blob/d749762c9295b92d893677a8c7be2a14dd43b3bb/src/main/java/com/googlecode/jsonrpc4j/JsonRpcBasicServer.java#L273-L281 |
jenkinsci/jenkins | core/src/main/java/hudson/model/AbstractProject.java | AbstractProject.scheduleBuild2 | @SuppressWarnings("deprecation")
@WithBridgeMethods(Future.class)
public QueueTaskFuture<R> scheduleBuild2(int quietPeriod) {
"""
Schedules a build, and returns a {@link Future} object
to wait for the completion of the build.
<p>
Production code shouldn't be using this, but for tests this is very conv... | java | @SuppressWarnings("deprecation")
@WithBridgeMethods(Future.class)
public QueueTaskFuture<R> scheduleBuild2(int quietPeriod) {
return scheduleBuild2(quietPeriod, new LegacyCodeCause());
} | [
"@",
"SuppressWarnings",
"(",
"\"deprecation\"",
")",
"@",
"WithBridgeMethods",
"(",
"Future",
".",
"class",
")",
"public",
"QueueTaskFuture",
"<",
"R",
">",
"scheduleBuild2",
"(",
"int",
"quietPeriod",
")",
"{",
"return",
"scheduleBuild2",
"(",
"quietPeriod",
"... | Schedules a build, and returns a {@link Future} object
to wait for the completion of the build.
<p>
Production code shouldn't be using this, but for tests this is very convenient, so this isn't marked
as deprecated. | [
"Schedules",
"a",
"build",
"and",
"returns",
"a",
"{",
"@link",
"Future",
"}",
"object",
"to",
"wait",
"for",
"the",
"completion",
"of",
"the",
"build",
"."
] | train | https://github.com/jenkinsci/jenkins/blob/44c4d3989232082c254d27ae360aa810669f44b7/core/src/main/java/hudson/model/AbstractProject.java#L836-L840 |
spring-projects/spring-android | spring-android-auth/src/main/java/org/springframework/security/crypto/encrypt/AndroidEncryptors.java | AndroidEncryptors.queryableText | public static TextEncryptor queryableText(CharSequence password, CharSequence salt) {
"""
Creates an encryptor for queryable text strings that uses standard password-based encryption. Uses a shared, or
constant 16 byte initialization vector so encrypting the same data results in the same encryption result. This i... | java | public static TextEncryptor queryableText(CharSequence password, CharSequence salt) {
return new HexEncodingTextEncryptor(new AndroidAesBytesEncryptor(password.toString(), salt, AndroidKeyGenerators.shared(16)));
} | [
"public",
"static",
"TextEncryptor",
"queryableText",
"(",
"CharSequence",
"password",
",",
"CharSequence",
"salt",
")",
"{",
"return",
"new",
"HexEncodingTextEncryptor",
"(",
"new",
"AndroidAesBytesEncryptor",
"(",
"password",
".",
"toString",
"(",
")",
",",
"salt"... | Creates an encryptor for queryable text strings that uses standard password-based encryption. Uses a shared, or
constant 16 byte initialization vector so encrypting the same data results in the same encryption result. This is
done to allow encrypted data to be queried against. Encrypted text is hex-encoded.
@param pas... | [
"Creates",
"an",
"encryptor",
"for",
"queryable",
"text",
"strings",
"that",
"uses",
"standard",
"password",
"-",
"based",
"encryption",
".",
"Uses",
"a",
"shared",
"or",
"constant",
"16",
"byte",
"initialization",
"vector",
"so",
"encrypting",
"the",
"same",
... | train | https://github.com/spring-projects/spring-android/blob/941296e152d49a40e0745a3e81628a974f72b7e4/spring-android-auth/src/main/java/org/springframework/security/crypto/encrypt/AndroidEncryptors.java#L63-L65 |
alkacon/opencms-core | src-gwt/org/opencms/gwt/client/ui/input/colorpicker/CmsColorSelector.java | CmsColorSelector.setHSV | public void setHSV(int hue, int sat, int bri) throws Exception {
"""
Set the Hue, Saturation and Brightness variables.<p>
@param hue angle - valid range is 0-359
@param sat percent - valid range is 0-100
@param bri percent (Brightness) - valid range is 0-100
@throws java.lang.Exception if something goes wron... | java | public void setHSV(int hue, int sat, int bri) throws Exception {
CmsColor color = new CmsColor();
color.setHSV(hue, sat, bri);
m_red = color.getRed();
m_green = color.getGreen();
m_blue = color.getBlue();
m_hue = hue;
m_saturation = sat;
m_brig... | [
"public",
"void",
"setHSV",
"(",
"int",
"hue",
",",
"int",
"sat",
",",
"int",
"bri",
")",
"throws",
"Exception",
"{",
"CmsColor",
"color",
"=",
"new",
"CmsColor",
"(",
")",
";",
"color",
".",
"setHSV",
"(",
"hue",
",",
"sat",
",",
"bri",
")",
";",
... | Set the Hue, Saturation and Brightness variables.<p>
@param hue angle - valid range is 0-359
@param sat percent - valid range is 0-100
@param bri percent (Brightness) - valid range is 0-100
@throws java.lang.Exception if something goes wrong | [
"Set",
"the",
"Hue",
"Saturation",
"and",
"Brightness",
"variables",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src-gwt/org/opencms/gwt/client/ui/input/colorpicker/CmsColorSelector.java#L754-L776 |
Stratio/stratio-cassandra | src/java/org/apache/cassandra/utils/memory/MemoryUtil.java | MemoryUtil.setBytes | public static void setBytes(long address, byte[] buffer, int bufferOffset, int count) {
"""
Transfers count bytes from buffer to Memory
@param address start offset in the memory
@param buffer the data buffer
@param bufferOffset start offset of the buffer
@param count number of bytes to transfer
"""
... | java | public static void setBytes(long address, byte[] buffer, int bufferOffset, int count)
{
assert buffer != null;
assert !(bufferOffset < 0 || count < 0 || bufferOffset + count > buffer.length);
setBytes(buffer, bufferOffset, address, count);
} | [
"public",
"static",
"void",
"setBytes",
"(",
"long",
"address",
",",
"byte",
"[",
"]",
"buffer",
",",
"int",
"bufferOffset",
",",
"int",
"count",
")",
"{",
"assert",
"buffer",
"!=",
"null",
";",
"assert",
"!",
"(",
"bufferOffset",
"<",
"0",
"||",
"coun... | Transfers count bytes from buffer to Memory
@param address start offset in the memory
@param buffer the data buffer
@param bufferOffset start offset of the buffer
@param count number of bytes to transfer | [
"Transfers",
"count",
"bytes",
"from",
"buffer",
"to",
"Memory"
] | train | https://github.com/Stratio/stratio-cassandra/blob/f6416b43ad5309083349ad56266450fa8c6a2106/src/java/org/apache/cassandra/utils/memory/MemoryUtil.java#L257-L262 |
liferay/com-liferay-commerce | commerce-product-service/src/main/java/com/liferay/commerce/product/service/persistence/impl/CPDefinitionOptionRelPersistenceImpl.java | CPDefinitionOptionRelPersistenceImpl.findByC_SC | @Override
public List<CPDefinitionOptionRel> findByC_SC(long CPDefinitionId,
boolean skuContributor, int start, int end) {
"""
Returns a range of all the cp definition option rels where CPDefinitionId = ? and skuContributor = ?.
<p>
Useful when paginating results. Returns a maximum of <code>end - st... | java | @Override
public List<CPDefinitionOptionRel> findByC_SC(long CPDefinitionId,
boolean skuContributor, int start, int end) {
return findByC_SC(CPDefinitionId, skuContributor, start, end, null);
} | [
"@",
"Override",
"public",
"List",
"<",
"CPDefinitionOptionRel",
">",
"findByC_SC",
"(",
"long",
"CPDefinitionId",
",",
"boolean",
"skuContributor",
",",
"int",
"start",
",",
"int",
"end",
")",
"{",
"return",
"findByC_SC",
"(",
"CPDefinitionId",
",",
"skuContrib... | Returns a range of all the cp definition option rels where CPDefinitionId = ? and skuContributor = ?.
<p>
Useful when paginating results. Returns a maximum of <code>end - start</code> instances. <code>start</code> and <code>end</code> are not primary keys, they are indexes in the result set. Thus, <code>0</cod... | [
"Returns",
"a",
"range",
"of",
"all",
"the",
"cp",
"definition",
"option",
"rels",
"where",
"CPDefinitionId",
"=",
"?",
";",
"and",
"skuContributor",
"=",
"?",
";",
"."
] | train | https://github.com/liferay/com-liferay-commerce/blob/9e54362d7f59531fc684016ba49ee7cdc3a2f22b/commerce-product-service/src/main/java/com/liferay/commerce/product/service/persistence/impl/CPDefinitionOptionRelPersistenceImpl.java#L3313-L3317 |
alibaba/canal | dbsync/src/main/java/com/taobao/tddl/dbsync/binlog/event/RowsLogBuffer.java | RowsLogBuffer.nextOneRow | public final boolean nextOneRow(BitSet columns, boolean after) {
"""
Extracting next row from packed buffer.
@see mysql-5.1.60/sql/log_event.cc -
Rows_log_event::print_verbose_one_row
"""
final boolean hasOneRow = buffer.hasRemaining();
if (hasOneRow) {
int column = 0;
... | java | public final boolean nextOneRow(BitSet columns, boolean after) {
final boolean hasOneRow = buffer.hasRemaining();
if (hasOneRow) {
int column = 0;
for (int i = 0; i < columnLen; i++)
if (columns.get(i)) {
column++;
}
... | [
"public",
"final",
"boolean",
"nextOneRow",
"(",
"BitSet",
"columns",
",",
"boolean",
"after",
")",
"{",
"final",
"boolean",
"hasOneRow",
"=",
"buffer",
".",
"hasRemaining",
"(",
")",
";",
"if",
"(",
"hasOneRow",
")",
"{",
"int",
"column",
"=",
"0",
";",... | Extracting next row from packed buffer.
@see mysql-5.1.60/sql/log_event.cc -
Rows_log_event::print_verbose_one_row | [
"Extracting",
"next",
"row",
"from",
"packed",
"buffer",
"."
] | train | https://github.com/alibaba/canal/blob/8f088cddc0755f4350c5aaae95c6e4002d90a40f/dbsync/src/main/java/com/taobao/tddl/dbsync/binlog/event/RowsLogBuffer.java#L70-L96 |
kstateome/canvas-api | src/main/java/edu/ksu/canvas/CanvasApiFactory.java | CanvasApiFactory.getWriter | public <T extends CanvasWriter> T getWriter(Class<T> type, OauthToken oauthToken) {
"""
Get a writer implementation to push data into Canvas.
@param type Interface type you wish to get an implementation for
@param oauthToken An OAuth token to use for authentication when making API calls
@param <T> A writer impl... | java | public <T extends CanvasWriter> T getWriter(Class<T> type, OauthToken oauthToken) {
return getWriter(type, oauthToken, false);
} | [
"public",
"<",
"T",
"extends",
"CanvasWriter",
">",
"T",
"getWriter",
"(",
"Class",
"<",
"T",
">",
"type",
",",
"OauthToken",
"oauthToken",
")",
"{",
"return",
"getWriter",
"(",
"type",
",",
"oauthToken",
",",
"false",
")",
";",
"}"
] | Get a writer implementation to push data into Canvas.
@param type Interface type you wish to get an implementation for
@param oauthToken An OAuth token to use for authentication when making API calls
@param <T> A writer implementation
@return A writer implementation class | [
"Get",
"a",
"writer",
"implementation",
"to",
"push",
"data",
"into",
"Canvas",
"."
] | train | https://github.com/kstateome/canvas-api/blob/426bf403a8fd7aca3f170348005feda25b374e5a/src/main/java/edu/ksu/canvas/CanvasApiFactory.java#L112-L114 |
lightoze/gwt-i18n-server | src/main/java/net/lightoze/gwt/i18n/client/LocaleFactory.java | LocaleFactory.getEncoder | public static <T extends Messages> T getEncoder(Class<T> cls) {
"""
Get <em>encoding</em> localization object, which will encode all requests so that they can be decoded later by {@link net.lightoze.gwt.i18n.server.LocaleProxy#decode}.
<p>
The purpose is to separate complex (e.g. template-based) text generation ... | java | public static <T extends Messages> T getEncoder(Class<T> cls) {
return get(cls, ENCODER);
} | [
"public",
"static",
"<",
"T",
"extends",
"Messages",
">",
"T",
"getEncoder",
"(",
"Class",
"<",
"T",
">",
"cls",
")",
"{",
"return",
"get",
"(",
"cls",
",",
"ENCODER",
")",
";",
"}"
] | Get <em>encoding</em> localization object, which will encode all requests so that they can be decoded later by {@link net.lightoze.gwt.i18n.server.LocaleProxy#decode}.
<p>
The purpose is to separate complex (e.g. template-based) text generation and its localization for particular locale into two separate phases.
<p>
<s... | [
"Get",
"<em",
">",
"encoding<",
"/",
"em",
">",
"localization",
"object",
"which",
"will",
"encode",
"all",
"requests",
"so",
"that",
"they",
"can",
"be",
"decoded",
"later",
"by",
"{",
"@link",
"net",
".",
"lightoze",
".",
"gwt",
".",
"i18n",
".",
"se... | train | https://github.com/lightoze/gwt-i18n-server/blob/96de53288e9bf31721d7b0e2a1d9f7b6ce1a7e83/src/main/java/net/lightoze/gwt/i18n/client/LocaleFactory.java#L46-L48 |
apache/incubator-gobblin | gobblin-api/src/main/java/org/apache/gobblin/source/workunit/WorkUnit.java | WorkUnit.getExpectedHighWatermark | public <T extends Watermark> T getExpectedHighWatermark(Class<T> watermarkClass) {
"""
Get the expected high {@link Watermark}. A default {@link Gson} object will be used to deserialize the watermark.
@param watermarkClass the watermark class for this {@code WorkUnit}.
@return the expected high watermark in th... | java | public <T extends Watermark> T getExpectedHighWatermark(Class<T> watermarkClass) {
return getExpectedHighWatermark(watermarkClass, GSON);
} | [
"public",
"<",
"T",
"extends",
"Watermark",
">",
"T",
"getExpectedHighWatermark",
"(",
"Class",
"<",
"T",
">",
"watermarkClass",
")",
"{",
"return",
"getExpectedHighWatermark",
"(",
"watermarkClass",
",",
"GSON",
")",
";",
"}"
] | Get the expected high {@link Watermark}. A default {@link Gson} object will be used to deserialize the watermark.
@param watermarkClass the watermark class for this {@code WorkUnit}.
@return the expected high watermark in this {@code WorkUnit}. | [
"Get",
"the",
"expected",
"high",
"{",
"@link",
"Watermark",
"}",
".",
"A",
"default",
"{",
"@link",
"Gson",
"}",
"object",
"will",
"be",
"used",
"to",
"deserialize",
"the",
"watermark",
"."
] | train | https://github.com/apache/incubator-gobblin/blob/f029b4c0fea0fe4aa62f36dda2512344ff708bae/gobblin-api/src/main/java/org/apache/gobblin/source/workunit/WorkUnit.java#L263-L265 |
aws/aws-sdk-java | aws-java-sdk-servicecatalog/src/main/java/com/amazonaws/services/servicecatalog/model/ServiceActionDetail.java | ServiceActionDetail.withDefinition | public ServiceActionDetail withDefinition(java.util.Map<String, String> definition) {
"""
<p>
A map that defines the self-service action.
</p>
@param definition
A map that defines the self-service action.
@return Returns a reference to this object so that method calls can be chained together.
"""
... | java | public ServiceActionDetail withDefinition(java.util.Map<String, String> definition) {
setDefinition(definition);
return this;
} | [
"public",
"ServiceActionDetail",
"withDefinition",
"(",
"java",
".",
"util",
".",
"Map",
"<",
"String",
",",
"String",
">",
"definition",
")",
"{",
"setDefinition",
"(",
"definition",
")",
";",
"return",
"this",
";",
"}"
] | <p>
A map that defines the self-service action.
</p>
@param definition
A map that defines the self-service action.
@return Returns a reference to this object so that method calls can be chained together. | [
"<p",
">",
"A",
"map",
"that",
"defines",
"the",
"self",
"-",
"service",
"action",
".",
"<",
"/",
"p",
">"
] | train | https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-servicecatalog/src/main/java/com/amazonaws/services/servicecatalog/model/ServiceActionDetail.java#L119-L122 |
lecho/hellocharts-android | hellocharts-library/src/lecho/lib/hellocharts/renderer/LineChartRenderer.java | LineChartRenderer.drawPath | private void drawPath(Canvas canvas, final Line line) {
"""
Draws lines, uses path for drawing filled area on software canvas. Line is drawn with canvas.drawLines() method.
"""
prepareLinePaint(line);
int valueIndex = 0;
for (PointValue pointValue : line.getValues()) {
fin... | java | private void drawPath(Canvas canvas, final Line line) {
prepareLinePaint(line);
int valueIndex = 0;
for (PointValue pointValue : line.getValues()) {
final float rawX = computator.computeRawX(pointValue.getX());
final float rawY = computator.computeRawY(pointValue.getY()... | [
"private",
"void",
"drawPath",
"(",
"Canvas",
"canvas",
",",
"final",
"Line",
"line",
")",
"{",
"prepareLinePaint",
"(",
"line",
")",
";",
"int",
"valueIndex",
"=",
"0",
";",
"for",
"(",
"PointValue",
"pointValue",
":",
"line",
".",
"getValues",
"(",
")"... | Draws lines, uses path for drawing filled area on software canvas. Line is drawn with canvas.drawLines() method. | [
"Draws",
"lines",
"uses",
"path",
"for",
"drawing",
"filled",
"area",
"on",
"software",
"canvas",
".",
"Line",
"is",
"drawn",
"with",
"canvas",
".",
"drawLines",
"()",
"method",
"."
] | train | https://github.com/lecho/hellocharts-android/blob/c41419c9afa097452dee823c7eba0e5136aa96bd/hellocharts-library/src/lecho/lib/hellocharts/renderer/LineChartRenderer.java#L216-L242 |
gmessner/gitlab4j-api | src/main/java/org/gitlab4j/api/AbstractApi.java | AbstractApi.addFormParam | protected void addFormParam(Form formData, String name, Object value, boolean required) throws IllegalArgumentException {
"""
Convenience method for adding query and form parameters to a get() or post() call.
If required is true and value is null, will throw an IllegalArgumentException.
@param formData the For... | java | protected void addFormParam(Form formData, String name, Object value, boolean required) throws IllegalArgumentException {
if (value == null) {
if (required) {
throw new IllegalArgumentException(name + " cannot be empty or null");
}
return;
}
... | [
"protected",
"void",
"addFormParam",
"(",
"Form",
"formData",
",",
"String",
"name",
",",
"Object",
"value",
",",
"boolean",
"required",
")",
"throws",
"IllegalArgumentException",
"{",
"if",
"(",
"value",
"==",
"null",
")",
"{",
"if",
"(",
"required",
")",
... | Convenience method for adding query and form parameters to a get() or post() call.
If required is true and value is null, will throw an IllegalArgumentException.
@param formData the Form containing the name/value pairs
@param name the name of the field/attribute to add
@param value the value of the field/attribute to ... | [
"Convenience",
"method",
"for",
"adding",
"query",
"and",
"form",
"parameters",
"to",
"a",
"get",
"()",
"or",
"post",
"()",
"call",
".",
"If",
"required",
"is",
"true",
"and",
"value",
"is",
"null",
"will",
"throw",
"an",
"IllegalArgumentException",
"."
] | train | https://github.com/gmessner/gitlab4j-api/blob/ab045070abac0a8f4ccbf17b5ed9bfdef5723eed/src/main/java/org/gitlab4j/api/AbstractApi.java#L555-L572 |
spotify/helios | helios-client/src/main/java/com/spotify/helios/client/HeliosClient.java | HeliosClient.listHosts | public ListenableFuture<List<String>> listHosts(final String namePattern) {
"""
Returns a list of all hosts registered in the Helios cluster whose name matches the given
pattern.
"""
return listHosts(ImmutableMultimap.of("namePattern", namePattern));
} | java | public ListenableFuture<List<String>> listHosts(final String namePattern) {
return listHosts(ImmutableMultimap.of("namePattern", namePattern));
} | [
"public",
"ListenableFuture",
"<",
"List",
"<",
"String",
">",
">",
"listHosts",
"(",
"final",
"String",
"namePattern",
")",
"{",
"return",
"listHosts",
"(",
"ImmutableMultimap",
".",
"of",
"(",
"\"namePattern\"",
",",
"namePattern",
")",
")",
";",
"}"
] | Returns a list of all hosts registered in the Helios cluster whose name matches the given
pattern. | [
"Returns",
"a",
"list",
"of",
"all",
"hosts",
"registered",
"in",
"the",
"Helios",
"cluster",
"whose",
"name",
"matches",
"the",
"given",
"pattern",
"."
] | train | https://github.com/spotify/helios/blob/c9000bc1d6908651570be8b057d4981bba4df5b4/helios-client/src/main/java/com/spotify/helios/client/HeliosClient.java#L374-L376 |
OpenLiberty/open-liberty | dev/com.ibm.ws.messaging.runtime/src/com/ibm/ws/sib/matchspace/selector/impl/TopicPattern.java | TopicPattern.topicSkipBackward | static boolean topicSkipBackward(char[] chars, int[] cursor) {
"""
Skip backward to the next separator character
@param chars the characters to be examined
@param cursor the int[2] { start, end } "cursor" describing the area to be examined
@return true if something was skipped, false if nothing could be skipped... | java | static boolean topicSkipBackward(char[] chars, int[] cursor) {
if (cursor[0] == cursor[1])
return false;
while (cursor[0] < cursor[1] &&
chars[cursor[1]-1] != MatchSpace.SUBTOPIC_SEPARATOR_CHAR)
cursor[1]--;
return true;
} | [
"static",
"boolean",
"topicSkipBackward",
"(",
"char",
"[",
"]",
"chars",
",",
"int",
"[",
"]",
"cursor",
")",
"{",
"if",
"(",
"cursor",
"[",
"0",
"]",
"==",
"cursor",
"[",
"1",
"]",
")",
"return",
"false",
";",
"while",
"(",
"cursor",
"[",
"0",
... | Skip backward to the next separator character
@param chars the characters to be examined
@param cursor the int[2] { start, end } "cursor" describing the area to be examined
@return true if something was skipped, false if nothing could be skipped | [
"Skip",
"backward",
"to",
"the",
"next",
"separator",
"character"
] | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.messaging.runtime/src/com/ibm/ws/sib/matchspace/selector/impl/TopicPattern.java#L102-L109 |
netscaler/nitro | src/main/java/com/citrix/netscaler/nitro/resource/stat/appfw/appfwpolicylabel_stats.java | appfwpolicylabel_stats.get | public static appfwpolicylabel_stats get(nitro_service service, String labelname) throws Exception {
"""
Use this API to fetch statistics of appfwpolicylabel_stats resource of given name .
"""
appfwpolicylabel_stats obj = new appfwpolicylabel_stats();
obj.set_labelname(labelname);
appfwpolicylabel_stats ... | java | public static appfwpolicylabel_stats get(nitro_service service, String labelname) throws Exception{
appfwpolicylabel_stats obj = new appfwpolicylabel_stats();
obj.set_labelname(labelname);
appfwpolicylabel_stats response = (appfwpolicylabel_stats) obj.stat_resource(service);
return response;
} | [
"public",
"static",
"appfwpolicylabel_stats",
"get",
"(",
"nitro_service",
"service",
",",
"String",
"labelname",
")",
"throws",
"Exception",
"{",
"appfwpolicylabel_stats",
"obj",
"=",
"new",
"appfwpolicylabel_stats",
"(",
")",
";",
"obj",
".",
"set_labelname",
"(",... | Use this API to fetch statistics of appfwpolicylabel_stats resource of given name . | [
"Use",
"this",
"API",
"to",
"fetch",
"statistics",
"of",
"appfwpolicylabel_stats",
"resource",
"of",
"given",
"name",
"."
] | train | https://github.com/netscaler/nitro/blob/2a98692dcf4e4ec430c7d7baab8382e4ba5a35e4/src/main/java/com/citrix/netscaler/nitro/resource/stat/appfw/appfwpolicylabel_stats.java#L149-L154 |
line/armeria | core/src/main/java/com/linecorp/armeria/client/AbstractClientOptionsBuilder.java | AbstractClientOptionsBuilder.rpcDecorator | public <T extends Client<I, O>, R extends Client<I, O>, I extends RpcRequest, O extends RpcResponse>
B rpcDecorator(Function<T, R> decorator) {
"""
Adds the specified RPC-level {@code decorator}.
@param decorator the {@link Function} that transforms a {@link Client} to another
@param <T> the type of the {@... | java | public <T extends Client<I, O>, R extends Client<I, O>, I extends RpcRequest, O extends RpcResponse>
B rpcDecorator(Function<T, R> decorator) {
decoration.addRpc(decorator);
return self();
} | [
"public",
"<",
"T",
"extends",
"Client",
"<",
"I",
",",
"O",
">",
",",
"R",
"extends",
"Client",
"<",
"I",
",",
"O",
">",
",",
"I",
"extends",
"RpcRequest",
",",
"O",
"extends",
"RpcResponse",
">",
"B",
"rpcDecorator",
"(",
"Function",
"<",
"T",
",... | Adds the specified RPC-level {@code decorator}.
@param decorator the {@link Function} that transforms a {@link Client} to another
@param <T> the type of the {@link Client} being decorated
@param <R> the type of the {@link Client} produced by the {@code decorator}
@param <I> the {@link Request} type of the {@link Clien... | [
"Adds",
"the",
"specified",
"RPC",
"-",
"level",
"{",
"@code",
"decorator",
"}",
"."
] | train | https://github.com/line/armeria/blob/67d29e019fd35a35f89c45cc8f9119ff9b12b44d/core/src/main/java/com/linecorp/armeria/client/AbstractClientOptionsBuilder.java#L311-L315 |
CleverTap/clevertap-android-sdk | clevertap-android-sdk/src/main/java/com/clevertap/android/sdk/DBAdapter.java | DBAdapter.storeUserProfile | synchronized long storeUserProfile(String id, JSONObject obj) {
"""
Adds a JSON string representing to the DB.
@param obj the JSON to record
@return the number of rows in the table, or DB_OUT_OF_MEMORY_ERROR/DB_UPDATE_ERROR
"""
if (id == null) return DB_UPDATE_ERROR;
if (!this.belowMemThr... | java | synchronized long storeUserProfile(String id, JSONObject obj) {
if (id == null) return DB_UPDATE_ERROR;
if (!this.belowMemThreshold()) {
getConfigLogger().verbose("There is not enough space left on the device to store data, data discarded");
return DB_OUT_OF_MEMORY_ERROR;
... | [
"synchronized",
"long",
"storeUserProfile",
"(",
"String",
"id",
",",
"JSONObject",
"obj",
")",
"{",
"if",
"(",
"id",
"==",
"null",
")",
"return",
"DB_UPDATE_ERROR",
";",
"if",
"(",
"!",
"this",
".",
"belowMemThreshold",
"(",
")",
")",
"{",
"getConfigLogge... | Adds a JSON string representing to the DB.
@param obj the JSON to record
@return the number of rows in the table, or DB_OUT_OF_MEMORY_ERROR/DB_UPDATE_ERROR | [
"Adds",
"a",
"JSON",
"string",
"representing",
"to",
"the",
"DB",
"."
] | train | https://github.com/CleverTap/clevertap-android-sdk/blob/be134c06a4f07494c398335ad9ff4976633743e1/clevertap-android-sdk/src/main/java/com/clevertap/android/sdk/DBAdapter.java#L254-L280 |
biojava/biojava | biojava-structure-gui/src/main/java/demo/DemoShowLargeAssembly.java | DemoShowLargeAssembly.readStructure | public static Structure readStructure(String pdbId, int bioAssemblyId) {
"""
Load a specific biological assembly for a PDB entry
@param pdbId .. the PDB ID
@param bioAssemblyId .. the first assembly has the bioAssemblyId 1
@return a Structure object or null if something went wrong.
"""
// pre-computed... | java | public static Structure readStructure(String pdbId, int bioAssemblyId) {
// pre-computed files use lower case PDB IDs
pdbId = pdbId.toLowerCase();
// we just need this to track where to store PDB files
// this checks the PDB_DIR property (and uses a tmp location if not set)
AtomCache cache = new AtomCache(... | [
"public",
"static",
"Structure",
"readStructure",
"(",
"String",
"pdbId",
",",
"int",
"bioAssemblyId",
")",
"{",
"// pre-computed files use lower case PDB IDs",
"pdbId",
"=",
"pdbId",
".",
"toLowerCase",
"(",
")",
";",
"// we just need this to track where to store PDB files... | Load a specific biological assembly for a PDB entry
@param pdbId .. the PDB ID
@param bioAssemblyId .. the first assembly has the bioAssemblyId 1
@return a Structure object or null if something went wrong. | [
"Load",
"a",
"specific",
"biological",
"assembly",
"for",
"a",
"PDB",
"entry"
] | train | https://github.com/biojava/biojava/blob/a1c71a8e3d40cc32104b1d387a3d3b560b43356e/biojava-structure-gui/src/main/java/demo/DemoShowLargeAssembly.java#L72-L101 |
PeterisP/LVTagger | src/main/java/edu/stanford/nlp/ling/Sentence.java | Sentence.extractNgram | public static <T> String extractNgram(List<T> list, int start, int end) {
"""
Returns the substring of the sentence from start (inclusive)
to end (exclusive).
@param start Leftmost index of the substring
@param end Rightmost index of the ngram
@return The ngram as a String
"""
if (start < 0 || end >... | java | public static <T> String extractNgram(List<T> list, int start, int end) {
if (start < 0 || end > list.size() || start >= end) return null;
final StringBuilder sb = new StringBuilder();
// TODO: iterator
for (int i = start; i < end; i++) {
T o = list.get(i);
if (sb.length() != 0) sb.app... | [
"public",
"static",
"<",
"T",
">",
"String",
"extractNgram",
"(",
"List",
"<",
"T",
">",
"list",
",",
"int",
"start",
",",
"int",
"end",
")",
"{",
"if",
"(",
"start",
"<",
"0",
"||",
"end",
">",
"list",
".",
"size",
"(",
")",
"||",
"start",
">=... | Returns the substring of the sentence from start (inclusive)
to end (exclusive).
@param start Leftmost index of the substring
@param end Rightmost index of the ngram
@return The ngram as a String | [
"Returns",
"the",
"substring",
"of",
"the",
"sentence",
"from",
"start",
"(",
"inclusive",
")",
"to",
"end",
"(",
"exclusive",
")",
"."
] | train | https://github.com/PeterisP/LVTagger/blob/b3d44bab9ec07ace0d13612c448a6b7298c1f681/src/main/java/edu/stanford/nlp/ling/Sentence.java#L222-L232 |
BioPAX/Paxtools | paxtools-core/src/main/java/org/biopax/paxtools/io/SimpleIOHandler.java | SimpleIOHandler.writeObject | public void writeObject(Writer out, BioPAXElement bean) throws IOException {
"""
Writes the XML representation of individual BioPAX element that
is BioPAX-like but only for display or debug purpose (incomplete).
Note: use {@link BioPAXIOHandler#convertToOWL(org.biopax.paxtools.model.Model, java.io.OutputStream... | java | public void writeObject(Writer out, BioPAXElement bean) throws IOException
{
String name = "bp:" + bean.getModelInterface().getSimpleName();
writeIDLine(out, bean, name);
Set<PropertyEditor> editors = editorMap.getEditorsOf(bean);
if (editors == null || editors.isEmpty())
{
log.info("no editors for " + b... | [
"public",
"void",
"writeObject",
"(",
"Writer",
"out",
",",
"BioPAXElement",
"bean",
")",
"throws",
"IOException",
"{",
"String",
"name",
"=",
"\"bp:\"",
"+",
"bean",
".",
"getModelInterface",
"(",
")",
".",
"getSimpleName",
"(",
")",
";",
"writeIDLine",
"("... | Writes the XML representation of individual BioPAX element that
is BioPAX-like but only for display or debug purpose (incomplete).
Note: use {@link BioPAXIOHandler#convertToOWL(org.biopax.paxtools.model.Model, java.io.OutputStream)}
convertToOWL(org.biopax.paxtools.model.Model, Object)} instead
if you have a model and... | [
"Writes",
"the",
"XML",
"representation",
"of",
"individual",
"BioPAX",
"element",
"that",
"is",
"BioPAX",
"-",
"like",
"but",
"only",
"for",
"display",
"or",
"debug",
"purpose",
"(",
"incomplete",
")",
"."
] | train | https://github.com/BioPAX/Paxtools/blob/2f93afa94426bf8b5afc2e0e61cd4b269a83288d/paxtools-core/src/main/java/org/biopax/paxtools/io/SimpleIOHandler.java#L589-L612 |
kiegroup/jbpm | jbpm-bpmn2-emfextmodel/src/main/java/org/omg/spec/bpmn/non/normative/color/impl/ColorPackageImpl.java | ColorPackageImpl.initializePackageContents | public void initializePackageContents() {
"""
Complete the initialization of the package and its meta-model. This
method is guarded to have no affect on any invocation but its first.
<!-- begin-user-doc -->
<!-- end-user-doc -->
@generated
"""
if (isInitialized) return;
isInitialized = true;
// Ini... | java | public void initializePackageContents() {
if (isInitialized) return;
isInitialized = true;
// Initialize package
setName(eNAME);
setNsPrefix(eNS_PREFIX);
setNsURI(eNS_URI);
// Create type parameters
// Set bounds for type parameters
// Add supertypes to classes
// Initialize classes and feature... | [
"public",
"void",
"initializePackageContents",
"(",
")",
"{",
"if",
"(",
"isInitialized",
")",
"return",
";",
"isInitialized",
"=",
"true",
";",
"// Initialize package",
"setName",
"(",
"eNAME",
")",
";",
"setNsPrefix",
"(",
"eNS_PREFIX",
")",
";",
"setNsURI",
... | Complete the initialization of the package and its meta-model. This
method is guarded to have no affect on any invocation but its first.
<!-- begin-user-doc -->
<!-- end-user-doc -->
@generated | [
"Complete",
"the",
"initialization",
"of",
"the",
"package",
"and",
"its",
"meta",
"-",
"model",
".",
"This",
"method",
"is",
"guarded",
"to",
"have",
"no",
"affect",
"on",
"any",
"invocation",
"but",
"its",
"first",
".",
"<!",
"--",
"begin",
"-",
"user"... | train | https://github.com/kiegroup/jbpm/blob/c3473c728aa382ebbea01e380c5e754a96647b82/jbpm-bpmn2-emfextmodel/src/main/java/org/omg/spec/bpmn/non/normative/color/impl/ColorPackageImpl.java#L253-L286 |
UrielCh/ovh-java-sdk | ovh-java-sdk-dedicatedCloud/src/main/java/net/minidev/ovh/api/ApiOvhDedicatedCloud.java | ApiOvhDedicatedCloud.serviceName_vmEncryption_kms_kmsId_changeProperties_POST | public OvhTask serviceName_vmEncryption_kms_kmsId_changeProperties_POST(String serviceName, Long kmsId, String description, String sslThumbprint) throws IOException {
"""
Change option user access properties
REST: POST /dedicatedCloud/{serviceName}/vmEncryption/kms/{kmsId}/changeProperties
@param sslThumbprint... | java | public OvhTask serviceName_vmEncryption_kms_kmsId_changeProperties_POST(String serviceName, Long kmsId, String description, String sslThumbprint) throws IOException {
String qPath = "/dedicatedCloud/{serviceName}/vmEncryption/kms/{kmsId}/changeProperties";
StringBuilder sb = path(qPath, serviceName, kmsId);
HashM... | [
"public",
"OvhTask",
"serviceName_vmEncryption_kms_kmsId_changeProperties_POST",
"(",
"String",
"serviceName",
",",
"Long",
"kmsId",
",",
"String",
"description",
",",
"String",
"sslThumbprint",
")",
"throws",
"IOException",
"{",
"String",
"qPath",
"=",
"\"/dedicatedCloud... | Change option user access properties
REST: POST /dedicatedCloud/{serviceName}/vmEncryption/kms/{kmsId}/changeProperties
@param sslThumbprint [required] SSL thumbprint of the remote service, e.g. A7:61:68:...:61:91:2F
@param description [required] Description of your option access network
@param serviceName [required] ... | [
"Change",
"option",
"user",
"access",
"properties"
] | train | https://github.com/UrielCh/ovh-java-sdk/blob/6d531a40e56e09701943e334c25f90f640c55701/ovh-java-sdk-dedicatedCloud/src/main/java/net/minidev/ovh/api/ApiOvhDedicatedCloud.java#L590-L598 |
mangstadt/biweekly | src/main/java/biweekly/util/com/google/ical/iter/Util.java | Util.invertWeekdayNum | static int invertWeekdayNum(ByDay weekdayNum, DayOfWeek dow0, int nDays) {
"""
<p>
Converts a relative week number (such as {@code -1SU}) to an absolute
week number.
</p>
<p>
For example, the week number {@code -1SU} refers to the last Sunday of
either the month or year (depending on how this method was call... | java | static int invertWeekdayNum(ByDay weekdayNum, DayOfWeek dow0, int nDays) {
//how many are there of that week?
return countInPeriod(weekdayNum.getDay(), dow0, nDays) + weekdayNum.getNum() + 1;
} | [
"static",
"int",
"invertWeekdayNum",
"(",
"ByDay",
"weekdayNum",
",",
"DayOfWeek",
"dow0",
",",
"int",
"nDays",
")",
"{",
"//how many are there of that week?",
"return",
"countInPeriod",
"(",
"weekdayNum",
".",
"getDay",
"(",
")",
",",
"dow0",
",",
"nDays",
")",... | <p>
Converts a relative week number (such as {@code -1SU}) to an absolute
week number.
</p>
<p>
For example, the week number {@code -1SU} refers to the last Sunday of
either the month or year (depending on how this method was called). So if
there are 5 Sundays in the given period, then given a week number of
{@code -1S... | [
"<p",
">",
"Converts",
"a",
"relative",
"week",
"number",
"(",
"such",
"as",
"{"
] | train | https://github.com/mangstadt/biweekly/blob/2e21350f85c13dfff52fdef98fdbebe2976fcf61/src/main/java/biweekly/util/com/google/ical/iter/Util.java#L138-L141 |
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.listQueryResultsForResourceGroupLevelPolicyAssignment | public PolicyStatesQueryResultsInner listQueryResultsForResourceGroupLevelPolicyAssignment(PolicyStatesResource policyStatesResource, String subscriptionId, String resourceGroupName, String policyAssignmentName, QueryOptions queryOptions) {
"""
Queries policy states for the resource group level policy assignment.
... | java | public PolicyStatesQueryResultsInner listQueryResultsForResourceGroupLevelPolicyAssignment(PolicyStatesResource policyStatesResource, String subscriptionId, String resourceGroupName, String policyAssignmentName, QueryOptions queryOptions) {
return listQueryResultsForResourceGroupLevelPolicyAssignmentWithService... | [
"public",
"PolicyStatesQueryResultsInner",
"listQueryResultsForResourceGroupLevelPolicyAssignment",
"(",
"PolicyStatesResource",
"policyStatesResource",
",",
"String",
"subscriptionId",
",",
"String",
"resourceGroupName",
",",
"String",
"policyAssignmentName",
",",
"QueryOptions",
... | Queries policy states for the resource group level policy assignment.
@param policyStatesResource The virtual resource under PolicyStates resource type. In a given time range, 'latest' represents the latest policy state(s), whereas 'default' represents all policy state(s). Possible values include: 'default', 'latest'
... | [
"Queries",
"policy",
"states",
"for",
"the",
"resource",
"group",
"level",
"policy",
"assignment",
"."
] | 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#L2980-L2982 |
QSFT/Doradus | doradus-client/src/main/java/com/dell/doradus/client/SSLTransportParameters.java | SSLTransportParameters.setTrustStore | public void setTrustStore(String trustStore, String trustPass, String trustManagerType, String trustStoreType) {
"""
Set the truststore, password, certificate type and the store type
@param trustStore Location of the Truststore on disk
@param trustPass Truststore password
@param trustManagerType The default i... | java | public void setTrustStore(String trustStore, String trustPass, String trustManagerType, String trustStoreType)
{
if((trustStore == null) || (trustPass == null))
{
this.trustStore = System.getProperty("javax.net.ssl.trustStore");
this.trustPass = System.getProperty("ja... | [
"public",
"void",
"setTrustStore",
"(",
"String",
"trustStore",
",",
"String",
"trustPass",
",",
"String",
"trustManagerType",
",",
"String",
"trustStoreType",
")",
"{",
"if",
"(",
"(",
"trustStore",
"==",
"null",
")",
"||",
"(",
"trustPass",
"==",
"null",
"... | Set the truststore, password, certificate type and the store type
@param trustStore Location of the Truststore on disk
@param trustPass Truststore password
@param trustManagerType The default is X509
@param trustStoreType The default is JKS | [
"Set",
"the",
"truststore",
"password",
"certificate",
"type",
"and",
"the",
"store",
"type"
] | train | https://github.com/QSFT/Doradus/blob/ad64d3c37922eefda68ec8869ef089c1ca604b70/doradus-client/src/main/java/com/dell/doradus/client/SSLTransportParameters.java#L226-L246 |
google/j2objc | xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xpath/axes/WalkingIterator.java | WalkingIterator.fixupVariables | public void fixupVariables(java.util.Vector vars, int globalsSize) {
"""
This function is used to fixup variables from QNames to stack frame
indexes at stylesheet build time.
@param vars List of QNames that correspond to variables. This list
should be searched backwards for the first qualified name that
corre... | java | public void fixupVariables(java.util.Vector vars, int globalsSize)
{
m_predicateIndex = -1;
AxesWalker walker = m_firstWalker;
while (null != walker)
{
walker.fixupVariables(vars, globalsSize);
walker = walker.getNextWalker();
}
} | [
"public",
"void",
"fixupVariables",
"(",
"java",
".",
"util",
".",
"Vector",
"vars",
",",
"int",
"globalsSize",
")",
"{",
"m_predicateIndex",
"=",
"-",
"1",
";",
"AxesWalker",
"walker",
"=",
"m_firstWalker",
";",
"while",
"(",
"null",
"!=",
"walker",
")",
... | This function is used to fixup variables from QNames to stack frame
indexes at stylesheet build time.
@param vars List of QNames that correspond to variables. This list
should be searched backwards for the first qualified name that
corresponds to the variable reference qname. The position of the
QName in the vector f... | [
"This",
"function",
"is",
"used",
"to",
"fixup",
"variables",
"from",
"QNames",
"to",
"stack",
"frame",
"indexes",
"at",
"stylesheet",
"build",
"time",
"."
] | train | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xpath/axes/WalkingIterator.java#L286-L297 |
google/closure-compiler | src/com/google/javascript/jscomp/parsing/TypeTransformationParser.java | TypeTransformationParser.validTemplateTypeExpression | private boolean validTemplateTypeExpression(Node expr) {
"""
A template type expression must be of the form type(typename, TTLExp,...)
or type(typevar, TTLExp...)
"""
// The expression must have at least three children the type keyword,
// a type name (or type variable) and a type expression
if (!... | java | private boolean validTemplateTypeExpression(Node expr) {
// The expression must have at least three children the type keyword,
// a type name (or type variable) and a type expression
if (!checkParameterCount(expr, Keywords.TYPE)) {
return false;
}
int paramCount = getCallParamCount(expr);
... | [
"private",
"boolean",
"validTemplateTypeExpression",
"(",
"Node",
"expr",
")",
"{",
"// The expression must have at least three children the type keyword,",
"// a type name (or type variable) and a type expression",
"if",
"(",
"!",
"checkParameterCount",
"(",
"expr",
",",
"Keywords... | A template type expression must be of the form type(typename, TTLExp,...)
or type(typevar, TTLExp...) | [
"A",
"template",
"type",
"expression",
"must",
"be",
"of",
"the",
"form",
"type",
"(",
"typename",
"TTLExp",
"...",
")",
"or",
"type",
"(",
"typevar",
"TTLExp",
"...",
")"
] | train | https://github.com/google/closure-compiler/blob/d81e36740f6a9e8ac31a825ee8758182e1dc5aae/src/com/google/javascript/jscomp/parsing/TypeTransformationParser.java#L292-L314 |
amaembo/streamex | src/main/java/one/util/streamex/DoubleStreamEx.java | DoubleStreamEx.of | public static DoubleStreamEx of(DoubleStream stream) {
"""
Returns a {@code DoubleStreamEx} object which wraps given
{@link DoubleStream}.
<p>
The supplied stream must not be consumed or closed when this method is
called. No operation must be performed on the supplied stream after it's
wrapped.
@param st... | java | public static DoubleStreamEx of(DoubleStream stream) {
return stream instanceof DoubleStreamEx ? (DoubleStreamEx) stream
: new DoubleStreamEx(stream, StreamContext.of(stream));
} | [
"public",
"static",
"DoubleStreamEx",
"of",
"(",
"DoubleStream",
"stream",
")",
"{",
"return",
"stream",
"instanceof",
"DoubleStreamEx",
"?",
"(",
"DoubleStreamEx",
")",
"stream",
":",
"new",
"DoubleStreamEx",
"(",
"stream",
",",
"StreamContext",
".",
"of",
"(",... | Returns a {@code DoubleStreamEx} object which wraps given
{@link DoubleStream}.
<p>
The supplied stream must not be consumed or closed when this method is
called. No operation must be performed on the supplied stream after it's
wrapped.
@param stream original stream
@return the wrapped stream
@since 0.0.8 | [
"Returns",
"a",
"{",
"@code",
"DoubleStreamEx",
"}",
"object",
"which",
"wraps",
"given",
"{",
"@link",
"DoubleStream",
"}",
"."
] | train | https://github.com/amaembo/streamex/blob/936bbd1b7dfbcf64a3b990682bfc848213441d14/src/main/java/one/util/streamex/DoubleStreamEx.java#L1607-L1610 |
io7m/jproperties | com.io7m.jproperties.core/src/main/java/com/io7m/jproperties/JProperties.java | JProperties.getBigDecimalOptional | public static BigDecimal getBigDecimalOptional(
final Properties properties,
final String key,
final BigDecimal other)
throws
JPropertyIncorrectType {
"""
<p> Returns the real value associated with {@code key} in the
properties referenced by {@code properties} if it exists, otherwise
returns ... | java | public static BigDecimal getBigDecimalOptional(
final Properties properties,
final String key,
final BigDecimal other)
throws
JPropertyIncorrectType
{
Objects.requireNonNull(properties, "Properties");
Objects.requireNonNull(key, "Key");
Objects.requireNonNull(other, "Default");
fi... | [
"public",
"static",
"BigDecimal",
"getBigDecimalOptional",
"(",
"final",
"Properties",
"properties",
",",
"final",
"String",
"key",
",",
"final",
"BigDecimal",
"other",
")",
"throws",
"JPropertyIncorrectType",
"{",
"Objects",
".",
"requireNonNull",
"(",
"properties",
... | <p> Returns the real value associated with {@code key} in the
properties referenced by {@code properties} if it exists, otherwise
returns the given default value. </p>
@param other The default value
@param properties The loaded properties.
@param key The requested key.
@return The value associated with th... | [
"<p",
">",
"Returns",
"the",
"real",
"value",
"associated",
"with",
"{",
"@code",
"key",
"}",
"in",
"the",
"properties",
"referenced",
"by",
"{",
"@code",
"properties",
"}",
"if",
"it",
"exists",
"otherwise",
"returns",
"the",
"given",
"default",
"value",
... | train | https://github.com/io7m/jproperties/blob/b188b8fd87b3b078f1e2b564a9ed5996db0becfd/com.io7m.jproperties.core/src/main/java/com/io7m/jproperties/JProperties.java#L107-L123 |
apache/incubator-heron | heron/packing/src/java/org/apache/heron/packing/roundrobin/RoundRobinPacking.java | RoundRobinPacking.repack | @Override
public PackingPlan repack(PackingPlan currentPackingPlan, int containers, Map<String, Integer>
componentChanges) throws PackingException {
"""
Read the current packing plan with update parallelism and number of containers
to calculate a new packing plan.
The packing algorithm packInternal() is ... | java | @Override
public PackingPlan repack(PackingPlan currentPackingPlan, int containers, Map<String, Integer>
componentChanges) throws PackingException {
if (containers == currentPackingPlan.getContainers().size()) {
return repack(currentPackingPlan, componentChanges);
}
Map<String, Integer> newCom... | [
"@",
"Override",
"public",
"PackingPlan",
"repack",
"(",
"PackingPlan",
"currentPackingPlan",
",",
"int",
"containers",
",",
"Map",
"<",
"String",
",",
"Integer",
">",
"componentChanges",
")",
"throws",
"PackingException",
"{",
"if",
"(",
"containers",
"==",
"cu... | Read the current packing plan with update parallelism and number of containers
to calculate a new packing plan.
The packing algorithm packInternal() is shared with pack()
delegate to packInternal() with the new container count and component parallelism
@param currentPackingPlan Existing packing plan
@param containers ... | [
"Read",
"the",
"current",
"packing",
"plan",
"with",
"update",
"parallelism",
"and",
"number",
"of",
"containers",
"to",
"calculate",
"a",
"new",
"packing",
"plan",
".",
"The",
"packing",
"algorithm",
"packInternal",
"()",
"is",
"shared",
"with",
"pack",
"()",... | train | https://github.com/apache/incubator-heron/blob/776abe2b5a45b93a0eb957fd65cbc149d901a92a/heron/packing/src/java/org/apache/heron/packing/roundrobin/RoundRobinPacking.java#L517-L526 |
sporniket/core | sporniket-core-lang/src/main/java/com/sporniket/libre/lang/DataTools.java | DataTools.appendByteAsPaddedHexString | @Deprecated
public static StringBuffer appendByteAsPaddedHexString(byte value, StringBuffer buffer) {
"""
Convert a byte into a padded hexadecimal string.
@param value
the value to convert.
@param buffer
the buffer to append the result into.
@return the updated buffer.
@deprecated use <code>buffer.append(... | java | @Deprecated
public static StringBuffer appendByteAsPaddedHexString(byte value, StringBuffer buffer)
{
return buffer.append(printHexBinary(new byte[] {value}).toLowerCase());
} | [
"@",
"Deprecated",
"public",
"static",
"StringBuffer",
"appendByteAsPaddedHexString",
"(",
"byte",
"value",
",",
"StringBuffer",
"buffer",
")",
"{",
"return",
"buffer",
".",
"append",
"(",
"printHexBinary",
"(",
"new",
"byte",
"[",
"]",
"{",
"value",
"}",
")",... | Convert a byte into a padded hexadecimal string.
@param value
the value to convert.
@param buffer
the buffer to append the result into.
@return the updated buffer.
@deprecated use <code>buffer.append(javax.xml.bind.DatatypeConverter.printHexBinary(new byte[] {value}).toLowerCase())</code> | [
"Convert",
"a",
"byte",
"into",
"a",
"padded",
"hexadecimal",
"string",
"."
] | train | https://github.com/sporniket/core/blob/3480ebd72a07422fcc09971be2607ee25efb2c26/sporniket-core-lang/src/main/java/com/sporniket/libre/lang/DataTools.java#L128-L132 |
rhuss/jolokia | agent/core/src/main/java/org/jolokia/restrictor/policy/MBeanAccessChecker.java | MBeanAccessChecker.extractMbeanConfiguration | private void extractMbeanConfiguration(NodeList pNodes,MBeanPolicyConfig pConfig) throws MalformedObjectNameException {
"""
Extract configuration and put it into a given MBeanPolicyConfig
"""
for (int i = 0;i< pNodes.getLength();i++) {
Node node = pNodes.item(i);
if (node.getNod... | java | private void extractMbeanConfiguration(NodeList pNodes,MBeanPolicyConfig pConfig) throws MalformedObjectNameException {
for (int i = 0;i< pNodes.getLength();i++) {
Node node = pNodes.item(i);
if (node.getNodeType() != Node.ELEMENT_NODE) {
continue;
}
... | [
"private",
"void",
"extractMbeanConfiguration",
"(",
"NodeList",
"pNodes",
",",
"MBeanPolicyConfig",
"pConfig",
")",
"throws",
"MalformedObjectNameException",
"{",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
"<",
"pNodes",
".",
"getLength",
"(",
")",
";",
"i",... | Extract configuration and put it into a given MBeanPolicyConfig | [
"Extract",
"configuration",
"and",
"put",
"it",
"into",
"a",
"given",
"MBeanPolicyConfig"
] | train | https://github.com/rhuss/jolokia/blob/dc95e7bef859b1829776c5a84c8f7738f5d7d9c3/agent/core/src/main/java/org/jolokia/restrictor/policy/MBeanAccessChecker.java#L103-L111 |
Stratio/deep-spark | deep-commons/src/main/java/com/stratio/deep/commons/utils/Utils.java | Utils.getExtractorInstance | public static <T, S extends BaseConfig> IExtractor<T, S> getExtractorInstance(S config) {
"""
Gets extractor instance.
@param config the config
@return the extractor instance
"""
try {
Class<T> rdd = (Class<T>) config.getExtractorImplClass();
if (rdd == null) {
... | java | public static <T, S extends BaseConfig> IExtractor<T, S> getExtractorInstance(S config) {
try {
Class<T> rdd = (Class<T>) config.getExtractorImplClass();
if (rdd == null) {
rdd = (Class<T>) Class.forName(config.getExtractorImplClassName());
}
Cons... | [
"public",
"static",
"<",
"T",
",",
"S",
"extends",
"BaseConfig",
">",
"IExtractor",
"<",
"T",
",",
"S",
">",
"getExtractorInstance",
"(",
"S",
"config",
")",
"{",
"try",
"{",
"Class",
"<",
"T",
">",
"rdd",
"=",
"(",
"Class",
"<",
"T",
">",
")",
"... | Gets extractor instance.
@param config the config
@return the extractor instance | [
"Gets",
"extractor",
"instance",
"."
] | train | https://github.com/Stratio/deep-spark/blob/b9621c9b7a6d996f80fce1d073d696a157bed095/deep-commons/src/main/java/com/stratio/deep/commons/utils/Utils.java#L381-L403 |
fhussonnois/storm-trident-elasticsearch | src/main/java/com/github/fhuss/storm/elasticsearch/mapper/impl/DefaultTupleMapper.java | DefaultTupleMapper.newObjectDefaultTupleMapper | public static final DefaultTupleMapper newObjectDefaultTupleMapper( ) {
"""
Returns a new {@link DefaultTupleMapper} that accept Object as source field value.
"""
final ObjectMapper mapper = new ObjectMapper();
return new DefaultTupleMapper(new TupleMapper<String>() {
@Override
... | java | public static final DefaultTupleMapper newObjectDefaultTupleMapper( ) {
final ObjectMapper mapper = new ObjectMapper();
return new DefaultTupleMapper(new TupleMapper<String>() {
@Override
public String map(Tuple input) {
try {
return mapper.wri... | [
"public",
"static",
"final",
"DefaultTupleMapper",
"newObjectDefaultTupleMapper",
"(",
")",
"{",
"final",
"ObjectMapper",
"mapper",
"=",
"new",
"ObjectMapper",
"(",
")",
";",
"return",
"new",
"DefaultTupleMapper",
"(",
"new",
"TupleMapper",
"<",
"String",
">",
"("... | Returns a new {@link DefaultTupleMapper} that accept Object as source field value. | [
"Returns",
"a",
"new",
"{"
] | train | https://github.com/fhussonnois/storm-trident-elasticsearch/blob/1788157efff223800a92f17f79deb02c905230f7/src/main/java/com/github/fhuss/storm/elasticsearch/mapper/impl/DefaultTupleMapper.java#L79-L91 |
igniterealtime/Smack | smack-openpgp/src/main/java/org/jivesoftware/smackx/ox_im/OXInstantMessagingManager.java | OXInstantMessagingManager.sendOxMessage | public OpenPgpMetadata sendOxMessage(OpenPgpContact contact, CharSequence body)
throws InterruptedException, IOException,
SmackException.NotConnectedException, SmackException.NotLoggedInException, PGPException {
"""
Send an OX message to a {@link OpenPgpContact}. The message will be encrypt... | java | public OpenPgpMetadata sendOxMessage(OpenPgpContact contact, CharSequence body)
throws InterruptedException, IOException,
SmackException.NotConnectedException, SmackException.NotLoggedInException, PGPException {
Message message = new Message(contact.getJid());
Message.Body mBody ... | [
"public",
"OpenPgpMetadata",
"sendOxMessage",
"(",
"OpenPgpContact",
"contact",
",",
"CharSequence",
"body",
")",
"throws",
"InterruptedException",
",",
"IOException",
",",
"SmackException",
".",
"NotConnectedException",
",",
"SmackException",
".",
"NotLoggedInException",
... | Send an OX message to a {@link OpenPgpContact}. The message will be encrypted to all active keys of the contact,
as well as all of our active keys. The message is also signed with our key.
@param contact contact capable of OpenPGP for XMPP: Instant Messaging.
@param body message body.
@return {@link OpenPgpMetadata} ... | [
"Send",
"an",
"OX",
"message",
"to",
"a",
"{",
"@link",
"OpenPgpContact",
"}",
".",
"The",
"message",
"will",
"be",
"encrypted",
"to",
"all",
"active",
"keys",
"of",
"the",
"contact",
"as",
"well",
"as",
"all",
"of",
"our",
"active",
"keys",
".",
"The"... | train | https://github.com/igniterealtime/Smack/blob/870756997faec1e1bfabfac0cd6c2395b04da873/smack-openpgp/src/main/java/org/jivesoftware/smackx/ox_im/OXInstantMessagingManager.java#L227-L238 |
dwdyer/uncommons-maths | demo/src/java/main/org/uncommons/swing/SwingBackgroundTask.java | SwingBackgroundTask.execute | public void execute() {
"""
Asynchronous call that begins execution of the task
and returns immediately.
"""
Runnable task = new Runnable()
{
public void run()
{
final V result = performTask();
SwingUtilities.invokeLater(new Runnable()
... | java | public void execute()
{
Runnable task = new Runnable()
{
public void run()
{
final V result = performTask();
SwingUtilities.invokeLater(new Runnable()
{
public void run()
{
... | [
"public",
"void",
"execute",
"(",
")",
"{",
"Runnable",
"task",
"=",
"new",
"Runnable",
"(",
")",
"{",
"public",
"void",
"run",
"(",
")",
"{",
"final",
"V",
"result",
"=",
"performTask",
"(",
")",
";",
"SwingUtilities",
".",
"invokeLater",
"(",
"new",
... | Asynchronous call that begins execution of the task
and returns immediately. | [
"Asynchronous",
"call",
"that",
"begins",
"execution",
"of",
"the",
"task",
"and",
"returns",
"immediately",
"."
] | train | https://github.com/dwdyer/uncommons-maths/blob/b7ba13aea70625bb7f37c856783a29e17e354964/demo/src/java/main/org/uncommons/swing/SwingBackgroundTask.java#L49-L67 |
mikepenz/FastAdapter | library/src/main/java/com/mikepenz/fastadapter/commons/utils/FastAdapterUIUtils.java | FastAdapterUIUtils.getRippleMask | private static Drawable getRippleMask(int color, int radius) {
"""
helper to create an ripple mask with the given color and radius
@param color the color
@param radius the radius
@return the mask drawable
"""
float[] outerRadius = new float[8];
Arrays.fill(outerRadius, radius);
Ro... | java | private static Drawable getRippleMask(int color, int radius) {
float[] outerRadius = new float[8];
Arrays.fill(outerRadius, radius);
RoundRectShape r = new RoundRectShape(outerRadius, null, null);
ShapeDrawable shapeDrawable = new ShapeDrawable(r);
shapeDrawable.getPaint().setCol... | [
"private",
"static",
"Drawable",
"getRippleMask",
"(",
"int",
"color",
",",
"int",
"radius",
")",
"{",
"float",
"[",
"]",
"outerRadius",
"=",
"new",
"float",
"[",
"8",
"]",
";",
"Arrays",
".",
"fill",
"(",
"outerRadius",
",",
"radius",
")",
";",
"Round... | helper to create an ripple mask with the given color and radius
@param color the color
@param radius the radius
@return the mask drawable | [
"helper",
"to",
"create",
"an",
"ripple",
"mask",
"with",
"the",
"given",
"color",
"and",
"radius"
] | train | https://github.com/mikepenz/FastAdapter/blob/3b2412abe001ba58422e0125846b704d4dba4ae9/library/src/main/java/com/mikepenz/fastadapter/commons/utils/FastAdapterUIUtils.java#L117-L124 |
fuinorg/utils4j | src/main/java/org/fuin/utils4j/Utils4J.java | Utils4J.getResource | public static URL getResource(final Class<?> clasz, final String name) {
"""
Get the path to a resource located in the same package as a given class.
@param clasz
Class with the same package where the resource is located - Cannot be <code>null</code>.
@param name
Filename of the resource - Cannot be <code>nu... | java | public static URL getResource(final Class<?> clasz, final String name) {
checkNotNull("clasz", clasz);
checkNotNull("name", name);
final String nameAndPath = SLASH + getPackagePath(clasz) + SLASH + name;
return clasz.getResource(nameAndPath);
} | [
"public",
"static",
"URL",
"getResource",
"(",
"final",
"Class",
"<",
"?",
">",
"clasz",
",",
"final",
"String",
"name",
")",
"{",
"checkNotNull",
"(",
"\"clasz\"",
",",
"clasz",
")",
";",
"checkNotNull",
"(",
"\"name\"",
",",
"name",
")",
";",
"final",
... | Get the path to a resource located in the same package as a given class.
@param clasz
Class with the same package where the resource is located - Cannot be <code>null</code>.
@param name
Filename of the resource - Cannot be <code>null</code>.
@return Resource URL. | [
"Get",
"the",
"path",
"to",
"a",
"resource",
"located",
"in",
"the",
"same",
"package",
"as",
"a",
"given",
"class",
"."
] | train | https://github.com/fuinorg/utils4j/blob/71cf88e0a8d8ed67bbac513bf3cab165cd7e3280/src/main/java/org/fuin/utils4j/Utils4J.java#L133-L138 |
apptentive/apptentive-android | apptentive/src/main/java/com/apptentive/android/sdk/encryption/resolvers/KeyResolver18.java | KeyResolver18.loadSymmetricKey | private static @Nullable SecretKey loadSymmetricKey(Context context, KeyPair wrapperKey) throws NoSuchPaddingException,
NoSuchAlgorithmException,
... | java | private static @Nullable SecretKey loadSymmetricKey(Context context, KeyPair wrapperKey) throws NoSuchPaddingException,
NoSuchAlgorithmException,
... | [
"private",
"static",
"@",
"Nullable",
"SecretKey",
"loadSymmetricKey",
"(",
"Context",
"context",
",",
"KeyPair",
"wrapperKey",
")",
"throws",
"NoSuchPaddingException",
",",
"NoSuchAlgorithmException",
",",
"InvalidKeyException",
"{",
"String",
"encryptedSymmetricKey",
"=... | Attempts to load an existing symmetric key or return <code>null</code> if failed.
Multistep process:
1. Load and encrypted symmetric key data from the shared preferences.
2. Unwraps the key using <code>wrapperKey</code> | [
"Attempts",
"to",
"load",
"an",
"existing",
"symmetric",
"key",
"or",
"return",
"<code",
">",
"null<",
"/",
"code",
">",
"if",
"failed",
".",
"Multistep",
"process",
":",
"1",
".",
"Load",
"and",
"encrypted",
"symmetric",
"key",
"data",
"from",
"the",
"s... | train | https://github.com/apptentive/apptentive-android/blob/887c08d7bd5ae6488a90366dfb58f58938861a93/apptentive/src/main/java/com/apptentive/android/sdk/encryption/resolvers/KeyResolver18.java#L125-L134 |
softindex/datakernel | core-bytebuf/src/main/java/io/datakernel/bytebuf/ByteBuf.java | ByteBuf.isContentEqual | @Contract(pure = true)
public boolean isContentEqual(@NotNull ByteBuf other) {
"""
Checks if provided {@code ByteBuf} readable bytes are equal to the
readable bytes of the {@link #array}.
@param other {@code ByteBuf} to be compared with the {@link #array}
@return {@code true} if the {@code ByteBuf} is equal ... | java | @Contract(pure = true)
public boolean isContentEqual(@NotNull ByteBuf other) {
return isContentEqual(other.array, other.head, other.readRemaining());
} | [
"@",
"Contract",
"(",
"pure",
"=",
"true",
")",
"public",
"boolean",
"isContentEqual",
"(",
"@",
"NotNull",
"ByteBuf",
"other",
")",
"{",
"return",
"isContentEqual",
"(",
"other",
".",
"array",
",",
"other",
".",
"head",
",",
"other",
".",
"readRemaining",... | Checks if provided {@code ByteBuf} readable bytes are equal to the
readable bytes of the {@link #array}.
@param other {@code ByteBuf} to be compared with the {@link #array}
@return {@code true} if the {@code ByteBuf} is equal to the array,
otherwise {@code false} | [
"Checks",
"if",
"provided",
"{",
"@code",
"ByteBuf",
"}",
"readable",
"bytes",
"are",
"equal",
"to",
"the",
"readable",
"bytes",
"of",
"the",
"{",
"@link",
"#array",
"}",
"."
] | train | https://github.com/softindex/datakernel/blob/090ca1116416c14d463d49d275cb1daaafa69c56/core-bytebuf/src/main/java/io/datakernel/bytebuf/ByteBuf.java#L748-L751 |
camunda/camunda-bpm-jbehave | camunda-bpm-jbehave/src/main/java/org/camunda/bpm/data/Guards.java | Guards.checkIsSetGlobal | public static void checkIsSetGlobal(final DelegateExecution execution, final String variableName) {
"""
Checks, if a global variable with specified name is set.
@param execution
process execution.
@param variableName
name of the variable to check.
"""
Preconditions.checkArgument(variableName != null,... | java | public static void checkIsSetGlobal(final DelegateExecution execution, final String variableName) {
Preconditions.checkArgument(variableName != null, VARIABLE_SKIP_GUARDS);
final Object variable = execution.getVariable(variableName);
Preconditions.checkState(variable != null,
String.format("Conditi... | [
"public",
"static",
"void",
"checkIsSetGlobal",
"(",
"final",
"DelegateExecution",
"execution",
",",
"final",
"String",
"variableName",
")",
"{",
"Preconditions",
".",
"checkArgument",
"(",
"variableName",
"!=",
"null",
",",
"VARIABLE_SKIP_GUARDS",
")",
";",
"final"... | Checks, if a global variable with specified name is set.
@param execution
process execution.
@param variableName
name of the variable to check. | [
"Checks",
"if",
"a",
"global",
"variable",
"with",
"specified",
"name",
"is",
"set",
"."
] | train | https://github.com/camunda/camunda-bpm-jbehave/blob/ffad22471418e2c7f161f8976ca8a042114138ab/camunda-bpm-jbehave/src/main/java/org/camunda/bpm/data/Guards.java#L96-L102 |
Stratio/stratio-connector-commons | connector-commons/src/main/java/com/stratio/connector/commons/metadata/CatalogMetadataBuilder.java | CatalogMetadataBuilder.withOptions | @TimerJ
public CatalogMetadataBuilder withOptions(Map<Selector, Selector> opts) {
"""
Set the options. Any options previously created are removed.
@param opts the opts
@return the catalog metadata builder
"""
options = new HashMap<Selector, Selector>(opts);
return this;
} | java | @TimerJ
public CatalogMetadataBuilder withOptions(Map<Selector, Selector> opts) {
options = new HashMap<Selector, Selector>(opts);
return this;
} | [
"@",
"TimerJ",
"public",
"CatalogMetadataBuilder",
"withOptions",
"(",
"Map",
"<",
"Selector",
",",
"Selector",
">",
"opts",
")",
"{",
"options",
"=",
"new",
"HashMap",
"<",
"Selector",
",",
"Selector",
">",
"(",
"opts",
")",
";",
"return",
"this",
";",
... | Set the options. Any options previously created are removed.
@param opts the opts
@return the catalog metadata builder | [
"Set",
"the",
"options",
".",
"Any",
"options",
"previously",
"created",
"are",
"removed",
"."
] | train | https://github.com/Stratio/stratio-connector-commons/blob/d7cc66cb9591344a13055962e87a91f01c3707d1/connector-commons/src/main/java/com/stratio/connector/commons/metadata/CatalogMetadataBuilder.java#L82-L86 |
sarl/sarl | main/coreplugins/io.sarl.eclipse/src/io/sarl/eclipse/util/Jdt2Ecore.java | Jdt2Ecore.getAnnotation | public IAnnotation getAnnotation(IAnnotatable element, String qualifiedName) {
"""
Replies the annotation with the given qualified name.
@param element the annoted element.
@param qualifiedName the qualified name of the element.
@return the annotation, or <code>null</code> if the element is not annoted.
"... | java | public IAnnotation getAnnotation(IAnnotatable element, String qualifiedName) {
if (element != null) {
try {
final int separator = qualifiedName.lastIndexOf('.');
final String simpleName;
if (separator >= 0 && separator < (qualifiedName.length() - 1)) {
simpleName = qualifiedName.substring(separato... | [
"public",
"IAnnotation",
"getAnnotation",
"(",
"IAnnotatable",
"element",
",",
"String",
"qualifiedName",
")",
"{",
"if",
"(",
"element",
"!=",
"null",
")",
"{",
"try",
"{",
"final",
"int",
"separator",
"=",
"qualifiedName",
".",
"lastIndexOf",
"(",
"'",
"'"... | Replies the annotation with the given qualified name.
@param element the annoted element.
@param qualifiedName the qualified name of the element.
@return the annotation, or <code>null</code> if the element is not annoted. | [
"Replies",
"the",
"annotation",
"with",
"the",
"given",
"qualified",
"name",
"."
] | train | https://github.com/sarl/sarl/blob/ca00ff994598c730339972def4e19a60e0b8cace/main/coreplugins/io.sarl.eclipse/src/io/sarl/eclipse/util/Jdt2Ecore.java#L335-L356 |
hazelcast/hazelcast | hazelcast/src/main/java/com/hazelcast/config/cp/CPSubsystemConfig.java | CPSubsystemConfig.setLockConfigs | public CPSubsystemConfig setLockConfigs(Map<String, FencedLockConfig> lockConfigs) {
"""
Sets the map of {@link FencedLock} configurations, mapped by config
name. Names could optionally contain a {@link CPGroup} name, such as
"myLock@group1".
@param lockConfigs the {@link FencedLock} config map to set
@retur... | java | public CPSubsystemConfig setLockConfigs(Map<String, FencedLockConfig> lockConfigs) {
this.lockConfigs.clear();
this.lockConfigs.putAll(lockConfigs);
for (Entry<String, FencedLockConfig> entry : this.lockConfigs.entrySet()) {
entry.getValue().setName(entry.getKey());
}
... | [
"public",
"CPSubsystemConfig",
"setLockConfigs",
"(",
"Map",
"<",
"String",
",",
"FencedLockConfig",
">",
"lockConfigs",
")",
"{",
"this",
".",
"lockConfigs",
".",
"clear",
"(",
")",
";",
"this",
".",
"lockConfigs",
".",
"putAll",
"(",
"lockConfigs",
")",
";... | Sets the map of {@link FencedLock} configurations, mapped by config
name. Names could optionally contain a {@link CPGroup} name, such as
"myLock@group1".
@param lockConfigs the {@link FencedLock} config map to set
@return this config instance | [
"Sets",
"the",
"map",
"of",
"{",
"@link",
"FencedLock",
"}",
"configurations",
"mapped",
"by",
"config",
"name",
".",
"Names",
"could",
"optionally",
"contain",
"a",
"{",
"@link",
"CPGroup",
"}",
"name",
"such",
"as",
"myLock@group1",
"."
] | train | https://github.com/hazelcast/hazelcast/blob/8c4bc10515dbbfb41a33e0302c0caedf3cda1baf/hazelcast/src/main/java/com/hazelcast/config/cp/CPSubsystemConfig.java#L544-L551 |
js-lib-com/commons | src/main/java/js/converter/UrlConverter.java | UrlConverter.asObject | @Override
public <T> T asObject(String string, Class<T> valueType) throws ConverterException {
"""
Convert URL string representation into URL instance.
@throws ConverterException if given string is not a valid URL.
"""
// at this point value type is guaranteed to be URL
try {
return (T) new URL(... | java | @Override
public <T> T asObject(String string, Class<T> valueType) throws ConverterException {
// at this point value type is guaranteed to be URL
try {
return (T) new URL(string);
} catch (MalformedURLException e) {
throw new ConverterException(e.getMessage());
}
} | [
"@",
"Override",
"public",
"<",
"T",
">",
"T",
"asObject",
"(",
"String",
"string",
",",
"Class",
"<",
"T",
">",
"valueType",
")",
"throws",
"ConverterException",
"{",
"// at this point value type is guaranteed to be URL\r",
"try",
"{",
"return",
"(",
"T",
")",
... | Convert URL string representation into URL instance.
@throws ConverterException if given string is not a valid URL. | [
"Convert",
"URL",
"string",
"representation",
"into",
"URL",
"instance",
"."
] | train | https://github.com/js-lib-com/commons/blob/f8c64482142b163487745da74feb106f0765c16b/src/main/java/js/converter/UrlConverter.java#L23-L31 |
Azure/azure-sdk-for-java | labservices/resource-manager/v2018_10_15/src/main/java/com/microsoft/azure/management/labservices/v2018_10_15/implementation/EnvironmentSettingsInner.java | EnvironmentSettingsInner.getAsync | public Observable<EnvironmentSettingInner> getAsync(String resourceGroupName, String labAccountName, String labName, String environmentSettingName, String expand) {
"""
Get environment setting.
@param resourceGroupName The name of the resource group.
@param labAccountName The name of the lab Account.
@param l... | java | public Observable<EnvironmentSettingInner> getAsync(String resourceGroupName, String labAccountName, String labName, String environmentSettingName, String expand) {
return getWithServiceResponseAsync(resourceGroupName, labAccountName, labName, environmentSettingName, expand).map(new Func1<ServiceResponse<Enviro... | [
"public",
"Observable",
"<",
"EnvironmentSettingInner",
">",
"getAsync",
"(",
"String",
"resourceGroupName",
",",
"String",
"labAccountName",
",",
"String",
"labName",
",",
"String",
"environmentSettingName",
",",
"String",
"expand",
")",
"{",
"return",
"getWithServic... | Get environment setting.
@param resourceGroupName The name of the resource group.
@param labAccountName The name of the lab Account.
@param labName The name of the lab.
@param environmentSettingName The name of the environment Setting.
@param expand Specify the $expand query. Example: 'properties($select=publishingSta... | [
"Get",
"environment",
"setting",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/labservices/resource-manager/v2018_10_15/src/main/java/com/microsoft/azure/management/labservices/v2018_10_15/implementation/EnvironmentSettingsInner.java#L543-L550 |
OpenTSDB/opentsdb | src/tree/Tree.java | Tree.storeTree | public Deferred<Boolean> storeTree(final TSDB tsdb, final boolean overwrite) {
"""
Attempts to store the tree definition via a CompareAndSet call.
@param tsdb The TSDB to use for access
@param overwrite Whether or not tree data should be overwritten
@return True if the write was successful, false if an error oc... | java | public Deferred<Boolean> storeTree(final TSDB tsdb, final boolean overwrite) {
if (tree_id < 1 || tree_id > 65535) {
throw new IllegalArgumentException("Invalid Tree ID");
}
// if there aren't any changes, save time and bandwidth by not writing to
// storage
boolean has_changes = false;
... | [
"public",
"Deferred",
"<",
"Boolean",
">",
"storeTree",
"(",
"final",
"TSDB",
"tsdb",
",",
"final",
"boolean",
"overwrite",
")",
"{",
"if",
"(",
"tree_id",
"<",
"1",
"||",
"tree_id",
">",
"65535",
")",
"{",
"throw",
"new",
"IllegalArgumentException",
"(",
... | Attempts to store the tree definition via a CompareAndSet call.
@param tsdb The TSDB to use for access
@param overwrite Whether or not tree data should be overwritten
@return True if the write was successful, false if an error occurred
@throws IllegalArgumentException if the tree ID is missing or invalid
@throws HBaseE... | [
"Attempts",
"to",
"store",
"the",
"tree",
"definition",
"via",
"a",
"CompareAndSet",
"call",
"."
] | train | https://github.com/OpenTSDB/opentsdb/blob/3fc2d491c3c1ad397252c0a80203a69a3f9e3ef3/src/tree/Tree.java#L312-L375 |
linkedin/PalDB | paldb/src/main/java/com/linkedin/paldb/api/PalDB.java | PalDB.createReader | public static StoreReader createReader(File file, Configuration config) {
"""
Creates a store reader from the specified <code>file</code>.
<p>
The file must exists.
@param file a PalDB store file
@param config configuration
@return a store reader
"""
return StoreImpl.createReader(file, config);
} | java | public static StoreReader createReader(File file, Configuration config) {
return StoreImpl.createReader(file, config);
} | [
"public",
"static",
"StoreReader",
"createReader",
"(",
"File",
"file",
",",
"Configuration",
"config",
")",
"{",
"return",
"StoreImpl",
".",
"createReader",
"(",
"file",
",",
"config",
")",
";",
"}"
] | Creates a store reader from the specified <code>file</code>.
<p>
The file must exists.
@param file a PalDB store file
@param config configuration
@return a store reader | [
"Creates",
"a",
"store",
"reader",
"from",
"the",
"specified",
"<code",
">",
"file<",
"/",
"code",
">",
".",
"<p",
">",
"The",
"file",
"must",
"exists",
"."
] | train | https://github.com/linkedin/PalDB/blob/d05ccdd3f67855eb2675dbd82599f19aa7a9f650/paldb/src/main/java/com/linkedin/paldb/api/PalDB.java#L58-L60 |
yavijava/yavijava | src/main/java/com/vmware/vim25/mo/IoFilterManager.java | IoFilterManager.unInstallIoFilter_Task | public Task unInstallIoFilter_Task(String filterId, ComputeResource cluster) throws FilterInUse, InvalidArgument, InvalidState, NotFound, RuntimeFault, RemoteException {
"""
Uninstall an IO Filter on a compute resource. IO Filters can only be installed on a cluster.
@param filterId
- ID of the filter.
@param ... | java | public Task unInstallIoFilter_Task(String filterId, ComputeResource cluster) throws FilterInUse, InvalidArgument, InvalidState, NotFound, RuntimeFault, RemoteException {
return new Task(getServerConnection(), getVimService().uninstallIoFilter_Task(getMOR(), filterId, cluster.getMOR()));
} | [
"public",
"Task",
"unInstallIoFilter_Task",
"(",
"String",
"filterId",
",",
"ComputeResource",
"cluster",
")",
"throws",
"FilterInUse",
",",
"InvalidArgument",
",",
"InvalidState",
",",
"NotFound",
",",
"RuntimeFault",
",",
"RemoteException",
"{",
"return",
"new",
"... | Uninstall an IO Filter on a compute resource. IO Filters can only be installed on a cluster.
@param filterId
- ID of the filter.
@param cluster
- The compute resource to install the IO Filter on. "compRes" must be a cluster.
@return - This method returns a Task object with which to monitor the operation. The task is s... | [
"Uninstall",
"an",
"IO",
"Filter",
"on",
"a",
"compute",
"resource",
".",
"IO",
"Filters",
"can",
"only",
"be",
"installed",
"on",
"a",
"cluster",
"."
] | train | https://github.com/yavijava/yavijava/blob/27fd2c5826115782d5eeb934f86e3e39240179cd/src/main/java/com/vmware/vim25/mo/IoFilterManager.java#L208-L210 |
albfernandez/itext2 | src/main/java/com/lowagie/text/pdf/PdfStamper.java | PdfStamper.setEncryption | public void setEncryption(Certificate[] certs, int[] permissions, int encryptionType) throws DocumentException {
"""
Sets the certificate encryption options for this document. An array of one or more public certificates
must be provided together with an array of the same size for the permissions for each certific... | java | public void setEncryption(Certificate[] certs, int[] permissions, int encryptionType) throws DocumentException {
if (stamper.isAppend())
throw new DocumentException("Append mode does not support changing the encryption status.");
if (stamper.isContentWritten())
throw new Document... | [
"public",
"void",
"setEncryption",
"(",
"Certificate",
"[",
"]",
"certs",
",",
"int",
"[",
"]",
"permissions",
",",
"int",
"encryptionType",
")",
"throws",
"DocumentException",
"{",
"if",
"(",
"stamper",
".",
"isAppend",
"(",
")",
")",
"throw",
"new",
"Doc... | Sets the certificate encryption options for this document. An array of one or more public certificates
must be provided together with an array of the same size for the permissions for each certificate.
The open permissions for the document can be
AllowPrinting, AllowModifyContents, AllowCopy, AllowModifyAnnotations,
Al... | [
"Sets",
"the",
"certificate",
"encryption",
"options",
"for",
"this",
"document",
".",
"An",
"array",
"of",
"one",
"or",
"more",
"public",
"certificates",
"must",
"be",
"provided",
"together",
"with",
"an",
"array",
"of",
"the",
"same",
"size",
"for",
"the",... | train | https://github.com/albfernandez/itext2/blob/438fc1899367fd13dfdfa8dfdca9a3c1a7783b84/src/main/java/com/lowagie/text/pdf/PdfStamper.java#L346-L352 |
wwadge/bonecp | bonecp/src/main/java/com/jolbox/bonecp/PoolUtil.java | PoolUtil.fillLogParams | public static String fillLogParams(String sql, Map<Object, Object> logParams) {
"""
Returns sql statement used in this prepared statement together with the parameters.
@param sql base sql statement
@param logParams parameters to print out
@return returns printable statement
"""
StringBuilder result = new ... | java | public static String fillLogParams(String sql, Map<Object, Object> logParams) {
StringBuilder result = new StringBuilder();
Map<Object, Object> tmpLogParam = (logParams == null ? new HashMap<Object, Object>() : logParams);
Iterator<Object> it = tmpLogParam.values().iterator();
boolean inQuote = false;
boolea... | [
"public",
"static",
"String",
"fillLogParams",
"(",
"String",
"sql",
",",
"Map",
"<",
"Object",
",",
"Object",
">",
"logParams",
")",
"{",
"StringBuilder",
"result",
"=",
"new",
"StringBuilder",
"(",
")",
";",
"Map",
"<",
"Object",
",",
"Object",
">",
"t... | Returns sql statement used in this prepared statement together with the parameters.
@param sql base sql statement
@param logParams parameters to print out
@return returns printable statement | [
"Returns",
"sql",
"statement",
"used",
"in",
"this",
"prepared",
"statement",
"together",
"with",
"the",
"parameters",
"."
] | train | https://github.com/wwadge/bonecp/blob/74bc3287025fc137ca28909f0f7693edae37a15d/bonecp/src/main/java/com/jolbox/bonecp/PoolUtil.java#L46-L76 |
igniterealtime/Smack | smack-experimental/src/main/java/org/jivesoftware/smackx/eme/element/ExplicitMessageEncryptionElement.java | ExplicitMessageEncryptionElement.hasProtocol | public static boolean hasProtocol(Message message, String protocolNamespace) {
"""
Return true, if the {@code message} already contains an EME element with the specified {@code protocolNamespace}.
@param message message
@param protocolNamespace namespace
@return true if message has EME element for that namesp... | java | public static boolean hasProtocol(Message message, String protocolNamespace) {
List<ExtensionElement> extensionElements = message.getExtensions(
ExplicitMessageEncryptionElement.ELEMENT,
ExplicitMessageEncryptionElement.NAMESPACE);
for (ExtensionElement extensionElement ... | [
"public",
"static",
"boolean",
"hasProtocol",
"(",
"Message",
"message",
",",
"String",
"protocolNamespace",
")",
"{",
"List",
"<",
"ExtensionElement",
">",
"extensionElements",
"=",
"message",
".",
"getExtensions",
"(",
"ExplicitMessageEncryptionElement",
".",
"ELEME... | Return true, if the {@code message} already contains an EME element with the specified {@code protocolNamespace}.
@param message message
@param protocolNamespace namespace
@return true if message has EME element for that namespace, otherwise false | [
"Return",
"true",
"if",
"the",
"{",
"@code",
"message",
"}",
"already",
"contains",
"an",
"EME",
"element",
"with",
"the",
"specified",
"{",
"@code",
"protocolNamespace",
"}",
"."
] | train | https://github.com/igniterealtime/Smack/blob/870756997faec1e1bfabfac0cd6c2395b04da873/smack-experimental/src/main/java/org/jivesoftware/smackx/eme/element/ExplicitMessageEncryptionElement.java#L157-L170 |
ixa-ehu/kaflib | src/main/java/ixa/kaflib/KAFDocument.java | KAFDocument.newCategory | public Feature newCategory(String id, String lemma, List<Span<Term>> references) {
"""
Creates a new category. It receives it's ID as an argument. The category is added to the document.
@param id the ID of the category.
@param lemma the lemma of the category.
@param references different mentions (list of target... | java | public Feature newCategory(String id, String lemma, List<Span<Term>> references) {
idManager.updateCounter(AnnotationType.CATEGORY, id);
Feature newCategory = new Feature(id, lemma, references);
annotationContainer.add(newCategory, Layer.CATEGORIES, AnnotationType.CATEGORY);
return newCategory;
} | [
"public",
"Feature",
"newCategory",
"(",
"String",
"id",
",",
"String",
"lemma",
",",
"List",
"<",
"Span",
"<",
"Term",
">",
">",
"references",
")",
"{",
"idManager",
".",
"updateCounter",
"(",
"AnnotationType",
".",
"CATEGORY",
",",
"id",
")",
";",
"Fea... | Creates a new category. It receives it's ID as an argument. The category is added to the document.
@param id the ID of the category.
@param lemma the lemma of the category.
@param references different mentions (list of targets) to the same category.
@return a new coreference. | [
"Creates",
"a",
"new",
"category",
".",
"It",
"receives",
"it",
"s",
"ID",
"as",
"an",
"argument",
".",
"The",
"category",
"is",
"added",
"to",
"the",
"document",
"."
] | train | https://github.com/ixa-ehu/kaflib/blob/3921f55d9ae4621736a329418f6334fb721834b8/src/main/java/ixa/kaflib/KAFDocument.java#L927-L932 |
JOML-CI/JOML | src/org/joml/Vector2f.java | Vector2f.distanceSquared | public static float distanceSquared(float x1, float y1, float x2, float y2) {
"""
Return the squared distance between <code>(x1, y1)</code> and <code>(x2, y2)</code>.
@param x1
the x component of the first vector
@param y1
the y component of the first vector
@param x2
the x component of the second vector
... | java | public static float distanceSquared(float x1, float y1, float x2, float y2) {
float dx = x1 - x2;
float dy = y1 - y2;
return dx * dx + dy * dy;
} | [
"public",
"static",
"float",
"distanceSquared",
"(",
"float",
"x1",
",",
"float",
"y1",
",",
"float",
"x2",
",",
"float",
"y2",
")",
"{",
"float",
"dx",
"=",
"x1",
"-",
"x2",
";",
"float",
"dy",
"=",
"y1",
"-",
"y2",
";",
"return",
"dx",
"*",
"dx... | Return the squared distance between <code>(x1, y1)</code> and <code>(x2, y2)</code>.
@param x1
the x component of the first vector
@param y1
the y component of the first vector
@param x2
the x component of the second vector
@param y2
the y component of the second vector
@return the euclidean distance squared | [
"Return",
"the",
"squared",
"distance",
"between",
"<code",
">",
"(",
"x1",
"y1",
")",
"<",
"/",
"code",
">",
"and",
"<code",
">",
"(",
"x2",
"y2",
")",
"<",
"/",
"code",
">",
"."
] | train | https://github.com/JOML-CI/JOML/blob/ce2652fc236b42bda3875c591f8e6645048a678f/src/org/joml/Vector2f.java#L607-L611 |
sawano/java-commons | src/main/java/se/sawano/java/commons/lang/validate/AbstractValidate.java | AbstractValidate.isFalse | public void isFalse(final boolean expression, final String message, final long value) {
"""
<p>Validate that the argument condition is {@code false}; otherwise throwing an exception with the specified message. This method is useful when validating according to an arbitrary boolean
expression, such as validating a... | java | public void isFalse(final boolean expression, final String message, final long value) {
if (expression) {
fail(String.format(message, value));
}
} | [
"public",
"void",
"isFalse",
"(",
"final",
"boolean",
"expression",
",",
"final",
"String",
"message",
",",
"final",
"long",
"value",
")",
"{",
"if",
"(",
"expression",
")",
"{",
"fail",
"(",
"String",
".",
"format",
"(",
"message",
",",
"value",
")",
... | <p>Validate that the argument condition is {@code false}; otherwise throwing an exception with the specified message. This method is useful when validating according to an arbitrary boolean
expression, such as validating a primitive number or using your own custom validation expression.</p>
<pre>
Validate.isFalse(age &... | [
"<p",
">",
"Validate",
"that",
"the",
"argument",
"condition",
"is",
"{",
"@code",
"false",
"}",
";",
"otherwise",
"throwing",
"an",
"exception",
"with",
"the",
"specified",
"message",
".",
"This",
"method",
"is",
"useful",
"when",
"validating",
"according",
... | train | https://github.com/sawano/java-commons/blob/6f219c9e8dec4401dbe528d17ae6ec1ef9c0d284/src/main/java/se/sawano/java/commons/lang/validate/AbstractValidate.java#L406-L410 |
apache/spark | sql/core/src/main/java/org/apache/spark/sql/execution/vectorized/OffHeapColumnVector.java | OffHeapColumnVector.allocateColumns | public static OffHeapColumnVector[] allocateColumns(int capacity, StructField[] fields) {
"""
Allocates columns to store elements of each field off heap.
Capacity is the initial capacity of the vector and it will grow as necessary. Capacity is
in number of elements, not number of bytes.
"""
OffHeapColumn... | java | public static OffHeapColumnVector[] allocateColumns(int capacity, StructField[] fields) {
OffHeapColumnVector[] vectors = new OffHeapColumnVector[fields.length];
for (int i = 0; i < fields.length; i++) {
vectors[i] = new OffHeapColumnVector(capacity, fields[i].dataType());
}
return vectors;
} | [
"public",
"static",
"OffHeapColumnVector",
"[",
"]",
"allocateColumns",
"(",
"int",
"capacity",
",",
"StructField",
"[",
"]",
"fields",
")",
"{",
"OffHeapColumnVector",
"[",
"]",
"vectors",
"=",
"new",
"OffHeapColumnVector",
"[",
"fields",
".",
"length",
"]",
... | Allocates columns to store elements of each field off heap.
Capacity is the initial capacity of the vector and it will grow as necessary. Capacity is
in number of elements, not number of bytes. | [
"Allocates",
"columns",
"to",
"store",
"elements",
"of",
"each",
"field",
"off",
"heap",
".",
"Capacity",
"is",
"the",
"initial",
"capacity",
"of",
"the",
"vector",
"and",
"it",
"will",
"grow",
"as",
"necessary",
".",
"Capacity",
"is",
"in",
"number",
"of"... | train | https://github.com/apache/spark/blob/25ee0474f47d9c30d6f553a7892d9549f91071cf/sql/core/src/main/java/org/apache/spark/sql/execution/vectorized/OffHeapColumnVector.java#L50-L56 |
elki-project/elki | elki-gui-minigui/src/main/java/de/lmu/ifi/dbs/elki/gui/util/SavedSettingsFile.java | SavedSettingsFile.put | public void put(String key, ArrayList<String> value) {
"""
Add/Replace a saved setting
@param key Key
@param value (New) value.
"""
Iterator<Pair<String, ArrayList<String>>> it = store.iterator();
while (it.hasNext()) {
Pair<String, ArrayList<String>> pair = it.next();
if (key.equals(pa... | java | public void put(String key, ArrayList<String> value) {
Iterator<Pair<String, ArrayList<String>>> it = store.iterator();
while (it.hasNext()) {
Pair<String, ArrayList<String>> pair = it.next();
if (key.equals(pair.first)) {
pair.second = value;
return;
}
}
store.add(new ... | [
"public",
"void",
"put",
"(",
"String",
"key",
",",
"ArrayList",
"<",
"String",
">",
"value",
")",
"{",
"Iterator",
"<",
"Pair",
"<",
"String",
",",
"ArrayList",
"<",
"String",
">",
">",
">",
"it",
"=",
"store",
".",
"iterator",
"(",
")",
";",
"whi... | Add/Replace a saved setting
@param key Key
@param value (New) value. | [
"Add",
"/",
"Replace",
"a",
"saved",
"setting"
] | train | https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-gui-minigui/src/main/java/de/lmu/ifi/dbs/elki/gui/util/SavedSettingsFile.java#L168-L178 |
vkostyukov/la4j | src/main/java/org/la4j/matrix/ColumnMajorSparseMatrix.java | ColumnMajorSparseMatrix.from1DArray | public static ColumnMajorSparseMatrix from1DArray(int rows, int columns, double[] array) {
"""
Creates a new {@link ColumnMajorSparseMatrix} from the given 1D {@code array} with
compressing (copying) the underlying array.
"""
return CCSMatrix.from1DArray(rows, columns, array);
} | java | public static ColumnMajorSparseMatrix from1DArray(int rows, int columns, double[] array) {
return CCSMatrix.from1DArray(rows, columns, array);
} | [
"public",
"static",
"ColumnMajorSparseMatrix",
"from1DArray",
"(",
"int",
"rows",
",",
"int",
"columns",
",",
"double",
"[",
"]",
"array",
")",
"{",
"return",
"CCSMatrix",
".",
"from1DArray",
"(",
"rows",
",",
"columns",
",",
"array",
")",
";",
"}"
] | Creates a new {@link ColumnMajorSparseMatrix} from the given 1D {@code array} with
compressing (copying) the underlying array. | [
"Creates",
"a",
"new",
"{"
] | train | https://github.com/vkostyukov/la4j/blob/dd1b917caf9606399a49afa6b0d738934cd3a7b3/src/main/java/org/la4j/matrix/ColumnMajorSparseMatrix.java#L99-L101 |
MariaDB/mariadb-connector-j | src/main/java/org/mariadb/jdbc/MariaDbDatabaseMetaData.java | MariaDbDatabaseMetaData.getSuperTables | public ResultSet getSuperTables(String catalog, String schemaPattern, String tableNamePattern)
throws SQLException {
"""
Retrieves a description of the table hierarchies defined in a particular schema in this
database.
<P>Only supertable information for tables matching the catalog, schema and table name ... | java | public ResultSet getSuperTables(String catalog, String schemaPattern, String tableNamePattern)
throws SQLException {
String sql =
"SELECT ' ' TABLE_CAT, ' ' TABLE_SCHEM, ' ' TABLE_NAME, ' ' SUPERTABLE_NAME FROM DUAL WHERE 1=0";
return executeQuery(sql);
} | [
"public",
"ResultSet",
"getSuperTables",
"(",
"String",
"catalog",
",",
"String",
"schemaPattern",
",",
"String",
"tableNamePattern",
")",
"throws",
"SQLException",
"{",
"String",
"sql",
"=",
"\"SELECT ' ' TABLE_CAT, ' ' TABLE_SCHEM, ' ' TABLE_NAME, ' ' SUPERTABLE_NAME FROM DU... | Retrieves a description of the table hierarchies defined in a particular schema in this
database.
<P>Only supertable information for tables matching the catalog, schema and table name are
returned. The table name parameter may be a fully-qualified name, in which case, the catalog
and schemaPattern parameters are ignor... | [
"Retrieves",
"a",
"description",
"of",
"the",
"table",
"hierarchies",
"defined",
"in",
"a",
"particular",
"schema",
"in",
"this",
"database",
"."
] | train | https://github.com/MariaDB/mariadb-connector-j/blob/d148c7cd347c4680617be65d9e511b289d38a30b/src/main/java/org/mariadb/jdbc/MariaDbDatabaseMetaData.java#L2786-L2791 |
amzn/ion-java | src/com/amazon/ion/facet/Facets.java | Facets.asFacet | public static <T> T asFacet(Class<T> facetType, Faceted subject) {
"""
Returns a facet of the given subject if supported, returning null
otherwise.
<p>
This does not attempt to cast the subject to the requested type, since
the {@link Faceted} interface declares the intent to control the
conversion.
@return... | java | public static <T> T asFacet(Class<T> facetType, Faceted subject)
{
return subject == null ? null : subject.asFacet(facetType);
} | [
"public",
"static",
"<",
"T",
">",
"T",
"asFacet",
"(",
"Class",
"<",
"T",
">",
"facetType",
",",
"Faceted",
"subject",
")",
"{",
"return",
"subject",
"==",
"null",
"?",
"null",
":",
"subject",
".",
"asFacet",
"(",
"facetType",
")",
";",
"}"
] | Returns a facet of the given subject if supported, returning null
otherwise.
<p>
This does not attempt to cast the subject to the requested type, since
the {@link Faceted} interface declares the intent to control the
conversion.
@return the requested facet, or null if {@code subject} is null or if
subject doesn't supp... | [
"Returns",
"a",
"facet",
"of",
"the",
"given",
"subject",
"if",
"supported",
"returning",
"null",
"otherwise",
".",
"<p",
">",
"This",
"does",
"not",
"attempt",
"to",
"cast",
"the",
"subject",
"to",
"the",
"requested",
"type",
"since",
"the",
"{",
"@link",... | train | https://github.com/amzn/ion-java/blob/4ce1f0f58c6a5a8e42d0425ccdb36e38be3e2270/src/com/amazon/ion/facet/Facets.java#L44-L47 |
kuali/ojb-1.0.4 | src/xdoclet/java/src/xdoclet/modules/ojb/OjbTagsHandler.java | OjbTagsHandler.forAllValuePairs | public void forAllValuePairs(String template, Properties attributes) throws XDocletException {
"""
Processes the template for the comma-separated value pairs in an attribute of the current object on the specified level.
@param template The template
@param attributes The attributes of th... | java | public void forAllValuePairs(String template, Properties attributes) throws XDocletException
{
String name = attributes.getProperty(ATTRIBUTE_NAME, "attributes");
String defaultValue = attributes.getProperty(ATTRIBUTE_DEFAULT_RIGHT, "");
String attributePairs = getPropertyVal... | [
"public",
"void",
"forAllValuePairs",
"(",
"String",
"template",
",",
"Properties",
"attributes",
")",
"throws",
"XDocletException",
"{",
"String",
"name",
"=",
"attributes",
".",
"getProperty",
"(",
"ATTRIBUTE_NAME",
",",
"\"attributes\"",
")",
";",
"String",
"de... | Processes the template for the comma-separated value pairs in an attribute of the current object on the specified level.
@param template The template
@param attributes The attributes of the tag
@exception XDocletException if an error occurs
@doc.tag type="block"
@doc.param ... | [
"Processes",
"the",
"template",
"for",
"the",
"comma",
"-",
"separated",
"value",
"pairs",
"in",
"an",
"attribute",
"of",
"the",
"current",
"object",
"on",
"the",
"specified",
"level",
"."
] | train | https://github.com/kuali/ojb-1.0.4/blob/9a544372f67ce965f662cdc71609dd03683c8f04/src/xdoclet/java/src/xdoclet/modules/ojb/OjbTagsHandler.java#L1616-L1651 |
aws/aws-sdk-java | aws-java-sdk-servicediscovery/src/main/java/com/amazonaws/services/servicediscovery/model/Operation.java | Operation.withTargets | public Operation withTargets(java.util.Map<String, String> targets) {
"""
<p>
The name of the target entity that is associated with the operation:
</p>
<ul>
<li>
<p>
<b>NAMESPACE</b>: The namespace ID is returned in the <code>ResourceId</code> property.
</p>
</li>
<li>
<p>
<b>SERVICE</b>: The service ID... | java | public Operation withTargets(java.util.Map<String, String> targets) {
setTargets(targets);
return this;
} | [
"public",
"Operation",
"withTargets",
"(",
"java",
".",
"util",
".",
"Map",
"<",
"String",
",",
"String",
">",
"targets",
")",
"{",
"setTargets",
"(",
"targets",
")",
";",
"return",
"this",
";",
"}"
] | <p>
The name of the target entity that is associated with the operation:
</p>
<ul>
<li>
<p>
<b>NAMESPACE</b>: The namespace ID is returned in the <code>ResourceId</code> property.
</p>
</li>
<li>
<p>
<b>SERVICE</b>: The service ID is returned in the <code>ResourceId</code> property.
</p>
</li>
<li>
<p>
<b>INSTANCE</b>:... | [
"<p",
">",
"The",
"name",
"of",
"the",
"target",
"entity",
"that",
"is",
"associated",
"with",
"the",
"operation",
":",
"<",
"/",
"p",
">",
"<ul",
">",
"<li",
">",
"<p",
">",
"<b",
">",
"NAMESPACE<",
"/",
"b",
">",
":",
"The",
"namespace",
"ID",
... | train | https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-servicediscovery/src/main/java/com/amazonaws/services/servicediscovery/model/Operation.java#L1033-L1036 |
DDTH/ddth-commons | ddth-commons-core/src/main/java/com/github/ddth/commons/utils/TypesafeConfigUtils.java | TypesafeConfigUtils.getPeriod | public static Period getPeriod(Config config, String path) {
"""
Get a configuration as period (parses special strings like "1w"). Return {@code null}
if missing, wrong type or bad value.
@param config
@param path
@return
"""
try {
return config.getPeriod(path);
} catch (Confi... | java | public static Period getPeriod(Config config, String path) {
try {
return config.getPeriod(path);
} catch (ConfigException.Missing | ConfigException.WrongType | ConfigException.BadValue e) {
if (e instanceof ConfigException.WrongType || e instanceof ConfigException.BadValue) {
... | [
"public",
"static",
"Period",
"getPeriod",
"(",
"Config",
"config",
",",
"String",
"path",
")",
"{",
"try",
"{",
"return",
"config",
".",
"getPeriod",
"(",
"path",
")",
";",
"}",
"catch",
"(",
"ConfigException",
".",
"Missing",
"|",
"ConfigException",
".",... | Get a configuration as period (parses special strings like "1w"). Return {@code null}
if missing, wrong type or bad value.
@param config
@param path
@return | [
"Get",
"a",
"configuration",
"as",
"period",
"(",
"parses",
"special",
"strings",
"like",
"1w",
")",
".",
"Return",
"{",
"@code",
"null",
"}",
"if",
"missing",
"wrong",
"type",
"or",
"bad",
"value",
"."
] | train | https://github.com/DDTH/ddth-commons/blob/734f0e77321d41eeca78a557be9884df9874e46e/ddth-commons-core/src/main/java/com/github/ddth/commons/utils/TypesafeConfigUtils.java#L604-L613 |
OpenLiberty/open-liberty | dev/com.ibm.ws.container.service.compat/src/com/ibm/ws/util/ThreadContextAccessor.java | ThreadContextAccessor.repushContextClassLoader | public Object repushContextClassLoader(Object origLoader, ClassLoader loader) {
"""
Updates the context class loader of the current thread between calls to {@link #pushContextClassLoader} and {@link #popContextClassLoader}. If
the original class loader is {@link #UNCHANGED}, then this is equivalent
to {@link #pu... | java | public Object repushContextClassLoader(Object origLoader, ClassLoader loader) {
if (origLoader == UNCHANGED) {
return pushContextClassLoader(loader);
}
setContextClassLoader(Thread.currentThread(), loader);
return origLoader;
} | [
"public",
"Object",
"repushContextClassLoader",
"(",
"Object",
"origLoader",
",",
"ClassLoader",
"loader",
")",
"{",
"if",
"(",
"origLoader",
"==",
"UNCHANGED",
")",
"{",
"return",
"pushContextClassLoader",
"(",
"loader",
")",
";",
"}",
"setContextClassLoader",
"(... | Updates the context class loader of the current thread between calls to {@link #pushContextClassLoader} and {@link #popContextClassLoader}. If
the original class loader is {@link #UNCHANGED}, then this is equivalent
to {@link #pushContextClassLoader}). Otherwise, this is equivalent to {@link #setContextClassLoader}, an... | [
"Updates",
"the",
"context",
"class",
"loader",
"of",
"the",
"current",
"thread",
"between",
"calls",
"to",
"{",
"@link",
"#pushContextClassLoader",
"}",
"and",
"{",
"@link",
"#popContextClassLoader",
"}",
".",
"If",
"the",
"original",
"class",
"loader",
"is",
... | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.container.service.compat/src/com/ibm/ws/util/ThreadContextAccessor.java#L179-L186 |
apache/flink | flink-streaming-java/src/main/java/org/apache/flink/streaming/runtime/operators/GenericWriteAheadSink.java | GenericWriteAheadSink.saveHandleInState | private void saveHandleInState(final long checkpointId, final long timestamp) throws Exception {
"""
Called when a checkpoint barrier arrives. It closes any open streams to the backend
and marks them as pending for committing to the external, third-party storage system.
@param checkpointId the id of the latest... | java | private void saveHandleInState(final long checkpointId, final long timestamp) throws Exception {
//only add handle if a new OperatorState was created since the last snapshot
if (out != null) {
int subtaskIdx = getRuntimeContext().getIndexOfThisSubtask();
StreamStateHandle handle = out.closeAndGetHandle();
... | [
"private",
"void",
"saveHandleInState",
"(",
"final",
"long",
"checkpointId",
",",
"final",
"long",
"timestamp",
")",
"throws",
"Exception",
"{",
"//only add handle if a new OperatorState was created since the last snapshot",
"if",
"(",
"out",
"!=",
"null",
")",
"{",
"i... | Called when a checkpoint barrier arrives. It closes any open streams to the backend
and marks them as pending for committing to the external, third-party storage system.
@param checkpointId the id of the latest received checkpoint.
@throws IOException in case something went wrong when handling the stream to the backen... | [
"Called",
"when",
"a",
"checkpoint",
"barrier",
"arrives",
".",
"It",
"closes",
"any",
"open",
"streams",
"to",
"the",
"backend",
"and",
"marks",
"them",
"as",
"pending",
"for",
"committing",
"to",
"the",
"external",
"third",
"-",
"party",
"storage",
"system... | train | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-streaming-java/src/main/java/org/apache/flink/streaming/runtime/operators/GenericWriteAheadSink.java#L136-L155 |
exoplatform/jcr | exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/dataflow/persistent/LinkedWorkspaceStorageCacheImpl.java | LinkedWorkspaceStorageCacheImpl.removeSiblings | protected void removeSiblings(final NodeData node) {
"""
Remove sibling's subtrees from cache C, CN, CP.<br> For update (order-before) usecase.<br>
The work does remove of all descendants of the item parent. I.e. the node and its siblings (for
SNS case).<br>
"""
if (node.getIdentifier().equals(Constant... | java | protected void removeSiblings(final NodeData node)
{
if (node.getIdentifier().equals(Constants.ROOT_UUID))
{
return;
}
// remove child nodes of the item parent recursive
writeLock.lock();
try
{
// remove on-parent child nodes list
nodesCache.remov... | [
"protected",
"void",
"removeSiblings",
"(",
"final",
"NodeData",
"node",
")",
"{",
"if",
"(",
"node",
".",
"getIdentifier",
"(",
")",
".",
"equals",
"(",
"Constants",
".",
"ROOT_UUID",
")",
")",
"{",
"return",
";",
"}",
"// remove child nodes of the item paren... | Remove sibling's subtrees from cache C, CN, CP.<br> For update (order-before) usecase.<br>
The work does remove of all descendants of the item parent. I.e. the node and its siblings (for
SNS case).<br> | [
"Remove",
"sibling",
"s",
"subtrees",
"from",
"cache",
"C",
"CN",
"CP",
".",
"<br",
">",
"For",
"update",
"(",
"order",
"-",
"before",
")",
"usecase",
".",
"<br",
">",
"The",
"work",
"does",
"remove",
"of",
"all",
"descendants",
"of",
"the",
"item",
... | train | https://github.com/exoplatform/jcr/blob/3e7f9ee1b5683640d73a4316fb4b0ad5eac5b8a2/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/dataflow/persistent/LinkedWorkspaceStorageCacheImpl.java#L1810-L1865 |
UrielCh/ovh-java-sdk | ovh-java-sdk-paastimeseries/src/main/java/net/minidev/ovh/api/ApiOvhPaastimeseries.java | ApiOvhPaastimeseries.serviceName_PUT | public void serviceName_PUT(String serviceName, net.minidev.ovh.api.timeseries.OvhProject body) throws IOException {
"""
Alter this object properties
REST: PUT /paas/timeseries/{serviceName}
@param body [required] New object properties
@param serviceName [required] The internal name of your timeseries project... | java | public void serviceName_PUT(String serviceName, net.minidev.ovh.api.timeseries.OvhProject body) throws IOException {
String qPath = "/paas/timeseries/{serviceName}";
StringBuilder sb = path(qPath, serviceName);
exec(qPath, "PUT", sb.toString(), body);
} | [
"public",
"void",
"serviceName_PUT",
"(",
"String",
"serviceName",
",",
"net",
".",
"minidev",
".",
"ovh",
".",
"api",
".",
"timeseries",
".",
"OvhProject",
"body",
")",
"throws",
"IOException",
"{",
"String",
"qPath",
"=",
"\"/paas/timeseries/{serviceName}\"",
... | Alter this object properties
REST: PUT /paas/timeseries/{serviceName}
@param body [required] New object properties
@param serviceName [required] The internal name of your timeseries project
@deprecated | [
"Alter",
"this",
"object",
"properties"
] | train | https://github.com/UrielCh/ovh-java-sdk/blob/6d531a40e56e09701943e334c25f90f640c55701/ovh-java-sdk-paastimeseries/src/main/java/net/minidev/ovh/api/ApiOvhPaastimeseries.java#L228-L232 |
maven-nar/nar-maven-plugin | src/main/java/com/github/maven_nar/cpptasks/msvc/VisualStudioNETProjectWriter.java | VisualStudioNETProjectWriter.addAttribute | private static void addAttribute(final AttributesImpl attributes, final String attrName, final String attrValue) {
"""
Adds an non-namespace-qualified attribute to attribute list.
@param attributes
list of attributes.
@param attrName
attribute name, may not be null.
@param attrValue
attribute value, if nul... | java | private static void addAttribute(final AttributesImpl attributes, final String attrName, final String attrValue) {
if (attrName == null) {
throw new IllegalArgumentException("attrName");
}
if (attrValue != null) {
attributes.addAttribute(null, attrName, attrName, "#PCDATA", attrValue);
}
} | [
"private",
"static",
"void",
"addAttribute",
"(",
"final",
"AttributesImpl",
"attributes",
",",
"final",
"String",
"attrName",
",",
"final",
"String",
"attrValue",
")",
"{",
"if",
"(",
"attrName",
"==",
"null",
")",
"{",
"throw",
"new",
"IllegalArgumentException... | Adds an non-namespace-qualified attribute to attribute list.
@param attributes
list of attributes.
@param attrName
attribute name, may not be null.
@param attrValue
attribute value, if null attribute is not added. | [
"Adds",
"an",
"non",
"-",
"namespace",
"-",
"qualified",
"attribute",
"to",
"attribute",
"list",
"."
] | train | https://github.com/maven-nar/nar-maven-plugin/blob/3c622e2024296b4203431bbae3bde290a01dac00/src/main/java/com/github/maven_nar/cpptasks/msvc/VisualStudioNETProjectWriter.java#L65-L72 |
Impetus/Kundera | src/kundera-cassandra/cassandra-ds-driver/src/main/java/com/impetus/kundera/client/cassandra/dsdriver/DSClientUtilities.java | DSClientUtilities.setTextValue | private static Object setTextValue(Object entity, Field member, Object retVal) {
"""
Sets the text value.
@param entity
the entity
@param member
the member
@param retVal
the ret val
@return the object
"""
if (member != null && member.getType().isEnum())
{
EnumAccessor acces... | java | private static Object setTextValue(Object entity, Field member, Object retVal)
{
if (member != null && member.getType().isEnum())
{
EnumAccessor accessor = new EnumAccessor();
if (member != null)
{
retVal = accessor.fromString(member.getType(), (St... | [
"private",
"static",
"Object",
"setTextValue",
"(",
"Object",
"entity",
",",
"Field",
"member",
",",
"Object",
"retVal",
")",
"{",
"if",
"(",
"member",
"!=",
"null",
"&&",
"member",
".",
"getType",
"(",
")",
".",
"isEnum",
"(",
")",
")",
"{",
"EnumAcce... | Sets the text value.
@param entity
the entity
@param member
the member
@param retVal
the ret val
@return the object | [
"Sets",
"the",
"text",
"value",
"."
] | train | https://github.com/Impetus/Kundera/blob/268958ab1ec09d14ec4d9184f0c8ded7a9158908/src/kundera-cassandra/cassandra-ds-driver/src/main/java/com/impetus/kundera/client/cassandra/dsdriver/DSClientUtilities.java#L762-L778 |
akarnokd/akarnokd-xml | src/main/java/hu/akarnokd/xml/XNElement.java | XNElement.childValue | public String childValue(String name, String namespace) {
"""
Returns the content of the first child which has the given name.
@param name the child name
@param namespace the namespace URI
@return the content or null if no such child
"""
for (XNElement e : children) {
if (Objects.equals(... | java | public String childValue(String name, String namespace) {
for (XNElement e : children) {
if (Objects.equals(e.name, name) && Objects.equals(e.namespace, namespace)) {
return e.content;
}
}
return null;
} | [
"public",
"String",
"childValue",
"(",
"String",
"name",
",",
"String",
"namespace",
")",
"{",
"for",
"(",
"XNElement",
"e",
":",
"children",
")",
"{",
"if",
"(",
"Objects",
".",
"equals",
"(",
"e",
".",
"name",
",",
"name",
")",
"&&",
"Objects",
"."... | Returns the content of the first child which has the given name.
@param name the child name
@param namespace the namespace URI
@return the content or null if no such child | [
"Returns",
"the",
"content",
"of",
"the",
"first",
"child",
"which",
"has",
"the",
"given",
"name",
"."
] | train | https://github.com/akarnokd/akarnokd-xml/blob/57466a5a9cb455a13d7121557c165287b31ee870/src/main/java/hu/akarnokd/xml/XNElement.java#L495-L502 |
iig-uni-freiburg/SEWOL | ext/org/deckfour/xes/nikefs2/NikeFS2SwapFileManager.java | NikeFS2SwapFileManager.createSwapFile | public static synchronized File createSwapFile(String prefix, String suffix) throws IOException {
"""
Creates a new, empty swap file, ready for use. It is guaranteed
that this swap file will be removed from the system either on
JVM shutdown (Unix platforms) or on subsequent use of this class
(Win32 platforms).
... | java | public static synchronized File createSwapFile(String prefix, String suffix) throws IOException {
File swapDir = getSwapDir();
File tmpFile = File.createTempFile(prefix, suffix, swapDir);
return tmpFile;
} | [
"public",
"static",
"synchronized",
"File",
"createSwapFile",
"(",
"String",
"prefix",
",",
"String",
"suffix",
")",
"throws",
"IOException",
"{",
"File",
"swapDir",
"=",
"getSwapDir",
"(",
")",
";",
"File",
"tmpFile",
"=",
"File",
".",
"createTempFile",
"(",
... | Creates a new, empty swap file, ready for use. It is guaranteed
that this swap file will be removed from the system either on
JVM shutdown (Unix platforms) or on subsequent use of this class
(Win32 platforms).
@param prefix Prefix to be used for this swap file.
@param suffix Suffix to be used for this swap file.
@retur... | [
"Creates",
"a",
"new",
"empty",
"swap",
"file",
"ready",
"for",
"use",
".",
"It",
"is",
"guaranteed",
"that",
"this",
"swap",
"file",
"will",
"be",
"removed",
"from",
"the",
"system",
"either",
"on",
"JVM",
"shutdown",
"(",
"Unix",
"platforms",
")",
"or"... | train | https://github.com/iig-uni-freiburg/SEWOL/blob/e791cb07a6e62ecf837d760d58a25f32fbf6bbca/ext/org/deckfour/xes/nikefs2/NikeFS2SwapFileManager.java#L117-L121 |
igniterealtime/Smack | smack-core/src/main/java/org/jivesoftware/smack/sasl/SASLMechanism.java | SASLMechanism.authenticate | public void authenticate(String host, DomainBareJid serviceName, CallbackHandler cbh, EntityBareJid authzid, SSLSession sslSession)
throws SmackSaslException, NotConnectedException, InterruptedException {
"""
Builds and sends the <tt>auth</tt> stanza to the server. The callback handler will han... | java | public void authenticate(String host, DomainBareJid serviceName, CallbackHandler cbh, EntityBareJid authzid, SSLSession sslSession)
throws SmackSaslException, NotConnectedException, InterruptedException {
this.host = host;
this.serviceName = serviceName;
this.authorizationId ... | [
"public",
"void",
"authenticate",
"(",
"String",
"host",
",",
"DomainBareJid",
"serviceName",
",",
"CallbackHandler",
"cbh",
",",
"EntityBareJid",
"authzid",
",",
"SSLSession",
"sslSession",
")",
"throws",
"SmackSaslException",
",",
"NotConnectedException",
",",
"Inte... | Builds and sends the <tt>auth</tt> stanza to the server. The callback handler will handle
any additional information, such as the authentication ID or realm, if it is needed.
@param host the hostname where the user account resides.
@param serviceName the xmpp service location
@param cbh the CallbackHandler to... | [
"Builds",
"and",
"sends",
"the",
"<tt",
">",
"auth<",
"/",
"tt",
">",
"stanza",
"to",
"the",
"server",
".",
"The",
"callback",
"handler",
"will",
"handle",
"any",
"additional",
"information",
"such",
"as",
"the",
"authentication",
"ID",
"or",
"realm",
"if"... | train | https://github.com/igniterealtime/Smack/blob/870756997faec1e1bfabfac0cd6c2395b04da873/smack-core/src/main/java/org/jivesoftware/smack/sasl/SASLMechanism.java#L176-L185 |
JavaMoney/jsr354-ri-bp | src/main/java/org/javamoney/moneta/spi/base/BaseExchangeRateProvider.java | BaseExchangeRateProvider.isAvailable | public boolean isAvailable(CurrencyUnit base, CurrencyUnit term) {
"""
Checks if an {@link javax.money.convert.ExchangeRate} between two {@link javax.money.CurrencyUnit} is
available from this provider. This method should check, if a given rate
is <i>currently</i> defined.
@param base the base {@link javax.mo... | java | public boolean isAvailable(CurrencyUnit base, CurrencyUnit term){
return isAvailable(ConversionQueryBuilder.of().setBaseCurrency(base).setTermCurrency(term).build());
} | [
"public",
"boolean",
"isAvailable",
"(",
"CurrencyUnit",
"base",
",",
"CurrencyUnit",
"term",
")",
"{",
"return",
"isAvailable",
"(",
"ConversionQueryBuilder",
".",
"of",
"(",
")",
".",
"setBaseCurrency",
"(",
"base",
")",
".",
"setTermCurrency",
"(",
"term",
... | Checks if an {@link javax.money.convert.ExchangeRate} between two {@link javax.money.CurrencyUnit} is
available from this provider. This method should check, if a given rate
is <i>currently</i> defined.
@param base the base {@link javax.money.CurrencyUnit}
@param term the term {@link javax.money.CurrencyUnit}
@return ... | [
"Checks",
"if",
"an",
"{",
"@link",
"javax",
".",
"money",
".",
"convert",
".",
"ExchangeRate",
"}",
"between",
"two",
"{",
"@link",
"javax",
".",
"money",
".",
"CurrencyUnit",
"}",
"is",
"available",
"from",
"this",
"provider",
".",
"This",
"method",
"s... | train | https://github.com/JavaMoney/jsr354-ri-bp/blob/9c147ef5623d8032a6dc4c0e5eefdfb41641a9a2/src/main/java/org/javamoney/moneta/spi/base/BaseExchangeRateProvider.java#L106-L108 |
VoltDB/voltdb | src/hsqldb19b3/org/hsqldb_voltpatches/jdbc/JDBCResultSet.java | JDBCResultSet.getObject | public Object getObject(int columnIndex) throws SQLException {
"""
<!-- start generic documentation -->
<p>Gets the value of the designated column in the current row
of this <code>ResultSet</code> object as
an <code>Object</code> in the Java programming language.
<p>This method will return the value of the g... | java | public Object getObject(int columnIndex) throws SQLException {
checkColumn(columnIndex);
Type sourceType = resultMetaData.columnTypes[columnIndex - 1];
switch (sourceType.typeCode) {
case Types.SQL_DATE :
return getDate(columnIndex);
case Types.SQL_TIM... | [
"public",
"Object",
"getObject",
"(",
"int",
"columnIndex",
")",
"throws",
"SQLException",
"{",
"checkColumn",
"(",
"columnIndex",
")",
";",
"Type",
"sourceType",
"=",
"resultMetaData",
".",
"columnTypes",
"[",
"columnIndex",
"-",
"1",
"]",
";",
"switch",
"(",... | <!-- start generic documentation -->
<p>Gets the value of the designated column in the current row
of this <code>ResultSet</code> object as
an <code>Object</code> in the Java programming language.
<p>This method will return the value of the given column as a
Java object. The type of the Java object will be the defaul... | [
"<!",
"--",
"start",
"generic",
"documentation",
"--",
">",
"<p",
">",
"Gets",
"the",
"value",
"of",
"the",
"designated",
"column",
"in",
"the",
"current",
"row",
"of",
"this",
"<code",
">",
"ResultSet<",
"/",
"code",
">",
"object",
"as",
"an",
"<code",
... | train | https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/src/hsqldb19b3/org/hsqldb_voltpatches/jdbc/JDBCResultSet.java#L1504-L1540 |
looly/hulu | src/main/java/com/xiaoleilu/hulu/ActionContext.java | ActionContext.handle | protected static boolean handle(ServletRequest req, ServletResponse res) {
"""
注入ServletRequest 和 ServletResponse并处理请求
@param req ServletRequest
@param res ServletResponse
@return 是否处理成功
"""
return handler.handle((HttpServletRequest)req, (HttpServletResponse)res);
} | java | protected static boolean handle(ServletRequest req, ServletResponse res) {
return handler.handle((HttpServletRequest)req, (HttpServletResponse)res);
} | [
"protected",
"static",
"boolean",
"handle",
"(",
"ServletRequest",
"req",
",",
"ServletResponse",
"res",
")",
"{",
"return",
"handler",
".",
"handle",
"(",
"(",
"HttpServletRequest",
")",
"req",
",",
"(",
"HttpServletResponse",
")",
"res",
")",
";",
"}"
] | 注入ServletRequest 和 ServletResponse并处理请求
@param req ServletRequest
@param res ServletResponse
@return 是否处理成功 | [
"注入ServletRequest",
"和",
"ServletResponse并处理请求"
] | train | https://github.com/looly/hulu/blob/4072de684e2e2f28ac8a3a44c0d5a690b289ef28/src/main/java/com/xiaoleilu/hulu/ActionContext.java#L91-L93 |
alkacon/opencms-core | src/org/opencms/xml/page/CmsXmlPage.java | CmsXmlPage.setEnabled | public void setEnabled(String name, Locale locale, boolean isEnabled) {
"""
Sets the enabled flag of an already existing element.<p>
Note: if isEnabled is set to true, the attribute is removed
since true is the default
@param name name name of the element
@param locale locale of the element
@param isEnabl... | java | public void setEnabled(String name, Locale locale, boolean isEnabled) {
CmsXmlHtmlValue value = (CmsXmlHtmlValue)getValue(name, locale);
Element element = value.getElement();
Attribute enabled = element.attribute(ATTRIBUTE_ENABLED);
if (enabled == null) {
if (!isEnabled) {
... | [
"public",
"void",
"setEnabled",
"(",
"String",
"name",
",",
"Locale",
"locale",
",",
"boolean",
"isEnabled",
")",
"{",
"CmsXmlHtmlValue",
"value",
"=",
"(",
"CmsXmlHtmlValue",
")",
"getValue",
"(",
"name",
",",
"locale",
")",
";",
"Element",
"element",
"=",
... | Sets the enabled flag of an already existing element.<p>
Note: if isEnabled is set to true, the attribute is removed
since true is the default
@param name name name of the element
@param locale locale of the element
@param isEnabled enabled flag for the element | [
"Sets",
"the",
"enabled",
"flag",
"of",
"an",
"already",
"existing",
"element",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/xml/page/CmsXmlPage.java#L408-L423 |
davidmoten/rxjava-extras | src/main/java/com/github/davidmoten/rx/Transformers.java | Transformers.bufferWhile | public static final <T> Transformer<T, List<T>> bufferWhile(
Func1<? super T, Boolean> predicate) {
"""
Buffers the elements into continuous, non-overlapping Lists where the
boundary is determined by a predicate receiving each item, before or
after being buffered, and returns true to indicate a new b... | java | public static final <T> Transformer<T, List<T>> bufferWhile(
Func1<? super T, Boolean> predicate) {
return bufferWhile(predicate, 10);
} | [
"public",
"static",
"final",
"<",
"T",
">",
"Transformer",
"<",
"T",
",",
"List",
"<",
"T",
">",
">",
"bufferWhile",
"(",
"Func1",
"<",
"?",
"super",
"T",
",",
"Boolean",
">",
"predicate",
")",
"{",
"return",
"bufferWhile",
"(",
"predicate",
",",
"10... | Buffers the elements into continuous, non-overlapping Lists where the
boundary is determined by a predicate receiving each item, before or
after being buffered, and returns true to indicate a new buffer should
start.
<p>
The operator won't return an empty first or last buffer.
<dl>
<dt><b>Backpressure Support:</b></d... | [
"Buffers",
"the",
"elements",
"into",
"continuous",
"non",
"-",
"overlapping",
"Lists",
"where",
"the",
"boundary",
"is",
"determined",
"by",
"a",
"predicate",
"receiving",
"each",
"item",
"before",
"or",
"after",
"being",
"buffered",
"and",
"returns",
"true",
... | train | https://github.com/davidmoten/rxjava-extras/blob/a91d2ba7d454843250e0b0fce36084f9fb02a551/src/main/java/com/github/davidmoten/rx/Transformers.java#L1180-L1183 |
jbundle/osgi | core/src/main/java/org/jbundle/util/osgi/bundle/BaseBundleActivator.java | BaseBundleActivator.getService | public Object getService(String interfaceClassName, String serviceClassName, String versionRange, Dictionary<String,String> filter) {
"""
Convenience method to get the service for this implementation class.
@param interfaceClassName
@return
"""
return ClassServiceUtility.getClassService().getClassFin... | java | public Object getService(String interfaceClassName, String serviceClassName, String versionRange, Dictionary<String,String> filter)
{
return ClassServiceUtility.getClassService().getClassFinder(context).getClassBundleService(interfaceClassName, serviceClassName, versionRange, filter, -1);
} | [
"public",
"Object",
"getService",
"(",
"String",
"interfaceClassName",
",",
"String",
"serviceClassName",
",",
"String",
"versionRange",
",",
"Dictionary",
"<",
"String",
",",
"String",
">",
"filter",
")",
"{",
"return",
"ClassServiceUtility",
".",
"getClassService"... | Convenience method to get the service for this implementation class.
@param interfaceClassName
@return | [
"Convenience",
"method",
"to",
"get",
"the",
"service",
"for",
"this",
"implementation",
"class",
"."
] | train | https://github.com/jbundle/osgi/blob/beb02aef78736a4f799aaac001c8f0327bf0536c/core/src/main/java/org/jbundle/util/osgi/bundle/BaseBundleActivator.java#L284-L287 |
b3dgs/lionengine | lionengine-core/src/main/java/com/b3dgs/lionengine/graphic/filter/FilterBlur.java | FilterBlur.createKernel | private static Kernel createKernel(float radius, int width, int height) {
"""
Create a blur kernel.
@param radius The blur radius.
@param width The image width.
@param height The image height.
@return The blur kernel.
"""
final int r = (int) Math.ceil(radius);
final int rows = r * 2 + 1... | java | private static Kernel createKernel(float radius, int width, int height)
{
final int r = (int) Math.ceil(radius);
final int rows = r * 2 + 1;
final float[] matrix = new float[rows];
final float sigma = radius / 3;
final float sigma22 = 2 * sigma * sigma;
final f... | [
"private",
"static",
"Kernel",
"createKernel",
"(",
"float",
"radius",
",",
"int",
"width",
",",
"int",
"height",
")",
"{",
"final",
"int",
"r",
"=",
"(",
"int",
")",
"Math",
".",
"ceil",
"(",
"radius",
")",
";",
"final",
"int",
"rows",
"=",
"r",
"... | Create a blur kernel.
@param radius The blur radius.
@param width The image width.
@param height The image height.
@return The blur kernel. | [
"Create",
"a",
"blur",
"kernel",
"."
] | train | https://github.com/b3dgs/lionengine/blob/cac3d5578532cf11724a737b9f09e71bf9995ab2/lionengine-core/src/main/java/com/b3dgs/lionengine/graphic/filter/FilterBlur.java#L174-L210 |
m-m-m/util | pojo/src/main/java/net/sf/mmm/util/pojo/api/TypedProperty.java | TypedProperty.appendPath | public static void appendPath(StringBuilder buffer, String... segments) {
"""
This method {@link StringBuilder#append(String) appends} the {@link #getPojoPath() pojo property path}
specified by the given {@code segments} to the given {@code buffer}.
@param buffer is the {@link StringBuilder} to append to.
@pa... | java | public static void appendPath(StringBuilder buffer, String... segments) {
for (int i = 0; i < segments.length; i++) {
String s = segments[i];
if (i > 0) {
buffer.append(SEPARATOR);
}
buffer.append(s);
}
} | [
"public",
"static",
"void",
"appendPath",
"(",
"StringBuilder",
"buffer",
",",
"String",
"...",
"segments",
")",
"{",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
"<",
"segments",
".",
"length",
";",
"i",
"++",
")",
"{",
"String",
"s",
"=",
"segments"... | This method {@link StringBuilder#append(String) appends} the {@link #getPojoPath() pojo property path}
specified by the given {@code segments} to the given {@code buffer}.
@param buffer is the {@link StringBuilder} to append to.
@param segments are the path segments for the property. | [
"This",
"method",
"{",
"@link",
"StringBuilder#append",
"(",
"String",
")",
"appends",
"}",
"the",
"{",
"@link",
"#getPojoPath",
"()",
"pojo",
"property",
"path",
"}",
"specified",
"by",
"the",
"given",
"{",
"@code",
"segments",
"}",
"to",
"the",
"given",
... | train | https://github.com/m-m-m/util/blob/f0e4e084448f8dfc83ca682a9e1618034a094ce6/pojo/src/main/java/net/sf/mmm/util/pojo/api/TypedProperty.java#L256-L265 |
opencb/biodata | biodata-tools/src/main/java/org/opencb/biodata/tools/variant/converters/proto/VariantContextToVariantProtoConverter.java | VariantContextToVariantProtoConverter.setConsequenceTypeParams | private List<ConsequenceType> setConsequenceTypeParams() {
"""
method to set Consequence Type Parameters
@return consequenceTypeList
"""
List<ConsequenceType> consequenceTypeList = new ArrayList<>();
ConsequenceType.Builder consequenceType = ConsequenceType.newBuilder();
consequenceTy... | java | private List<ConsequenceType> setConsequenceTypeParams(){
List<ConsequenceType> consequenceTypeList = new ArrayList<>();
ConsequenceType.Builder consequenceType = ConsequenceType.newBuilder();
consequenceType.setGeneName(null);
consequenceType.setEnsemblGeneId(null);
consequence... | [
"private",
"List",
"<",
"ConsequenceType",
">",
"setConsequenceTypeParams",
"(",
")",
"{",
"List",
"<",
"ConsequenceType",
">",
"consequenceTypeList",
"=",
"new",
"ArrayList",
"<>",
"(",
")",
";",
"ConsequenceType",
".",
"Builder",
"consequenceType",
"=",
"Consequ... | method to set Consequence Type Parameters
@return consequenceTypeList | [
"method",
"to",
"set",
"Consequence",
"Type",
"Parameters"
] | train | https://github.com/opencb/biodata/blob/21b3d51d71f578efab908422aca4bab7a73097b1/biodata-tools/src/main/java/org/opencb/biodata/tools/variant/converters/proto/VariantContextToVariantProtoConverter.java#L224-L280 |
iipc/openwayback | wayback-core/src/main/java/org/archive/wayback/resourceindex/updater/LocalResourceIndexUpdater.java | LocalResourceIndexUpdater.init | public void init() throws ConfigurationException {
"""
start the background index merging thread
@throws ConfigurationException
"""
if(index == null) {
throw new ConfigurationException("No index target");
}
if(!index.isUpdatable()) {
throw new ConfigurationException("ResourceIndex is not updatable... | java | public void init() throws ConfigurationException {
if(index == null) {
throw new ConfigurationException("No index target");
}
if(!index.isUpdatable()) {
throw new ConfigurationException("ResourceIndex is not updatable");
}
if(incoming == null) {
throw new ConfigurationException("No incoming");
}... | [
"public",
"void",
"init",
"(",
")",
"throws",
"ConfigurationException",
"{",
"if",
"(",
"index",
"==",
"null",
")",
"{",
"throw",
"new",
"ConfigurationException",
"(",
"\"No index target\"",
")",
";",
"}",
"if",
"(",
"!",
"index",
".",
"isUpdatable",
"(",
... | start the background index merging thread
@throws ConfigurationException | [
"start",
"the",
"background",
"index",
"merging",
"thread"
] | train | https://github.com/iipc/openwayback/blob/da74c3a59a5b5a5c365bd4702dcb45d263535794/wayback-core/src/main/java/org/archive/wayback/resourceindex/updater/LocalResourceIndexUpdater.java#L76-L90 |
lievendoclo/Valkyrie-RCP | valkyrie-rcp-core/src/main/java/org/valkyriercp/util/EventListenerListHelper.java | EventListenerListHelper.fire | public void fire(String methodName, Object arg1, Object arg2) {
"""
Invokes the method with the given name and two parameters on each of the listeners
registered with this list.
@param methodName the name of the method to invoke.
@param arg1 the first argument to pass to each invocation.
@param arg2 the seco... | java | public void fire(String methodName, Object arg1, Object arg2) {
if (listeners != EMPTY_OBJECT_ARRAY) {
fireEventByReflection(methodName, new Object[] { arg1, arg2 });
}
} | [
"public",
"void",
"fire",
"(",
"String",
"methodName",
",",
"Object",
"arg1",
",",
"Object",
"arg2",
")",
"{",
"if",
"(",
"listeners",
"!=",
"EMPTY_OBJECT_ARRAY",
")",
"{",
"fireEventByReflection",
"(",
"methodName",
",",
"new",
"Object",
"[",
"]",
"{",
"a... | Invokes the method with the given name and two parameters on each of the listeners
registered with this list.
@param methodName the name of the method to invoke.
@param arg1 the first argument to pass to each invocation.
@param arg2 the second argument to pass to each invocation.
@throws IllegalArgumentException if n... | [
"Invokes",
"the",
"method",
"with",
"the",
"given",
"name",
"and",
"two",
"parameters",
"on",
"each",
"of",
"the",
"listeners",
"registered",
"with",
"this",
"list",
"."
] | train | https://github.com/lievendoclo/Valkyrie-RCP/blob/6aad6e640b348cda8f3b0841f6e42025233f1eb8/valkyrie-rcp-core/src/main/java/org/valkyriercp/util/EventListenerListHelper.java#L250-L254 |
ZieIony/Carbon | carbon/src/main/java/carbon/drawable/ripple/LollipopDrawablesCompat.java | LollipopDrawablesCompat.createFromXml | public static Drawable createFromXml(Resources r, XmlPullParser parser) throws XmlPullParserException, IOException {
"""
Create a drawable from an XML document. For more information on how to create resources in
XML, see
<a href="{@docRoot}guide/topics/resources/drawable-resource.html">Drawable Resources</a>.
... | java | public static Drawable createFromXml(Resources r, XmlPullParser parser) throws XmlPullParserException, IOException {
return createFromXml(r, parser, null);
} | [
"public",
"static",
"Drawable",
"createFromXml",
"(",
"Resources",
"r",
",",
"XmlPullParser",
"parser",
")",
"throws",
"XmlPullParserException",
",",
"IOException",
"{",
"return",
"createFromXml",
"(",
"r",
",",
"parser",
",",
"null",
")",
";",
"}"
] | Create a drawable from an XML document. For more information on how to create resources in
XML, see
<a href="{@docRoot}guide/topics/resources/drawable-resource.html">Drawable Resources</a>. | [
"Create",
"a",
"drawable",
"from",
"an",
"XML",
"document",
".",
"For",
"more",
"information",
"on",
"how",
"to",
"create",
"resources",
"in",
"XML",
"see",
"<a",
"href",
"=",
"{"
] | train | https://github.com/ZieIony/Carbon/blob/78b0a432bd49edc7a6a13ce111cab274085d1693/carbon/src/main/java/carbon/drawable/ripple/LollipopDrawablesCompat.java#L99-L101 |
alibaba/jstorm | jstorm-core/src/main/java/com/alibaba/jstorm/daemon/supervisor/SyncProcessEvent.java | SyncProcessEvent.matchesAssignment | public boolean matchesAssignment(WorkerHeartbeat whb, Map<Integer, LocalAssignment> assignedTasks) {
"""
check whether the worker heartbeat is allowed in the assignedTasks
@param whb WorkerHeartbeat
@param assignedTasks assigned tasks
@return if true, the assignments(LS-LOCAL-ASSIGNMENTS) match with... | java | public boolean matchesAssignment(WorkerHeartbeat whb, Map<Integer, LocalAssignment> assignedTasks) {
boolean isMatch = true;
LocalAssignment localAssignment = assignedTasks.get(whb.getPort());
if (localAssignment == null) {
LOG.debug("Following worker has been removed, port=" + whb.g... | [
"public",
"boolean",
"matchesAssignment",
"(",
"WorkerHeartbeat",
"whb",
",",
"Map",
"<",
"Integer",
",",
"LocalAssignment",
">",
"assignedTasks",
")",
"{",
"boolean",
"isMatch",
"=",
"true",
";",
"LocalAssignment",
"localAssignment",
"=",
"assignedTasks",
".",
"g... | check whether the worker heartbeat is allowed in the assignedTasks
@param whb WorkerHeartbeat
@param assignedTasks assigned tasks
@return if true, the assignments(LS-LOCAL-ASSIGNMENTS) match with worker heartbeat, false otherwise | [
"check",
"whether",
"the",
"worker",
"heartbeat",
"is",
"allowed",
"in",
"the",
"assignedTasks"
] | train | https://github.com/alibaba/jstorm/blob/5d6cde22dbca7df3d6e6830bf94f98a6639ab559/jstorm-core/src/main/java/com/alibaba/jstorm/daemon/supervisor/SyncProcessEvent.java#L437-L453 |
spotbugs/spotbugs | spotbugs/src/main/java/edu/umd/cs/findbugs/classfile/impl/ClassPathBuilder.java | ClassPathBuilder.parseClassName | private void parseClassName(ICodeBaseEntry entry) {
"""
Attempt to parse data of given resource in order to divine the real name
of the class contained in the resource.
@param entry
the resource
"""
DataInputStream in = null;
try {
InputStream resourceIn = entry.openResource();... | java | private void parseClassName(ICodeBaseEntry entry) {
DataInputStream in = null;
try {
InputStream resourceIn = entry.openResource();
if (resourceIn == null) {
throw new NullPointerException("Got null resource");
}
in = new DataInputStream(re... | [
"private",
"void",
"parseClassName",
"(",
"ICodeBaseEntry",
"entry",
")",
"{",
"DataInputStream",
"in",
"=",
"null",
";",
"try",
"{",
"InputStream",
"resourceIn",
"=",
"entry",
".",
"openResource",
"(",
")",
";",
"if",
"(",
"resourceIn",
"==",
"null",
")",
... | Attempt to parse data of given resource in order to divine the real name
of the class contained in the resource.
@param entry
the resource | [
"Attempt",
"to",
"parse",
"data",
"of",
"given",
"resource",
"in",
"order",
"to",
"divine",
"the",
"real",
"name",
"of",
"the",
"class",
"contained",
"in",
"the",
"resource",
"."
] | train | https://github.com/spotbugs/spotbugs/blob/f6365c6eea6515035bded38efa4a7c8b46ccf28c/spotbugs/src/main/java/edu/umd/cs/findbugs/classfile/impl/ClassPathBuilder.java#L723-L746 |
google/closure-compiler | src/com/google/javascript/jscomp/NodeUtil.java | NodeUtil.replaceDeclarationChild | public static void replaceDeclarationChild(Node declChild, Node newStatement) {
"""
Replace the child of a var/let/const declaration (usually a name) with a new statement.
Preserves the order of side effects for all the other declaration children.
@param declChild The name node to be replaced.
@param newState... | java | public static void replaceDeclarationChild(Node declChild, Node newStatement) {
checkArgument(isNameDeclaration(declChild.getParent()));
checkArgument(null == newStatement.getParent());
Node decl = declChild.getParent();
Node declParent = decl.getParent();
if (decl.hasOneChild()) {
declParent... | [
"public",
"static",
"void",
"replaceDeclarationChild",
"(",
"Node",
"declChild",
",",
"Node",
"newStatement",
")",
"{",
"checkArgument",
"(",
"isNameDeclaration",
"(",
"declChild",
".",
"getParent",
"(",
")",
")",
")",
";",
"checkArgument",
"(",
"null",
"==",
... | Replace the child of a var/let/const declaration (usually a name) with a new statement.
Preserves the order of side effects for all the other declaration children.
@param declChild The name node to be replaced.
@param newStatement The statement to replace with. | [
"Replace",
"the",
"child",
"of",
"a",
"var",
"/",
"let",
"/",
"const",
"declaration",
"(",
"usually",
"a",
"name",
")",
"with",
"a",
"new",
"statement",
".",
"Preserves",
"the",
"order",
"of",
"side",
"effects",
"for",
"all",
"the",
"other",
"declaration... | train | https://github.com/google/closure-compiler/blob/d81e36740f6a9e8ac31a825ee8758182e1dc5aae/src/com/google/javascript/jscomp/NodeUtil.java#L2879-L2904 |
groovy/groovy-core | src/main/org/codehaus/groovy/syntax/Types.java | Types.canMean | public static boolean canMean( int actual, int preferred ) {
"""
Given two types, returns true if the first can be viewed as the second.
NOTE that <code>canMean()</code> is orthogonal to <code>ofType()</code>.
"""
if( actual == preferred ) {
return true;
}
switch( preferr... | java | public static boolean canMean( int actual, int preferred ) {
if( actual == preferred ) {
return true;
}
switch( preferred ) {
case SYNTH_PARAMETER_DECLARATION:
case IDENTIFIER:
switch( actual ) {
case IDENTIFIER:
... | [
"public",
"static",
"boolean",
"canMean",
"(",
"int",
"actual",
",",
"int",
"preferred",
")",
"{",
"if",
"(",
"actual",
"==",
"preferred",
")",
"{",
"return",
"true",
";",
"}",
"switch",
"(",
"preferred",
")",
"{",
"case",
"SYNTH_PARAMETER_DECLARATION",
":... | Given two types, returns true if the first can be viewed as the second.
NOTE that <code>canMean()</code> is orthogonal to <code>ofType()</code>. | [
"Given",
"two",
"types",
"returns",
"true",
"if",
"the",
"first",
"can",
"be",
"viewed",
"as",
"the",
"second",
".",
"NOTE",
"that",
"<code",
">",
"canMean",
"()",
"<",
"/",
"code",
">",
"is",
"orthogonal",
"to",
"<code",
">",
"ofType",
"()",
"<",
"/... | train | https://github.com/groovy/groovy-core/blob/01309f9d4be34ddf93c4a9943b5a97843bff6181/src/main/org/codehaus/groovy/syntax/Types.java#L854-L901 |
OpenLiberty/open-liberty | dev/com.ibm.ws.injection/src/com/ibm/ws/injectionengine/osgi/internal/naming/InjectionJavaColonHelper.java | InjectionJavaColonHelper.getInjectionScopeData | protected OSGiInjectionScopeData getInjectionScopeData(NamingConstants.JavaColonNamespace namespace) throws NamingException {
"""
Internal method to obtain the injection metadata associated with
the specified component metadata. <p>
@return the associated injection metadata; or null if none exists
"""
... | java | protected OSGiInjectionScopeData getInjectionScopeData(NamingConstants.JavaColonNamespace namespace) throws NamingException {
final boolean isTraceOn = TraceComponent.isAnyTracingEnabled();
OSGiInjectionScopeData isd = null;
// Get the ComponentMetaData for the currently active component.
... | [
"protected",
"OSGiInjectionScopeData",
"getInjectionScopeData",
"(",
"NamingConstants",
".",
"JavaColonNamespace",
"namespace",
")",
"throws",
"NamingException",
"{",
"final",
"boolean",
"isTraceOn",
"=",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
";",
"OSGiI... | Internal method to obtain the injection metadata associated with
the specified component metadata. <p>
@return the associated injection metadata; or null if none exists | [
"Internal",
"method",
"to",
"obtain",
"the",
"injection",
"metadata",
"associated",
"with",
"the",
"specified",
"component",
"metadata",
".",
"<p",
">"
] | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.injection/src/com/ibm/ws/injectionengine/osgi/internal/naming/InjectionJavaColonHelper.java#L149-L170 |
phax/ph-oton | ph-oton-core/src/main/java/com/helger/photon/core/menu/MenuItemDeterminatorCallback.java | MenuItemDeterminatorCallback.getAllMenuItemIDs | @Nonnull
@ReturnsMutableCopy
public static ICommonsMap <String, Boolean> getAllMenuItemIDs (@Nonnull final IMenuTree aMenuTree) {
"""
Get all menu items without usage a separate
{@link MenuItemDeterminatorCallback} instance.
@param aMenuTree
The menu tree to get all items from. May not be <code>null</code... | java | @Nonnull
@ReturnsMutableCopy
public static ICommonsMap <String, Boolean> getAllMenuItemIDs (@Nonnull final IMenuTree aMenuTree)
{
ValueEnforcer.notNull (aMenuTree, "MenuTree");
final ICommonsMap <String, Boolean> ret = new CommonsHashMap <> ();
TreeVisitor.visitTree (aMenuTree,
... | [
"@",
"Nonnull",
"@",
"ReturnsMutableCopy",
"public",
"static",
"ICommonsMap",
"<",
"String",
",",
"Boolean",
">",
"getAllMenuItemIDs",
"(",
"@",
"Nonnull",
"final",
"IMenuTree",
"aMenuTree",
")",
"{",
"ValueEnforcer",
".",
"notNull",
"(",
"aMenuTree",
",",
"\"Me... | Get all menu items without usage a separate
{@link MenuItemDeterminatorCallback} instance.
@param aMenuTree
The menu tree to get all items from. May not be <code>null</code>.
@return A non-<code>null</code> map with all menu item IDs as keys and the
"expansion state" as the value. | [
"Get",
"all",
"menu",
"items",
"without",
"usage",
"a",
"separate",
"{",
"@link",
"MenuItemDeterminatorCallback",
"}",
"instance",
"."
] | train | https://github.com/phax/ph-oton/blob/f3aaacbbc02a9f3e4f32fe8db8e4adf7b9c1d3ef/ph-oton-core/src/main/java/com/helger/photon/core/menu/MenuItemDeterminatorCallback.java#L180-L198 |
liferay/com-liferay-commerce | commerce-product-service/src/main/java/com/liferay/commerce/product/service/persistence/impl/CPSpecificationOptionPersistenceImpl.java | CPSpecificationOptionPersistenceImpl.removeByG_K | @Override
public CPSpecificationOption removeByG_K(long groupId, String key)
throws NoSuchCPSpecificationOptionException {
"""
Removes the cp specification option where groupId = ? and key = ? from the database.
@param groupId the group ID
@param key the key
@return the cp specification option that... | java | @Override
public CPSpecificationOption removeByG_K(long groupId, String key)
throws NoSuchCPSpecificationOptionException {
CPSpecificationOption cpSpecificationOption = findByG_K(groupId, key);
return remove(cpSpecificationOption);
} | [
"@",
"Override",
"public",
"CPSpecificationOption",
"removeByG_K",
"(",
"long",
"groupId",
",",
"String",
"key",
")",
"throws",
"NoSuchCPSpecificationOptionException",
"{",
"CPSpecificationOption",
"cpSpecificationOption",
"=",
"findByG_K",
"(",
"groupId",
",",
"key",
"... | Removes the cp specification option where groupId = ? and key = ? from the database.
@param groupId the group ID
@param key the key
@return the cp specification option that was removed | [
"Removes",
"the",
"cp",
"specification",
"option",
"where",
"groupId",
"=",
"?",
";",
"and",
"key",
"=",
"?",
";",
"from",
"the",
"database",
"."
] | train | https://github.com/liferay/com-liferay-commerce/blob/9e54362d7f59531fc684016ba49ee7cdc3a2f22b/commerce-product-service/src/main/java/com/liferay/commerce/product/service/persistence/impl/CPSpecificationOptionPersistenceImpl.java#L2697-L2703 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.