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 |
|---|---|---|---|---|---|---|---|---|---|---|
alkacon/opencms-core | src/org/opencms/db/generic/CmsUserQueryBuilder.java | CmsUserQueryBuilder.getSortExpression | protected String getSortExpression(TableAlias users, CmsUserSearchParameters searchParams) {
"""
Returns the expression used for sorting the results.<p>
@param users the user table alias
@param searchParams the search parameters
@return the sorting expressiong
"""
SortKey sortKey = searchParams... | java | protected String getSortExpression(TableAlias users, CmsUserSearchParameters searchParams) {
SortKey sortKey = searchParams.getSortKey();
String ordering = users.column(colId());
if (sortKey != null) {
switch (sortKey) {
case email:
ordering = use... | [
"protected",
"String",
"getSortExpression",
"(",
"TableAlias",
"users",
",",
"CmsUserSearchParameters",
"searchParams",
")",
"{",
"SortKey",
"sortKey",
"=",
"searchParams",
".",
"getSortKey",
"(",
")",
";",
"String",
"ordering",
"=",
"users",
".",
"column",
"(",
... | Returns the expression used for sorting the results.<p>
@param users the user table alias
@param searchParams the search parameters
@return the sorting expressiong | [
"Returns",
"the",
"expression",
"used",
"for",
"sorting",
"the",
"results",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/db/generic/CmsUserQueryBuilder.java#L567-L600 |
netscaler/nitro | src/main/java/com/citrix/netscaler/nitro/resource/config/ssl/sslcipher_binding.java | sslcipher_binding.get | public static sslcipher_binding get(nitro_service service, String ciphergroupname) throws Exception {
"""
Use this API to fetch sslcipher_binding resource of given name .
"""
sslcipher_binding obj = new sslcipher_binding();
obj.set_ciphergroupname(ciphergroupname);
sslcipher_binding response = (sslcipher... | java | public static sslcipher_binding get(nitro_service service, String ciphergroupname) throws Exception{
sslcipher_binding obj = new sslcipher_binding();
obj.set_ciphergroupname(ciphergroupname);
sslcipher_binding response = (sslcipher_binding) obj.get_resource(service);
return response;
} | [
"public",
"static",
"sslcipher_binding",
"get",
"(",
"nitro_service",
"service",
",",
"String",
"ciphergroupname",
")",
"throws",
"Exception",
"{",
"sslcipher_binding",
"obj",
"=",
"new",
"sslcipher_binding",
"(",
")",
";",
"obj",
".",
"set_ciphergroupname",
"(",
... | Use this API to fetch sslcipher_binding resource of given name . | [
"Use",
"this",
"API",
"to",
"fetch",
"sslcipher_binding",
"resource",
"of",
"given",
"name",
"."
] | train | https://github.com/netscaler/nitro/blob/2a98692dcf4e4ec430c7d7baab8382e4ba5a35e4/src/main/java/com/citrix/netscaler/nitro/resource/config/ssl/sslcipher_binding.java#L114-L119 |
apache/incubator-gobblin | gobblin-utility/src/main/java/org/apache/gobblin/util/ProxiedFileSystemCache.java | ProxiedFileSystemCache.getProxiedFileSystemUsingKeytab | @Deprecated
public static FileSystem getProxiedFileSystemUsingKeytab(State state, URI fsURI, Configuration conf)
throws ExecutionException {
"""
Cached version of {@link ProxiedFileSystemUtils#createProxiedFileSystemUsingKeytab(State, URI, Configuration)}.
@deprecated use {@link #fromKeytab}.
"""
... | java | @Deprecated
public static FileSystem getProxiedFileSystemUsingKeytab(State state, URI fsURI, Configuration conf)
throws ExecutionException {
Preconditions.checkArgument(state.contains(ConfigurationKeys.FS_PROXY_AS_USER_NAME));
Preconditions.checkArgument(state.contains(ConfigurationKeys.SUPER_USER_NAME_... | [
"@",
"Deprecated",
"public",
"static",
"FileSystem",
"getProxiedFileSystemUsingKeytab",
"(",
"State",
"state",
",",
"URI",
"fsURI",
",",
"Configuration",
"conf",
")",
"throws",
"ExecutionException",
"{",
"Preconditions",
".",
"checkArgument",
"(",
"state",
".",
"con... | Cached version of {@link ProxiedFileSystemUtils#createProxiedFileSystemUsingKeytab(State, URI, Configuration)}.
@deprecated use {@link #fromKeytab}. | [
"Cached",
"version",
"of",
"{"
] | train | https://github.com/apache/incubator-gobblin/blob/f029b4c0fea0fe4aa62f36dda2512344ff708bae/gobblin-utility/src/main/java/org/apache/gobblin/util/ProxiedFileSystemCache.java#L146-L156 |
EvidentSolutions/dalesbred | dalesbred/src/main/java/org/dalesbred/Database.java | Database.findOptionalDouble | public @NotNull OptionalDouble findOptionalDouble(@NotNull @SQL String sql, Object... args) {
"""
Finds a unique result from database, converting the database row to double using default mechanisms.
Returns empty if there are no results or if single null result is returned.
@throws NonUniqueResultException if ... | java | public @NotNull OptionalDouble findOptionalDouble(@NotNull @SQL String sql, Object... args) {
return findOptionalDouble(SqlQuery.query(sql, args));
} | [
"public",
"@",
"NotNull",
"OptionalDouble",
"findOptionalDouble",
"(",
"@",
"NotNull",
"@",
"SQL",
"String",
"sql",
",",
"Object",
"...",
"args",
")",
"{",
"return",
"findOptionalDouble",
"(",
"SqlQuery",
".",
"query",
"(",
"sql",
",",
"args",
")",
")",
";... | Finds a unique result from database, converting the database row to double using default mechanisms.
Returns empty if there are no results or if single null result is returned.
@throws NonUniqueResultException if there are multiple result rows | [
"Finds",
"a",
"unique",
"result",
"from",
"database",
"converting",
"the",
"database",
"row",
"to",
"double",
"using",
"default",
"mechanisms",
".",
"Returns",
"empty",
"if",
"there",
"are",
"no",
"results",
"or",
"if",
"single",
"null",
"result",
"is",
"ret... | train | https://github.com/EvidentSolutions/dalesbred/blob/713f5b6e152d97e1672ca68b9ff9c7c6c288ceb1/dalesbred/src/main/java/org/dalesbred/Database.java#L454-L456 |
BorderTech/wcomponents | wcomponents-core/src/main/java/com/github/bordertech/wcomponents/WDateField.java | WDateField.handleRequestValue | protected void handleRequestValue(final Date value, final boolean valid, final String text) {
"""
Set the request value.
@param value the date value
@param valid true if valid value
@param text the user text
"""
// As setData() clears the text value (if valid), this must be called first so it can be set... | java | protected void handleRequestValue(final Date value, final boolean valid, final String text) {
// As setData() clears the text value (if valid), this must be called first so it can be set after
setData(value);
DateFieldModel model = getOrCreateComponentModel();
model.validDate = valid;
model.text = text;
} | [
"protected",
"void",
"handleRequestValue",
"(",
"final",
"Date",
"value",
",",
"final",
"boolean",
"valid",
",",
"final",
"String",
"text",
")",
"{",
"// As setData() clears the text value (if valid), this must be called first so it can be set after",
"setData",
"(",
"value",... | Set the request value.
@param value the date value
@param valid true if valid value
@param text the user text | [
"Set",
"the",
"request",
"value",
"."
] | train | https://github.com/BorderTech/wcomponents/blob/d1a2b2243270067db030feb36ca74255aaa94436/wcomponents-core/src/main/java/com/github/bordertech/wcomponents/WDateField.java#L209-L215 |
synchronoss/cpo-api | cpo-jdbc/src/main/java/org/synchronoss/cpo/jdbc/JdbcCpoAdapter.java | JdbcCpoAdapter.processUpdateGroup | protected <T> long processUpdateGroup(Collection<T> coll, String groupType, String groupName, Collection<CpoWhere> wheres, Collection<CpoOrderBy> orderBy, Collection<CpoNativeFunction> nativeExpressions) throws CpoException {
"""
DOCUMENT ME!
@param coll DOCUMENT ME!
@param groupType DOCUMENT ME!
@param ... | java | protected <T> long processUpdateGroup(Collection<T> coll, String groupType, String groupName, Collection<CpoWhere> wheres, Collection<CpoOrderBy> orderBy, Collection<CpoNativeFunction> nativeExpressions) throws CpoException {
Connection c = null;
long updateCount = 0;
try {
c = getWriteConnection();
... | [
"protected",
"<",
"T",
">",
"long",
"processUpdateGroup",
"(",
"Collection",
"<",
"T",
">",
"coll",
",",
"String",
"groupType",
",",
"String",
"groupName",
",",
"Collection",
"<",
"CpoWhere",
">",
"wheres",
",",
"Collection",
"<",
"CpoOrderBy",
">",
"orderBy... | DOCUMENT ME!
@param coll DOCUMENT ME!
@param groupType DOCUMENT ME!
@param groupName DOCUMENT ME!
@return DOCUMENT ME!
@throws CpoException DOCUMENT ME! | [
"DOCUMENT",
"ME!"
] | train | https://github.com/synchronoss/cpo-api/blob/dc745aca3b3206abf80b85d9689b0132f5baa694/cpo-jdbc/src/main/java/org/synchronoss/cpo/jdbc/JdbcCpoAdapter.java#L2745-L2763 |
JRebirth/JRebirth | org.jrebirth.af/presentation/src/main/java/org/jrebirth/af/presentation/ui/base/AbstractSlideModel.java | AbstractSlideModel.findAngle | private double findAngle(final double fromX, final double fromY, final double toX, final double toY) {
"""
Return the right angle for the given coordinate.
@param fromX the x starting point coordinate
@param toX the x arrival point coordinate
@param fromY the y starting point coordinate
@param toY the y arri... | java | private double findAngle(final double fromX, final double fromY, final double toX, final double toY) {
final double yDelta = toY - fromY;
final double y = Math.sin(yDelta) * Math.cos(toX);
final double x = Math.cos(fromX) * Math.sin(toX)
- Math.sin(fromX) * Math.cos(toX) * Math.c... | [
"private",
"double",
"findAngle",
"(",
"final",
"double",
"fromX",
",",
"final",
"double",
"fromY",
",",
"final",
"double",
"toX",
",",
"final",
"double",
"toY",
")",
"{",
"final",
"double",
"yDelta",
"=",
"toY",
"-",
"fromY",
";",
"final",
"double",
"y"... | Return the right angle for the given coordinate.
@param fromX the x starting point coordinate
@param toX the x arrival point coordinate
@param fromY the y starting point coordinate
@param toY the y arrival point coordinate
@return the right angle | [
"Return",
"the",
"right",
"angle",
"for",
"the",
"given",
"coordinate",
"."
] | train | https://github.com/JRebirth/JRebirth/blob/93f4fc087b83c73db540333b9686e97b4cec694d/org.jrebirth.af/presentation/src/main/java/org/jrebirth/af/presentation/ui/base/AbstractSlideModel.java#L534-L546 |
upwork/java-upwork | src/com/Upwork/api/Routers/Freelancers/Search.java | Search.find | public JSONObject find(HashMap<String, String> params) throws JSONException {
"""
Search freelancers
@param params (Optional) Parameters
@throws JSONException If error occurred
@return {@link JSONObject}
"""
return oClient.get("/profiles/v2/search/providers", params);
} | java | public JSONObject find(HashMap<String, String> params) throws JSONException {
return oClient.get("/profiles/v2/search/providers", params);
} | [
"public",
"JSONObject",
"find",
"(",
"HashMap",
"<",
"String",
",",
"String",
">",
"params",
")",
"throws",
"JSONException",
"{",
"return",
"oClient",
".",
"get",
"(",
"\"/profiles/v2/search/providers\"",
",",
"params",
")",
";",
"}"
] | Search freelancers
@param params (Optional) Parameters
@throws JSONException If error occurred
@return {@link JSONObject} | [
"Search",
"freelancers"
] | train | https://github.com/upwork/java-upwork/blob/342297161503a74e9e0bddbd381ab5eebf4dc454/src/com/Upwork/api/Routers/Freelancers/Search.java#L53-L55 |
ModeShape/modeshape | index-providers/modeshape-lucene-index-provider/src/main/java/org/modeshape/jcr/index/lucene/query/LuceneQueryFactory.java | LuceneQueryFactory.forTextIndex | public static LuceneQueryFactory forTextIndex( ValueFactories factories,
Map<String, Object> variables,
Map<String, PropertyType> propertyTypesByName,
LuceneConfig con... | java | public static LuceneQueryFactory forTextIndex( ValueFactories factories,
Map<String, Object> variables,
Map<String, PropertyType> propertyTypesByName,
LuceneConfig con... | [
"public",
"static",
"LuceneQueryFactory",
"forTextIndex",
"(",
"ValueFactories",
"factories",
",",
"Map",
"<",
"String",
",",
"Object",
">",
"variables",
",",
"Map",
"<",
"String",
",",
"PropertyType",
">",
"propertyTypesByName",
",",
"LuceneConfig",
"config",
")"... | Creates a new query factory which can be used to produce Lucene queries for {@link org.modeshape.jcr.index.lucene.TextIndex}
indexes.
@param factories a {@link ValueFactories} instance; may not be null
@param variables a {@link Map} instance which contains the query variables for a particular query; may be {@code null... | [
"Creates",
"a",
"new",
"query",
"factory",
"which",
"can",
"be",
"used",
"to",
"produce",
"Lucene",
"queries",
"for",
"{",
"@link",
"org",
".",
"modeshape",
".",
"jcr",
".",
"index",
".",
"lucene",
".",
"TextIndex",
"}",
"indexes",
"."
] | train | https://github.com/ModeShape/modeshape/blob/794cfdabb67a90f24629c4fff0424a6125f8f95b/index-providers/modeshape-lucene-index-provider/src/main/java/org/modeshape/jcr/index/lucene/query/LuceneQueryFactory.java#L160-L165 |
biojava/biojava | biojava-ws/src/main/java/org/biojava/nbio/ws/alignment/qblast/NCBIQBlastOutputProperties.java | NCBIQBlastOutputProperties.setOutputOption | @Override
public void setOutputOption(String key, String val) {
"""
This method forwards to {@link #setOutputOption(BlastOutputParameterEnum, String)}. Consider using it instead.
"""
setOutputOption(BlastOutputParameterEnum.valueOf(key), val);
} | java | @Override
public void setOutputOption(String key, String val) {
setOutputOption(BlastOutputParameterEnum.valueOf(key), val);
} | [
"@",
"Override",
"public",
"void",
"setOutputOption",
"(",
"String",
"key",
",",
"String",
"val",
")",
"{",
"setOutputOption",
"(",
"BlastOutputParameterEnum",
".",
"valueOf",
"(",
"key",
")",
",",
"val",
")",
";",
"}"
] | This method forwards to {@link #setOutputOption(BlastOutputParameterEnum, String)}. Consider using it instead. | [
"This",
"method",
"forwards",
"to",
"{"
] | train | https://github.com/biojava/biojava/blob/a1c71a8e3d40cc32104b1d387a3d3b560b43356e/biojava-ws/src/main/java/org/biojava/nbio/ws/alignment/qblast/NCBIQBlastOutputProperties.java#L75-L78 |
jboss/jboss-jstl-api_spec | src/main/java/org/apache/taglibs/standard/lang/support/ExpressionEvaluatorManager.java | ExpressionEvaluatorManager.getEvaluatorByName | @Deprecated
public static ExpressionEvaluator getEvaluatorByName(String name) throws JspException {
"""
Gets an ExpressionEvaluator from the cache, or seeds the cache
if we haven't seen a particular ExpressionEvaluator before.
"""
try {
ExpressionEvaluator evaluator = nameMap.get(name)... | java | @Deprecated
public static ExpressionEvaluator getEvaluatorByName(String name) throws JspException {
try {
ExpressionEvaluator evaluator = nameMap.get(name);
if (evaluator == null) {
nameMap.putIfAbsent(name, (ExpressionEvaluator) Class.forName(name).newInstance());
... | [
"@",
"Deprecated",
"public",
"static",
"ExpressionEvaluator",
"getEvaluatorByName",
"(",
"String",
"name",
")",
"throws",
"JspException",
"{",
"try",
"{",
"ExpressionEvaluator",
"evaluator",
"=",
"nameMap",
".",
"get",
"(",
"name",
")",
";",
"if",
"(",
"evaluato... | Gets an ExpressionEvaluator from the cache, or seeds the cache
if we haven't seen a particular ExpressionEvaluator before. | [
"Gets",
"an",
"ExpressionEvaluator",
"from",
"the",
"cache",
"or",
"seeds",
"the",
"cache",
"if",
"we",
"haven",
"t",
"seen",
"a",
"particular",
"ExpressionEvaluator",
"before",
"."
] | train | https://github.com/jboss/jboss-jstl-api_spec/blob/4ad412ae5be1ae606b8d33c188cb3d98bfcbe84c/src/main/java/org/apache/taglibs/standard/lang/support/ExpressionEvaluatorManager.java#L91-L110 |
eurekaclinical/eurekaclinical-common | src/main/java/org/eurekaclinical/common/comm/clients/EurekaClinicalClient.java | EurekaClinicalClient.errorIf | private void errorIf(ClientResponse response,
ClientResponse.Status[] status, boolean bool)
throws ClientException {
"""
If there is an unexpected status code, it gets the status message, closes
the response, and throws an exception.
@throws ClientException
"""
ClientRespons... | java | private void errorIf(ClientResponse response,
ClientResponse.Status[] status, boolean bool)
throws ClientException {
ClientResponse.Status clientResponseStatus
= response.getClientResponseStatus();
if (bool) {
if (contains(status, clientResponseStatus)... | [
"private",
"void",
"errorIf",
"(",
"ClientResponse",
"response",
",",
"ClientResponse",
".",
"Status",
"[",
"]",
"status",
",",
"boolean",
"bool",
")",
"throws",
"ClientException",
"{",
"ClientResponse",
".",
"Status",
"clientResponseStatus",
"=",
"response",
".",... | If there is an unexpected status code, it gets the status message, closes
the response, and throws an exception.
@throws ClientException | [
"If",
"there",
"is",
"an",
"unexpected",
"status",
"code",
"it",
"gets",
"the",
"status",
"message",
"closes",
"the",
"response",
"and",
"throws",
"an",
"exception",
"."
] | train | https://github.com/eurekaclinical/eurekaclinical-common/blob/1867102ff43fe94e519f76a074d5f5923e9be61c/src/main/java/org/eurekaclinical/common/comm/clients/EurekaClinicalClient.java#L1116-L1130 |
looly/hutool | hutool-setting/src/main/java/cn/hutool/setting/AbsSetting.java | AbsSetting.getDouble | public Double getDouble(String key, String group, Double defaultValue) {
"""
获取double类型属性值
@param key 属性名
@param group 分组名
@param defaultValue 默认值
@return 属性值
"""
return Convert.toDouble(getByGroup(key, group), defaultValue);
} | java | public Double getDouble(String key, String group, Double defaultValue) {
return Convert.toDouble(getByGroup(key, group), defaultValue);
} | [
"public",
"Double",
"getDouble",
"(",
"String",
"key",
",",
"String",
"group",
",",
"Double",
"defaultValue",
")",
"{",
"return",
"Convert",
".",
"toDouble",
"(",
"getByGroup",
"(",
"key",
",",
"group",
")",
",",
"defaultValue",
")",
";",
"}"
] | 获取double类型属性值
@param key 属性名
@param group 分组名
@param defaultValue 默认值
@return 属性值 | [
"获取double类型属性值"
] | train | https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-setting/src/main/java/cn/hutool/setting/AbsSetting.java#L252-L254 |
google/auto | service/processor/src/main/java/com/google/auto/service/processor/ServicesFiles.java | ServicesFiles.readServiceFile | static Set<String> readServiceFile(InputStream input) throws IOException {
"""
Reads the set of service classes from a service file.
@param input not {@code null}. Closed after use.
@return a not {@code null Set} of service class names.
@throws IOException
"""
HashSet<String> serviceClasses = new Hash... | java | static Set<String> readServiceFile(InputStream input) throws IOException {
HashSet<String> serviceClasses = new HashSet<String>();
Closer closer = Closer.create();
try {
// TODO(gak): use CharStreams
BufferedReader r = closer.register(new BufferedReader(new InputStreamReader(input, UTF_8)));
... | [
"static",
"Set",
"<",
"String",
">",
"readServiceFile",
"(",
"InputStream",
"input",
")",
"throws",
"IOException",
"{",
"HashSet",
"<",
"String",
">",
"serviceClasses",
"=",
"new",
"HashSet",
"<",
"String",
">",
"(",
")",
";",
"Closer",
"closer",
"=",
"Clo... | Reads the set of service classes from a service file.
@param input not {@code null}. Closed after use.
@return a not {@code null Set} of service class names.
@throws IOException | [
"Reads",
"the",
"set",
"of",
"service",
"classes",
"from",
"a",
"service",
"file",
"."
] | train | https://github.com/google/auto/blob/4158a5fa71f1ef763e683b627f4d29bc04cfde9d/service/processor/src/main/java/com/google/auto/service/processor/ServicesFiles.java#L58-L81 |
lucee/Lucee | core/src/main/java/lucee/commons/io/SystemUtil.java | SystemUtil.getTempFile | public static Resource getTempFile(String extension, boolean touch) throws IOException {
"""
returns the a unique temp file (with no auto delete)
@param extension
@return temp directory
@throws IOException
"""
String filename = CreateUniqueId.invoke();
if (!StringUtil.isEmpty(extension, true)) {
if... | java | public static Resource getTempFile(String extension, boolean touch) throws IOException {
String filename = CreateUniqueId.invoke();
if (!StringUtil.isEmpty(extension, true)) {
if (extension.startsWith(".")) filename += extension;
else filename += "." + extension;
}
Resource file = getTempDirectory().getRe... | [
"public",
"static",
"Resource",
"getTempFile",
"(",
"String",
"extension",
",",
"boolean",
"touch",
")",
"throws",
"IOException",
"{",
"String",
"filename",
"=",
"CreateUniqueId",
".",
"invoke",
"(",
")",
";",
"if",
"(",
"!",
"StringUtil",
".",
"isEmpty",
"(... | returns the a unique temp file (with no auto delete)
@param extension
@return temp directory
@throws IOException | [
"returns",
"the",
"a",
"unique",
"temp",
"file",
"(",
"with",
"no",
"auto",
"delete",
")"
] | train | https://github.com/lucee/Lucee/blob/29b153fc4e126e5edb97da937f2ee2e231b87593/core/src/main/java/lucee/commons/io/SystemUtil.java#L369-L378 |
jbundle/jbundle | main/db/src/main/java/org/jbundle/main/user/db/UserField.java | UserField.setupDefaultView | public ScreenComponent setupDefaultView(ScreenLoc itsLocation, ComponentParent targetScreen, Convert converter, int iDisplayFieldDesc, Map<String, Object> properties) {
"""
Set up the default screen control for this field.
@param itsLocation Location of this component on screen (ie., GridBagConstraint).
@param t... | java | public ScreenComponent setupDefaultView(ScreenLoc itsLocation, ComponentParent targetScreen, Convert converter, int iDisplayFieldDesc, Map<String, Object> properties)
{
Record record = this.makeReferenceRecord();
return this.setupTableLookup(itsLocation, targetScreen, converter, iDisplayFieldDesc, r... | [
"public",
"ScreenComponent",
"setupDefaultView",
"(",
"ScreenLoc",
"itsLocation",
",",
"ComponentParent",
"targetScreen",
",",
"Convert",
"converter",
",",
"int",
"iDisplayFieldDesc",
",",
"Map",
"<",
"String",
",",
"Object",
">",
"properties",
")",
"{",
"Record",
... | Set up the default screen control for this field.
@param itsLocation Location of this component on screen (ie., GridBagConstraint).
@param targetScreen Where to place this component (ie., Parent screen or GridBagLayout).
@param converter The converter to set the screenfield to.
@param iDisplayFieldDesc Display the labe... | [
"Set",
"up",
"the",
"default",
"screen",
"control",
"for",
"this",
"field",
"."
] | train | https://github.com/jbundle/jbundle/blob/4037fcfa85f60c7d0096c453c1a3cd573c2b0abc/main/db/src/main/java/org/jbundle/main/user/db/UserField.java#L76-L80 |
Mozu/mozu-java | mozu-java-core/src/main/java/com/mozu/api/urls/commerce/catalog/admin/ProductUrl.java | ProductUrl.deleteProductInCatalogUrl | public static MozuUrl deleteProductInCatalogUrl(Integer catalogId, String productCode) {
"""
Get Resource Url for DeleteProductInCatalog
@param catalogId Unique identifier for a catalog.
@param productCode The unique, user-defined product code of a product, used throughout to reference and associate to a produc... | java | public static MozuUrl deleteProductInCatalogUrl(Integer catalogId, String productCode)
{
UrlFormatter formatter = new UrlFormatter("/api/commerce/catalog/admin/products/{productCode}/ProductInCatalogs/{catalogId}");
formatter.formatUrl("catalogId", catalogId);
formatter.formatUrl("productCode", productCode);... | [
"public",
"static",
"MozuUrl",
"deleteProductInCatalogUrl",
"(",
"Integer",
"catalogId",
",",
"String",
"productCode",
")",
"{",
"UrlFormatter",
"formatter",
"=",
"new",
"UrlFormatter",
"(",
"\"/api/commerce/catalog/admin/products/{productCode}/ProductInCatalogs/{catalogId}\"",
... | Get Resource Url for DeleteProductInCatalog
@param catalogId Unique identifier for a catalog.
@param productCode The unique, user-defined product code of a product, used throughout to reference and associate to a product.
@return String Resource Url | [
"Get",
"Resource",
"Url",
"for",
"DeleteProductInCatalog"
] | train | https://github.com/Mozu/mozu-java/blob/5beadde73601a859f845e3e2fc1077b39c8bea83/mozu-java-core/src/main/java/com/mozu/api/urls/commerce/catalog/admin/ProductUrl.java#L180-L186 |
cesarferreira/AndroidQuickUtils | library/src/main/java/quickutils/core/categories/sdcard.java | sdcard.writeToFile | private static void writeToFile(String text, String logFilePath, boolean isDetailed) {
"""
private write to file method
@param text text to append
@param logFilePath path to the file
@param isDetailed if it should show the timestamp or not
"""
if (isSDCardAvailable() && isSDCardWritable()... | java | private static void writeToFile(String text, String logFilePath, boolean isDetailed) {
if (isSDCardAvailable() && isSDCardWritable() && text != null) {
try {
File file = new File(logFilePath);
OutputStream os = new FileOutputStream(file, true);
... | [
"private",
"static",
"void",
"writeToFile",
"(",
"String",
"text",
",",
"String",
"logFilePath",
",",
"boolean",
"isDetailed",
")",
"{",
"if",
"(",
"isSDCardAvailable",
"(",
")",
"&&",
"isSDCardWritable",
"(",
")",
"&&",
"text",
"!=",
"null",
")",
"{",
"tr... | private write to file method
@param text text to append
@param logFilePath path to the file
@param isDetailed if it should show the timestamp or not | [
"private",
"write",
"to",
"file",
"method"
] | train | https://github.com/cesarferreira/AndroidQuickUtils/blob/73a91daedbb9f7be7986ea786fbc441c9e5a881c/library/src/main/java/quickutils/core/categories/sdcard.java#L243-L261 |
TheCoder4eu/BootsFaces-OSP | src/main/java/net/bootsfaces/component/remoteCommand/RemoteCommandRenderer.java | RemoteCommandRenderer.encodeBegin | @Override
public void encodeBegin(FacesContext context, UIComponent component) throws IOException {
"""
This methods generates the HTML code of the current b:remoteCommand.
@param context the FacesContext.
@param component the current b:remoteCommand.
@throws IOException thrown if something goes wrong when wri... | java | @Override
public void encodeBegin(FacesContext context, UIComponent component) throws IOException {
if (!component.isRendered()) {
return;
}
RemoteCommand remoteCommand = (RemoteCommand) component;
ResponseWriter rw = context.getResponseWriter();
String clientId = remoteCommand.getClientId();
String pa... | [
"@",
"Override",
"public",
"void",
"encodeBegin",
"(",
"FacesContext",
"context",
",",
"UIComponent",
"component",
")",
"throws",
"IOException",
"{",
"if",
"(",
"!",
"component",
".",
"isRendered",
"(",
")",
")",
"{",
"return",
";",
"}",
"RemoteCommand",
"re... | This methods generates the HTML code of the current b:remoteCommand.
@param context the FacesContext.
@param component the current b:remoteCommand.
@throws IOException thrown if something goes wrong when writing the HTML code. | [
"This",
"methods",
"generates",
"the",
"HTML",
"code",
"of",
"the",
"current",
"b",
":",
"remoteCommand",
"."
] | train | https://github.com/TheCoder4eu/BootsFaces-OSP/blob/d1a70952bc240979b5272fa4fe1c7f100873add0/src/main/java/net/bootsfaces/component/remoteCommand/RemoteCommandRenderer.java#L63-L99 |
google/error-prone-javac | src/jdk.compiler/share/classes/com/sun/source/util/DocTreePath.java | DocTreePath.getPath | public static DocTreePath getPath(TreePath treePath, DocCommentTree doc, DocTree target) {
"""
Returns a documentation tree path for a tree node within a compilation unit,
or {@code null} if the node is not found.
@param treePath the path for the node with which the doc comment is associated
@param doc the doc ... | java | public static DocTreePath getPath(TreePath treePath, DocCommentTree doc, DocTree target) {
return getPath(new DocTreePath(treePath, doc), target);
} | [
"public",
"static",
"DocTreePath",
"getPath",
"(",
"TreePath",
"treePath",
",",
"DocCommentTree",
"doc",
",",
"DocTree",
"target",
")",
"{",
"return",
"getPath",
"(",
"new",
"DocTreePath",
"(",
"treePath",
",",
"doc",
")",
",",
"target",
")",
";",
"}"
] | Returns a documentation tree path for a tree node within a compilation unit,
or {@code null} if the node is not found.
@param treePath the path for the node with which the doc comment is associated
@param doc the doc comment associated with the node
@param target a node within the doc comment
@return a path identifying... | [
"Returns",
"a",
"documentation",
"tree",
"path",
"for",
"a",
"tree",
"node",
"within",
"a",
"compilation",
"unit",
"or",
"{"
] | train | https://github.com/google/error-prone-javac/blob/a53d069bbdb2c60232ed3811c19b65e41c3e60e0/src/jdk.compiler/share/classes/com/sun/source/util/DocTreePath.java#L49-L51 |
graknlabs/grakn | server/src/server/exception/TransactionException.java | TransactionException.duplicateHas | public static TransactionException duplicateHas(Type type, AttributeType attributeType) {
"""
Thrown when {@code type} has {@code attributeType} as a Type#key(AttributeType) and a Type#has(AttributeType)
"""
return create(ErrorMessage.CANNOT_BE_KEY_AND_ATTRIBUTE.getMessage(type.label(), attributeType.l... | java | public static TransactionException duplicateHas(Type type, AttributeType attributeType) {
return create(ErrorMessage.CANNOT_BE_KEY_AND_ATTRIBUTE.getMessage(type.label(), attributeType.label()));
} | [
"public",
"static",
"TransactionException",
"duplicateHas",
"(",
"Type",
"type",
",",
"AttributeType",
"attributeType",
")",
"{",
"return",
"create",
"(",
"ErrorMessage",
".",
"CANNOT_BE_KEY_AND_ATTRIBUTE",
".",
"getMessage",
"(",
"type",
".",
"label",
"(",
")",
"... | Thrown when {@code type} has {@code attributeType} as a Type#key(AttributeType) and a Type#has(AttributeType) | [
"Thrown",
"when",
"{"
] | train | https://github.com/graknlabs/grakn/blob/6aaee75ea846202474d591f8809d62028262fac5/server/src/server/exception/TransactionException.java#L115-L117 |
bitcoinj/bitcoinj | core/src/main/java/org/bitcoinj/core/LegacyAddress.java | LegacyAddress.fromKey | public static LegacyAddress fromKey(NetworkParameters params, ECKey key) {
"""
Construct a {@link LegacyAddress} that represents the public part of the given {@link ECKey}. Note that an address is
derived from a hash of the public key and is not the public key itself.
@param params
network this address is val... | java | public static LegacyAddress fromKey(NetworkParameters params, ECKey key) {
return fromPubKeyHash(params, key.getPubKeyHash());
} | [
"public",
"static",
"LegacyAddress",
"fromKey",
"(",
"NetworkParameters",
"params",
",",
"ECKey",
"key",
")",
"{",
"return",
"fromPubKeyHash",
"(",
"params",
",",
"key",
".",
"getPubKeyHash",
"(",
")",
")",
";",
"}"
] | Construct a {@link LegacyAddress} that represents the public part of the given {@link ECKey}. Note that an address is
derived from a hash of the public key and is not the public key itself.
@param params
network this address is valid for
@param key
only the public part is used
@return constructed address | [
"Construct",
"a",
"{",
"@link",
"LegacyAddress",
"}",
"that",
"represents",
"the",
"public",
"part",
"of",
"the",
"given",
"{",
"@link",
"ECKey",
"}",
".",
"Note",
"that",
"an",
"address",
"is",
"derived",
"from",
"a",
"hash",
"of",
"the",
"public",
"key... | train | https://github.com/bitcoinj/bitcoinj/blob/9cf13d29315014ed59cf4fc5944e5f227e8df9a6/core/src/main/java/org/bitcoinj/core/LegacyAddress.java#L98-L100 |
ggrandes/kvstore | src/main/java/org/javastack/kvstore/structures/btree/BplusTree.java | BplusTree.lowerEntry | public synchronized TreeEntry<K, V> lowerEntry(final K key) {
"""
Returns the greatest key strictly less than the given key, or null if there is no such key.
@param key the key
@return the Entry with greatest key strictly less than the given key, or null if there is no such key.
"""
// Retorna la clave m... | java | public synchronized TreeEntry<K, V> lowerEntry(final K key) {
// Retorna la clave mas cercana menor a la clave indicada
return getRoundEntry(key, false, false);
} | [
"public",
"synchronized",
"TreeEntry",
"<",
"K",
",",
"V",
">",
"lowerEntry",
"(",
"final",
"K",
"key",
")",
"{",
"// Retorna la clave mas cercana menor a la clave indicada",
"return",
"getRoundEntry",
"(",
"key",
",",
"false",
",",
"false",
")",
";",
"}"
] | Returns the greatest key strictly less than the given key, or null if there is no such key.
@param key the key
@return the Entry with greatest key strictly less than the given key, or null if there is no such key. | [
"Returns",
"the",
"greatest",
"key",
"strictly",
"less",
"than",
"the",
"given",
"key",
"or",
"null",
"if",
"there",
"is",
"no",
"such",
"key",
"."
] | train | https://github.com/ggrandes/kvstore/blob/c79277f79f4604e0fec8349a98519838e3de38f0/src/main/java/org/javastack/kvstore/structures/btree/BplusTree.java#L682-L685 |
iron-io/iron_mq_java | src/main/java/io/iron/ironmq/Queue.java | Queue.deleteMessage | public void deleteMessage(String id, String reservationId) throws IOException {
"""
Deletes a Message from the queue.
@param id The ID of the message to delete.
@param reservationId Reservation Id of the message. Reserved message could not be deleted without reservation Id.
@throws io.iron.ironmq.HTTPExcept... | java | public void deleteMessage(String id, String reservationId) throws IOException {
deleteMessage(id, reservationId, null);
} | [
"public",
"void",
"deleteMessage",
"(",
"String",
"id",
",",
"String",
"reservationId",
")",
"throws",
"IOException",
"{",
"deleteMessage",
"(",
"id",
",",
"reservationId",
",",
"null",
")",
";",
"}"
] | Deletes a Message from the queue.
@param id The ID of the message to delete.
@param reservationId Reservation Id of the message. Reserved message could not be deleted without reservation Id.
@throws io.iron.ironmq.HTTPException If the IronMQ service returns a status other than 200 OK.
@throws java.io.IOException If t... | [
"Deletes",
"a",
"Message",
"from",
"the",
"queue",
"."
] | train | https://github.com/iron-io/iron_mq_java/blob/62d6a86545ca7ef31b7b4797aae0c5b31394a507/src/main/java/io/iron/ironmq/Queue.java#L281-L283 |
Dempsy/dempsy | dempsy-framework.impl/src/main/java/net/dempsy/output/OutputQuartzHelper.java | OutputQuartzHelper.getSimpleTrigger | public Trigger getSimpleTrigger(TimeUnit timeUnit, int timeInterval) {
"""
Gets the simple trigger.
@param timeUnit the time unit
@param timeInterval the time interval
@return the simple trigger
"""
SimpleScheduleBuilder simpleScheduleBuilder = null;
simpleScheduleBuilder = SimpleScheduleBuilder.s... | java | public Trigger getSimpleTrigger(TimeUnit timeUnit, int timeInterval) {
SimpleScheduleBuilder simpleScheduleBuilder = null;
simpleScheduleBuilder = SimpleScheduleBuilder.simpleSchedule();
switch (timeUnit) {
case MILLISECONDS:
simpleScheduleBuilder.withIntervalInMilliseconds(timeInterval).repeatFo... | [
"public",
"Trigger",
"getSimpleTrigger",
"(",
"TimeUnit",
"timeUnit",
",",
"int",
"timeInterval",
")",
"{",
"SimpleScheduleBuilder",
"simpleScheduleBuilder",
"=",
"null",
";",
"simpleScheduleBuilder",
"=",
"SimpleScheduleBuilder",
".",
"simpleSchedule",
"(",
")",
";",
... | Gets the simple trigger.
@param timeUnit the time unit
@param timeInterval the time interval
@return the simple trigger | [
"Gets",
"the",
"simple",
"trigger",
"."
] | train | https://github.com/Dempsy/dempsy/blob/cd3415b51b6787a6a9d9589b15f00ce674b6f113/dempsy-framework.impl/src/main/java/net/dempsy/output/OutputQuartzHelper.java#L62-L87 |
konmik/nucleus | nucleus-example-with-fragments/src/main/java/nucleus/example/main/FragmentStack.java | FragmentStack.findCallback | @SuppressWarnings("unchecked")
public <T> T findCallback(Fragment fragment, Class<T> callbackType) {
"""
Returns a back fragment if the fragment is of given class.
If such fragment does not exist and activity implements the given class then the activity will be returned.
@param fragment a fragment to s... | java | @SuppressWarnings("unchecked")
public <T> T findCallback(Fragment fragment, Class<T> callbackType) {
Fragment back = getBackFragment(fragment);
if (back != null && callbackType.isAssignableFrom(back.getClass()))
return (T)back;
if (callbackType.isAssignableFrom(activity.getCla... | [
"@",
"SuppressWarnings",
"(",
"\"unchecked\"",
")",
"public",
"<",
"T",
">",
"T",
"findCallback",
"(",
"Fragment",
"fragment",
",",
"Class",
"<",
"T",
">",
"callbackType",
")",
"{",
"Fragment",
"back",
"=",
"getBackFragment",
"(",
"fragment",
")",
";",
"if... | Returns a back fragment if the fragment is of given class.
If such fragment does not exist and activity implements the given class then the activity will be returned.
@param fragment a fragment to search from.
@param callbackType a class of type for callback to search.
@param <T> a type of callback.
@retu... | [
"Returns",
"a",
"back",
"fragment",
"if",
"the",
"fragment",
"is",
"of",
"given",
"class",
".",
"If",
"such",
"fragment",
"does",
"not",
"exist",
"and",
"activity",
"implements",
"the",
"given",
"class",
"then",
"the",
"activity",
"will",
"be",
"returned",
... | train | https://github.com/konmik/nucleus/blob/b161484a2bbf66a7896a8c1f61fa7187856ca5f7/nucleus-example-with-fragments/src/main/java/nucleus/example/main/FragmentStack.java#L122-L134 |
deeplearning4j/deeplearning4j | nd4j/nd4j-backends/nd4j-api-parent/nd4j-api/src/main/java/org/nd4j/autodiff/samediff/SameDiff.java | SameDiff.updateVariableNameAndReference | public SDVariable updateVariableNameAndReference(SDVariable varToUpdate, String newVarName) {
"""
Updates the variable name property on the passed in variable, the reference in samediff, and returns the variable.
<p>
Note that if null for the new variable is passed in, it will just return the original input vari... | java | public SDVariable updateVariableNameAndReference(SDVariable varToUpdate, String newVarName) {
if (varToUpdate == null) {
throw new NullPointerException("Null input: No variable found for updating!");
}
if(newVarName != null && variables.containsKey(newVarName) && varToUpdate != vari... | [
"public",
"SDVariable",
"updateVariableNameAndReference",
"(",
"SDVariable",
"varToUpdate",
",",
"String",
"newVarName",
")",
"{",
"if",
"(",
"varToUpdate",
"==",
"null",
")",
"{",
"throw",
"new",
"NullPointerException",
"(",
"\"Null input: No variable found for updating!... | Updates the variable name property on the passed in variable, the reference in samediff, and returns the variable.
<p>
Note that if null for the new variable is passed in, it will just return the original input variable.
@param varToUpdate the variable to update
@param newVarName the new variable name
@return the pas... | [
"Updates",
"the",
"variable",
"name",
"property",
"on",
"the",
"passed",
"in",
"variable",
"the",
"reference",
"in",
"samediff",
"and",
"returns",
"the",
"variable",
".",
"<p",
">",
"Note",
"that",
"if",
"null",
"for",
"the",
"new",
"variable",
"is",
"pass... | train | https://github.com/deeplearning4j/deeplearning4j/blob/effce52f2afd7eeb53c5bcca699fcd90bd06822f/nd4j/nd4j-backends/nd4j-api-parent/nd4j-api/src/main/java/org/nd4j/autodiff/samediff/SameDiff.java#L3803-L3826 |
upwork/java-upwork | src/com/Upwork/api/Routers/Activities/Team.java | Team._getByType | private JSONObject _getByType(String company, String team, String code) throws JSONException {
"""
Get by type
@param company Company ID
@param team Team ID
@param code (Optional) Code(s)
@throws JSONException If error occurred
@return {@link JSONObject}
"""
String url = "";
if (code... | java | private JSONObject _getByType(String company, String team, String code) throws JSONException {
String url = "";
if (code != null) {
url = "/" + code;
}
return oClient.get("/otask/v1/tasks/companies/" + company + "/teams/" + team + "/tasks" + url);
} | [
"private",
"JSONObject",
"_getByType",
"(",
"String",
"company",
",",
"String",
"team",
",",
"String",
"code",
")",
"throws",
"JSONException",
"{",
"String",
"url",
"=",
"\"\"",
";",
"if",
"(",
"code",
"!=",
"null",
")",
"{",
"url",
"=",
"\"/\"",
"+",
... | Get by type
@param company Company ID
@param team Team ID
@param code (Optional) Code(s)
@throws JSONException If error occurred
@return {@link JSONObject} | [
"Get",
"by",
"type"
] | train | https://github.com/upwork/java-upwork/blob/342297161503a74e9e0bddbd381ab5eebf4dc454/src/com/Upwork/api/Routers/Activities/Team.java#L55-L62 |
sawano/java-commons | src/main/java/se/sawano/java/commons/lang/validate/Validate.java | Validate.isNull | public static <T> void isNull(final T object, final String message, final Object... values) {
"""
<p>Validate that the specified argument is {@code null}; otherwise throwing an exception with the specified message.
<pre>Validate.isNull(myObject, "The object must be null");</pre>
@param <T>
the object type
@p... | java | public static <T> void isNull(final T object, final String message, final Object... values) {
INSTANCE.isNull(object, message, values);
} | [
"public",
"static",
"<",
"T",
">",
"void",
"isNull",
"(",
"final",
"T",
"object",
",",
"final",
"String",
"message",
",",
"final",
"Object",
"...",
"values",
")",
"{",
"INSTANCE",
".",
"isNull",
"(",
"object",
",",
"message",
",",
"values",
")",
";",
... | <p>Validate that the specified argument is {@code null}; otherwise throwing an exception with the specified message.
<pre>Validate.isNull(myObject, "The object must be null");</pre>
@param <T>
the object type
@param object
the object to check
@param message
the {@link String#format(String, Object...)} exception messag... | [
"<p",
">",
"Validate",
"that",
"the",
"specified",
"argument",
"is",
"{",
"@code",
"null",
"}",
";",
"otherwise",
"throwing",
"an",
"exception",
"with",
"the",
"specified",
"message",
".",
"<pre",
">",
"Validate",
".",
"isNull",
"(",
"myObject",
"The",
"ob... | train | https://github.com/sawano/java-commons/blob/6f219c9e8dec4401dbe528d17ae6ec1ef9c0d284/src/main/java/se/sawano/java/commons/lang/validate/Validate.java#L533-L535 |
JodaOrg/joda-time | src/main/java/org/joda/time/YearMonthDay.java | YearMonthDay.withChronologyRetainFields | public YearMonthDay withChronologyRetainFields(Chronology newChronology) {
"""
Returns a copy of this date with the specified chronology.
This instance is immutable and unaffected by this method call.
<p>
This method retains the values of the fields, thus the result will
typically refer to a different instant.... | java | public YearMonthDay withChronologyRetainFields(Chronology newChronology) {
newChronology = DateTimeUtils.getChronology(newChronology);
newChronology = newChronology.withUTC();
if (newChronology == getChronology()) {
return this;
} else {
YearMonthDay newYearMonthD... | [
"public",
"YearMonthDay",
"withChronologyRetainFields",
"(",
"Chronology",
"newChronology",
")",
"{",
"newChronology",
"=",
"DateTimeUtils",
".",
"getChronology",
"(",
"newChronology",
")",
";",
"newChronology",
"=",
"newChronology",
".",
"withUTC",
"(",
")",
";",
"... | Returns a copy of this date with the specified chronology.
This instance is immutable and unaffected by this method call.
<p>
This method retains the values of the fields, thus the result will
typically refer to a different instant.
<p>
The time zone of the specified chronology is ignored, as YearMonthDay
operates with... | [
"Returns",
"a",
"copy",
"of",
"this",
"date",
"with",
"the",
"specified",
"chronology",
".",
"This",
"instance",
"is",
"immutable",
"and",
"unaffected",
"by",
"this",
"method",
"call",
".",
"<p",
">",
"This",
"method",
"retains",
"the",
"values",
"of",
"th... | train | https://github.com/JodaOrg/joda-time/blob/bd79f1c4245e79b3c2c56d7b04fde2a6e191fa42/src/main/java/org/joda/time/YearMonthDay.java#L380-L390 |
Jsondb/jsondb-core | src/main/java/io/jsondb/crypto/CryptoUtil.java | CryptoUtil.decryptFields | public static void decryptFields(Object object, CollectionMetaData cmd, ICipher cipher)
throws IllegalAccessException, IllegalArgumentException, InvocationTargetException {
"""
A utility method to decrypt the value of field marked by the @Secret annotation using its
setter/mutator method.
@param object th... | java | public static void decryptFields(Object object, CollectionMetaData cmd, ICipher cipher)
throws IllegalAccessException, IllegalArgumentException, InvocationTargetException {
for (String secretAnnotatedFieldName: cmd.getSecretAnnotatedFieldNames()) {
Method getterMethod = cmd.getGetterMethodForFieldName... | [
"public",
"static",
"void",
"decryptFields",
"(",
"Object",
"object",
",",
"CollectionMetaData",
"cmd",
",",
"ICipher",
"cipher",
")",
"throws",
"IllegalAccessException",
",",
"IllegalArgumentException",
",",
"InvocationTargetException",
"{",
"for",
"(",
"String",
"se... | A utility method to decrypt the value of field marked by the @Secret annotation using its
setter/mutator method.
@param object the actual Object representing the POJO we want the Id of.
@param cmd the CollectionMetaData object from which we can obtain the list
containing names of fields which have the @Secret annotatio... | [
"A",
"utility",
"method",
"to",
"decrypt",
"the",
"value",
"of",
"field",
"marked",
"by",
"the"
] | train | https://github.com/Jsondb/jsondb-core/blob/c49654d1eee2ace4d5ca5be19730652a966ce7f4/src/main/java/io/jsondb/crypto/CryptoUtil.java#L90-L110 |
jeremylong/DependencyCheck | utils/src/main/java/org/owasp/dependencycheck/utils/Settings.java | Settings.setStringIfNotEmpty | public void setStringIfNotEmpty(@NotNull final String key, @Nullable final String value) {
"""
Sets a property value only if the value is not null and not empty.
@param key the key for the property
@param value the value for the property
"""
if (null != value && !value.isEmpty()) {
setS... | java | public void setStringIfNotEmpty(@NotNull final String key, @Nullable final String value) {
if (null != value && !value.isEmpty()) {
setString(key, value);
}
} | [
"public",
"void",
"setStringIfNotEmpty",
"(",
"@",
"NotNull",
"final",
"String",
"key",
",",
"@",
"Nullable",
"final",
"String",
"value",
")",
"{",
"if",
"(",
"null",
"!=",
"value",
"&&",
"!",
"value",
".",
"isEmpty",
"(",
")",
")",
"{",
"setString",
"... | Sets a property value only if the value is not null and not empty.
@param key the key for the property
@param value the value for the property | [
"Sets",
"a",
"property",
"value",
"only",
"if",
"the",
"value",
"is",
"not",
"null",
"and",
"not",
"empty",
"."
] | train | https://github.com/jeremylong/DependencyCheck/blob/6cc7690ea12e4ca1454210ceaa2e9a5523f0926c/utils/src/main/java/org/owasp/dependencycheck/utils/Settings.java#L688-L692 |
lucee/Lucee | core/src/main/java/lucee/runtime/tag/Http.java | Http.setTimeout | public void setTimeout(Object timeout) throws PageException {
"""
set the value timeout
@param timeout value to set
@throws ExpressionException
"""
if (timeout instanceof TimeSpan) this.timeout = (TimeSpan) timeout;
// seconds
else {
int i = Caster.toIntValue(timeout);
if (i < 0) throw new App... | java | public void setTimeout(Object timeout) throws PageException {
if (timeout instanceof TimeSpan) this.timeout = (TimeSpan) timeout;
// seconds
else {
int i = Caster.toIntValue(timeout);
if (i < 0) throw new ApplicationException("invalid value [" + i + "] for attribute timeout, value must be a positive intege... | [
"public",
"void",
"setTimeout",
"(",
"Object",
"timeout",
")",
"throws",
"PageException",
"{",
"if",
"(",
"timeout",
"instanceof",
"TimeSpan",
")",
"this",
".",
"timeout",
"=",
"(",
"TimeSpan",
")",
"timeout",
";",
"// seconds",
"else",
"{",
"int",
"i",
"=... | set the value timeout
@param timeout value to set
@throws ExpressionException | [
"set",
"the",
"value",
"timeout"
] | train | https://github.com/lucee/Lucee/blob/29b153fc4e126e5edb97da937f2ee2e231b87593/core/src/main/java/lucee/runtime/tag/Http.java#L439-L448 |
ksclarke/vertx-pairtree | src/main/java/info/freelibrary/pairtree/PairtreeFactory.java | PairtreeFactory.getPrefixedPairtree | public Pairtree getPrefixedPairtree(final String aPrefix, final String aBucket, final String aBucketPath,
final String aAccessKey, final String aSecretKey) {
"""
Creates a Pairtree, with the supplied prefix, using the supplied S3 bucket and internal bucket path.
@param aPrefix A Pairtree prefix
@pa... | java | public Pairtree getPrefixedPairtree(final String aPrefix, final String aBucket, final String aBucketPath,
final String aAccessKey, final String aSecretKey) {
return new S3Pairtree(aPrefix, myVertx, aBucket, aBucketPath, aAccessKey, aSecretKey);
} | [
"public",
"Pairtree",
"getPrefixedPairtree",
"(",
"final",
"String",
"aPrefix",
",",
"final",
"String",
"aBucket",
",",
"final",
"String",
"aBucketPath",
",",
"final",
"String",
"aAccessKey",
",",
"final",
"String",
"aSecretKey",
")",
"{",
"return",
"new",
"S3Pa... | Creates a Pairtree, with the supplied prefix, using the supplied S3 bucket and internal bucket path.
@param aPrefix A Pairtree prefix
@param aBucket An S3 bucket
@param aBucketPath A path in the S3 bucket to the Pairtree root
@param aAccessKey An AWS access key
@param aSecretKey An AWS secret key
@return A Pairtree | [
"Creates",
"a",
"Pairtree",
"with",
"the",
"supplied",
"prefix",
"using",
"the",
"supplied",
"S3",
"bucket",
"and",
"internal",
"bucket",
"path",
"."
] | train | https://github.com/ksclarke/vertx-pairtree/blob/b2ea1e32057e5df262e9265540d346a732b718df/src/main/java/info/freelibrary/pairtree/PairtreeFactory.java#L274-L277 |
OpenLiberty/open-liberty | dev/com.ibm.ws.messaging.msgstore/src/com/ibm/ws/objectManager/AbstractTreeMap.java | AbstractTreeMap.put | public Object put(Object key, Token value) throws ObjectManagerException {
"""
Maps the specified key to the specified value.
@param key the key
@param value the value
@return the value of any previous mapping with the specified key or null
if there was no mapping
@exception ClassCastException
when the... | java | public Object put(Object key, Token value) throws ObjectManagerException {
AbstractMapEntry entry = rbInsert(key);
Object result = entry.value;
entry.value = value;
return result;
} | [
"public",
"Object",
"put",
"(",
"Object",
"key",
",",
"Token",
"value",
")",
"throws",
"ObjectManagerException",
"{",
"AbstractMapEntry",
"entry",
"=",
"rbInsert",
"(",
"key",
")",
";",
"Object",
"result",
"=",
"entry",
".",
"value",
";",
"entry",
".",
"va... | Maps the specified key to the specified value.
@param key the key
@param value the value
@return the value of any previous mapping with the specified key or null
if there was no mapping
@exception ClassCastException
when the key cannot be compared with the keys in this
TreeMap
@exception NullPointerException
when th... | [
"Maps",
"the",
"specified",
"key",
"to",
"the",
"specified",
"value",
"."
] | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.messaging.msgstore/src/com/ibm/ws/objectManager/AbstractTreeMap.java#L951-L956 |
jdereg/java-util | src/main/java/com/cedarsoftware/util/UrlUtilities.java | UrlUtilities.getContentFromUrlAsString | public static String getContentFromUrlAsString(String url, Map inCookies, Map outCookies, boolean trustAllCerts) {
"""
Get content from the passed in URL. This code will open a connection to
the passed in server, fetch the requested content, and return it as a
String.
@param url URL to hit
@param inCookies ... | java | public static String getContentFromUrlAsString(String url, Map inCookies, Map outCookies, boolean trustAllCerts)
{
byte[] bytes = getContentFromUrl(url, inCookies, outCookies, trustAllCerts);
return bytes == null ? null : StringUtilities.createString(bytes, "UTF-8");
} | [
"public",
"static",
"String",
"getContentFromUrlAsString",
"(",
"String",
"url",
",",
"Map",
"inCookies",
",",
"Map",
"outCookies",
",",
"boolean",
"trustAllCerts",
")",
"{",
"byte",
"[",
"]",
"bytes",
"=",
"getContentFromUrl",
"(",
"url",
",",
"inCookies",
",... | Get content from the passed in URL. This code will open a connection to
the passed in server, fetch the requested content, and return it as a
String.
@param url URL to hit
@param inCookies Map of session cookies (or null if not needed)
@param outCookies Map of session cookies (or null if not needed)
@param trustAllCe... | [
"Get",
"content",
"from",
"the",
"passed",
"in",
"URL",
".",
"This",
"code",
"will",
"open",
"a",
"connection",
"to",
"the",
"passed",
"in",
"server",
"fetch",
"the",
"requested",
"content",
"and",
"return",
"it",
"as",
"a",
"String",
"."
] | train | https://github.com/jdereg/java-util/blob/a2dce61aed16d6454ee575174dda1ba6bff0015c/src/main/java/com/cedarsoftware/util/UrlUtilities.java#L439-L443 |
ironjacamar/ironjacamar | core/src/main/java/org/ironjacamar/core/tx/narayana/XAResourceWrapperImpl.java | XAResourceWrapperImpl.convertXid | private Xid convertXid(Xid xid) {
"""
Return wrapper for given xid.
@param xid xid
@return return wrapper
"""
if (xid instanceof XidWrapper)
return xid;
else
return new XidWrapperImpl(xid, pad, jndiName);
} | java | private Xid convertXid(Xid xid)
{
if (xid instanceof XidWrapper)
return xid;
else
return new XidWrapperImpl(xid, pad, jndiName);
} | [
"private",
"Xid",
"convertXid",
"(",
"Xid",
"xid",
")",
"{",
"if",
"(",
"xid",
"instanceof",
"XidWrapper",
")",
"return",
"xid",
";",
"else",
"return",
"new",
"XidWrapperImpl",
"(",
"xid",
",",
"pad",
",",
"jndiName",
")",
";",
"}"
] | Return wrapper for given xid.
@param xid xid
@return return wrapper | [
"Return",
"wrapper",
"for",
"given",
"xid",
"."
] | train | https://github.com/ironjacamar/ironjacamar/blob/f0389ee7e62aa8b40ba09b251edad76d220ea796/core/src/main/java/org/ironjacamar/core/tx/narayana/XAResourceWrapperImpl.java#L258-L264 |
ModeShape/modeshape | modeshape-jcr/src/main/java/org/modeshape/jcr/RepositoryQueryManager.java | RepositoryQueryManager.reindexContent | private void reindexContent( boolean includeSystemContent,
IndexWriter indexes ) {
"""
Crawl and index all of the repository content.
@param includeSystemContent true if the system content should also be indexed
@param indexes the index writer that should be use; may not be nul... | java | private void reindexContent( boolean includeSystemContent,
IndexWriter indexes ) {
if (indexes.canBeSkipped()) return;
// The node type schemata changes every time a node type is (un)registered, so get the snapshot that we'll use throughout
RepositoryCache repoCa... | [
"private",
"void",
"reindexContent",
"(",
"boolean",
"includeSystemContent",
",",
"IndexWriter",
"indexes",
")",
"{",
"if",
"(",
"indexes",
".",
"canBeSkipped",
"(",
")",
")",
"return",
";",
"// The node type schemata changes every time a node type is (un)registered, so get... | Crawl and index all of the repository content.
@param includeSystemContent true if the system content should also be indexed
@param indexes the index writer that should be use; may not be null | [
"Crawl",
"and",
"index",
"all",
"of",
"the",
"repository",
"content",
"."
] | train | https://github.com/ModeShape/modeshape/blob/794cfdabb67a90f24629c4fff0424a6125f8f95b/modeshape-jcr/src/main/java/org/modeshape/jcr/RepositoryQueryManager.java#L449-L484 |
beihaifeiwu/dolphin | dolphin-common/src/main/java/com/freetmp/common/util/BridgeMethodResolver.java | BridgeMethodResolver.isBridgeMethodFor | static boolean isBridgeMethodFor(Method bridgeMethod, Method candidateMethod, Class<?> declaringClass) {
"""
Determines whether or not the bridge {@link Method} is the bridge for the
supplied candidate {@link Method}.
"""
if (isResolvedTypeMatch(candidateMethod, bridgeMethod, declaringClass)) {
return tr... | java | static boolean isBridgeMethodFor(Method bridgeMethod, Method candidateMethod, Class<?> declaringClass) {
if (isResolvedTypeMatch(candidateMethod, bridgeMethod, declaringClass)) {
return true;
}
Method method = findGenericDeclaration(bridgeMethod);
return (method != null && isResolvedTypeMatch(method, candida... | [
"static",
"boolean",
"isBridgeMethodFor",
"(",
"Method",
"bridgeMethod",
",",
"Method",
"candidateMethod",
",",
"Class",
"<",
"?",
">",
"declaringClass",
")",
"{",
"if",
"(",
"isResolvedTypeMatch",
"(",
"candidateMethod",
",",
"bridgeMethod",
",",
"declaringClass",
... | Determines whether or not the bridge {@link Method} is the bridge for the
supplied candidate {@link Method}. | [
"Determines",
"whether",
"or",
"not",
"the",
"bridge",
"{"
] | train | https://github.com/beihaifeiwu/dolphin/blob/b100579cc6986dce5eba5593ebb5fbae7bad9d1a/dolphin-common/src/main/java/com/freetmp/common/util/BridgeMethodResolver.java#L127-L133 |
alkacon/opencms-core | src-gwt/org/opencms/ade/publish/client/CmsPublishGroupPanel.java | CmsPublishGroupPanel.fillButtonSlot | private static void fillButtonSlot(CmsListItemWidget listItemWidget, int index, Widget widget, int[] slotMapping) {
"""
Fills a slot for a button in a publish list item widget.<p>
@param listItemWidget the list item widget
@param index the slot index
@param widget the widget which should be displayed in the s... | java | private static void fillButtonSlot(CmsListItemWidget listItemWidget, int index, Widget widget, int[] slotMapping) {
int realIndex = slotMapping[index];
if (realIndex >= 0) {
SimplePanel panel = (SimplePanel)listItemWidget.getButton(slotMapping[index]);
panel.clear();
... | [
"private",
"static",
"void",
"fillButtonSlot",
"(",
"CmsListItemWidget",
"listItemWidget",
",",
"int",
"index",
",",
"Widget",
"widget",
",",
"int",
"[",
"]",
"slotMapping",
")",
"{",
"int",
"realIndex",
"=",
"slotMapping",
"[",
"index",
"]",
";",
"if",
"(",... | Fills a slot for a button in a publish list item widget.<p>
@param listItemWidget the list item widget
@param index the slot index
@param widget the widget which should be displayed in the slot
@param slotMapping array mapping logical slot ids to button indexes | [
"Fills",
"a",
"slot",
"for",
"a",
"button",
"in",
"a",
"publish",
"list",
"item",
"widget",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src-gwt/org/opencms/ade/publish/client/CmsPublishGroupPanel.java#L255-L263 |
unbescape/unbescape | src/main/java/org/unbescape/uri/UriEscape.java | UriEscape.unescapeUriPath | public static void unescapeUriPath(final String text, final Writer writer, final String encoding)
throws IOException {
"""
<p>
Perform am URI path <strong>unescape</strong> operation
on a <tt>String</tt> input, writing results to a <tt>Writer</tt>.
</p>
<p>
This method will unescape every percent-... | java | public static void unescapeUriPath(final String text, final Writer writer, final String encoding)
throws IOException {
if (writer == null) {
throw new IllegalArgumentException("Argument 'writer' cannot be null");
}
if (encoding == null) {
throw new IllegalAr... | [
"public",
"static",
"void",
"unescapeUriPath",
"(",
"final",
"String",
"text",
",",
"final",
"Writer",
"writer",
",",
"final",
"String",
"encoding",
")",
"throws",
"IOException",
"{",
"if",
"(",
"writer",
"==",
"null",
")",
"{",
"throw",
"new",
"IllegalArgum... | <p>
Perform am URI path <strong>unescape</strong> operation
on a <tt>String</tt> input, writing results to a <tt>Writer</tt>.
</p>
<p>
This method will unescape every percent-encoded (<tt>%HH</tt>) sequences present in input,
even for those characters that do not need to be percent-encoded in this context (unreserved c... | [
"<p",
">",
"Perform",
"am",
"URI",
"path",
"<strong",
">",
"unescape<",
"/",
"strong",
">",
"operation",
"on",
"a",
"<tt",
">",
"String<",
"/",
"tt",
">",
"input",
"writing",
"results",
"to",
"a",
"<tt",
">",
"Writer<",
"/",
"tt",
">",
".",
"<",
"/... | train | https://github.com/unbescape/unbescape/blob/ec5435fb3508c2eed25d8165dc27ded2602cae13/src/main/java/org/unbescape/uri/UriEscape.java#L1835-L1848 |
jamesdbloom/mockserver | mockserver-core/src/main/java/org/mockserver/model/HttpRequest.java | HttpRequest.withCookie | public HttpRequest withCookie(NottableString name, NottableString value) {
"""
Adds one cookie to match on or to not match on using the NottableString, each NottableString can either be a positive matching value,
such as string("match"), or a value to not match on, such as not("do not match"), the string values p... | java | public HttpRequest withCookie(NottableString name, NottableString value) {
this.cookies.withEntry(name, value);
return this;
} | [
"public",
"HttpRequest",
"withCookie",
"(",
"NottableString",
"name",
",",
"NottableString",
"value",
")",
"{",
"this",
".",
"cookies",
".",
"withEntry",
"(",
"name",
",",
"value",
")",
";",
"return",
"this",
";",
"}"
] | Adds one cookie to match on or to not match on using the NottableString, each NottableString can either be a positive matching value,
such as string("match"), or a value to not match on, such as not("do not match"), the string values passed to the NottableString
can be a plain string or a regex (for more details of the... | [
"Adds",
"one",
"cookie",
"to",
"match",
"on",
"or",
"to",
"not",
"match",
"on",
"using",
"the",
"NottableString",
"each",
"NottableString",
"can",
"either",
"be",
"a",
"positive",
"matching",
"value",
"such",
"as",
"string",
"(",
"match",
")",
"or",
"a",
... | train | https://github.com/jamesdbloom/mockserver/blob/8b84fdd877e57b4eb780c9f8c8b1d65bcb448025/mockserver-core/src/main/java/org/mockserver/model/HttpRequest.java#L536-L539 |
google/j2objc | jre_emul/android/platform/libcore/ojluni/src/main/java/java/lang/Math.java | Math.max | public static double max(double a, double b) {
"""
Returns the greater of two {@code double} values. That
is, the result is the argument closer to positive infinity. If
the arguments have the same value, the result is that same
value. If either value is NaN, then the result is NaN. Unlike
the numerical compa... | java | public static double max(double a, double b) {
if (a != a)
return a; // a is NaN
if ((a == 0.0d) &&
(b == 0.0d) &&
(Double.doubleToRawLongBits(a) == negativeZeroDoubleBits)) {
// Raw conversion ok since NaN can't map to -0.0.
return b;
... | [
"public",
"static",
"double",
"max",
"(",
"double",
"a",
",",
"double",
"b",
")",
"{",
"if",
"(",
"a",
"!=",
"a",
")",
"return",
"a",
";",
"// a is NaN",
"if",
"(",
"(",
"a",
"==",
"0.0d",
")",
"&&",
"(",
"b",
"==",
"0.0d",
")",
"&&",
"(",
"D... | Returns the greater of two {@code double} values. That
is, the result is the argument closer to positive infinity. If
the arguments have the same value, the result is that same
value. If either value is NaN, then the result is NaN. Unlike
the numerical comparison operators, this method considers
negative zero to be s... | [
"Returns",
"the",
"greater",
"of",
"two",
"{",
"@code",
"double",
"}",
"values",
".",
"That",
"is",
"the",
"result",
"is",
"the",
"argument",
"closer",
"to",
"positive",
"infinity",
".",
"If",
"the",
"arguments",
"have",
"the",
"same",
"value",
"the",
"r... | train | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/libcore/ojluni/src/main/java/java/lang/Math.java#L1324-L1334 |
elki-project/elki | elki/src/main/java/de/lmu/ifi/dbs/elki/algorithm/projection/PerplexityAffinityMatrixBuilder.java | PerplexityAffinityMatrixBuilder.estimateInitialBeta | protected static double estimateInitialBeta(double[] dist_i, double perplexity) {
"""
Estimate beta from the distances in a row.
This lacks a mathematical argument, but is a handcrafted heuristic to avoid
numerical problems. The average distance is usually too large, so we scale
the average distance by 2*N/pe... | java | protected static double estimateInitialBeta(double[] dist_i, double perplexity) {
double sum = 0.;
for(double d : dist_i) {
double d2 = d * d;
sum += d2 < Double.POSITIVE_INFINITY ? d2 : 0.;
}
return sum > 0 && sum < Double.POSITIVE_INFINITY ? .5 / sum * perplexity * (dist_i.length - 1.) : 1... | [
"protected",
"static",
"double",
"estimateInitialBeta",
"(",
"double",
"[",
"]",
"dist_i",
",",
"double",
"perplexity",
")",
"{",
"double",
"sum",
"=",
"0.",
";",
"for",
"(",
"double",
"d",
":",
"dist_i",
")",
"{",
"double",
"d2",
"=",
"d",
"*",
"d",
... | Estimate beta from the distances in a row.
This lacks a mathematical argument, but is a handcrafted heuristic to avoid
numerical problems. The average distance is usually too large, so we scale
the average distance by 2*N/perplexity. Then estimate beta as 1/x.
@param dist_i Distances
@param perplexity Desired perplex... | [
"Estimate",
"beta",
"from",
"the",
"distances",
"in",
"a",
"row",
"."
] | train | https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki/src/main/java/de/lmu/ifi/dbs/elki/algorithm/projection/PerplexityAffinityMatrixBuilder.java#L206-L213 |
spring-cloud/spring-cloud-stream-app-starters | app-starters-common/app-starters-file-common/src/main/java/org/springframework/cloud/stream/app/file/FileUtils.java | FileUtils.enhanceFlowForReadingMode | public static IntegrationFlowBuilder enhanceFlowForReadingMode(IntegrationFlowBuilder flowBuilder,
FileConsumerProperties fileConsumerProperties) {
"""
Enhance an {@link IntegrationFlowBuilder} to add flow snippets, depending on
{@link FileConsumerProperties}.
@param flowBuilder the flow builder.
@param file... | java | public static IntegrationFlowBuilder enhanceFlowForReadingMode(IntegrationFlowBuilder flowBuilder,
FileConsumerProperties fileConsumerProperties) {
switch (fileConsumerProperties.getMode()) {
case contents:
flowBuilder.enrichHeaders(Collections.<String, Object>singletonMap(MessageHeaders.CONTENT_TYPE,
"a... | [
"public",
"static",
"IntegrationFlowBuilder",
"enhanceFlowForReadingMode",
"(",
"IntegrationFlowBuilder",
"flowBuilder",
",",
"FileConsumerProperties",
"fileConsumerProperties",
")",
"{",
"switch",
"(",
"fileConsumerProperties",
".",
"getMode",
"(",
")",
")",
"{",
"case",
... | Enhance an {@link IntegrationFlowBuilder} to add flow snippets, depending on
{@link FileConsumerProperties}.
@param flowBuilder the flow builder.
@param fileConsumerProperties the properties.
@return the updated flow builder. | [
"Enhance",
"an",
"{"
] | train | https://github.com/spring-cloud/spring-cloud-stream-app-starters/blob/c82827a9b5a6eab78fe6a2d56a946b5f9fb0ead9/app-starters-common/app-starters-file-common/src/main/java/org/springframework/cloud/stream/app/file/FileUtils.java#L40-L63 |
phax/ph-commons | ph-commons/src/main/java/com/helger/commons/collection/ArrayHelper.java | ArrayHelper.getAllExceptFirst | @Nullable
@ReturnsMutableCopy
@SafeVarargs
public static <ELEMENTTYPE> ELEMENTTYPE [] getAllExceptFirst (@Nullable final ELEMENTTYPE... aArray) {
"""
Get an array that contains all elements, except for the first element.
@param <ELEMENTTYPE>
Array element type
@param aArray
The source array. May be <co... | java | @Nullable
@ReturnsMutableCopy
@SafeVarargs
public static <ELEMENTTYPE> ELEMENTTYPE [] getAllExceptFirst (@Nullable final ELEMENTTYPE... aArray)
{
return getAllExceptFirst (aArray, 1);
} | [
"@",
"Nullable",
"@",
"ReturnsMutableCopy",
"@",
"SafeVarargs",
"public",
"static",
"<",
"ELEMENTTYPE",
">",
"ELEMENTTYPE",
"[",
"]",
"getAllExceptFirst",
"(",
"@",
"Nullable",
"final",
"ELEMENTTYPE",
"...",
"aArray",
")",
"{",
"return",
"getAllExceptFirst",
"(",
... | Get an array that contains all elements, except for the first element.
@param <ELEMENTTYPE>
Array element type
@param aArray
The source array. May be <code>null</code>.
@return <code>null</code> if the passed array is <code>null</code> or has
less than one element. A non-<code>null</code> copy of the array
without the... | [
"Get",
"an",
"array",
"that",
"contains",
"all",
"elements",
"except",
"for",
"the",
"first",
"element",
"."
] | train | https://github.com/phax/ph-commons/blob/d28c03565f44a0b804d96028d0969f9bb38c4313/ph-commons/src/main/java/com/helger/commons/collection/ArrayHelper.java#L2737-L2743 |
hazelcast/hazelcast | hazelcast/src/main/java/com/hazelcast/cp/internal/raft/impl/RaftNodeImpl.java | RaftNodeImpl.invalidateFuturesUntil | private void invalidateFuturesUntil(long entryIndex, Object response) {
"""
Invalidates futures registered with indexes {@code <= entryIndex}. Note that {@code entryIndex} is inclusive.
{@link StaleAppendRequestException} is set a result to futures.
"""
int count = 0;
Iterator<Entry<Long, Simp... | java | private void invalidateFuturesUntil(long entryIndex, Object response) {
int count = 0;
Iterator<Entry<Long, SimpleCompletableFuture>> iterator = futures.entrySet().iterator();
while (iterator.hasNext()) {
Entry<Long, SimpleCompletableFuture> entry = iterator.next();
long ... | [
"private",
"void",
"invalidateFuturesUntil",
"(",
"long",
"entryIndex",
",",
"Object",
"response",
")",
"{",
"int",
"count",
"=",
"0",
";",
"Iterator",
"<",
"Entry",
"<",
"Long",
",",
"SimpleCompletableFuture",
">",
">",
"iterator",
"=",
"futures",
".",
"ent... | Invalidates futures registered with indexes {@code <= entryIndex}. Note that {@code entryIndex} is inclusive.
{@link StaleAppendRequestException} is set a result to futures. | [
"Invalidates",
"futures",
"registered",
"with",
"indexes",
"{"
] | train | https://github.com/hazelcast/hazelcast/blob/8c4bc10515dbbfb41a33e0302c0caedf3cda1baf/hazelcast/src/main/java/com/hazelcast/cp/internal/raft/impl/RaftNodeImpl.java#L707-L723 |
wmdietl/jsr308-langtools | src/share/classes/com/sun/tools/javac/util/Log.java | Log.printVerbose | public void printVerbose(String key, Object... args) {
"""
Print the localized text of a "verbose" message to the
noticeWriter stream.
"""
printRawLines(noticeWriter, localize("verbose." + key, args));
} | java | public void printVerbose(String key, Object... args) {
printRawLines(noticeWriter, localize("verbose." + key, args));
} | [
"public",
"void",
"printVerbose",
"(",
"String",
"key",
",",
"Object",
"...",
"args",
")",
"{",
"printRawLines",
"(",
"noticeWriter",
",",
"localize",
"(",
"\"verbose.\"",
"+",
"key",
",",
"args",
")",
")",
";",
"}"
] | Print the localized text of a "verbose" message to the
noticeWriter stream. | [
"Print",
"the",
"localized",
"text",
"of",
"a",
"verbose",
"message",
"to",
"the",
"noticeWriter",
"stream",
"."
] | train | https://github.com/wmdietl/jsr308-langtools/blob/8812d28c20f4de070a0dd6de1b45602431379834/src/share/classes/com/sun/tools/javac/util/Log.java#L538-L540 |
inkstand-io/scribble | scribble-inject/src/main/java/io/inkstand/scribble/inject/Injection.java | Injection.isNullOrMatchingType | private boolean isNullOrMatchingType(final Object injectedValue, final Field field) {
"""
Checks if the specified value is either null or compatible with the field. Compatibility is verified based
on inheritance or primitive-type compatibility.
@param injectedValue
the value that is checked against the field
@... | java | private boolean isNullOrMatchingType(final Object injectedValue, final Field field) {
if (injectedValue == null) {
// null is always type-compatible
return true;
}
final Class<?> fieldType = field.getType();
final Class<?> valueType = injectedValue.getClass();
... | [
"private",
"boolean",
"isNullOrMatchingType",
"(",
"final",
"Object",
"injectedValue",
",",
"final",
"Field",
"field",
")",
"{",
"if",
"(",
"injectedValue",
"==",
"null",
")",
"{",
"// null is always type-compatible",
"return",
"true",
";",
"}",
"final",
"Class",
... | Checks if the specified value is either null or compatible with the field. Compatibility is verified based
on inheritance or primitive-type compatibility.
@param injectedValue
the value that is checked against the field
@param field
the field that should be compatible with the value
@return
<code>true</code> if the val... | [
"Checks",
"if",
"the",
"specified",
"value",
"is",
"either",
"null",
"or",
"compatible",
"with",
"the",
"field",
".",
"Compatibility",
"is",
"verified",
"based",
"on",
"inheritance",
"or",
"primitive",
"-",
"type",
"compatibility",
"."
] | train | https://github.com/inkstand-io/scribble/blob/66e67553bad4b1ff817e1715fd1d3dd833406744/scribble-inject/src/main/java/io/inkstand/scribble/inject/Injection.java#L257-L271 |
Samsung/GearVRf | GVRf/Framework/framework/src/main/java/org/gearvrf/GVRPreference.java | GVRPreference.getFloatProperty | public Float getFloatProperty(String key, Float defaultValue) {
"""
Gets a boolean property with a boolean value.
@param key The key string.
@param defaultValue The default value.
@return The boolean property value.
"""
String val = getProperty(key, defaultValue.toString());
try {
... | java | public Float getFloatProperty(String key, Float defaultValue) {
String val = getProperty(key, defaultValue.toString());
try {
Float intVal = Float.parseFloat(val);
return intVal;
} catch (NumberFormatException e) {
return defaultValue;
}
} | [
"public",
"Float",
"getFloatProperty",
"(",
"String",
"key",
",",
"Float",
"defaultValue",
")",
"{",
"String",
"val",
"=",
"getProperty",
"(",
"key",
",",
"defaultValue",
".",
"toString",
"(",
")",
")",
";",
"try",
"{",
"Float",
"intVal",
"=",
"Float",
"... | Gets a boolean property with a boolean value.
@param key The key string.
@param defaultValue The default value.
@return The boolean property value. | [
"Gets",
"a",
"boolean",
"property",
"with",
"a",
"boolean",
"value",
"."
] | train | https://github.com/Samsung/GearVRf/blob/05034d465a7b0a494fabb9e9f2971ac19392f32d/GVRf/Framework/framework/src/main/java/org/gearvrf/GVRPreference.java#L89-L97 |
netscaler/nitro | src/main/java/com/citrix/netscaler/nitro/resource/stat/system/systemmemory_stats.java | systemmemory_stats.get_nitro_response | protected base_resource[] get_nitro_response(nitro_service service, String response) throws Exception {
"""
<pre>
converts nitro response into object and returns the object array in case of get request.
</pre>
"""
systemmemory_stats[] resources = new systemmemory_stats[1];
systemmemory_response result = ... | java | protected base_resource[] get_nitro_response(nitro_service service, String response) throws Exception {
systemmemory_stats[] resources = new systemmemory_stats[1];
systemmemory_response result = (systemmemory_response) service.get_payload_formatter().string_to_resource(systemmemory_response.class, response);
if(r... | [
"protected",
"base_resource",
"[",
"]",
"get_nitro_response",
"(",
"nitro_service",
"service",
",",
"String",
"response",
")",
"throws",
"Exception",
"{",
"systemmemory_stats",
"[",
"]",
"resources",
"=",
"new",
"systemmemory_stats",
"[",
"1",
"]",
";",
"systemmem... | <pre>
converts nitro response into object and returns the object array in case of get request.
</pre> | [
"<pre",
">",
"converts",
"nitro",
"response",
"into",
"object",
"and",
"returns",
"the",
"object",
"array",
"in",
"case",
"of",
"get",
"request",
".",
"<",
"/",
"pre",
">"
] | train | https://github.com/netscaler/nitro/blob/2a98692dcf4e4ec430c7d7baab8382e4ba5a35e4/src/main/java/com/citrix/netscaler/nitro/resource/stat/system/systemmemory_stats.java#L160-L179 |
sdl/Testy | src/main/java/com/sdl/selenium/web/XPathBuilder.java | XPathBuilder.setTitle | @SuppressWarnings("unchecked")
public <T extends XPathBuilder> T setTitle(final String title, final SearchType... searchTypes) {
"""
<p><b>Used for finding element process (to generate xpath address)</b></p>
<p><b>Title only applies to Panel, and if you set the item "setTemplate("title", "@title='%s'")" a tem... | java | @SuppressWarnings("unchecked")
public <T extends XPathBuilder> T setTitle(final String title, final SearchType... searchTypes) {
this.title = title;
if (searchTypes != null && searchTypes.length > 0) {
setSearchTitleType(searchTypes);
} else {
this.searchTitleType.add... | [
"@",
"SuppressWarnings",
"(",
"\"unchecked\"",
")",
"public",
"<",
"T",
"extends",
"XPathBuilder",
">",
"T",
"setTitle",
"(",
"final",
"String",
"title",
",",
"final",
"SearchType",
"...",
"searchTypes",
")",
"{",
"this",
".",
"title",
"=",
"title",
";",
"... | <p><b>Used for finding element process (to generate xpath address)</b></p>
<p><b>Title only applies to Panel, and if you set the item "setTemplate("title", "@title='%s'")" a template.</b></p>
@param title of element
@param searchTypes see {@link SearchType}
@param <T> the element which calls this method
... | [
"<p",
">",
"<b",
">",
"Used",
"for",
"finding",
"element",
"process",
"(",
"to",
"generate",
"xpath",
"address",
")",
"<",
"/",
"b",
">",
"<",
"/",
"p",
">",
"<p",
">",
"<b",
">",
"Title",
"only",
"applies",
"to",
"Panel",
"and",
"if",
"you",
"se... | train | https://github.com/sdl/Testy/blob/b3ae061554016f926f04694a39ff00dab7576609/src/main/java/com/sdl/selenium/web/XPathBuilder.java#L357-L366 |
aoindustries/aocode-public | src/main/java/com/aoindustries/util/StringUtility.java | StringUtility.firstLineOnly | public static String firstLineOnly(String value, int maxCharacters) {
"""
Returns the first line only, and only up to the maximum number of characters. If the
value is modified, will append a horizontal ellipsis (Unicode 0x2026).
"""
if(value==null) return value;
int pos = value.indexOf(lineSeparator);
... | java | public static String firstLineOnly(String value, int maxCharacters) {
if(value==null) return value;
int pos = value.indexOf(lineSeparator);
if(pos==-1) pos = value.length();
if(pos>maxCharacters) pos = maxCharacters;
return pos==value.length() ? value : (value.substring(0, pos) + '\u2026');
} | [
"public",
"static",
"String",
"firstLineOnly",
"(",
"String",
"value",
",",
"int",
"maxCharacters",
")",
"{",
"if",
"(",
"value",
"==",
"null",
")",
"return",
"value",
";",
"int",
"pos",
"=",
"value",
".",
"indexOf",
"(",
"lineSeparator",
")",
";",
"if",... | Returns the first line only, and only up to the maximum number of characters. If the
value is modified, will append a horizontal ellipsis (Unicode 0x2026). | [
"Returns",
"the",
"first",
"line",
"only",
"and",
"only",
"up",
"to",
"the",
"maximum",
"number",
"of",
"characters",
".",
"If",
"the",
"value",
"is",
"modified",
"will",
"append",
"a",
"horizontal",
"ellipsis",
"(",
"Unicode",
"0x2026",
")",
"."
] | train | https://github.com/aoindustries/aocode-public/blob/c7bc1d08aee1d02dfaeeb1421fad21aca1aad4c3/src/main/java/com/aoindustries/util/StringUtility.java#L1417-L1423 |
xmlunit/xmlunit | xmlunit-core/src/main/java/org/xmlunit/diff/XPathContext.java | XPathContext.add1OrIncrement | private static int add1OrIncrement(String name, Map<String, Integer> map) {
"""
Increments the value name maps to or adds 1 as value if name
isn't present inside the map.
@return the new mapping for name
"""
Integer old = map.get(name);
int index = old == null ? 1 : old.intValue() + 1;
... | java | private static int add1OrIncrement(String name, Map<String, Integer> map) {
Integer old = map.get(name);
int index = old == null ? 1 : old.intValue() + 1;
map.put(name, Integer.valueOf(index));
return index;
} | [
"private",
"static",
"int",
"add1OrIncrement",
"(",
"String",
"name",
",",
"Map",
"<",
"String",
",",
"Integer",
">",
"map",
")",
"{",
"Integer",
"old",
"=",
"map",
".",
"get",
"(",
"name",
")",
";",
"int",
"index",
"=",
"old",
"==",
"null",
"?",
"... | Increments the value name maps to or adds 1 as value if name
isn't present inside the map.
@return the new mapping for name | [
"Increments",
"the",
"value",
"name",
"maps",
"to",
"or",
"adds",
"1",
"as",
"value",
"if",
"name",
"isn",
"t",
"present",
"inside",
"the",
"map",
"."
] | train | https://github.com/xmlunit/xmlunit/blob/fe3d701d43f57ee83dcba336e4c1555619d3084b/xmlunit-core/src/main/java/org/xmlunit/diff/XPathContext.java#L260-L265 |
Impetus/Kundera | src/kundera-cassandra/cassandra-core/src/main/java/com/impetus/client/cassandra/schemamanager/CassandraSchemaManager.java | CassandraSchemaManager.onSetComparatorType | private void onSetComparatorType(CfDef cfDef, Properties cfProperties, StringBuilder builder) {
"""
On set comparator type.
@param cfDef
the cf def
@param cfProperties
the cf properties
@param builder
the builder
"""
String comparatorType = cfProperties.getProperty(CassandraConstants.COMPARATOR... | java | private void onSetComparatorType(CfDef cfDef, Properties cfProperties, StringBuilder builder)
{
String comparatorType = cfProperties.getProperty(CassandraConstants.COMPARATOR_TYPE);
if (comparatorType != null)
{
if (builder != null)
{
// TODO:::nothing... | [
"private",
"void",
"onSetComparatorType",
"(",
"CfDef",
"cfDef",
",",
"Properties",
"cfProperties",
",",
"StringBuilder",
"builder",
")",
"{",
"String",
"comparatorType",
"=",
"cfProperties",
".",
"getProperty",
"(",
"CassandraConstants",
".",
"COMPARATOR_TYPE",
")",
... | On set comparator type.
@param cfDef
the cf def
@param cfProperties
the cf properties
@param builder
the builder | [
"On",
"set",
"comparator",
"type",
"."
] | train | https://github.com/Impetus/Kundera/blob/268958ab1ec09d14ec4d9184f0c8ded7a9158908/src/kundera-cassandra/cassandra-core/src/main/java/com/impetus/client/cassandra/schemamanager/CassandraSchemaManager.java#L2713-L2727 |
igniterealtime/Smack | smack-legacy/src/main/java/org/jivesoftware/smackx/xevent/MessageEventManager.java | MessageEventManager.sendCancelledNotification | public void sendCancelledNotification(Jid to, String packetID) throws NotConnectedException, InterruptedException {
"""
Sends the notification that the receiver of the message has cancelled composing a reply.
@param to the recipient of the notification.
@param packetID the id of the message to send.
@throws N... | java | public void sendCancelledNotification(Jid to, String packetID) throws NotConnectedException, InterruptedException {
// Create the message to send
Message msg = new Message(to);
// Create a MessageEvent Package and add it to the message
MessageEvent messageEvent = new MessageEvent();
... | [
"public",
"void",
"sendCancelledNotification",
"(",
"Jid",
"to",
",",
"String",
"packetID",
")",
"throws",
"NotConnectedException",
",",
"InterruptedException",
"{",
"// Create the message to send",
"Message",
"msg",
"=",
"new",
"Message",
"(",
"to",
")",
";",
"// C... | Sends the notification that the receiver of the message has cancelled composing a reply.
@param to the recipient of the notification.
@param packetID the id of the message to send.
@throws NotConnectedException
@throws InterruptedException | [
"Sends",
"the",
"notification",
"that",
"the",
"receiver",
"of",
"the",
"message",
"has",
"cancelled",
"composing",
"a",
"reply",
"."
] | train | https://github.com/igniterealtime/Smack/blob/870756997faec1e1bfabfac0cd6c2395b04da873/smack-legacy/src/main/java/org/jivesoftware/smackx/xevent/MessageEventManager.java#L275-L285 |
andkulikov/Transitions-Everywhere | library(1.x)/src/main/java/com/transitionseverywhere/TransitionManager.java | TransitionManager.changeScene | private static void changeScene(@NonNull Scene scene, @Nullable Transition transition) {
"""
This is where all of the work of a transition/scene-change is
orchestrated. This method captures the start values for the given
transition, exits the current Scene, enters the new scene, captures
the end values for the ... | java | private static void changeScene(@NonNull Scene scene, @Nullable Transition transition) {
final ViewGroup sceneRoot = scene.getSceneRoot();
if (!sPendingTransitions.contains(sceneRoot)) {
Transition transitionClone = null;
if (isTransitionsAllowed()) {
sPendingTra... | [
"private",
"static",
"void",
"changeScene",
"(",
"@",
"NonNull",
"Scene",
"scene",
",",
"@",
"Nullable",
"Transition",
"transition",
")",
"{",
"final",
"ViewGroup",
"sceneRoot",
"=",
"scene",
".",
"getSceneRoot",
"(",
")",
";",
"if",
"(",
"!",
"sPendingTrans... | This is where all of the work of a transition/scene-change is
orchestrated. This method captures the start values for the given
transition, exits the current Scene, enters the new scene, captures
the end values for the transition, and finally plays the
resulting values-populated transition.
@param scene The scene... | [
"This",
"is",
"where",
"all",
"of",
"the",
"work",
"of",
"a",
"transition",
"/",
"scene",
"-",
"change",
"is",
"orchestrated",
".",
"This",
"method",
"captures",
"the",
"start",
"values",
"for",
"the",
"given",
"transition",
"exits",
"the",
"current",
"Sce... | train | https://github.com/andkulikov/Transitions-Everywhere/blob/828efe5f152a2f05e2bfeee6254b74ad2269d4f1/library(1.x)/src/main/java/com/transitionseverywhere/TransitionManager.java#L185-L211 |
hyperledger/fabric-sdk-java | src/main/java/org/hyperledger/fabric/sdk/Channel.java | Channel.queryBlockByNumber | public BlockInfo queryBlockByNumber(Collection<Peer> peers, long blockNumber, User userContext) throws InvalidArgumentException, ProposalException {
"""
query a peer in this channel for a Block by the blockNumber
@param peers the peers to try and send the request to
@param blockNumber index of the Block ... | java | public BlockInfo queryBlockByNumber(Collection<Peer> peers, long blockNumber, User userContext) throws InvalidArgumentException, ProposalException {
checkChannelState();
checkPeers(peers);
userContextCheck(userContext);
try {
logger.debug("queryBlockByNumber with blockNumbe... | [
"public",
"BlockInfo",
"queryBlockByNumber",
"(",
"Collection",
"<",
"Peer",
">",
"peers",
",",
"long",
"blockNumber",
",",
"User",
"userContext",
")",
"throws",
"InvalidArgumentException",
",",
"ProposalException",
"{",
"checkChannelState",
"(",
")",
";",
"checkPee... | query a peer in this channel for a Block by the blockNumber
@param peers the peers to try and send the request to
@param blockNumber index of the Block in the chain
@param userContext the user context to use.
@return the {@link BlockInfo} with the given blockNumber
@throws InvalidArgumentException
@throws Propos... | [
"query",
"a",
"peer",
"in",
"this",
"channel",
"for",
"a",
"Block",
"by",
"the",
"blockNumber"
] | train | https://github.com/hyperledger/fabric-sdk-java/blob/4a2d7b3408b8b0a1ed812aa36942c438159c37a0/src/main/java/org/hyperledger/fabric/sdk/Channel.java#L2927-L2946 |
lets-blade/blade-jdbc | blade-jdbc-core/src/main/java/com/blade/jdbc/core/SqlBuilder.java | SqlBuilder.buildFindAllSql | @SafeVarargs
static QueryMeta buildFindAllSql(ActiveRecord activeRecord, Supplier<ConditionEnum>... conditions) {
"""
构造一个查询列表SQL
@param activeRecord ActiveRecord对象
@param conditions 条件
@return 返回QueryMeta对象
"""
QueryMeta queryMeta = new QueryMeta();
String initSql = parseFi... | java | @SafeVarargs
static QueryMeta buildFindAllSql(ActiveRecord activeRecord, Supplier<ConditionEnum>... conditions) {
QueryMeta queryMeta = new QueryMeta();
String initSql = parseFieldsSql(activeRecord.getTableName(), conditions);
StringBuilder sqlBuf = new StringBuilder(initSql);
... | [
"@",
"SafeVarargs",
"static",
"QueryMeta",
"buildFindAllSql",
"(",
"ActiveRecord",
"activeRecord",
",",
"Supplier",
"<",
"ConditionEnum",
">",
"...",
"conditions",
")",
"{",
"QueryMeta",
"queryMeta",
"=",
"new",
"QueryMeta",
"(",
")",
";",
"String",
"initSql",
"... | 构造一个查询列表SQL
@param activeRecord ActiveRecord对象
@param conditions 条件
@return 返回QueryMeta对象 | [
"构造一个查询列表SQL"
] | train | https://github.com/lets-blade/blade-jdbc/blob/f9348b6da2eaae5d953bc3cdb49f8fea1cc8b75c/blade-jdbc-core/src/main/java/com/blade/jdbc/core/SqlBuilder.java#L142-L175 |
b3log/latke | latke-core/src/main/java/org/json/JSONObject.java | JSONObject.optString | public String optString(String key, String defaultValue) {
"""
Get an optional string associated with a key. It returns the defaultValue
if there is no such key.
@param key
A key string.
@param defaultValue
The default.
@return A string which is the value.
"""
Object object = this.opt(key);
... | java | public String optString(String key, String defaultValue) {
Object object = this.opt(key);
return NULL.equals(object) ? defaultValue : object.toString();
} | [
"public",
"String",
"optString",
"(",
"String",
"key",
",",
"String",
"defaultValue",
")",
"{",
"Object",
"object",
"=",
"this",
".",
"opt",
"(",
"key",
")",
";",
"return",
"NULL",
".",
"equals",
"(",
"object",
")",
"?",
"defaultValue",
":",
"object",
... | Get an optional string associated with a key. It returns the defaultValue
if there is no such key.
@param key
A key string.
@param defaultValue
The default.
@return A string which is the value. | [
"Get",
"an",
"optional",
"string",
"associated",
"with",
"a",
"key",
".",
"It",
"returns",
"the",
"defaultValue",
"if",
"there",
"is",
"no",
"such",
"key",
"."
] | train | https://github.com/b3log/latke/blob/f7e08a47eeecea5f7c94006382c24f353585de33/latke-core/src/main/java/org/json/JSONObject.java#L1437-L1440 |
igniterealtime/Smack | smack-legacy/src/main/java/org/jivesoftware/smackx/workgroup/agent/AgentSession.java | AgentSession.getGenericSettings | public GenericSettings getGenericSettings(XMPPConnection con, String query) throws NoResponseException, XMPPErrorException, NotConnectedException, InterruptedException {
"""
Returns the generic metadata of the workgroup the agent belongs to.
@param con the XMPPConnection to use.
@param query an optional quer... | java | public GenericSettings getGenericSettings(XMPPConnection con, String query) throws NoResponseException, XMPPErrorException, NotConnectedException, InterruptedException {
GenericSettings setting = new GenericSettings();
setting.setType(IQ.Type.get);
setting.setTo(workgroupJID);
GenericSe... | [
"public",
"GenericSettings",
"getGenericSettings",
"(",
"XMPPConnection",
"con",
",",
"String",
"query",
")",
"throws",
"NoResponseException",
",",
"XMPPErrorException",
",",
"NotConnectedException",
",",
"InterruptedException",
"{",
"GenericSettings",
"setting",
"=",
"ne... | Returns the generic metadata of the workgroup the agent belongs to.
@param con the XMPPConnection to use.
@param query an optional query object used to tell the server what metadata to retrieve. This can be null.
@return the settings for the workgroup.
@throws XMPPErrorException if an error occurs while sending the ... | [
"Returns",
"the",
"generic",
"metadata",
"of",
"the",
"workgroup",
"the",
"agent",
"belongs",
"to",
"."
] | train | https://github.com/igniterealtime/Smack/blob/870756997faec1e1bfabfac0cd6c2395b04da873/smack-legacy/src/main/java/org/jivesoftware/smackx/workgroup/agent/AgentSession.java#L1078-L1086 |
hazelcast/hazelcast | hazelcast/src/main/java/com/hazelcast/map/impl/MapKeyLoader.java | MapKeyLoader.startLoading | public Future<?> startLoading(MapStoreContext mapStoreContext, boolean replaceExistingValues) {
"""
Triggers key and value loading if there is no ongoing or completed
key loading task, otherwise does nothing.
The actual loading is done on a separate thread.
@param mapStoreContext the map store context f... | java | public Future<?> startLoading(MapStoreContext mapStoreContext, boolean replaceExistingValues) {
role.nextOrStay(Role.SENDER);
if (state.is(State.LOADING)) {
return keyLoadFinished;
}
state.next(State.LOADING);
return sendKeys(mapStoreContext, replaceExistingValues);... | [
"public",
"Future",
"<",
"?",
">",
"startLoading",
"(",
"MapStoreContext",
"mapStoreContext",
",",
"boolean",
"replaceExistingValues",
")",
"{",
"role",
".",
"nextOrStay",
"(",
"Role",
".",
"SENDER",
")",
";",
"if",
"(",
"state",
".",
"is",
"(",
"State",
"... | Triggers key and value loading if there is no ongoing or completed
key loading task, otherwise does nothing.
The actual loading is done on a separate thread.
@param mapStoreContext the map store context for this map
@param replaceExistingValues if the existing entries for the loaded keys should be replaced
@retu... | [
"Triggers",
"key",
"and",
"value",
"loading",
"if",
"there",
"is",
"no",
"ongoing",
"or",
"completed",
"key",
"loading",
"task",
"otherwise",
"does",
"nothing",
".",
"The",
"actual",
"loading",
"is",
"done",
"on",
"a",
"separate",
"thread",
"."
] | train | https://github.com/hazelcast/hazelcast/blob/8c4bc10515dbbfb41a33e0302c0caedf3cda1baf/hazelcast/src/main/java/com/hazelcast/map/impl/MapKeyLoader.java#L325-L334 |
OpenLiberty/open-liberty | dev/com.ibm.ws.messaging.runtime/src/com/ibm/ws/sib/processor/proxyhandler/BusGroup.java | BusGroup.generateResetSubscriptionMessage | protected SubscriptionMessage generateResetSubscriptionMessage() {
"""
Generates the reset subscription message that should be sent to a
member, or members of this Bus.
@return a new ResetSubscriptionMessage
"""
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.entry(tc, "gen... | java | protected SubscriptionMessage generateResetSubscriptionMessage()
{
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.entry(tc, "generateResetSubscriptionMessage");
// Get the Message Handler for doing this operation.
final SubscriptionMessageHandler messageHandler =
i... | [
"protected",
"SubscriptionMessage",
"generateResetSubscriptionMessage",
"(",
")",
"{",
"if",
"(",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
"&&",
"tc",
".",
"isEntryEnabled",
"(",
")",
")",
"SibTr",
".",
"entry",
"(",
"tc",
",",
"\"generateResetSubsc... | Generates the reset subscription message that should be sent to a
member, or members of this Bus.
@return a new ResetSubscriptionMessage | [
"Generates",
"the",
"reset",
"subscription",
"message",
"that",
"should",
"be",
"sent",
"to",
"a",
"member",
"or",
"members",
"of",
"this",
"Bus",
"."
] | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.messaging.runtime/src/com/ibm/ws/sib/processor/proxyhandler/BusGroup.java#L770-L797 |
spring-projects/spring-boot | spring-boot-project/spring-boot-tools/spring-boot-loader-tools/src/main/java/org/springframework/boot/loader/tools/JarWriter.java | JarWriter.writeLoaderClasses | @Override
public void writeLoaderClasses(String loaderJarResourceName) throws IOException {
"""
Write the required spring-boot-loader classes to the JAR.
@param loaderJarResourceName the name of the resource containing the loader classes
to be written
@throws IOException if the classes cannot be written
""... | java | @Override
public void writeLoaderClasses(String loaderJarResourceName) throws IOException {
URL loaderJar = getClass().getClassLoader().getResource(loaderJarResourceName);
try (JarInputStream inputStream = new JarInputStream(
new BufferedInputStream(loaderJar.openStream()))) {
JarEntry entry;
while ((ent... | [
"@",
"Override",
"public",
"void",
"writeLoaderClasses",
"(",
"String",
"loaderJarResourceName",
")",
"throws",
"IOException",
"{",
"URL",
"loaderJar",
"=",
"getClass",
"(",
")",
".",
"getClassLoader",
"(",
")",
".",
"getResource",
"(",
"loaderJarResourceName",
")... | Write the required spring-boot-loader classes to the JAR.
@param loaderJarResourceName the name of the resource containing the loader classes
to be written
@throws IOException if the classes cannot be written | [
"Write",
"the",
"required",
"spring",
"-",
"boot",
"-",
"loader",
"classes",
"to",
"the",
"JAR",
"."
] | train | https://github.com/spring-projects/spring-boot/blob/0b27f7c70e164b2b1a96477f1d9c1acba56790c1/spring-boot-project/spring-boot-tools/spring-boot-loader-tools/src/main/java/org/springframework/boot/loader/tools/JarWriter.java#L222-L235 |
SeleniumHQ/selenium | java/client/src/org/openqa/selenium/support/pagefactory/AjaxElementLocator.java | AjaxElementLocator.findElement | @Override
public WebElement findElement() {
"""
{@inheritDoc}
Will poll the interface on a regular basis until the element is present.
"""
SlowLoadingElement loadingElement = new SlowLoadingElement(clock, timeOutInSeconds);
try {
return loadingElement.get().getElement();
} catch (NoSuchE... | java | @Override
public WebElement findElement() {
SlowLoadingElement loadingElement = new SlowLoadingElement(clock, timeOutInSeconds);
try {
return loadingElement.get().getElement();
} catch (NoSuchElementError e) {
throw new NoSuchElementException(
String.format("Timed out after %d second... | [
"@",
"Override",
"public",
"WebElement",
"findElement",
"(",
")",
"{",
"SlowLoadingElement",
"loadingElement",
"=",
"new",
"SlowLoadingElement",
"(",
"clock",
",",
"timeOutInSeconds",
")",
";",
"try",
"{",
"return",
"loadingElement",
".",
"get",
"(",
")",
".",
... | {@inheritDoc}
Will poll the interface on a regular basis until the element is present. | [
"{",
"@inheritDoc",
"}"
] | train | https://github.com/SeleniumHQ/selenium/blob/7af172729f17b20269c8ca4ea6f788db48616535/java/client/src/org/openqa/selenium/support/pagefactory/AjaxElementLocator.java#L91-L101 |
zxing/zxing | core/src/main/java/com/google/zxing/oned/EAN13Reader.java | EAN13Reader.determineFirstDigit | private static void determineFirstDigit(StringBuilder resultString, int lgPatternFound)
throws NotFoundException {
"""
Based on pattern of odd-even ('L' and 'G') patterns used to encoded the explicitly-encoded
digits in a barcode, determines the implicitly encoded first digit and adds it to the
result stri... | java | private static void determineFirstDigit(StringBuilder resultString, int lgPatternFound)
throws NotFoundException {
for (int d = 0; d < 10; d++) {
if (lgPatternFound == FIRST_DIGIT_ENCODINGS[d]) {
resultString.insert(0, (char) ('0' + d));
return;
}
}
throw NotFoundException.... | [
"private",
"static",
"void",
"determineFirstDigit",
"(",
"StringBuilder",
"resultString",
",",
"int",
"lgPatternFound",
")",
"throws",
"NotFoundException",
"{",
"for",
"(",
"int",
"d",
"=",
"0",
";",
"d",
"<",
"10",
";",
"d",
"++",
")",
"{",
"if",
"(",
"... | Based on pattern of odd-even ('L' and 'G') patterns used to encoded the explicitly-encoded
digits in a barcode, determines the implicitly encoded first digit and adds it to the
result string.
@param resultString string to insert decoded first digit into
@param lgPatternFound int whose bits indicates the pattern of odd... | [
"Based",
"on",
"pattern",
"of",
"odd",
"-",
"even",
"(",
"L",
"and",
"G",
")",
"patterns",
"used",
"to",
"encoded",
"the",
"explicitly",
"-",
"encoded",
"digits",
"in",
"a",
"barcode",
"determines",
"the",
"implicitly",
"encoded",
"first",
"digit",
"and",
... | train | https://github.com/zxing/zxing/blob/653ac2a3beb11481eff82e7d5f2bab8a745f7fac/core/src/main/java/com/google/zxing/oned/EAN13Reader.java#L127-L136 |
dustin/java-memcached-client | src/main/java/net/spy/memcached/MemcachedClient.java | MemcachedClient.asyncGets | @Override
public <T> OperationFuture<CASValue<T>> asyncGets(final String key,
final Transcoder<T> tc) {
"""
Gets (with CAS support) the given key asynchronously.
@param <T>
@param key the key to fetch
@param tc the transcoder to serialize and unserialize value
@return a future that will hold the retu... | java | @Override
public <T> OperationFuture<CASValue<T>> asyncGets(final String key,
final Transcoder<T> tc) {
final CountDownLatch latch = new CountDownLatch(1);
final OperationFuture<CASValue<T>> rv =
new OperationFuture<CASValue<T>>(key, latch, operationTimeout,
executorService);
Operation... | [
"@",
"Override",
"public",
"<",
"T",
">",
"OperationFuture",
"<",
"CASValue",
"<",
"T",
">",
">",
"asyncGets",
"(",
"final",
"String",
"key",
",",
"final",
"Transcoder",
"<",
"T",
">",
"tc",
")",
"{",
"final",
"CountDownLatch",
"latch",
"=",
"new",
"Co... | Gets (with CAS support) the given key asynchronously.
@param <T>
@param key the key to fetch
@param tc the transcoder to serialize and unserialize value
@return a future that will hold the return value of the fetch
@throws IllegalStateException in the rare circumstance where queue is too
full to accept any more reques... | [
"Gets",
"(",
"with",
"CAS",
"support",
")",
"the",
"given",
"key",
"asynchronously",
"."
] | train | https://github.com/dustin/java-memcached-client/blob/c232307ad8e0c7ccc926e495dd7d5aad2d713318/src/main/java/net/spy/memcached/MemcachedClient.java#L1071-L1105 |
nuun-io/kernel | core/src/main/java/io/nuun/kernel/core/internal/FacetRegistry.java | FacetRegistry.getFacet | <T> T getFacet(@Nullable Class<T> facet) throws IllegalStateException {
"""
Returns the plugin implementing the given facet.
<p>
In order to provide more flexibility, the given class can also
be a Plugin class. In this case, its implementation will be directly
returned if present.
</p>
@param facet the fac... | java | <T> T getFacet(@Nullable Class<T> facet) throws IllegalStateException
{
T plugin = null;
if (facet != null)
{
List<T> plugins = getFacets(facet);
if (plugins.size() > 1)
{
throw new IllegalStateException(String.format("One implementation wa... | [
"<",
"T",
">",
"T",
"getFacet",
"(",
"@",
"Nullable",
"Class",
"<",
"T",
">",
"facet",
")",
"throws",
"IllegalStateException",
"{",
"T",
"plugin",
"=",
"null",
";",
"if",
"(",
"facet",
"!=",
"null",
")",
"{",
"List",
"<",
"T",
">",
"plugins",
"=",
... | Returns the plugin implementing the given facet.
<p>
In order to provide more flexibility, the given class can also
be a Plugin class. In this case, its implementation will be directly
returned if present.
</p>
@param facet the facet class
@param <T> the facet type
@return the facet implementation or null if not pre... | [
"Returns",
"the",
"plugin",
"implementing",
"the",
"given",
"facet",
".",
"<p",
">",
"In",
"order",
"to",
"provide",
"more",
"flexibility",
"the",
"given",
"class",
"can",
"also",
"be",
"a",
"Plugin",
"class",
".",
"In",
"this",
"case",
"its",
"implementat... | train | https://github.com/nuun-io/kernel/blob/116a7664fe2a9323e280574803d273699a333732/core/src/main/java/io/nuun/kernel/core/internal/FacetRegistry.java#L75-L90 |
mboudreau/Alternator | src/main/java/com/amazonaws/services/dynamodb/datamodeling/DynamoDBMapper.java | DynamoDBMapper.getSimpleAttributeValue | private AttributeValue getSimpleAttributeValue(final Method getter, final Object getterReturnResult) {
"""
Returns an {@link AttributeValue} corresponding to the getter and return
result given, treating it as a non-versioned attribute.
"""
if ( getterReturnResult == null )
return null;
... | java | private AttributeValue getSimpleAttributeValue(final Method getter, final Object getterReturnResult) {
if ( getterReturnResult == null )
return null;
ArgumentMarshaller marshaller = reflector.getArgumentMarshaller(getter);
return marshaller.marshall(getterReturnResult);
} | [
"private",
"AttributeValue",
"getSimpleAttributeValue",
"(",
"final",
"Method",
"getter",
",",
"final",
"Object",
"getterReturnResult",
")",
"{",
"if",
"(",
"getterReturnResult",
"==",
"null",
")",
"return",
"null",
";",
"ArgumentMarshaller",
"marshaller",
"=",
"ref... | Returns an {@link AttributeValue} corresponding to the getter and return
result given, treating it as a non-versioned attribute. | [
"Returns",
"an",
"{"
] | train | https://github.com/mboudreau/Alternator/blob/4b230ac843494cb10e46ddc2848f5b5d377d7b72/src/main/java/com/amazonaws/services/dynamodb/datamodeling/DynamoDBMapper.java#L361-L367 |
onepf/OpenIAB | library/src/main/java/org/onepf/oms/util/Utils.java | Utils.packageInstalled | public static boolean packageInstalled(@NotNull final Context context, @NotNull final String packageName) {
"""
Checks if an application is installed.
@return true if the current thread it the UI thread.
"""
final PackageManager packageManager = context.getPackageManager();
boolean result = ... | java | public static boolean packageInstalled(@NotNull final Context context, @NotNull final String packageName) {
final PackageManager packageManager = context.getPackageManager();
boolean result = false;
try {
packageManager.getPackageInfo(packageName, PackageManager.GET_ACTIVITIES);
... | [
"public",
"static",
"boolean",
"packageInstalled",
"(",
"@",
"NotNull",
"final",
"Context",
"context",
",",
"@",
"NotNull",
"final",
"String",
"packageName",
")",
"{",
"final",
"PackageManager",
"packageManager",
"=",
"context",
".",
"getPackageManager",
"(",
")",... | Checks if an application is installed.
@return true if the current thread it the UI thread. | [
"Checks",
"if",
"an",
"application",
"is",
"installed",
"."
] | train | https://github.com/onepf/OpenIAB/blob/90552d53c5303b322940d96a0c4b7cb797d78760/library/src/main/java/org/onepf/oms/util/Utils.java#L53-L63 |
wisdom-framework/wisdom | core/content-manager/src/main/java/org/wisdom/content/jackson/JacksonSingleton.java | JacksonSingleton.fromXML | @Override
public <A> A fromXML(String xml, Class<A> clazz) {
"""
Builds a new instance of the given class <em>clazz</em> from the given XML string.
@param xml the XML string
@param clazz the class of the instance to construct
@return an instance of the class.
"""
try {
return xml... | java | @Override
public <A> A fromXML(String xml, Class<A> clazz) {
try {
return xmlMapper().readValue(xml, clazz);
} catch (IOException e) {
throw new RuntimeException(e);
}
} | [
"@",
"Override",
"public",
"<",
"A",
">",
"A",
"fromXML",
"(",
"String",
"xml",
",",
"Class",
"<",
"A",
">",
"clazz",
")",
"{",
"try",
"{",
"return",
"xmlMapper",
"(",
")",
".",
"readValue",
"(",
"xml",
",",
"clazz",
")",
";",
"}",
"catch",
"(",
... | Builds a new instance of the given class <em>clazz</em> from the given XML string.
@param xml the XML string
@param clazz the class of the instance to construct
@return an instance of the class. | [
"Builds",
"a",
"new",
"instance",
"of",
"the",
"given",
"class",
"<em",
">",
"clazz<",
"/",
"em",
">",
"from",
"the",
"given",
"XML",
"string",
"."
] | train | https://github.com/wisdom-framework/wisdom/blob/a35b6431200fec56b178c0ff60837ed73fd7874d/core/content-manager/src/main/java/org/wisdom/content/jackson/JacksonSingleton.java#L515-L522 |
sculptor/sculptor | sculptor-generator/sculptor-generator-core/src/main/java/org/sculptor/generator/util/HelperBase.java | HelperBase.handleBooleanAnnotation | public String handleBooleanAnnotation(String annotation, Boolean value, String message, String validate) {
"""
Handles all boolean validation annotations (Future, Past, Email, ...).
@param annotation
the name of the annotation
@param value
annotation is set or not
@param validate
the validate string
@retu... | java | public String handleBooleanAnnotation(String annotation, Boolean value, String message, String validate) {
if (!Boolean.TRUE.equals(value))
return "";
// if validate contains annotation, do nothing
if (validate != null && validate.toLowerCase().matches(".*@" + annotation.toLowerCase() + ".*"))
return "";
... | [
"public",
"String",
"handleBooleanAnnotation",
"(",
"String",
"annotation",
",",
"Boolean",
"value",
",",
"String",
"message",
",",
"String",
"validate",
")",
"{",
"if",
"(",
"!",
"Boolean",
".",
"TRUE",
".",
"equals",
"(",
"value",
")",
")",
"return",
"\"... | Handles all boolean validation annotations (Future, Past, Email, ...).
@param annotation
the name of the annotation
@param value
annotation is set or not
@param validate
the validate string
@return annotation validation string | [
"Handles",
"all",
"boolean",
"validation",
"annotations",
"(",
"Future",
"Past",
"Email",
"...",
")",
"."
] | train | https://github.com/sculptor/sculptor/blob/38df06ceb7e40f5f52dbd53b1cd1d07ee11aade5/sculptor-generator/sculptor-generator-core/src/main/java/org/sculptor/generator/util/HelperBase.java#L1170-L1187 |
Azure/azure-sdk-for-java | appservice/resource-manager/v2016_09_01/src/main/java/com/microsoft/azure/management/appservice/v2016_09_01/implementation/AppServiceEnvironmentsInner.java | AppServiceEnvironmentsInner.listMultiRoleUsagesWithServiceResponseAsync | public Observable<ServiceResponse<Page<UsageInner>>> listMultiRoleUsagesWithServiceResponseAsync(final String resourceGroupName, final String name) {
"""
Get usage metrics for a multi-role pool of an App Service Environment.
Get usage metrics for a multi-role pool of an App Service Environment.
@param resource... | java | public Observable<ServiceResponse<Page<UsageInner>>> listMultiRoleUsagesWithServiceResponseAsync(final String resourceGroupName, final String name) {
return listMultiRoleUsagesSinglePageAsync(resourceGroupName, name)
.concatMap(new Func1<ServiceResponse<Page<UsageInner>>, Observable<ServiceResponse<... | [
"public",
"Observable",
"<",
"ServiceResponse",
"<",
"Page",
"<",
"UsageInner",
">",
">",
">",
"listMultiRoleUsagesWithServiceResponseAsync",
"(",
"final",
"String",
"resourceGroupName",
",",
"final",
"String",
"name",
")",
"{",
"return",
"listMultiRoleUsagesSinglePageA... | Get usage metrics for a multi-role pool of an App Service Environment.
Get usage metrics for a multi-role pool of an App Service Environment.
@param resourceGroupName Name of the resource group to which the resource belongs.
@param name Name of the App Service Environment.
@throws IllegalArgumentException thrown if pa... | [
"Get",
"usage",
"metrics",
"for",
"a",
"multi",
"-",
"role",
"pool",
"of",
"an",
"App",
"Service",
"Environment",
".",
"Get",
"usage",
"metrics",
"for",
"a",
"multi",
"-",
"role",
"pool",
"of",
"an",
"App",
"Service",
"Environment",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/appservice/resource-manager/v2016_09_01/src/main/java/com/microsoft/azure/management/appservice/v2016_09_01/implementation/AppServiceEnvironmentsInner.java#L3559-L3571 |
orbisgis/h2gis | h2gis-functions/src/main/java/org/h2gis/functions/io/tsv/TSVDriverFunction.java | TSVDriverFunction.exportFromResultSet | public void exportFromResultSet(Connection connection, ResultSet res, File fileName, ProgressVisitor progress, String encoding) throws SQLException {
"""
Export a resultset to a TSV file
@param connection
@param res
@param fileName
@param progress
@param encoding
@throws java.sql.SQLException
"""
... | java | public void exportFromResultSet(Connection connection, ResultSet res, File fileName, ProgressVisitor progress, String encoding) throws SQLException {
Csv csv = new Csv();
String csvOptions = "charset=UTF-8 fieldSeparator=\t fieldDelimiter=\t";
if (encoding != null) {
csvOptions = Str... | [
"public",
"void",
"exportFromResultSet",
"(",
"Connection",
"connection",
",",
"ResultSet",
"res",
",",
"File",
"fileName",
",",
"ProgressVisitor",
"progress",
",",
"String",
"encoding",
")",
"throws",
"SQLException",
"{",
"Csv",
"csv",
"=",
"new",
"Csv",
"(",
... | Export a resultset to a TSV file
@param connection
@param res
@param fileName
@param progress
@param encoding
@throws java.sql.SQLException | [
"Export",
"a",
"resultset",
"to",
"a",
"TSV",
"file"
] | train | https://github.com/orbisgis/h2gis/blob/9cd70b447e6469cecbc2fc64b16774b59491df3b/h2gis-functions/src/main/java/org/h2gis/functions/io/tsv/TSVDriverFunction.java#L152-L160 |
mebigfatguy/fb-contrib | src/main/java/com/mebigfatguy/fbcontrib/detect/JPAIssues.java | JPAIssues.reportExceptionMismatch | private void reportExceptionMismatch(Method method, Set<JavaClass> expectedExceptions, Set<JavaClass> actualExceptions, boolean checkByDirectionally,
BugType bugType) {
"""
compares the current methods exceptions to those declared in the spring-tx's @Transactional method, both rollbackFor and noRollbac... | java | private void reportExceptionMismatch(Method method, Set<JavaClass> expectedExceptions, Set<JavaClass> actualExceptions, boolean checkByDirectionally,
BugType bugType) {
try {
for (JavaClass declEx : actualExceptions) {
boolean handled = false;
for (JavaCla... | [
"private",
"void",
"reportExceptionMismatch",
"(",
"Method",
"method",
",",
"Set",
"<",
"JavaClass",
">",
"expectedExceptions",
",",
"Set",
"<",
"JavaClass",
">",
"actualExceptions",
",",
"boolean",
"checkByDirectionally",
",",
"BugType",
"bugType",
")",
"{",
"try... | compares the current methods exceptions to those declared in the spring-tx's @Transactional method, both rollbackFor and noRollbackFor. It looks both
ways, exceptions thrown that aren't handled by rollbacks/norollbacks, and Spring declarations that aren't actually thrown.
@param method
the currently parsed method
@par... | [
"compares",
"the",
"current",
"methods",
"exceptions",
"to",
"those",
"declared",
"in",
"the",
"spring",
"-",
"tx",
"s",
"@Transactional",
"method",
"both",
"rollbackFor",
"and",
"noRollbackFor",
".",
"It",
"looks",
"both",
"ways",
"exceptions",
"thrown",
"that"... | train | https://github.com/mebigfatguy/fb-contrib/blob/3b5203196f627b399fbcea3c2ab2b1f4e56cc7b8/src/main/java/com/mebigfatguy/fbcontrib/detect/JPAIssues.java#L372-L392 |
alipay/sofa-rpc | extension-impl/fault-tolerance/src/main/java/com/alipay/sofa/rpc/common/utils/CalculateUtils.java | CalculateUtils.subtract | public static double subtract(double minuend, double reduction, int scale) {
"""
减法。计算结果四舍五入。
@param minuend 被减数
@param reduction 减数
@param scale 计算结果保留位数。(注意包括整数部分)
@return 计算结果
"""
BigDecimal minuendBd = new BigDecimal(Double.toString(minuend));
BigDecimal reductionBd = new BigDec... | java | public static double subtract(double minuend, double reduction, int scale) {
BigDecimal minuendBd = new BigDecimal(Double.toString(minuend));
BigDecimal reductionBd = new BigDecimal(Double.toString(reduction));
MathContext mathContext = new MathContext(scale, RoundingMode.HALF_UP);
retur... | [
"public",
"static",
"double",
"subtract",
"(",
"double",
"minuend",
",",
"double",
"reduction",
",",
"int",
"scale",
")",
"{",
"BigDecimal",
"minuendBd",
"=",
"new",
"BigDecimal",
"(",
"Double",
".",
"toString",
"(",
"minuend",
")",
")",
";",
"BigDecimal",
... | 减法。计算结果四舍五入。
@param minuend 被减数
@param reduction 减数
@param scale 计算结果保留位数。(注意包括整数部分)
@return 计算结果 | [
"减法。计算结果四舍五入。"
] | train | https://github.com/alipay/sofa-rpc/blob/a31406410291e56696185a29c3ba4bd1f54488fd/extension-impl/fault-tolerance/src/main/java/com/alipay/sofa/rpc/common/utils/CalculateUtils.java#L88-L93 |
geomajas/geomajas-project-server | impl/src/main/java/org/geomajas/internal/service/DtoConverterServiceImpl.java | DtoConverterServiceImpl.toInternal | public Object toInternal(Attribute<?> attribute) throws GeomajasException {
"""
Converts a DTO attribute into a generic attribute object.
@param attribute
The DTO attribute.
@return The server side attribute representation. As we don't know at this point what kind of object the
attribute is (that's a problem... | java | public Object toInternal(Attribute<?> attribute) throws GeomajasException {
if (attribute instanceof PrimitiveAttribute<?>) {
return toPrimitiveObject((PrimitiveAttribute<?>) attribute);
} else if (attribute instanceof AssociationAttribute<?>) {
return toAssociationObject((AssociationAttribute<?>) attribute);... | [
"public",
"Object",
"toInternal",
"(",
"Attribute",
"<",
"?",
">",
"attribute",
")",
"throws",
"GeomajasException",
"{",
"if",
"(",
"attribute",
"instanceof",
"PrimitiveAttribute",
"<",
"?",
">",
")",
"{",
"return",
"toPrimitiveObject",
"(",
"(",
"PrimitiveAttri... | Converts a DTO attribute into a generic attribute object.
@param attribute
The DTO attribute.
@return The server side attribute representation. As we don't know at this point what kind of object the
attribute is (that's a problem for the <code>FeatureModel</code>), we return an <code>Object</code>. | [
"Converts",
"a",
"DTO",
"attribute",
"into",
"a",
"generic",
"attribute",
"object",
"."
] | train | https://github.com/geomajas/geomajas-project-server/blob/904b7d7deed1350d28955589098dd1e0a786d76e/impl/src/main/java/org/geomajas/internal/service/DtoConverterServiceImpl.java#L97-L105 |
facebookarchive/hadoop-20 | src/core/org/apache/hadoop/http/HttpServer.java | HttpServer.addContext | protected void addContext(String pathSpec, String dir, boolean isFiltered) throws IOException {
"""
Add a context
@param pathSpec The path spec for the context
@param dir The directory containing the context
@param isFiltered if true, the servlet is added to the filter path mapping
@throws IOException
"""
... | java | protected void addContext(String pathSpec, String dir, boolean isFiltered) throws IOException {
if (0 == webServer.getHandlers().length) {
throw new RuntimeException("Couldn't find handler");
}
WebAppContext webAppCtx = new WebAppContext();
webAppCtx.setContextPath(pathSpec);
webAppCtx.setWar(... | [
"protected",
"void",
"addContext",
"(",
"String",
"pathSpec",
",",
"String",
"dir",
",",
"boolean",
"isFiltered",
")",
"throws",
"IOException",
"{",
"if",
"(",
"0",
"==",
"webServer",
".",
"getHandlers",
"(",
")",
".",
"length",
")",
"{",
"throw",
"new",
... | Add a context
@param pathSpec The path spec for the context
@param dir The directory containing the context
@param isFiltered if true, the servlet is added to the filter path mapping
@throws IOException | [
"Add",
"a",
"context"
] | train | https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/core/org/apache/hadoop/http/HttpServer.java#L255-L263 |
samskivert/pythagoras | src/main/java/pythagoras/d/Matrix4.java | Matrix4.setToFrustum | public Matrix4 setToFrustum (
double left, double right, double bottom, double top, double near, double far) {
"""
Sets this to a perspective projection matrix. The formula comes from the OpenGL
documentation for the glFrustum function.
@return a reference to this matrix, for chaining.
"""
... | java | public Matrix4 setToFrustum (
double left, double right, double bottom, double top, double near, double far) {
return setToFrustum(left, right, bottom, top, near, far, Vector3.UNIT_Z);
} | [
"public",
"Matrix4",
"setToFrustum",
"(",
"double",
"left",
",",
"double",
"right",
",",
"double",
"bottom",
",",
"double",
"top",
",",
"double",
"near",
",",
"double",
"far",
")",
"{",
"return",
"setToFrustum",
"(",
"left",
",",
"right",
",",
"bottom",
... | Sets this to a perspective projection matrix. The formula comes from the OpenGL
documentation for the glFrustum function.
@return a reference to this matrix, for chaining. | [
"Sets",
"this",
"to",
"a",
"perspective",
"projection",
"matrix",
".",
"The",
"formula",
"comes",
"from",
"the",
"OpenGL",
"documentation",
"for",
"the",
"glFrustum",
"function",
"."
] | train | https://github.com/samskivert/pythagoras/blob/b8fea743ee8a7d742ad9c06ee4f11f50571fbd32/src/main/java/pythagoras/d/Matrix4.java#L387-L390 |
jasminb/jsonapi-converter | src/main/java/com/github/jasminb/jsonapi/ResourceConverter.java | ResourceConverter.writeDocumentCollection | public byte [] writeDocumentCollection(JSONAPIDocument<? extends Iterable<?>> documentCollection,
SerializationSettings serializationSettings)
throws DocumentSerializationException {
"""
Serializes provided {@link JSONAPIDocument} into JSON API Spec compatible byte representation.
@param documentC... | java | public byte [] writeDocumentCollection(JSONAPIDocument<? extends Iterable<?>> documentCollection,
SerializationSettings serializationSettings)
throws DocumentSerializationException {
try {
resourceCache.init();
ArrayNode results = objectMapper.createArrayNode();
Map<String, ObjectNode> inclu... | [
"public",
"byte",
"[",
"]",
"writeDocumentCollection",
"(",
"JSONAPIDocument",
"<",
"?",
"extends",
"Iterable",
"<",
"?",
">",
">",
"documentCollection",
",",
"SerializationSettings",
"serializationSettings",
")",
"throws",
"DocumentSerializationException",
"{",
"try",
... | Serializes provided {@link JSONAPIDocument} into JSON API Spec compatible byte representation.
@param documentCollection {@link JSONAPIDocument} document collection to serialize
@param serializationSettings {@link SerializationSettings} settings that override global serialization settings
@return serialized content in ... | [
"Serializes",
"provided",
"{"
] | train | https://github.com/jasminb/jsonapi-converter/blob/73b41c3b9274e70e62b3425071ca8afdc7bddaf6/src/main/java/com/github/jasminb/jsonapi/ResourceConverter.java#L765-L793 |
seancfoley/IPAddress | IPAddress/src/inet.ipaddr/inet/ipaddr/format/util/sql/SQLStringMatcher.java | SQLStringMatcher.getSQLCondition | public StringBuilder getSQLCondition(StringBuilder builder, String columnName) {
"""
Get an SQL condition to match this address section representation
@param builder
@param columnName
@return the condition
"""
String string = networkString.getString();
if(isEntireAddress) {
matchString(builder, col... | java | public StringBuilder getSQLCondition(StringBuilder builder, String columnName) {
String string = networkString.getString();
if(isEntireAddress) {
matchString(builder, columnName, string);
} else {
matchSubString(
builder,
columnName,
networkString.getTrailingSegmentSeparator(),
networkSt... | [
"public",
"StringBuilder",
"getSQLCondition",
"(",
"StringBuilder",
"builder",
",",
"String",
"columnName",
")",
"{",
"String",
"string",
"=",
"networkString",
".",
"getString",
"(",
")",
";",
"if",
"(",
"isEntireAddress",
")",
"{",
"matchString",
"(",
"builder"... | Get an SQL condition to match this address section representation
@param builder
@param columnName
@return the condition | [
"Get",
"an",
"SQL",
"condition",
"to",
"match",
"this",
"address",
"section",
"representation"
] | train | https://github.com/seancfoley/IPAddress/blob/90493d0673511d673100c36d020dd93dd870111a/IPAddress/src/inet.ipaddr/inet/ipaddr/format/util/sql/SQLStringMatcher.java#L53-L66 |
lettuce-io/lettuce-core | src/main/java/io/lettuce/core/RedisClient.java | RedisClient.connectPubSubAsync | public <K, V> ConnectionFuture<StatefulRedisPubSubConnection<K, V>> connectPubSubAsync(RedisCodec<K, V> codec,
RedisURI redisURI) {
"""
Open asynchronously a new pub/sub connection to the Redis server using the supplied {@link RedisURI} and use the supplied
{@link RedisCodec codec} to encode/decode ke... | java | public <K, V> ConnectionFuture<StatefulRedisPubSubConnection<K, V>> connectPubSubAsync(RedisCodec<K, V> codec,
RedisURI redisURI) {
assertNotNull(redisURI);
return transformAsyncConnectionException(connectPubSubAsync(codec, redisURI, redisURI.getTimeout()));
} | [
"public",
"<",
"K",
",",
"V",
">",
"ConnectionFuture",
"<",
"StatefulRedisPubSubConnection",
"<",
"K",
",",
"V",
">",
">",
"connectPubSubAsync",
"(",
"RedisCodec",
"<",
"K",
",",
"V",
">",
"codec",
",",
"RedisURI",
"redisURI",
")",
"{",
"assertNotNull",
"(... | Open asynchronously a new pub/sub connection to the Redis server using the supplied {@link RedisURI} and use the supplied
{@link RedisCodec codec} to encode/decode keys and values.
@param codec Use this codec to encode/decode keys and values, must not be {@literal null}
@param redisURI the redis server to connect to, ... | [
"Open",
"asynchronously",
"a",
"new",
"pub",
"/",
"sub",
"connection",
"to",
"the",
"Redis",
"server",
"using",
"the",
"supplied",
"{",
"@link",
"RedisURI",
"}",
"and",
"use",
"the",
"supplied",
"{",
"@link",
"RedisCodec",
"codec",
"}",
"to",
"encode",
"/"... | train | https://github.com/lettuce-io/lettuce-core/blob/b6de74e384dea112e3656684ca3f50cdfd6c8e0d/src/main/java/io/lettuce/core/RedisClient.java#L413-L418 |
Waikato/moa | moa/src/main/java/moa/clusterers/clustree/Node.java | Node.addEntry | public void addEntry(Entry newEntry, long currentTime) {
"""
Add a new <code>Entry</code> to this node. If there is no space left a
<code>NoFreeEntryException</code> is thrown.
@param newEntry The <code>Entry</code> to be added.
@throws NoFreeEntryException Is thrown when there is no space left in
the node for... | java | public void addEntry(Entry newEntry, long currentTime){
newEntry.setNode(this);
int freePosition = getNextEmptyPosition();
entries[freePosition].initializeEntry(newEntry, currentTime);
} | [
"public",
"void",
"addEntry",
"(",
"Entry",
"newEntry",
",",
"long",
"currentTime",
")",
"{",
"newEntry",
".",
"setNode",
"(",
"this",
")",
";",
"int",
"freePosition",
"=",
"getNextEmptyPosition",
"(",
")",
";",
"entries",
"[",
"freePosition",
"]",
".",
"i... | Add a new <code>Entry</code> to this node. If there is no space left a
<code>NoFreeEntryException</code> is thrown.
@param newEntry The <code>Entry</code> to be added.
@throws NoFreeEntryException Is thrown when there is no space left in
the node for the new entry. | [
"Add",
"a",
"new",
"<code",
">",
"Entry<",
"/",
"code",
">",
"to",
"this",
"node",
".",
"If",
"there",
"is",
"no",
"space",
"left",
"a",
"<code",
">",
"NoFreeEntryException<",
"/",
"code",
">",
"is",
"thrown",
"."
] | train | https://github.com/Waikato/moa/blob/395982e5100bfe75a3a4d26115462ce2cc74cbb0/moa/src/main/java/moa/clusterers/clustree/Node.java#L204-L208 |
jbossas/jboss-vfs | src/main/java/org/jboss/vfs/TempDir.java | TempDir.getFile | public File getFile(String relativePath) throws IOException {
"""
Get the {@code File} for a relative path. The returned file is only valid as long as the tempdir exists.
@param relativePath the relative path
@return the corresponding file
@throws IOException if the directory was closed at the time of this i... | java | public File getFile(String relativePath) throws IOException {
if (!open.get()) {
throw VFSMessages.MESSAGES.tempDirectoryClosed();
}
return new File(root, relativePath);
} | [
"public",
"File",
"getFile",
"(",
"String",
"relativePath",
")",
"throws",
"IOException",
"{",
"if",
"(",
"!",
"open",
".",
"get",
"(",
")",
")",
"{",
"throw",
"VFSMessages",
".",
"MESSAGES",
".",
"tempDirectoryClosed",
"(",
")",
";",
"}",
"return",
"new... | Get the {@code File} for a relative path. The returned file is only valid as long as the tempdir exists.
@param relativePath the relative path
@return the corresponding file
@throws IOException if the directory was closed at the time of this invocation | [
"Get",
"the",
"{",
"@code",
"File",
"}",
"for",
"a",
"relative",
"path",
".",
"The",
"returned",
"file",
"is",
"only",
"valid",
"as",
"long",
"as",
"the",
"tempdir",
"exists",
"."
] | train | https://github.com/jbossas/jboss-vfs/blob/420f4b896d6178ee5f6758f3421e9f350d2b8ab5/src/main/java/org/jboss/vfs/TempDir.java#L65-L70 |
Carbonado/Carbonado | src/main/java/com/amazon/carbonado/info/StorableIndex.java | StorableIndex.nextSep | private static int nextSep(String desc, int pos) {
"""
Find the first subsequent occurrance of '+', '-', or '~' in the string
or the end of line if none are there
@param desc string to search
@param pos starting position in string
@return position of next separator, or end of string if none present
"""
... | java | private static int nextSep(String desc, int pos) {
int pos2 = desc.length(); // assume we'll find none
int candidate = desc.indexOf('+', pos);
if (candidate > 0) {
pos2=candidate;
}
candidate = desc.indexOf('-', pos);
if (candidate>0) {
... | [
"private",
"static",
"int",
"nextSep",
"(",
"String",
"desc",
",",
"int",
"pos",
")",
"{",
"int",
"pos2",
"=",
"desc",
".",
"length",
"(",
")",
";",
"// assume we'll find none\r",
"int",
"candidate",
"=",
"desc",
".",
"indexOf",
"(",
"'",
"'",
",",
"po... | Find the first subsequent occurrance of '+', '-', or '~' in the string
or the end of line if none are there
@param desc string to search
@param pos starting position in string
@return position of next separator, or end of string if none present | [
"Find",
"the",
"first",
"subsequent",
"occurrance",
"of",
"+",
"-",
"or",
"~",
"in",
"the",
"string",
"or",
"the",
"end",
"of",
"line",
"if",
"none",
"are",
"there"
] | train | https://github.com/Carbonado/Carbonado/blob/eee29b365a61c8f03e1a1dc6bed0692e6b04b1db/src/main/java/com/amazon/carbonado/info/StorableIndex.java#L135-L152 |
paypal/SeLion | appium-provider/src/main/java/com/paypal/selion/appium/platform/grid/SeLionAppiumProvider.java | SeLionAppiumProvider.createDriver | @Override
public RemoteWebDriver createDriver(WebDriverPlatform platform, CommandExecutor commandExecutor,
URL url, Capabilities caps) {
"""
create an instance of SeLionAppiumIOSDriver or SeLionAppiumAndroidDriver
"""
if (platform.equals(WebDriverPlatform.... | java | @Override
public RemoteWebDriver createDriver(WebDriverPlatform platform, CommandExecutor commandExecutor,
URL url, Capabilities caps) {
if (platform.equals(WebDriverPlatform.ANDROID)) {
if (commandExecutor == null) {
return new SeLionAp... | [
"@",
"Override",
"public",
"RemoteWebDriver",
"createDriver",
"(",
"WebDriverPlatform",
"platform",
",",
"CommandExecutor",
"commandExecutor",
",",
"URL",
"url",
",",
"Capabilities",
"caps",
")",
"{",
"if",
"(",
"platform",
".",
"equals",
"(",
"WebDriverPlatform",
... | create an instance of SeLionAppiumIOSDriver or SeLionAppiumAndroidDriver | [
"create",
"an",
"instance",
"of",
"SeLionAppiumIOSDriver",
"or",
"SeLionAppiumAndroidDriver"
] | train | https://github.com/paypal/SeLion/blob/694d12d0df76db48d0360b16192770c6a4fbdfd2/appium-provider/src/main/java/com/paypal/selion/appium/platform/grid/SeLionAppiumProvider.java#L47-L66 |
couchbase/couchbase-lite-java | src/main/java/com/couchbase/lite/MutableDocument.java | MutableDocument.setFloat | @NonNull
@Override
public MutableDocument setFloat(@NonNull String key, float value) {
"""
Set a float value for the given key
@param key the key.
@param key the float value.
@return this MutableDocument instance
"""
return setValue(key, value);
} | java | @NonNull
@Override
public MutableDocument setFloat(@NonNull String key, float value) {
return setValue(key, value);
} | [
"@",
"NonNull",
"@",
"Override",
"public",
"MutableDocument",
"setFloat",
"(",
"@",
"NonNull",
"String",
"key",
",",
"float",
"value",
")",
"{",
"return",
"setValue",
"(",
"key",
",",
"value",
")",
";",
"}"
] | Set a float value for the given key
@param key the key.
@param key the float value.
@return this MutableDocument instance | [
"Set",
"a",
"float",
"value",
"for",
"the",
"given",
"key"
] | train | https://github.com/couchbase/couchbase-lite-java/blob/cb72c44186456e6191a9ad0a7feb310011d0b081/src/main/java/com/couchbase/lite/MutableDocument.java#L210-L214 |
apereo/cas | core/cas-server-core-util-api/src/main/java/org/apereo/cas/util/HttpUtils.java | HttpUtils.executePost | public static HttpResponse executePost(final String url,
final String basicAuthUsername,
final String basicAuthPassword,
final String entity,
final ... | java | public static HttpResponse executePost(final String url,
final String basicAuthUsername,
final String basicAuthPassword,
final String entity,
final ... | [
"public",
"static",
"HttpResponse",
"executePost",
"(",
"final",
"String",
"url",
",",
"final",
"String",
"basicAuthUsername",
",",
"final",
"String",
"basicAuthPassword",
",",
"final",
"String",
"entity",
",",
"final",
"Map",
"<",
"String",
",",
"Object",
">",
... | Execute post http response.
@param url the url
@param basicAuthUsername the basic auth username
@param basicAuthPassword the basic auth password
@param entity the entity
@param parameters the parameters
@param headers the headers
@return the http response | [
"Execute",
"post",
"http",
"response",
"."
] | train | https://github.com/apereo/cas/blob/b4b306433a8782cef803a39bea5b1f96740e0e9b/core/cas-server-core-util-api/src/main/java/org/apereo/cas/util/HttpUtils.java#L364-L376 |
camunda/camunda-bpm-platform | engine/src/main/java/org/camunda/bpm/engine/impl/bpmn/parser/BpmnParse.java | BpmnParse.parseConditionalEventDefinition | protected ConditionalEventDefinition parseConditionalEventDefinition(Element element, ActivityImpl conditionalActivity) {
"""
Parses the given element and returns an ConditionalEventDefinition object.
@param element the XML element which contains the conditional event information
@param conditionalActivity the... | java | protected ConditionalEventDefinition parseConditionalEventDefinition(Element element, ActivityImpl conditionalActivity) {
ConditionalEventDefinition conditionalEventDefinition = null;
Element conditionExprElement = element.element(CONDITION);
if (conditionExprElement != null) {
Condition condition = ... | [
"protected",
"ConditionalEventDefinition",
"parseConditionalEventDefinition",
"(",
"Element",
"element",
",",
"ActivityImpl",
"conditionalActivity",
")",
"{",
"ConditionalEventDefinition",
"conditionalEventDefinition",
"=",
"null",
";",
"Element",
"conditionExprElement",
"=",
"... | Parses the given element and returns an ConditionalEventDefinition object.
@param element the XML element which contains the conditional event information
@param conditionalActivity the conditional event activity
@return the conditional event definition which was parsed | [
"Parses",
"the",
"given",
"element",
"and",
"returns",
"an",
"ConditionalEventDefinition",
"object",
"."
] | train | https://github.com/camunda/camunda-bpm-platform/blob/1a464fc887ef3760e53d6f91b9e5b871a0d77cc0/engine/src/main/java/org/camunda/bpm/engine/impl/bpmn/parser/BpmnParse.java#L3519-L3550 |
osmdroid/osmdroid | osmdroid-android/src/main/java/org/osmdroid/tileprovider/modules/SqlTileWriter.java | SqlTileWriter.getRowCount | public long getRowCount(String tileSourceName) {
"""
Returns the number of tiles in the cache for the specified tile source name
@param tileSourceName
@return
@since 5.6
"""
if (tileSourceName == null) {
return getRowCount(null, null);
}
return getRowCount(COLUMN_PROVID... | java | public long getRowCount(String tileSourceName) {
if (tileSourceName == null) {
return getRowCount(null, null);
}
return getRowCount(COLUMN_PROVIDER + "=?", new String[] {tileSourceName});
} | [
"public",
"long",
"getRowCount",
"(",
"String",
"tileSourceName",
")",
"{",
"if",
"(",
"tileSourceName",
"==",
"null",
")",
"{",
"return",
"getRowCount",
"(",
"null",
",",
"null",
")",
";",
"}",
"return",
"getRowCount",
"(",
"COLUMN_PROVIDER",
"+",
"\"=?\"",... | Returns the number of tiles in the cache for the specified tile source name
@param tileSourceName
@return
@since 5.6 | [
"Returns",
"the",
"number",
"of",
"tiles",
"in",
"the",
"cache",
"for",
"the",
"specified",
"tile",
"source",
"name"
] | train | https://github.com/osmdroid/osmdroid/blob/3b178b2f078497dd88c137110e87aafe45ad2b16/osmdroid-android/src/main/java/org/osmdroid/tileprovider/modules/SqlTileWriter.java#L411-L416 |
joniles/mpxj | src/main/java/net/sf/mpxj/Resource.java | Resource.setNumber | public void setNumber(int index, Number value) {
"""
Set a number value.
@param index number index (1-20)
@param value number value
"""
set(selectField(ResourceFieldLists.CUSTOM_NUMBER, index), value);
} | java | public void setNumber(int index, Number value)
{
set(selectField(ResourceFieldLists.CUSTOM_NUMBER, index), value);
} | [
"public",
"void",
"setNumber",
"(",
"int",
"index",
",",
"Number",
"value",
")",
"{",
"set",
"(",
"selectField",
"(",
"ResourceFieldLists",
".",
"CUSTOM_NUMBER",
",",
"index",
")",
",",
"value",
")",
";",
"}"
] | Set a number value.
@param index number index (1-20)
@param value number value | [
"Set",
"a",
"number",
"value",
"."
] | train | https://github.com/joniles/mpxj/blob/143ea0e195da59cd108f13b3b06328e9542337e8/src/main/java/net/sf/mpxj/Resource.java#L1639-L1642 |
mcxiaoke/Android-Next | core/src/main/java/com/mcxiaoke/next/utils/TrafficUtils.java | TrafficUtils.start | public static long start(Context context, String tag) {
"""
开始流量统计
@param context Context
@param tag traffic tag
@return received bytes
"""
final int uid = getUid(context);
if (uid > 0) {
long appRxValue = TrafficStats.getUidRxBytes(uid);
long appTxValue = Traff... | java | public static long start(Context context, String tag) {
final int uid = getUid(context);
if (uid > 0) {
long appRxValue = TrafficStats.getUidRxBytes(uid);
long appTxValue = TrafficStats.getUidTxBytes(uid);
sReceivedBytes.put(tag, appRxValue);
sSendBytes.pu... | [
"public",
"static",
"long",
"start",
"(",
"Context",
"context",
",",
"String",
"tag",
")",
"{",
"final",
"int",
"uid",
"=",
"getUid",
"(",
"context",
")",
";",
"if",
"(",
"uid",
">",
"0",
")",
"{",
"long",
"appRxValue",
"=",
"TrafficStats",
".",
"get... | 开始流量统计
@param context Context
@param tag traffic tag
@return received bytes | [
"开始流量统计"
] | train | https://github.com/mcxiaoke/Android-Next/blob/1bfdf99d0b81a849aa0fa6697c53ed673151ca39/core/src/main/java/com/mcxiaoke/next/utils/TrafficUtils.java#L37-L50 |
zaproxy/zaproxy | src/org/parosproxy/paros/db/paros/ParosTableHistory.java | ParosTableHistory.getHistoryIdsOfHistType | @Override
public List<Integer> getHistoryIdsOfHistType(long sessionId, int... histTypes) throws DatabaseException {
"""
Gets all the history record IDs of the given session and with the given history types.
@param sessionId the ID of session of the history records
@param histTypes the history types of the... | java | @Override
public List<Integer> getHistoryIdsOfHistType(long sessionId, int... histTypes) throws DatabaseException {
return getHistoryIdsByParams(sessionId, 0, true, histTypes);
} | [
"@",
"Override",
"public",
"List",
"<",
"Integer",
">",
"getHistoryIdsOfHistType",
"(",
"long",
"sessionId",
",",
"int",
"...",
"histTypes",
")",
"throws",
"DatabaseException",
"{",
"return",
"getHistoryIdsByParams",
"(",
"sessionId",
",",
"0",
",",
"true",
",",... | Gets all the history record IDs of the given session and with the given history types.
@param sessionId the ID of session of the history records
@param histTypes the history types of the history records that should be returned
@return a {@code List} with all the history IDs of the given session and history types, neve... | [
"Gets",
"all",
"the",
"history",
"record",
"IDs",
"of",
"the",
"given",
"session",
"and",
"with",
"the",
"given",
"history",
"types",
"."
] | train | https://github.com/zaproxy/zaproxy/blob/0cbe5121f2ae1ecca222513d182759210c569bec/src/org/parosproxy/paros/db/paros/ParosTableHistory.java#L436-L439 |
aws/aws-sdk-java | jmespath-java/src/main/java/com/amazonaws/jmespath/JmesPathEvaluationVisitor.java | JmesPathEvaluationVisitor.visit | @Override
public JsonNode visit(JmesPathProjection jmesPathProjection, JsonNode input) throws InvalidTypeException {
"""
Evaluates a list projection expression in two steps.
The left hand side (LHS) creates a JSON array of initial
values.
The right hand side (RHS) of a projection is the
expression to proje... | java | @Override
public JsonNode visit(JmesPathProjection jmesPathProjection, JsonNode input) throws InvalidTypeException {
JsonNode lhsResult = jmesPathProjection.getLhsExpr().accept(this, input);
if (lhsResult.isArray()) {
Iterator<JsonNode> elements = lhsResult.elements();
ArrayN... | [
"@",
"Override",
"public",
"JsonNode",
"visit",
"(",
"JmesPathProjection",
"jmesPathProjection",
",",
"JsonNode",
"input",
")",
"throws",
"InvalidTypeException",
"{",
"JsonNode",
"lhsResult",
"=",
"jmesPathProjection",
".",
"getLhsExpr",
"(",
")",
".",
"accept",
"("... | Evaluates a list projection expression in two steps.
The left hand side (LHS) creates a JSON array of initial
values.
The right hand side (RHS) of a projection is the
expression to project for each element in the JSON array
created by the left hand side.
@param jmesPathProjection JmesPath list projection type
@param i... | [
"Evaluates",
"a",
"list",
"projection",
"expression",
"in",
"two",
"steps",
".",
"The",
"left",
"hand",
"side",
"(",
"LHS",
")",
"creates",
"a",
"JSON",
"array",
"of",
"initial",
"values",
".",
"The",
"right",
"hand",
"side",
"(",
"RHS",
")",
"of",
"a"... | train | https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/jmespath-java/src/main/java/com/amazonaws/jmespath/JmesPathEvaluationVisitor.java#L78-L93 |
JRebirth/JRebirth | org.jrebirth.af/core/src/main/java/org/jrebirth/af/core/resource/parameter/ParameterBuilder.java | ParameterBuilder.define | public void define(final ParameterItem<?> key, final Object forcedValue) {
"""
Override a parameter value.
@param key the parameter item key
@param forcedValue the overridden value
"""
this.overriddenParametersMap.put(key, forcedValue);
set(getParamKey(key), forcedValue);
} | java | public void define(final ParameterItem<?> key, final Object forcedValue) {
this.overriddenParametersMap.put(key, forcedValue);
set(getParamKey(key), forcedValue);
} | [
"public",
"void",
"define",
"(",
"final",
"ParameterItem",
"<",
"?",
">",
"key",
",",
"final",
"Object",
"forcedValue",
")",
"{",
"this",
".",
"overriddenParametersMap",
".",
"put",
"(",
"key",
",",
"forcedValue",
")",
";",
"set",
"(",
"getParamKey",
"(",
... | Override a parameter value.
@param key the parameter item key
@param forcedValue the overridden value | [
"Override",
"a",
"parameter",
"value",
"."
] | train | https://github.com/JRebirth/JRebirth/blob/93f4fc087b83c73db540333b9686e97b4cec694d/org.jrebirth.af/core/src/main/java/org/jrebirth/af/core/resource/parameter/ParameterBuilder.java#L256-L259 |
xiancloud/xian | xian-zookeeper/xian-curator/xian-curator-recipes/src/main/java/org/apache/curator/framework/recipes/shared/SharedCount.java | SharedCount.trySetCount | public boolean trySetCount(VersionedValue<Integer> previous, int newCount) throws Exception {
"""
Changes the shared count only if its value has not changed since the version specified by
newCount. If the count has changed, the value is not set and this client's view of the
value is updated. i.e. if the count i... | java | public boolean trySetCount(VersionedValue<Integer> previous, int newCount) throws Exception
{
VersionedValue<byte[]> previousCopy = new VersionedValue<byte[]>(previous.getVersion(), toBytes(previous.getValue()));
return sharedValue.trySetValue(previousCopy, toBytes(newCount));
} | [
"public",
"boolean",
"trySetCount",
"(",
"VersionedValue",
"<",
"Integer",
">",
"previous",
",",
"int",
"newCount",
")",
"throws",
"Exception",
"{",
"VersionedValue",
"<",
"byte",
"[",
"]",
">",
"previousCopy",
"=",
"new",
"VersionedValue",
"<",
"byte",
"[",
... | Changes the shared count only if its value has not changed since the version specified by
newCount. If the count has changed, the value is not set and this client's view of the
value is updated. i.e. if the count is not successful you can get the updated value
by calling {@link #getCount()}.
@param newCount the new va... | [
"Changes",
"the",
"shared",
"count",
"only",
"if",
"its",
"value",
"has",
"not",
"changed",
"since",
"the",
"version",
"specified",
"by",
"newCount",
".",
"If",
"the",
"count",
"has",
"changed",
"the",
"value",
"is",
"not",
"set",
"and",
"this",
"client",
... | train | https://github.com/xiancloud/xian/blob/1948e088545553d2745b2c86d8b5a64988bb850e/xian-zookeeper/xian-curator/xian-curator-recipes/src/main/java/org/apache/curator/framework/recipes/shared/SharedCount.java#L108-L112 |
alibaba/Tangram-Android | tangram/src/main/java/com/tmall/wireless/tangram/BaseTangramEngine.java | BaseTangramEngine.insertData | @Deprecated
public void insertData(int position, @Nullable T data) {
"""
Insert original data to Tangram at target position. It cause full screen item's rebinding, be careful.
@param position Target insert position.
@param data Original data with type {@link T}.
"""
Preconditions.checkState(mGrou... | java | @Deprecated
public void insertData(int position, @Nullable T data) {
Preconditions.checkState(mGroupBasicAdapter != null, "Must call bindView() first");
insertData(position, mDataParser.parseGroup(data, this));
} | [
"@",
"Deprecated",
"public",
"void",
"insertData",
"(",
"int",
"position",
",",
"@",
"Nullable",
"T",
"data",
")",
"{",
"Preconditions",
".",
"checkState",
"(",
"mGroupBasicAdapter",
"!=",
"null",
",",
"\"Must call bindView() first\"",
")",
";",
"insertData",
"(... | Insert original data to Tangram at target position. It cause full screen item's rebinding, be careful.
@param position Target insert position.
@param data Original data with type {@link T}. | [
"Insert",
"original",
"data",
"to",
"Tangram",
"at",
"target",
"position",
".",
"It",
"cause",
"full",
"screen",
"item",
"s",
"rebinding",
"be",
"careful",
"."
] | train | https://github.com/alibaba/Tangram-Android/blob/caa57f54e009c8dacd34a2322d5761956ebed321/tangram/src/main/java/com/tmall/wireless/tangram/BaseTangramEngine.java#L345-L350 |
TheHortonMachine/hortonmachine | dbs/src/main/java/org/hortonmachine/dbs/utils/DbsUtilities.java | DbsUtilities.createPolygonFromBounds | public static Polygon createPolygonFromBounds( double minX, double minY, double maxX, double maxY ) {
"""
Create a polygon using boundaries.
@param minX the min x.
@param minY the min y.
@param maxX the max x.
@param maxY the max y.
@return the created geomerty.
"""
Coordinate[] c = new Coordina... | java | public static Polygon createPolygonFromBounds( double minX, double minY, double maxX, double maxY ) {
Coordinate[] c = new Coordinate[]{new Coordinate(minX, minY), new Coordinate(minX, maxY), new Coordinate(maxX, maxY),
new Coordinate(maxX, minY), new Coordinate(minX, minY)};
return gf()... | [
"public",
"static",
"Polygon",
"createPolygonFromBounds",
"(",
"double",
"minX",
",",
"double",
"minY",
",",
"double",
"maxX",
",",
"double",
"maxY",
")",
"{",
"Coordinate",
"[",
"]",
"c",
"=",
"new",
"Coordinate",
"[",
"]",
"{",
"new",
"Coordinate",
"(",
... | Create a polygon using boundaries.
@param minX the min x.
@param minY the min y.
@param maxX the max x.
@param maxY the max y.
@return the created geomerty. | [
"Create",
"a",
"polygon",
"using",
"boundaries",
"."
] | train | https://github.com/TheHortonMachine/hortonmachine/blob/d2b436bbdf951dc1fda56096a42dbc0eae4d35a5/dbs/src/main/java/org/hortonmachine/dbs/utils/DbsUtilities.java#L136-L140 |
OpenLiberty/open-liberty | dev/com.ibm.ws.logging.core/src/com/ibm/ws/ffdc/FFDC.java | FFDC.registerDiagnosticModule | public static int registerDiagnosticModule(DiagnosticModule diagnosticModule, String packageName) {
"""
Register a diagnostic module
@param diagnosticModule
The diagnostic module to be registered
@param packageName
The package name with which to register
@return 0 if the diagnostic module is registered 1 if... | java | public static int registerDiagnosticModule(DiagnosticModule diagnosticModule, String packageName) {
if (modules.containsKey(packageName)) {
return 1;
}
try {
diagnosticModule.init();
} catch (Throwable th) {
// No FFDC code needed - we're reporting th... | [
"public",
"static",
"int",
"registerDiagnosticModule",
"(",
"DiagnosticModule",
"diagnosticModule",
",",
"String",
"packageName",
")",
"{",
"if",
"(",
"modules",
".",
"containsKey",
"(",
"packageName",
")",
")",
"{",
"return",
"1",
";",
"}",
"try",
"{",
"diagn... | Register a diagnostic module
@param diagnosticModule
The diagnostic module to be registered
@param packageName
The package name with which to register
@return 0 if the diagnostic module is registered 1 if the diagnostic
module was already registered 3 if the diagnostic module could
not be initialized | [
"Register",
"a",
"diagnostic",
"module"
] | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.logging.core/src/com/ibm/ws/ffdc/FFDC.java#L37-L52 |
google/error-prone-javac | src/jdk.javadoc/share/classes/com/sun/tools/javadoc/main/ClassDocImpl.java | ClassDocImpl.serializableFields | public FieldDoc[] serializableFields() {
"""
Return the Serializable fields of class.<p>
Return either a list of default fields documented by
<code>serial</code> tag<br>
or return a single <code>FieldDoc</code> for
<code>serialPersistentField</code> member.
There should be a <code>serialField</code> tag for... | java | public FieldDoc[] serializableFields() {
if (serializedForm == null) {
serializedForm = new SerializedForm(env, tsym, this);
}
//### Clone this?
return serializedForm.fields();
} | [
"public",
"FieldDoc",
"[",
"]",
"serializableFields",
"(",
")",
"{",
"if",
"(",
"serializedForm",
"==",
"null",
")",
"{",
"serializedForm",
"=",
"new",
"SerializedForm",
"(",
"env",
",",
"tsym",
",",
"this",
")",
";",
"}",
"//### Clone this?",
"return",
"s... | Return the Serializable fields of class.<p>
Return either a list of default fields documented by
<code>serial</code> tag<br>
or return a single <code>FieldDoc</code> for
<code>serialPersistentField</code> member.
There should be a <code>serialField</code> tag for
each Serializable field defined by an <code>ObjectStrea... | [
"Return",
"the",
"Serializable",
"fields",
"of",
"class",
".",
"<p",
">"
] | train | https://github.com/google/error-prone-javac/blob/a53d069bbdb2c60232ed3811c19b65e41c3e60e0/src/jdk.javadoc/share/classes/com/sun/tools/javadoc/main/ClassDocImpl.java#L1283-L1289 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.