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 |
|---|---|---|---|---|---|---|---|---|---|---|
jcuda/jcuda | JCudaJava/src/main/java/jcuda/driver/JCudaDriver.java | JCudaDriver.cuDeviceGetName | public static int cuDeviceGetName(byte name[], int len, CUdevice dev) {
"""
Returns an identifer string for the device.
<pre>
CUresult cuDeviceGetName (
char* name,
int len,
CUdevice dev )
</pre>
<div>
<p>Returns an identifer string for the
device. Returns an ASCII string identifying the device <tt>de... | java | public static int cuDeviceGetName(byte name[], int len, CUdevice dev)
{
return checkResult(cuDeviceGetNameNative(name, len, dev));
} | [
"public",
"static",
"int",
"cuDeviceGetName",
"(",
"byte",
"name",
"[",
"]",
",",
"int",
"len",
",",
"CUdevice",
"dev",
")",
"{",
"return",
"checkResult",
"(",
"cuDeviceGetNameNative",
"(",
"name",
",",
"len",
",",
"dev",
")",
")",
";",
"}"
] | Returns an identifer string for the device.
<pre>
CUresult cuDeviceGetName (
char* name,
int len,
CUdevice dev )
</pre>
<div>
<p>Returns an identifer string for the
device. Returns an ASCII string identifying the device <tt>dev</tt>
in the NULL-terminated string pointed to by <tt>name</tt>. <tt>len</tt> specifies th... | [
"Returns",
"an",
"identifer",
"string",
"for",
"the",
"device",
"."
] | train | https://github.com/jcuda/jcuda/blob/468528b5b9b37dfceb6ed83fcfd889e9b359f984/JCudaJava/src/main/java/jcuda/driver/JCudaDriver.java#L655-L658 |
pgjdbc/pgjdbc | pgjdbc/src/main/java/org/postgresql/jdbc/TimestampUtils.java | TimestampUtils.toTimeBin | public Time toTimeBin(TimeZone tz, byte[] bytes) throws PSQLException {
"""
Returns the SQL Time object matching the given bytes with {@link Oid#TIME} or
{@link Oid#TIMETZ}.
@param tz The timezone used when received data is {@link Oid#TIME}, ignored if data already
contains {@link Oid#TIMETZ}.
@param bytes T... | java | public Time toTimeBin(TimeZone tz, byte[] bytes) throws PSQLException {
if ((bytes.length != 8 && bytes.length != 12)) {
throw new PSQLException(GT.tr("Unsupported binary encoding of {0}.", "time"),
PSQLState.BAD_DATETIME_FORMAT);
}
long millis;
int timeOffset;
if (usesDouble) {
... | [
"public",
"Time",
"toTimeBin",
"(",
"TimeZone",
"tz",
",",
"byte",
"[",
"]",
"bytes",
")",
"throws",
"PSQLException",
"{",
"if",
"(",
"(",
"bytes",
".",
"length",
"!=",
"8",
"&&",
"bytes",
".",
"length",
"!=",
"12",
")",
")",
"{",
"throw",
"new",
"... | Returns the SQL Time object matching the given bytes with {@link Oid#TIME} or
{@link Oid#TIMETZ}.
@param tz The timezone used when received data is {@link Oid#TIME}, ignored if data already
contains {@link Oid#TIMETZ}.
@param bytes The binary encoded time value.
@return The parsed time object.
@throws PSQLException If... | [
"Returns",
"the",
"SQL",
"Time",
"object",
"matching",
"the",
"given",
"bytes",
"with",
"{",
"@link",
"Oid#TIME",
"}",
"or",
"{",
"@link",
"Oid#TIMETZ",
"}",
"."
] | train | https://github.com/pgjdbc/pgjdbc/blob/95ba7b261e39754674c5817695ae5ebf9a341fae/pgjdbc/src/main/java/org/postgresql/jdbc/TimestampUtils.java#L967-L1002 |
aws/aws-sdk-java | aws-java-sdk-dynamodb/src/main/java/com/amazonaws/services/dynamodbv2/document/utils/ValueMap.java | ValueMap.withList | public ValueMap withList(String key, List<?> val) {
"""
Sets the value of the specified key in the current ValueMap to the
given value.
"""
super.put(key, val == null ? null : new ArrayList<Object>(val));
return this;
} | java | public ValueMap withList(String key, List<?> val) {
super.put(key, val == null ? null : new ArrayList<Object>(val));
return this;
} | [
"public",
"ValueMap",
"withList",
"(",
"String",
"key",
",",
"List",
"<",
"?",
">",
"val",
")",
"{",
"super",
".",
"put",
"(",
"key",
",",
"val",
"==",
"null",
"?",
"null",
":",
"new",
"ArrayList",
"<",
"Object",
">",
"(",
"val",
")",
")",
";",
... | Sets the value of the specified key in the current ValueMap to the
given value. | [
"Sets",
"the",
"value",
"of",
"the",
"specified",
"key",
"in",
"the",
"current",
"ValueMap",
"to",
"the",
"given",
"value",
"."
] | train | https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-dynamodb/src/main/java/com/amazonaws/services/dynamodbv2/document/utils/ValueMap.java#L158-L161 |
looly/hutool | hutool-db/src/main/java/cn/hutool/db/sql/SqlExecutor.java | SqlExecutor.query | public static <T> T query(PreparedStatement ps, RsHandler<T> rsh, Object... params) throws SQLException {
"""
执行查询语句<br>
此方法不会关闭PreparedStatement
@param <T> 处理结果类型
@param ps PreparedStatement
@param rsh 结果集处理对象
@param params 参数
@return 结果对象
@throws SQLException SQL执行异常
"""
StatementUtil.fillParams(p... | java | public static <T> T query(PreparedStatement ps, RsHandler<T> rsh, Object... params) throws SQLException {
StatementUtil.fillParams(ps, params);
return executeQuery(ps, rsh);
} | [
"public",
"static",
"<",
"T",
">",
"T",
"query",
"(",
"PreparedStatement",
"ps",
",",
"RsHandler",
"<",
"T",
">",
"rsh",
",",
"Object",
"...",
"params",
")",
"throws",
"SQLException",
"{",
"StatementUtil",
".",
"fillParams",
"(",
"ps",
",",
"params",
")"... | 执行查询语句<br>
此方法不会关闭PreparedStatement
@param <T> 处理结果类型
@param ps PreparedStatement
@param rsh 结果集处理对象
@param params 参数
@return 结果对象
@throws SQLException SQL执行异常 | [
"执行查询语句<br",
">",
"此方法不会关闭PreparedStatement"
] | train | https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-db/src/main/java/cn/hutool/db/sql/SqlExecutor.java#L312-L315 |
xvik/guice-persist-orient | src/main/java/ru/vyarus/guice/persist/orient/db/PersistentContext.java | PersistentContext.doInTransaction | public <T> T doInTransaction(final TxConfig config, final SpecificTxAction<T, C> action) {
"""
Execute specific action within transaction.
@param config transaction config (ignored in case of ongoing transaction)
@param action action to execute within transaction (new or ongoing)
@param <T> expected return... | java | public <T> T doInTransaction(final TxConfig config, final SpecificTxAction<T, C> action) {
return template.doInTransaction(config, action);
} | [
"public",
"<",
"T",
">",
"T",
"doInTransaction",
"(",
"final",
"TxConfig",
"config",
",",
"final",
"SpecificTxAction",
"<",
"T",
",",
"C",
">",
"action",
")",
"{",
"return",
"template",
".",
"doInTransaction",
"(",
"config",
",",
"action",
")",
";",
"}"
... | Execute specific action within transaction.
@param config transaction config (ignored in case of ongoing transaction)
@param action action to execute within transaction (new or ongoing)
@param <T> expected return type
@return value produced by action
@see ru.vyarus.guice.persist.orient.db.transaction.template.Speci... | [
"Execute",
"specific",
"action",
"within",
"transaction",
"."
] | train | https://github.com/xvik/guice-persist-orient/blob/5ef06fb4f734360512e9824a3b875c4906c56b5b/src/main/java/ru/vyarus/guice/persist/orient/db/PersistentContext.java#L106-L108 |
Red5/red5-io | src/main/java/org/red5/io/amf/Output.java | Output.putString | public static void putString(IoBuffer buf, String string) {
"""
Write out string
@param buf
Byte buffer to write to
@param string
String to write
"""
final byte[] encoded = encodeString(string);
if (encoded.length < AMF.LONG_STRING_LENGTH) {
// write unsigned short
... | java | public static void putString(IoBuffer buf, String string) {
final byte[] encoded = encodeString(string);
if (encoded.length < AMF.LONG_STRING_LENGTH) {
// write unsigned short
buf.put((byte) ((encoded.length >> 8) & 0xff));
buf.put((byte) (encoded.length & 0xff));
... | [
"public",
"static",
"void",
"putString",
"(",
"IoBuffer",
"buf",
",",
"String",
"string",
")",
"{",
"final",
"byte",
"[",
"]",
"encoded",
"=",
"encodeString",
"(",
"string",
")",
";",
"if",
"(",
"encoded",
".",
"length",
"<",
"AMF",
".",
"LONG_STRING_LEN... | Write out string
@param buf
Byte buffer to write to
@param string
String to write | [
"Write",
"out",
"string"
] | train | https://github.com/Red5/red5-io/blob/9bbbc506423c5a8f18169d46d400df56c0072a33/src/main/java/org/red5/io/amf/Output.java#L546-L556 |
astrapi69/jaulp-wicket | jaulp-wicket-dialogs/src/main/java/de/alpharogroup/wicket/dialogs/panels/save/SaveDialogPanel.java | SaveDialogPanel.newSaveLabel | protected Label newSaveLabel(final String id, final ResourceBundleKey resourceKey) {
"""
Factory method for creating a new save {@link Label} with a {@link ResourceBundleKey}. This
method is invoked in the constructor from the derived classes and can be overridden so users
can provide their own version of a save... | java | protected Label newSaveLabel(final String id, final ResourceBundleKey resourceKey)
{
return ComponentFactory.newLabel(id, resourceKey, this);
} | [
"protected",
"Label",
"newSaveLabel",
"(",
"final",
"String",
"id",
",",
"final",
"ResourceBundleKey",
"resourceKey",
")",
"{",
"return",
"ComponentFactory",
".",
"newLabel",
"(",
"id",
",",
"resourceKey",
",",
"this",
")",
";",
"}"
] | Factory method for creating a new save {@link Label} with a {@link ResourceBundleKey}. This
method is invoked in the constructor from the derived classes and can be overridden so users
can provide their own version of a save {@link Label}.
@param id
the id
@param resourceKey
the resource key
@return the new {@link Lab... | [
"Factory",
"method",
"for",
"creating",
"a",
"new",
"save",
"{",
"@link",
"Label",
"}",
"with",
"a",
"{",
"@link",
"ResourceBundleKey",
"}",
".",
"This",
"method",
"is",
"invoked",
"in",
"the",
"constructor",
"from",
"the",
"derived",
"classes",
"and",
"ca... | train | https://github.com/astrapi69/jaulp-wicket/blob/85d74368d00abd9bb97659b5794e38c0f8a013d4/jaulp-wicket-dialogs/src/main/java/de/alpharogroup/wicket/dialogs/panels/save/SaveDialogPanel.java#L235-L238 |
looly/hutool | hutool-json/src/main/java/cn/hutool/json/JSONUtil.java | JSONUtil.quote | public static String quote(String string, boolean isWrap) {
"""
对所有双引号做转义处理(使用双反斜杠做转义)<br>
为了能在HTML中较好的显示,会将</转义为<\/<br>
JSON字符串中不能包含控制字符和未经转义的引号和反斜杠
@param string 字符串
@param isWrap 是否使用双引号包装字符串
@return 适合在JSON中显示的字符串
@since 3.3.1
"""
StringWriter sw = new StringWriter();
try {
return q... | java | public static String quote(String string, boolean isWrap) {
StringWriter sw = new StringWriter();
try {
return quote(string, sw, isWrap).toString();
} catch (IOException ignored) {
// will never happen - we are writing to a string writer
return StrUtil.EMPTY;
}
} | [
"public",
"static",
"String",
"quote",
"(",
"String",
"string",
",",
"boolean",
"isWrap",
")",
"{",
"StringWriter",
"sw",
"=",
"new",
"StringWriter",
"(",
")",
";",
"try",
"{",
"return",
"quote",
"(",
"string",
",",
"sw",
",",
"isWrap",
")",
".",
"toSt... | 对所有双引号做转义处理(使用双反斜杠做转义)<br>
为了能在HTML中较好的显示,会将</转义为<\/<br>
JSON字符串中不能包含控制字符和未经转义的引号和反斜杠
@param string 字符串
@param isWrap 是否使用双引号包装字符串
@return 适合在JSON中显示的字符串
@since 3.3.1 | [
"对所有双引号做转义处理(使用双反斜杠做转义)<br",
">",
"为了能在HTML中较好的显示,会将<",
";",
"/",
"转义为<",
";",
"\\",
"/",
"<br",
">",
"JSON字符串中不能包含控制字符和未经转义的引号和反斜杠"
] | train | https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-json/src/main/java/cn/hutool/json/JSONUtil.java#L462-L470 |
goldmansachs/reladomo | reladomo/src/main/java/com/gs/fw/common/mithra/attribute/Attribute.java | Attribute.filterEqForMappedAttribute | protected Operation filterEqForMappedAttribute(Attribute other) {
"""
/*
First reduce the left and right mappers to the common ancestor, then there are 4 possibilities here
1) leftReduced and rightReduced are not mapped. This is a plain filter operation with a common mapper on top
2) leftReduced is mapped, righ... | java | protected Operation filterEqForMappedAttribute(Attribute other)
{
MappedAttribute left = (MappedAttribute) this;
if (other instanceof MappedAttribute)
{
MappedAttribute right = (MappedAttribute) other;
if (left.getMapper().equals(right.getMapper()))
... | [
"protected",
"Operation",
"filterEqForMappedAttribute",
"(",
"Attribute",
"other",
")",
"{",
"MappedAttribute",
"left",
"=",
"(",
"MappedAttribute",
")",
"this",
";",
"if",
"(",
"other",
"instanceof",
"MappedAttribute",
")",
"{",
"MappedAttribute",
"right",
"=",
"... | /*
First reduce the left and right mappers to the common ancestor, then there are 4 possibilities here
1) leftReduced and rightReduced are not mapped. This is a plain filter operation with a common mapper on top
2) leftReduced is mapped, rightReduced is not mapped. equivalent to (3), just flipped.
3) leftReduced is not... | [
"/",
"*",
"First",
"reduce",
"the",
"left",
"and",
"right",
"mappers",
"to",
"the",
"common",
"ancestor",
"then",
"there",
"are",
"4",
"possibilities",
"here",
"1",
")",
"leftReduced",
"and",
"rightReduced",
"are",
"not",
"mapped",
".",
"This",
"is",
"a",
... | train | https://github.com/goldmansachs/reladomo/blob/e9a069452eece7a6ef9551caf81a69d3d9a3d990/reladomo/src/main/java/com/gs/fw/common/mithra/attribute/Attribute.java#L543-L577 |
pryzach/midao | midao-jdbc-core/src/main/java/org/midao/jdbc/core/processor/BasicQueryInputProcessor.java | BasicQueryInputProcessor.parseSqlString | private ProcessedInput parseSqlString(String preProcessedSql, ProcessedInput processedInput) {
"""
Performs actual input SQL/parameters processing
Used by {@link #processInput(String, java.util.Map)}
@param preProcessedSql SQL string with removed blocks (comments etc.)
@param processedInput Processed Input o... | java | private ProcessedInput parseSqlString(String preProcessedSql, ProcessedInput processedInput) {
ProcessedInput resultProcessedInput = new ProcessedInput(processedInput);
String originalSql = resultProcessedInput.getOriginalSql();
StringBuilder parsedSql = new StringBuilder(preProcessedSql.le... | [
"private",
"ProcessedInput",
"parseSqlString",
"(",
"String",
"preProcessedSql",
",",
"ProcessedInput",
"processedInput",
")",
"{",
"ProcessedInput",
"resultProcessedInput",
"=",
"new",
"ProcessedInput",
"(",
"processedInput",
")",
";",
"String",
"originalSql",
"=",
"re... | Performs actual input SQL/parameters processing
Used by {@link #processInput(String, java.util.Map)}
@param preProcessedSql SQL string with removed blocks (comments etc.)
@param processedInput Processed Input object which would be filled
@return filled ProcessedInput object | [
"Performs",
"actual",
"input",
"SQL",
"/",
"parameters",
"processing",
"Used",
"by",
"{",
"@link",
"#processInput",
"(",
"String",
"java",
".",
"util",
".",
"Map",
")",
"}"
] | train | https://github.com/pryzach/midao/blob/ed9048ed2c792a4794a2116a25779dfb84cd9447/midao-jdbc-core/src/main/java/org/midao/jdbc/core/processor/BasicQueryInputProcessor.java#L152-L190 |
infinispan/infinispan | lucene/lucene-directory/src/main/java/org/infinispan/lucene/LuceneKey2StringMapper.java | LuceneKey2StringMapper.getKeyMapping | @Override
public Object getKeyMapping(String key) {
"""
This method has to perform the inverse transformation of the keys used in the Lucene
Directory from String to object. So this implementation is strongly coupled to the
toString method of each key type.
@see ChunkCacheKey#toString()
@see FileCacheKey#... | java | @Override
public Object getKeyMapping(String key) {
if (key == null) {
throw new IllegalArgumentException("Not supporting null keys");
}
// ChunkCacheKey: "C|" + fileName + "|" + chunkId + "|" + bufferSize "|" + indexName + "|" + affinitySegmentId;
// FileCacheKey : "M|" + fileName ... | [
"@",
"Override",
"public",
"Object",
"getKeyMapping",
"(",
"String",
"key",
")",
"{",
"if",
"(",
"key",
"==",
"null",
")",
"{",
"throw",
"new",
"IllegalArgumentException",
"(",
"\"Not supporting null keys\"",
")",
";",
"}",
"// ChunkCacheKey: \"C|\" + fileName + \"|... | This method has to perform the inverse transformation of the keys used in the Lucene
Directory from String to object. So this implementation is strongly coupled to the
toString method of each key type.
@see ChunkCacheKey#toString()
@see FileCacheKey#toString()
@see FileListCacheKey#toString()
@see FileReadLockKey#toSt... | [
"This",
"method",
"has",
"to",
"perform",
"the",
"inverse",
"transformation",
"of",
"the",
"keys",
"used",
"in",
"the",
"Lucene",
"Directory",
"from",
"String",
"to",
"object",
".",
"So",
"this",
"implementation",
"is",
"strongly",
"coupled",
"to",
"the",
"t... | train | https://github.com/infinispan/infinispan/blob/7c62b94886c3febb4774ae8376acf2baa0265ab5/lucene/lucene-directory/src/main/java/org/infinispan/lucene/LuceneKey2StringMapper.java#L52-L97 |
OpenLiberty/open-liberty | dev/com.ibm.ws.jca/src/com/ibm/ws/jca/internal/BootstrapContextImpl.java | BootstrapContextImpl.getDestinationName | private Object getDestinationName(String destinationType, Object destination) throws Exception {
"""
Returns the name of the queue or topic.
@param destinationType type of destination (javax.jms.Queue or javax.jms.Topic).
@param value instance of the above type.
@return name of the queue or topic.
@throws Ex... | java | private Object getDestinationName(String destinationType, Object destination) throws Exception {
String methodName;
if ("javax.jms.Queue".equals(destinationType))
methodName = "getQueueName";
else if ("javax.jms.Topic".equals(destinationType))
methodName = "getTopicName";... | [
"private",
"Object",
"getDestinationName",
"(",
"String",
"destinationType",
",",
"Object",
"destination",
")",
"throws",
"Exception",
"{",
"String",
"methodName",
";",
"if",
"(",
"\"javax.jms.Queue\"",
".",
"equals",
"(",
"destinationType",
")",
")",
"methodName",
... | Returns the name of the queue or topic.
@param destinationType type of destination (javax.jms.Queue or javax.jms.Topic).
@param value instance of the above type.
@return name of the queue or topic.
@throws Exception if unable to obtain the destination name. | [
"Returns",
"the",
"name",
"of",
"the",
"queue",
"or",
"topic",
"."
] | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.jca/src/com/ibm/ws/jca/internal/BootstrapContextImpl.java#L801-L815 |
ivanceras/orm | src/main/java/com/ivanceras/db/api/SynchronousEntityManager.java | SynchronousEntityManager.insertNoChangeLog | @Override
public <T extends DAO> T insertNoChangeLog(DAO dao, ModelDef model) throws DatabaseException {
"""
Insert the record without bothering changelog, to avoid infinite method recursive calls when inserting changelogs into record_changelog table
@param dao
@param model
@return
@throws DatabaseException
... | java | @Override
public <T extends DAO> T insertNoChangeLog(DAO dao, ModelDef model) throws DatabaseException{
DAO ret = db.insert(dao, null, model, null);
Class<? extends DAO> clazz = getDaoClass(dao.getModelName());
return cast(clazz, ret);
} | [
"@",
"Override",
"public",
"<",
"T",
"extends",
"DAO",
">",
"T",
"insertNoChangeLog",
"(",
"DAO",
"dao",
",",
"ModelDef",
"model",
")",
"throws",
"DatabaseException",
"{",
"DAO",
"ret",
"=",
"db",
".",
"insert",
"(",
"dao",
",",
"null",
",",
"model",
"... | Insert the record without bothering changelog, to avoid infinite method recursive calls when inserting changelogs into record_changelog table
@param dao
@param model
@return
@throws DatabaseException | [
"Insert",
"the",
"record",
"without",
"bothering",
"changelog",
"to",
"avoid",
"infinite",
"method",
"recursive",
"calls",
"when",
"inserting",
"changelogs",
"into",
"record_changelog",
"table"
] | train | https://github.com/ivanceras/orm/blob/e63213cb8abefd11df0e2d34b1c95477788e600e/src/main/java/com/ivanceras/db/api/SynchronousEntityManager.java#L301-L306 |
bitcoinj/bitcoinj | core/src/main/java/org/bitcoinj/core/ECKey.java | ECKey.fromEncrypted | public static ECKey fromEncrypted(EncryptedData encryptedPrivateKey, KeyCrypter crypter, byte[] pubKey) {
"""
Constructs a key that has an encrypted private component. The given object wraps encrypted bytes and an
initialization vector. Note that the key will not be decrypted during this call: the returned ECKey ... | java | public static ECKey fromEncrypted(EncryptedData encryptedPrivateKey, KeyCrypter crypter, byte[] pubKey) {
ECKey key = fromPublicOnly(pubKey);
key.encryptedPrivateKey = checkNotNull(encryptedPrivateKey);
key.keyCrypter = checkNotNull(crypter);
return key;
} | [
"public",
"static",
"ECKey",
"fromEncrypted",
"(",
"EncryptedData",
"encryptedPrivateKey",
",",
"KeyCrypter",
"crypter",
",",
"byte",
"[",
"]",
"pubKey",
")",
"{",
"ECKey",
"key",
"=",
"fromPublicOnly",
"(",
"pubKey",
")",
";",
"key",
".",
"encryptedPrivateKey",... | Constructs a key that has an encrypted private component. The given object wraps encrypted bytes and an
initialization vector. Note that the key will not be decrypted during this call: the returned ECKey is
unusable for signing unless a decryption key is supplied. | [
"Constructs",
"a",
"key",
"that",
"has",
"an",
"encrypted",
"private",
"component",
".",
"The",
"given",
"object",
"wraps",
"encrypted",
"bytes",
"and",
"an",
"initialization",
"vector",
".",
"Note",
"that",
"the",
"key",
"will",
"not",
"be",
"decrypted",
"d... | train | https://github.com/bitcoinj/bitcoinj/blob/9cf13d29315014ed59cf4fc5944e5f227e8df9a6/core/src/main/java/org/bitcoinj/core/ECKey.java#L355-L360 |
wildfly/wildfly-core | controller/src/main/java/org/jboss/as/controller/transform/TransformersLogger.java | TransformersLogger.logAttributeWarning | public void logAttributeWarning(PathAddress address, ModelNode operation, String message, Set<String> attributes) {
"""
Log a warning for the given operation at the provided address for the given attributes, using the provided detail
message.
@param address where warning occurred
@param operation where wh... | java | public void logAttributeWarning(PathAddress address, ModelNode operation, String message, Set<String> attributes) {
messageQueue.add(new AttributeLogEntry(address, operation, message, attributes));
} | [
"public",
"void",
"logAttributeWarning",
"(",
"PathAddress",
"address",
",",
"ModelNode",
"operation",
",",
"String",
"message",
",",
"Set",
"<",
"String",
">",
"attributes",
")",
"{",
"messageQueue",
".",
"add",
"(",
"new",
"AttributeLogEntry",
"(",
"address",
... | Log a warning for the given operation at the provided address for the given attributes, using the provided detail
message.
@param address where warning occurred
@param operation where which problem occurred
@param message custom error message to append
@param attributes attributes we that have problems about | [
"Log",
"a",
"warning",
"for",
"the",
"given",
"operation",
"at",
"the",
"provided",
"address",
"for",
"the",
"given",
"attributes",
"using",
"the",
"provided",
"detail",
"message",
"."
] | train | https://github.com/wildfly/wildfly-core/blob/cfaf0479dcbb2d320a44c5374b93b944ec39fade/controller/src/main/java/org/jboss/as/controller/transform/TransformersLogger.java#L160-L162 |
UrielCh/ovh-java-sdk | ovh-java-sdk-telephony/src/main/java/net/minidev/ovh/api/ApiOvhTelephony.java | ApiOvhTelephony.number_specificNumbers_GET | public ArrayList<OvhSpecificNumber> number_specificNumbers_GET(OvhNumberCountryEnum country, String range, OvhNumberTypeEnum type, String zone) throws IOException {
"""
Get all available specific number from a country
REST: GET /telephony/number/specificNumbers
@param type [required] The type of number
@param... | java | public ArrayList<OvhSpecificNumber> number_specificNumbers_GET(OvhNumberCountryEnum country, String range, OvhNumberTypeEnum type, String zone) throws IOException {
String qPath = "/telephony/number/specificNumbers";
StringBuilder sb = path(qPath);
query(sb, "country", country);
query(sb, "range", range);
que... | [
"public",
"ArrayList",
"<",
"OvhSpecificNumber",
">",
"number_specificNumbers_GET",
"(",
"OvhNumberCountryEnum",
"country",
",",
"String",
"range",
",",
"OvhNumberTypeEnum",
"type",
",",
"String",
"zone",
")",
"throws",
"IOException",
"{",
"String",
"qPath",
"=",
"\... | Get all available specific number from a country
REST: GET /telephony/number/specificNumbers
@param type [required] The type of number
@param country [required] The country
@param zone [required] The zone (geographic number)
@param range [required] The range (special number) | [
"Get",
"all",
"available",
"specific",
"number",
"from",
"a",
"country"
] | train | https://github.com/UrielCh/ovh-java-sdk/blob/6d531a40e56e09701943e334c25f90f640c55701/ovh-java-sdk-telephony/src/main/java/net/minidev/ovh/api/ApiOvhTelephony.java#L8662-L8671 |
Azure/azure-sdk-for-java | appservice/resource-manager/v2018_02_01/src/main/java/com/microsoft/azure/management/appservice/v2018_02_01/implementation/DiagnosticsInner.java | DiagnosticsInner.getSiteDiagnosticCategorySlot | public DiagnosticCategoryInner getSiteDiagnosticCategorySlot(String resourceGroupName, String siteName, String diagnosticCategory, String slot) {
"""
Get Diagnostics Category.
Get Diagnostics Category.
@param resourceGroupName Name of the resource group to which the resource belongs.
@param siteName Site Name... | java | public DiagnosticCategoryInner getSiteDiagnosticCategorySlot(String resourceGroupName, String siteName, String diagnosticCategory, String slot) {
return getSiteDiagnosticCategorySlotWithServiceResponseAsync(resourceGroupName, siteName, diagnosticCategory, slot).toBlocking().single().body();
} | [
"public",
"DiagnosticCategoryInner",
"getSiteDiagnosticCategorySlot",
"(",
"String",
"resourceGroupName",
",",
"String",
"siteName",
",",
"String",
"diagnosticCategory",
",",
"String",
"slot",
")",
"{",
"return",
"getSiteDiagnosticCategorySlotWithServiceResponseAsync",
"(",
"... | Get Diagnostics Category.
Get Diagnostics Category.
@param resourceGroupName Name of the resource group to which the resource belongs.
@param siteName Site Name
@param diagnosticCategory Diagnostic Category
@param slot Slot Name
@throws IllegalArgumentException thrown if parameters fail the validation
@throws DefaultE... | [
"Get",
"Diagnostics",
"Category",
".",
"Get",
"Diagnostics",
"Category",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/appservice/resource-manager/v2018_02_01/src/main/java/com/microsoft/azure/management/appservice/v2018_02_01/implementation/DiagnosticsInner.java#L1486-L1488 |
alkacon/opencms-core | src/org/opencms/jsp/CmsJspTagEdit.java | CmsJspTagEdit.getContextRootPath | private static String getContextRootPath(CmsObject cms, String creationSitemap) {
"""
Returns the context root path.<p>
@param cms the CMS context
@param creationSitemap the creation sitemap parameter
@return the context root path
"""
String path = null;
if (CmsStringUtil.isNotEmptyOrWh... | java | private static String getContextRootPath(CmsObject cms, String creationSitemap) {
String path = null;
if (CmsStringUtil.isNotEmptyOrWhitespaceOnly(creationSitemap)) {
try {
path = cms.readFolder(creationSitemap).getRootPath();
} catch (CmsException e) {
... | [
"private",
"static",
"String",
"getContextRootPath",
"(",
"CmsObject",
"cms",
",",
"String",
"creationSitemap",
")",
"{",
"String",
"path",
"=",
"null",
";",
"if",
"(",
"CmsStringUtil",
".",
"isNotEmptyOrWhitespaceOnly",
"(",
"creationSitemap",
")",
")",
"{",
"t... | Returns the context root path.<p>
@param cms the CMS context
@param creationSitemap the creation sitemap parameter
@return the context root path | [
"Returns",
"the",
"context",
"root",
"path",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/jsp/CmsJspTagEdit.java#L299-L314 |
baratine/baratine | framework/src/main/java/com/caucho/v5/reflect/ReflectUtil.java | ReflectUtil.isMatch | public static boolean isMatch(Method methodA, Method methodB) {
"""
Tests if an annotated method matches a name and parameter types.
"""
if (! methodA.getName().equals(methodB.getName()))
return false;
return isMatch(methodA.getParameterTypes(),
methodB.getParameterTypes());
... | java | public static boolean isMatch(Method methodA, Method methodB)
{
if (! methodA.getName().equals(methodB.getName()))
return false;
return isMatch(methodA.getParameterTypes(),
methodB.getParameterTypes());
} | [
"public",
"static",
"boolean",
"isMatch",
"(",
"Method",
"methodA",
",",
"Method",
"methodB",
")",
"{",
"if",
"(",
"!",
"methodA",
".",
"getName",
"(",
")",
".",
"equals",
"(",
"methodB",
".",
"getName",
"(",
")",
")",
")",
"return",
"false",
";",
"r... | Tests if an annotated method matches a name and parameter types. | [
"Tests",
"if",
"an",
"annotated",
"method",
"matches",
"a",
"name",
"and",
"parameter",
"types",
"."
] | train | https://github.com/baratine/baratine/blob/db34b45c03c5a5e930d8142acc72319125569fcf/framework/src/main/java/com/caucho/v5/reflect/ReflectUtil.java#L158-L165 |
nextreports/nextreports-engine | src/ro/nextreports/engine/util/ReportUtil.java | ReportUtil.isValidSqlWithMessage | public static String isValidSqlWithMessage(Connection con, Report report) {
"""
Test if sql from a report object and sql from all parameter sources (if any) are valid
@param con database connection
@param report report object
@return return message error if sql is not valid, null otherwise
"""
String sq... | java | public static String isValidSqlWithMessage(Connection con, Report report) {
String sql = getSql(report);
List<QueryParameter> parameters = report.getParameters();
String message = isValidSqlWithMessage(con, sql, parameters);
if (message == null) {
for (QueryParameter qp : parameters) {
if (qp.isManualSou... | [
"public",
"static",
"String",
"isValidSqlWithMessage",
"(",
"Connection",
"con",
",",
"Report",
"report",
")",
"{",
"String",
"sql",
"=",
"getSql",
"(",
"report",
")",
";",
"List",
"<",
"QueryParameter",
">",
"parameters",
"=",
"report",
".",
"getParameters",
... | Test if sql from a report object and sql from all parameter sources (if any) are valid
@param con database connection
@param report report object
@return return message error if sql is not valid, null otherwise | [
"Test",
"if",
"sql",
"from",
"a",
"report",
"object",
"and",
"sql",
"from",
"all",
"parameter",
"sources",
"(",
"if",
"any",
")",
"are",
"valid"
] | train | https://github.com/nextreports/nextreports-engine/blob/a847575a9298b5fce63b88961190c5b83ddccc44/src/ro/nextreports/engine/util/ReportUtil.java#L736-L752 |
OpenLiberty/open-liberty | dev/com.ibm.ws.messaging.comms.client/src/com/ibm/ws/sib/comms/common/CommsUtils.java | CommsUtils.getRuntimeBooleanProperty | public static boolean getRuntimeBooleanProperty(String property, String defaultValue) {
"""
This method will get a runtime property from the sib.properties file as a boolean.
@param property The property key used to look up in the file.
@param defaultValue The default value if the property is not in the file.
... | java | public static boolean getRuntimeBooleanProperty(String property, String defaultValue)
{
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.entry(tc, "getRuntimeBooleanProperty", new Object[] {property, defaultValue});
boolean runtimeProp = B... | [
"public",
"static",
"boolean",
"getRuntimeBooleanProperty",
"(",
"String",
"property",
",",
"String",
"defaultValue",
")",
"{",
"if",
"(",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
"&&",
"tc",
".",
"isEntryEnabled",
"(",
")",
")",
"SibTr",
".",
"... | This method will get a runtime property from the sib.properties file as a boolean.
@param property The property key used to look up in the file.
@param defaultValue The default value if the property is not in the file.
@return Returns the property value. | [
"This",
"method",
"will",
"get",
"a",
"runtime",
"property",
"from",
"the",
"sib",
".",
"properties",
"file",
"as",
"a",
"boolean",
"."
] | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.messaging.comms.client/src/com/ibm/ws/sib/comms/common/CommsUtils.java#L77-L86 |
Azure/azure-sdk-for-java | keyvault/data-plane/azure-keyvault/src/main/java/com/microsoft/azure/keyvault/implementation/KeyVaultClientBaseImpl.java | KeyVaultClientBaseImpl.mergeCertificate | public CertificateBundle mergeCertificate(String vaultBaseUrl, String certificateName, List<byte[]> x509Certificates) {
"""
Merges a certificate or a certificate chain with a key pair existing on the server.
The MergeCertificate operation performs the merging of a certificate or certificate chain with a key pair ... | java | public CertificateBundle mergeCertificate(String vaultBaseUrl, String certificateName, List<byte[]> x509Certificates) {
return mergeCertificateWithServiceResponseAsync(vaultBaseUrl, certificateName, x509Certificates).toBlocking().single().body();
} | [
"public",
"CertificateBundle",
"mergeCertificate",
"(",
"String",
"vaultBaseUrl",
",",
"String",
"certificateName",
",",
"List",
"<",
"byte",
"[",
"]",
">",
"x509Certificates",
")",
"{",
"return",
"mergeCertificateWithServiceResponseAsync",
"(",
"vaultBaseUrl",
",",
"... | Merges a certificate or a certificate chain with a key pair existing on the server.
The MergeCertificate operation performs the merging of a certificate or certificate chain with a key pair currently available in the service. This operation requires the certificates/create permission.
@param vaultBaseUrl The vault nam... | [
"Merges",
"a",
"certificate",
"or",
"a",
"certificate",
"chain",
"with",
"a",
"key",
"pair",
"existing",
"on",
"the",
"server",
".",
"The",
"MergeCertificate",
"operation",
"performs",
"the",
"merging",
"of",
"a",
"certificate",
"or",
"certificate",
"chain",
"... | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/keyvault/data-plane/azure-keyvault/src/main/java/com/microsoft/azure/keyvault/implementation/KeyVaultClientBaseImpl.java#L7911-L7913 |
redkale/redkale-plugins | src/org/redkalex/convert/pson/ProtobufReader.java | ProtobufReader.hasNext | @Override
public boolean hasNext(int startPosition, int contentLength) {
"""
判断对象是否存在下一个属性或者数组是否存在下一个元素
@param startPosition 起始位置
@param contentLength 内容大小, 不确定的传-1
@return 是否存在
"""
//("-------------: " + startPosition + ", " + contentLength + ", " + this.position);
if (startPosit... | java | @Override
public boolean hasNext(int startPosition, int contentLength) {
//("-------------: " + startPosition + ", " + contentLength + ", " + this.position);
if (startPosition >= 0 && contentLength >= 0) {
return (this.position) < (startPosition + contentLength);
}
... | [
"@",
"Override",
"public",
"boolean",
"hasNext",
"(",
"int",
"startPosition",
",",
"int",
"contentLength",
")",
"{",
"//(\"-------------: \" + startPosition + \", \" + contentLength + \", \" + this.position);\r",
"if",
"(",
"startPosition",
">=",
"0",
"&&",
"contentLength",
... | 判断对象是否存在下一个属性或者数组是否存在下一个元素
@param startPosition 起始位置
@param contentLength 内容大小, 不确定的传-1
@return 是否存在 | [
"判断对象是否存在下一个属性或者数组是否存在下一个元素"
] | train | https://github.com/redkale/redkale-plugins/blob/a1edfc906a444ae19fe6aababce2957c9b5ea9d2/src/org/redkalex/convert/pson/ProtobufReader.java#L239-L246 |
belaban/JGroups | src/org/jgroups/blocks/MessageDispatcher.java | MessageDispatcher.sendMessageWithFuture | public <T> CompletableFuture<T> sendMessageWithFuture(Address dest, byte[] data, int offset, int length,
RequestOptions opts) throws Exception {
"""
Sends a unicast message to the target defined by msg.getDest() and returns a future
@param dest the target... | java | public <T> CompletableFuture<T> sendMessageWithFuture(Address dest, byte[] data, int offset, int length,
RequestOptions opts) throws Exception {
return sendMessageWithFuture(dest, new Buffer(data, offset, length), opts);
} | [
"public",
"<",
"T",
">",
"CompletableFuture",
"<",
"T",
">",
"sendMessageWithFuture",
"(",
"Address",
"dest",
",",
"byte",
"[",
"]",
"data",
",",
"int",
"offset",
",",
"int",
"length",
",",
"RequestOptions",
"opts",
")",
"throws",
"Exception",
"{",
"return... | Sends a unicast message to the target defined by msg.getDest() and returns a future
@param dest the target to which to send the unicast message. Must not be null.
@param data the payload to send
@param offset the offset at which the data starts
@param length the number of bytes to send
@param opts the options
@return C... | [
"Sends",
"a",
"unicast",
"message",
"to",
"the",
"target",
"defined",
"by",
"msg",
".",
"getDest",
"()",
"and",
"returns",
"a",
"future"
] | train | https://github.com/belaban/JGroups/blob/bd3ca786aa57fed41dfbc10a94b1281e388be03b/src/org/jgroups/blocks/MessageDispatcher.java#L398-L401 |
kayemkim/milonga | src/main/java/com/skp/milonga/servlet/handler/AtmosHttpRequestHandler.java | AtmosHttpRequestHandler.setCookie | @SuppressWarnings("unchecked")
private void setCookie(NativeObject result, HttpServletResponse response) {
"""
set cookie from result of handler to HttpServletResponse
@param result
return object of handler
@param response
HttpServletResponse
"""
Map<String, String> cookieMap = ScriptableObject.getTyp... | java | @SuppressWarnings("unchecked")
private void setCookie(NativeObject result, HttpServletResponse response) {
Map<String, String> cookieMap = ScriptableObject.getTypedProperty(
result, "cookie", Map.class);
if (cookieMap == null) {
return;
}
Iterator<Entry<String, String>> iterator = cookieMap.entrySet()
... | [
"@",
"SuppressWarnings",
"(",
"\"unchecked\"",
")",
"private",
"void",
"setCookie",
"(",
"NativeObject",
"result",
",",
"HttpServletResponse",
"response",
")",
"{",
"Map",
"<",
"String",
",",
"String",
">",
"cookieMap",
"=",
"ScriptableObject",
".",
"getTypedPrope... | set cookie from result of handler to HttpServletResponse
@param result
return object of handler
@param response
HttpServletResponse | [
"set",
"cookie",
"from",
"result",
"of",
"handler",
"to",
"HttpServletResponse"
] | train | https://github.com/kayemkim/milonga/blob/b084095552995dc3998d7fe1fd71c06a3a378af2/src/main/java/com/skp/milonga/servlet/handler/AtmosHttpRequestHandler.java#L87-L102 |
BorderTech/wcomponents | wcomponents-core/src/main/java/com/github/bordertech/wcomponents/WebUtilities.java | WebUtilities.percentEncodeUrl | public static String percentEncodeUrl(final String urlStr) {
"""
Percent encode a URL to include in HTML.
@param urlStr the URL to escape
@return the URL percent encoded
"""
if (Util.empty(urlStr)) {
return urlStr;
}
try {
// Avoid double encoding
String decode = URIUtil.decode(urlStr);
... | java | public static String percentEncodeUrl(final String urlStr) {
if (Util.empty(urlStr)) {
return urlStr;
}
try {
// Avoid double encoding
String decode = URIUtil.decode(urlStr);
URI uri = new URI(decode, false);
return uri.getEscapedURIReference();
} catch (Exception e) {
return urlStr;
}
} | [
"public",
"static",
"String",
"percentEncodeUrl",
"(",
"final",
"String",
"urlStr",
")",
"{",
"if",
"(",
"Util",
".",
"empty",
"(",
"urlStr",
")",
")",
"{",
"return",
"urlStr",
";",
"}",
"try",
"{",
"// Avoid double encoding",
"String",
"decode",
"=",
"URI... | Percent encode a URL to include in HTML.
@param urlStr the URL to escape
@return the URL percent encoded | [
"Percent",
"encode",
"a",
"URL",
"to",
"include",
"in",
"HTML",
"."
] | train | https://github.com/BorderTech/wcomponents/blob/d1a2b2243270067db030feb36ca74255aaa94436/wcomponents-core/src/main/java/com/github/bordertech/wcomponents/WebUtilities.java#L300-L313 |
SpringForAll/spring-boot-starter-swagger | src/main/java/com/spring4all/swagger/SwaggerAutoConfiguration.java | SwaggerAutoConfiguration.buildGlobalResponseMessage | private void buildGlobalResponseMessage(SwaggerProperties swaggerProperties, Docket docketForBuilder) {
"""
设置全局响应消息
@param swaggerProperties swaggerProperties 支持 POST,GET,PUT,PATCH,DELETE,HEAD,OPTIONS,TRACE
@param docketForBuilder swagger docket builder
"""
SwaggerProperties.GlobalResponseMessag... | java | private void buildGlobalResponseMessage(SwaggerProperties swaggerProperties, Docket docketForBuilder) {
SwaggerProperties.GlobalResponseMessage globalResponseMessages =
swaggerProperties.getGlobalResponseMessage();
/* POST,GET,PUT,PATCH,DELETE,HEAD,OPTIONS,TRACE 响应消息体 **/
List<... | [
"private",
"void",
"buildGlobalResponseMessage",
"(",
"SwaggerProperties",
"swaggerProperties",
",",
"Docket",
"docketForBuilder",
")",
"{",
"SwaggerProperties",
".",
"GlobalResponseMessage",
"globalResponseMessages",
"=",
"swaggerProperties",
".",
"getGlobalResponseMessage",
"... | 设置全局响应消息
@param swaggerProperties swaggerProperties 支持 POST,GET,PUT,PATCH,DELETE,HEAD,OPTIONS,TRACE
@param docketForBuilder swagger docket builder | [
"设置全局响应消息"
] | train | https://github.com/SpringForAll/spring-boot-starter-swagger/blob/420e146f0ac2fcfd3a63b43cd4d605e895502fe4/src/main/java/com/spring4all/swagger/SwaggerAutoConfiguration.java#L332-L356 |
OpenLiberty/open-liberty | dev/com.ibm.ws.app.manager.war/src/com/ibm/ws/app/manager/ear/internal/EARDeployedAppInfo.java | EARDeployedAppInfo.createModuleChildClassLoader | private ClassLoader createModuleChildClassLoader(String moduleDomain, ModuleInfo moduleInfo, List<ContainerInfo> moduleClassesContainers) {
"""
<p>Create a class loader for a web or client module - which is a child to the top-level app loader.</p>
<p>Notable: This constructor is only usable for web and client m... | java | private ClassLoader createModuleChildClassLoader(String moduleDomain, ModuleInfo moduleInfo, List<ContainerInfo> moduleClassesContainers) {
String moduleName = moduleInfo.getName();
String j2eeModuleName = moduleInfo.getURI();
List<Container> containers = new ArrayList<Container>();
for... | [
"private",
"ClassLoader",
"createModuleChildClassLoader",
"(",
"String",
"moduleDomain",
",",
"ModuleInfo",
"moduleInfo",
",",
"List",
"<",
"ContainerInfo",
">",
"moduleClassesContainers",
")",
"{",
"String",
"moduleName",
"=",
"moduleInfo",
".",
"getName",
"(",
")",
... | <p>Create a class loader for a web or client module - which is a child to the top-level app loader.</p>
<p>Notable: This constructor is only usable for web and client modules. Other code of the module
container must make available the collection of locations for the class path.</p>
@see WebModuleClassesInfo
@param t... | [
"<p",
">",
"Create",
"a",
"class",
"loader",
"for",
"a",
"web",
"or",
"client",
"module",
"-",
"which",
"is",
"a",
"child",
"to",
"the",
"top",
"-",
"level",
"app",
"loader",
".",
"<",
"/",
"p",
">"
] | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.app.manager.war/src/com/ibm/ws/app/manager/ear/internal/EARDeployedAppInfo.java#L966-L1002 |
banq/jdonframework | src/main/java/com/jdon/util/task/TaskEngine.java | TaskEngine.addTask | public static void addTask(Runnable task, int priority) {
"""
Adds a task to the task queue. The task will be executed immediately
provided there is a free worker thread to execute it. Otherwise, it will
execute as soon as a worker thread becomes available.
<p>
The priority of the task can be specified and m... | java | public static void addTask(Runnable task, int priority) {
synchronized (lock) {
taskList.addFirst(task);
// Notify the worker threads. The notifyAll() methods notifies all
// threads waiting on this object.
lock.notifyAll();
}
} | [
"public",
"static",
"void",
"addTask",
"(",
"Runnable",
"task",
",",
"int",
"priority",
")",
"{",
"synchronized",
"(",
"lock",
")",
"{",
"taskList",
".",
"addFirst",
"(",
"task",
")",
";",
"// Notify the worker threads. The notifyAll() methods notifies all\r",
"// t... | Adds a task to the task queue. The task will be executed immediately
provided there is a free worker thread to execute it. Otherwise, it will
execute as soon as a worker thread becomes available.
<p>
The priority of the task can be specified and must be one of the
following values:
<ul>
<li>Thread.MAX_PRIORITY
<li>Thr... | [
"Adds",
"a",
"task",
"to",
"the",
"task",
"queue",
".",
"The",
"task",
"will",
"be",
"executed",
"immediately",
"provided",
"there",
"is",
"a",
"free",
"worker",
"thread",
"to",
"execute",
"it",
".",
"Otherwise",
"it",
"will",
"execute",
"as",
"soon",
"a... | train | https://github.com/banq/jdonframework/blob/72b451caac04f775e57f52aaed3d8775044ead53/src/main/java/com/jdon/util/task/TaskEngine.java#L92-L99 |
querydsl/querydsl | querydsl-core/src/main/java/com/querydsl/core/types/dsl/Expressions.java | Expressions.simpleTemplate | public static <T> SimpleTemplate<T> simpleTemplate(Class<? extends T> cl, String template, Object... args) {
"""
Create a new Template expression
@param cl type of expression
@param template template
@param args template parameters
@return template expression
"""
return simpleTemplate(cl, createT... | java | public static <T> SimpleTemplate<T> simpleTemplate(Class<? extends T> cl, String template, Object... args) {
return simpleTemplate(cl, createTemplate(template), ImmutableList.copyOf(args));
} | [
"public",
"static",
"<",
"T",
">",
"SimpleTemplate",
"<",
"T",
">",
"simpleTemplate",
"(",
"Class",
"<",
"?",
"extends",
"T",
">",
"cl",
",",
"String",
"template",
",",
"Object",
"...",
"args",
")",
"{",
"return",
"simpleTemplate",
"(",
"cl",
",",
"cre... | Create a new Template expression
@param cl type of expression
@param template template
@param args template parameters
@return template expression | [
"Create",
"a",
"new",
"Template",
"expression"
] | train | https://github.com/querydsl/querydsl/blob/2bf234caf78549813a1e0f44d9c30ecc5ef734e3/querydsl-core/src/main/java/com/querydsl/core/types/dsl/Expressions.java#L242-L244 |
Azure/azure-sdk-for-java | compute/resource-manager/v2017_12_01/src/main/java/com/microsoft/azure/management/compute/v2017_12_01/implementation/LogAnalyticsInner.java | LogAnalyticsInner.beginExportRequestRateByIntervalAsync | public Observable<LogAnalyticsOperationResultInner> beginExportRequestRateByIntervalAsync(String location, RequestRateByIntervalInput parameters) {
"""
Export logs that show Api requests made by this subscription in the given time window to show throttling activities.
@param location The location upon which vir... | java | public Observable<LogAnalyticsOperationResultInner> beginExportRequestRateByIntervalAsync(String location, RequestRateByIntervalInput parameters) {
return beginExportRequestRateByIntervalWithServiceResponseAsync(location, parameters).map(new Func1<ServiceResponse<LogAnalyticsOperationResultInner>, LogAnalyticsO... | [
"public",
"Observable",
"<",
"LogAnalyticsOperationResultInner",
">",
"beginExportRequestRateByIntervalAsync",
"(",
"String",
"location",
",",
"RequestRateByIntervalInput",
"parameters",
")",
"{",
"return",
"beginExportRequestRateByIntervalWithServiceResponseAsync",
"(",
"location"... | Export logs that show Api requests made by this subscription in the given time window to show throttling activities.
@param location The location upon which virtual-machine-sizes is queried.
@param parameters Parameters supplied to the LogAnalytics getRequestRateByInterval Api.
@throws IllegalArgumentException thrown ... | [
"Export",
"logs",
"that",
"show",
"Api",
"requests",
"made",
"by",
"this",
"subscription",
"in",
"the",
"given",
"time",
"window",
"to",
"show",
"throttling",
"activities",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/compute/resource-manager/v2017_12_01/src/main/java/com/microsoft/azure/management/compute/v2017_12_01/implementation/LogAnalyticsInner.java#L181-L188 |
RestComm/sip-servlets | sip-servlets-impl/src/main/java/org/mobicents/servlet/sip/core/session/SipSessionsUtilImpl.java | SipSessionsUtilImpl.addCorrespondingSipSession | public void addCorrespondingSipSession(MobicentsSipSession newSession, MobicentsSipSession correspondingSipSession, String headerName) {
"""
Add a mapping between a new session and a corresponding sipSession related to a headerName. See Also getCorrespondingSipSession method.
@param newSession the new session
@p... | java | public void addCorrespondingSipSession(MobicentsSipSession newSession, MobicentsSipSession correspondingSipSession, String headerName) {
if(JoinHeader.NAME.equalsIgnoreCase(headerName)) {
joinSession.putIfAbsent(newSession.getKey(), correspondingSipSession);
} else if (ReplacesHeader.NAME.equalsIgnoreCase(hea... | [
"public",
"void",
"addCorrespondingSipSession",
"(",
"MobicentsSipSession",
"newSession",
",",
"MobicentsSipSession",
"correspondingSipSession",
",",
"String",
"headerName",
")",
"{",
"if",
"(",
"JoinHeader",
".",
"NAME",
".",
"equalsIgnoreCase",
"(",
"headerName",
")",... | Add a mapping between a new session and a corresponding sipSession related to a headerName. See Also getCorrespondingSipSession method.
@param newSession the new session
@param correspondingSipSession the corresponding sip session to add
@param headerName the header name | [
"Add",
"a",
"mapping",
"between",
"a",
"new",
"session",
"and",
"a",
"corresponding",
"sipSession",
"related",
"to",
"a",
"headerName",
".",
"See",
"Also",
"getCorrespondingSipSession",
"method",
"."
] | train | https://github.com/RestComm/sip-servlets/blob/fd7011d2803ab1d205b140768a760c8c69e0c997/sip-servlets-impl/src/main/java/org/mobicents/servlet/sip/core/session/SipSessionsUtilImpl.java#L160-L168 |
ironjacamar/ironjacamar | embedded/src/main/java/org/ironjacamar/embedded/byteman/IronJacamarWithByteman.java | IronJacamarWithByteman.createScriptText | private ScriptText createScriptText(int key, BMRule rule) {
"""
Create a ScriptText instance
@param key The key
@param rule The rule
@return The ScriptText instance
"""
StringBuilder builder = new StringBuilder();
builder.append("# BMUnit autogenerated script: ").append(rule.name());
buil... | java | private ScriptText createScriptText(int key, BMRule rule)
{
StringBuilder builder = new StringBuilder();
builder.append("# BMUnit autogenerated script: ").append(rule.name());
builder.append("\nRULE ");
builder.append(rule.name());
if (rule.isInterface())
{
builder.appen... | [
"private",
"ScriptText",
"createScriptText",
"(",
"int",
"key",
",",
"BMRule",
"rule",
")",
"{",
"StringBuilder",
"builder",
"=",
"new",
"StringBuilder",
"(",
")",
";",
"builder",
".",
"append",
"(",
"\"# BMUnit autogenerated script: \"",
")",
".",
"append",
"("... | Create a ScriptText instance
@param key The key
@param rule The rule
@return The ScriptText instance | [
"Create",
"a",
"ScriptText",
"instance"
] | train | https://github.com/ironjacamar/ironjacamar/blob/f0389ee7e62aa8b40ba09b251edad76d220ea796/embedded/src/main/java/org/ironjacamar/embedded/byteman/IronJacamarWithByteman.java#L118-L166 |
pravega/pravega | segmentstore/server/src/main/java/io/pravega/segmentstore/server/tables/IndexWriter.java | IndexWriter.generateTableAttributeUpdates | private void generateTableAttributeUpdates(long currentOffset, long newOffset, int processedCount, UpdateInstructions update) {
"""
Generates conditional {@link AttributeUpdate}s that update the values for Core Attributes representing the indexing
state of the Table Segment.
@param currentOffset The offset fr... | java | private void generateTableAttributeUpdates(long currentOffset, long newOffset, int processedCount, UpdateInstructions update) {
// Add an Update for the INDEX_OFFSET to indicate we have indexed everything up to this offset.
Preconditions.checkArgument(currentOffset <= newOffset, "newOffset must be large... | [
"private",
"void",
"generateTableAttributeUpdates",
"(",
"long",
"currentOffset",
",",
"long",
"newOffset",
",",
"int",
"processedCount",
",",
"UpdateInstructions",
"update",
")",
"{",
"// Add an Update for the INDEX_OFFSET to indicate we have indexed everything up to this offset."... | Generates conditional {@link AttributeUpdate}s that update the values for Core Attributes representing the indexing
state of the Table Segment.
@param currentOffset The offset from which this indexing batch began. This will be checked against
{@link TableAttributes#INDEX_OFFSET}.
@param newOffset The new offset ... | [
"Generates",
"conditional",
"{",
"@link",
"AttributeUpdate",
"}",
"s",
"that",
"update",
"the",
"values",
"for",
"Core",
"Attributes",
"representing",
"the",
"indexing",
"state",
"of",
"the",
"Table",
"Segment",
"."
] | train | https://github.com/pravega/pravega/blob/6e24df7470669b3956a07018f52b2c6b3c2a3503/segmentstore/server/src/main/java/io/pravega/segmentstore/server/tables/IndexWriter.java#L227-L244 |
facebookarchive/hadoop-20 | src/contrib/namespace-notifier/src/java/org/apache/hadoop/hdfs/notifier/server/ServerHistory.java | ServerHistory.cleanUpHistory | private void cleanUpHistory() {
"""
Checks if there are notifications in our tree which are older than
historyLength. It removes does which are older.
"""
long oldestAllowedTimestamp = System.currentTimeMillis() - historyLength;
int trashedNotifications = 0;
if (LOG.isDebugEnabled()) {
... | java | private void cleanUpHistory() {
long oldestAllowedTimestamp = System.currentTimeMillis() - historyLength;
int trashedNotifications = 0;
if (LOG.isDebugEnabled()) {
LOG.debug("History cleanup: Checking old notifications to remove from history list ...");
}
HistoryTreeEntry key = new H... | [
"private",
"void",
"cleanUpHistory",
"(",
")",
"{",
"long",
"oldestAllowedTimestamp",
"=",
"System",
".",
"currentTimeMillis",
"(",
")",
"-",
"historyLength",
";",
"int",
"trashedNotifications",
"=",
"0",
";",
"if",
"(",
"LOG",
".",
"isDebugEnabled",
"(",
")",... | Checks if there are notifications in our tree which are older than
historyLength. It removes does which are older. | [
"Checks",
"if",
"there",
"are",
"notifications",
"in",
"our",
"tree",
"which",
"are",
"older",
"than",
"historyLength",
".",
"It",
"removes",
"does",
"which",
"are",
"older",
"."
] | train | https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/contrib/namespace-notifier/src/java/org/apache/hadoop/hdfs/notifier/server/ServerHistory.java#L142-L197 |
baratine/baratine | web/src/main/java/com/caucho/v5/web/webapp/MultiMapImpl.java | MultiMapImpl.add | public void add(K key, V value) {
"""
Puts a new item in the cache.
@param key key to store data
@param value value to be stored
@return old value stored under the key
"""
if (key == null) {
return;
}
K []keys = _keys;
final int size = _size;
for (int i = size - 1; i >= 0... | java | public void add(K key, V value)
{
if (key == null) {
return;
}
K []keys = _keys;
final int size = _size;
for (int i = size - 1; i >= 0; i--) {
if (key.equals(keys[i])) {
_values[i].add(value);
return;
}
}
if (! ensureCapacity(size)) {
return;
... | [
"public",
"void",
"add",
"(",
"K",
"key",
",",
"V",
"value",
")",
"{",
"if",
"(",
"key",
"==",
"null",
")",
"{",
"return",
";",
"}",
"K",
"[",
"]",
"keys",
"=",
"_keys",
";",
"final",
"int",
"size",
"=",
"_size",
";",
"for",
"(",
"int",
"i",
... | Puts a new item in the cache.
@param key key to store data
@param value value to be stored
@return old value stored under the key | [
"Puts",
"a",
"new",
"item",
"in",
"the",
"cache",
"."
] | train | https://github.com/baratine/baratine/blob/db34b45c03c5a5e930d8142acc72319125569fcf/web/src/main/java/com/caucho/v5/web/webapp/MultiMapImpl.java#L153-L178 |
google/j2objc | xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xalan/processor/StylesheetHandler.java | StylesheetHandler.createXPath | public XPath createXPath(String str, ElemTemplateElement owningTemplate)
throws javax.xml.transform.TransformerException {
"""
Process an expression string into an XPath.
Must be public for access by the AVT class.
@param str A non-null reference to a valid or invalid XPath expression string.
@ret... | java | public XPath createXPath(String str, ElemTemplateElement owningTemplate)
throws javax.xml.transform.TransformerException
{
ErrorListener handler = m_stylesheetProcessor.getErrorListener();
XPath xpath = new XPath(str, owningTemplate, this, XPath.SELECT, handler,
m_funcTable);
// Vis... | [
"public",
"XPath",
"createXPath",
"(",
"String",
"str",
",",
"ElemTemplateElement",
"owningTemplate",
")",
"throws",
"javax",
".",
"xml",
".",
"transform",
".",
"TransformerException",
"{",
"ErrorListener",
"handler",
"=",
"m_stylesheetProcessor",
".",
"getErrorListen... | Process an expression string into an XPath.
Must be public for access by the AVT class.
@param str A non-null reference to a valid or invalid XPath expression string.
@return A non-null reference to an XPath object that represents the string argument.
@throws javax.xml.transform.TransformerException if the expressio... | [
"Process",
"an",
"expression",
"string",
"into",
"an",
"XPath",
".",
"Must",
"be",
"public",
"for",
"access",
"by",
"the",
"AVT",
"class",
"."
] | train | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xalan/processor/StylesheetHandler.java#L151-L160 |
Wolfgang-Schuetzelhofer/jcypher | src/main/java/iot/jcypher/query/values/JcString.java | JcString.trimLeft | public JcString trimLeft() {
"""
<div color='red' style="font-size:24px;color:red"><b><i><u>JCYPHER</u></i></b></div>
<div color='red' style="font-size:18px;color:red"><i>return the result of removing leading white spaces form a string, return a <b>JcString</b></i></div>
<br/>
"""
JcString ret = new JcStri... | java | public JcString trimLeft() {
JcString ret = new JcString(null, this,
new FunctionInstance(FUNCTION.String.LTRIM, 1));
QueryRecorder.recordInvocationConditional(this, "trimLeft", ret);
return ret;
} | [
"public",
"JcString",
"trimLeft",
"(",
")",
"{",
"JcString",
"ret",
"=",
"new",
"JcString",
"(",
"null",
",",
"this",
",",
"new",
"FunctionInstance",
"(",
"FUNCTION",
".",
"String",
".",
"LTRIM",
",",
"1",
")",
")",
";",
"QueryRecorder",
".",
"recordInvo... | <div color='red' style="font-size:24px;color:red"><b><i><u>JCYPHER</u></i></b></div>
<div color='red' style="font-size:18px;color:red"><i>return the result of removing leading white spaces form a string, return a <b>JcString</b></i></div>
<br/> | [
"<div",
"color",
"=",
"red",
"style",
"=",
"font",
"-",
"size",
":",
"24px",
";",
"color",
":",
"red",
">",
"<b",
">",
"<i",
">",
"<u",
">",
"JCYPHER<",
"/",
"u",
">",
"<",
"/",
"i",
">",
"<",
"/",
"b",
">",
"<",
"/",
"div",
">",
"<div",
... | train | https://github.com/Wolfgang-Schuetzelhofer/jcypher/blob/0f36914b4d6993a004cc235bb18dd3e02a59d253/src/main/java/iot/jcypher/query/values/JcString.java#L94-L99 |
google/error-prone | core/src/main/java/com/google/errorprone/refaster/PlaceholderUnificationVisitor.java | PlaceholderUnificationVisitor.unifyExpressions | public Choice<State<List<JCExpression>>> unifyExpressions(
@Nullable Iterable<? extends ExpressionTree> nodes, State<?> state) {
"""
Returns all the ways this placeholder invocation might unify with the specified list of trees.
"""
return unify(nodes, state)
.transform(s -> s.withResult(List.... | java | public Choice<State<List<JCExpression>>> unifyExpressions(
@Nullable Iterable<? extends ExpressionTree> nodes, State<?> state) {
return unify(nodes, state)
.transform(s -> s.withResult(List.convert(JCExpression.class, s.result())));
} | [
"public",
"Choice",
"<",
"State",
"<",
"List",
"<",
"JCExpression",
">",
">",
">",
"unifyExpressions",
"(",
"@",
"Nullable",
"Iterable",
"<",
"?",
"extends",
"ExpressionTree",
">",
"nodes",
",",
"State",
"<",
"?",
">",
"state",
")",
"{",
"return",
"unify... | Returns all the ways this placeholder invocation might unify with the specified list of trees. | [
"Returns",
"all",
"the",
"ways",
"this",
"placeholder",
"invocation",
"might",
"unify",
"with",
"the",
"specified",
"list",
"of",
"trees",
"."
] | train | https://github.com/google/error-prone/blob/fe2e3cc2cf1958cb7c487bfe89852bb4c225ba9d/core/src/main/java/com/google/errorprone/refaster/PlaceholderUnificationVisitor.java#L279-L283 |
netscaler/nitro | src/main/java/com/citrix/netscaler/nitro/resource/config/authentication/authenticationlocalpolicy_binding.java | authenticationlocalpolicy_binding.get | public static authenticationlocalpolicy_binding get(nitro_service service, String name) throws Exception {
"""
Use this API to fetch authenticationlocalpolicy_binding resource of given name .
"""
authenticationlocalpolicy_binding obj = new authenticationlocalpolicy_binding();
obj.set_name(name);
authenti... | java | public static authenticationlocalpolicy_binding get(nitro_service service, String name) throws Exception{
authenticationlocalpolicy_binding obj = new authenticationlocalpolicy_binding();
obj.set_name(name);
authenticationlocalpolicy_binding response = (authenticationlocalpolicy_binding) obj.get_resource(service);... | [
"public",
"static",
"authenticationlocalpolicy_binding",
"get",
"(",
"nitro_service",
"service",
",",
"String",
"name",
")",
"throws",
"Exception",
"{",
"authenticationlocalpolicy_binding",
"obj",
"=",
"new",
"authenticationlocalpolicy_binding",
"(",
")",
";",
"obj",
".... | Use this API to fetch authenticationlocalpolicy_binding resource of given name . | [
"Use",
"this",
"API",
"to",
"fetch",
"authenticationlocalpolicy_binding",
"resource",
"of",
"given",
"name",
"."
] | train | https://github.com/netscaler/nitro/blob/2a98692dcf4e4ec430c7d7baab8382e4ba5a35e4/src/main/java/com/citrix/netscaler/nitro/resource/config/authentication/authenticationlocalpolicy_binding.java#L136-L141 |
rundeck/rundeck | core/src/main/java/com/dtolabs/shared/resources/ResourceXMLParser.java | ResourceXMLParser.parseEnt | private Entity parseEnt(final Node node, final EntitySet set) throws ResourceXMLParserException {
"""
Given xml Node and EntitySet, parse the entity defined in the Node
@param node DOM node
@param set entity set holder
@return parsed Entity object
@throws ResourceXMLParserException if entity definition ... | java | private Entity parseEnt(final Node node, final EntitySet set) throws ResourceXMLParserException {
final Entity ent = parseResourceRef(set, node);
ent.setResourceType(node.getName());
parseEntProperties(ent, node);
parseEntSubAttributes(ent, node);
return ent;
} | [
"private",
"Entity",
"parseEnt",
"(",
"final",
"Node",
"node",
",",
"final",
"EntitySet",
"set",
")",
"throws",
"ResourceXMLParserException",
"{",
"final",
"Entity",
"ent",
"=",
"parseResourceRef",
"(",
"set",
",",
"node",
")",
";",
"ent",
".",
"setResourceTyp... | Given xml Node and EntitySet, parse the entity defined in the Node
@param node DOM node
@param set entity set holder
@return parsed Entity object
@throws ResourceXMLParserException if entity definition was previously found, or another error occurs | [
"Given",
"xml",
"Node",
"and",
"EntitySet",
"parse",
"the",
"entity",
"defined",
"in",
"the",
"Node"
] | train | https://github.com/rundeck/rundeck/blob/8070f774f55bffaa1118ff0c03aea319d40a9668/core/src/main/java/com/dtolabs/shared/resources/ResourceXMLParser.java#L183-L189 |
looly/hutool | hutool-http/src/main/java/cn/hutool/http/HttpUtil.java | HttpUtil.download | public static long download(String url, OutputStream out, boolean isCloseOut, StreamProgress streamProgress) {
"""
下载远程文件
@param url 请求的url
@param out 将下载内容写到输出流中 {@link OutputStream}
@param isCloseOut 是否关闭输出流
@param streamProgress 进度条
@return 文件大小
"""
if (StrUtil.isBlank(url)) {
throw new NullPo... | java | public static long download(String url, OutputStream out, boolean isCloseOut, StreamProgress streamProgress) {
if (StrUtil.isBlank(url)) {
throw new NullPointerException("[url] is null!");
}
if (null == out) {
throw new NullPointerException("[out] is null!");
}
final HttpResponse response = Htt... | [
"public",
"static",
"long",
"download",
"(",
"String",
"url",
",",
"OutputStream",
"out",
",",
"boolean",
"isCloseOut",
",",
"StreamProgress",
"streamProgress",
")",
"{",
"if",
"(",
"StrUtil",
".",
"isBlank",
"(",
"url",
")",
")",
"{",
"throw",
"new",
"Nul... | 下载远程文件
@param url 请求的url
@param out 将下载内容写到输出流中 {@link OutputStream}
@param isCloseOut 是否关闭输出流
@param streamProgress 进度条
@return 文件大小 | [
"下载远程文件"
] | train | https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-http/src/main/java/cn/hutool/http/HttpUtil.java#L339-L352 |
mikepenz/MaterialDrawer | library/src/main/java/com/mikepenz/materialdrawer/Drawer.java | Drawer.setHeader | public void setHeader(@NonNull View view, boolean padding, boolean divider, DimenHolder height) {
"""
method to replace a previous set header
@param view
@param padding
@param divider
@param height
"""
mDrawerBuilder.getHeaderAdapter().clear();
if (padding) {
mDrawerBuilder.ge... | java | public void setHeader(@NonNull View view, boolean padding, boolean divider, DimenHolder height) {
mDrawerBuilder.getHeaderAdapter().clear();
if (padding) {
mDrawerBuilder.getHeaderAdapter().add(new ContainerDrawerItem().withView(view).withDivider(divider).withHeight(height).withViewPosition(... | [
"public",
"void",
"setHeader",
"(",
"@",
"NonNull",
"View",
"view",
",",
"boolean",
"padding",
",",
"boolean",
"divider",
",",
"DimenHolder",
"height",
")",
"{",
"mDrawerBuilder",
".",
"getHeaderAdapter",
"(",
")",
".",
"clear",
"(",
")",
";",
"if",
"(",
... | method to replace a previous set header
@param view
@param padding
@param divider
@param height | [
"method",
"to",
"replace",
"a",
"previous",
"set",
"header"
] | train | https://github.com/mikepenz/MaterialDrawer/blob/f4fb31635767edead0a01cee7b7588942b89d8d9/library/src/main/java/com/mikepenz/materialdrawer/Drawer.java#L336-L345 |
UrielCh/ovh-java-sdk | ovh-java-sdk-telephony/src/main/java/net/minidev/ovh/api/ApiOvhTelephony.java | ApiOvhTelephony.billingAccount_transferSecurityDeposit_POST | public void billingAccount_transferSecurityDeposit_POST(String billingAccount, Long amount, String billingAccountDestination) throws IOException {
"""
Transfer security deposit between two billing accounts
REST: POST /telephony/{billingAccount}/transferSecurityDeposit
@param amount [required] The amount, in eu... | java | public void billingAccount_transferSecurityDeposit_POST(String billingAccount, Long amount, String billingAccountDestination) throws IOException {
String qPath = "/telephony/{billingAccount}/transferSecurityDeposit";
StringBuilder sb = path(qPath, billingAccount);
HashMap<String, Object>o = new HashMap<String, Ob... | [
"public",
"void",
"billingAccount_transferSecurityDeposit_POST",
"(",
"String",
"billingAccount",
",",
"Long",
"amount",
",",
"String",
"billingAccountDestination",
")",
"throws",
"IOException",
"{",
"String",
"qPath",
"=",
"\"/telephony/{billingAccount}/transferSecurityDeposit... | Transfer security deposit between two billing accounts
REST: POST /telephony/{billingAccount}/transferSecurityDeposit
@param amount [required] The amount, in euros, you want to transfer
@param billingAccountDestination [required] The destination billing account
@param billingAccount [required] The name of your billing... | [
"Transfer",
"security",
"deposit",
"between",
"two",
"billing",
"accounts"
] | train | https://github.com/UrielCh/ovh-java-sdk/blob/6d531a40e56e09701943e334c25f90f640c55701/ovh-java-sdk-telephony/src/main/java/net/minidev/ovh/api/ApiOvhTelephony.java#L8192-L8199 |
facebookarchive/hadoop-20 | src/hdfs/org/apache/hadoop/hdfs/server/datanode/DataXceiver.java | DataXceiver.readBlockAccelerator | private void readBlockAccelerator(DataInputStream in,
VersionAndOpcode versionAndOpcode) throws IOException {
"""
Read a block from the disk, the emphasis in on speed baby, speed!
The focus is to decrease the number of system calls issued to satisfy
this read request.
@param in The stream to read from
... | java | private void readBlockAccelerator(DataInputStream in,
VersionAndOpcode versionAndOpcode) throws IOException {
//
// Read in the header
//
int namespaceId = in.readInt();
long blockId = in.readLong();
long generationStamp = in.readLong();
long startOffset = in.readL... | [
"private",
"void",
"readBlockAccelerator",
"(",
"DataInputStream",
"in",
",",
"VersionAndOpcode",
"versionAndOpcode",
")",
"throws",
"IOException",
"{",
"//",
"// Read in the header",
"//",
"int",
"namespaceId",
"=",
"in",
".",
"readInt",
"(",
")",
";",
"long",
"b... | Read a block from the disk, the emphasis in on speed baby, speed!
The focus is to decrease the number of system calls issued to satisfy
this read request.
@param in The stream to read from
Input 4 bytes: namespace id
8 bytes: block id
8 bytes: genstamp
8 bytes: startOffset
8 bytes: length of data to read
n bytes: cli... | [
"Read",
"a",
"block",
"from",
"the",
"disk",
"the",
"emphasis",
"in",
"on",
"speed",
"baby",
"speed!",
"The",
"focus",
"is",
"to",
"decrease",
"the",
"number",
"of",
"system",
"calls",
"issued",
"to",
"satisfy",
"this",
"read",
"request",
".",
"@param",
... | train | https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/hdfs/org/apache/hadoop/hdfs/server/datanode/DataXceiver.java#L1326-L1371 |
mabe02/lanterna | src/main/java/com/googlecode/lanterna/TextCharacter.java | TextCharacter.withoutModifier | public TextCharacter withoutModifier(SGR modifier) {
"""
Returns a copy of this TextCharacter with an SGR modifier removed. All of the currently active SGR codes
will be carried over to the copy, except for the one specified. If the current TextCharacter doesn't have the
SGR specified, it will return itself.
@p... | java | public TextCharacter withoutModifier(SGR modifier) {
if(!modifiers.contains(modifier)) {
return this;
}
EnumSet<SGR> newSet = EnumSet.copyOf(this.modifiers);
newSet.remove(modifier);
return new TextCharacter(character, foregroundColor, backgroundColor, newSet);
} | [
"public",
"TextCharacter",
"withoutModifier",
"(",
"SGR",
"modifier",
")",
"{",
"if",
"(",
"!",
"modifiers",
".",
"contains",
"(",
"modifier",
")",
")",
"{",
"return",
"this",
";",
"}",
"EnumSet",
"<",
"SGR",
">",
"newSet",
"=",
"EnumSet",
".",
"copyOf",... | Returns a copy of this TextCharacter with an SGR modifier removed. All of the currently active SGR codes
will be carried over to the copy, except for the one specified. If the current TextCharacter doesn't have the
SGR specified, it will return itself.
@param modifier SGR modifiers the copy should not have
@return Copy... | [
"Returns",
"a",
"copy",
"of",
"this",
"TextCharacter",
"with",
"an",
"SGR",
"modifier",
"removed",
".",
"All",
"of",
"the",
"currently",
"active",
"SGR",
"codes",
"will",
"be",
"carried",
"over",
"to",
"the",
"copy",
"except",
"for",
"the",
"one",
"specifi... | train | https://github.com/mabe02/lanterna/blob/8dfd62206ff46ab10223b2ef2dbb0a2c51850954/src/main/java/com/googlecode/lanterna/TextCharacter.java#L280-L287 |
Faylixe/googlecodejam-client | src/main/java/fr/faylixe/googlecodejam/client/CodeJamSession.java | CodeJamSession.createContent | private MultipartContent createContent(final ProblemInput input, final File output, final File source) throws IOException {
"""
<p>Created and returns a valid {@link MultipartContent} instance
that contains data required for submission.</p>
@param input Input file to submit solution for.
@param output Output ... | java | private MultipartContent createContent(final ProblemInput input, final File output, final File source) throws IOException {
final HttpMediaType type = new HttpMediaType(MEDIA_TYPE);
type.setParameter(BOUNDARY, createBoundary());
// Submission from Chrome through contest website sends fake path for security,
// ... | [
"private",
"MultipartContent",
"createContent",
"(",
"final",
"ProblemInput",
"input",
",",
"final",
"File",
"output",
",",
"final",
"File",
"source",
")",
"throws",
"IOException",
"{",
"final",
"HttpMediaType",
"type",
"=",
"new",
"HttpMediaType",
"(",
"MEDIA_TYP... | <p>Created and returns a valid {@link MultipartContent} instance
that contains data required for submission.</p>
@param input Input file to submit solution for.
@param output Output file produced by the algorithm.
@param source Source code file of the algorithm to submit.
@return Created multipart content. | [
"<p",
">",
"Created",
"and",
"returns",
"a",
"valid",
"{",
"@link",
"MultipartContent",
"}",
"instance",
"that",
"contains",
"data",
"required",
"for",
"submission",
".",
"<",
"/",
"p",
">"
] | train | https://github.com/Faylixe/googlecodejam-client/blob/84a5fed4e049dca48994dc3f70213976aaff4bd3/src/main/java/fr/faylixe/googlecodejam/client/CodeJamSession.java#L332-L356 |
GenesysPureEngage/authentication-client-java | src/main/java/com/genesys/authentication/RetrieveTokenApi.java | RetrieveTokenApi.retrieveToken | public DefaultOAuth2AccessToken retrieveToken(Map<String, Object> formParams, String authorization) throws AuthenticationApiException {
"""
Retrieve access token
Retrieve an access token based on the grant type &mdash; Authorization Code Grant, Resource Owner Password Credentials Grant or Client Credentials G... | java | public DefaultOAuth2AccessToken retrieveToken(Map<String, Object> formParams, String authorization) throws AuthenticationApiException {
Headers.Builder headerBuilder = new Headers.Builder();
headerBuilder.add("Accept", "*/*");
headerBuilder.add("Content-Type", "application/x-www-form-urlencoded"... | [
"public",
"DefaultOAuth2AccessToken",
"retrieveToken",
"(",
"Map",
"<",
"String",
",",
"Object",
">",
"formParams",
",",
"String",
"authorization",
")",
"throws",
"AuthenticationApiException",
"{",
"Headers",
".",
"Builder",
"headerBuilder",
"=",
"new",
"Headers",
"... | Retrieve access token
Retrieve an access token based on the grant type &mdash; Authorization Code Grant, Resource Owner Password Credentials Grant or Client Credentials Grant. For more information, see [Token Endpoint](https://tools.ietf.org/html/rfc6749). **Note:** For the optional **scope** parameter, the Authent... | [
"Retrieve",
"access",
"token",
"Retrieve",
"an",
"access",
"token",
"based",
"on",
"the",
"grant",
"type",
"&",
";",
"mdash",
";",
"Authorization",
"Code",
"Grant",
"Resource",
"Owner",
"Password",
"Credentials",
"Grant",
"or",
"Client",
"Credentials",
"Grant... | train | https://github.com/GenesysPureEngage/authentication-client-java/blob/eb0d58343ee42ebd3c037163c1137f611dfcbb3a/src/main/java/com/genesys/authentication/RetrieveTokenApi.java#L125-L146 |
imsweb/naaccr-xml | src/main/java/com/imsweb/naaccrxml/NaaccrXmlUtils.java | NaaccrXmlUtils.readXmlFile | public static NaaccrData readXmlFile(File xmlFile, NaaccrOptions options, List<NaaccrDictionary> userDictionaries, NaaccrObserver observer) throws NaaccrIOException {
"""
Reads an NAACCR XML data file and returns the corresponding data.
<br/>
ATTENTION: THIS METHOD WILL RETURN THE FULL CONTENT OF THE FILE AND IS... | java | public static NaaccrData readXmlFile(File xmlFile, NaaccrOptions options, List<NaaccrDictionary> userDictionaries, NaaccrObserver observer) throws NaaccrIOException {
if (xmlFile == null)
throw new NaaccrIOException("Source XML file is required");
if (!xmlFile.exists())
throw new... | [
"public",
"static",
"NaaccrData",
"readXmlFile",
"(",
"File",
"xmlFile",
",",
"NaaccrOptions",
"options",
",",
"List",
"<",
"NaaccrDictionary",
">",
"userDictionaries",
",",
"NaaccrObserver",
"observer",
")",
"throws",
"NaaccrIOException",
"{",
"if",
"(",
"xmlFile",... | Reads an NAACCR XML data file and returns the corresponding data.
<br/>
ATTENTION: THIS METHOD WILL RETURN THE FULL CONTENT OF THE FILE AND IS NOT SUITABLE FOR LARGE FILE; CONSIDER USING A STREAM INSTEAD.
@param xmlFile source XML data file, must exists
@param options optional validating options
@param userDictionaries... | [
"Reads",
"an",
"NAACCR",
"XML",
"data",
"file",
"and",
"returns",
"the",
"corresponding",
"data",
".",
"<br",
"/",
">",
"ATTENTION",
":",
"THIS",
"METHOD",
"WILL",
"RETURN",
"THE",
"FULL",
"CONTENT",
"OF",
"THE",
"FILE",
"AND",
"IS",
"NOT",
"SUITABLE",
"... | train | https://github.com/imsweb/naaccr-xml/blob/a3a501faa2a0c3411dd5248b2c1379f279131696/src/main/java/com/imsweb/naaccrxml/NaaccrXmlUtils.java#L145-L162 |
OpenLiberty/open-liberty | dev/com.ibm.jbatch.container/src/com/ibm/jbatch/container/ws/JoblogUtil.java | JoblogUtil.logToJobLogAndTrace | @Trivial
public static void logToJobLogAndTrace(Level level, String msg, Object[] params, Logger traceLogger) {
"""
logs the message to joblog and trace.
Joblog and trace.log messages will be logged as per supplied logging level
"""
String formattedMsg = getFormattedMessage(msg, params, "Job event.");
lo... | java | @Trivial
public static void logToJobLogAndTrace(Level level, String msg, Object[] params, Logger traceLogger){
String formattedMsg = getFormattedMessage(msg, params, "Job event.");
logRawMsgToJobLogAndTrace(level, formattedMsg, traceLogger);
} | [
"@",
"Trivial",
"public",
"static",
"void",
"logToJobLogAndTrace",
"(",
"Level",
"level",
",",
"String",
"msg",
",",
"Object",
"[",
"]",
"params",
",",
"Logger",
"traceLogger",
")",
"{",
"String",
"formattedMsg",
"=",
"getFormattedMessage",
"(",
"msg",
",",
... | logs the message to joblog and trace.
Joblog and trace.log messages will be logged as per supplied logging level | [
"logs",
"the",
"message",
"to",
"joblog",
"and",
"trace",
".",
"Joblog",
"and",
"trace",
".",
"log",
"messages",
"will",
"be",
"logged",
"as",
"per",
"supplied",
"logging",
"level"
] | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.jbatch.container/src/com/ibm/jbatch/container/ws/JoblogUtil.java#L90-L94 |
anotheria/moskito | moskito-core/src/main/java/net/anotheria/moskito/core/registry/JMXBridgeListener.java | JMXBridgeListener.createName | private String createName(String producerId, String statName) {
"""
Creates JMX name for a producer.
@param producerId target producerId.
@param statName target statName.
@return the name for JMXBean.
"""
String appName = encodeAppName(MoskitoConfigurationHolder.getConfiguration().getApplicationName());
... | java | private String createName(String producerId, String statName) {
String appName = encodeAppName(MoskitoConfigurationHolder.getConfiguration().getApplicationName());
return "MoSKito."+(appName.length()>0 ? appName+ '.' :"")+"producers:type="+producerId+ '.' +statName;
} | [
"private",
"String",
"createName",
"(",
"String",
"producerId",
",",
"String",
"statName",
")",
"{",
"String",
"appName",
"=",
"encodeAppName",
"(",
"MoskitoConfigurationHolder",
".",
"getConfiguration",
"(",
")",
".",
"getApplicationName",
"(",
")",
")",
";",
"... | Creates JMX name for a producer.
@param producerId target producerId.
@param statName target statName.
@return the name for JMXBean. | [
"Creates",
"JMX",
"name",
"for",
"a",
"producer",
"."
] | train | https://github.com/anotheria/moskito/blob/0fdb79053b98a6ece610fa159f59bc3331e4cf05/moskito-core/src/main/java/net/anotheria/moskito/core/registry/JMXBridgeListener.java#L65-L68 |
milaboratory/milib | src/main/java/com/milaboratory/core/sequence/SequencesUtils.java | SequencesUtils.belongsToAlphabet | public static boolean belongsToAlphabet(Alphabet<?> alphabet, String string) {
"""
Check if a sequence contains letters only from specified alphabet. So in can be converted to corresponding type
of sequence.
@param alphabet alphabet
@param string string to check
@return {@literal true} if sequence belongs ... | java | public static boolean belongsToAlphabet(Alphabet<?> alphabet, String string) {
for (int i = 0; i < string.length(); ++i)
if (alphabet.symbolToCode(string.charAt(i)) == -1)
return false;
return true;
} | [
"public",
"static",
"boolean",
"belongsToAlphabet",
"(",
"Alphabet",
"<",
"?",
">",
"alphabet",
",",
"String",
"string",
")",
"{",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
"<",
"string",
".",
"length",
"(",
")",
";",
"++",
"i",
")",
"if",
"(",
... | Check if a sequence contains letters only from specified alphabet. So in can be converted to corresponding type
of sequence.
@param alphabet alphabet
@param string string to check
@return {@literal true} if sequence belongs to alphabet, {@literal false} if does not | [
"Check",
"if",
"a",
"sequence",
"contains",
"letters",
"only",
"from",
"specified",
"alphabet",
".",
"So",
"in",
"can",
"be",
"converted",
"to",
"corresponding",
"type",
"of",
"sequence",
"."
] | train | https://github.com/milaboratory/milib/blob/2349b3dccdd3c7948643760e570238d6e30d5a34/src/main/java/com/milaboratory/core/sequence/SequencesUtils.java#L39-L44 |
BlueBrain/bluima | modules/bluima_typesystem/src/main/java/de/julielab/jules/types/ace/Document.java | Document.setEvents | public void setEvents(int i, Event v) {
"""
indexed setter for events - sets an indexed value -
@generated
@param i index in the array to set
@param v value to set into the array
"""
if (Document_Type.featOkTst && ((Document_Type)jcasType).casFeat_events == null)
jcasType.jcas.throwFeatMissing("e... | java | public void setEvents(int i, Event v) {
if (Document_Type.featOkTst && ((Document_Type)jcasType).casFeat_events == null)
jcasType.jcas.throwFeatMissing("events", "de.julielab.jules.types.ace.Document");
jcasType.jcas.checkArrayBounds(jcasType.ll_cas.ll_getRefValue(addr, ((Document_Type)jcasType).casFeatC... | [
"public",
"void",
"setEvents",
"(",
"int",
"i",
",",
"Event",
"v",
")",
"{",
"if",
"(",
"Document_Type",
".",
"featOkTst",
"&&",
"(",
"(",
"Document_Type",
")",
"jcasType",
")",
".",
"casFeat_events",
"==",
"null",
")",
"jcasType",
".",
"jcas",
".",
"t... | indexed setter for events - sets an indexed value -
@generated
@param i index in the array to set
@param v value to set into the array | [
"indexed",
"setter",
"for",
"events",
"-",
"sets",
"an",
"indexed",
"value",
"-"
] | train | https://github.com/BlueBrain/bluima/blob/793ea3f46761dce72094e057a56cddfa677156ae/modules/bluima_typesystem/src/main/java/de/julielab/jules/types/ace/Document.java#L314-L318 |
SeleniumHQ/selenium | java/client/src/org/openqa/selenium/interactions/Actions.java | Actions.sendKeys | public Actions sendKeys(WebElement target, CharSequence... keys) {
"""
Equivalent to calling:
<i>Actions.click(element).sendKeys(keysToSend).</i>
This method is different from {@link WebElement#sendKeys(CharSequence...)} - see
{@link #sendKeys(CharSequence...)} for details how.
@see #sendKeys(java.lang.CharS... | java | public Actions sendKeys(WebElement target, CharSequence... keys) {
if (isBuildingActions()) {
action.addAction(new SendKeysAction(jsonKeyboard, jsonMouse, (Locatable) target, keys));
}
return focusInTicks(target).sendKeysInTicks(keys);
} | [
"public",
"Actions",
"sendKeys",
"(",
"WebElement",
"target",
",",
"CharSequence",
"...",
"keys",
")",
"{",
"if",
"(",
"isBuildingActions",
"(",
")",
")",
"{",
"action",
".",
"addAction",
"(",
"new",
"SendKeysAction",
"(",
"jsonKeyboard",
",",
"jsonMouse",
"... | Equivalent to calling:
<i>Actions.click(element).sendKeys(keysToSend).</i>
This method is different from {@link WebElement#sendKeys(CharSequence...)} - see
{@link #sendKeys(CharSequence...)} for details how.
@see #sendKeys(java.lang.CharSequence[])
@param target element to focus on.
@param keys The keys.
@return A se... | [
"Equivalent",
"to",
"calling",
":",
"<i",
">",
"Actions",
".",
"click",
"(",
"element",
")",
".",
"sendKeys",
"(",
"keysToSend",
")",
".",
"<",
"/",
"i",
">",
"This",
"method",
"is",
"different",
"from",
"{",
"@link",
"WebElement#sendKeys",
"(",
"CharSeq... | train | https://github.com/SeleniumHQ/selenium/blob/7af172729f17b20269c8ca4ea6f788db48616535/java/client/src/org/openqa/selenium/interactions/Actions.java#L183-L189 |
googleapis/google-cloud-java | google-cloud-clients/google-cloud-dataproc/src/main/java/com/google/cloud/dataproc/v1/JobControllerClient.java | JobControllerClient.getJob | public final Job getJob(String projectId, String region, String jobId) {
"""
Gets the resource representation for a job in a project.
<p>Sample code:
<pre><code>
try (JobControllerClient jobControllerClient = JobControllerClient.create()) {
String projectId = "";
String region = "";
String jobId = "";
J... | java | public final Job getJob(String projectId, String region, String jobId) {
GetJobRequest request =
GetJobRequest.newBuilder()
.setProjectId(projectId)
.setRegion(region)
.setJobId(jobId)
.build();
return getJob(request);
} | [
"public",
"final",
"Job",
"getJob",
"(",
"String",
"projectId",
",",
"String",
"region",
",",
"String",
"jobId",
")",
"{",
"GetJobRequest",
"request",
"=",
"GetJobRequest",
".",
"newBuilder",
"(",
")",
".",
"setProjectId",
"(",
"projectId",
")",
".",
"setReg... | Gets the resource representation for a job in a project.
<p>Sample code:
<pre><code>
try (JobControllerClient jobControllerClient = JobControllerClient.create()) {
String projectId = "";
String region = "";
String jobId = "";
Job response = jobControllerClient.getJob(projectId, region, jobId);
}
</code></pre>
@param... | [
"Gets",
"the",
"resource",
"representation",
"for",
"a",
"job",
"in",
"a",
"project",
"."
] | train | https://github.com/googleapis/google-cloud-java/blob/d2f0bc64a53049040fe9c9d338b12fab3dd1ad6a/google-cloud-clients/google-cloud-dataproc/src/main/java/com/google/cloud/dataproc/v1/JobControllerClient.java#L259-L268 |
actorapp/actor-platform | actor-sdk/sdk-core/core/core-shared/src/main/java/im/actor/core/Messenger.java | Messenger.saveDraft | @ObjectiveCName("saveDraftWithPeer:withDraft:")
public void saveDraft(Peer peer, String draft) {
"""
Save message draft
@param peer destination peer
@param draft message draft
"""
modules.getMessagesModule().saveDraft(peer, draft);
} | java | @ObjectiveCName("saveDraftWithPeer:withDraft:")
public void saveDraft(Peer peer, String draft) {
modules.getMessagesModule().saveDraft(peer, draft);
} | [
"@",
"ObjectiveCName",
"(",
"\"saveDraftWithPeer:withDraft:\"",
")",
"public",
"void",
"saveDraft",
"(",
"Peer",
"peer",
",",
"String",
"draft",
")",
"{",
"modules",
".",
"getMessagesModule",
"(",
")",
".",
"saveDraft",
"(",
"peer",
",",
"draft",
")",
";",
"... | Save message draft
@param peer destination peer
@param draft message draft | [
"Save",
"message",
"draft"
] | train | https://github.com/actorapp/actor-platform/blob/5123c1584757c6eeea0ed2a0e7e043629871a0c6/actor-sdk/sdk-core/core/core-shared/src/main/java/im/actor/core/Messenger.java#L1097-L1100 |
Baidu-AIP/java-sdk | src/main/java/com/baidu/aip/face/AipFace.java | AipFace.videoFaceliveness | public JSONObject videoFaceliveness(String sessionId, byte[] video, HashMap<String, String> options) {
"""
视频活体检测接口接口
@param sessionId - 语音校验码会话id,使用此接口的前提是已经调用了语音校验码接口
@param video - 二进制图像数据
@param options - 可选参数对象,key: value都为string类型
options - options列表:
@return JSONObject
"""
AipRequest requ... | java | public JSONObject videoFaceliveness(String sessionId, byte[] video, HashMap<String, String> options) {
AipRequest request = new AipRequest();
preOperation(request);
request.addBody("session_id", sessionId);
String base64Content = Base64Util.encode(video);
request.addBody("video... | [
"public",
"JSONObject",
"videoFaceliveness",
"(",
"String",
"sessionId",
",",
"byte",
"[",
"]",
"video",
",",
"HashMap",
"<",
"String",
",",
"String",
">",
"options",
")",
"{",
"AipRequest",
"request",
"=",
"new",
"AipRequest",
"(",
")",
";",
"preOperation",... | 视频活体检测接口接口
@param sessionId - 语音校验码会话id,使用此接口的前提是已经调用了语音校验码接口
@param video - 二进制图像数据
@param options - 可选参数对象,key: value都为string类型
options - options列表:
@return JSONObject | [
"视频活体检测接口接口"
] | train | https://github.com/Baidu-AIP/java-sdk/blob/16bb8b7bb8f9bbcb7c8af62d0a67a1e79eecad90/src/main/java/com/baidu/aip/face/AipFace.java#L441-L455 |
JavaEden/Orchid | OrchidCore/src/main/java/com/eden/orchid/api/theme/assets/DefaultAssetManager.java | DefaultAssetManager.addAsset | @Override
public AssetPage addAsset(AssetPage asset, boolean renderImmediately) {
"""
this point. Inline resources are rendered directly into the page, and should not be rendered as a proper resource
"""
final String assetKey = asset.getReference().toString();
if(assets.containsKey(assetKey... | java | @Override
public AssetPage addAsset(AssetPage asset, boolean renderImmediately) {
final String assetKey = asset.getReference().toString();
if(assets.containsKey(assetKey)) {
return assets.get(assetKey);
}
else {
assets.put(assetKey, asset);
if(rend... | [
"@",
"Override",
"public",
"AssetPage",
"addAsset",
"(",
"AssetPage",
"asset",
",",
"boolean",
"renderImmediately",
")",
"{",
"final",
"String",
"assetKey",
"=",
"asset",
".",
"getReference",
"(",
")",
".",
"toString",
"(",
")",
";",
"if",
"(",
"assets",
"... | this point. Inline resources are rendered directly into the page, and should not be rendered as a proper resource | [
"this",
"point",
".",
"Inline",
"resources",
"are",
"rendered",
"directly",
"into",
"the",
"page",
"and",
"should",
"not",
"be",
"rendered",
"as",
"a",
"proper",
"resource"
] | train | https://github.com/JavaEden/Orchid/blob/47cde156fc3a7aea894cde41b7f76c503dad9811/OrchidCore/src/main/java/com/eden/orchid/api/theme/assets/DefaultAssetManager.java#L52-L66 |
recommenders/rival | rival-core/src/main/java/net/recommenders/rival/core/DataModel.java | DataModel.getUserItemPreference | @Override
public Double getUserItemPreference(U u, I i) {
"""
Method that returns the preference between a user and an item.
@param u the user.
@param i the item.
@return the preference between a user and an item or NaN.
"""
if (userItemPreferences.containsKey(u) && userItemPreferences.get(u).... | java | @Override
public Double getUserItemPreference(U u, I i) {
if (userItemPreferences.containsKey(u) && userItemPreferences.get(u).containsKey(i)) {
return userItemPreferences.get(u).get(i);
}
return Double.NaN;
} | [
"@",
"Override",
"public",
"Double",
"getUserItemPreference",
"(",
"U",
"u",
",",
"I",
"i",
")",
"{",
"if",
"(",
"userItemPreferences",
".",
"containsKey",
"(",
"u",
")",
"&&",
"userItemPreferences",
".",
"get",
"(",
"u",
")",
".",
"containsKey",
"(",
"i... | Method that returns the preference between a user and an item.
@param u the user.
@param i the item.
@return the preference between a user and an item or NaN. | [
"Method",
"that",
"returns",
"the",
"preference",
"between",
"a",
"user",
"and",
"an",
"item",
"."
] | train | https://github.com/recommenders/rival/blob/6ee8223e91810ae1c6052899595af3906e0c34c6/rival-core/src/main/java/net/recommenders/rival/core/DataModel.java#L88-L94 |
apptentive/apptentive-android | apptentive/src/main/java/com/apptentive/android/sdk/conversation/Conversation.java | Conversation.migrateConversationData | boolean migrateConversationData() throws SerializerException {
"""
Attempts to migrate from the legacy clear text format.
@return <code>false</code> if failed.
"""
long start = System.currentTimeMillis();
File legacyConversationDataFile = Util.getUnencryptedFilename(conversationDataFile);
if (legacyCo... | java | boolean migrateConversationData() throws SerializerException {
long start = System.currentTimeMillis();
File legacyConversationDataFile = Util.getUnencryptedFilename(conversationDataFile);
if (legacyConversationDataFile.exists()) {
try {
ApptentiveLog.d(CONVERSATION, "Migrating %sconversation data...", has... | [
"boolean",
"migrateConversationData",
"(",
")",
"throws",
"SerializerException",
"{",
"long",
"start",
"=",
"System",
".",
"currentTimeMillis",
"(",
")",
";",
"File",
"legacyConversationDataFile",
"=",
"Util",
".",
"getUnencryptedFilename",
"(",
"conversationDataFile",
... | Attempts to migrate from the legacy clear text format.
@return <code>false</code> if failed. | [
"Attempts",
"to",
"migrate",
"from",
"the",
"legacy",
"clear",
"text",
"format",
"."
] | train | https://github.com/apptentive/apptentive-android/blob/887c08d7bd5ae6488a90366dfb58f58938861a93/apptentive/src/main/java/com/apptentive/android/sdk/conversation/Conversation.java#L399-L417 |
marklogic/java-client-api | marklogic-client-api/src/main/java/com/marklogic/client/query/StructuredQueryBuilder.java | StructuredQueryBuilder.temporalPeriodRange | public StructuredQueryDefinition temporalPeriodRange(Axis axis, TemporalOperator operator,
Period period, String... options) {
"""
Matches documents that have a value in the specified axis that matches the specified
period using the specified operator.
@para... | java | public StructuredQueryDefinition temporalPeriodRange(Axis axis, TemporalOperator operator,
Period period, String... options)
{
if ( axis == null ) throw new IllegalArgumentException("axis cannot be null");
if ( period == null ) throw new IllegalArgumentEx... | [
"public",
"StructuredQueryDefinition",
"temporalPeriodRange",
"(",
"Axis",
"axis",
",",
"TemporalOperator",
"operator",
",",
"Period",
"period",
",",
"String",
"...",
"options",
")",
"{",
"if",
"(",
"axis",
"==",
"null",
")",
"throw",
"new",
"IllegalArgumentExcept... | Matches documents that have a value in the specified axis that matches the specified
period using the specified operator.
@param axis the axis of document temporal values used to determine which documents have
values that match this query
@param operator the operator used to determine if values in the axis match the sp... | [
"Matches",
"documents",
"that",
"have",
"a",
"value",
"in",
"the",
"specified",
"axis",
"that",
"matches",
"the",
"specified",
"period",
"using",
"the",
"specified",
"operator",
"."
] | train | https://github.com/marklogic/java-client-api/blob/acf60229a928abd4a8cc4b21b641d56957467da7/marklogic-client-api/src/main/java/com/marklogic/client/query/StructuredQueryBuilder.java#L2779-L2785 |
appium/java-client | src/main/java/io/appium/java_client/service/local/AppiumDriverLocalService.java | AppiumDriverLocalService.addSlf4jLogMessageConsumer | public void addSlf4jLogMessageConsumer(BiConsumer<String, Slf4jLogMessageContext> slf4jLogMessageConsumer) {
"""
When a complete log message is available (from server output data) that
message is parsed for its slf4j context (logger name, logger level etc.)
and the specified {@code BiConsumer} is invoked with th... | java | public void addSlf4jLogMessageConsumer(BiConsumer<String, Slf4jLogMessageContext> slf4jLogMessageConsumer) {
checkNotNull(slf4jLogMessageConsumer, "slf4jLogMessageConsumer parameter is NULL!");
addLogMessageConsumer(logMessage -> {
slf4jLogMessageConsumer.accept(logMessage, parseSlf4jContext... | [
"public",
"void",
"addSlf4jLogMessageConsumer",
"(",
"BiConsumer",
"<",
"String",
",",
"Slf4jLogMessageContext",
">",
"slf4jLogMessageConsumer",
")",
"{",
"checkNotNull",
"(",
"slf4jLogMessageConsumer",
",",
"\"slf4jLogMessageConsumer parameter is NULL!\"",
")",
";",
"addLogM... | When a complete log message is available (from server output data) that
message is parsed for its slf4j context (logger name, logger level etc.)
and the specified {@code BiConsumer} is invoked with the log message and
slf4j context.
<p>Use this method only if you want a behavior that differentiates from the
default be... | [
"When",
"a",
"complete",
"log",
"message",
"is",
"available",
"(",
"from",
"server",
"output",
"data",
")",
"that",
"message",
"is",
"parsed",
"for",
"its",
"slf4j",
"context",
"(",
"logger",
"name",
"logger",
"level",
"etc",
".",
")",
"and",
"the",
"spe... | train | https://github.com/appium/java-client/blob/5a17759b05d6fda8ef425b3ab6e766c73ed2e8df/src/main/java/io/appium/java_client/service/local/AppiumDriverLocalService.java#L310-L315 |
UrielCh/ovh-java-sdk | ovh-java-sdk-dbaasqueue/src/main/java/net/minidev/ovh/api/ApiOvhDbaasqueue.java | ApiOvhDbaasqueue.serviceName_role_roleName_GET | public OvhRole serviceName_role_roleName_GET(String serviceName, String roleName) throws IOException {
"""
Get a role
REST: GET /dbaas/queue/{serviceName}/role/{roleName}
@param serviceName [required] Application ID
@param roleName [required] Role name
API beta
"""
String qPath = "/dbaas/queue/{servi... | java | public OvhRole serviceName_role_roleName_GET(String serviceName, String roleName) throws IOException {
String qPath = "/dbaas/queue/{serviceName}/role/{roleName}";
StringBuilder sb = path(qPath, serviceName, roleName);
String resp = exec(qPath, "GET", sb.toString(), null);
return convertTo(resp, OvhRole.class);... | [
"public",
"OvhRole",
"serviceName_role_roleName_GET",
"(",
"String",
"serviceName",
",",
"String",
"roleName",
")",
"throws",
"IOException",
"{",
"String",
"qPath",
"=",
"\"/dbaas/queue/{serviceName}/role/{roleName}\"",
";",
"StringBuilder",
"sb",
"=",
"path",
"(",
"qPa... | Get a role
REST: GET /dbaas/queue/{serviceName}/role/{roleName}
@param serviceName [required] Application ID
@param roleName [required] Role name
API beta | [
"Get",
"a",
"role"
] | train | https://github.com/UrielCh/ovh-java-sdk/blob/6d531a40e56e09701943e334c25f90f640c55701/ovh-java-sdk-dbaasqueue/src/main/java/net/minidev/ovh/api/ApiOvhDbaasqueue.java#L211-L216 |
jbundle/jbundle | thin/base/remote/src/main/java/org/jbundle/thin/base/remote/proxy/transport/BaseTransport.java | BaseTransport.addParam | public void addParam(String strParam, Map<String,Object> properties) {
"""
Add this method param to the param list.
@param strParam The param name.
@param strValue The param value.
"""
this.addParam(strParam, (Object)properties);
} | java | public void addParam(String strParam, Map<String,Object> properties)
{
this.addParam(strParam, (Object)properties);
} | [
"public",
"void",
"addParam",
"(",
"String",
"strParam",
",",
"Map",
"<",
"String",
",",
"Object",
">",
"properties",
")",
"{",
"this",
".",
"addParam",
"(",
"strParam",
",",
"(",
"Object",
")",
"properties",
")",
";",
"}"
] | Add this method param to the param list.
@param strParam The param name.
@param strValue The param value. | [
"Add",
"this",
"method",
"param",
"to",
"the",
"param",
"list",
"."
] | train | https://github.com/jbundle/jbundle/blob/4037fcfa85f60c7d0096c453c1a3cd573c2b0abc/thin/base/remote/src/main/java/org/jbundle/thin/base/remote/proxy/transport/BaseTransport.java#L120-L123 |
cubedtear/aritzh | aritzh-core/src/main/java/io/github/aritzhack/aritzh/timing/Profiler.java | Profiler.getInstance | public static Profiler getInstance(String name, boolean verbose) {
"""
Returns a specific instance of profiler, specifying verbosity
<br>
<p style="color: red">
NOTE: Verbosity is not guaranteed. since loggers are cached, if there was another
profiler with the specified name and it was not verbose, that instan... | java | public static Profiler getInstance(String name, boolean verbose) {
if (Profiler.profilers.containsKey(name)) return Profiler.profilers.get(name);
else {
Profiler p = new Profiler(verbose);
Profiler.profilers.put(name, p);
return p;
}
} | [
"public",
"static",
"Profiler",
"getInstance",
"(",
"String",
"name",
",",
"boolean",
"verbose",
")",
"{",
"if",
"(",
"Profiler",
".",
"profilers",
".",
"containsKey",
"(",
"name",
")",
")",
"return",
"Profiler",
".",
"profilers",
".",
"get",
"(",
"name",
... | Returns a specific instance of profiler, specifying verbosity
<br>
<p style="color: red">
NOTE: Verbosity is not guaranteed. since loggers are cached, if there was another
profiler with the specified name and it was not verbose, that instance will be
returned. To set the verbosity afterwards see {@link Profiler#setVerb... | [
"Returns",
"a",
"specific",
"instance",
"of",
"profiler",
"specifying",
"verbosity",
"<br",
">",
"<p",
"style",
"=",
"color",
":",
"red",
">",
"NOTE",
":",
"Verbosity",
"is",
"not",
"guaranteed",
".",
"since",
"loggers",
"are",
"cached",
"if",
"there",
"wa... | train | https://github.com/cubedtear/aritzh/blob/bc7493447a1a6088c4a7306ca4d0f0c20278364f/aritzh-core/src/main/java/io/github/aritzhack/aritzh/timing/Profiler.java#L87-L94 |
google/j2objc | jre_emul/android/platform/external/icu/android_icu4j/src/main/java/android/icu/text/RuleBasedCollator.java | RuleBasedCollator.getContractionsAndExpansions | public void getContractionsAndExpansions(UnicodeSet contractions, UnicodeSet expansions, boolean addPrefixes)
throws Exception {
"""
Gets unicode sets containing contractions and/or expansions of a collator
@param contractions
if not null, set to contain contractions
@param expansions
if not null... | java | public void getContractionsAndExpansions(UnicodeSet contractions, UnicodeSet expansions, boolean addPrefixes)
throws Exception {
if (contractions != null) {
contractions.clear();
}
if (expansions != null) {
expansions.clear();
}
new Contraction... | [
"public",
"void",
"getContractionsAndExpansions",
"(",
"UnicodeSet",
"contractions",
",",
"UnicodeSet",
"expansions",
",",
"boolean",
"addPrefixes",
")",
"throws",
"Exception",
"{",
"if",
"(",
"contractions",
"!=",
"null",
")",
"{",
"contractions",
".",
"clear",
"... | Gets unicode sets containing contractions and/or expansions of a collator
@param contractions
if not null, set to contain contractions
@param expansions
if not null, set to contain expansions
@param addPrefixes
add the prefix contextual elements to contractions
@throws Exception
Throws an exception if any errors occur... | [
"Gets",
"unicode",
"sets",
"containing",
"contractions",
"and",
"/",
"or",
"expansions",
"of",
"a",
"collator"
] | train | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/external/icu/android_icu4j/src/main/java/android/icu/text/RuleBasedCollator.java#L989-L998 |
citrusframework/citrus | modules/citrus-ftp/src/main/java/com/consol/citrus/ftp/client/SftpEndpointComponent.java | SftpEndpointComponent.getPort | private Integer getPort(String resourcePath, FtpEndpointConfiguration endpointConfiguration) {
"""
Extract port number from resource path. If not present use default port from endpoint configuration.
@param resourcePath
@param endpointConfiguration
@return
"""
if (resourcePath.contains(":")) {
... | java | private Integer getPort(String resourcePath, FtpEndpointConfiguration endpointConfiguration) {
if (resourcePath.contains(":")) {
return Integer.valueOf(resourcePath.split(":")[1]);
}
return endpointConfiguration.getPort();
} | [
"private",
"Integer",
"getPort",
"(",
"String",
"resourcePath",
",",
"FtpEndpointConfiguration",
"endpointConfiguration",
")",
"{",
"if",
"(",
"resourcePath",
".",
"contains",
"(",
"\":\"",
")",
")",
"{",
"return",
"Integer",
".",
"valueOf",
"(",
"resourcePath",
... | Extract port number from resource path. If not present use default port from endpoint configuration.
@param resourcePath
@param endpointConfiguration
@return | [
"Extract",
"port",
"number",
"from",
"resource",
"path",
".",
"If",
"not",
"present",
"use",
"default",
"port",
"from",
"endpoint",
"configuration",
"."
] | train | https://github.com/citrusframework/citrus/blob/55c58ef74c01d511615e43646ca25c1b2301c56d/modules/citrus-ftp/src/main/java/com/consol/citrus/ftp/client/SftpEndpointComponent.java#L57-L63 |
xwiki/xwiki-commons | xwiki-commons-core/xwiki-commons-xml/src/main/java/org/xwiki/xml/html/filter/AbstractHTMLFilter.java | AbstractHTMLFilter.hasAttribute | protected boolean hasAttribute(List<Element> elements, String attributeName, boolean checkValue) {
"""
Utility method for checking if a list of elements have the same attribute set. If the checkValue is true, the
values of the given attribute will be checked for equivalency.
@param elements the list of element... | java | protected boolean hasAttribute(List<Element> elements, String attributeName, boolean checkValue)
{
boolean hasAttribute = true;
if (!checkValue) {
for (Element e : elements) {
hasAttribute = e.hasAttribute(attributeName) ? hasAttribute : false;
}
} els... | [
"protected",
"boolean",
"hasAttribute",
"(",
"List",
"<",
"Element",
">",
"elements",
",",
"String",
"attributeName",
",",
"boolean",
"checkValue",
")",
"{",
"boolean",
"hasAttribute",
"=",
"true",
";",
"if",
"(",
"!",
"checkValue",
")",
"{",
"for",
"(",
"... | Utility method for checking if a list of elements have the same attribute set. If the checkValue is true, the
values of the given attribute will be checked for equivalency.
@param elements the list of elements.
@param attributeName Name of the attribute.
@param checkValue flag indicating if the value of the attribute ... | [
"Utility",
"method",
"for",
"checking",
"if",
"a",
"list",
"of",
"elements",
"have",
"the",
"same",
"attribute",
"set",
".",
"If",
"the",
"checkValue",
"is",
"true",
"the",
"values",
"of",
"the",
"given",
"attribute",
"will",
"be",
"checked",
"for",
"equiv... | train | https://github.com/xwiki/xwiki-commons/blob/5374d8c6d966588c1eac7392c83da610dfb9f129/xwiki-commons-core/xwiki-commons-xml/src/main/java/org/xwiki/xml/html/filter/AbstractHTMLFilter.java#L110-L125 |
radkovo/jStyleParser | src/main/java/cz/vutbr/web/csskit/OutputUtil.java | OutputUtil.appendFunctionArgs | public static StringBuilder appendFunctionArgs(StringBuilder sb, List<Term<?>> list) {
"""
Appends the formatted list of function arguments to a string builder. The individual
arguments are separated by spaces with the exception of commas.
@param sb the string builder to be modified
@param list the list of func... | java | public static StringBuilder appendFunctionArgs(StringBuilder sb, List<Term<?>> list) {
Term<?> prev = null, pprev = null;
for (Term<?> elem : list) {
boolean sep = true;
if (elem instanceof TermOperator && ((TermOperator) elem).getValue() == ',')
sep = f... | [
"public",
"static",
"StringBuilder",
"appendFunctionArgs",
"(",
"StringBuilder",
"sb",
",",
"List",
"<",
"Term",
"<",
"?",
">",
">",
"list",
")",
"{",
"Term",
"<",
"?",
">",
"prev",
"=",
"null",
",",
"pprev",
"=",
"null",
";",
"for",
"(",
"Term",
"<"... | Appends the formatted list of function arguments to a string builder. The individual
arguments are separated by spaces with the exception of commas.
@param sb the string builder to be modified
@param list the list of function arguments
@return Modified <code>sb</code> to allow chaining | [
"Appends",
"the",
"formatted",
"list",
"of",
"function",
"arguments",
"to",
"a",
"string",
"builder",
".",
"The",
"individual",
"arguments",
"are",
"separated",
"by",
"spaces",
"with",
"the",
"exception",
"of",
"commas",
"."
] | train | https://github.com/radkovo/jStyleParser/blob/8ab049ac6866aa52c4d7deee25c9e294e7191957/src/main/java/cz/vutbr/web/csskit/OutputUtil.java#L179-L199 |
lessthanoptimal/BoofCV | main/boofcv-ip/src/main/java/boofcv/misc/CircularIndex.java | CircularIndex.distanceP | public static int distanceP(int index0, int index1, int size) {
"""
Returns how many elements away in the positive direction you need to travel to get from
index0 to index1.
@param index0 element in circular buffer
@param index1 element in circular buffer
@param size size of the circular buffer
@return posi... | java | public static int distanceP(int index0, int index1, int size) {
int difference = index1-index0;
if( difference < 0 ) {
difference = size+difference;
}
return difference;
} | [
"public",
"static",
"int",
"distanceP",
"(",
"int",
"index0",
",",
"int",
"index1",
",",
"int",
"size",
")",
"{",
"int",
"difference",
"=",
"index1",
"-",
"index0",
";",
"if",
"(",
"difference",
"<",
"0",
")",
"{",
"difference",
"=",
"size",
"+",
"di... | Returns how many elements away in the positive direction you need to travel to get from
index0 to index1.
@param index0 element in circular buffer
@param index1 element in circular buffer
@param size size of the circular buffer
@return positive distance | [
"Returns",
"how",
"many",
"elements",
"away",
"in",
"the",
"positive",
"direction",
"you",
"need",
"to",
"travel",
"to",
"get",
"from",
"index0",
"to",
"index1",
"."
] | train | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-ip/src/main/java/boofcv/misc/CircularIndex.java#L82-L88 |
gallandarakhneorg/afc | core/vmutils/src/main/java/org/arakhne/afc/vmutil/DynamicURLClassLoader.java | DynamicURLClassLoader.findClass | @Override
@Pure
protected Class<?> findClass(final String name) throws ClassNotFoundException {
"""
Finds and loads the class with the specified name from the URL search
path. Any URLs referring to JAR files are loaded and opened as needed
until the class is found.
@param name the name of the class
@return... | java | @Override
@Pure
protected Class<?> findClass(final String name) throws ClassNotFoundException {
try {
return AccessController.doPrivileged(new PrivilegedExceptionAction<Class<?>>() {
@Override
public Class<?> run() throws ClassNotFoundException {
final String path = name.replace('.', '/').concat(".c... | [
"@",
"Override",
"@",
"Pure",
"protected",
"Class",
"<",
"?",
">",
"findClass",
"(",
"final",
"String",
"name",
")",
"throws",
"ClassNotFoundException",
"{",
"try",
"{",
"return",
"AccessController",
".",
"doPrivileged",
"(",
"new",
"PrivilegedExceptionAction",
... | Finds and loads the class with the specified name from the URL search
path. Any URLs referring to JAR files are loaded and opened as needed
until the class is found.
@param name the name of the class
@return the resulting class
@exception ClassNotFoundException if the class could not be found | [
"Finds",
"and",
"loads",
"the",
"class",
"with",
"the",
"specified",
"name",
"from",
"the",
"URL",
"search",
"path",
".",
"Any",
"URLs",
"referring",
"to",
"JAR",
"files",
"are",
"loaded",
"and",
"opened",
"as",
"needed",
"until",
"the",
"class",
"is",
"... | train | https://github.com/gallandarakhneorg/afc/blob/0c7d2e1ddefd4167ef788416d970a6c1ef6f8bbb/core/vmutils/src/main/java/org/arakhne/afc/vmutil/DynamicURLClassLoader.java#L177-L199 |
lucmoreau/ProvToolbox | prov-model/src/main/java/org/openprovenance/prov/model/ProvFactory.java | ProvFactory.newWasGeneratedBy | public WasGeneratedBy newWasGeneratedBy(QualifiedName id, QualifiedName entity, QualifiedName activity) {
"""
A factory method to create an instance of a generation {@link WasGeneratedBy}
@param id an optional identifier for a usage
@param entity an identifier for the created <a href="http://www.w3.org/TR/prov-d... | java | public WasGeneratedBy newWasGeneratedBy(QualifiedName id, QualifiedName entity, QualifiedName activity) {
WasGeneratedBy res=newWasGeneratedBy(id,entity,null,activity);
return res;
} | [
"public",
"WasGeneratedBy",
"newWasGeneratedBy",
"(",
"QualifiedName",
"id",
",",
"QualifiedName",
"entity",
",",
"QualifiedName",
"activity",
")",
"{",
"WasGeneratedBy",
"res",
"=",
"newWasGeneratedBy",
"(",
"id",
",",
"entity",
",",
"null",
",",
"activity",
")",... | A factory method to create an instance of a generation {@link WasGeneratedBy}
@param id an optional identifier for a usage
@param entity an identifier for the created <a href="http://www.w3.org/TR/prov-dm/#generation.entity">entity</a>
@param activity an optional identifier for the <a href="http://www.w3.org/TR/prov-d... | [
"A",
"factory",
"method",
"to",
"create",
"an",
"instance",
"of",
"a",
"generation",
"{"
] | train | https://github.com/lucmoreau/ProvToolbox/blob/f865952868ffb69432937b08728c86bebbe4678a/prov-model/src/main/java/org/openprovenance/prov/model/ProvFactory.java#L1331-L1334 |
kkopacz/agiso-core | bundles/agiso-core-lang/src/main/java/org/agiso/core/lang/util/ConvertUtils.java | ConvertUtils.toDigest | public static String toDigest(byte[] bytes, String algorithm) throws NoSuchAlgorithmException {
"""
Konwertuje tablicę bajtów na skrót zgodnie z algorytmem określonym przez
parametr wywołania <code>algorithm</code>.
@param bytes Tablica bajtów do konwersji.
@param algorithm Algorytm wyznaczenia skrótu.
@re... | java | public static String toDigest(byte[] bytes, String algorithm) throws NoSuchAlgorithmException {
MessageDigest digest = MessageDigest.getInstance("MD5");
digest.update(bytes);
byte[] hash = digest.digest();
StringBuffer result = new StringBuffer();
for(int i = 0; i < hash.length; i++) {
String s = Integer.... | [
"public",
"static",
"String",
"toDigest",
"(",
"byte",
"[",
"]",
"bytes",
",",
"String",
"algorithm",
")",
"throws",
"NoSuchAlgorithmException",
"{",
"MessageDigest",
"digest",
"=",
"MessageDigest",
".",
"getInstance",
"(",
"\"MD5\"",
")",
";",
"digest",
".",
... | Konwertuje tablicę bajtów na skrót zgodnie z algorytmem określonym przez
parametr wywołania <code>algorithm</code>.
@param bytes Tablica bajtów do konwersji.
@param algorithm Algorytm wyznaczenia skrótu.
@return Łańcuch reprezentujący skrót.
@throws NoSuchAlgorithmException | [
"Konwertuje",
"tablicę",
"bajtów",
"na",
"skrót",
"zgodnie",
"z",
"algorytmem",
"określonym",
"przez",
"parametr",
"wywołania",
"<code",
">",
"algorithm<",
"/",
"code",
">",
"."
] | train | https://github.com/kkopacz/agiso-core/blob/b994ec0146be1fe3f10829d69cd719bdbdebe1c5/bundles/agiso-core-lang/src/main/java/org/agiso/core/lang/util/ConvertUtils.java#L212-L229 |
intuit/QuickBooks-V3-Java-SDK | ipp-v3-java-devkit/src/main/java/com/intuit/ipp/util/Config.java | Config.setProperty | public static void setProperty(String key, String value) {
"""
Sets the property to the configuration
@param key
@param value
"""
local.get().cc.setProperty(key, value);
} | java | public static void setProperty(String key, String value) {
local.get().cc.setProperty(key, value);
} | [
"public",
"static",
"void",
"setProperty",
"(",
"String",
"key",
",",
"String",
"value",
")",
"{",
"local",
".",
"get",
"(",
")",
".",
"cc",
".",
"setProperty",
"(",
"key",
",",
"value",
")",
";",
"}"
] | Sets the property to the configuration
@param key
@param value | [
"Sets",
"the",
"property",
"to",
"the",
"configuration"
] | train | https://github.com/intuit/QuickBooks-V3-Java-SDK/blob/59f988d0776d46620d0b34711c411b2b5b1da06b/ipp-v3-java-devkit/src/main/java/com/intuit/ipp/util/Config.java#L251-L253 |
google/closure-compiler | src/com/google/javascript/jscomp/PolymerPassStaticUtils.java | PolymerPassStaticUtils.collectConstructorPropertyJsDoc | private static void collectConstructorPropertyJsDoc(Node node, Map<String, JSDocInfo> map) {
"""
Find the properties that are initialized in the given constructor, and return a map from each
property name to its JSDoc.
@param node The constructor function node to traverse.
@param map The map from property nam... | java | private static void collectConstructorPropertyJsDoc(Node node, Map<String, JSDocInfo> map) {
checkNotNull(node);
for (Node child : node.children()) {
if (child.isGetProp()
&& child.getFirstChild().isThis()
&& child.getSecondChild().isString()) {
// We found a "this.foo" express... | [
"private",
"static",
"void",
"collectConstructorPropertyJsDoc",
"(",
"Node",
"node",
",",
"Map",
"<",
"String",
",",
"JSDocInfo",
">",
"map",
")",
"{",
"checkNotNull",
"(",
"node",
")",
";",
"for",
"(",
"Node",
"child",
":",
"node",
".",
"children",
"(",
... | Find the properties that are initialized in the given constructor, and return a map from each
property name to its JSDoc.
@param node The constructor function node to traverse.
@param map The map from property name to JSDoc. | [
"Find",
"the",
"properties",
"that",
"are",
"initialized",
"in",
"the",
"given",
"constructor",
"and",
"return",
"a",
"map",
"from",
"each",
"property",
"name",
"to",
"its",
"JSDoc",
"."
] | train | https://github.com/google/closure-compiler/blob/d81e36740f6a9e8ac31a825ee8758182e1dc5aae/src/com/google/javascript/jscomp/PolymerPassStaticUtils.java#L184-L201 |
spring-projects/spring-security-oauth | spring-security-oauth/src/main/java/org/springframework/security/oauth/consumer/client/CoreOAuthConsumerSupport.java | CoreOAuthConsumerSupport.configureURLForProtectedAccess | public URL configureURLForProtectedAccess(URL url, OAuthConsumerToken accessToken, String httpMethod, Map<String, String> additionalParameters) throws OAuthRequestFailedException {
"""
Create a configured URL. If the HTTP method to access the resource is "POST" or "PUT" and the "Authorization"
header isn't suppo... | java | public URL configureURLForProtectedAccess(URL url, OAuthConsumerToken accessToken, String httpMethod, Map<String, String> additionalParameters) throws OAuthRequestFailedException {
return configureURLForProtectedAccess(url, accessToken, getProtectedResourceDetailsService().loadProtectedResourceDetailsById(accessTok... | [
"public",
"URL",
"configureURLForProtectedAccess",
"(",
"URL",
"url",
",",
"OAuthConsumerToken",
"accessToken",
",",
"String",
"httpMethod",
",",
"Map",
"<",
"String",
",",
"String",
">",
"additionalParameters",
")",
"throws",
"OAuthRequestFailedException",
"{",
"retu... | Create a configured URL. If the HTTP method to access the resource is "POST" or "PUT" and the "Authorization"
header isn't supported, then the OAuth parameters will be expected to be sent in the body of the request. Otherwise,
you can assume that the given URL is ready to be used without further work.
@param url ... | [
"Create",
"a",
"configured",
"URL",
".",
"If",
"the",
"HTTP",
"method",
"to",
"access",
"the",
"resource",
"is",
"POST",
"or",
"PUT",
"and",
"the",
"Authorization",
"header",
"isn",
"t",
"supported",
"then",
"the",
"OAuth",
"parameters",
"will",
"be",
"exp... | train | https://github.com/spring-projects/spring-security-oauth/blob/bbae0027eceb2c74a21ac26bbc86142dc732ffbe/spring-security-oauth/src/main/java/org/springframework/security/oauth/consumer/client/CoreOAuthConsumerSupport.java#L258-L260 |
mapsforge/mapsforge | mapsforge-core/src/main/java/org/mapsforge/core/util/MercatorProjection.java | MercatorProjection.longitudeToPixelXWithScaleFactor | public static double longitudeToPixelXWithScaleFactor(double longitude, double scaleFactor, int tileSize) {
"""
Converts a longitude coordinate (in degrees) to a pixel X coordinate at a certain scale factor.
@param longitude the longitude coordinate that should be converted.
@param scaleFactor the scale fact... | java | public static double longitudeToPixelXWithScaleFactor(double longitude, double scaleFactor, int tileSize) {
long mapSize = getMapSizeWithScaleFactor(scaleFactor, tileSize);
return (longitude + 180) / 360 * mapSize;
} | [
"public",
"static",
"double",
"longitudeToPixelXWithScaleFactor",
"(",
"double",
"longitude",
",",
"double",
"scaleFactor",
",",
"int",
"tileSize",
")",
"{",
"long",
"mapSize",
"=",
"getMapSizeWithScaleFactor",
"(",
"scaleFactor",
",",
"tileSize",
")",
";",
"return"... | Converts a longitude coordinate (in degrees) to a pixel X coordinate at a certain scale factor.
@param longitude the longitude coordinate that should be converted.
@param scaleFactor the scale factor at which the coordinate should be converted.
@return the pixel X coordinate of the longitude value. | [
"Converts",
"a",
"longitude",
"coordinate",
"(",
"in",
"degrees",
")",
"to",
"a",
"pixel",
"X",
"coordinate",
"at",
"a",
"certain",
"scale",
"factor",
"."
] | train | https://github.com/mapsforge/mapsforge/blob/c49c83f7f727552f793dff15cefa532ade030842/mapsforge-core/src/main/java/org/mapsforge/core/util/MercatorProjection.java#L253-L256 |
ef-labs/vertx-when | vertx-when/src/main/java/com/englishtown/vertx/promises/RequestOptions.java | RequestOptions.addHeader | public RequestOptions addHeader(String name, String value) {
"""
Add a header to the request. Can be called multiple times to add multiple headers
@param name
@param value
@return
"""
if (headers == null) {
headers = new CaseInsensitiveHeaders();
}
headers.add(name, va... | java | public RequestOptions addHeader(String name, String value) {
if (headers == null) {
headers = new CaseInsensitiveHeaders();
}
headers.add(name, value);
return this;
} | [
"public",
"RequestOptions",
"addHeader",
"(",
"String",
"name",
",",
"String",
"value",
")",
"{",
"if",
"(",
"headers",
"==",
"null",
")",
"{",
"headers",
"=",
"new",
"CaseInsensitiveHeaders",
"(",
")",
";",
"}",
"headers",
".",
"add",
"(",
"name",
",",
... | Add a header to the request. Can be called multiple times to add multiple headers
@param name
@param value
@return | [
"Add",
"a",
"header",
"to",
"the",
"request",
".",
"Can",
"be",
"called",
"multiple",
"times",
"to",
"add",
"multiple",
"headers"
] | train | https://github.com/ef-labs/vertx-when/blob/dc4fde973f58130f2eb2159206ee78b867048f4d/vertx-when/src/main/java/com/englishtown/vertx/promises/RequestOptions.java#L69-L75 |
alibaba/jstorm | jstorm-hdfs/src/main/java/com/alibaba/jstorm/hdfs/spout/FileLock.java | FileLock.takeOwnership | public static FileLock takeOwnership(FileSystem fs, Path lockFile, LogEntry lastEntry, String spoutId)
throws IOException {
"""
Takes ownership of the lock file if possible.
@param lockFile
@param lastEntry last entry in the lock file. this param is an optimization.
we dont scan the lock file again ... | java | public static FileLock takeOwnership(FileSystem fs, Path lockFile, LogEntry lastEntry, String spoutId)
throws IOException {
try {
if(fs instanceof DistributedFileSystem ) {
if( !((DistributedFileSystem) fs).recoverLease(lockFile) ) {
LOG.warn("Unable to recover lease on lock file {... | [
"public",
"static",
"FileLock",
"takeOwnership",
"(",
"FileSystem",
"fs",
",",
"Path",
"lockFile",
",",
"LogEntry",
"lastEntry",
",",
"String",
"spoutId",
")",
"throws",
"IOException",
"{",
"try",
"{",
"if",
"(",
"fs",
"instanceof",
"DistributedFileSystem",
")",... | Takes ownership of the lock file if possible.
@param lockFile
@param lastEntry last entry in the lock file. this param is an optimization.
we dont scan the lock file again to find its last entry here since
its already been done once by the logic used to check if the lock
file is stale. so this value comes from that e... | [
"Takes",
"ownership",
"of",
"the",
"lock",
"file",
"if",
"possible",
"."
] | train | https://github.com/alibaba/jstorm/blob/5d6cde22dbca7df3d6e6830bf94f98a6639ab559/jstorm-hdfs/src/main/java/com/alibaba/jstorm/hdfs/spout/FileLock.java#L193-L213 |
liferay/com-liferay-commerce | commerce-product-service/src/main/java/com/liferay/commerce/product/service/persistence/impl/CPDefinitionPersistenceImpl.java | CPDefinitionPersistenceImpl.fetchByUUID_G | @Override
public CPDefinition fetchByUUID_G(String uuid, long groupId) {
"""
Returns the cp definition where uuid = ? and groupId = ? or returns <code>null</code> if it could not be found. Uses the finder cache.
@param uuid the uuid
@param groupId the group ID
@return the matching cp definition, or <... | java | @Override
public CPDefinition fetchByUUID_G(String uuid, long groupId) {
return fetchByUUID_G(uuid, groupId, true);
} | [
"@",
"Override",
"public",
"CPDefinition",
"fetchByUUID_G",
"(",
"String",
"uuid",
",",
"long",
"groupId",
")",
"{",
"return",
"fetchByUUID_G",
"(",
"uuid",
",",
"groupId",
",",
"true",
")",
";",
"}"
] | Returns the cp definition where uuid = ? and groupId = ? or returns <code>null</code> if it could not be found. Uses the finder cache.
@param uuid the uuid
@param groupId the group ID
@return the matching cp definition, or <code>null</code> if a matching cp definition could not be found | [
"Returns",
"the",
"cp",
"definition",
"where",
"uuid",
"=",
"?",
";",
"and",
"groupId",
"=",
"?",
";",
"or",
"returns",
"<code",
">",
"null<",
"/",
"code",
">",
"if",
"it",
"could",
"not",
"be",
"found",
".",
"Uses",
"the",
"finder",
"cache",
"... | train | https://github.com/liferay/com-liferay-commerce/blob/9e54362d7f59531fc684016ba49ee7cdc3a2f22b/commerce-product-service/src/main/java/com/liferay/commerce/product/service/persistence/impl/CPDefinitionPersistenceImpl.java#L698-L701 |
TheHortonMachine/hortonmachine | gears/src/main/java/org/hortonmachine/gears/modules/r/tmsgenerator/MBTilesHelper.java | MBTilesHelper.readGridcoverageImageForTile | public static BufferedImage readGridcoverageImageForTile( AbstractGridCoverage2DReader reader, int x, int y, int zoom,
CoordinateReferenceSystem resampleCrs ) throws IOException {
"""
Read the image of a tile from a generic geotools coverage reader.
@param reader the reader, expected to be in CRS 38... | java | public static BufferedImage readGridcoverageImageForTile( AbstractGridCoverage2DReader reader, int x, int y, int zoom,
CoordinateReferenceSystem resampleCrs ) throws IOException {
double north = tile2lat(y, zoom);
double south = tile2lat(y + 1, zoom);
double west = tile2lon(x, zoom);... | [
"public",
"static",
"BufferedImage",
"readGridcoverageImageForTile",
"(",
"AbstractGridCoverage2DReader",
"reader",
",",
"int",
"x",
",",
"int",
"y",
",",
"int",
"zoom",
",",
"CoordinateReferenceSystem",
"resampleCrs",
")",
"throws",
"IOException",
"{",
"double",
"nor... | Read the image of a tile from a generic geotools coverage reader.
@param reader the reader, expected to be in CRS 3857.
@param x the tile x.
@param y the tile y.
@param zoom the zoomlevel.
@return the image.
@throws IOException | [
"Read",
"the",
"image",
"of",
"a",
"tile",
"from",
"a",
"generic",
"geotools",
"coverage",
"reader",
"."
] | train | https://github.com/TheHortonMachine/hortonmachine/blob/d2b436bbdf951dc1fda56096a42dbc0eae4d35a5/gears/src/main/java/org/hortonmachine/gears/modules/r/tmsgenerator/MBTilesHelper.java#L341-L363 |
infinispan/infinispan | core/src/main/java/org/infinispan/container/impl/InternalEntryFactoryImpl.java | InternalEntryFactoryImpl.isStoreMetadata | public static boolean isStoreMetadata(Metadata metadata, InternalCacheEntry ice) {
"""
Indicates whether the entire metadata object needs to be stored or not.
This check is done to avoid keeping the entire metadata object around
when only lifespan or maxIdle time is stored. If more information
needs to be sto... | java | public static boolean isStoreMetadata(Metadata metadata, InternalCacheEntry ice) {
return metadata != null
&& (ice == null || isEntryMetadataAware(ice))
&& (metadata.version() != null
|| !(metadata instanceof EmbeddedMetadata));
} | [
"public",
"static",
"boolean",
"isStoreMetadata",
"(",
"Metadata",
"metadata",
",",
"InternalCacheEntry",
"ice",
")",
"{",
"return",
"metadata",
"!=",
"null",
"&&",
"(",
"ice",
"==",
"null",
"||",
"isEntryMetadataAware",
"(",
"ice",
")",
")",
"&&",
"(",
"met... | Indicates whether the entire metadata object needs to be stored or not.
This check is done to avoid keeping the entire metadata object around
when only lifespan or maxIdle time is stored. If more information
needs to be stored (i.e. version), or the metadata object is not the
embedded one, keep the entire metadata obj... | [
"Indicates",
"whether",
"the",
"entire",
"metadata",
"object",
"needs",
"to",
"be",
"stored",
"or",
"not",
"."
] | train | https://github.com/infinispan/infinispan/blob/7c62b94886c3febb4774ae8376acf2baa0265ab5/core/src/main/java/org/infinispan/container/impl/InternalEntryFactoryImpl.java#L387-L392 |
JavaMoney/jsr354-api | src/main/java/javax/money/Monetary.java | Monetary.isCurrencyAvailable | public static boolean isCurrencyAvailable(Locale locale, String... providers) {
"""
Allows to check if a {@link javax.money.CurrencyUnit} instance is
defined, i.e. accessible from {@link #getCurrency(String, String...)}.
@param locale the target {@link Locale}, not {@code null}.
@param providers the (optio... | java | public static boolean isCurrencyAvailable(Locale locale, String... providers) {
return Objects.nonNull(MONETARY_CURRENCIES_SINGLETON_SPI()) && MONETARY_CURRENCIES_SINGLETON_SPI().isCurrencyAvailable(locale, providers);
} | [
"public",
"static",
"boolean",
"isCurrencyAvailable",
"(",
"Locale",
"locale",
",",
"String",
"...",
"providers",
")",
"{",
"return",
"Objects",
".",
"nonNull",
"(",
"MONETARY_CURRENCIES_SINGLETON_SPI",
"(",
")",
")",
"&&",
"MONETARY_CURRENCIES_SINGLETON_SPI",
"(",
... | Allows to check if a {@link javax.money.CurrencyUnit} instance is
defined, i.e. accessible from {@link #getCurrency(String, String...)}.
@param locale the target {@link Locale}, not {@code null}.
@param providers the (optional) specification of providers to consider.
@return {@code true} if {@link #getCurrencies(Lo... | [
"Allows",
"to",
"check",
"if",
"a",
"{",
"@link",
"javax",
".",
"money",
".",
"CurrencyUnit",
"}",
"instance",
"is",
"defined",
"i",
".",
"e",
".",
"accessible",
"from",
"{",
"@link",
"#getCurrency",
"(",
"String",
"String",
"...",
")",
"}",
"."
] | train | https://github.com/JavaMoney/jsr354-api/blob/49a7ae436eaf45cac1040879185531ef22de5525/src/main/java/javax/money/Monetary.java#L448-L450 |
Impetus/Kundera | src/jpa-engine/fallback-impl/src/main/java/com/impetus/kundera/index/DocumentIndexer.java | DocumentIndexer.addParentKeyToDocument | protected void addParentKeyToDocument(String parentId, Document currentDoc, Class<?> clazz) {
"""
Index parent key.
@param parentId
the parent id
@param currentDoc
the current doc
@param clazz
the clazz
"""
// if (parentId != null)
if (clazz != null && parentId != null) {
Fi... | java | protected void addParentKeyToDocument(String parentId, Document currentDoc, Class<?> clazz) {
// if (parentId != null)
if (clazz != null && parentId != null) {
Field luceneField =
new Field(IndexingConstants.PARENT_ID_FIELD, parentId, Field.Store.YES, Field.Index.ANALYZED_NO_... | [
"protected",
"void",
"addParentKeyToDocument",
"(",
"String",
"parentId",
",",
"Document",
"currentDoc",
",",
"Class",
"<",
"?",
">",
"clazz",
")",
"{",
"// if (parentId != null)",
"if",
"(",
"clazz",
"!=",
"null",
"&&",
"parentId",
"!=",
"null",
")",
"{",
"... | Index parent key.
@param parentId
the parent id
@param currentDoc
the current doc
@param clazz
the clazz | [
"Index",
"parent",
"key",
"."
] | train | https://github.com/Impetus/Kundera/blob/268958ab1ec09d14ec4d9184f0c8ded7a9158908/src/jpa-engine/fallback-impl/src/main/java/com/impetus/kundera/index/DocumentIndexer.java#L140-L151 |
Azure/azure-sdk-for-java | appservice/resource-manager/v2016_03_01/src/main/java/com/microsoft/azure/management/appservice/v2016_03_01/implementation/CertificatesInner.java | CertificatesInner.createOrUpdate | public CertificateInner createOrUpdate(String resourceGroupName, String name, CertificateInner certificateEnvelope) {
"""
Create or update a certificate.
Create or update a certificate.
@param resourceGroupName Name of the resource group to which the resource belongs.
@param name Name of the certificate.
@pa... | java | public CertificateInner createOrUpdate(String resourceGroupName, String name, CertificateInner certificateEnvelope) {
return createOrUpdateWithServiceResponseAsync(resourceGroupName, name, certificateEnvelope).toBlocking().single().body();
} | [
"public",
"CertificateInner",
"createOrUpdate",
"(",
"String",
"resourceGroupName",
",",
"String",
"name",
",",
"CertificateInner",
"certificateEnvelope",
")",
"{",
"return",
"createOrUpdateWithServiceResponseAsync",
"(",
"resourceGroupName",
",",
"name",
",",
"certificateE... | Create or update a certificate.
Create or update a certificate.
@param resourceGroupName Name of the resource group to which the resource belongs.
@param name Name of the certificate.
@param certificateEnvelope Details of certificate, if it exists already.
@throws IllegalArgumentException thrown if parameters fail the... | [
"Create",
"or",
"update",
"a",
"certificate",
".",
"Create",
"or",
"update",
"a",
"certificate",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/appservice/resource-manager/v2016_03_01/src/main/java/com/microsoft/azure/management/appservice/v2016_03_01/implementation/CertificatesInner.java#L437-L439 |
FXMisc/WellBehavedFX | src/main/java/org/fxmisc/wellbehaved/event/template/InputMapTemplate.java | InputMapTemplate.consumeUnless | public static <S, T extends Event, U extends T> InputMapTemplate<S, U> consumeUnless(
EventPattern<? super T, ? extends U> eventPattern,
Predicate<? super S> condition,
BiConsumer<? super S, ? super U> action) {
"""
If the given {@link EventPattern} matches the given event type ... | java | public static <S, T extends Event, U extends T> InputMapTemplate<S, U> consumeUnless(
EventPattern<? super T, ? extends U> eventPattern,
Predicate<? super S> condition,
BiConsumer<? super S, ? super U> action) {
return consumeWhen(eventPattern, condition.negate(), action);
... | [
"public",
"static",
"<",
"S",
",",
"T",
"extends",
"Event",
",",
"U",
"extends",
"T",
">",
"InputMapTemplate",
"<",
"S",
",",
"U",
">",
"consumeUnless",
"(",
"EventPattern",
"<",
"?",
"super",
"T",
",",
"?",
"extends",
"U",
">",
"eventPattern",
",",
... | If the given {@link EventPattern} matches the given event type and {@code condition} is false,
consumes the event and does not attempt to match additional
{@code InputMap}s (if they exist). If {@code condition} is true, continues to try to pattern match
the event type with the next {@code InputMap} (if one exists). | [
"If",
"the",
"given",
"{"
] | train | https://github.com/FXMisc/WellBehavedFX/blob/ca889734481f5439655ca8deb6f742964b5654b0/src/main/java/org/fxmisc/wellbehaved/event/template/InputMapTemplate.java#L292-L297 |
Erudika/para | para-core/src/main/java/com/erudika/para/utils/Config.java | Config.getConfigInt | public static int getConfigInt(String key, int defaultValue) {
"""
Returns the integer value of a configuration parameter.
@param key the param key
@param defaultValue the default param value
@return the value of a param
"""
return NumberUtils.toInt(getConfigParam(key, Integer.toString(defaultValue)));
} | java | public static int getConfigInt(String key, int defaultValue) {
return NumberUtils.toInt(getConfigParam(key, Integer.toString(defaultValue)));
} | [
"public",
"static",
"int",
"getConfigInt",
"(",
"String",
"key",
",",
"int",
"defaultValue",
")",
"{",
"return",
"NumberUtils",
".",
"toInt",
"(",
"getConfigParam",
"(",
"key",
",",
"Integer",
".",
"toString",
"(",
"defaultValue",
")",
")",
")",
";",
"}"
] | Returns the integer value of a configuration parameter.
@param key the param key
@param defaultValue the default param value
@return the value of a param | [
"Returns",
"the",
"integer",
"value",
"of",
"a",
"configuration",
"parameter",
"."
] | train | https://github.com/Erudika/para/blob/5ba096c477042ea7b18e9a0e8b5b1ee0f5bd6ce9/para-core/src/main/java/com/erudika/para/utils/Config.java#L334-L336 |
alkacon/opencms-core | src/org/opencms/jsp/util/CmsMacroFormatterResolver.java | CmsMacroFormatterResolver.getMacroBeanValue | protected Object getMacroBeanValue(Object bean, String property) {
"""
Returns the property value read from the given JavaBean.
@param bean the JavaBean to read the property from
@param property the property to read
@return the property value read from the given JavaBean
"""
Object result = nul... | java | protected Object getMacroBeanValue(Object bean, String property) {
Object result = null;
if ((bean != null) && CmsStringUtil.isNotEmptyOrWhitespaceOnly(property)) {
try {
PropertyUtilsBean propBean = BeanUtilsBean.getInstance().getPropertyUtils();
result = pr... | [
"protected",
"Object",
"getMacroBeanValue",
"(",
"Object",
"bean",
",",
"String",
"property",
")",
"{",
"Object",
"result",
"=",
"null",
";",
"if",
"(",
"(",
"bean",
"!=",
"null",
")",
"&&",
"CmsStringUtil",
".",
"isNotEmptyOrWhitespaceOnly",
"(",
"property",
... | Returns the property value read from the given JavaBean.
@param bean the JavaBean to read the property from
@param property the property to read
@return the property value read from the given JavaBean | [
"Returns",
"the",
"property",
"value",
"read",
"from",
"the",
"given",
"JavaBean",
"."
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/jsp/util/CmsMacroFormatterResolver.java#L295-L309 |
querydsl/querydsl | querydsl-sql/src/main/java/com/querydsl/sql/mysql/AbstractMySQLQuery.java | AbstractMySQLQuery.highPriority | @WithBridgeMethods(value = MySQLQuery.class, castRequired = true)
public C highPriority() {
"""
HIGH_PRIORITY gives the SELECT higher priority than a statement that updates a table.
You should use this only for queries that are very fast and must be done at once.
@return the current object
"""
... | java | @WithBridgeMethods(value = MySQLQuery.class, castRequired = true)
public C highPriority() {
return addFlag(Position.AFTER_SELECT, HIGH_PRIORITY);
} | [
"@",
"WithBridgeMethods",
"(",
"value",
"=",
"MySQLQuery",
".",
"class",
",",
"castRequired",
"=",
"true",
")",
"public",
"C",
"highPriority",
"(",
")",
"{",
"return",
"addFlag",
"(",
"Position",
".",
"AFTER_SELECT",
",",
"HIGH_PRIORITY",
")",
";",
"}"
] | HIGH_PRIORITY gives the SELECT higher priority than a statement that updates a table.
You should use this only for queries that are very fast and must be done at once.
@return the current object | [
"HIGH_PRIORITY",
"gives",
"the",
"SELECT",
"higher",
"priority",
"than",
"a",
"statement",
"that",
"updates",
"a",
"table",
".",
"You",
"should",
"use",
"this",
"only",
"for",
"queries",
"that",
"are",
"very",
"fast",
"and",
"must",
"be",
"done",
"at",
"on... | train | https://github.com/querydsl/querydsl/blob/2bf234caf78549813a1e0f44d9c30ecc5ef734e3/querydsl-sql/src/main/java/com/querydsl/sql/mysql/AbstractMySQLQuery.java#L122-L125 |
OpenLiberty/open-liberty | dev/com.ibm.ws.ras.instrument/src/com/ibm/ws/ras/instrument/internal/bci/AbstractRasClassAdapter.java | AbstractRasClassAdapter.visitMethod | @Override
public MethodVisitor visitMethod(int access, String name, String descriptor, String signature, String[] exceptions) {
"""
Visit each method defined in the class. We use this to check for the
presence of static initializers and to chain the method adapter that
will instrument the methods with entry/... | java | @Override
public MethodVisitor visitMethod(int access, String name, String descriptor, String signature, String[] exceptions) {
// Add to observed methods list
visitedMethods.add(new Method(name, descriptor));
// Make sure the class is annotated.
ensureAnnotated();
// Chain... | [
"@",
"Override",
"public",
"MethodVisitor",
"visitMethod",
"(",
"int",
"access",
",",
"String",
"name",
",",
"String",
"descriptor",
",",
"String",
"signature",
",",
"String",
"[",
"]",
"exceptions",
")",
"{",
"// Add to observed methods list",
"visitedMethods",
"... | Visit each method defined in the class. We use this to check for the
presence of static initializers and to chain the method adapter that
will instrument the methods with entry/exit trace calls. | [
"Visit",
"each",
"method",
"defined",
"in",
"the",
"class",
".",
"We",
"use",
"this",
"to",
"check",
"for",
"the",
"presence",
"of",
"static",
"initializers",
"and",
"to",
"chain",
"the",
"method",
"adapter",
"that",
"will",
"instrument",
"the",
"methods",
... | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.ras.instrument/src/com/ibm/ws/ras/instrument/internal/bci/AbstractRasClassAdapter.java#L236-L251 |
Javacord/Javacord | javacord-core/src/main/java/org/javacord/core/entity/user/UserImpl.java | UserImpl.getAvatar | public static Icon getAvatar(DiscordApi api, String avatarHash, String discriminator, long userId) {
"""
Gets the avatar for the given details.
@param api The discord api instance.
@param avatarHash The avatar hash or {@code null} for default avatar.
@param discriminator The discriminator if default avatar is... | java | public static Icon getAvatar(DiscordApi api, String avatarHash, String discriminator, long userId) {
StringBuilder url = new StringBuilder("https://cdn.discordapp.com/");
if (avatarHash == null) {
url.append("embed/avatars/")
.append(Integer.parseInt(discriminator) % 5)
... | [
"public",
"static",
"Icon",
"getAvatar",
"(",
"DiscordApi",
"api",
",",
"String",
"avatarHash",
",",
"String",
"discriminator",
",",
"long",
"userId",
")",
"{",
"StringBuilder",
"url",
"=",
"new",
"StringBuilder",
"(",
"\"https://cdn.discordapp.com/\"",
")",
";",
... | Gets the avatar for the given details.
@param api The discord api instance.
@param avatarHash The avatar hash or {@code null} for default avatar.
@param discriminator The discriminator if default avatar is wanted.
@param userId The user id.
@return The avatar for the given details. | [
"Gets",
"the",
"avatar",
"for",
"the",
"given",
"details",
"."
] | train | https://github.com/Javacord/Javacord/blob/915aad084dc5e863284267529d0dccd625fc6886/javacord-core/src/main/java/org/javacord/core/entity/user/UserImpl.java#L245-L262 |
Impetus/Kundera | src/kundera-hbase/kundera-hbase-v2/src/main/java/com/impetus/client/hbase/HBaseClient.java | HBaseClient.findData | public <E> List<E> findData(EntityMetadata m, Object rowKey, byte[] startRow, byte[] endRow,
List<Map<String, Object>> columnsToOutput, Filter filters) {
"""
Find data.
@param <E>
the element type
@param m
the m
@param rowKey
the row key
@param startRow
the start row
@param endRow
the end r... | java | public <E> List<E> findData(EntityMetadata m, Object rowKey, byte[] startRow, byte[] endRow,
List<Map<String, Object>> columnsToOutput, Filter filters)
{
String tableName = HBaseUtils.getHTableName(m.getSchema(), m.getTableName());
FilterList filterList = getFilterList(filters);
... | [
"public",
"<",
"E",
">",
"List",
"<",
"E",
">",
"findData",
"(",
"EntityMetadata",
"m",
",",
"Object",
"rowKey",
",",
"byte",
"[",
"]",
"startRow",
",",
"byte",
"[",
"]",
"endRow",
",",
"List",
"<",
"Map",
"<",
"String",
",",
"Object",
">",
">",
... | Find data.
@param <E>
the element type
@param m
the m
@param rowKey
the row key
@param startRow
the start row
@param endRow
the end row
@param columnsToOutput
the columns to output
@param filters
the filters
@return the list | [
"Find",
"data",
"."
] | train | https://github.com/Impetus/Kundera/blob/268958ab1ec09d14ec4d9184f0c8ded7a9158908/src/kundera-hbase/kundera-hbase-v2/src/main/java/com/impetus/client/hbase/HBaseClient.java#L247-L261 |
Mthwate/DatLib | src/main/java/com/mthwate/datlib/math/MathUtils.java | MathUtils.lcm | public static BigInteger lcm(BigInteger a, BigInteger b) {
"""
Gets the least common multiple of 2 numbers.
@since 1.3
@param a the first BigInteger
@param b the second BigInteger
@return the least common multiple as a BigInteger
"""
return lcm(a, b, Calculator.BIG_INTEGER_CALCULATOR);
} | java | public static BigInteger lcm(BigInteger a, BigInteger b) {
return lcm(a, b, Calculator.BIG_INTEGER_CALCULATOR);
} | [
"public",
"static",
"BigInteger",
"lcm",
"(",
"BigInteger",
"a",
",",
"BigInteger",
"b",
")",
"{",
"return",
"lcm",
"(",
"a",
",",
"b",
",",
"Calculator",
".",
"BIG_INTEGER_CALCULATOR",
")",
";",
"}"
] | Gets the least common multiple of 2 numbers.
@since 1.3
@param a the first BigInteger
@param b the second BigInteger
@return the least common multiple as a BigInteger | [
"Gets",
"the",
"least",
"common",
"multiple",
"of",
"2",
"numbers",
"."
] | train | https://github.com/Mthwate/DatLib/blob/f0b3a9f9cf6fdc773d4f86234ebd95986c9b6077/src/main/java/com/mthwate/datlib/math/MathUtils.java#L96-L98 |
rwl/CSparseJ | src/main/java/edu/emory/mathcs/csparsej/tdouble/Dcs_transpose.java | Dcs_transpose.cs_transpose | public static Dcs cs_transpose(Dcs A, boolean values) {
"""
Computes the transpose of a sparse matrix, C =A';
@param A
column-compressed matrix
@param values
pattern only if false, both pattern and values otherwise
@return C=A', null on error
"""
int p, q, j, Cp[], Ci[], n, m, Ap[], Ai[], w[];
... | java | public static Dcs cs_transpose(Dcs A, boolean values) {
int p, q, j, Cp[], Ci[], n, m, Ap[], Ai[], w[];
double Cx[], Ax[];
Dcs C;
if (!Dcs_util.CS_CSC(A))
return (null); /* check inputs */
m = A.m;
n = A.n;
Ap = A.p;
Ai = A.i;
... | [
"public",
"static",
"Dcs",
"cs_transpose",
"(",
"Dcs",
"A",
",",
"boolean",
"values",
")",
"{",
"int",
"p",
",",
"q",
",",
"j",
",",
"Cp",
"[",
"]",
",",
"Ci",
"[",
"]",
",",
"n",
",",
"m",
",",
"Ap",
"[",
"]",
",",
"Ai",
"[",
"]",
",",
"... | Computes the transpose of a sparse matrix, C =A';
@param A
column-compressed matrix
@param values
pattern only if false, both pattern and values otherwise
@return C=A', null on error | [
"Computes",
"the",
"transpose",
"of",
"a",
"sparse",
"matrix",
"C",
"=",
"A",
";"
] | train | https://github.com/rwl/CSparseJ/blob/6a6f66bccce1558156a961494358952603b0ac84/src/main/java/edu/emory/mathcs/csparsej/tdouble/Dcs_transpose.java#L46-L73 |
DataSketches/sketches-core | src/main/java/com/yahoo/sketches/theta/HeapQuickSelectSketch.java | HeapQuickSelectSketch.setHashTableThreshold | static final int setHashTableThreshold(final int lgNomLongs, final int lgArrLongs) {
"""
Returns the cardinality limit given the current size of the hash table array.
@param lgNomLongs <a href="{@docRoot}/resources/dictionary.html#lgNomLongs">See lgNomLongs</a>.
@param lgArrLongs <a href="{@docRoot}/resources/... | java | static final int setHashTableThreshold(final int lgNomLongs, final int lgArrLongs) {
final double fraction = (lgArrLongs <= lgNomLongs) ? RESIZE_THRESHOLD : REBUILD_THRESHOLD;
return (int) Math.floor(fraction * (1 << lgArrLongs));
} | [
"static",
"final",
"int",
"setHashTableThreshold",
"(",
"final",
"int",
"lgNomLongs",
",",
"final",
"int",
"lgArrLongs",
")",
"{",
"final",
"double",
"fraction",
"=",
"(",
"lgArrLongs",
"<=",
"lgNomLongs",
")",
"?",
"RESIZE_THRESHOLD",
":",
"REBUILD_THRESHOLD",
... | Returns the cardinality limit given the current size of the hash table array.
@param lgNomLongs <a href="{@docRoot}/resources/dictionary.html#lgNomLongs">See lgNomLongs</a>.
@param lgArrLongs <a href="{@docRoot}/resources/dictionary.html#lgArrLongs">See lgArrLongs</a>.
@return the hash table threshold | [
"Returns",
"the",
"cardinality",
"limit",
"given",
"the",
"current",
"size",
"of",
"the",
"hash",
"table",
"array",
"."
] | train | https://github.com/DataSketches/sketches-core/blob/900c8c9668a1e2f1d54d453e956caad54702e540/src/main/java/com/yahoo/sketches/theta/HeapQuickSelectSketch.java#L298-L301 |
looly/hutool | hutool-crypto/src/main/java/cn/hutool/crypto/SecureUtil.java | SecureUtil.signParams | public static String signParams(DigestAlgorithm digestAlgorithm, Map<?, ?> params, String separator, String keyValueSeparator, boolean isIgnoreNull) {
"""
对参数做签名<br>
参数签名为对Map参数按照key的顺序排序后拼接为字符串,然后根据提供的签名算法生成签名字符串
@param digestAlgorithm 摘要算法
@param params 参数
@param separator entry之间的连接符
@param keyValueSepar... | java | public static String signParams(DigestAlgorithm digestAlgorithm, Map<?, ?> params, String separator, String keyValueSeparator, boolean isIgnoreNull) {
if (MapUtil.isEmpty(params)) {
return null;
}
final String paramsStr = MapUtil.join(MapUtil.sort(params), separator, keyValueSeparator, isIgnoreNull);
re... | [
"public",
"static",
"String",
"signParams",
"(",
"DigestAlgorithm",
"digestAlgorithm",
",",
"Map",
"<",
"?",
",",
"?",
">",
"params",
",",
"String",
"separator",
",",
"String",
"keyValueSeparator",
",",
"boolean",
"isIgnoreNull",
")",
"{",
"if",
"(",
"MapUtil"... | 对参数做签名<br>
参数签名为对Map参数按照key的顺序排序后拼接为字符串,然后根据提供的签名算法生成签名字符串
@param digestAlgorithm 摘要算法
@param params 参数
@param separator entry之间的连接符
@param keyValueSeparator kv之间的连接符
@param isIgnoreNull 是否忽略null的键和值
@return 签名
@since 4.0.1 | [
"对参数做签名<br",
">",
"参数签名为对Map参数按照key的顺序排序后拼接为字符串,然后根据提供的签名算法生成签名字符串"
] | train | https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-crypto/src/main/java/cn/hutool/crypto/SecureUtil.java#L920-L926 |
liferay/com-liferay-commerce | commerce-service/src/main/java/com/liferay/commerce/service/persistence/impl/CommerceCountryPersistenceImpl.java | CommerceCountryPersistenceImpl.findByG_B_A | @Override
public List<CommerceCountry> findByG_B_A(long groupId,
boolean billingAllowed, boolean active, int start, int end) {
"""
Returns a range of all the commerce countries where groupId = ? and billingAllowed = ? and active = ?.
<p>
Useful when paginating results. Returns a maximum of <code... | java | @Override
public List<CommerceCountry> findByG_B_A(long groupId,
boolean billingAllowed, boolean active, int start, int end) {
return findByG_B_A(groupId, billingAllowed, active, start, end, null);
} | [
"@",
"Override",
"public",
"List",
"<",
"CommerceCountry",
">",
"findByG_B_A",
"(",
"long",
"groupId",
",",
"boolean",
"billingAllowed",
",",
"boolean",
"active",
",",
"int",
"start",
",",
"int",
"end",
")",
"{",
"return",
"findByG_B_A",
"(",
"groupId",
",",... | Returns a range of all the commerce countries where groupId = ? and billingAllowed = ? and active = ?.
<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... | [
"Returns",
"a",
"range",
"of",
"all",
"the",
"commerce",
"countries",
"where",
"groupId",
"=",
"?",
";",
"and",
"billingAllowed",
"=",
"?",
";",
"and",
"active",
"=",
"?",
";",
"."
] | train | https://github.com/liferay/com-liferay-commerce/blob/9e54362d7f59531fc684016ba49ee7cdc3a2f22b/commerce-service/src/main/java/com/liferay/commerce/service/persistence/impl/CommerceCountryPersistenceImpl.java#L3060-L3064 |
alkacon/opencms-core | src-gwt/org/opencms/gwt/client/super_src/com/google/gwt/http/client/RequestBuilder.java | RequestBuilder.setHeader | public void setHeader(String header, String value) {
"""
Sets a request header with the given name and value. If a header with the
specified name has already been set then the new value overwrites the
current value.
@param header the name of the header
@param value the value of the header
@throws NullPoin... | java | public void setHeader(String header, String value) {
StringValidator.throwIfEmptyOrNull("header", header);
StringValidator.throwIfEmptyOrNull("value", value);
if (headers == null) {
headers = new HashMap<String, String>();
}
headers.put(header, value);
} | [
"public",
"void",
"setHeader",
"(",
"String",
"header",
",",
"String",
"value",
")",
"{",
"StringValidator",
".",
"throwIfEmptyOrNull",
"(",
"\"header\"",
",",
"header",
")",
";",
"StringValidator",
".",
"throwIfEmptyOrNull",
"(",
"\"value\"",
",",
"value",
")",... | Sets a request header with the given name and value. If a header with the
specified name has already been set then the new value overwrites the
current value.
@param header the name of the header
@param value the value of the header
@throws NullPointerException if header or value are null
@throws IllegalArgumentExcep... | [
"Sets",
"a",
"request",
"header",
"with",
"the",
"given",
"name",
"and",
"value",
".",
"If",
"a",
"header",
"with",
"the",
"specified",
"name",
"has",
"already",
"been",
"set",
"then",
"the",
"new",
"value",
"overwrites",
"the",
"current",
"value",
"."
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src-gwt/org/opencms/gwt/client/super_src/com/google/gwt/http/client/RequestBuilder.java#L283-L292 |
jbundle/jbundle | thin/base/screen/cal/other/src/main/java/org/jbundle/thin/base/screen/cal/opt/CachedItem.java | CachedItem.changeRemoteDate | public void changeRemoteDate(Application application, String strParams, CachedItem productItem, Date dateStart, Date dateEnd) {
"""
Change the date of the actual data.
Override this to change the date.
Usually, you add flashing icons to show the tasks that are being queued, then
you add an override to DateChang... | java | public void changeRemoteDate(Application application, String strParams, CachedItem productItem, Date dateStart, Date dateEnd)
{
} | [
"public",
"void",
"changeRemoteDate",
"(",
"Application",
"application",
",",
"String",
"strParams",
",",
"CachedItem",
"productItem",
",",
"Date",
"dateStart",
",",
"Date",
"dateEnd",
")",
"{",
"}"
] | Change the date of the actual data.
Override this to change the date.
Usually, you add flashing icons to show the tasks that are being queued, then
you add an override to DateChangeTask that changes the remote data in a Separate task.
The code usually looks something like this:
<pre>
Sample code:
this.setIcon(BaseApple... | [
"Change",
"the",
"date",
"of",
"the",
"actual",
"data",
".",
"Override",
"this",
"to",
"change",
"the",
"date",
".",
"Usually",
"you",
"add",
"flashing",
"icons",
"to",
"show",
"the",
"tasks",
"that",
"are",
"being",
"queued",
"then",
"you",
"add",
"an",... | train | https://github.com/jbundle/jbundle/blob/4037fcfa85f60c7d0096c453c1a3cd573c2b0abc/thin/base/screen/cal/other/src/main/java/org/jbundle/thin/base/screen/cal/opt/CachedItem.java#L158-L160 |
moparisthebest/beehive | beehive-netui-core/src/main/java/org/apache/beehive/netui/script/common/ImplicitObjectUtil.java | ImplicitObjectUtil.getUpdateVariableResolver | public static VariableResolver getUpdateVariableResolver(ServletRequest request,
ServletResponse response,
boolean isHandlingPost) {
"""
Internal method!
Create a {@link VariableResolver} th... | java | public static VariableResolver getUpdateVariableResolver(ServletRequest request,
ServletResponse response,
boolean isHandlingPost) {
Object form = ImplicitObjectUtil.unwrapForm(getActionForm... | [
"public",
"static",
"VariableResolver",
"getUpdateVariableResolver",
"(",
"ServletRequest",
"request",
",",
"ServletResponse",
"response",
",",
"boolean",
"isHandlingPost",
")",
"{",
"Object",
"form",
"=",
"ImplicitObjectUtil",
".",
"unwrapForm",
"(",
"getActionForm",
"... | Internal method!
Create a {@link VariableResolver} that contains the implicit objects available for expression
updates. | [
"Internal",
"method!"
] | train | https://github.com/moparisthebest/beehive/blob/4246a0cc40ce3c05f1a02c2da2653ac622703d77/beehive-netui-core/src/main/java/org/apache/beehive/netui/script/common/ImplicitObjectUtil.java#L243-L248 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.