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 |
|---|---|---|---|---|---|---|---|---|---|---|
Azure/azure-sdk-for-java | cosmosdb/resource-manager/v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/implementation/DatabaseAccountsInner.java | DatabaseAccountsInner.beginOnlineRegion | public void beginOnlineRegion(String resourceGroupName, String accountName, String region) {
"""
Online the specified region for the specified Azure Cosmos DB database account.
@param resourceGroupName Name of an Azure resource group.
@param accountName Cosmos DB database account name.
@param region Cosmos DB... | java | public void beginOnlineRegion(String resourceGroupName, String accountName, String region) {
beginOnlineRegionWithServiceResponseAsync(resourceGroupName, accountName, region).toBlocking().single().body();
} | [
"public",
"void",
"beginOnlineRegion",
"(",
"String",
"resourceGroupName",
",",
"String",
"accountName",
",",
"String",
"region",
")",
"{",
"beginOnlineRegionWithServiceResponseAsync",
"(",
"resourceGroupName",
",",
"accountName",
",",
"region",
")",
".",
"toBlocking",
... | Online the specified region for the specified Azure Cosmos DB database account.
@param resourceGroupName Name of an Azure resource group.
@param accountName Cosmos DB database account name.
@param region Cosmos DB region, with spaces between words and each word capitalized.
@throws IllegalArgumentException thrown if p... | [
"Online",
"the",
"specified",
"region",
"for",
"the",
"specified",
"Azure",
"Cosmos",
"DB",
"database",
"account",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/cosmosdb/resource-manager/v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/implementation/DatabaseAccountsInner.java#L1533-L1535 |
EdwardRaff/JSAT | JSAT/src/jsat/linear/Matrix.java | Matrix.isSymmetric | public static boolean isSymmetric(Matrix A, double eps) {
"""
Checks to see if the given input is approximately symmetric. Rounding
errors may cause the computation of a matrix to come out non symmetric,
where |a[i,h] - a[j, i]| < eps. Despite these errors, it may be
preferred to treat the matrix as perfectl... | java | public static boolean isSymmetric(Matrix A, double eps)
{
if(!A.isSquare())
return false;
for(int i = 0; i < A.rows(); i++)
for(int j = i+1; j < A.cols(); j++)
if( Math.abs(A.get(i, j)-A.get(j, i)) > eps)
return false;
return true;
... | [
"public",
"static",
"boolean",
"isSymmetric",
"(",
"Matrix",
"A",
",",
"double",
"eps",
")",
"{",
"if",
"(",
"!",
"A",
".",
"isSquare",
"(",
")",
")",
"return",
"false",
";",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
"<",
"A",
".",
"rows",
"(... | Checks to see if the given input is approximately symmetric. Rounding
errors may cause the computation of a matrix to come out non symmetric,
where |a[i,h] - a[j, i]| < eps. Despite these errors, it may be
preferred to treat the matrix as perfectly symmetric regardless.
@param A the input matrix
@param eps the maxi... | [
"Checks",
"to",
"see",
"if",
"the",
"given",
"input",
"is",
"approximately",
"symmetric",
".",
"Rounding",
"errors",
"may",
"cause",
"the",
"computation",
"of",
"a",
"matrix",
"to",
"come",
"out",
"non",
"symmetric",
"where",
"|a",
"[",
"i",
"h",
"]",
"-... | train | https://github.com/EdwardRaff/JSAT/blob/0ff53b7b39684b2379cc1da522f5b3a954b15cfb/JSAT/src/jsat/linear/Matrix.java#L1074-L1083 |
wildfly/wildfly-core | jmx/src/main/java/org/jboss/as/jmx/model/ObjectNameAddressUtil.java | ObjectNameAddressUtil.toPathAddress | static PathAddress toPathAddress(String domain, ImmutableManagementResourceRegistration registry, ObjectName name) {
"""
Straight conversion from an ObjectName to a PathAddress.
There may not necessarily be a Resource at this path address (if that correspond to a pattern) but it must
match a model in the regis... | java | static PathAddress toPathAddress(String domain, ImmutableManagementResourceRegistration registry, ObjectName name) {
if (!name.getDomain().equals(domain)) {
return PathAddress.EMPTY_ADDRESS;
}
if (name.equals(ModelControllerMBeanHelper.createRootObjectName(domain))) {
ret... | [
"static",
"PathAddress",
"toPathAddress",
"(",
"String",
"domain",
",",
"ImmutableManagementResourceRegistration",
"registry",
",",
"ObjectName",
"name",
")",
"{",
"if",
"(",
"!",
"name",
".",
"getDomain",
"(",
")",
".",
"equals",
"(",
"domain",
")",
")",
"{",... | Straight conversion from an ObjectName to a PathAddress.
There may not necessarily be a Resource at this path address (if that correspond to a pattern) but it must
match a model in the registry.
@param domain the name of the caller's JMX domain
@param registry the root resource for the management model
@param name th... | [
"Straight",
"conversion",
"from",
"an",
"ObjectName",
"to",
"a",
"PathAddress",
"."
] | train | https://github.com/wildfly/wildfly-core/blob/cfaf0479dcbb2d320a44c5374b93b944ec39fade/jmx/src/main/java/org/jboss/as/jmx/model/ObjectNameAddressUtil.java#L238-L247 |
projectodd/wunderboss-release | web/src/main/java/org/projectodd/wunderboss/web/async/OutputStreamHttpChannel.java | OutputStreamHttpChannel.send | @Override
public synchronized boolean send(final Object message,
final boolean shouldClose,
final OnComplete onComplete) throws IOException {
"""
message must be String or byte[]. Allowing Object makes life easier from clojure
"""
... | java | @Override
public synchronized boolean send(final Object message,
final boolean shouldClose,
final OnComplete onComplete) throws IOException {
if (!isOpen()) {
return false;
}
this.sendQueued = true;
... | [
"@",
"Override",
"public",
"synchronized",
"boolean",
"send",
"(",
"final",
"Object",
"message",
",",
"final",
"boolean",
"shouldClose",
",",
"final",
"OnComplete",
"onComplete",
")",
"throws",
"IOException",
"{",
"if",
"(",
"!",
"isOpen",
"(",
")",
")",
"{"... | message must be String or byte[]. Allowing Object makes life easier from clojure | [
"message",
"must",
"be",
"String",
"or",
"byte",
"[]",
".",
"Allowing",
"Object",
"makes",
"life",
"easier",
"from",
"clojure"
] | train | https://github.com/projectodd/wunderboss-release/blob/f67c68e80c5798169e3a9b2015e278239dbf005d/web/src/main/java/org/projectodd/wunderboss/web/async/OutputStreamHttpChannel.java#L93-L117 |
Esri/geometry-api-java | src/main/java/com/esri/core/geometry/Transformation2D.java | Transformation2D.flipY | public void flipY(double y0, double y1) {
"""
Flips the transformation around the Y axis.
@param y0
The Y coordinate to flip.
@param y1
The Y coordinate to flip to.
"""
yx = -yx;
yy = -yy;
yd = y0 + y1 - yd;
} | java | public void flipY(double y0, double y1) {
yx = -yx;
yy = -yy;
yd = y0 + y1 - yd;
} | [
"public",
"void",
"flipY",
"(",
"double",
"y0",
",",
"double",
"y1",
")",
"{",
"yx",
"=",
"-",
"yx",
";",
"yy",
"=",
"-",
"yy",
";",
"yd",
"=",
"y0",
"+",
"y1",
"-",
"yd",
";",
"}"
] | Flips the transformation around the Y axis.
@param y0
The Y coordinate to flip.
@param y1
The Y coordinate to flip to. | [
"Flips",
"the",
"transformation",
"around",
"the",
"Y",
"axis",
"."
] | train | https://github.com/Esri/geometry-api-java/blob/494da8ec953d76e7c6072afbc081abfe48ff07cf/src/main/java/com/esri/core/geometry/Transformation2D.java#L812-L816 |
hatunet/spring-data-mybatis | spring-data-mybatis/src/main/java/org/springframework/data/mybatis/dialect/pagination/AbstractLimitHandler.java | AbstractLimitHandler.bindLimitParameters | protected final int bindLimitParameters(RowSelection selection, PreparedStatement statement, int index)
throws SQLException {
"""
Default implementation of binding parameter values needed by the LIMIT clause.
@param selection the selection criteria for rows.
@param statement Statement to which to bind limit... | java | protected final int bindLimitParameters(RowSelection selection, PreparedStatement statement, int index)
throws SQLException {
if (!supportsVariableLimit() || !LimitHelper.hasMaxRows(selection)) {
return 0;
}
final int firstRow = convertToFirstRowValue(LimitHelper.getFirstRow(selection));
final int lastRow... | [
"protected",
"final",
"int",
"bindLimitParameters",
"(",
"RowSelection",
"selection",
",",
"PreparedStatement",
"statement",
",",
"int",
"index",
")",
"throws",
"SQLException",
"{",
"if",
"(",
"!",
"supportsVariableLimit",
"(",
")",
"||",
"!",
"LimitHelper",
".",
... | Default implementation of binding parameter values needed by the LIMIT clause.
@param selection the selection criteria for rows.
@param statement Statement to which to bind limit parameter values.
@param index Index from which to start binding.
@return The number of parameter values bound.
@throws SQLException Indicat... | [
"Default",
"implementation",
"of",
"binding",
"parameter",
"values",
"needed",
"by",
"the",
"LIMIT",
"clause",
"."
] | train | https://github.com/hatunet/spring-data-mybatis/blob/ee6316f2c29f45e8e9ef1538957a29c21c89055f/spring-data-mybatis/src/main/java/org/springframework/data/mybatis/dialect/pagination/AbstractLimitHandler.java#L123-L137 |
Impetus/Kundera | src/kundera-couchdb/src/main/java/com/impetus/client/couchdb/CouchDBClient.java | CouchDBClient.getResponse | private HttpResponse getResponse(StringBuilder q, String _id) throws URISyntaxException, IOException,
ClientProtocolException {
"""
Gets the response.
@param q
the q
@param _id
the _id
@return the response
@throws URISyntaxException
the URI syntax exception
@throws IOException
Signals that a... | java | private HttpResponse getResponse(StringBuilder q, String _id) throws URISyntaxException, IOException,
ClientProtocolException
{
URI uri = new URI(CouchDBConstants.PROTOCOL, null, httpHost.getHostName(), httpHost.getPort(), _id,
q.toString(), null);
HttpGet get = new HttpG... | [
"private",
"HttpResponse",
"getResponse",
"(",
"StringBuilder",
"q",
",",
"String",
"_id",
")",
"throws",
"URISyntaxException",
",",
"IOException",
",",
"ClientProtocolException",
"{",
"URI",
"uri",
"=",
"new",
"URI",
"(",
"CouchDBConstants",
".",
"PROTOCOL",
",",... | Gets the response.
@param q
the q
@param _id
the _id
@return the response
@throws URISyntaxException
the URI syntax exception
@throws IOException
Signals that an I/O exception has occurred.
@throws ClientProtocolException
the client protocol exception | [
"Gets",
"the",
"response",
"."
] | train | https://github.com/Impetus/Kundera/blob/268958ab1ec09d14ec4d9184f0c8ded7a9158908/src/kundera-couchdb/src/main/java/com/impetus/client/couchdb/CouchDBClient.java#L1096-L1104 |
OpenLiberty/open-liberty | dev/com.ibm.ws.monitor/src/com/ibm/wsspi/pmi/factory/StatsFactory.java | StatsFactory.createStatsGroup | public static StatsGroup createStatsGroup(String groupName, String statsTemplate, StatsGroup parentGroup, ObjectName mBean, StatisticActions actionLsnr)
throws StatsFactoryException {
"""
Create a StatsGroup using the Stats template and add to the PMI tree under the specified parent group.
Thi... | java | public static StatsGroup createStatsGroup(String groupName, String statsTemplate, StatsGroup parentGroup, ObjectName mBean, StatisticActions actionLsnr)
throws StatsFactoryException {
if (tc.isEntryEnabled())
Tr.entry(tc, new StringBuffer("createStatsGroup:name=").append(groupNam... | [
"public",
"static",
"StatsGroup",
"createStatsGroup",
"(",
"String",
"groupName",
",",
"String",
"statsTemplate",
",",
"StatsGroup",
"parentGroup",
",",
"ObjectName",
"mBean",
",",
"StatisticActions",
"actionLsnr",
")",
"throws",
"StatsFactoryException",
"{",
"if",
"(... | Create a StatsGroup using the Stats template and add to the PMI tree under the specified parent group.
This method will associate the MBean provided by the caller to the Stats group.
@param groupName name of the group
@param statsTemplate location of the Stats template XML file
@param parentGroup parent Stats group
@p... | [
"Create",
"a",
"StatsGroup",
"using",
"the",
"Stats",
"template",
"and",
"add",
"to",
"the",
"PMI",
"tree",
"under",
"the",
"specified",
"parent",
"group",
".",
"This",
"method",
"will",
"associate",
"the",
"MBean",
"provided",
"by",
"the",
"caller",
"to",
... | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.monitor/src/com/ibm/wsspi/pmi/factory/StatsFactory.java#L147-L172 |
looly/hutool | hutool-core/src/main/java/cn/hutool/core/lang/Validator.java | Validator.validateUrl | public static <T extends CharSequence> T validateUrl(T value, String errorMsg) throws ValidateException {
"""
验证是否为URL
@param <T> 字符串类型
@param value 值
@param errorMsg 验证错误的信息
@return 验证后的值
@throws ValidateException 验证异常
"""
if (false == isUrl(value)) {
throw new ValidateException(errorMsg);
}
... | java | public static <T extends CharSequence> T validateUrl(T value, String errorMsg) throws ValidateException {
if (false == isUrl(value)) {
throw new ValidateException(errorMsg);
}
return value;
} | [
"public",
"static",
"<",
"T",
"extends",
"CharSequence",
">",
"T",
"validateUrl",
"(",
"T",
"value",
",",
"String",
"errorMsg",
")",
"throws",
"ValidateException",
"{",
"if",
"(",
"false",
"==",
"isUrl",
"(",
"value",
")",
")",
"{",
"throw",
"new",
"Vali... | 验证是否为URL
@param <T> 字符串类型
@param value 值
@param errorMsg 验证错误的信息
@return 验证后的值
@throws ValidateException 验证异常 | [
"验证是否为URL"
] | train | https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-core/src/main/java/cn/hutool/core/lang/Validator.java#L922-L927 |
deeplearning4j/deeplearning4j | nd4j/nd4j-backends/nd4j-api-parent/nd4j-api/src/main/java/org/nd4j/evaluation/curves/PrecisionRecallCurve.java | PrecisionRecallCurve.getPointAtThreshold | public Point getPointAtThreshold(double threshold) {
"""
Get the point (index, threshold, precision, recall) at the given threshold.<br>
Note that if the threshold is not found exactly, the next highest threshold exceeding the requested threshold
is returned
@param threshold Threshold to get the point for
@r... | java | public Point getPointAtThreshold(double threshold) {
//Return (closest) point number, precision, recall, whether it's interpolated or not
//Binary search to find closest threshold
int idx = Arrays.binarySearch(this.threshold, threshold);
if (idx < 0) {
//Not found (usual c... | [
"public",
"Point",
"getPointAtThreshold",
"(",
"double",
"threshold",
")",
"{",
"//Return (closest) point number, precision, recall, whether it's interpolated or not",
"//Binary search to find closest threshold",
"int",
"idx",
"=",
"Arrays",
".",
"binarySearch",
"(",
"this",
".",... | Get the point (index, threshold, precision, recall) at the given threshold.<br>
Note that if the threshold is not found exactly, the next highest threshold exceeding the requested threshold
is returned
@param threshold Threshold to get the point for
@return point (index, threshold, precision, recall) at the given thre... | [
"Get",
"the",
"point",
"(",
"index",
"threshold",
"precision",
"recall",
")",
"at",
"the",
"given",
"threshold",
".",
"<br",
">",
"Note",
"that",
"if",
"the",
"threshold",
"is",
"not",
"found",
"exactly",
"the",
"next",
"highest",
"threshold",
"exceeding",
... | train | https://github.com/deeplearning4j/deeplearning4j/blob/effce52f2afd7eeb53c5bcca699fcd90bd06822f/nd4j/nd4j-backends/nd4j-api-parent/nd4j-api/src/main/java/org/nd4j/evaluation/curves/PrecisionRecallCurve.java#L126-L152 |
fozziethebeat/S-Space | src/main/java/edu/ucla/sspace/text/IteratorFactory.java | IteratorFactory.tokenizeOrderedWithReplacement | public static Iterator<String> tokenizeOrderedWithReplacement(
BufferedReader reader) {
"""
Wraps an iterator returned by {@link #tokenizeOrdered(String)
tokenizeOrdered} to also include term replacement of tokens. Terms will
be replaced based on a mapping provided through the system configuration.
... | java | public static Iterator<String> tokenizeOrderedWithReplacement(
BufferedReader reader) {
Iterator<String> baseIterator = tokenizeOrdered(reader);
return (replacementMap == null)
? baseIterator
: new WordReplacementIterator(baseIterator, replacementMap);
} | [
"public",
"static",
"Iterator",
"<",
"String",
">",
"tokenizeOrderedWithReplacement",
"(",
"BufferedReader",
"reader",
")",
"{",
"Iterator",
"<",
"String",
">",
"baseIterator",
"=",
"tokenizeOrdered",
"(",
"reader",
")",
";",
"return",
"(",
"replacementMap",
"==",... | Wraps an iterator returned by {@link #tokenizeOrdered(String)
tokenizeOrdered} to also include term replacement of tokens. Terms will
be replaced based on a mapping provided through the system configuration.
@param reader A reader whose contents are to be tokenized.
@return An iterator over all the tokens in the rea... | [
"Wraps",
"an",
"iterator",
"returned",
"by",
"{",
"@link",
"#tokenizeOrdered",
"(",
"String",
")",
"tokenizeOrdered",
"}",
"to",
"also",
"include",
"term",
"replacement",
"of",
"tokens",
".",
"Terms",
"will",
"be",
"replaced",
"based",
"on",
"a",
"mapping",
... | train | https://github.com/fozziethebeat/S-Space/blob/a608102737dfd3d59038a9ead33fe60356bc6029/src/main/java/edu/ucla/sspace/text/IteratorFactory.java#L403-L409 |
jenkinsci/artifactory-plugin | src/main/java/org/jfrog/hudson/util/CredentialManager.java | CredentialManager.getPreferredResolver | public static CredentialsConfig getPreferredResolver(ResolverOverrider resolverOverrider, ArtifactoryServer server) {
"""
Decides and returns the preferred resolver credentials to use from this builder settings and selected server
Override priority:
1) Job override resolver
2) Plugin manage override resolver
3... | java | public static CredentialsConfig getPreferredResolver(ResolverOverrider resolverOverrider, ArtifactoryServer server) {
if (resolverOverrider != null && resolverOverrider.isOverridingDefaultResolver()) {
CredentialsConfig resolverCredentialsConfig = resolverOverrider.getResolverCredentialsConfig();
... | [
"public",
"static",
"CredentialsConfig",
"getPreferredResolver",
"(",
"ResolverOverrider",
"resolverOverrider",
",",
"ArtifactoryServer",
"server",
")",
"{",
"if",
"(",
"resolverOverrider",
"!=",
"null",
"&&",
"resolverOverrider",
".",
"isOverridingDefaultResolver",
"(",
... | Decides and returns the preferred resolver credentials to use from this builder settings and selected server
Override priority:
1) Job override resolver
2) Plugin manage override resolver
3) Plugin manage general
@param resolverOverrider Resolve-overriding capable builder
@param server Selected Artifactory ... | [
"Decides",
"and",
"returns",
"the",
"preferred",
"resolver",
"credentials",
"to",
"use",
"from",
"this",
"builder",
"settings",
"and",
"selected",
"server",
"Override",
"priority",
":",
"1",
")",
"Job",
"override",
"resolver",
"2",
")",
"Plugin",
"manage",
"ov... | train | https://github.com/jenkinsci/artifactory-plugin/blob/f5fcfff6a5a50be5374813e49d1fe3aaf6422333/src/main/java/org/jfrog/hudson/util/CredentialManager.java#L78-L87 |
Harium/keel | src/main/java/com/harium/keel/catalano/math/function/Beta.java | Beta.Log | public static double Log(double a, double b) {
"""
Natural logarithm of the Beta function.
@param a Value.
@param b Value.
@return Result.
"""
return Gamma.Log(a) + Gamma.Log(b) - Gamma.Log(a + b);
} | java | public static double Log(double a, double b) {
return Gamma.Log(a) + Gamma.Log(b) - Gamma.Log(a + b);
} | [
"public",
"static",
"double",
"Log",
"(",
"double",
"a",
",",
"double",
"b",
")",
"{",
"return",
"Gamma",
".",
"Log",
"(",
"a",
")",
"+",
"Gamma",
".",
"Log",
"(",
"b",
")",
"-",
"Gamma",
".",
"Log",
"(",
"a",
"+",
"b",
")",
";",
"}"
] | Natural logarithm of the Beta function.
@param a Value.
@param b Value.
@return Result. | [
"Natural",
"logarithm",
"of",
"the",
"Beta",
"function",
"."
] | train | https://github.com/Harium/keel/blob/0369ae674f9e664bccc5f9e161ae7e7a3b949a1e/src/main/java/com/harium/keel/catalano/math/function/Beta.java#L60-L62 |
redkale/redkale | src/org/redkale/util/Utility.java | Utility.createAsyncHandler | public static <V> CompletionHandler<V, Void> createAsyncHandler(final Consumer<V> success, final Consumer<Throwable> fail) {
"""
创建没有附件对象的 CompletionHandler 对象
@param <V> 结果对象的泛型
@param success 成功的回调函数
@param fail 失败的回调函数
@return CompletionHandler
"""
return new CompletionHandler<V, Voi... | java | public static <V> CompletionHandler<V, Void> createAsyncHandler(final Consumer<V> success, final Consumer<Throwable> fail) {
return new CompletionHandler<V, Void>() {
@Override
public void completed(V result, Void attachment) {
if (success != null) success.accept(resu... | [
"public",
"static",
"<",
"V",
">",
"CompletionHandler",
"<",
"V",
",",
"Void",
">",
"createAsyncHandler",
"(",
"final",
"Consumer",
"<",
"V",
">",
"success",
",",
"final",
"Consumer",
"<",
"Throwable",
">",
"fail",
")",
"{",
"return",
"new",
"CompletionHan... | 创建没有附件对象的 CompletionHandler 对象
@param <V> 结果对象的泛型
@param success 成功的回调函数
@param fail 失败的回调函数
@return CompletionHandler | [
"创建没有附件对象的",
"CompletionHandler",
"对象"
] | train | https://github.com/redkale/redkale/blob/ea5169b5c5ea7412fd762331c0c497165832e901/src/org/redkale/util/Utility.java#L931-L943 |
LMAX-Exchange/disruptor | src/main/java/com/lmax/disruptor/dsl/Disruptor.java | Disruptor.publishEvent | public <A> void publishEvent(final EventTranslatorOneArg<T, A> eventTranslator, final A arg) {
"""
Publish an event to the ring buffer.
@param <A> Class of the user supplied argument.
@param eventTranslator the translator that will load data into the event.
@param arg A single argument to load int... | java | public <A> void publishEvent(final EventTranslatorOneArg<T, A> eventTranslator, final A arg)
{
ringBuffer.publishEvent(eventTranslator, arg);
} | [
"public",
"<",
"A",
">",
"void",
"publishEvent",
"(",
"final",
"EventTranslatorOneArg",
"<",
"T",
",",
"A",
">",
"eventTranslator",
",",
"final",
"A",
"arg",
")",
"{",
"ringBuffer",
".",
"publishEvent",
"(",
"eventTranslator",
",",
"arg",
")",
";",
"}"
] | Publish an event to the ring buffer.
@param <A> Class of the user supplied argument.
@param eventTranslator the translator that will load data into the event.
@param arg A single argument to load into the event | [
"Publish",
"an",
"event",
"to",
"the",
"ring",
"buffer",
"."
] | train | https://github.com/LMAX-Exchange/disruptor/blob/4266d00c5250190313446fdd7c8aa7a4edb5c818/src/main/java/com/lmax/disruptor/dsl/Disruptor.java#L341-L344 |
groupon/odo | client/src/main/java/com/groupon/odo/client/PathValueClient.java | PathValueClient.getPathFromEndpoint | public JSONObject getPathFromEndpoint(String pathValue, String requestType) throws Exception {
"""
Retrieves the path using the endpoint value
@param pathValue - path (endpoint) value
@param requestType - "GET", "POST", etc
@return Path or null
@throws Exception exception
"""
int type = getReques... | java | public JSONObject getPathFromEndpoint(String pathValue, String requestType) throws Exception {
int type = getRequestTypeFromString(requestType);
String url = BASE_PATH;
JSONObject response = new JSONObject(doGet(url, null));
JSONArray paths = response.getJSONArray("paths");
for (... | [
"public",
"JSONObject",
"getPathFromEndpoint",
"(",
"String",
"pathValue",
",",
"String",
"requestType",
")",
"throws",
"Exception",
"{",
"int",
"type",
"=",
"getRequestTypeFromString",
"(",
"requestType",
")",
";",
"String",
"url",
"=",
"BASE_PATH",
";",
"JSONObj... | Retrieves the path using the endpoint value
@param pathValue - path (endpoint) value
@param requestType - "GET", "POST", etc
@return Path or null
@throws Exception exception | [
"Retrieves",
"the",
"path",
"using",
"the",
"endpoint",
"value"
] | train | https://github.com/groupon/odo/blob/3bae43d5eca8ace036775e5b2d3ed9af1a9ff9b1/client/src/main/java/com/groupon/odo/client/PathValueClient.java#L43-L55 |
apache/incubator-druid | core/src/main/java/org/apache/druid/java/util/common/StreamUtils.java | StreamUtils.copyAndClose | public static long copyAndClose(InputStream is, OutputStream os) throws IOException {
"""
Copy from `is` to `os` and close the streams regardless of the result.
@param is The `InputStream` to copy results from. It is closed
@param os The `OutputStream` to copy results to. It is closed
@return The count of b... | java | public static long copyAndClose(InputStream is, OutputStream os) throws IOException
{
try {
final long retval = ByteStreams.copy(is, os);
// Workarround for http://hg.openjdk.java.net/jdk8/jdk8/jdk/rev/759aa847dcaf
os.flush();
return retval;
}
finally {
is.close();
os.c... | [
"public",
"static",
"long",
"copyAndClose",
"(",
"InputStream",
"is",
",",
"OutputStream",
"os",
")",
"throws",
"IOException",
"{",
"try",
"{",
"final",
"long",
"retval",
"=",
"ByteStreams",
".",
"copy",
"(",
"is",
",",
"os",
")",
";",
"// Workarround for ht... | Copy from `is` to `os` and close the streams regardless of the result.
@param is The `InputStream` to copy results from. It is closed
@param os The `OutputStream` to copy results to. It is closed
@return The count of bytes written to `os`
@throws IOException | [
"Copy",
"from",
"is",
"to",
"os",
"and",
"close",
"the",
"streams",
"regardless",
"of",
"the",
"result",
"."
] | train | https://github.com/apache/incubator-druid/blob/f776b9408962b9006cfcfe4d6c1794751972cc8e/core/src/main/java/org/apache/druid/java/util/common/StreamUtils.java#L74-L86 |
mongodb/stitch-android-sdk | core/services/mongodb-remote/src/main/java/com/mongodb/stitch/core/services/mongodb/remote/sync/internal/ChangeEvents.java | ChangeEvents.changeEventForLocalUpdate | static ChangeEvent<BsonDocument> changeEventForLocalUpdate(
final MongoNamespace namespace,
final BsonValue documentId,
final UpdateDescription update,
final BsonDocument fullDocumentAfterUpdate,
final boolean writePending
) {
"""
Generates a change event for a local update of a doc... | java | static ChangeEvent<BsonDocument> changeEventForLocalUpdate(
final MongoNamespace namespace,
final BsonValue documentId,
final UpdateDescription update,
final BsonDocument fullDocumentAfterUpdate,
final boolean writePending
) {
return new ChangeEvent<>(
new BsonDocument(),
... | [
"static",
"ChangeEvent",
"<",
"BsonDocument",
">",
"changeEventForLocalUpdate",
"(",
"final",
"MongoNamespace",
"namespace",
",",
"final",
"BsonValue",
"documentId",
",",
"final",
"UpdateDescription",
"update",
",",
"final",
"BsonDocument",
"fullDocumentAfterUpdate",
",",... | Generates a change event for a local update of a document in the given namespace referring
to the given document _id.
@param namespace the namespace where the document was inserted.
@param documentId the _id of the document that was updated.
@param update the update specifier.
@return a change event for a local update... | [
"Generates",
"a",
"change",
"event",
"for",
"a",
"local",
"update",
"of",
"a",
"document",
"in",
"the",
"given",
"namespace",
"referring",
"to",
"the",
"given",
"document",
"_id",
"."
] | train | https://github.com/mongodb/stitch-android-sdk/blob/159b9334b1f1a827285544be5ee20cdf7b04e4cc/core/services/mongodb-remote/src/main/java/com/mongodb/stitch/core/services/mongodb/remote/sync/internal/ChangeEvents.java#L66-L81 |
pravega/pravega | controller/src/main/java/io/pravega/controller/server/SegmentHelper.java | SegmentHelper.readTableKeys | public CompletableFuture<TableSegment.IteratorItem<TableKey<byte[]>>> readTableKeys(final String tableName,
final int suggestedKeyCount,
final IteratorS... | java | public CompletableFuture<TableSegment.IteratorItem<TableKey<byte[]>>> readTableKeys(final String tableName,
final int suggestedKeyCount,
final IteratorS... | [
"public",
"CompletableFuture",
"<",
"TableSegment",
".",
"IteratorItem",
"<",
"TableKey",
"<",
"byte",
"[",
"]",
">",
">",
">",
"readTableKeys",
"(",
"final",
"String",
"tableName",
",",
"final",
"int",
"suggestedKeyCount",
",",
"final",
"IteratorState",
"state"... | The method sends a WireCommand to iterate over table keys.
@param tableName Qualified table name.
@param suggestedKeyCount Suggested number of {@link TableKey}s to be returned by the SegmentStore.
@param state Last known state of the iterator.
@param delegationToken The token to be presented to the segmentstore.
@param... | [
"The",
"method",
"sends",
"a",
"WireCommand",
"to",
"iterate",
"over",
"table",
"keys",
"."
] | train | https://github.com/pravega/pravega/blob/6e24df7470669b3956a07018f52b2c6b3c2a3503/controller/src/main/java/io/pravega/controller/server/SegmentHelper.java#L1022-L1083 |
dustin/java-memcached-client | src/main/java/net/spy/memcached/compat/log/AbstractLogger.java | AbstractLogger.fatal | public void fatal(String message, Object... args) {
"""
Log a formatted message at debug level.
@param message the message to log
@param args the arguments for that message
"""
fatal(String.format(message, args), getThrowable(args));
} | java | public void fatal(String message, Object... args) {
fatal(String.format(message, args), getThrowable(args));
} | [
"public",
"void",
"fatal",
"(",
"String",
"message",
",",
"Object",
"...",
"args",
")",
"{",
"fatal",
"(",
"String",
".",
"format",
"(",
"message",
",",
"args",
")",
",",
"getThrowable",
"(",
"args",
")",
")",
";",
"}"
] | Log a formatted message at debug level.
@param message the message to log
@param args the arguments for that message | [
"Log",
"a",
"formatted",
"message",
"at",
"debug",
"level",
"."
] | train | https://github.com/dustin/java-memcached-client/blob/c232307ad8e0c7ccc926e495dd7d5aad2d713318/src/main/java/net/spy/memcached/compat/log/AbstractLogger.java#L248-L250 |
wisdom-framework/wisdom-jcr | wisdom-modeshape-web-jcr-rest/src/main/java/org/modeshape/web/jcr/rest/handler/RestNodeTypeHandlerImpl.java | RestNodeTypeHandlerImpl.getNodeType | @Override
public RestNodeType getNodeType(Request request,
String repositoryName,
String workspaceName,
String nodeTypeName) throws RepositoryException {
"""
Retrieves the {@link RestNodeType rest node t... | java | @Override
public RestNodeType getNodeType(Request request,
String repositoryName,
String workspaceName,
String nodeTypeName) throws RepositoryException {
Session session = getSession(request, reposito... | [
"@",
"Override",
"public",
"RestNodeType",
"getNodeType",
"(",
"Request",
"request",
",",
"String",
"repositoryName",
",",
"String",
"workspaceName",
",",
"String",
"nodeTypeName",
")",
"throws",
"RepositoryException",
"{",
"Session",
"session",
"=",
"getSession",
"... | Retrieves the {@link RestNodeType rest node type representation} of the {@link javax.jcr.nodetype.NodeType} with the given name.
@param request a non-null {@link org.wisdom.api.http.Request}
@param repositoryName a non-null, URL encoded {@link String} representing the name of a repository
@param workspaceName ... | [
"Retrieves",
"the",
"{",
"@link",
"RestNodeType",
"rest",
"node",
"type",
"representation",
"}",
"of",
"the",
"{",
"@link",
"javax",
".",
"jcr",
".",
"nodetype",
".",
"NodeType",
"}",
"with",
"the",
"given",
"name",
"."
] | train | https://github.com/wisdom-framework/wisdom-jcr/blob/2711383dde2239a19b90c226b3fd2aecab5715e4/wisdom-modeshape-web-jcr-rest/src/main/java/org/modeshape/web/jcr/rest/handler/RestNodeTypeHandlerImpl.java#L83-L92 |
jmeetsma/Iglu-Common | src/main/java/org/ijsberg/iglu/database/component/StandardConnectionPool.java | StandardConnectionPool.obtainConnection | ConnectionWrapper obtainConnection() {
"""
To be invoked by ConnectionWrapper and StandardConnectionPool only only
@return A database connection (wrapped in a class that implements Connection as well)
"""
synchronized (allConnections) {
//fails if connection pool not started
if (!availableConnection... | java | ConnectionWrapper obtainConnection() {
synchronized (allConnections) {
//fails if connection pool not started
if (!availableConnections.isEmpty()) {
//retrieve and remove first connection from list
// since released connections are added to the back, connections will rotate
ConnectionWrapper connWr... | [
"ConnectionWrapper",
"obtainConnection",
"(",
")",
"{",
"synchronized",
"(",
"allConnections",
")",
"{",
"//fails if connection pool not started",
"if",
"(",
"!",
"availableConnections",
".",
"isEmpty",
"(",
")",
")",
"{",
"//retrieve and remove first connection from list",... | To be invoked by ConnectionWrapper and StandardConnectionPool only only
@return A database connection (wrapped in a class that implements Connection as well) | [
"To",
"be",
"invoked",
"by",
"ConnectionWrapper",
"and",
"StandardConnectionPool",
"only",
"only"
] | train | https://github.com/jmeetsma/Iglu-Common/blob/0fb0885775b576209ff1b5a0f67e3c25a99a6420/src/main/java/org/ijsberg/iglu/database/component/StandardConnectionPool.java#L440-L478 |
moparisthebest/beehive | beehive-netui-tags/src/main/java/org/apache/beehive/netui/tags/html/FileUpload.java | FileUpload.setAttribute | public void setAttribute(String name, String value, String facet)
throws JspException {
"""
Base support for the attribute tag. This is overridden to prevent setting the <code>type</code>
attribute.
@param name The name of the attribute. This value may not be null or the empty string.
@param valu... | java | public void setAttribute(String name, String value, String facet)
throws JspException
{
if (name != null) {
if (name.equals(TYPE)) {
String s = Bundle.getString("Tags_AttributeMayNotBeSet", new Object[]{name});
registerTagError(s, null);
}
... | [
"public",
"void",
"setAttribute",
"(",
"String",
"name",
",",
"String",
"value",
",",
"String",
"facet",
")",
"throws",
"JspException",
"{",
"if",
"(",
"name",
"!=",
"null",
")",
"{",
"if",
"(",
"name",
".",
"equals",
"(",
"TYPE",
")",
")",
"{",
"Str... | Base support for the attribute tag. This is overridden to prevent setting the <code>type</code>
attribute.
@param name The name of the attribute. This value may not be null or the empty string.
@param value The value of the attribute. This may contain an expression.
@param facet The name of a facet to which the att... | [
"Base",
"support",
"for",
"the",
"attribute",
"tag",
".",
"This",
"is",
"overridden",
"to",
"prevent",
"setting",
"the",
"<code",
">",
"type<",
"/",
"code",
">",
"attribute",
"."
] | train | https://github.com/moparisthebest/beehive/blob/4246a0cc40ce3c05f1a02c2da2653ac622703d77/beehive-netui-tags/src/main/java/org/apache/beehive/netui/tags/html/FileUpload.java#L133-L147 |
cdk/cdk | tool/group/src/main/java/org/openscience/cdk/group/PermutationGroup.java | PermutationGroup.makeSymN | public static PermutationGroup makeSymN(int size) {
"""
Make the symmetric group Sym(N) for N. That is, a group of permutations
that represents _all_ permutations of size N.
@param size the size of the permutation
@return a group for all permutations of N
"""
List<Permutation> generators = new Arr... | java | public static PermutationGroup makeSymN(int size) {
List<Permutation> generators = new ArrayList<Permutation>();
// p1 is (0, 1)
int[] p1 = new int[size];
p1[0] = 1;
p1[1] = 0;
for (int i = 2; i < size; i++) {
p1[i] = i;
}
// p2 is (1, 2, ...... | [
"public",
"static",
"PermutationGroup",
"makeSymN",
"(",
"int",
"size",
")",
"{",
"List",
"<",
"Permutation",
">",
"generators",
"=",
"new",
"ArrayList",
"<",
"Permutation",
">",
"(",
")",
";",
"// p1 is (0, 1)",
"int",
"[",
"]",
"p1",
"=",
"new",
"int",
... | Make the symmetric group Sym(N) for N. That is, a group of permutations
that represents _all_ permutations of size N.
@param size the size of the permutation
@return a group for all permutations of N | [
"Make",
"the",
"symmetric",
"group",
"Sym",
"(",
"N",
")",
"for",
"N",
".",
"That",
"is",
"a",
"group",
"of",
"permutations",
"that",
"represents",
"_all_",
"permutations",
"of",
"size",
"N",
"."
] | train | https://github.com/cdk/cdk/blob/c3d0f16502bf08df50365fee392e11d7c9856657/tool/group/src/main/java/org/openscience/cdk/group/PermutationGroup.java#L159-L182 |
jbundle/jbundle | base/message/trx/src/main/java/org/jbundle/base/message/trx/message/external/convert/BaseConvertToNative.java | BaseConvertToNative.setPayloadProperties | public void setPayloadProperties(BaseMessage message, Object msg) {
"""
Move the standard payload properties from the message to the xml.
@param message
@param msg
"""
MessageDataDesc messageDataDesc = message.getMessageDataDesc(null); // Top level only
if (messageDataDesc != null)
{
... | java | public void setPayloadProperties(BaseMessage message, Object msg)
{
MessageDataDesc messageDataDesc = message.getMessageDataDesc(null); // Top level only
if (messageDataDesc != null)
{
Map<String,Class<?>> mapPropertyNames = messageDataDesc.getPayloadPropertyNames(null);
... | [
"public",
"void",
"setPayloadProperties",
"(",
"BaseMessage",
"message",
",",
"Object",
"msg",
")",
"{",
"MessageDataDesc",
"messageDataDesc",
"=",
"message",
".",
"getMessageDataDesc",
"(",
"null",
")",
";",
"// Top level only",
"if",
"(",
"messageDataDesc",
"!=",
... | Move the standard payload properties from the message to the xml.
@param message
@param msg | [
"Move",
"the",
"standard",
"payload",
"properties",
"from",
"the",
"message",
"to",
"the",
"xml",
"."
] | train | https://github.com/jbundle/jbundle/blob/4037fcfa85f60c7d0096c453c1a3cd573c2b0abc/base/message/trx/src/main/java/org/jbundle/base/message/trx/message/external/convert/BaseConvertToNative.java#L171-L189 |
lestard/advanced-bindings | src/main/java/eu/lestard/advanced_bindings/api/MathBindings.java | MathBindings.IEEEremainder | public static DoubleBinding IEEEremainder(final ObservableDoubleValue f1, final ObservableDoubleValue f2) {
"""
Binding for {@link java.lang.Math#IEEEremainder(double, double)}
@param f1 the dividend.
@param f2 the divisor.
@return the remainder when {@code f1} is divided by
{@code f2}.
"""
... | java | public static DoubleBinding IEEEremainder(final ObservableDoubleValue f1, final ObservableDoubleValue f2) {
return createDoubleBinding(() -> Math.IEEEremainder(f1.get(), f2.get()), f1, f2);
} | [
"public",
"static",
"DoubleBinding",
"IEEEremainder",
"(",
"final",
"ObservableDoubleValue",
"f1",
",",
"final",
"ObservableDoubleValue",
"f2",
")",
"{",
"return",
"createDoubleBinding",
"(",
"(",
")",
"->",
"Math",
".",
"IEEEremainder",
"(",
"f1",
".",
"get",
"... | Binding for {@link java.lang.Math#IEEEremainder(double, double)}
@param f1 the dividend.
@param f2 the divisor.
@return the remainder when {@code f1} is divided by
{@code f2}. | [
"Binding",
"for",
"{",
"@link",
"java",
".",
"lang",
".",
"Math#IEEEremainder",
"(",
"double",
"double",
")",
"}"
] | train | https://github.com/lestard/advanced-bindings/blob/054a5dde261c29f862b971765fa3da3704a13ab4/src/main/java/eu/lestard/advanced_bindings/api/MathBindings.java#L624-L626 |
airlift/slice | src/main/java/io/airlift/slice/UnsafeSliceFactory.java | UnsafeSliceFactory.newSlice | public Slice newSlice(long address, int size, Object reference) {
"""
Creates a slice for directly a raw memory address. This is
inherently unsafe as it may be used to access arbitrary memory.
The slice will hold the specified object reference to prevent the
garbage collector from freeing it while it is in use ... | java | public Slice newSlice(long address, int size, Object reference)
{
if (address <= 0) {
throw new IllegalArgumentException("Invalid address: " + address);
}
if (reference == null) {
throw new NullPointerException("Object reference is null");
}
if (size =... | [
"public",
"Slice",
"newSlice",
"(",
"long",
"address",
",",
"int",
"size",
",",
"Object",
"reference",
")",
"{",
"if",
"(",
"address",
"<=",
"0",
")",
"{",
"throw",
"new",
"IllegalArgumentException",
"(",
"\"Invalid address: \"",
"+",
"address",
")",
";",
... | Creates a slice for directly a raw memory address. This is
inherently unsafe as it may be used to access arbitrary memory.
The slice will hold the specified object reference to prevent the
garbage collector from freeing it while it is in use by the slice.
@param address the raw memory address base
@param size the size... | [
"Creates",
"a",
"slice",
"for",
"directly",
"a",
"raw",
"memory",
"address",
".",
"This",
"is",
"inherently",
"unsafe",
"as",
"it",
"may",
"be",
"used",
"to",
"access",
"arbitrary",
"memory",
".",
"The",
"slice",
"will",
"hold",
"the",
"specified",
"object... | train | https://github.com/airlift/slice/blob/7166cb0319e3655f8ba15f5a7ccf3d2f721c1242/src/main/java/io/airlift/slice/UnsafeSliceFactory.java#L86-L98 |
JOML-CI/JOML | src/org/joml/Matrix4d.java | Matrix4d.rotateAroundLocal | public Matrix4d rotateAroundLocal(Quaterniondc quat, double ox, double oy, double oz, Matrix4d dest) {
"""
/* (non-Javadoc)
@see org.joml.Matrix4dc#rotateAroundLocal(org.joml.Quaterniondc, double, double, double, org.joml.Matrix4d)
"""
double w2 = quat.w() * quat.w();
double x2 = quat.x() * qu... | java | public Matrix4d rotateAroundLocal(Quaterniondc quat, double ox, double oy, double oz, Matrix4d dest) {
double w2 = quat.w() * quat.w();
double x2 = quat.x() * quat.x();
double y2 = quat.y() * quat.y();
double z2 = quat.z() * quat.z();
double zw = quat.z() * quat.w();
doub... | [
"public",
"Matrix4d",
"rotateAroundLocal",
"(",
"Quaterniondc",
"quat",
",",
"double",
"ox",
",",
"double",
"oy",
",",
"double",
"oz",
",",
"Matrix4d",
"dest",
")",
"{",
"double",
"w2",
"=",
"quat",
".",
"w",
"(",
")",
"*",
"quat",
".",
"w",
"(",
")"... | /* (non-Javadoc)
@see org.joml.Matrix4dc#rotateAroundLocal(org.joml.Quaterniondc, double, double, double, org.joml.Matrix4d) | [
"/",
"*",
"(",
"non",
"-",
"Javadoc",
")"
] | train | https://github.com/JOML-CI/JOML/blob/ce2652fc236b42bda3875c591f8e6645048a678f/src/org/joml/Matrix4d.java#L5289-L5339 |
adessoAG/wicked-charts | highcharts-wrapper/src/main/java/de/adesso/wickedcharts/highcharts/options/livedata/LiveDataSeries.java | LiveDataSeries.addJavaScriptParameter | public LiveDataSeries addJavaScriptParameter(final String parameterName, final String javascriptExpression) {
"""
Adds a javascript parameter that will be passed into the
{@link #update(LiveDataUpdateEvent)} method.
@param parameterName
the name of the parameter
@param javascriptExpression
a javascript expr... | java | public LiveDataSeries addJavaScriptParameter(final String parameterName, final String javascriptExpression) {
this.javascriptParameters.put(parameterName, javascriptExpression);
return this;
} | [
"public",
"LiveDataSeries",
"addJavaScriptParameter",
"(",
"final",
"String",
"parameterName",
",",
"final",
"String",
"javascriptExpression",
")",
"{",
"this",
".",
"javascriptParameters",
".",
"put",
"(",
"parameterName",
",",
"javascriptExpression",
")",
";",
"retu... | Adds a javascript parameter that will be passed into the
{@link #update(LiveDataUpdateEvent)} method.
@param parameterName
the name of the parameter
@param javascriptExpression
a javascript expression. The value this expression evaluates to
will be transmitted to the server via AJAX and will be passed into
update(Live... | [
"Adds",
"a",
"javascript",
"parameter",
"that",
"will",
"be",
"passed",
"into",
"the",
"{",
"@link",
"#update",
"(",
"LiveDataUpdateEvent",
")",
"}",
"method",
"."
] | train | https://github.com/adessoAG/wicked-charts/blob/498aceff025f612e22ba5135b26531afeabac03c/highcharts-wrapper/src/main/java/de/adesso/wickedcharts/highcharts/options/livedata/LiveDataSeries.java#L88-L91 |
apereo/cas | support/cas-server-support-pac4j-core-clients/src/main/java/org/apereo/cas/support/pac4j/authentication/DelegatedClientFactory.java | DelegatedClientFactory.configureClient | protected void configureClient(final BaseClient client, final Pac4jBaseClientProperties props) {
"""
Sets client name.
@param client the client
@param props the props
"""
val cname = props.getClientName();
if (StringUtils.isNotBlank(cname)) {
client.setName(cname);
} el... | java | protected void configureClient(final BaseClient client, final Pac4jBaseClientProperties props) {
val cname = props.getClientName();
if (StringUtils.isNotBlank(cname)) {
client.setName(cname);
} else {
val className = client.getClass().getSimpleName();
val genN... | [
"protected",
"void",
"configureClient",
"(",
"final",
"BaseClient",
"client",
",",
"final",
"Pac4jBaseClientProperties",
"props",
")",
"{",
"val",
"cname",
"=",
"props",
".",
"getClientName",
"(",
")",
";",
"if",
"(",
"StringUtils",
".",
"isNotBlank",
"(",
"cn... | Sets client name.
@param client the client
@param props the props | [
"Sets",
"client",
"name",
"."
] | train | https://github.com/apereo/cas/blob/b4b306433a8782cef803a39bea5b1f96740e0e9b/support/cas-server-support-pac4j-core-clients/src/main/java/org/apereo/cas/support/pac4j/authentication/DelegatedClientFactory.java#L330-L346 |
spring-projects/spring-boot | spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/info/GitInfoContributor.java | GitInfoContributor.postProcessContent | @Override
protected void postProcessContent(Map<String, Object> content) {
"""
Post-process the content to expose. By default, well known keys representing dates
are converted to {@link Instant} instances.
@param content the content to expose
"""
replaceValue(getNestedMap(content, "commit"), "time",
g... | java | @Override
protected void postProcessContent(Map<String, Object> content) {
replaceValue(getNestedMap(content, "commit"), "time",
getProperties().getCommitTime());
replaceValue(getNestedMap(content, "build"), "time",
getProperties().getInstant("build.time"));
} | [
"@",
"Override",
"protected",
"void",
"postProcessContent",
"(",
"Map",
"<",
"String",
",",
"Object",
">",
"content",
")",
"{",
"replaceValue",
"(",
"getNestedMap",
"(",
"content",
",",
"\"commit\"",
")",
",",
"\"time\"",
",",
"getProperties",
"(",
")",
".",... | Post-process the content to expose. By default, well known keys representing dates
are converted to {@link Instant} instances.
@param content the content to expose | [
"Post",
"-",
"process",
"the",
"content",
"to",
"expose",
".",
"By",
"default",
"well",
"known",
"keys",
"representing",
"dates",
"are",
"converted",
"to",
"{"
] | train | https://github.com/spring-projects/spring-boot/blob/0b27f7c70e164b2b1a96477f1d9c1acba56790c1/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/info/GitInfoContributor.java#L65-L71 |
Azure/azure-sdk-for-java | keyvault/data-plane/azure-keyvault/src/main/java/com/microsoft/azure/keyvault/implementation/KeyVaultClientBaseImpl.java | KeyVaultClientBaseImpl.restoreSecretAsync | public Observable<SecretBundle> restoreSecretAsync(String vaultBaseUrl, byte[] secretBundleBackup) {
"""
Restores a backed up secret to a vault.
Restores a backed up secret, and all its versions, to a vault. This operation requires the secrets/restore permission.
@param vaultBaseUrl The vault name, for example... | java | public Observable<SecretBundle> restoreSecretAsync(String vaultBaseUrl, byte[] secretBundleBackup) {
return restoreSecretWithServiceResponseAsync(vaultBaseUrl, secretBundleBackup).map(new Func1<ServiceResponse<SecretBundle>, SecretBundle>() {
@Override
public SecretBundle call(ServiceRes... | [
"public",
"Observable",
"<",
"SecretBundle",
">",
"restoreSecretAsync",
"(",
"String",
"vaultBaseUrl",
",",
"byte",
"[",
"]",
"secretBundleBackup",
")",
"{",
"return",
"restoreSecretWithServiceResponseAsync",
"(",
"vaultBaseUrl",
",",
"secretBundleBackup",
")",
".",
"... | Restores a backed up secret to a vault.
Restores a backed up secret, and all its versions, to a vault. This operation requires the secrets/restore permission.
@param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net.
@param secretBundleBackup The backup blob associated with a secret bundle.
@thr... | [
"Restores",
"a",
"backed",
"up",
"secret",
"to",
"a",
"vault",
".",
"Restores",
"a",
"backed",
"up",
"secret",
"and",
"all",
"its",
"versions",
"to",
"a",
"vault",
".",
"This",
"operation",
"requires",
"the",
"secrets",
"/",
"restore",
"permission",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/keyvault/data-plane/azure-keyvault/src/main/java/com/microsoft/azure/keyvault/implementation/KeyVaultClientBaseImpl.java#L5021-L5028 |
cdk/cdk | base/standard/src/main/java/org/openscience/cdk/geometry/GeometryUtil.java | GeometryUtil.get3DCentreOfMass | public static Point3d get3DCentreOfMass(IAtomContainer ac) {
"""
Calculates the center of mass for the <code>Atom</code>s in the AtomContainer.
@param ac AtomContainer for which the center of mass is calculated
@return The center of mass of the molecule, or <code>NULL</code> if the molecule
does not have 3D c... | java | public static Point3d get3DCentreOfMass(IAtomContainer ac) {
double xsum = 0.0;
double ysum = 0.0;
double zsum = 0.0;
double totalmass = 0.0;
Isotopes isotopes;
try {
isotopes = Isotopes.getInstance();
} catch (IOException e) {
throw new R... | [
"public",
"static",
"Point3d",
"get3DCentreOfMass",
"(",
"IAtomContainer",
"ac",
")",
"{",
"double",
"xsum",
"=",
"0.0",
";",
"double",
"ysum",
"=",
"0.0",
";",
"double",
"zsum",
"=",
"0.0",
";",
"double",
"totalmass",
"=",
"0.0",
";",
"Isotopes",
"isotope... | Calculates the center of mass for the <code>Atom</code>s in the AtomContainer.
@param ac AtomContainer for which the center of mass is calculated
@return The center of mass of the molecule, or <code>NULL</code> if the molecule
does not have 3D coordinates or if any of the atoms do not have a valid atomic mass
@cdk.key... | [
"Calculates",
"the",
"center",
"of",
"mass",
"for",
"the",
"<code",
">",
"Atom<",
"/",
"code",
">",
"s",
"in",
"the",
"AtomContainer",
"."
] | train | https://github.com/cdk/cdk/blob/c3d0f16502bf08df50365fee392e11d7c9856657/base/standard/src/main/java/org/openscience/cdk/geometry/GeometryUtil.java#L540-L567 |
Netflix/conductor | core/src/main/java/com/netflix/conductor/core/events/EventProcessor.java | EventProcessor.executeEvent | private List<EventExecution> executeEvent(String event, Message msg) throws Exception {
"""
Executes all the actions configured on all the event handlers triggered by the {@link Message} on the queue
If any of the actions on an event handler fails due to a transient failure, the execution is not persisted such th... | java | private List<EventExecution> executeEvent(String event, Message msg) throws Exception {
List<EventHandler> eventHandlerList = metadataService.getEventHandlersForEvent(event, true);
Object payloadObject = getPayloadObject(msg.getPayload());
List<EventExecution> transientFailures = new ArrayList<... | [
"private",
"List",
"<",
"EventExecution",
">",
"executeEvent",
"(",
"String",
"event",
",",
"Message",
"msg",
")",
"throws",
"Exception",
"{",
"List",
"<",
"EventHandler",
">",
"eventHandlerList",
"=",
"metadataService",
".",
"getEventHandlersForEvent",
"(",
"even... | Executes all the actions configured on all the event handlers triggered by the {@link Message} on the queue
If any of the actions on an event handler fails due to a transient failure, the execution is not persisted such that it can be retried
@return a list of {@link EventExecution} that failed due to transient failur... | [
"Executes",
"all",
"the",
"actions",
"configured",
"on",
"all",
"the",
"event",
"handlers",
"triggered",
"by",
"the",
"{",
"@link",
"Message",
"}",
"on",
"the",
"queue",
"If",
"any",
"of",
"the",
"actions",
"on",
"an",
"event",
"handler",
"fails",
"due",
... | train | https://github.com/Netflix/conductor/blob/78fae0ed9ddea22891f9eebb96a2ec0b2783dca0/core/src/main/java/com/netflix/conductor/core/events/EventProcessor.java#L174-L210 |
Azure/azure-sdk-for-java | compute/resource-manager/v2017_12_01/src/main/java/com/microsoft/azure/management/compute/v2017_12_01/implementation/VirtualMachineScaleSetVMsInner.java | VirtualMachineScaleSetVMsInner.updateAsync | public Observable<VirtualMachineScaleSetVMInner> updateAsync(String resourceGroupName, String vmScaleSetName, String instanceId, VirtualMachineScaleSetVMInner parameters) {
"""
Updates a virtual machine of a VM scale set.
@param resourceGroupName The name of the resource group.
@param vmScaleSetName The name o... | java | public Observable<VirtualMachineScaleSetVMInner> updateAsync(String resourceGroupName, String vmScaleSetName, String instanceId, VirtualMachineScaleSetVMInner parameters) {
return updateWithServiceResponseAsync(resourceGroupName, vmScaleSetName, instanceId, parameters).map(new Func1<ServiceResponse<VirtualMachi... | [
"public",
"Observable",
"<",
"VirtualMachineScaleSetVMInner",
">",
"updateAsync",
"(",
"String",
"resourceGroupName",
",",
"String",
"vmScaleSetName",
",",
"String",
"instanceId",
",",
"VirtualMachineScaleSetVMInner",
"parameters",
")",
"{",
"return",
"updateWithServiceResp... | Updates a virtual machine of a VM scale set.
@param resourceGroupName The name of the resource group.
@param vmScaleSetName The name of the VM scale set where the extension should be create or updated.
@param instanceId The instance ID of the virtual machine.
@param parameters Parameters supplied to the Update Virtual... | [
"Updates",
"a",
"virtual",
"machine",
"of",
"a",
"VM",
"scale",
"set",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/compute/resource-manager/v2017_12_01/src/main/java/com/microsoft/azure/management/compute/v2017_12_01/implementation/VirtualMachineScaleSetVMsInner.java#L714-L721 |
SeleniumHQ/selenium | java/client/src/org/openqa/selenium/interactions/Actions.java | Actions.moveByOffset | public Actions moveByOffset(int xOffset, int yOffset) {
"""
Moves the mouse from its current position (or 0,0) by the given offset. If the coordinates
provided are outside the viewport (the mouse will end up outside the browser window) then
the viewport is scrolled to match.
@param xOffset horizontal offset. A ... | java | public Actions moveByOffset(int xOffset, int yOffset) {
if (isBuildingActions()) {
action.addAction(new MoveToOffsetAction(jsonMouse, null, xOffset, yOffset));
}
return tick(
defaultMouse.createPointerMove(Duration.ofMillis(200), Origin.pointer(), xOffset, yOffset));
} | [
"public",
"Actions",
"moveByOffset",
"(",
"int",
"xOffset",
",",
"int",
"yOffset",
")",
"{",
"if",
"(",
"isBuildingActions",
"(",
")",
")",
"{",
"action",
".",
"addAction",
"(",
"new",
"MoveToOffsetAction",
"(",
"jsonMouse",
",",
"null",
",",
"xOffset",
",... | Moves the mouse from its current position (or 0,0) by the given offset. If the coordinates
provided are outside the viewport (the mouse will end up outside the browser window) then
the viewport is scrolled to match.
@param xOffset horizontal offset. A negative value means moving the mouse left.
@param yOffset vertical ... | [
"Moves",
"the",
"mouse",
"from",
"its",
"current",
"position",
"(",
"or",
"0",
"0",
")",
"by",
"the",
"given",
"offset",
".",
"If",
"the",
"coordinates",
"provided",
"are",
"outside",
"the",
"viewport",
"(",
"the",
"mouse",
"will",
"end",
"up",
"outside"... | train | https://github.com/SeleniumHQ/selenium/blob/7af172729f17b20269c8ca4ea6f788db48616535/java/client/src/org/openqa/selenium/interactions/Actions.java#L405-L412 |
UrielCh/ovh-java-sdk | ovh-java-sdk-order/src/main/java/net/minidev/ovh/api/ApiOvhOrder.java | ApiOvhOrder.license_plesk_new_GET | public ArrayList<String> license_plesk_new_GET(OvhOrderableAntivirusEnum antivirus, OvhPleskApplicationSetEnum applicationSet, OvhOrderablePleskDomainNumberEnum domainNumber, String ip, OvhOrderablePleskLanguagePackEnum languagePackNumber, Boolean powerpack, Boolean resellerManagement, OvhLicenseTypeEnum serviceType, O... | java | public ArrayList<String> license_plesk_new_GET(OvhOrderableAntivirusEnum antivirus, OvhPleskApplicationSetEnum applicationSet, OvhOrderablePleskDomainNumberEnum domainNumber, String ip, OvhOrderablePleskLanguagePackEnum languagePackNumber, Boolean powerpack, Boolean resellerManagement, OvhLicenseTypeEnum serviceType, O... | [
"public",
"ArrayList",
"<",
"String",
">",
"license_plesk_new_GET",
"(",
"OvhOrderableAntivirusEnum",
"antivirus",
",",
"OvhPleskApplicationSetEnum",
"applicationSet",
",",
"OvhOrderablePleskDomainNumberEnum",
"domainNumber",
",",
"String",
"ip",
",",
"OvhOrderablePleskLanguage... | Get allowed durations for 'new' option
REST: GET /order/license/plesk/new
@param serviceType [required] # DEPRECATED # The kind of service on which this license will be used # Will not be used, keeped only for compatibility #
@param languagePackNumber [required] The amount of language pack numbers to include in this l... | [
"Get",
"allowed",
"durations",
"for",
"new",
"option"
] | train | https://github.com/UrielCh/ovh-java-sdk/blob/6d531a40e56e09701943e334c25f90f640c55701/ovh-java-sdk-order/src/main/java/net/minidev/ovh/api/ApiOvhOrder.java#L1764-L1779 |
plume-lib/options | src/main/java/org/plumelib/options/Options.java | Options.getRefArg | @SuppressWarnings("nullness") // static method, so null first arg is OK: oi.factory
private @NonNull Object getRefArg(OptionInfo oi, String argName, String argValue)
throws ArgException {
"""
Given a value string supplied on the command line, create an object. The only expected error is
some sort of parse... | java | @SuppressWarnings("nullness") // static method, so null first arg is OK: oi.factory
private @NonNull Object getRefArg(OptionInfo oi, String argName, String argValue)
throws ArgException {
Object val;
try {
if (oi.constructor != null) {
val = oi.constructor.newInstance(new Object[] {argVal... | [
"@",
"SuppressWarnings",
"(",
"\"nullness\"",
")",
"// static method, so null first arg is OK: oi.factory",
"private",
"@",
"NonNull",
"Object",
"getRefArg",
"(",
"OptionInfo",
"oi",
",",
"String",
"argName",
",",
"String",
"argValue",
")",
"throws",
"ArgException",
"{"... | Given a value string supplied on the command line, create an object. The only expected error is
some sort of parse error from the constructor.
@param oi the option corresponding to {@code argName} and {@code argValue}
@param argName the argument name -- used only for diagnostics
@param argValue the value supplied on t... | [
"Given",
"a",
"value",
"string",
"supplied",
"on",
"the",
"command",
"line",
"create",
"an",
"object",
".",
"The",
"only",
"expected",
"error",
"is",
"some",
"sort",
"of",
"parse",
"error",
"from",
"the",
"constructor",
"."
] | train | https://github.com/plume-lib/options/blob/1bdd0ac7a1794bdf9dd373e279f69d43395154f0/src/main/java/org/plumelib/options/Options.java#L1421-L1448 |
wildfly/wildfly-core | patching/src/main/java/org/jboss/as/patching/runner/IdentityPatchRunner.java | IdentityPatchRunner.applyPatch | public PatchingResult applyPatch(final PatchMetadataResolver patchResolver, final PatchContentProvider contentProvider, final ContentVerificationPolicy contentPolicy, final InstallationManager.InstallationModification modification) throws PatchingException {
"""
Apply a patch.
@param patchResolver the patch m... | java | public PatchingResult applyPatch(final PatchMetadataResolver patchResolver, final PatchContentProvider contentProvider, final ContentVerificationPolicy contentPolicy, final InstallationManager.InstallationModification modification) throws PatchingException {
try {
// Check if we can apply this patch... | [
"public",
"PatchingResult",
"applyPatch",
"(",
"final",
"PatchMetadataResolver",
"patchResolver",
",",
"final",
"PatchContentProvider",
"contentProvider",
",",
"final",
"ContentVerificationPolicy",
"contentPolicy",
",",
"final",
"InstallationManager",
".",
"InstallationModifica... | Apply a patch.
@param patchResolver the patch metadata resolver
@param contentProvider the patch content provider
@param contentPolicy the content verification policy
@param modification the installation modification
@throws PatchingException for any error | [
"Apply",
"a",
"patch",
"."
] | train | https://github.com/wildfly/wildfly-core/blob/cfaf0479dcbb2d320a44c5374b93b944ec39fade/patching/src/main/java/org/jboss/as/patching/runner/IdentityPatchRunner.java#L75-L108 |
PuyallupFoursquare/ccb-api-client-java | src/main/java/com/p4square/ccbapi/serializer/FormBuilder.java | FormBuilder.appendField | public void appendField(final String key, final LocalDateTime value) {
"""
Append a LocalDateTime field to the form.
@param key The form key, which must be URLEncoded before calling this method.
@param value The value associated with the key.
"""
appendField(key, DATE_TIME_FORMAT.format(value));
... | java | public void appendField(final String key, final LocalDateTime value) {
appendField(key, DATE_TIME_FORMAT.format(value));
} | [
"public",
"void",
"appendField",
"(",
"final",
"String",
"key",
",",
"final",
"LocalDateTime",
"value",
")",
"{",
"appendField",
"(",
"key",
",",
"DATE_TIME_FORMAT",
".",
"format",
"(",
"value",
")",
")",
";",
"}"
] | Append a LocalDateTime field to the form.
@param key The form key, which must be URLEncoded before calling this method.
@param value The value associated with the key. | [
"Append",
"a",
"LocalDateTime",
"field",
"to",
"the",
"form",
"."
] | train | https://github.com/PuyallupFoursquare/ccb-api-client-java/blob/54a7a3184dc565fe513aa520e1344b2303ea6834/src/main/java/com/p4square/ccbapi/serializer/FormBuilder.java#L116-L118 |
apache/flink | flink-core/src/main/java/org/apache/flink/configuration/Configuration.java | Configuration.addAll | public void addAll(Configuration other, String prefix) {
"""
Adds all entries from the given configuration into this configuration. The keys
are prepended with the given prefix.
@param other
The configuration whose entries are added to this configuration.
@param prefix
The prefix to prepend.
"""
final... | java | public void addAll(Configuration other, String prefix) {
final StringBuilder bld = new StringBuilder();
bld.append(prefix);
final int pl = bld.length();
synchronized (this.confData) {
synchronized (other.confData) {
for (Map.Entry<String, Object> entry : other.confData.entrySet()) {
bld.setLength(p... | [
"public",
"void",
"addAll",
"(",
"Configuration",
"other",
",",
"String",
"prefix",
")",
"{",
"final",
"StringBuilder",
"bld",
"=",
"new",
"StringBuilder",
"(",
")",
";",
"bld",
".",
"append",
"(",
"prefix",
")",
";",
"final",
"int",
"pl",
"=",
"bld",
... | Adds all entries from the given configuration into this configuration. The keys
are prepended with the given prefix.
@param other
The configuration whose entries are added to this configuration.
@param prefix
The prefix to prepend. | [
"Adds",
"all",
"entries",
"from",
"the",
"given",
"configuration",
"into",
"this",
"configuration",
".",
"The",
"keys",
"are",
"prepended",
"with",
"the",
"given",
"prefix",
"."
] | train | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-core/src/main/java/org/apache/flink/configuration/Configuration.java#L683-L697 |
UrielCh/ovh-java-sdk | ovh-java-sdk-emailexchange/src/main/java/net/minidev/ovh/api/ApiOvhEmailexchange.java | ApiOvhEmailexchange.organizationName_service_exchangeService_account_primaryEmailAddress_PUT | public void organizationName_service_exchangeService_account_primaryEmailAddress_PUT(String organizationName, String exchangeService, String primaryEmailAddress, OvhAccount body) throws IOException {
"""
Alter this object properties
REST: PUT /email/exchange/{organizationName}/service/{exchangeService}/account/... | java | public void organizationName_service_exchangeService_account_primaryEmailAddress_PUT(String organizationName, String exchangeService, String primaryEmailAddress, OvhAccount body) throws IOException {
String qPath = "/email/exchange/{organizationName}/service/{exchangeService}/account/{primaryEmailAddress}";
StringB... | [
"public",
"void",
"organizationName_service_exchangeService_account_primaryEmailAddress_PUT",
"(",
"String",
"organizationName",
",",
"String",
"exchangeService",
",",
"String",
"primaryEmailAddress",
",",
"OvhAccount",
"body",
")",
"throws",
"IOException",
"{",
"String",
"qP... | Alter this object properties
REST: PUT /email/exchange/{organizationName}/service/{exchangeService}/account/{primaryEmailAddress}
@param body [required] New object properties
@param organizationName [required] The internal name of your exchange organization
@param exchangeService [required] The internal name of your e... | [
"Alter",
"this",
"object",
"properties"
] | train | https://github.com/UrielCh/ovh-java-sdk/blob/6d531a40e56e09701943e334c25f90f640c55701/ovh-java-sdk-emailexchange/src/main/java/net/minidev/ovh/api/ApiOvhEmailexchange.java#L2092-L2096 |
google/closure-compiler | src/com/google/javascript/jscomp/parsing/JsDocInfoParser.java | JsDocInfoParser.parseAndRecordTypeNameNode | private Node parseAndRecordTypeNameNode(JsDocToken token, int lineno,
int startCharno, boolean matchingLC) {
"""
Looks for a type expression at the current token and if found,
returns it. Note that this method consumes input.
@param token The current token.
@param lin... | java | private Node parseAndRecordTypeNameNode(JsDocToken token, int lineno,
int startCharno, boolean matchingLC) {
return parseAndRecordTypeNode(token, lineno, startCharno, matchingLC, true);
} | [
"private",
"Node",
"parseAndRecordTypeNameNode",
"(",
"JsDocToken",
"token",
",",
"int",
"lineno",
",",
"int",
"startCharno",
",",
"boolean",
"matchingLC",
")",
"{",
"return",
"parseAndRecordTypeNode",
"(",
"token",
",",
"lineno",
",",
"startCharno",
",",
"matchin... | Looks for a type expression at the current token and if found,
returns it. Note that this method consumes input.
@param token The current token.
@param lineno The line of the type expression.
@param startCharno The starting character position of the type expression.
@param matchingLC Whether the type expression starts... | [
"Looks",
"for",
"a",
"type",
"expression",
"at",
"the",
"current",
"token",
"and",
"if",
"found",
"returns",
"it",
".",
"Note",
"that",
"this",
"method",
"consumes",
"input",
"."
] | train | https://github.com/google/closure-compiler/blob/d81e36740f6a9e8ac31a825ee8758182e1dc5aae/src/com/google/javascript/jscomp/parsing/JsDocInfoParser.java#L1541-L1544 |
line/armeria | core/src/main/java/com/linecorp/armeria/server/ServerBuilder.java | ServerBuilder.withVirtualHost | public ChainedVirtualHostBuilder withVirtualHost(String hostnamePattern) {
"""
Adds the <a href="https://en.wikipedia.org/wiki/Virtual_hosting#Name-based">name-based virtual host</a>
specified by {@link VirtualHost}.
@param hostnamePattern virtual host name regular expression
@return {@link VirtualHostBuilder... | java | public ChainedVirtualHostBuilder withVirtualHost(String hostnamePattern) {
final ChainedVirtualHostBuilder virtualHostBuilder =
new ChainedVirtualHostBuilder(hostnamePattern, this);
virtualHostBuilders.add(virtualHostBuilder);
return virtualHostBuilder;
} | [
"public",
"ChainedVirtualHostBuilder",
"withVirtualHost",
"(",
"String",
"hostnamePattern",
")",
"{",
"final",
"ChainedVirtualHostBuilder",
"virtualHostBuilder",
"=",
"new",
"ChainedVirtualHostBuilder",
"(",
"hostnamePattern",
",",
"this",
")",
";",
"virtualHostBuilders",
"... | Adds the <a href="https://en.wikipedia.org/wiki/Virtual_hosting#Name-based">name-based virtual host</a>
specified by {@link VirtualHost}.
@param hostnamePattern virtual host name regular expression
@return {@link VirtualHostBuilder} for build the virtual host | [
"Adds",
"the",
"<a",
"href",
"=",
"https",
":",
"//",
"en",
".",
"wikipedia",
".",
"org",
"/",
"wiki",
"/",
"Virtual_hosting#Name",
"-",
"based",
">",
"name",
"-",
"based",
"virtual",
"host<",
"/",
"a",
">",
"specified",
"by",
"{",
"@link",
"VirtualHos... | train | https://github.com/line/armeria/blob/67d29e019fd35a35f89c45cc8f9119ff9b12b44d/core/src/main/java/com/linecorp/armeria/server/ServerBuilder.java#L1153-L1158 |
molgenis/molgenis | molgenis-data-postgresql/src/main/java/org/molgenis/data/postgresql/PostgreSqlExceptionTranslator.java | PostgreSqlExceptionTranslator.translateReadonlyViolation | MolgenisValidationException translateReadonlyViolation(PSQLException pSqlException) {
"""
Package private for testability
@param pSqlException PostgreSQL exception
@return translated validation exception
"""
Matcher matcher =
Pattern.compile(
"Updating read-only column \"?(.*?)\... | java | MolgenisValidationException translateReadonlyViolation(PSQLException pSqlException) {
Matcher matcher =
Pattern.compile(
"Updating read-only column \"?(.*?)\"? of table \"?(.*?)\"? with id \\[(.*?)] is not allowed")
.matcher(pSqlException.getServerErrorMessage().getMessage());
... | [
"MolgenisValidationException",
"translateReadonlyViolation",
"(",
"PSQLException",
"pSqlException",
")",
"{",
"Matcher",
"matcher",
"=",
"Pattern",
".",
"compile",
"(",
"\"Updating read-only column \\\"?(.*?)\\\"? of table \\\"?(.*?)\\\"? with id \\\\[(.*?)] is not allowed\"",
")",
"... | Package private for testability
@param pSqlException PostgreSQL exception
@return translated validation exception | [
"Package",
"private",
"for",
"testability"
] | train | https://github.com/molgenis/molgenis/blob/b4d0d6b27e6f6c8d7505a3863dc03b589601f987/molgenis-data-postgresql/src/main/java/org/molgenis/data/postgresql/PostgreSqlExceptionTranslator.java#L143-L164 |
sarl/sarl | products/sarlc/src/main/java/io/sarl/lang/sarlc/modules/configs/SarlcConfigModule.java | SarlcConfigModule.getSarlcConfig | @SuppressWarnings("static-method")
@Provides
@Singleton
public SarlConfig getSarlcConfig(ConfigurationFactory configFactory, Injector injector) {
"""
Replies the instance of the sarl configuration.
@param configFactory accessor to the bootique factory.
@param injector the current injector.
@return the path... | java | @SuppressWarnings("static-method")
@Provides
@Singleton
public SarlConfig getSarlcConfig(ConfigurationFactory configFactory, Injector injector) {
final SarlConfig config = SarlConfig.getConfiguration(configFactory);
injector.injectMembers(config);
return config;
} | [
"@",
"SuppressWarnings",
"(",
"\"static-method\"",
")",
"@",
"Provides",
"@",
"Singleton",
"public",
"SarlConfig",
"getSarlcConfig",
"(",
"ConfigurationFactory",
"configFactory",
",",
"Injector",
"injector",
")",
"{",
"final",
"SarlConfig",
"config",
"=",
"SarlConfig"... | Replies the instance of the sarl configuration.
@param configFactory accessor to the bootique factory.
@param injector the current injector.
@return the path configuration accessor. | [
"Replies",
"the",
"instance",
"of",
"the",
"sarl",
"configuration",
"."
] | train | https://github.com/sarl/sarl/blob/ca00ff994598c730339972def4e19a60e0b8cace/products/sarlc/src/main/java/io/sarl/lang/sarlc/modules/configs/SarlcConfigModule.java#L135-L142 |
code4everything/util | src/main/java/com/zhazhapan/util/DateUtils.java | DateUtils.add | public static Date add(Date date, int field, int amount) {
"""
日期添加
@param date 日期
@param field 添加区域 {@link Calendar#DATE} {@link Calendar#MONTH} {@link Calendar#YEAR}
@param amount 数量
@return 添加后的日期
"""
CALENDAR.setTime(date);
CALENDAR.add(field, amount);
return CALENDAR.getTim... | java | public static Date add(Date date, int field, int amount) {
CALENDAR.setTime(date);
CALENDAR.add(field, amount);
return CALENDAR.getTime();
} | [
"public",
"static",
"Date",
"add",
"(",
"Date",
"date",
",",
"int",
"field",
",",
"int",
"amount",
")",
"{",
"CALENDAR",
".",
"setTime",
"(",
"date",
")",
";",
"CALENDAR",
".",
"add",
"(",
"field",
",",
"amount",
")",
";",
"return",
"CALENDAR",
".",
... | 日期添加
@param date 日期
@param field 添加区域 {@link Calendar#DATE} {@link Calendar#MONTH} {@link Calendar#YEAR}
@param amount 数量
@return 添加后的日期 | [
"日期添加"
] | train | https://github.com/code4everything/util/blob/1fc9f0ead1108f4d7208ba7c000df4244f708418/src/main/java/com/zhazhapan/util/DateUtils.java#L525-L529 |
netarchivesuite/heritrix3-wrapper | src/main/java/org/netarchivesuite/heritrix3wrapper/unzip/UnzipUtility.java | UnzipUtility.extractFile | private void extractFile(ZipInputStream zipIn, File destFile) throws IOException {
"""
Extracts a zip entry (file entry)
@param zipIn
@param destFile
@throws IOException
"""
BufferedOutputStream bos = new BufferedOutputStream(new FileOutputStream(destFile));
int read = 0;
while ((rea... | java | private void extractFile(ZipInputStream zipIn, File destFile) throws IOException {
BufferedOutputStream bos = new BufferedOutputStream(new FileOutputStream(destFile));
int read = 0;
while ((read = zipIn.read(tmpBuffer)) != -1) {
bos.write(tmpBuffer, 0, read);
}
bos.cl... | [
"private",
"void",
"extractFile",
"(",
"ZipInputStream",
"zipIn",
",",
"File",
"destFile",
")",
"throws",
"IOException",
"{",
"BufferedOutputStream",
"bos",
"=",
"new",
"BufferedOutputStream",
"(",
"new",
"FileOutputStream",
"(",
"destFile",
")",
")",
";",
"int",
... | Extracts a zip entry (file entry)
@param zipIn
@param destFile
@throws IOException | [
"Extracts",
"a",
"zip",
"entry",
"(",
"file",
"entry",
")"
] | train | https://github.com/netarchivesuite/heritrix3-wrapper/blob/e53ec5736cbac0bdd3925b5331737dc905871629/src/main/java/org/netarchivesuite/heritrix3wrapper/unzip/UnzipUtility.java#L59-L66 |
jnidzwetzki/bitfinex-v2-wss-api-java | src/main/java/com/github/jnidzwetzki/bitfinex/v2/SimpleBitfinexApiBroker.java | SimpleBitfinexApiBroker.handleResubscribeFailed | private void handleResubscribeFailed(final Map<Integer, ChannelCallbackHandler> oldChannelIdSymbolMap)
throws BitfinexClientException, InterruptedException {
"""
Handle channel re-subscribe failed
@param oldChannelIdSymbolMap
@throws BitfinexClientException
@throws InterruptedException
"""
final i... | java | private void handleResubscribeFailed(final Map<Integer, ChannelCallbackHandler> oldChannelIdSymbolMap)
throws BitfinexClientException, InterruptedException {
final int requiredSymbols = oldChannelIdSymbolMap.size();
final int subscribedSymbols = channelIdToHandlerMap.size();
// Unsubscribe old channels b... | [
"private",
"void",
"handleResubscribeFailed",
"(",
"final",
"Map",
"<",
"Integer",
",",
"ChannelCallbackHandler",
">",
"oldChannelIdSymbolMap",
")",
"throws",
"BitfinexClientException",
",",
"InterruptedException",
"{",
"final",
"int",
"requiredSymbols",
"=",
"oldChannelI... | Handle channel re-subscribe failed
@param oldChannelIdSymbolMap
@throws BitfinexClientException
@throws InterruptedException | [
"Handle",
"channel",
"re",
"-",
"subscribe",
"failed"
] | train | https://github.com/jnidzwetzki/bitfinex-v2-wss-api-java/blob/2e6adf1eb6f8cd4c8722f1619f78ab2cc3c600ee/src/main/java/com/github/jnidzwetzki/bitfinex/v2/SimpleBitfinexApiBroker.java#L687-L705 |
SonarOpenCommunity/sonar-cxx | cxx-squid/src/main/java/org/sonar/cxx/CxxVCppBuildLogParser.java | CxxVCppBuildLogParser.parseVCppLine | public void parseVCppLine(String line, String projectPath, String compilationFile) {
"""
Can be used to create a list of includes, defines and options for a single line If it follows the format of VC++
@param line
@param projectPath
@param compilationFile
"""
this.parseVCppCompilerCLLine(line, project... | java | public void parseVCppLine(String line, String projectPath, String compilationFile) {
this.parseVCppCompilerCLLine(line, projectPath, compilationFile);
} | [
"public",
"void",
"parseVCppLine",
"(",
"String",
"line",
",",
"String",
"projectPath",
",",
"String",
"compilationFile",
")",
"{",
"this",
".",
"parseVCppCompilerCLLine",
"(",
"line",
",",
"projectPath",
",",
"compilationFile",
")",
";",
"}"
] | Can be used to create a list of includes, defines and options for a single line If it follows the format of VC++
@param line
@param projectPath
@param compilationFile | [
"Can",
"be",
"used",
"to",
"create",
"a",
"list",
"of",
"includes",
"defines",
"and",
"options",
"for",
"a",
"single",
"line",
"If",
"it",
"follows",
"the",
"format",
"of",
"VC",
"++"
] | train | https://github.com/SonarOpenCommunity/sonar-cxx/blob/7e7a3a44d6d86382a0434652a798f8235503c9b8/cxx-squid/src/main/java/org/sonar/cxx/CxxVCppBuildLogParser.java#L111-L113 |
cubedtear/aritzh | aritzh-core/src/main/java/io/github/aritzhack/aritzh/util/IOUtil.java | IOUtil.chooseFolder | public static File chooseFolder(String title, File currentDir) {
"""
Open a {@link javax.swing.JFileChooser} which can only select folders, and return the selected folder, or null if closed or cancelled.
@param title The title of the file-chooser window.
@param currentDir The root directory. If null, {@co... | java | public static File chooseFolder(String title, File currentDir) {
if (currentDir == null) currentDir = new File(".");
JFileChooser fileChooser = new JFileChooser();
fileChooser.setCurrentDirectory(currentDir);
fileChooser.setDialogTitle(title);
fileChooser.setFileSelectionMode(JFileChooser.DIRECTORIES_ONLY);
... | [
"public",
"static",
"File",
"chooseFolder",
"(",
"String",
"title",
",",
"File",
"currentDir",
")",
"{",
"if",
"(",
"currentDir",
"==",
"null",
")",
"currentDir",
"=",
"new",
"File",
"(",
"\".\"",
")",
";",
"JFileChooser",
"fileChooser",
"=",
"new",
"JFile... | Open a {@link javax.swing.JFileChooser} which can only select folders, and return the selected folder, or null if closed or cancelled.
@param title The title of the file-chooser window.
@param currentDir The root directory. If null, {@code new File(".")} will be used.
@return The chosen folder, or null if none wa... | [
"Open",
"a",
"{",
"@link",
"javax",
".",
"swing",
".",
"JFileChooser",
"}",
"which",
"can",
"only",
"select",
"folders",
"and",
"return",
"the",
"selected",
"folder",
"or",
"null",
"if",
"closed",
"or",
"cancelled",
"."
] | train | https://github.com/cubedtear/aritzh/blob/bc7493447a1a6088c4a7306ca4d0f0c20278364f/aritzh-core/src/main/java/io/github/aritzhack/aritzh/util/IOUtil.java#L113-L125 |
JOML-CI/JOML | src/org/joml/Matrix4x3f.java | Matrix4x3f.lookAlong | public Matrix4x3f lookAlong(float dirX, float dirY, float dirZ, float upX, float upY, float upZ) {
"""
Apply a rotation transformation to this matrix to make <code>-z</code> point along <code>dir</code>.
<p>
If <code>M</code> is <code>this</code> matrix and <code>L</code> the lookalong rotation matrix,
then the... | java | public Matrix4x3f lookAlong(float dirX, float dirY, float dirZ, float upX, float upY, float upZ) {
return lookAlong(dirX, dirY, dirZ, upX, upY, upZ, this);
} | [
"public",
"Matrix4x3f",
"lookAlong",
"(",
"float",
"dirX",
",",
"float",
"dirY",
",",
"float",
"dirZ",
",",
"float",
"upX",
",",
"float",
"upY",
",",
"float",
"upZ",
")",
"{",
"return",
"lookAlong",
"(",
"dirX",
",",
"dirY",
",",
"dirZ",
",",
"upX",
... | Apply a rotation transformation to this matrix to make <code>-z</code> point along <code>dir</code>.
<p>
If <code>M</code> is <code>this</code> matrix and <code>L</code> the lookalong rotation matrix,
then the new matrix will be <code>M * L</code>. So when transforming a
vector <code>v</code> with the new matrix by usi... | [
"Apply",
"a",
"rotation",
"transformation",
"to",
"this",
"matrix",
"to",
"make",
"<code",
">",
"-",
"z<",
"/",
"code",
">",
"point",
"along",
"<code",
">",
"dir<",
"/",
"code",
">",
".",
"<p",
">",
"If",
"<code",
">",
"M<",
"/",
"code",
">",
"is",... | train | https://github.com/JOML-CI/JOML/blob/ce2652fc236b42bda3875c591f8e6645048a678f/src/org/joml/Matrix4x3f.java#L6092-L6094 |
DataSketches/sketches-core | src/main/java/com/yahoo/sketches/sampling/VarOptItemsSketch.java | VarOptItemsSketch.swapValues | private void swapValues(final int src, final int dst) {
"""
/* swap values of data_, weights_, and marks between src and dst indices
"""
final T item = data_.get(src);
data_.set(src, data_.get(dst));
data_.set(dst, item);
final Double wt = weights_.get(src);
weights_.set(src, weights_.get(... | java | private void swapValues(final int src, final int dst) {
final T item = data_.get(src);
data_.set(src, data_.get(dst));
data_.set(dst, item);
final Double wt = weights_.get(src);
weights_.set(src, weights_.get(dst));
weights_.set(dst, wt);
if (marks_ != null) {
final Boolean mark = ma... | [
"private",
"void",
"swapValues",
"(",
"final",
"int",
"src",
",",
"final",
"int",
"dst",
")",
"{",
"final",
"T",
"item",
"=",
"data_",
".",
"get",
"(",
"src",
")",
";",
"data_",
".",
"set",
"(",
"src",
",",
"data_",
".",
"get",
"(",
"dst",
")",
... | /* swap values of data_, weights_, and marks between src and dst indices | [
"/",
"*",
"swap",
"values",
"of",
"data_",
"weights_",
"and",
"marks",
"between",
"src",
"and",
"dst",
"indices"
] | train | https://github.com/DataSketches/sketches-core/blob/900c8c9668a1e2f1d54d453e956caad54702e540/src/main/java/com/yahoo/sketches/sampling/VarOptItemsSketch.java#L1222-L1236 |
ModeShape/modeshape | index-providers/modeshape-elasticsearch-index-provider/src/main/java/org/modeshape/jcr/index/elasticsearch/client/EsRequest.java | EsRequest.put | public void put(String name, Object[] values) {
"""
Adds multivalued property value.
@param name property name.
@param value property values.
"""
if (values instanceof EsRequest[]) {
Object[] docs = new Object[values.length];
for (int i = 0; i < docs.length; i++) {
... | java | public void put(String name, Object[] values) {
if (values instanceof EsRequest[]) {
Object[] docs = new Object[values.length];
for (int i = 0; i < docs.length; i++) {
docs[i] = ((EsRequest)values[i]).document;
}
document.setArray(name, docs);
... | [
"public",
"void",
"put",
"(",
"String",
"name",
",",
"Object",
"[",
"]",
"values",
")",
"{",
"if",
"(",
"values",
"instanceof",
"EsRequest",
"[",
"]",
")",
"{",
"Object",
"[",
"]",
"docs",
"=",
"new",
"Object",
"[",
"values",
".",
"length",
"]",
";... | Adds multivalued property value.
@param name property name.
@param value property values. | [
"Adds",
"multivalued",
"property",
"value",
"."
] | train | https://github.com/ModeShape/modeshape/blob/794cfdabb67a90f24629c4fff0424a6125f8f95b/index-providers/modeshape-elasticsearch-index-provider/src/main/java/org/modeshape/jcr/index/elasticsearch/client/EsRequest.java#L70-L80 |
Jasig/uPortal | uPortal-groups/uPortal-groups-core/src/main/java/org/apereo/portal/groups/RDBMEntityGroupStore.java | RDBMEntityGroupStore.primFind | private IEntityGroup primFind(String groupID, boolean lockable) throws GroupsException {
"""
Find and return an instance of the group.
@param groupID the group ID
@param lockable boolean
@return IEntityGroup
"""
IEntityGroup eg = null;
Connection conn = null;
try {
conn... | java | private IEntityGroup primFind(String groupID, boolean lockable) throws GroupsException {
IEntityGroup eg = null;
Connection conn = null;
try {
conn = RDBMServices.getConnection();
String sql = getFindGroupSql();
PreparedStatement ps = conn.prepareStatement(sql... | [
"private",
"IEntityGroup",
"primFind",
"(",
"String",
"groupID",
",",
"boolean",
"lockable",
")",
"throws",
"GroupsException",
"{",
"IEntityGroup",
"eg",
"=",
"null",
";",
"Connection",
"conn",
"=",
"null",
";",
"try",
"{",
"conn",
"=",
"RDBMServices",
".",
... | Find and return an instance of the group.
@param groupID the group ID
@param lockable boolean
@return IEntityGroup | [
"Find",
"and",
"return",
"an",
"instance",
"of",
"the",
"group",
"."
] | train | https://github.com/Jasig/uPortal/blob/c1986542abb9acd214268f2df21c6305ad2f262b/uPortal-groups/uPortal-groups-core/src/main/java/org/apereo/portal/groups/RDBMEntityGroupStore.java#L1114-L1147 |
Hygieia/Hygieia | collectors/misc/score/src/main/java/com/capitalone/dashboard/ApplicationScoreService.java | ApplicationScoreService.getScoreForApplication | public ScoreMetric getScoreForApplication(ScoreCollectorItem scoreApplication, ScoreCriteriaSettings scoreCriteriaSettings) {
"""
Calculate score for a {@link ScoreCollectorItem}
@param scoreApplication Score Application collector item for a dashboard
@param scoreCriteriaSettings Score Criteria Settings
@retu... | java | public ScoreMetric getScoreForApplication(ScoreCollectorItem scoreApplication, ScoreCriteriaSettings scoreCriteriaSettings) {
Dashboard dashboard = getDashboard(scoreApplication.getDashboardId());
if (null == dashboard) {
LOGGER.info("Dashboard with id " + scoreApplication.getDashboardId() + " is null!")... | [
"public",
"ScoreMetric",
"getScoreForApplication",
"(",
"ScoreCollectorItem",
"scoreApplication",
",",
"ScoreCriteriaSettings",
"scoreCriteriaSettings",
")",
"{",
"Dashboard",
"dashboard",
"=",
"getDashboard",
"(",
"scoreApplication",
".",
"getDashboardId",
"(",
")",
")",
... | Calculate score for a {@link ScoreCollectorItem}
@param scoreApplication Score Application collector item for a dashboard
@param scoreCriteriaSettings Score Criteria Settings
@return Score for dashboard | [
"Calculate",
"score",
"for",
"a",
"{",
"@link",
"ScoreCollectorItem",
"}"
] | train | https://github.com/Hygieia/Hygieia/blob/d8b67a590da2744acf59bcd99d9b34ef1bb84890/collectors/misc/score/src/main/java/com/capitalone/dashboard/ApplicationScoreService.java#L60-L91 |
languagetool-org/languagetool | languagetool-language-modules/de/src/main/java/org/languagetool/rules/de/SubjectVerbAgreementRule.java | SubjectVerbAgreementRule.containsOnlyInfinitivesToTheLeft | private boolean containsOnlyInfinitivesToTheLeft(AnalyzedTokenReadings[] tokens, int startPos) throws IOException {
"""
No false alarm on ""Das Kopieren und Einfügen ist sehr nützlich." etc.
"""
int infinitives = 0;
for (int i = startPos; i > 0; i--) {
String token = tokens[i].getToken();
i... | java | private boolean containsOnlyInfinitivesToTheLeft(AnalyzedTokenReadings[] tokens, int startPos) throws IOException {
int infinitives = 0;
for (int i = startPos; i > 0; i--) {
String token = tokens[i].getToken();
if (tokens[i].hasPartialPosTag("SUB:")) {
AnalyzedTokenReadings lookup = tagger.l... | [
"private",
"boolean",
"containsOnlyInfinitivesToTheLeft",
"(",
"AnalyzedTokenReadings",
"[",
"]",
"tokens",
",",
"int",
"startPos",
")",
"throws",
"IOException",
"{",
"int",
"infinitives",
"=",
"0",
";",
"for",
"(",
"int",
"i",
"=",
"startPos",
";",
"i",
">",
... | No false alarm on ""Das Kopieren und Einfügen ist sehr nützlich." etc. | [
"No",
"false",
"alarm",
"on",
"Das",
"Kopieren",
"und",
"Einfügen",
"ist",
"sehr",
"nützlich",
".",
"etc",
"."
] | train | https://github.com/languagetool-org/languagetool/blob/b7a3d63883d242fb2525877c6382681c57a0a142/languagetool-language-modules/de/src/main/java/org/languagetool/rules/de/SubjectVerbAgreementRule.java#L300-L314 |
matthewhorridge/owlapi-gwt | owlapi-gwt-serialization/src/main/java/uk/ac/manchester/cs/owl/owlapi/OWLDeclarationAxiomImpl_CustomFieldSerializer.java | OWLDeclarationAxiomImpl_CustomFieldSerializer.serializeInstance | @Override
public void serializeInstance(SerializationStreamWriter streamWriter, OWLDeclarationAxiomImpl instance) throws SerializationException {
"""
Serializes the content of the object into the
{@link com.google.gwt.user.client.rpc.SerializationStreamWriter}.
@param streamWriter the {@link com.google.gwt... | java | @Override
public void serializeInstance(SerializationStreamWriter streamWriter, OWLDeclarationAxiomImpl instance) throws SerializationException {
serialize(streamWriter, instance);
} | [
"@",
"Override",
"public",
"void",
"serializeInstance",
"(",
"SerializationStreamWriter",
"streamWriter",
",",
"OWLDeclarationAxiomImpl",
"instance",
")",
"throws",
"SerializationException",
"{",
"serialize",
"(",
"streamWriter",
",",
"instance",
")",
";",
"}"
] | Serializes the content of the object into the
{@link com.google.gwt.user.client.rpc.SerializationStreamWriter}.
@param streamWriter the {@link com.google.gwt.user.client.rpc.SerializationStreamWriter} to write the
object's content to
@param instance the object instance to serialize
@throws com.google.gwt.user.clie... | [
"Serializes",
"the",
"content",
"of",
"the",
"object",
"into",
"the",
"{",
"@link",
"com",
".",
"google",
".",
"gwt",
".",
"user",
".",
"client",
".",
"rpc",
".",
"SerializationStreamWriter",
"}",
"."
] | train | https://github.com/matthewhorridge/owlapi-gwt/blob/7ab975fb6cef3c8947099983551672a3b5d4e2fd/owlapi-gwt-serialization/src/main/java/uk/ac/manchester/cs/owl/owlapi/OWLDeclarationAxiomImpl_CustomFieldSerializer.java#L74-L77 |
google/j2objc | jre_emul/android/platform/libcore/ojluni/src/main/java/java/lang/ThreadLocal.java | ThreadLocal.setInitialValue | private T setInitialValue() {
"""
Variant of set() to establish initialValue. Used instead
of set() in case user has overridden the set() method.
@return the initial value
"""
T value = initialValue();
Thread t = Thread.currentThread();
ThreadLocalMap map = getMap(t);
if (ma... | java | private T setInitialValue() {
T value = initialValue();
Thread t = Thread.currentThread();
ThreadLocalMap map = getMap(t);
if (map != null)
map.set(this, value);
else
createMap(t, value);
return value;
} | [
"private",
"T",
"setInitialValue",
"(",
")",
"{",
"T",
"value",
"=",
"initialValue",
"(",
")",
";",
"Thread",
"t",
"=",
"Thread",
".",
"currentThread",
"(",
")",
";",
"ThreadLocalMap",
"map",
"=",
"getMap",
"(",
"t",
")",
";",
"if",
"(",
"map",
"!=",... | Variant of set() to establish initialValue. Used instead
of set() in case user has overridden the set() method.
@return the initial value | [
"Variant",
"of",
"set",
"()",
"to",
"establish",
"initialValue",
".",
"Used",
"instead",
"of",
"set",
"()",
"in",
"case",
"user",
"has",
"overridden",
"the",
"set",
"()",
"method",
"."
] | train | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/libcore/ojluni/src/main/java/java/lang/ThreadLocal.java#L179-L188 |
lessthanoptimal/ejml | main/ejml-ddense/src/org/ejml/dense/row/CommonOps_DDRM.java | CommonOps_DDRM.permuteRowInv | public static DMatrixRMaj permuteRowInv( int pinv[] , DMatrixRMaj input , DMatrixRMaj output ) {
"""
Applies the row permutation specified by the vector to the input matrix and save the results
in the output matrix. output[perm[j],:] = input[j,:]
@param pinv (Input) Inverse permutation vector. Specifies new ... | java | public static DMatrixRMaj permuteRowInv( int pinv[] , DMatrixRMaj input , DMatrixRMaj output ) {
if( input.numRows > pinv.length )
throw new MatrixDimensionException("permutation vector must have at least as many elements as input has rows");
if( output == null )
output = new DM... | [
"public",
"static",
"DMatrixRMaj",
"permuteRowInv",
"(",
"int",
"pinv",
"[",
"]",
",",
"DMatrixRMaj",
"input",
",",
"DMatrixRMaj",
"output",
")",
"{",
"if",
"(",
"input",
".",
"numRows",
">",
"pinv",
".",
"length",
")",
"throw",
"new",
"MatrixDimensionExcept... | Applies the row permutation specified by the vector to the input matrix and save the results
in the output matrix. output[perm[j],:] = input[j,:]
@param pinv (Input) Inverse permutation vector. Specifies new order of the rows.
@param input (Input) Matrix which is to be permuted
@param output (Output) Matrix which ha... | [
"Applies",
"the",
"row",
"permutation",
"specified",
"by",
"the",
"vector",
"to",
"the",
"input",
"matrix",
"and",
"save",
"the",
"results",
"in",
"the",
"output",
"matrix",
".",
"output",
"[",
"perm",
"[",
"j",
"]",
":",
"]",
"=",
"input",
"[",
"j",
... | train | https://github.com/lessthanoptimal/ejml/blob/1444680cc487af5e866730e62f48f5f9636850d9/main/ejml-ddense/src/org/ejml/dense/row/CommonOps_DDRM.java#L2884-L2897 |
E7du/jfinal-ext3 | src/main/java/com/jfinal/ext/kit/PageViewKit.java | PageViewKit.getPageView | public static String getPageView(String dir, String viewPath, String pageName, String fileExtension) {
"""
获取页面
@param dir 所在目录
@param viewPath view路径
@param pageName view名字
@param fileExtension view后缀
@return
"""
if (!dir.endsWith("/")) {
dir = dir + "/";
}
if (!viewPath.endsWith("/")) {
view... | java | public static String getPageView(String dir, String viewPath, String pageName, String fileExtension){
if (!dir.endsWith("/")) {
dir = dir + "/";
}
if (!viewPath.endsWith("/")) {
viewPath = viewPath + "/";
}
return dir+viewPath+pageName+fileExtension;
} | [
"public",
"static",
"String",
"getPageView",
"(",
"String",
"dir",
",",
"String",
"viewPath",
",",
"String",
"pageName",
",",
"String",
"fileExtension",
")",
"{",
"if",
"(",
"!",
"dir",
".",
"endsWith",
"(",
"\"/\"",
")",
")",
"{",
"dir",
"=",
"dir",
"... | 获取页面
@param dir 所在目录
@param viewPath view路径
@param pageName view名字
@param fileExtension view后缀
@return | [
"获取页面"
] | train | https://github.com/E7du/jfinal-ext3/blob/8ffcbd150fd50c72852bb778bd427b5eb19254dc/src/main/java/com/jfinal/ext/kit/PageViewKit.java#L215-L223 |
denisneuling/apitrary.jar | apitrary-api-client/src/main/java/com/apitrary/api/client/util/ClassUtil.java | ClassUtil.setSilent | public static Object setSilent(Object target, String fieldName, Object value) {
"""
<p>
setSilent.
</p>
@param target
a {@link java.lang.Object} object.
@param fieldName
a {@link java.lang.String} object.
@param value
a {@link java.lang.Object} object.
@return a {@link java.lang.Object} object.
"""
... | java | public static Object setSilent(Object target, String fieldName, Object value) {
Class<?> targetClass = target.getClass();
try {
Field field = targetClass.getDeclaredField(fieldName);
field.setAccessible(true);
field.set(target, box(value, field.getType()));
return target;
} catch (Exception e) {
re... | [
"public",
"static",
"Object",
"setSilent",
"(",
"Object",
"target",
",",
"String",
"fieldName",
",",
"Object",
"value",
")",
"{",
"Class",
"<",
"?",
">",
"targetClass",
"=",
"target",
".",
"getClass",
"(",
")",
";",
"try",
"{",
"Field",
"field",
"=",
"... | <p>
setSilent.
</p>
@param target
a {@link java.lang.Object} object.
@param fieldName
a {@link java.lang.String} object.
@param value
a {@link java.lang.Object} object.
@return a {@link java.lang.Object} object. | [
"<p",
">",
"setSilent",
".",
"<",
"/",
"p",
">"
] | train | https://github.com/denisneuling/apitrary.jar/blob/b7f639a1e735c60ba2b1b62851926757f5de8628/apitrary-api-client/src/main/java/com/apitrary/api/client/util/ClassUtil.java#L286-L296 |
onepf/OpenIAB | library/src/main/java/org/onepf/oms/SkuManager.java | SkuManager.getStoreSku | @NotNull
public String getStoreSku(@NotNull String appstoreName, @NotNull String sku) {
"""
Returns a store-specific SKU by the base internal SKU.
@param appstoreName The name of an app store.
@param sku The internal SKU.
@return store-specific SKU by a base internal one.
@throws java.lang.Illeg... | java | @NotNull
public String getStoreSku(@NotNull String appstoreName, @NotNull String sku) {
if (TextUtils.isEmpty(appstoreName)) {
throw SkuMappingException.newInstance(SkuMappingException.REASON_STORE_NAME);
}
if (TextUtils.isEmpty(sku)) {
throw SkuMappingException.newIn... | [
"@",
"NotNull",
"public",
"String",
"getStoreSku",
"(",
"@",
"NotNull",
"String",
"appstoreName",
",",
"@",
"NotNull",
"String",
"sku",
")",
"{",
"if",
"(",
"TextUtils",
".",
"isEmpty",
"(",
"appstoreName",
")",
")",
"{",
"throw",
"SkuMappingException",
".",... | Returns a store-specific SKU by the base internal SKU.
@param appstoreName The name of an app store.
@param sku The internal SKU.
@return store-specific SKU by a base internal one.
@throws java.lang.IllegalArgumentException When appstoreName or sku param is empty or null value.
@see #mapSku(String, String, St... | [
"Returns",
"a",
"store",
"-",
"specific",
"SKU",
"by",
"the",
"base",
"internal",
"SKU",
"."
] | train | https://github.com/onepf/OpenIAB/blob/90552d53c5303b322940d96a0c4b7cb797d78760/library/src/main/java/org/onepf/oms/SkuManager.java#L160-L176 |
apache/incubator-gobblin | gobblin-runtime/src/main/java/org/apache/gobblin/runtime/cli/CliOptions.java | CliOptions.parseArgs | public static Properties parseArgs(Class<?> caller, String[] args) throws IOException {
"""
Parse command line arguments and return a {@link java.util.Properties} object for the gobblin job found.
@param caller Class of the calling main method. Used for error logs.
@param args Command line arguments.
@return In... | java | public static Properties parseArgs(Class<?> caller, String[] args) throws IOException {
try {
// Parse command-line options
CommandLine cmd = new DefaultParser().parse(options(), args);
if (cmd.hasOption(HELP_OPTION.getOpt())) {
printUsage(caller);
System.exit(0);
}
i... | [
"public",
"static",
"Properties",
"parseArgs",
"(",
"Class",
"<",
"?",
">",
"caller",
",",
"String",
"[",
"]",
"args",
")",
"throws",
"IOException",
"{",
"try",
"{",
"// Parse command-line options",
"CommandLine",
"cmd",
"=",
"new",
"DefaultParser",
"(",
")",
... | Parse command line arguments and return a {@link java.util.Properties} object for the gobblin job found.
@param caller Class of the calling main method. Used for error logs.
@param args Command line arguments.
@return Instance of {@link Properties} for the Gobblin job to run.
@throws IOException | [
"Parse",
"command",
"line",
"arguments",
"and",
"return",
"a",
"{"
] | train | https://github.com/apache/incubator-gobblin/blob/f029b4c0fea0fe4aa62f36dda2512344ff708bae/gobblin-runtime/src/main/java/org/apache/gobblin/runtime/cli/CliOptions.java#L53-L76 |
pmwmedia/tinylog | tinylog-impl/src/main/java/org/tinylog/core/ConfigurationParser.java | ConfigurationParser.parse | private static Level parse(final String property, final Level defaultValue) {
"""
Reads a severity level from configuration.
@param property
Key of property
@param defaultValue
Default value, if property doesn't exist or is invalid
@return Severity level
"""
if (property == null) {
return defaultVa... | java | private static Level parse(final String property, final Level defaultValue) {
if (property == null) {
return defaultValue;
} else {
try {
return Level.valueOf(property.toUpperCase(Locale.ROOT));
} catch (IllegalArgumentException ex) {
InternalLogger.log(Level.ERROR, "Illegal severity level: " + pro... | [
"private",
"static",
"Level",
"parse",
"(",
"final",
"String",
"property",
",",
"final",
"Level",
"defaultValue",
")",
"{",
"if",
"(",
"property",
"==",
"null",
")",
"{",
"return",
"defaultValue",
";",
"}",
"else",
"{",
"try",
"{",
"return",
"Level",
"."... | Reads a severity level from configuration.
@param property
Key of property
@param defaultValue
Default value, if property doesn't exist or is invalid
@return Severity level | [
"Reads",
"a",
"severity",
"level",
"from",
"configuration",
"."
] | train | https://github.com/pmwmedia/tinylog/blob/d03d4ef84a1310155037e08ca8822a91697d1086/tinylog-impl/src/main/java/org/tinylog/core/ConfigurationParser.java#L223-L234 |
bwkimmel/java-util | src/main/java/ca/eandb/util/sql/DbUtil.java | DbUtil.getTypeName | private static String getTypeName(int type, int length, ResultSet typeInfo) throws SQLException {
"""
Gets the <code>String</code> denoting the specified SQL data type.
@param type The data type to get the name of. Valid type values
consist of the static fields of {@link java.sql.Types}.
@param length The leng... | java | private static String getTypeName(int type, int length, ResultSet typeInfo) throws SQLException {
int dataTypeColumn = typeInfo.findColumn("DATA_TYPE");
while (typeInfo.next()) {
if (typeInfo.getInt(dataTypeColumn) == type) {
String typeName = typeInfo.getString("TYPE_NAME");
if (length > ... | [
"private",
"static",
"String",
"getTypeName",
"(",
"int",
"type",
",",
"int",
"length",
",",
"ResultSet",
"typeInfo",
")",
"throws",
"SQLException",
"{",
"int",
"dataTypeColumn",
"=",
"typeInfo",
".",
"findColumn",
"(",
"\"DATA_TYPE\"",
")",
";",
"while",
"(",... | Gets the <code>String</code> denoting the specified SQL data type.
@param type The data type to get the name of. Valid type values
consist of the static fields of {@link java.sql.Types}.
@param length The length to assign to data types for those types
that require a length (e.g., <code>VARCHAR(n)</code>), or zero
to i... | [
"Gets",
"the",
"<code",
">",
"String<",
"/",
"code",
">",
"denoting",
"the",
"specified",
"SQL",
"data",
"type",
"."
] | train | https://github.com/bwkimmel/java-util/blob/0c03664d42f0e6b111f64447f222aa73c2819e5c/src/main/java/ca/eandb/util/sql/DbUtil.java#L521-L538 |
mediathekview/MLib | src/main/java/de/mediathekview/mlib/tool/TimedTextMarkupLanguageParser.java | TimedTextMarkupLanguageParser.toSrt | public void toSrt(Path srtFile) {
"""
Convert internal representation into SubRip Text Format and save to file.
"""
try (FileOutputStream fos = new FileOutputStream(srtFile.toFile());
OutputStreamWriter osw = new OutputStreamWriter(fos, Charset.forName("UTF-8"));
PrintWriter w... | java | public void toSrt(Path srtFile) {
try (FileOutputStream fos = new FileOutputStream(srtFile.toFile());
OutputStreamWriter osw = new OutputStreamWriter(fos, Charset.forName("UTF-8"));
PrintWriter writer = new PrintWriter(osw)) {
long counter = 1;
for (Subtitle tit... | [
"public",
"void",
"toSrt",
"(",
"Path",
"srtFile",
")",
"{",
"try",
"(",
"FileOutputStream",
"fos",
"=",
"new",
"FileOutputStream",
"(",
"srtFile",
".",
"toFile",
"(",
")",
")",
";",
"OutputStreamWriter",
"osw",
"=",
"new",
"OutputStreamWriter",
"(",
"fos",
... | Convert internal representation into SubRip Text Format and save to file. | [
"Convert",
"internal",
"representation",
"into",
"SubRip",
"Text",
"Format",
"and",
"save",
"to",
"file",
"."
] | train | https://github.com/mediathekview/MLib/blob/01fd5791d87390fea7536275b8a2d4407fc00908/src/main/java/de/mediathekview/mlib/tool/TimedTextMarkupLanguageParser.java#L296-L320 |
stapler/stapler | core/src/main/java/org/kohsuke/stapler/lang/KlassNavigator.java | KlassNavigator.getMapElement | public Object getMapElement(Object o, String key) {
"""
Given an instance for which the type reported {@code isMap()==true}, obtains the element
of the specified index.
"""
return ((Map)o).get(key);
} | java | public Object getMapElement(Object o, String key) {
return ((Map)o).get(key);
} | [
"public",
"Object",
"getMapElement",
"(",
"Object",
"o",
",",
"String",
"key",
")",
"{",
"return",
"(",
"(",
"Map",
")",
"o",
")",
".",
"get",
"(",
"key",
")",
";",
"}"
] | Given an instance for which the type reported {@code isMap()==true}, obtains the element
of the specified index. | [
"Given",
"an",
"instance",
"for",
"which",
"the",
"type",
"reported",
"{"
] | train | https://github.com/stapler/stapler/blob/11ad5af185e062fb46e01bf9fbed66f3ebf2a8f7/core/src/main/java/org/kohsuke/stapler/lang/KlassNavigator.java#L137-L139 |
super-csv/super-csv | super-csv/src/main/java/org/supercsv/cellprocessor/Truncate.java | Truncate.checkPreconditions | private static void checkPreconditions(final int maxSize, final String suffix) {
"""
Checks the preconditions for creating a new Truncate processor.
@param maxSize
the maximum size of the String
@param suffix
the String to append if the input is truncated (e.g. "...")
@throws IllegalArgumentException
if {@... | java | private static void checkPreconditions(final int maxSize, final String suffix) {
if( maxSize <= 0 ) {
throw new IllegalArgumentException(String.format("maxSize should be > 0 but was %d", maxSize));
}
if( suffix == null ) {
throw new NullPointerException("suffix should not be null");
}
} | [
"private",
"static",
"void",
"checkPreconditions",
"(",
"final",
"int",
"maxSize",
",",
"final",
"String",
"suffix",
")",
"{",
"if",
"(",
"maxSize",
"<=",
"0",
")",
"{",
"throw",
"new",
"IllegalArgumentException",
"(",
"String",
".",
"format",
"(",
"\"maxSiz... | Checks the preconditions for creating a new Truncate processor.
@param maxSize
the maximum size of the String
@param suffix
the String to append if the input is truncated (e.g. "...")
@throws IllegalArgumentException
if {@code maxSize <= 0}
@throws NullPointerException
if suffix is null | [
"Checks",
"the",
"preconditions",
"for",
"creating",
"a",
"new",
"Truncate",
"processor",
"."
] | train | https://github.com/super-csv/super-csv/blob/f18db724674dc1c4116e25142c1b5403ebf43e96/super-csv/src/main/java/org/supercsv/cellprocessor/Truncate.java#L128-L135 |
gfk-ba/senbot | SenBotRunner/src/main/java/com/gfk/senbot/framework/context/SeleniumManager.java | SeleniumManager.getViewRepresentation | public <T> T getViewRepresentation(Class<T> T, boolean forceRefresh) {
"""
Check {@link PageFactory} for how these Objects are instantiated using the {@link FindBy} and {@link FindBys} annotations.
Senbot will cache your objects in the Scenario globals so that they only get initialized once
@param T
@param fo... | java | public <T> T getViewRepresentation(Class<T> T, boolean forceRefresh) {
ScenarioGlobals currentScenarioGlobals = SenBotContext.getSenBotContext().getCucumberManager().getCurrentScenarioGlobals();
T foundView = currentScenarioGlobals == null ? null : (T) currentScenarioGlobals.getAttribute(T.getName());
if... | [
"public",
"<",
"T",
">",
"T",
"getViewRepresentation",
"(",
"Class",
"<",
"T",
">",
"T",
",",
"boolean",
"forceRefresh",
")",
"{",
"ScenarioGlobals",
"currentScenarioGlobals",
"=",
"SenBotContext",
".",
"getSenBotContext",
"(",
")",
".",
"getCucumberManager",
"(... | Check {@link PageFactory} for how these Objects are instantiated using the {@link FindBy} and {@link FindBys} annotations.
Senbot will cache your objects in the Scenario globals so that they only get initialized once
@param T
@param forceRefresh if true we will always reinstantiate
@return instanciated T | [
"Check",
"{",
"@link",
"PageFactory",
"}",
"for",
"how",
"these",
"Objects",
"are",
"instantiated",
"using",
"the",
"{",
"@link",
"FindBy",
"}",
"and",
"{",
"@link",
"FindBys",
"}",
"annotations",
".",
"Senbot",
"will",
"cache",
"your",
"objects",
"in",
"t... | train | https://github.com/gfk-ba/senbot/blob/e9a152aa67be48b1bb13a4691655caf6d873b553/SenBotRunner/src/main/java/com/gfk/senbot/framework/context/SeleniumManager.java#L152-L162 |
wildfly/wildfly-core | domain-management/src/main/java/org/jboss/as/domain/management/security/PropertiesFileLoader.java | PropertiesFileLoader.addLineContent | protected void addLineContent(BufferedReader bufferedFileReader, List<String> content, String line) throws IOException {
"""
Add the line to the content
@param bufferedFileReader The file reader
@param content The content of the file
@param line The current read line
@throws IOExcept... | java | protected void addLineContent(BufferedReader bufferedFileReader, List<String> content, String line) throws IOException {
content.add(line);
} | [
"protected",
"void",
"addLineContent",
"(",
"BufferedReader",
"bufferedFileReader",
",",
"List",
"<",
"String",
">",
"content",
",",
"String",
"line",
")",
"throws",
"IOException",
"{",
"content",
".",
"add",
"(",
"line",
")",
";",
"}"
] | Add the line to the content
@param bufferedFileReader The file reader
@param content The content of the file
@param line The current read line
@throws IOException | [
"Add",
"the",
"line",
"to",
"the",
"content"
] | train | https://github.com/wildfly/wildfly-core/blob/cfaf0479dcbb2d320a44c5374b93b944ec39fade/domain-management/src/main/java/org/jboss/as/domain/management/security/PropertiesFileLoader.java#L301-L303 |
ebean-orm/querybean-agent-now-merged-into-ebean-agent- | src/main/java/io/ebean/typequery/agent/ClassInfo.java | ClassInfo.addAssocBeanExtras | public void addAssocBeanExtras(ClassVisitor cv) {
"""
Add fields and constructors to assoc type query beans as necessary.
"""
if (isLog(3)) {
String msg = "... add fields";
if (!hasBasicConstructor) {
msg += ", basic constructor";
}
if (!hasMainConstructor) {
msg +=... | java | public void addAssocBeanExtras(ClassVisitor cv) {
if (isLog(3)) {
String msg = "... add fields";
if (!hasBasicConstructor) {
msg += ", basic constructor";
}
if (!hasMainConstructor) {
msg += ", main constructor";
}
log(msg);
}
if (!hasBasicConstructor) {... | [
"public",
"void",
"addAssocBeanExtras",
"(",
"ClassVisitor",
"cv",
")",
"{",
"if",
"(",
"isLog",
"(",
"3",
")",
")",
"{",
"String",
"msg",
"=",
"\"... add fields\"",
";",
"if",
"(",
"!",
"hasBasicConstructor",
")",
"{",
"msg",
"+=",
"\", basic constructor\""... | Add fields and constructors to assoc type query beans as necessary. | [
"Add",
"fields",
"and",
"constructors",
"to",
"assoc",
"type",
"query",
"beans",
"as",
"necessary",
"."
] | train | https://github.com/ebean-orm/querybean-agent-now-merged-into-ebean-agent-/blob/a063554fabdbed15ff5e10ad0a0b53b67e039006/src/main/java/io/ebean/typequery/agent/ClassInfo.java#L185-L207 |
FedericoPecora/meta-csp-framework | src/main/java/org/metacsp/multi/spatioTemporal/paths/TrajectoryEnvelope.java | TrajectoryEnvelope.setFootprint | public void setFootprint(double w, double l, double dw, double dl) {
"""
Set the footprint of this {@link TrajectoryEnvelope}, which is used for computing the spatial envelope.
@param w The width of the robot's footprint (dimension along the perpendicular to the driving direction).
@param l The length of the rob... | java | public void setFootprint(double w, double l, double dw, double dl) {
this.initFootprint(w, l, dw, dl);
} | [
"public",
"void",
"setFootprint",
"(",
"double",
"w",
",",
"double",
"l",
",",
"double",
"dw",
",",
"double",
"dl",
")",
"{",
"this",
".",
"initFootprint",
"(",
"w",
",",
"l",
",",
"dw",
",",
"dl",
")",
";",
"}"
] | Set the footprint of this {@link TrajectoryEnvelope}, which is used for computing the spatial envelope.
@param w The width of the robot's footprint (dimension along the perpendicular to the driving direction).
@param l The length of the robot's footprint (dimension along the driving direction).
@param dw Lateral displa... | [
"Set",
"the",
"footprint",
"of",
"this",
"{"
] | train | https://github.com/FedericoPecora/meta-csp-framework/blob/42aaef2e2b76d0f738427f0dd9653c4f62b40517/src/main/java/org/metacsp/multi/spatioTemporal/paths/TrajectoryEnvelope.java#L183-L185 |
aws/aws-sdk-java | aws-java-sdk-dynamodb/src/main/java/com/amazonaws/services/dynamodbv2/util/TableUtils.java | TableUtils.createTableIfNotExists | public static final boolean createTableIfNotExists(final AmazonDynamoDB dynamo, final CreateTableRequest createTableRequest) {
"""
Creates the table and ignores any errors if it already exists.
@param dynamo The Dynamo client to use.
@param createTableRequest The create table request.
@return True if created, f... | java | public static final boolean createTableIfNotExists(final AmazonDynamoDB dynamo, final CreateTableRequest createTableRequest) {
try {
dynamo.createTable(createTableRequest);
return true;
} catch (final ResourceInUseException e) {
if (LOG.isTraceEnabled()) {
... | [
"public",
"static",
"final",
"boolean",
"createTableIfNotExists",
"(",
"final",
"AmazonDynamoDB",
"dynamo",
",",
"final",
"CreateTableRequest",
"createTableRequest",
")",
"{",
"try",
"{",
"dynamo",
".",
"createTable",
"(",
"createTableRequest",
")",
";",
"return",
"... | Creates the table and ignores any errors if it already exists.
@param dynamo The Dynamo client to use.
@param createTableRequest The create table request.
@return True if created, false otherwise. | [
"Creates",
"the",
"table",
"and",
"ignores",
"any",
"errors",
"if",
"it",
"already",
"exists",
"."
] | train | https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-dynamodb/src/main/java/com/amazonaws/services/dynamodbv2/util/TableUtils.java#L233-L243 |
pravega/pravega | controller/src/main/java/io/pravega/controller/metrics/StreamMetrics.java | StreamMetrics.updateStreamFailed | public void updateStreamFailed(String scope, String streamName) {
"""
This method increments the counter of failed Stream update operations in the system as well as the failed
update attempts for this specific Stream.
@param scope Scope.
@param streamName Name of the Stream.
"""
DYNAMIC... | java | public void updateStreamFailed(String scope, String streamName) {
DYNAMIC_LOGGER.incCounterValue(globalMetricName(UPDATE_STREAM_FAILED), 1);
DYNAMIC_LOGGER.incCounterValue(UPDATE_STREAM_FAILED, 1, streamTags(scope, streamName));
} | [
"public",
"void",
"updateStreamFailed",
"(",
"String",
"scope",
",",
"String",
"streamName",
")",
"{",
"DYNAMIC_LOGGER",
".",
"incCounterValue",
"(",
"globalMetricName",
"(",
"UPDATE_STREAM_FAILED",
")",
",",
"1",
")",
";",
"DYNAMIC_LOGGER",
".",
"incCounterValue",
... | This method increments the counter of failed Stream update operations in the system as well as the failed
update attempts for this specific Stream.
@param scope Scope.
@param streamName Name of the Stream. | [
"This",
"method",
"increments",
"the",
"counter",
"of",
"failed",
"Stream",
"update",
"operations",
"in",
"the",
"system",
"as",
"well",
"as",
"the",
"failed",
"update",
"attempts",
"for",
"this",
"specific",
"Stream",
"."
] | train | https://github.com/pravega/pravega/blob/6e24df7470669b3956a07018f52b2c6b3c2a3503/controller/src/main/java/io/pravega/controller/metrics/StreamMetrics.java#L152-L155 |
redkale/redkale-plugins | src/org/redkalex/convert/pson/ProtobufReader.java | ProtobufReader.readArrayB | @Override
public final int readArrayB(DeMember member, byte[] typevals, Decodeable componentDecoder) {
"""
判断下一个非空白字符是否为[
@param member DeMember
@param typevals byte[]
@param componentDecoder Decodeable
@return SIGN_NOLENGTH 或 SIGN_NULL
"""
if (member == null || componen... | java | @Override
public final int readArrayB(DeMember member, byte[] typevals, Decodeable componentDecoder) {
if (member == null || componentDecoder == null) return Reader.SIGN_NOLENBUTBYTES;
Type type = componentDecoder.getType();
if (!(type instanceof Class)) return Reader.SIGN_NOLENBUTBYTES;... | [
"@",
"Override",
"public",
"final",
"int",
"readArrayB",
"(",
"DeMember",
"member",
",",
"byte",
"[",
"]",
"typevals",
",",
"Decodeable",
"componentDecoder",
")",
"{",
"if",
"(",
"member",
"==",
"null",
"||",
"componentDecoder",
"==",
"null",
")",
"return",
... | 判断下一个非空白字符是否为[
@param member DeMember
@param typevals byte[]
@param componentDecoder Decodeable
@return SIGN_NOLENGTH 或 SIGN_NULL | [
"判断下一个非空白字符是否为",
"["
] | train | https://github.com/redkale/redkale-plugins/blob/a1edfc906a444ae19fe6aababce2957c9b5ea9d2/src/org/redkalex/convert/pson/ProtobufReader.java#L104-L118 |
auth0/Lock.Android | lib/src/main/java/com/auth0/android/lock/views/ViewUtils.java | ViewUtils.dipToPixels | static float dipToPixels(Resources resources, int dip) {
"""
Converts dp into px.
@param resources the context's current resources.
@param dip the dp value to convert to px.
@return the result px value.
"""
return TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_DIP, dip, resources.getDispl... | java | static float dipToPixels(Resources resources, int dip) {
return TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_DIP, dip, resources.getDisplayMetrics());
} | [
"static",
"float",
"dipToPixels",
"(",
"Resources",
"resources",
",",
"int",
"dip",
")",
"{",
"return",
"TypedValue",
".",
"applyDimension",
"(",
"TypedValue",
".",
"COMPLEX_UNIT_DIP",
",",
"dip",
",",
"resources",
".",
"getDisplayMetrics",
"(",
")",
")",
";",... | Converts dp into px.
@param resources the context's current resources.
@param dip the dp value to convert to px.
@return the result px value. | [
"Converts",
"dp",
"into",
"px",
"."
] | train | https://github.com/auth0/Lock.Android/blob/8eb2a979048d2eb6cf0ec631e82e6c3fe6e7d220/lib/src/main/java/com/auth0/android/lock/views/ViewUtils.java#L75-L77 |
wcm-io/wcm-io-caconfig | extensions/src/main/java/io/wcm/caconfig/extensions/persistence/impl/ToolsConfigPagePersistenceStrategy.java | ToolsConfigPagePersistenceStrategy.findConfigRefs | @SuppressWarnings("unchecked")
private Iterator<String> findConfigRefs(@NotNull final Resource startResource, @NotNull final Collection<String> bucketNames) {
"""
Searches the resource hierarchy upwards for all config references and returns them.
"""
// collect all context path resources (but filter out... | java | @SuppressWarnings("unchecked")
private Iterator<String> findConfigRefs(@NotNull final Resource startResource, @NotNull final Collection<String> bucketNames) {
// collect all context path resources (but filter out those without config reference)
final Iterator<ContextResource> contextResources = new FilterIte... | [
"@",
"SuppressWarnings",
"(",
"\"unchecked\"",
")",
"private",
"Iterator",
"<",
"String",
">",
"findConfigRefs",
"(",
"@",
"NotNull",
"final",
"Resource",
"startResource",
",",
"@",
"NotNull",
"final",
"Collection",
"<",
"String",
">",
"bucketNames",
")",
"{",
... | Searches the resource hierarchy upwards for all config references and returns them. | [
"Searches",
"the",
"resource",
"hierarchy",
"upwards",
"for",
"all",
"config",
"references",
"and",
"returns",
"them",
"."
] | train | https://github.com/wcm-io/wcm-io-caconfig/blob/48592eadb0b62a09eec555cedfae7e00b213f6ed/extensions/src/main/java/io/wcm/caconfig/extensions/persistence/impl/ToolsConfigPagePersistenceStrategy.java#L246-L272 |
spotify/helios | helios-services/src/main/java/com/spotify/helios/servicescommon/ServiceRegistrars.java | ServiceRegistrars.createFactory | private static ServiceRegistrarFactory createFactory() {
"""
Get a registrar factory from the application class loader.
@return The ServiceRegistrarFactory object.
"""
final ServiceRegistrarFactory factory;
final ServiceRegistrarFactory installed;
try {
installed = ServiceRegistrarLoader.l... | java | private static ServiceRegistrarFactory createFactory() {
final ServiceRegistrarFactory factory;
final ServiceRegistrarFactory installed;
try {
installed = ServiceRegistrarLoader.load();
} catch (ServiceRegistrarLoadingException e) {
throw new RuntimeException("Unable to load service registra... | [
"private",
"static",
"ServiceRegistrarFactory",
"createFactory",
"(",
")",
"{",
"final",
"ServiceRegistrarFactory",
"factory",
";",
"final",
"ServiceRegistrarFactory",
"installed",
";",
"try",
"{",
"installed",
"=",
"ServiceRegistrarLoader",
".",
"load",
"(",
")",
";"... | Get a registrar factory from the application class loader.
@return The ServiceRegistrarFactory object. | [
"Get",
"a",
"registrar",
"factory",
"from",
"the",
"application",
"class",
"loader",
"."
] | train | https://github.com/spotify/helios/blob/c9000bc1d6908651570be8b057d4981bba4df5b4/helios-services/src/main/java/com/spotify/helios/servicescommon/ServiceRegistrars.java#L107-L124 |
SimiaCryptus/utilities | java-util/src/main/java/com/simiacryptus/text/ConvolutionalTrieSerializer.java | ConvolutionalTrieSerializer.getUpperBound | protected long getUpperBound(TrieNode currentParent, AtomicLong currentChildren, TrieNode godchildNode, int godchildAdjustment) {
"""
Gets upper bound.
@param currentParent the current parent
@param currentChildren the current children
@param godchildNode the godchild node
@param godchildAdjust... | java | protected long getUpperBound(TrieNode currentParent, AtomicLong currentChildren, TrieNode godchildNode, int godchildAdjustment) {
return Math.min(
currentParent.getCursorCount() - currentChildren.get(),
godchildNode.getCursorCount() - godchildAdjustment);
} | [
"protected",
"long",
"getUpperBound",
"(",
"TrieNode",
"currentParent",
",",
"AtomicLong",
"currentChildren",
",",
"TrieNode",
"godchildNode",
",",
"int",
"godchildAdjustment",
")",
"{",
"return",
"Math",
".",
"min",
"(",
"currentParent",
".",
"getCursorCount",
"(",... | Gets upper bound.
@param currentParent the current parent
@param currentChildren the current children
@param godchildNode the godchild node
@param godchildAdjustment the godchild adjustment
@return the upper bound | [
"Gets",
"upper",
"bound",
"."
] | train | https://github.com/SimiaCryptus/utilities/blob/b5a5e73449aae57de7dbfca2ed7a074432c5b17e/java-util/src/main/java/com/simiacryptus/text/ConvolutionalTrieSerializer.java#L237-L241 |
OpenLiberty/open-liberty | dev/com.ibm.ws.channelfw/src/com/ibm/ws/channelfw/internal/ChannelFrameworkImpl.java | ChannelFrameworkImpl.setChannelState | private synchronized void setChannelState(String channelName, RuntimeState state) {
"""
Set the channel state of a given channel.
@param channelName
@param state
"""
if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {
Tr.debug(tc, "setChannelState channelName=" + channelN... | java | private synchronized void setChannelState(String channelName, RuntimeState state) {
if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {
Tr.debug(tc, "setChannelState channelName=" + channelName + ", state=" + state.ordinal);
}
if (null != channelName) {
Cha... | [
"private",
"synchronized",
"void",
"setChannelState",
"(",
"String",
"channelName",
",",
"RuntimeState",
"state",
")",
"{",
"if",
"(",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
"&&",
"tc",
".",
"isDebugEnabled",
"(",
")",
")",
"{",
"Tr",
".",
"... | Set the channel state of a given channel.
@param channelName
@param state | [
"Set",
"the",
"channel",
"state",
"of",
"a",
"given",
"channel",
"."
] | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.channelfw/src/com/ibm/ws/channelfw/internal/ChannelFrameworkImpl.java#L4097-L4107 |
algolia/algoliasearch-client-java | src/main/java/com/algolia/search/saas/Index.java | Index.saveSynonym | public JSONObject saveSynonym(String objectID, JSONObject content, RequestOptions requestOptions) throws AlgoliaException {
"""
Update one synonym
@param objectID The objectId of the synonym to save
@param content The new content of this synonym
@param requestOptions Options to pass to this reque... | java | public JSONObject saveSynonym(String objectID, JSONObject content, RequestOptions requestOptions) throws AlgoliaException {
return saveSynonym(objectID, content, false, requestOptions);
} | [
"public",
"JSONObject",
"saveSynonym",
"(",
"String",
"objectID",
",",
"JSONObject",
"content",
",",
"RequestOptions",
"requestOptions",
")",
"throws",
"AlgoliaException",
"{",
"return",
"saveSynonym",
"(",
"objectID",
",",
"content",
",",
"false",
",",
"requestOpti... | Update one synonym
@param objectID The objectId of the synonym to save
@param content The new content of this synonym
@param requestOptions Options to pass to this request | [
"Update",
"one",
"synonym"
] | train | https://github.com/algolia/algoliasearch-client-java/blob/a05da2f66c099fe6f77295c7b6a8a12c24e95f9b/src/main/java/com/algolia/search/saas/Index.java#L1676-L1678 |
fcrepo3/fcrepo | fcrepo-server/src/main/java/org/fcrepo/server/utilities/SQLUtility.java | SQLUtility.getLongString | public static String getLongString(ResultSet rs, int pos)
throws SQLException {
"""
Get a long string, which could be a TEXT or CLOB type. (CLOBs require
special handling -- this method normalizes the reading of them)
"""
return instance.i_getLongString(rs, pos);
} | java | public static String getLongString(ResultSet rs, int pos)
throws SQLException {
return instance.i_getLongString(rs, pos);
} | [
"public",
"static",
"String",
"getLongString",
"(",
"ResultSet",
"rs",
",",
"int",
"pos",
")",
"throws",
"SQLException",
"{",
"return",
"instance",
".",
"i_getLongString",
"(",
"rs",
",",
"pos",
")",
";",
"}"
] | Get a long string, which could be a TEXT or CLOB type. (CLOBs require
special handling -- this method normalizes the reading of them) | [
"Get",
"a",
"long",
"string",
"which",
"could",
"be",
"a",
"TEXT",
"or",
"CLOB",
"type",
".",
"(",
"CLOBs",
"require",
"special",
"handling",
"--",
"this",
"method",
"normalizes",
"the",
"reading",
"of",
"them",
")"
] | train | https://github.com/fcrepo3/fcrepo/blob/37df51b9b857fd12c6ab8269820d406c3c4ad774/fcrepo-server/src/main/java/org/fcrepo/server/utilities/SQLUtility.java#L140-L143 |
sarl/sarl | docs/io.sarl.docs.doclet/src/main/java/io/sarl/docs/doclet/SarlDoclet.java | SarlDoclet.validOptions | public static boolean validOptions(String[][] options, DocErrorReporter reporter) {
"""
Validate the given options.
@param options the options to validate, which their parameters.
@param reporter the receiver of errors.
@return the validation status.
"""
return SARL_DOCLET.configuration.validOptions(opt... | java | public static boolean validOptions(String[][] options, DocErrorReporter reporter) {
return SARL_DOCLET.configuration.validOptions(options, reporter);
} | [
"public",
"static",
"boolean",
"validOptions",
"(",
"String",
"[",
"]",
"[",
"]",
"options",
",",
"DocErrorReporter",
"reporter",
")",
"{",
"return",
"SARL_DOCLET",
".",
"configuration",
".",
"validOptions",
"(",
"options",
",",
"reporter",
")",
";",
"}"
] | Validate the given options.
@param options the options to validate, which their parameters.
@param reporter the receiver of errors.
@return the validation status. | [
"Validate",
"the",
"given",
"options",
"."
] | train | https://github.com/sarl/sarl/blob/ca00ff994598c730339972def4e19a60e0b8cace/docs/io.sarl.docs.doclet/src/main/java/io/sarl/docs/doclet/SarlDoclet.java#L104-L106 |
FedericoPecora/meta-csp-framework | src/main/java/org/metacsp/multi/spatial/DE9IM/DE9IMRelation.java | DE9IMRelation.isRelation | public static boolean isRelation(GeometricShapeVariable gv1, GeometricShapeVariable gv2, DE9IMRelation.Type t) {
"""
Check if the spatial relation between two {@link GeometricShapeVariable}s is of a given type.
@param gv1 The source {@link GeometricShapeVariable}.
@param gv2 The destination {@link GeometricShape... | java | public static boolean isRelation(GeometricShapeVariable gv1, GeometricShapeVariable gv2, DE9IMRelation.Type t) {
try {
String methodName = t.name().substring(0, 1).toLowerCase() + t.name().substring(1);
Method m = Geometry.class.getMethod(methodName, Geometry.class);
Geometry g1 = ((GeometricShapeDomain)gv1.... | [
"public",
"static",
"boolean",
"isRelation",
"(",
"GeometricShapeVariable",
"gv1",
",",
"GeometricShapeVariable",
"gv2",
",",
"DE9IMRelation",
".",
"Type",
"t",
")",
"{",
"try",
"{",
"String",
"methodName",
"=",
"t",
".",
"name",
"(",
")",
".",
"substring",
... | Check if the spatial relation between two {@link GeometricShapeVariable}s is of a given type.
@param gv1 The source {@link GeometricShapeVariable}.
@param gv2 The destination {@link GeometricShapeVariable}.
@param t The type of relation to check.
@return <code>true</code> iff the given variables are in the given relati... | [
"Check",
"if",
"the",
"spatial",
"relation",
"between",
"two",
"{"
] | train | https://github.com/FedericoPecora/meta-csp-framework/blob/42aaef2e2b76d0f738427f0dd9653c4f62b40517/src/main/java/org/metacsp/multi/spatial/DE9IM/DE9IMRelation.java#L78-L92 |
hazelcast/hazelcast | hazelcast/src/main/java/com/hazelcast/internal/cluster/impl/ClusterHeartbeatManager.java | ClusterHeartbeatManager.onHeartbeat | public void onHeartbeat(MemberImpl member, long timestamp) {
"""
Accepts the heartbeat message from {@code member} created at {@code timestamp}. The timestamp must be
related to the cluster clock, not the local clock. The heartbeat is ignored if the duration between
{@code timestamp} and the current cluster time... | java | public void onHeartbeat(MemberImpl member, long timestamp) {
if (member == null) {
return;
}
long clusterTime = clusterClock.getClusterTime();
if (logger.isFineEnabled()) {
logger.fine(format("Received heartbeat from %s (now: %s, timestamp: %s)",
... | [
"public",
"void",
"onHeartbeat",
"(",
"MemberImpl",
"member",
",",
"long",
"timestamp",
")",
"{",
"if",
"(",
"member",
"==",
"null",
")",
"{",
"return",
";",
"}",
"long",
"clusterTime",
"=",
"clusterClock",
".",
"getClusterTime",
"(",
")",
";",
"if",
"("... | Accepts the heartbeat message from {@code member} created at {@code timestamp}. The timestamp must be
related to the cluster clock, not the local clock. The heartbeat is ignored if the duration between
{@code timestamp} and the current cluster time is more than {@link GroupProperty#MAX_NO_HEARTBEAT_SECONDS}/2.
If the s... | [
"Accepts",
"the",
"heartbeat",
"message",
"from",
"{",
"@code",
"member",
"}",
"created",
"at",
"{",
"@code",
"timestamp",
"}",
".",
"The",
"timestamp",
"must",
"be",
"related",
"to",
"the",
"cluster",
"clock",
"not",
"the",
"local",
"clock",
".",
"The",
... | train | https://github.com/hazelcast/hazelcast/blob/8c4bc10515dbbfb41a33e0302c0caedf3cda1baf/hazelcast/src/main/java/com/hazelcast/internal/cluster/impl/ClusterHeartbeatManager.java#L383-L407 |
benmccann/xero-java-client | xjc-plugin/src/main/java/com/connectifier/xeroclient/jaxb/PluginImpl.java | PluginImpl.updateArrayOfSetters | private void updateArrayOfSetters(ClassOutline co, JCodeModel model) {
"""
Update setters to use Java List. For example:
setLineItems(ArrayOfLineItem value) -> setLineItems(List<LineItem> value)
"""
JDefinedClass implClass = co.implClass;
List<JMethod> removedMethods = new ArrayList<>();
Iterator... | java | private void updateArrayOfSetters(ClassOutline co, JCodeModel model) {
JDefinedClass implClass = co.implClass;
List<JMethod> removedMethods = new ArrayList<>();
Iterator<JMethod> iter = implClass.methods().iterator();
while (iter.hasNext()) {
JMethod method = iter.next();
if (method.params(... | [
"private",
"void",
"updateArrayOfSetters",
"(",
"ClassOutline",
"co",
",",
"JCodeModel",
"model",
")",
"{",
"JDefinedClass",
"implClass",
"=",
"co",
".",
"implClass",
";",
"List",
"<",
"JMethod",
">",
"removedMethods",
"=",
"new",
"ArrayList",
"<>",
"(",
")",
... | Update setters to use Java List. For example:
setLineItems(ArrayOfLineItem value) -> setLineItems(List<LineItem> value) | [
"Update",
"setters",
"to",
"use",
"Java",
"List",
".",
"For",
"example",
":",
"setLineItems",
"(",
"ArrayOfLineItem",
"value",
")",
"-",
">",
"setLineItems",
"(",
"List<LineItem",
">",
"value",
")"
] | train | https://github.com/benmccann/xero-java-client/blob/1c84acf36929ea2a4a3ac5f2527a4e9252229f18/xjc-plugin/src/main/java/com/connectifier/xeroclient/jaxb/PluginImpl.java#L92-L124 |
line/armeria | core/src/main/java/com/linecorp/armeria/server/file/AbstractHttpFileBuilder.java | AbstractHttpFileBuilder.contentType | public final B contentType(CharSequence contentType) {
"""
Sets the {@code "content-type"} header. This method is a shortcut of:
<pre>{@code
builder.autoDetectedContentType(false);
builder.setHeader(HttpHeaderNames.CONTENT_TYPE, contentType);
}</pre>
"""
requireNonNull(contentType, "contentType");
... | java | public final B contentType(CharSequence contentType) {
requireNonNull(contentType, "contentType");
autoDetectedContentType(false);
return setHeader(HttpHeaderNames.CONTENT_TYPE, contentType);
} | [
"public",
"final",
"B",
"contentType",
"(",
"CharSequence",
"contentType",
")",
"{",
"requireNonNull",
"(",
"contentType",
",",
"\"contentType\"",
")",
";",
"autoDetectedContentType",
"(",
"false",
")",
";",
"return",
"setHeader",
"(",
"HttpHeaderNames",
".",
"CON... | Sets the {@code "content-type"} header. This method is a shortcut of:
<pre>{@code
builder.autoDetectedContentType(false);
builder.setHeader(HttpHeaderNames.CONTENT_TYPE, contentType);
}</pre> | [
"Sets",
"the",
"{"
] | train | https://github.com/line/armeria/blob/67d29e019fd35a35f89c45cc8f9119ff9b12b44d/core/src/main/java/com/linecorp/armeria/server/file/AbstractHttpFileBuilder.java#L234-L238 |
unbescape/unbescape | src/main/java/org/unbescape/xml/XmlEscape.java | XmlEscape.escapeXml10 | public static String escapeXml10(final String text, final XmlEscapeType type, final XmlEscapeLevel level) {
"""
<p>
Perform a (configurable) XML 1.0 <strong>escape</strong> operation on a <tt>String</tt> input.
</p>
<p>
This method will perform an escape operation according to the specified
{@link org.unbesca... | java | public static String escapeXml10(final String text, final XmlEscapeType type, final XmlEscapeLevel level) {
return escapeXml(text, XmlEscapeSymbols.XML10_SYMBOLS, type, level);
} | [
"public",
"static",
"String",
"escapeXml10",
"(",
"final",
"String",
"text",
",",
"final",
"XmlEscapeType",
"type",
",",
"final",
"XmlEscapeLevel",
"level",
")",
"{",
"return",
"escapeXml",
"(",
"text",
",",
"XmlEscapeSymbols",
".",
"XML10_SYMBOLS",
",",
"type",... | <p>
Perform a (configurable) XML 1.0 <strong>escape</strong> operation on a <tt>String</tt> input.
</p>
<p>
This method will perform an escape operation according to the specified
{@link org.unbescape.xml.XmlEscapeType} and {@link org.unbescape.xml.XmlEscapeLevel}
argument values.
</p>
<p>
All other <tt>String</tt>-bas... | [
"<p",
">",
"Perform",
"a",
"(",
"configurable",
")",
"XML",
"1",
".",
"0",
"<strong",
">",
"escape<",
"/",
"strong",
">",
"operation",
"on",
"a",
"<tt",
">",
"String<",
"/",
"tt",
">",
"input",
".",
"<",
"/",
"p",
">",
"<p",
">",
"This",
"method"... | train | https://github.com/unbescape/unbescape/blob/ec5435fb3508c2eed25d8165dc27ded2602cae13/src/main/java/org/unbescape/xml/XmlEscape.java#L530-L532 |
alkacon/opencms-core | src/org/opencms/site/xmlsitemap/CmsXmlSitemapActionElement.java | CmsXmlSitemapActionElement.createSitemapGenerator | public static CmsXmlSitemapGenerator createSitemapGenerator(String className, String folderRootPath)
throws CmsException {
"""
Creates an XML sitemap generator instance given a class name and the root path for the sitemap.<p>
@param className the class name of the sitemap generator (may be null for the def... | java | public static CmsXmlSitemapGenerator createSitemapGenerator(String className, String folderRootPath)
throws CmsException {
if (CmsStringUtil.isEmptyOrWhitespaceOnly(className)) {
className = (String)(OpenCms.getRuntimeProperty(PARAM_DEFAULT_SITEMAP_GENERATOR));
}
if (CmsSt... | [
"public",
"static",
"CmsXmlSitemapGenerator",
"createSitemapGenerator",
"(",
"String",
"className",
",",
"String",
"folderRootPath",
")",
"throws",
"CmsException",
"{",
"if",
"(",
"CmsStringUtil",
".",
"isEmptyOrWhitespaceOnly",
"(",
"className",
")",
")",
"{",
"class... | Creates an XML sitemap generator instance given a class name and the root path for the sitemap.<p>
@param className the class name of the sitemap generator (may be null for the default
@param folderRootPath the root path of the start folder for the sitemap
@return the sitemap generator instance
@throws CmsException i... | [
"Creates",
"an",
"XML",
"sitemap",
"generator",
"instance",
"given",
"a",
"class",
"name",
"and",
"the",
"root",
"path",
"for",
"the",
"sitemap",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/site/xmlsitemap/CmsXmlSitemapActionElement.java#L88-L109 |
codeprimate-software/cp-elements | src/main/java/org/cp/elements/lang/RuntimeExceptionsFactory.java | RuntimeExceptionsFactory.newIllegalArgumentException | public static IllegalArgumentException newIllegalArgumentException(String message, Object... args) {
"""
Constructs and initializes a new {@link IllegalArgumentException} with the given {@link String message}
formatted with the given {@link Object[] arguments}.
@param message {@link String} describing the {@li... | java | public static IllegalArgumentException newIllegalArgumentException(String message, Object... args) {
return newIllegalArgumentException(null, message, args);
} | [
"public",
"static",
"IllegalArgumentException",
"newIllegalArgumentException",
"(",
"String",
"message",
",",
"Object",
"...",
"args",
")",
"{",
"return",
"newIllegalArgumentException",
"(",
"null",
",",
"message",
",",
"args",
")",
";",
"}"
] | Constructs and initializes a new {@link IllegalArgumentException} with the given {@link String message}
formatted with the given {@link Object[] arguments}.
@param message {@link String} describing the {@link IllegalArgumentException exception}.
@param args {@link Object[] arguments} used to replace format placeholder... | [
"Constructs",
"and",
"initializes",
"a",
"new",
"{",
"@link",
"IllegalArgumentException",
"}",
"with",
"the",
"given",
"{",
"@link",
"String",
"message",
"}",
"formatted",
"with",
"the",
"given",
"{",
"@link",
"Object",
"[]",
"arguments",
"}",
"."
] | train | https://github.com/codeprimate-software/cp-elements/blob/f2163c149fbbef05015e688132064ebcac7c49ab/src/main/java/org/cp/elements/lang/RuntimeExceptionsFactory.java#L48-L50 |
LearnLib/automatalib | visualization/dot-visualizer/src/main/java/net/automatalib/visualization/dot/DOT.java | DOT.renderDOTExternal | public static void renderDOTExternal(Reader r, String format) {
"""
Renders a GraphVIZ description, using an external program for displaying. The program is determined by the
system's file type associations, using the {@link Desktop#open(File)} method.
@param r
the reader from which the GraphVIZ description i... | java | public static void renderDOTExternal(Reader r, String format) {
try {
File image = File.createTempFile("dot", format);
runDOT(r, format, image);
Desktop.getDesktop().open(image);
} catch (IOException e) {
JOptionPane.showMessageDialog(null,
... | [
"public",
"static",
"void",
"renderDOTExternal",
"(",
"Reader",
"r",
",",
"String",
"format",
")",
"{",
"try",
"{",
"File",
"image",
"=",
"File",
".",
"createTempFile",
"(",
"\"dot\"",
",",
"format",
")",
";",
"runDOT",
"(",
"r",
",",
"format",
",",
"i... | Renders a GraphVIZ description, using an external program for displaying. The program is determined by the
system's file type associations, using the {@link Desktop#open(File)} method.
@param r
the reader from which the GraphVIZ description is read.
@param format
the output format, as understood by the dot utility, e.... | [
"Renders",
"a",
"GraphVIZ",
"description",
"using",
"an",
"external",
"program",
"for",
"displaying",
".",
"The",
"program",
"is",
"determined",
"by",
"the",
"system",
"s",
"file",
"type",
"associations",
"using",
"the",
"{",
"@link",
"Desktop#open",
"(",
"Fil... | train | https://github.com/LearnLib/automatalib/blob/8a462ec52f6eaab9f8996e344f2163a72cb8aa6e/visualization/dot-visualizer/src/main/java/net/automatalib/visualization/dot/DOT.java#L209-L220 |
goldmansachs/gs-collections | collections/src/main/java/com/gs/collections/impl/utility/StringIterate.java | StringIterate.countCodePoint | public static int countCodePoint(String string, CodePointPredicate predicate) {
"""
Count the number of elements that return true for the specified {@code predicate}.
@since 7.0
"""
int count = 0;
int size = string.length();
for (int i = 0; i < size; )
{
int codeP... | java | public static int countCodePoint(String string, CodePointPredicate predicate)
{
int count = 0;
int size = string.length();
for (int i = 0; i < size; )
{
int codePoint = string.codePointAt(i);
if (predicate.accept(codePoint))
{
count... | [
"public",
"static",
"int",
"countCodePoint",
"(",
"String",
"string",
",",
"CodePointPredicate",
"predicate",
")",
"{",
"int",
"count",
"=",
"0",
";",
"int",
"size",
"=",
"string",
".",
"length",
"(",
")",
";",
"for",
"(",
"int",
"i",
"=",
"0",
";",
... | Count the number of elements that return true for the specified {@code predicate}.
@since 7.0 | [
"Count",
"the",
"number",
"of",
"elements",
"that",
"return",
"true",
"for",
"the",
"specified",
"{",
"@code",
"predicate",
"}",
"."
] | train | https://github.com/goldmansachs/gs-collections/blob/fa8bf3e103689efa18bca2ab70203e71cde34b52/collections/src/main/java/com/gs/collections/impl/utility/StringIterate.java#L541-L555 |
OpenLiberty/open-liberty | dev/com.ibm.ws.logging.core/src/com/ibm/websphere/ras/Tr.java | Tr.formatMessage | public static final String formatMessage(TraceComponent tc, List<Locale> locales, String msgKey, Object... objs) {
"""
Translate a message in the context of the input trace component. This
method is typically used to provide translated messages that might help
resolve an exception that is surfaced to a user.
... | java | public static final String formatMessage(TraceComponent tc, List<Locale> locales, String msgKey, Object... objs) {
// WsLogRecord.createWsLogRecord + BaseTraceService.formatMessage
// The best odds for finding the resource bundle are with using the
// classloader that loaded the associated clas... | [
"public",
"static",
"final",
"String",
"formatMessage",
"(",
"TraceComponent",
"tc",
",",
"List",
"<",
"Locale",
">",
"locales",
",",
"String",
"msgKey",
",",
"Object",
"...",
"objs",
")",
"{",
"// WsLogRecord.createWsLogRecord + BaseTraceService.formatMessage",
"// T... | Translate a message in the context of the input trace component. This
method is typically used to provide translated messages that might help
resolve an exception that is surfaced to a user.
@param tc
the non-null <code>TraceComponent</code> of the message
@param locales
the possible locales to use for translation. Lo... | [
"Translate",
"a",
"message",
"in",
"the",
"context",
"of",
"the",
"input",
"trace",
"component",
".",
"This",
"method",
"is",
"typically",
"used",
"to",
"provide",
"translated",
"messages",
"that",
"might",
"help",
"resolve",
"an",
"exception",
"that",
"is",
... | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.logging.core/src/com/ibm/websphere/ras/Tr.java#L723-L744 |
joniles/mpxj | src/main/java/net/sf/mpxj/mpp/MPPUtility.java | MPPUtility.getUnicodeStringLengthInBytes | private static final int getUnicodeStringLengthInBytes(byte[] data, int offset) {
"""
Determine the length of a nul terminated UTF16LE string in bytes.
@param data string data
@param offset offset into string data
@return length in bytes
"""
int result;
if (data == null || offset >= data.lengt... | java | private static final int getUnicodeStringLengthInBytes(byte[] data, int offset)
{
int result;
if (data == null || offset >= data.length)
{
result = 0;
}
else
{
result = data.length - offset;
for (int loop = offset; loop < (data.length - 1); loop += 2)
... | [
"private",
"static",
"final",
"int",
"getUnicodeStringLengthInBytes",
"(",
"byte",
"[",
"]",
"data",
",",
"int",
"offset",
")",
"{",
"int",
"result",
";",
"if",
"(",
"data",
"==",
"null",
"||",
"offset",
">=",
"data",
".",
"length",
")",
"{",
"result",
... | Determine the length of a nul terminated UTF16LE string in bytes.
@param data string data
@param offset offset into string data
@return length in bytes | [
"Determine",
"the",
"length",
"of",
"a",
"nul",
"terminated",
"UTF16LE",
"string",
"in",
"bytes",
"."
] | train | https://github.com/joniles/mpxj/blob/143ea0e195da59cd108f13b3b06328e9542337e8/src/main/java/net/sf/mpxj/mpp/MPPUtility.java#L459-L480 |
BorderTech/wcomponents | wcomponents-core/src/main/java/com/github/bordertech/wcomponents/render/webxml/WDataTableRenderer.java | WDataTableRenderer.paintRows | private void paintRows(final WDataTable table, final WebXmlRenderContext renderContext) {
"""
Paints the rows of the table.
@param table the table to paint the rows for.
@param renderContext the RenderContext to paint to.
"""
XmlStringBuilder xml = renderContext.getWriter();
TableDataModel model = tabl... | java | private void paintRows(final WDataTable table, final WebXmlRenderContext renderContext) {
XmlStringBuilder xml = renderContext.getWriter();
TableDataModel model = table.getDataModel();
xml.appendTagOpen("ui:tbody");
xml.appendAttribute("id", table.getRepeater().getId());
xml.appendClose();
if (model.getRo... | [
"private",
"void",
"paintRows",
"(",
"final",
"WDataTable",
"table",
",",
"final",
"WebXmlRenderContext",
"renderContext",
")",
"{",
"XmlStringBuilder",
"xml",
"=",
"renderContext",
".",
"getWriter",
"(",
")",
";",
"TableDataModel",
"model",
"=",
"table",
".",
"... | Paints the rows of the table.
@param table the table to paint the rows for.
@param renderContext the RenderContext to paint to. | [
"Paints",
"the",
"rows",
"of",
"the",
"table",
"."
] | train | https://github.com/BorderTech/wcomponents/blob/d1a2b2243270067db030feb36ca74255aaa94436/wcomponents-core/src/main/java/com/github/bordertech/wcomponents/render/webxml/WDataTableRenderer.java#L299-L324 |
google/error-prone-javac | src/jdk.javadoc/share/classes/com/sun/tools/doclets/formats/html/markup/HtmlTree.java | HtmlTree.UL | public static HtmlTree UL(HtmlStyle styleClass, Content body) {
"""
Generates a UL tag with the style class attribute and some content.
@param styleClass style for the tag
@param body content for the tag
@return an HtmlTree object for the UL tag
"""
HtmlTree htmltree = new HtmlTree(HtmlTag.UL, nul... | java | public static HtmlTree UL(HtmlStyle styleClass, Content body) {
HtmlTree htmltree = new HtmlTree(HtmlTag.UL, nullCheck(body));
htmltree.addStyle(nullCheck(styleClass));
return htmltree;
} | [
"public",
"static",
"HtmlTree",
"UL",
"(",
"HtmlStyle",
"styleClass",
",",
"Content",
"body",
")",
"{",
"HtmlTree",
"htmltree",
"=",
"new",
"HtmlTree",
"(",
"HtmlTag",
".",
"UL",
",",
"nullCheck",
"(",
"body",
")",
")",
";",
"htmltree",
".",
"addStyle",
... | Generates a UL tag with the style class attribute and some content.
@param styleClass style for the tag
@param body content for the tag
@return an HtmlTree object for the UL tag | [
"Generates",
"a",
"UL",
"tag",
"with",
"the",
"style",
"class",
"attribute",
"and",
"some",
"content",
"."
] | train | https://github.com/google/error-prone-javac/blob/a53d069bbdb2c60232ed3811c19b65e41c3e60e0/src/jdk.javadoc/share/classes/com/sun/tools/doclets/formats/html/markup/HtmlTree.java#L833-L837 |
liferay/com-liferay-commerce | commerce-product-service/src/main/java/com/liferay/commerce/product/service/persistence/impl/CPDefinitionSpecificationOptionValuePersistenceImpl.java | CPDefinitionSpecificationOptionValuePersistenceImpl.fetchByUUID_G | @Override
public CPDefinitionSpecificationOptionValue fetchByUUID_G(String uuid,
long groupId) {
"""
Returns the cp definition specification option value where uuid = ? and groupId = ? or returns <code>null</code> if it could not be found. Uses the finder cache.
@param uuid the uuid
@param groupId t... | java | @Override
public CPDefinitionSpecificationOptionValue fetchByUUID_G(String uuid,
long groupId) {
return fetchByUUID_G(uuid, groupId, true);
} | [
"@",
"Override",
"public",
"CPDefinitionSpecificationOptionValue",
"fetchByUUID_G",
"(",
"String",
"uuid",
",",
"long",
"groupId",
")",
"{",
"return",
"fetchByUUID_G",
"(",
"uuid",
",",
"groupId",
",",
"true",
")",
";",
"}"
] | Returns the cp definition specification option value where uuid = ? and groupId = ? or returns <code>null</code> if it could not be found. Uses the finder cache.
@param uuid the uuid
@param groupId the group ID
@return the matching cp definition specification option value, or <code>null</code> if a matching cp... | [
"Returns",
"the",
"cp",
"definition",
"specification",
"option",
"value",
"where",
"uuid",
"=",
"?",
";",
"and",
"groupId",
"=",
"?",
";",
"or",
"returns",
"<code",
">",
"null<",
"/",
"code",
">",
"if",
"it",
"could",
"not",
"be",
"found",
".",
"... | train | https://github.com/liferay/com-liferay-commerce/blob/9e54362d7f59531fc684016ba49ee7cdc3a2f22b/commerce-product-service/src/main/java/com/liferay/commerce/product/service/persistence/impl/CPDefinitionSpecificationOptionValuePersistenceImpl.java#L718-L722 |
bullhorn/sdk-rest | src/main/java/com/bullhornsdk/data/api/StandardBullhornData.java | StandardBullhornData.handleSearchForEntities | protected <L extends ListWrapper<T>, T extends SearchEntity> L handleSearchForEntities(Class<T> type, String query, Set<String> fieldSet,
SearchParams params) {
"""
Makes the "search" api call
<p>
HTTP Method: GET
@param ... | java | protected <L extends ListWrapper<T>, T extends SearchEntity> L handleSearchForEntities(Class<T> type, String query, Set<String> fieldSet,
SearchParams params) {
if(query.length() < MAX_URL_LENGTH ){
Map<String, ... | [
"protected",
"<",
"L",
"extends",
"ListWrapper",
"<",
"T",
">",
",",
"T",
"extends",
"SearchEntity",
">",
"L",
"handleSearchForEntities",
"(",
"Class",
"<",
"T",
">",
"type",
",",
"String",
"query",
",",
"Set",
"<",
"String",
">",
"fieldSet",
",",
"Searc... | Makes the "search" api call
<p>
HTTP Method: GET
@param type the BullhornEntity type
@param query Lucene query string
@param fieldSet the fields to return, if null or emtpy will default to "*" all
@param params optional SearchParams .
@return a LinsWrapper containing the records plus some additional informati... | [
"Makes",
"the",
"search",
"api",
"call",
"<p",
">",
"HTTP",
"Method",
":",
"GET"
] | train | https://github.com/bullhorn/sdk-rest/blob/0c75a141c768bb31510afc3a412c11bd101eca06/src/main/java/com/bullhornsdk/data/api/StandardBullhornData.java#L1051-L1066 |
albfernandez/itext2 | src/main/java/com/lowagie/text/pdf/parser/PdfContentStreamProcessor.java | PdfContentStreamProcessor.processContent | public void processContent(byte[] contentBytes, PdfDictionary resources) {
"""
Processes PDF syntax
@param contentBytes the bytes of a content stream
@param resources the resources that come with the content stream
"""
this.resources.push(resources);
try {
PdfContentParser ps = new PdfContentParse... | java | public void processContent(byte[] contentBytes, PdfDictionary resources) {
this.resources.push(resources);
try {
PdfContentParser ps = new PdfContentParser(new PRTokeniser(contentBytes));
ArrayList operands = new ArrayList();
while (ps.parse(operands).size() > 0) {
PdfLiteral operator = (PdfLiter... | [
"public",
"void",
"processContent",
"(",
"byte",
"[",
"]",
"contentBytes",
",",
"PdfDictionary",
"resources",
")",
"{",
"this",
".",
"resources",
".",
"push",
"(",
"resources",
")",
";",
"try",
"{",
"PdfContentParser",
"ps",
"=",
"new",
"PdfContentParser",
"... | Processes PDF syntax
@param contentBytes the bytes of a content stream
@param resources the resources that come with the content stream | [
"Processes",
"PDF",
"syntax"
] | train | https://github.com/albfernandez/itext2/blob/438fc1899367fd13dfdfa8dfdca9a3c1a7783b84/src/main/java/com/lowagie/text/pdf/parser/PdfContentStreamProcessor.java#L258-L271 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.