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 |
|---|---|---|---|---|---|---|---|---|---|---|
Erudika/para | para-client/src/main/java/com/erudika/para/client/ParaClient.java | ParaClient.findTermInList | public <P extends ParaObject> List<P> findTermInList(String type, String field, List<String> terms, Pager... pager) {
"""
Searches for objects having a property value that is in list of possible values.
@param <P> type of the object
@param type the type of object to search for. See {@link com.erudika.para.core.P... | java | public <P extends ParaObject> List<P> findTermInList(String type, String field, List<String> terms, Pager... pager) {
MultivaluedMap<String, String> params = new MultivaluedHashMap<>();
params.putSingle("field", field);
params.put("terms", terms);
params.putSingle(Config._TYPE, type);
params.putAll(pagerToPar... | [
"public",
"<",
"P",
"extends",
"ParaObject",
">",
"List",
"<",
"P",
">",
"findTermInList",
"(",
"String",
"type",
",",
"String",
"field",
",",
"List",
"<",
"String",
">",
"terms",
",",
"Pager",
"...",
"pager",
")",
"{",
"MultivaluedMap",
"<",
"String",
... | Searches for objects having a property value that is in list of possible values.
@param <P> type of the object
@param type the type of object to search for. See {@link com.erudika.para.core.ParaObject#getType()}
@param field the property name of an object
@param terms a list of terms (property values)
@param pager a {@... | [
"Searches",
"for",
"objects",
"having",
"a",
"property",
"value",
"that",
"is",
"in",
"list",
"of",
"possible",
"values",
"."
] | train | https://github.com/Erudika/para/blob/5ba096c477042ea7b18e9a0e8b5b1ee0f5bd6ce9/para-client/src/main/java/com/erudika/para/client/ParaClient.java#L810-L817 |
SonarSource/sonarqube | sonar-core/src/main/java/org/sonar/core/util/stream/MoreCollectors.java | MoreCollectors.uniqueIndex | public static <K, E> Collector<E, Map<K, E>, ImmutableMap<K, E>> uniqueIndex(Function<? super E, K> keyFunction) {
"""
Creates an {@link ImmutableMap} from the stream where the values are the values in the stream and the keys are the
result of the provided {@link Function keyFunction} applied to each value in the... | java | public static <K, E> Collector<E, Map<K, E>, ImmutableMap<K, E>> uniqueIndex(Function<? super E, K> keyFunction) {
return uniqueIndex(keyFunction, Function.<E>identity());
} | [
"public",
"static",
"<",
"K",
",",
"E",
">",
"Collector",
"<",
"E",
",",
"Map",
"<",
"K",
",",
"E",
">",
",",
"ImmutableMap",
"<",
"K",
",",
"E",
">",
">",
"uniqueIndex",
"(",
"Function",
"<",
"?",
"super",
"E",
",",
"K",
">",
"keyFunction",
")... | Creates an {@link ImmutableMap} from the stream where the values are the values in the stream and the keys are the
result of the provided {@link Function keyFunction} applied to each value in the stream.
<p>
The {@link Function keyFunction} must return a unique (according to the key's type {@link Object#equals(Object)... | [
"Creates",
"an",
"{",
"@link",
"ImmutableMap",
"}",
"from",
"the",
"stream",
"where",
"the",
"values",
"are",
"the",
"values",
"in",
"the",
"stream",
"and",
"the",
"keys",
"are",
"the",
"result",
"of",
"the",
"provided",
"{",
"@link",
"Function",
"keyFunct... | train | https://github.com/SonarSource/sonarqube/blob/2fffa4c2f79ae3714844d7742796e82822b6a98a/sonar-core/src/main/java/org/sonar/core/util/stream/MoreCollectors.java#L186-L188 |
JodaOrg/joda-money | src/main/java/org/joda/money/BigMoney.java | BigMoney.convertRetainScale | public BigMoney convertRetainScale(CurrencyUnit currency, BigDecimal conversionMultipler, RoundingMode roundingMode) {
"""
Returns a copy of this monetary value converted into another currency
using the specified conversion rate, with a rounding mode used to adjust
the decimal places in the result.
<p>
The res... | java | public BigMoney convertRetainScale(CurrencyUnit currency, BigDecimal conversionMultipler, RoundingMode roundingMode) {
return convertedTo(currency, conversionMultipler).withScale(getScale(), roundingMode);
} | [
"public",
"BigMoney",
"convertRetainScale",
"(",
"CurrencyUnit",
"currency",
",",
"BigDecimal",
"conversionMultipler",
",",
"RoundingMode",
"roundingMode",
")",
"{",
"return",
"convertedTo",
"(",
"currency",
",",
"conversionMultipler",
")",
".",
"withScale",
"(",
"get... | Returns a copy of this monetary value converted into another currency
using the specified conversion rate, with a rounding mode used to adjust
the decimal places in the result.
<p>
The result will have the same scale as this instance even though it will
be in a different currency.
<p>
This instance is immutable and una... | [
"Returns",
"a",
"copy",
"of",
"this",
"monetary",
"value",
"converted",
"into",
"another",
"currency",
"using",
"the",
"specified",
"conversion",
"rate",
"with",
"a",
"rounding",
"mode",
"used",
"to",
"adjust",
"the",
"decimal",
"places",
"in",
"the",
"result"... | train | https://github.com/JodaOrg/joda-money/blob/e1f2de75aa36610a695358696c8a88a18ca66cde/src/main/java/org/joda/money/BigMoney.java#L1545-L1547 |
alkacon/opencms-core | src-gwt/org/opencms/ade/containerpage/client/CmsContainerpageController.java | CmsContainerpageController.deleteElement | public void deleteElement(String elementId, final String relatedElementId) {
"""
Deletes an element from the VFS, removes it from all containers and the client side cache.<p>
@param elementId the element to delete
@param relatedElementId related element to reload after the element has been deleted
"""
... | java | public void deleteElement(String elementId, final String relatedElementId) {
elementId = getServerId(elementId);
removeContainerElements(elementId);
addToRecentList(elementId, null);
reloadElements(new String[] {relatedElementId});
} | [
"public",
"void",
"deleteElement",
"(",
"String",
"elementId",
",",
"final",
"String",
"relatedElementId",
")",
"{",
"elementId",
"=",
"getServerId",
"(",
"elementId",
")",
";",
"removeContainerElements",
"(",
"elementId",
")",
";",
"addToRecentList",
"(",
"elemen... | Deletes an element from the VFS, removes it from all containers and the client side cache.<p>
@param elementId the element to delete
@param relatedElementId related element to reload after the element has been deleted | [
"Deletes",
"an",
"element",
"from",
"the",
"VFS",
"removes",
"it",
"from",
"all",
"containers",
"and",
"the",
"client",
"side",
"cache",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src-gwt/org/opencms/ade/containerpage/client/CmsContainerpageController.java#L1110-L1116 |
Azure/azure-sdk-for-java | datalakeanalytics/resource-manager/v2015_10_01_preview/src/main/java/com/microsoft/azure/management/datalakeanalytics/v2015_10_01_preview/implementation/AccountsInner.java | AccountsInner.addDataLakeStoreAccount | public void addDataLakeStoreAccount(String resourceGroupName, String accountName, String dataLakeStoreAccountName, AddDataLakeStoreParameters parameters) {
"""
Updates the specified Data Lake Analytics account to include the additional Data Lake Store account.
@param resourceGroupName The name of the Azure reso... | java | public void addDataLakeStoreAccount(String resourceGroupName, String accountName, String dataLakeStoreAccountName, AddDataLakeStoreParameters parameters) {
addDataLakeStoreAccountWithServiceResponseAsync(resourceGroupName, accountName, dataLakeStoreAccountName, parameters).toBlocking().single().body();
} | [
"public",
"void",
"addDataLakeStoreAccount",
"(",
"String",
"resourceGroupName",
",",
"String",
"accountName",
",",
"String",
"dataLakeStoreAccountName",
",",
"AddDataLakeStoreParameters",
"parameters",
")",
"{",
"addDataLakeStoreAccountWithServiceResponseAsync",
"(",
"resource... | Updates the specified Data Lake Analytics account to include the additional Data Lake Store account.
@param resourceGroupName The name of the Azure resource group that contains the Data Lake Analytics account.
@param accountName The name of the Data Lake Analytics account to which to add the Data Lake Store account.
@... | [
"Updates",
"the",
"specified",
"Data",
"Lake",
"Analytics",
"account",
"to",
"include",
"the",
"additional",
"Data",
"Lake",
"Store",
"account",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/datalakeanalytics/resource-manager/v2015_10_01_preview/src/main/java/com/microsoft/azure/management/datalakeanalytics/v2015_10_01_preview/implementation/AccountsInner.java#L1132-L1134 |
Azure/azure-sdk-for-java | sql/resource-manager/v2015_05_01_preview/src/main/java/com/microsoft/azure/management/sql/v2015_05_01_preview/implementation/SyncMembersInner.java | SyncMembersInner.refreshMemberSchema | public void refreshMemberSchema(String resourceGroupName, String serverName, String databaseName, String syncGroupName, String syncMemberName) {
"""
Refreshes a sync member database schema.
@param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azu... | java | public void refreshMemberSchema(String resourceGroupName, String serverName, String databaseName, String syncGroupName, String syncMemberName) {
refreshMemberSchemaWithServiceResponseAsync(resourceGroupName, serverName, databaseName, syncGroupName, syncMemberName).toBlocking().last().body();
} | [
"public",
"void",
"refreshMemberSchema",
"(",
"String",
"resourceGroupName",
",",
"String",
"serverName",
",",
"String",
"databaseName",
",",
"String",
"syncGroupName",
",",
"String",
"syncMemberName",
")",
"{",
"refreshMemberSchemaWithServiceResponseAsync",
"(",
"resourc... | Refreshes a sync member database schema.
@param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal.
@param serverName The name of the server.
@param databaseName The name of the database on which the sync group is hos... | [
"Refreshes",
"a",
"sync",
"member",
"database",
"schema",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/sql/resource-manager/v2015_05_01_preview/src/main/java/com/microsoft/azure/management/sql/v2015_05_01_preview/implementation/SyncMembersInner.java#L1151-L1153 |
apache/incubator-gobblin | gobblin-metrics-libs/gobblin-metrics-base/src/main/java/org/apache/gobblin/filesystem/MetricsFileSystemInstrumentation.java | MetricsFileSystemInstrumentation.setPermission | public void setPermission (Path f, final FsPermission permission) throws IOException {
"""
Add timer metrics to {@link DistributedFileSystem#setPermission(Path, FsPermission)}
"""
try (Closeable context = new TimerContextWithLog(this.setPermissionTimer.time(), "setPermission", f, permission)) {
super... | java | public void setPermission (Path f, final FsPermission permission) throws IOException {
try (Closeable context = new TimerContextWithLog(this.setPermissionTimer.time(), "setPermission", f, permission)) {
super.setPermission(f, permission);
}
} | [
"public",
"void",
"setPermission",
"(",
"Path",
"f",
",",
"final",
"FsPermission",
"permission",
")",
"throws",
"IOException",
"{",
"try",
"(",
"Closeable",
"context",
"=",
"new",
"TimerContextWithLog",
"(",
"this",
".",
"setPermissionTimer",
".",
"time",
"(",
... | Add timer metrics to {@link DistributedFileSystem#setPermission(Path, FsPermission)} | [
"Add",
"timer",
"metrics",
"to",
"{"
] | train | https://github.com/apache/incubator-gobblin/blob/f029b4c0fea0fe4aa62f36dda2512344ff708bae/gobblin-metrics-libs/gobblin-metrics-base/src/main/java/org/apache/gobblin/filesystem/MetricsFileSystemInstrumentation.java#L307-L311 |
lessthanoptimal/ddogleg | src/org/ddogleg/optimization/lm/LevenbergMarquardt_F64.java | LevenbergMarquardt_F64.processStepResults | private boolean processStepResults(double fx_candidate, double actualReduction, double predictedReduction) {
"""
Sees if this is an improvement worth accepting. Adjust dampening parameter and change
the state if accepted.
@return true if it has converged or false if it has not
"""
double ratio = actualRe... | java | private boolean processStepResults(double fx_candidate, double actualReduction, double predictedReduction) {
double ratio = actualReduction/predictedReduction;
boolean accepted;
// Accept the new state if the score improved
if( fx_candidate < fx ) {
// reduce the amount of dampening. Magic equation from [1... | [
"private",
"boolean",
"processStepResults",
"(",
"double",
"fx_candidate",
",",
"double",
"actualReduction",
",",
"double",
"predictedReduction",
")",
"{",
"double",
"ratio",
"=",
"actualReduction",
"/",
"predictedReduction",
";",
"boolean",
"accepted",
";",
"// Accep... | Sees if this is an improvement worth accepting. Adjust dampening parameter and change
the state if accepted.
@return true if it has converged or false if it has not | [
"Sees",
"if",
"this",
"is",
"an",
"improvement",
"worth",
"accepting",
".",
"Adjust",
"dampening",
"parameter",
"and",
"change",
"the",
"state",
"if",
"accepted",
"."
] | train | https://github.com/lessthanoptimal/ddogleg/blob/3786bf448ba23d0e04962dd08c34fa68de276029/src/org/ddogleg/optimization/lm/LevenbergMarquardt_F64.java#L209-L244 |
JM-Lab/utils-java8 | src/main/java/kr/jm/utils/time/JMTimeUtil.java | JMTimeUtil.changeFormatAndTimeZone | public static String changeFormatAndTimeZone(String isoTimestamp,
String toBeTimeFormat, String zoneId) {
"""
Change format and time zone string.
@param isoTimestamp the iso timestamp
@param toBeTimeFormat the to be time format
@param zoneId the zone id
@return the string
"""
... | java | public static String changeFormatAndTimeZone(String isoTimestamp,
String toBeTimeFormat, String zoneId) {
return getTime(changeIsoTimestampToLong(isoTimestamp, zoneId),
toBeTimeFormat, zoneId);
} | [
"public",
"static",
"String",
"changeFormatAndTimeZone",
"(",
"String",
"isoTimestamp",
",",
"String",
"toBeTimeFormat",
",",
"String",
"zoneId",
")",
"{",
"return",
"getTime",
"(",
"changeIsoTimestampToLong",
"(",
"isoTimestamp",
",",
"zoneId",
")",
",",
"toBeTimeF... | Change format and time zone string.
@param isoTimestamp the iso timestamp
@param toBeTimeFormat the to be time format
@param zoneId the zone id
@return the string | [
"Change",
"format",
"and",
"time",
"zone",
"string",
"."
] | train | https://github.com/JM-Lab/utils-java8/blob/9e407b3f28a7990418a1e877229fa8344f4d78a5/src/main/java/kr/jm/utils/time/JMTimeUtil.java#L373-L377 |
googleapis/google-cloud-java | google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/deprecated/SubnetworkId.java | SubnetworkId.of | public static SubnetworkId of(String region, String subnetwork) {
"""
Returns a subnetwork identity given the region and subnetwork names. The subnetwork name must
be 1-63 characters long and comply with RFC1035. Specifically, the name must match the regular
expression {@code [a-z]([-a-z0-9]*[a-z0-9])?} which me... | java | public static SubnetworkId of(String region, String subnetwork) {
return new SubnetworkId(null, region, subnetwork);
} | [
"public",
"static",
"SubnetworkId",
"of",
"(",
"String",
"region",
",",
"String",
"subnetwork",
")",
"{",
"return",
"new",
"SubnetworkId",
"(",
"null",
",",
"region",
",",
"subnetwork",
")",
";",
"}"
] | Returns a subnetwork identity given the region and subnetwork names. The subnetwork name must
be 1-63 characters long and comply with RFC1035. Specifically, the name must match the regular
expression {@code [a-z]([-a-z0-9]*[a-z0-9])?} which means the first character must be a
lowercase letter, and all following charact... | [
"Returns",
"a",
"subnetwork",
"identity",
"given",
"the",
"region",
"and",
"subnetwork",
"names",
".",
"The",
"subnetwork",
"name",
"must",
"be",
"1",
"-",
"63",
"characters",
"long",
"and",
"comply",
"with",
"RFC1035",
".",
"Specifically",
"the",
"name",
"m... | train | https://github.com/googleapis/google-cloud-java/blob/d2f0bc64a53049040fe9c9d338b12fab3dd1ad6a/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/deprecated/SubnetworkId.java#L140-L142 |
datastax/java-driver | core/src/main/java/com/datastax/oss/driver/api/core/session/SessionBuilder.java | SessionBuilder.withNodeFilter | @NonNull
public SelfT withNodeFilter(@NonNull Predicate<Node> nodeFilter) {
"""
Alias to {@link #withNodeFilter(String, Predicate)} for the default profile.
"""
return withNodeFilter(DriverExecutionProfile.DEFAULT_NAME, nodeFilter);
} | java | @NonNull
public SelfT withNodeFilter(@NonNull Predicate<Node> nodeFilter) {
return withNodeFilter(DriverExecutionProfile.DEFAULT_NAME, nodeFilter);
} | [
"@",
"NonNull",
"public",
"SelfT",
"withNodeFilter",
"(",
"@",
"NonNull",
"Predicate",
"<",
"Node",
">",
"nodeFilter",
")",
"{",
"return",
"withNodeFilter",
"(",
"DriverExecutionProfile",
".",
"DEFAULT_NAME",
",",
"nodeFilter",
")",
";",
"}"
] | Alias to {@link #withNodeFilter(String, Predicate)} for the default profile. | [
"Alias",
"to",
"{"
] | train | https://github.com/datastax/java-driver/blob/612a63f2525618e2020e86c9ad75ab37adba6132/core/src/main/java/com/datastax/oss/driver/api/core/session/SessionBuilder.java#L271-L274 |
vznet/mongo-jackson-mapper | src/main/java/net/vz/mongodb/jackson/JacksonDBCollection.java | JacksonDBCollection.getCount | public long getCount(T query, T fields, long limit, long skip) throws MongoException {
"""
Returns the number of documents in the collection
that match the specified query
@param query query to select documents to count
@param fields fields to return
@param limit limit the count to this value
@param skip ... | java | public long getCount(T query, T fields, long limit, long skip) throws MongoException {
return dbCollection.getCount(convertToBasicDbObject(query), convertToBasicDbObject(fields), limit, skip);
} | [
"public",
"long",
"getCount",
"(",
"T",
"query",
",",
"T",
"fields",
",",
"long",
"limit",
",",
"long",
"skip",
")",
"throws",
"MongoException",
"{",
"return",
"dbCollection",
".",
"getCount",
"(",
"convertToBasicDbObject",
"(",
"query",
")",
",",
"convertTo... | Returns the number of documents in the collection
that match the specified query
@param query query to select documents to count
@param fields fields to return
@param limit limit the count to this value
@param skip number of entries to skip
@return number of documents that match query and fields
@throws MongoExcep... | [
"Returns",
"the",
"number",
"of",
"documents",
"in",
"the",
"collection",
"that",
"match",
"the",
"specified",
"query"
] | train | https://github.com/vznet/mongo-jackson-mapper/blob/ecd189aefa89636cddf70fb383f5d676be347976/src/main/java/net/vz/mongodb/jackson/JacksonDBCollection.java#L1150-L1152 |
Azure/azure-sdk-for-java | cognitiveservices/resource-manager/v2017_04_18/src/main/java/com/microsoft/azure/management/cognitiveservices/v2017_04_18/implementation/AccountsInner.java | AccountsInner.getByResourceGroupAsync | public Observable<CognitiveServicesAccountInner> getByResourceGroupAsync(String resourceGroupName, String accountName) {
"""
Returns a Cognitive Services account specified by the parameters.
@param resourceGroupName The name of the resource group within the user's subscription.
@param accountName The name of C... | java | public Observable<CognitiveServicesAccountInner> getByResourceGroupAsync(String resourceGroupName, String accountName) {
return getByResourceGroupWithServiceResponseAsync(resourceGroupName, accountName).map(new Func1<ServiceResponse<CognitiveServicesAccountInner>, CognitiveServicesAccountInner>() {
... | [
"public",
"Observable",
"<",
"CognitiveServicesAccountInner",
">",
"getByResourceGroupAsync",
"(",
"String",
"resourceGroupName",
",",
"String",
"accountName",
")",
"{",
"return",
"getByResourceGroupWithServiceResponseAsync",
"(",
"resourceGroupName",
",",
"accountName",
")",... | Returns a Cognitive Services account specified by the parameters.
@param resourceGroupName The name of the resource group within the user's subscription.
@param accountName The name of Cognitive Services account.
@throws IllegalArgumentException thrown if parameters fail the validation
@return the observable to the Co... | [
"Returns",
"a",
"Cognitive",
"Services",
"account",
"specified",
"by",
"the",
"parameters",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/cognitiveservices/resource-manager/v2017_04_18/src/main/java/com/microsoft/azure/management/cognitiveservices/v2017_04_18/implementation/AccountsInner.java#L524-L531 |
tipsy/javalin | src/main/java/io/javalin/Javalin.java | Javalin.sse | public Javalin sse(@NotNull String path, @NotNull Consumer<SseClient> client, @NotNull Set<Role> permittedRoles) {
"""
Adds a lambda handler for a Server Sent Event connection on the specified path.
Requires an access manager to be set on the instance.
"""
return get(path, new SseHandler(client), perm... | java | public Javalin sse(@NotNull String path, @NotNull Consumer<SseClient> client, @NotNull Set<Role> permittedRoles) {
return get(path, new SseHandler(client), permittedRoles);
} | [
"public",
"Javalin",
"sse",
"(",
"@",
"NotNull",
"String",
"path",
",",
"@",
"NotNull",
"Consumer",
"<",
"SseClient",
">",
"client",
",",
"@",
"NotNull",
"Set",
"<",
"Role",
">",
"permittedRoles",
")",
"{",
"return",
"get",
"(",
"path",
",",
"new",
"Ss... | Adds a lambda handler for a Server Sent Event connection on the specified path.
Requires an access manager to be set on the instance. | [
"Adds",
"a",
"lambda",
"handler",
"for",
"a",
"Server",
"Sent",
"Event",
"connection",
"on",
"the",
"specified",
"path",
".",
"Requires",
"an",
"access",
"manager",
"to",
"be",
"set",
"on",
"the",
"instance",
"."
] | train | https://github.com/tipsy/javalin/blob/68b2f7592f237db1c2b597e645697eb75fdaee53/src/main/java/io/javalin/Javalin.java#L443-L445 |
scireum/s3ninja | src/main/java/ninja/S3Dispatcher.java | S3Dispatcher.abortMultipartUpload | private void abortMultipartUpload(WebContext ctx, String uploadId) {
"""
Handles DELETE /bucket/id?uploadId=X
@param ctx the context describing the current request
@param uploadId the multipart upload that should be cancelled
"""
multipartUploads.remove(uploadId);
ctx.respondWith().sta... | java | private void abortMultipartUpload(WebContext ctx, String uploadId) {
multipartUploads.remove(uploadId);
ctx.respondWith().status(HttpResponseStatus.OK);
delete(getUploadDir(uploadId));
} | [
"private",
"void",
"abortMultipartUpload",
"(",
"WebContext",
"ctx",
",",
"String",
"uploadId",
")",
"{",
"multipartUploads",
".",
"remove",
"(",
"uploadId",
")",
";",
"ctx",
".",
"respondWith",
"(",
")",
".",
"status",
"(",
"HttpResponseStatus",
".",
"OK",
... | Handles DELETE /bucket/id?uploadId=X
@param ctx the context describing the current request
@param uploadId the multipart upload that should be cancelled | [
"Handles",
"DELETE",
"/",
"bucket",
"/",
"id?uploadId",
"=",
"X"
] | train | https://github.com/scireum/s3ninja/blob/445eec55c91780267a7f987818b3fedecae009c5/src/main/java/ninja/S3Dispatcher.java#L801-L805 |
jcuda/jcuda | JCudaJava/src/main/java/jcuda/driver/JCudaDriver.java | JCudaDriver.cuOccupancyMaxActiveBlocksPerMultiprocessor | public static int cuOccupancyMaxActiveBlocksPerMultiprocessor(int numBlocks[], CUfunction func, int blockSize, long dynamicSMemSize) {
"""
<code><pre>
\brief Returns occupancy of a function
Returns in \p *numBlocks the number of the maximum active blocks per
streaming multiprocessor.
\param numBlocks ... | java | public static int cuOccupancyMaxActiveBlocksPerMultiprocessor(int numBlocks[], CUfunction func, int blockSize, long dynamicSMemSize)
{
return checkResult(cuOccupancyMaxActiveBlocksPerMultiprocessorNative(numBlocks, func, blockSize, dynamicSMemSize));
} | [
"public",
"static",
"int",
"cuOccupancyMaxActiveBlocksPerMultiprocessor",
"(",
"int",
"numBlocks",
"[",
"]",
",",
"CUfunction",
"func",
",",
"int",
"blockSize",
",",
"long",
"dynamicSMemSize",
")",
"{",
"return",
"checkResult",
"(",
"cuOccupancyMaxActiveBlocksPerMultipr... | <code><pre>
\brief Returns occupancy of a function
Returns in \p *numBlocks the number of the maximum active blocks per
streaming multiprocessor.
\param numBlocks - Returned occupancy
\param func - Kernel for which occupancy is calulated
\param blockSize - Block size the kernel is intended to b... | [
"<code",
">",
"<pre",
">",
"\\",
"brief",
"Returns",
"occupancy",
"of",
"a",
"function"
] | train | https://github.com/jcuda/jcuda/blob/468528b5b9b37dfceb6ed83fcfd889e9b359f984/JCudaJava/src/main/java/jcuda/driver/JCudaDriver.java#L13055-L13058 |
bitcoinj/bitcoinj | core/src/main/java/org/bitcoinj/wallet/RedeemData.java | RedeemData.of | public static RedeemData of(ECKey key, Script redeemScript) {
"""
Creates RedeemData for P2PKH, P2WPKH or P2PK input. Provided key is a single private key needed
to spend such inputs.
"""
checkArgument(ScriptPattern.isP2PKH(redeemScript)
|| ScriptPattern.isP2WPKH(redeemScript) || Scrip... | java | public static RedeemData of(ECKey key, Script redeemScript) {
checkArgument(ScriptPattern.isP2PKH(redeemScript)
|| ScriptPattern.isP2WPKH(redeemScript) || ScriptPattern.isP2PK(redeemScript));
return key != null ? new RedeemData(Collections.singletonList(key), redeemScript) : null;
} | [
"public",
"static",
"RedeemData",
"of",
"(",
"ECKey",
"key",
",",
"Script",
"redeemScript",
")",
"{",
"checkArgument",
"(",
"ScriptPattern",
".",
"isP2PKH",
"(",
"redeemScript",
")",
"||",
"ScriptPattern",
".",
"isP2WPKH",
"(",
"redeemScript",
")",
"||",
"Scri... | Creates RedeemData for P2PKH, P2WPKH or P2PK input. Provided key is a single private key needed
to spend such inputs. | [
"Creates",
"RedeemData",
"for",
"P2PKH",
"P2WPKH",
"or",
"P2PK",
"input",
".",
"Provided",
"key",
"is",
"a",
"single",
"private",
"key",
"needed",
"to",
"spend",
"such",
"inputs",
"."
] | train | https://github.com/bitcoinj/bitcoinj/blob/9cf13d29315014ed59cf4fc5944e5f227e8df9a6/core/src/main/java/org/bitcoinj/wallet/RedeemData.java#L59-L63 |
joniles/mpxj | src/main/java/net/sf/mpxj/synchro/SynchroReader.java | SynchroReader.processRanges | private void processRanges(List<DateRange> ranges, ProjectCalendarDateRanges container) {
"""
Populate time ranges.
@param ranges time ranges from a Synchro table
@param container time range container
"""
if (ranges != null)
{
for (DateRange range : ranges)
{
conta... | java | private void processRanges(List<DateRange> ranges, ProjectCalendarDateRanges container)
{
if (ranges != null)
{
for (DateRange range : ranges)
{
container.addRange(range);
}
}
} | [
"private",
"void",
"processRanges",
"(",
"List",
"<",
"DateRange",
">",
"ranges",
",",
"ProjectCalendarDateRanges",
"container",
")",
"{",
"if",
"(",
"ranges",
"!=",
"null",
")",
"{",
"for",
"(",
"DateRange",
"range",
":",
"ranges",
")",
"{",
"container",
... | Populate time ranges.
@param ranges time ranges from a Synchro table
@param container time range container | [
"Populate",
"time",
"ranges",
"."
] | train | https://github.com/joniles/mpxj/blob/143ea0e195da59cd108f13b3b06328e9542337e8/src/main/java/net/sf/mpxj/synchro/SynchroReader.java#L187-L196 |
lessthanoptimal/ejml | main/ejml-ddense/src/org/ejml/dense/row/CommonOps_DDRM.java | CommonOps_DDRM.multAddTransA | public static void multAddTransA(double alpha , DMatrix1Row a , DMatrix1Row b , DMatrix1Row c ) {
"""
<p>
Performs the following operation:<br>
<br>
c = c + α * a<sup>T</sup> * b<br>
c<sub>ij</sub> =c<sub>ij</sub> + α * ∑<sub>k=1:n</sub> { a<sub>ki</sub> * b<sub>kj</sub>}
</p>
@param alpha... | java | public static void multAddTransA(double alpha , DMatrix1Row a , DMatrix1Row b , DMatrix1Row c )
{
// TODO add a matrix vectory multiply here
if( a.numCols >= EjmlParameters.MULT_COLUMN_SWITCH ||
b.numCols >= EjmlParameters.MULT_COLUMN_SWITCH ) {
MatrixMatrixMult_DDRM.mult... | [
"public",
"static",
"void",
"multAddTransA",
"(",
"double",
"alpha",
",",
"DMatrix1Row",
"a",
",",
"DMatrix1Row",
"b",
",",
"DMatrix1Row",
"c",
")",
"{",
"// TODO add a matrix vectory multiply here",
"if",
"(",
"a",
".",
"numCols",
">=",
"EjmlParameters",
".",
"... | <p>
Performs the following operation:<br>
<br>
c = c + α * a<sup>T</sup> * b<br>
c<sub>ij</sub> =c<sub>ij</sub> + α * ∑<sub>k=1:n</sub> { a<sub>ki</sub> * b<sub>kj</sub>}
</p>
@param alpha scaling factor
@param a The left matrix in the multiplication operation. Not modified.
@param b The right matrix ... | [
"<p",
">",
"Performs",
"the",
"following",
"operation",
":",
"<br",
">",
"<br",
">",
"c",
"=",
"c",
"+",
"&alpha",
";",
"*",
"a<sup",
">",
"T<",
"/",
"sup",
">",
"*",
"b<br",
">",
"c<sub",
">",
"ij<",
"/",
"sub",
">",
"=",
"c<sub",
">",
"ij<",
... | train | https://github.com/lessthanoptimal/ejml/blob/1444680cc487af5e866730e62f48f5f9636850d9/main/ejml-ddense/src/org/ejml/dense/row/CommonOps_DDRM.java#L412-L421 |
Azure/azure-sdk-for-java | locks/resource-manager/v2016_09_01/src/main/java/com/microsoft/azure/management/locks/v2016_09_01/implementation/ManagementLocksInner.java | ManagementLocksInner.createOrUpdateAtResourceGroupLevel | public ManagementLockObjectInner createOrUpdateAtResourceGroupLevel(String resourceGroupName, String lockName, ManagementLockObjectInner parameters) {
"""
Creates or updates a management lock at the resource group level.
When you apply a lock at a parent scope, all child resources inherit the same lock. To create... | java | public ManagementLockObjectInner createOrUpdateAtResourceGroupLevel(String resourceGroupName, String lockName, ManagementLockObjectInner parameters) {
return createOrUpdateAtResourceGroupLevelWithServiceResponseAsync(resourceGroupName, lockName, parameters).toBlocking().single().body();
} | [
"public",
"ManagementLockObjectInner",
"createOrUpdateAtResourceGroupLevel",
"(",
"String",
"resourceGroupName",
",",
"String",
"lockName",
",",
"ManagementLockObjectInner",
"parameters",
")",
"{",
"return",
"createOrUpdateAtResourceGroupLevelWithServiceResponseAsync",
"(",
"resour... | Creates or updates a management lock at the resource group level.
When you apply a lock at a parent scope, all child resources inherit the same lock. To create management locks, you must have access to Microsoft.Authorization/* or Microsoft.Authorization/locks/* actions. Of the built-in roles, only Owner and User Acces... | [
"Creates",
"or",
"updates",
"a",
"management",
"lock",
"at",
"the",
"resource",
"group",
"level",
".",
"When",
"you",
"apply",
"a",
"lock",
"at",
"a",
"parent",
"scope",
"all",
"child",
"resources",
"inherit",
"the",
"same",
"lock",
".",
"To",
"create",
... | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/locks/resource-manager/v2016_09_01/src/main/java/com/microsoft/azure/management/locks/v2016_09_01/implementation/ManagementLocksInner.java#L152-L154 |
aws/aws-sdk-java | aws-java-sdk-api-gateway/src/main/java/com/amazonaws/services/apigateway/model/PutIntegrationResult.java | PutIntegrationResult.withRequestTemplates | public PutIntegrationResult withRequestTemplates(java.util.Map<String, String> requestTemplates) {
"""
<p>
Represents a map of Velocity templates that are applied on the request payload based on the value of the
Content-Type header sent by the client. The content type value is the key in this map, and the templa... | java | public PutIntegrationResult withRequestTemplates(java.util.Map<String, String> requestTemplates) {
setRequestTemplates(requestTemplates);
return this;
} | [
"public",
"PutIntegrationResult",
"withRequestTemplates",
"(",
"java",
".",
"util",
".",
"Map",
"<",
"String",
",",
"String",
">",
"requestTemplates",
")",
"{",
"setRequestTemplates",
"(",
"requestTemplates",
")",
";",
"return",
"this",
";",
"}"
] | <p>
Represents a map of Velocity templates that are applied on the request payload based on the value of the
Content-Type header sent by the client. The content type value is the key in this map, and the template (as a
String) is the value.
</p>
@param requestTemplates
Represents a map of Velocity templates that are a... | [
"<p",
">",
"Represents",
"a",
"map",
"of",
"Velocity",
"templates",
"that",
"are",
"applied",
"on",
"the",
"request",
"payload",
"based",
"on",
"the",
"value",
"of",
"the",
"Content",
"-",
"Type",
"header",
"sent",
"by",
"the",
"client",
".",
"The",
"con... | train | https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-api-gateway/src/main/java/com/amazonaws/services/apigateway/model/PutIntegrationResult.java#L1107-L1110 |
Azure/azure-sdk-for-java | keyvault/data-plane/azure-keyvault/src/main/java/com/microsoft/azure/keyvault/implementation/KeyVaultClientBaseImpl.java | KeyVaultClientBaseImpl.getCertificateAsync | public ServiceFuture<CertificateBundle> getCertificateAsync(String vaultBaseUrl, String certificateName, String certificateVersion, final ServiceCallback<CertificateBundle> serviceCallback) {
"""
Gets information about a certificate.
Gets information about a specific certificate. This operation requires the certi... | java | public ServiceFuture<CertificateBundle> getCertificateAsync(String vaultBaseUrl, String certificateName, String certificateVersion, final ServiceCallback<CertificateBundle> serviceCallback) {
return ServiceFuture.fromResponse(getCertificateWithServiceResponseAsync(vaultBaseUrl, certificateName, certificateVersi... | [
"public",
"ServiceFuture",
"<",
"CertificateBundle",
">",
"getCertificateAsync",
"(",
"String",
"vaultBaseUrl",
",",
"String",
"certificateName",
",",
"String",
"certificateVersion",
",",
"final",
"ServiceCallback",
"<",
"CertificateBundle",
">",
"serviceCallback",
")",
... | Gets information about a certificate.
Gets information about a specific certificate. This operation requires the certificates/get permission.
@param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net.
@param certificateName The name of the certificate in the given vault.
@param certificateVersion... | [
"Gets",
"information",
"about",
"a",
"certificate",
".",
"Gets",
"information",
"about",
"a",
"specific",
"certificate",
".",
"This",
"operation",
"requires",
"the",
"certificates",
"/",
"get",
"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#L7561-L7563 |
Coveros/selenified | src/main/java/com/coveros/selenified/utilities/Reporter.java | Reporter.getActual | private String getActual(String actual, double timeTook) {
"""
Helper to recordStep, which takes in some result, and appends a time waited, if
appropriate. If timeTook is greater than zero, some time was waited along with
the action, and the returned result will reflect that
@param actual - the actual outco... | java | private String getActual(String actual, double timeTook) {
if (timeTook > 0) {
String lowercase = actual.substring(0, 1).toLowerCase();
actual = "After waiting for " + timeTook + " seconds, " + lowercase + actual.substring(1);
}
return actual;
} | [
"private",
"String",
"getActual",
"(",
"String",
"actual",
",",
"double",
"timeTook",
")",
"{",
"if",
"(",
"timeTook",
">",
"0",
")",
"{",
"String",
"lowercase",
"=",
"actual",
".",
"substring",
"(",
"0",
",",
"1",
")",
".",
"toLowerCase",
"(",
")",
... | Helper to recordStep, which takes in some result, and appends a time waited, if
appropriate. If timeTook is greater than zero, some time was waited along with
the action, and the returned result will reflect that
@param actual - the actual outcome from the check
@param timeTook - how long something took to run, prov... | [
"Helper",
"to",
"recordStep",
"which",
"takes",
"in",
"some",
"result",
"and",
"appends",
"a",
"time",
"waited",
"if",
"appropriate",
".",
"If",
"timeTook",
"is",
"greater",
"than",
"zero",
"some",
"time",
"was",
"waited",
"along",
"with",
"the",
"action",
... | train | https://github.com/Coveros/selenified/blob/396cc1f010dd69eed33cc5061c41253de246a4cd/src/main/java/com/coveros/selenified/utilities/Reporter.java#L362-L368 |
Azure/azure-sdk-for-java | containerservice/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/containerservice/v2019_02_01/implementation/ManagedClustersInner.java | ManagedClustersInner.resetAADProfileAsync | public Observable<Void> resetAADProfileAsync(String resourceGroupName, String resourceName, ManagedClusterAADProfile parameters) {
"""
Reset AAD Profile of a managed cluster.
Update the AAD Profile for a managed cluster.
@param resourceGroupName The name of the resource group.
@param resourceName The name of ... | java | public Observable<Void> resetAADProfileAsync(String resourceGroupName, String resourceName, ManagedClusterAADProfile parameters) {
return resetAADProfileWithServiceResponseAsync(resourceGroupName, resourceName, parameters).map(new Func1<ServiceResponse<Void>, Void>() {
@Override
public V... | [
"public",
"Observable",
"<",
"Void",
">",
"resetAADProfileAsync",
"(",
"String",
"resourceGroupName",
",",
"String",
"resourceName",
",",
"ManagedClusterAADProfile",
"parameters",
")",
"{",
"return",
"resetAADProfileWithServiceResponseAsync",
"(",
"resourceGroupName",
",",
... | Reset AAD Profile of a managed cluster.
Update the AAD Profile for a managed cluster.
@param resourceGroupName The name of the resource group.
@param resourceName The name of the managed cluster resource.
@param parameters Parameters supplied to the Reset AAD Profile operation for a Managed Cluster.
@throws IllegalArg... | [
"Reset",
"AAD",
"Profile",
"of",
"a",
"managed",
"cluster",
".",
"Update",
"the",
"AAD",
"Profile",
"for",
"a",
"managed",
"cluster",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/containerservice/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/containerservice/v2019_02_01/implementation/ManagedClustersInner.java#L1704-L1711 |
calrissian/mango | mango-json/src/main/java/org/calrissian/mango/json/mappings/JsonMetadata.java | JsonMetadata.setArrayIndex | static void setArrayIndex(Map<String,String> meta, int level, int index) {
"""
Sets an array index on a map of metadata for a specific level of a nested
json tree. Since the json requires that arrays have preserved order, it's
imported that it is constrained from the flattened to the re-expanded
representation.... | java | static void setArrayIndex(Map<String,String> meta, int level, int index) {
meta.put(level + ARRAY_IDX_SUFFIX, Integer.toString(index));
} | [
"static",
"void",
"setArrayIndex",
"(",
"Map",
"<",
"String",
",",
"String",
">",
"meta",
",",
"int",
"level",
",",
"int",
"index",
")",
"{",
"meta",
".",
"put",
"(",
"level",
"+",
"ARRAY_IDX_SUFFIX",
",",
"Integer",
".",
"toString",
"(",
"index",
")",... | Sets an array index on a map of metadata for a specific level of a nested
json tree. Since the json requires that arrays have preserved order, it's
imported that it is constrained from the flattened to the re-expanded
representation.
@param meta
@param level
@param index | [
"Sets",
"an",
"array",
"index",
"on",
"a",
"map",
"of",
"metadata",
"for",
"a",
"specific",
"level",
"of",
"a",
"nested",
"json",
"tree",
".",
"Since",
"the",
"json",
"requires",
"that",
"arrays",
"have",
"preserved",
"order",
"it",
"s",
"imported",
"tha... | train | https://github.com/calrissian/mango/blob/a95aa5e77af9aa0e629787228d80806560023452/mango-json/src/main/java/org/calrissian/mango/json/mappings/JsonMetadata.java#L43-L45 |
jbundle/jbundle | model/base/src/main/java/org/jbundle/model/util/Util.java | Util.isNumeric | public static boolean isNumeric(String string, boolean bAllowFormatting) {
"""
Is this string a valid number?
@param string The string to check.
@return true if this string is a valid number (all characters numeric).
"""
if ((string == null) || (string.length() == 0))
return false;
... | java | public static boolean isNumeric(String string, boolean bAllowFormatting)
{
if ((string == null) || (string.length() == 0))
return false;
boolean bIsNumeric = true;
for (int i = 0; i < string.length(); i++)
{
if (!Character.isDigit(string.charAt(i)))
... | [
"public",
"static",
"boolean",
"isNumeric",
"(",
"String",
"string",
",",
"boolean",
"bAllowFormatting",
")",
"{",
"if",
"(",
"(",
"string",
"==",
"null",
")",
"||",
"(",
"string",
".",
"length",
"(",
")",
"==",
"0",
")",
")",
"return",
"false",
";",
... | Is this string a valid number?
@param string The string to check.
@return true if this string is a valid number (all characters numeric). | [
"Is",
"this",
"string",
"a",
"valid",
"number?"
] | train | https://github.com/jbundle/jbundle/blob/4037fcfa85f60c7d0096c453c1a3cd573c2b0abc/model/base/src/main/java/org/jbundle/model/util/Util.java#L135-L150 |
sirensolutions/siren-join | src/main/java/solutions/siren/join/index/query/FieldDataTermsQuery.java | FieldDataTermsQuery.newBytes | public static FieldDataTermsQuery newBytes(final byte[] encodedTerms, final IndexFieldData fieldData, final long cacheKey) {
"""
Get a {@link FieldDataTermsQuery} that filters on non-numeric terms found in a hppc {@link LongHashSet} of
{@link BytesRef}.
@param encodedTerms An encoded set of terms.
@param fie... | java | public static FieldDataTermsQuery newBytes(final byte[] encodedTerms, final IndexFieldData fieldData, final long cacheKey) {
return new BytesFieldDataTermsQuery(encodedTerms, fieldData, cacheKey);
} | [
"public",
"static",
"FieldDataTermsQuery",
"newBytes",
"(",
"final",
"byte",
"[",
"]",
"encodedTerms",
",",
"final",
"IndexFieldData",
"fieldData",
",",
"final",
"long",
"cacheKey",
")",
"{",
"return",
"new",
"BytesFieldDataTermsQuery",
"(",
"encodedTerms",
",",
"... | Get a {@link FieldDataTermsQuery} that filters on non-numeric terms found in a hppc {@link LongHashSet} of
{@link BytesRef}.
@param encodedTerms An encoded set of terms.
@param fieldData The fielddata for the field.
@param cacheKey A unique key to use for caching this query.
@return the query. | [
"Get",
"a",
"{",
"@link",
"FieldDataTermsQuery",
"}",
"that",
"filters",
"on",
"non",
"-",
"numeric",
"terms",
"found",
"in",
"a",
"hppc",
"{",
"@link",
"LongHashSet",
"}",
"of",
"{",
"@link",
"BytesRef",
"}",
"."
] | train | https://github.com/sirensolutions/siren-join/blob/cba1111b209ce6f72ab7750d5488a573a6c77fe5/src/main/java/solutions/siren/join/index/query/FieldDataTermsQuery.java#L94-L96 |
DV8FromTheWorld/JDA | src/main/java/net/dv8tion/jda/core/JDABuilder.java | JDABuilder.setContextMap | public JDABuilder setContextMap(ConcurrentMap<String, String> map) {
"""
Sets the {@link org.slf4j.MDC MDC} mappings to use in JDA.
<br>If sharding is enabled JDA will automatically add a {@code jda.shard} context with the format {@code [SHARD_ID / TOTAL]}
where {@code SHARD_ID} and {@code TOTAL} are the shard c... | java | public JDABuilder setContextMap(ConcurrentMap<String, String> map)
{
this.contextMap = map;
if (map != null)
this.enableContext = true;
return this;
} | [
"public",
"JDABuilder",
"setContextMap",
"(",
"ConcurrentMap",
"<",
"String",
",",
"String",
">",
"map",
")",
"{",
"this",
".",
"contextMap",
"=",
"map",
";",
"if",
"(",
"map",
"!=",
"null",
")",
"this",
".",
"enableContext",
"=",
"true",
";",
"return",
... | Sets the {@link org.slf4j.MDC MDC} mappings to use in JDA.
<br>If sharding is enabled JDA will automatically add a {@code jda.shard} context with the format {@code [SHARD_ID / TOTAL]}
where {@code SHARD_ID} and {@code TOTAL} are the shard configuration.
Additionally it will provide context for the id via {@code jda.sha... | [
"Sets",
"the",
"{",
"@link",
"org",
".",
"slf4j",
".",
"MDC",
"MDC",
"}",
"mappings",
"to",
"use",
"in",
"JDA",
".",
"<br",
">",
"If",
"sharding",
"is",
"enabled",
"JDA",
"will",
"automatically",
"add",
"a",
"{",
"@code",
"jda",
".",
"shard",
"}",
... | train | https://github.com/DV8FromTheWorld/JDA/blob/8ecbbe354d03f6bf448411bba573d0d4c268b560/src/main/java/net/dv8tion/jda/core/JDABuilder.java#L186-L192 |
alkacon/opencms-core | src/org/opencms/workplace/CmsDialog.java | CmsDialog.initCmsDialog | public static CmsDialog initCmsDialog(PageContext context, HttpServletRequest req, HttpServletResponse res) {
"""
Returns an initialized CmsDialog instance that is read from the request attributes.<p>
This method is used by dialog elements.
The dialog elements do not initialize their own workplace class,
but ... | java | public static CmsDialog initCmsDialog(PageContext context, HttpServletRequest req, HttpServletResponse res) {
CmsDialog wp = (CmsDialog)req.getAttribute(CmsWorkplace.SESSION_WORKPLACE_CLASS);
if (wp == null) {
// ensure that we don't get null pointers if the page is directly called
... | [
"public",
"static",
"CmsDialog",
"initCmsDialog",
"(",
"PageContext",
"context",
",",
"HttpServletRequest",
"req",
",",
"HttpServletResponse",
"res",
")",
"{",
"CmsDialog",
"wp",
"=",
"(",
"CmsDialog",
")",
"req",
".",
"getAttribute",
"(",
"CmsWorkplace",
".",
"... | Returns an initialized CmsDialog instance that is read from the request attributes.<p>
This method is used by dialog elements.
The dialog elements do not initialize their own workplace class,
but use the initialized instance of the "master" class.
This is required to ensure that parameters of the "master" class
can pr... | [
"Returns",
"an",
"initialized",
"CmsDialog",
"instance",
"that",
"is",
"read",
"from",
"the",
"request",
"attributes",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/workplace/CmsDialog.java#L319-L328 |
h2oai/h2o-3 | h2o-core/src/main/java/hex/AUC2.java | AUC2.compute_auc | private double compute_auc() {
"""
points. TPR and FPR are monotonically increasing from 0 to 1.
"""
if (_fps[_nBins-1] == 0) return 1.0; //special case
if (_tps[_nBins-1] == 0) return 0.0; //special case
// All math is computed scaled by TP and FP. We'll descale once at the
// end. Trapezo... | java | private double compute_auc() {
if (_fps[_nBins-1] == 0) return 1.0; //special case
if (_tps[_nBins-1] == 0) return 0.0; //special case
// All math is computed scaled by TP and FP. We'll descale once at the
// end. Trapezoids from (tps[i-1],fps[i-1]) to (tps[i],fps[i])
double tp0 = 0, fp0 = 0;
... | [
"private",
"double",
"compute_auc",
"(",
")",
"{",
"if",
"(",
"_fps",
"[",
"_nBins",
"-",
"1",
"]",
"==",
"0",
")",
"return",
"1.0",
";",
"//special case",
"if",
"(",
"_tps",
"[",
"_nBins",
"-",
"1",
"]",
"==",
"0",
")",
"return",
"0.0",
";",
"//... | points. TPR and FPR are monotonically increasing from 0 to 1. | [
"points",
".",
"TPR",
"and",
"FPR",
"are",
"monotonically",
"increasing",
"from",
"0",
"to",
"1",
"."
] | train | https://github.com/h2oai/h2o-3/blob/845eb49dfeaadf638b6e2f779d82fac996391fad/h2o-core/src/main/java/hex/AUC2.java#L203-L217 |
uscexp/grappa.extension | src/main/java/com/github/uscexp/grappa/extension/interpreter/ProcessStore.java | ProcessStore.setNewVariable | public boolean setNewVariable(Object key, Object value) {
"""
set a new variable, on the highest block hierarchy or global if no
hierarchy exists.
@param key
name of the variable
@param value
value of the variable
@return true if at least one local block hierarchy exists else false
"""
boolean succes... | java | public boolean setNewVariable(Object key, Object value) {
boolean success = false;
success = setLocalVariable(key, value);
if (!success) {
setGlobalVariable(key, value);
success = true;
}
return success;
} | [
"public",
"boolean",
"setNewVariable",
"(",
"Object",
"key",
",",
"Object",
"value",
")",
"{",
"boolean",
"success",
"=",
"false",
";",
"success",
"=",
"setLocalVariable",
"(",
"key",
",",
"value",
")",
";",
"if",
"(",
"!",
"success",
")",
"{",
"setGloba... | set a new variable, on the highest block hierarchy or global if no
hierarchy exists.
@param key
name of the variable
@param value
value of the variable
@return true if at least one local block hierarchy exists else false | [
"set",
"a",
"new",
"variable",
"on",
"the",
"highest",
"block",
"hierarchy",
"or",
"global",
"if",
"no",
"hierarchy",
"exists",
"."
] | train | https://github.com/uscexp/grappa.extension/blob/a6001eb6eee434a09e2870e7513f883c7fdaea94/src/main/java/com/github/uscexp/grappa/extension/interpreter/ProcessStore.java#L300-L311 |
CleverTap/clevertap-android-sdk | clevertap-android-sdk/src/main/java/com/clevertap/android/sdk/DBAdapter.java | DBAdapter.deleteMessageForId | synchronized boolean deleteMessageForId(String messageId, String userId) {
"""
Deletes the inbox message for given messageId
@param messageId String messageId
@return boolean value based on success of operation
"""
if(messageId == null || userId == null) return false;
final String tName = Ta... | java | synchronized boolean deleteMessageForId(String messageId, String userId){
if(messageId == null || userId == null) return false;
final String tName = Table.INBOX_MESSAGES.getName();
try {
final SQLiteDatabase db = dbHelper.getWritableDatabase();
db.delete(tName, _ID + " ... | [
"synchronized",
"boolean",
"deleteMessageForId",
"(",
"String",
"messageId",
",",
"String",
"userId",
")",
"{",
"if",
"(",
"messageId",
"==",
"null",
"||",
"userId",
"==",
"null",
")",
"return",
"false",
";",
"final",
"String",
"tName",
"=",
"Table",
".",
... | Deletes the inbox message for given messageId
@param messageId String messageId
@return boolean value based on success of operation | [
"Deletes",
"the",
"inbox",
"message",
"for",
"given",
"messageId"
] | train | https://github.com/CleverTap/clevertap-android-sdk/blob/be134c06a4f07494c398335ad9ff4976633743e1/clevertap-android-sdk/src/main/java/com/clevertap/android/sdk/DBAdapter.java#L672-L687 |
killbilling/recurly-java-library | src/main/java/com/ning/billing/recurly/RecurlyClient.java | RecurlyClient.refundInvoice | @Deprecated
public Invoice refundInvoice(final String invoiceId, List<AdjustmentRefund> lineItems, final RefundMethod method) {
"""
Refund an invoice given some line items
<p/>
Returns the refunded invoice
@deprecated Please use refundInvoice(String, InvoiceRefund)
@param invoiceId The id of the invoic... | java | @Deprecated
public Invoice refundInvoice(final String invoiceId, List<AdjustmentRefund> lineItems, final RefundMethod method) {
final InvoiceRefund invoiceRefund = new InvoiceRefund();
invoiceRefund.setRefundMethod(method);
invoiceRefund.setLineItems(lineItems);
return refundInvoice... | [
"@",
"Deprecated",
"public",
"Invoice",
"refundInvoice",
"(",
"final",
"String",
"invoiceId",
",",
"List",
"<",
"AdjustmentRefund",
">",
"lineItems",
",",
"final",
"RefundMethod",
"method",
")",
"{",
"final",
"InvoiceRefund",
"invoiceRefund",
"=",
"new",
"InvoiceR... | Refund an invoice given some line items
<p/>
Returns the refunded invoice
@deprecated Please use refundInvoice(String, InvoiceRefund)
@param invoiceId The id of the invoice to refund
@param lineItems The list of adjustment refund objects
@param method If credit line items exist on the invoice, this parameter specifie... | [
"Refund",
"an",
"invoice",
"given",
"some",
"line",
"items",
"<p",
"/",
">",
"Returns",
"the",
"refunded",
"invoice"
] | train | https://github.com/killbilling/recurly-java-library/blob/5e05eedd91885a51e1aa8293bd41139d082cf7f4/src/main/java/com/ning/billing/recurly/RecurlyClient.java#L1149-L1156 |
saxsys/SynchronizeFX | transmitter/websocket-transmitter/src/main/java/de/saxsys/synchronizefx/websocket/SychronizeFXWebsocketServer.java | SychronizeFXWebsocketServer.newChannel | public SynchronizeFxServer newChannel(final Object root, final String channelName,
final Executor modelChangeExecutor, final ServerCallback callback) {
"""
Creates a new {@link SynchronizeFxServer} that synchronizes it's own model.
<p>
Each {@link SynchronizeFxServer} managed by this servlet must h... | java | public SynchronizeFxServer newChannel(final Object root, final String channelName,
final Executor modelChangeExecutor, final ServerCallback callback) {
synchronized (channels) {
if (channels.containsKey(channelName)) {
throw new IllegalArgumentException("A new Synchronize... | [
"public",
"SynchronizeFxServer",
"newChannel",
"(",
"final",
"Object",
"root",
",",
"final",
"String",
"channelName",
",",
"final",
"Executor",
"modelChangeExecutor",
",",
"final",
"ServerCallback",
"callback",
")",
"{",
"synchronized",
"(",
"channels",
")",
"{",
... | Creates a new {@link SynchronizeFxServer} that synchronizes it's own model.
<p>
Each {@link SynchronizeFxServer} managed by this servlet must have its own channel name.
</p>
@param root The root object of the model that should be synchronized.
@param channelName The name of the channel at which clients can connect to... | [
"Creates",
"a",
"new",
"{",
"@link",
"SynchronizeFxServer",
"}",
"that",
"synchronizes",
"it",
"s",
"own",
"model",
"."
] | train | https://github.com/saxsys/SynchronizeFX/blob/f3683020e4749110b38514eb5bc73a247998b579/transmitter/websocket-transmitter/src/main/java/de/saxsys/synchronizefx/websocket/SychronizeFXWebsocketServer.java#L114-L130 |
albfernandez/itext2 | src/main/java/com/lowagie/text/rtf/parser/ctrlwords/RtfCtrlWordMgr.java | RtfCtrlWordMgr.handleKeyword | public int handleKeyword(RtfCtrlWordData ctrlWordData, int groupLevel) {
"""
Internal to control word manager class.
@param ctrlWordData The <code>RtfCtrlWordData</code> object with control word and param
@param groupLevel The current document group parsing level
@return errOK if ok, otherwise an error code.
... | java | public int handleKeyword(RtfCtrlWordData ctrlWordData, int groupLevel) {
//TODO: May be used for event handling.
int result = RtfParser.errOK;
// Call before handler event here
beforeCtrlWord(ctrlWordData);
result = dispatchKeyword(ctrlWordData, groupLevel);
// call after handler event here
after... | [
"public",
"int",
"handleKeyword",
"(",
"RtfCtrlWordData",
"ctrlWordData",
",",
"int",
"groupLevel",
")",
"{",
"//TODO: May be used for event handling.",
"int",
"result",
"=",
"RtfParser",
".",
"errOK",
";",
"// Call before handler event here",
"beforeCtrlWord",
"(",
"ctrl... | Internal to control word manager class.
@param ctrlWordData The <code>RtfCtrlWordData</code> object with control word and param
@param groupLevel The current document group parsing level
@return errOK if ok, otherwise an error code. | [
"Internal",
"to",
"control",
"word",
"manager",
"class",
"."
] | train | https://github.com/albfernandez/itext2/blob/438fc1899367fd13dfdfa8dfdca9a3c1a7783b84/src/main/java/com/lowagie/text/rtf/parser/ctrlwords/RtfCtrlWordMgr.java#L110-L123 |
jboss/jboss-el-api_spec | src/main/java/org/jboss/el/cache/FactoryFinderCache.java | FactoryFinderCache.addCacheEntry | public static void addCacheEntry(final ClassLoader classLoader, final String factoryId, final String factoryClassName) {
"""
Called by the container at deployment time to set the name of a given factory, to remove the need for the
implementation to look it up on every call.
@param classLoader The deployme... | java | public static void addCacheEntry(final ClassLoader classLoader, final String factoryId, final String factoryClassName) {
if (factoryClassName == null) {
CLASS_CACHE.put(new CacheKey(classLoader, factoryId), "");
} else {
CLASS_CACHE.put(new CacheKey(classLoader, factoryId), facto... | [
"public",
"static",
"void",
"addCacheEntry",
"(",
"final",
"ClassLoader",
"classLoader",
",",
"final",
"String",
"factoryId",
",",
"final",
"String",
"factoryClassName",
")",
"{",
"if",
"(",
"factoryClassName",
"==",
"null",
")",
"{",
"CLASS_CACHE",
".",
"put",
... | Called by the container at deployment time to set the name of a given factory, to remove the need for the
implementation to look it up on every call.
@param classLoader The deployments class loader
@param factoryId The type of factory that is being recorded (at this stage only javax.el.ExpressionFactory ha... | [
"Called",
"by",
"the",
"container",
"at",
"deployment",
"time",
"to",
"set",
"the",
"name",
"of",
"a",
"given",
"factory",
"to",
"remove",
"the",
"need",
"for",
"the",
"implementation",
"to",
"look",
"it",
"up",
"on",
"every",
"call",
"."
] | train | https://github.com/jboss/jboss-el-api_spec/blob/4cef117cae3ccf9f76439845687a8d219ad2eb43/src/main/java/org/jboss/el/cache/FactoryFinderCache.java#L47-L53 |
authlete/authlete-java-common | src/main/java/com/authlete/common/util/TypedProperties.java | TypedProperties.setBoolean | public void setBoolean(Enum<?> key, boolean value) {
"""
Equivalent to {@link #setBoolean(String, boolean)
setBoolean}{@code (key.name(), value)}.
If {@code key} is null, nothing is done.
"""
if (key == null)
{
return;
}
setBoolean(key.name(), value);
} | java | public void setBoolean(Enum<?> key, boolean value)
{
if (key == null)
{
return;
}
setBoolean(key.name(), value);
} | [
"public",
"void",
"setBoolean",
"(",
"Enum",
"<",
"?",
">",
"key",
",",
"boolean",
"value",
")",
"{",
"if",
"(",
"key",
"==",
"null",
")",
"{",
"return",
";",
"}",
"setBoolean",
"(",
"key",
".",
"name",
"(",
")",
",",
"value",
")",
";",
"}"
] | Equivalent to {@link #setBoolean(String, boolean)
setBoolean}{@code (key.name(), value)}.
If {@code key} is null, nothing is done. | [
"Equivalent",
"to",
"{"
] | train | https://github.com/authlete/authlete-java-common/blob/49c94c483713cbf5a04d805ff7dbd83766c9c964/src/main/java/com/authlete/common/util/TypedProperties.java#L597-L605 |
Commonjava/webdav-handler | common/src/main/java/net/sf/webdav/locking/ResourceLocks.java | ResourceLocks.generateTempLockedObjects | private LockedObject generateTempLockedObjects(ITransaction transaction,
String path) {
"""
generates temporary LockedObjects for the resource at path and its parent
folders. does not create new LockedObjects if they already exist
@param transaction
@param path
path to the (new) LockedObject
@re... | java | private LockedObject generateTempLockedObjects(ITransaction transaction,
String path) {
if (!_tempLocks.containsKey(path)) {
LockedObject returnObject = new LockedObject(this, path, _temporary);
String parentPath = getParentPath(path);
if (parentPath != null) {
... | [
"private",
"LockedObject",
"generateTempLockedObjects",
"(",
"ITransaction",
"transaction",
",",
"String",
"path",
")",
"{",
"if",
"(",
"!",
"_tempLocks",
".",
"containsKey",
"(",
"path",
")",
")",
"{",
"LockedObject",
"returnObject",
"=",
"new",
"LockedObject",
... | generates temporary LockedObjects for the resource at path and its parent
folders. does not create new LockedObjects if they already exist
@param transaction
@param path
path to the (new) LockedObject
@return the LockedObject for path. | [
"generates",
"temporary",
"LockedObjects",
"for",
"the",
"resource",
"at",
"path",
"and",
"its",
"parent",
"folders",
".",
"does",
"not",
"create",
"new",
"LockedObjects",
"if",
"they",
"already",
"exist"
] | train | https://github.com/Commonjava/webdav-handler/blob/39bb7032fc75c1b67d3f2440dd1c234ead96cb9d/common/src/main/java/net/sf/webdav/locking/ResourceLocks.java#L289-L306 |
Jasig/uPortal | uPortal-rendering/src/main/java/org/apereo/portal/portlet/container/cache/PortletCacheControlServiceImpl.java | PortletCacheControlServiceImpl.getPortletCacheState | @SuppressWarnings("unchecked")
protected <D extends CachedPortletResultHolder<T>, T extends Serializable>
CacheState<D, T> getPortletCacheState(
HttpServletRequest request,
IPortletWindow portletWindow,
PublicPortletCacheKey publicCacheKey,
... | java | @SuppressWarnings("unchecked")
protected <D extends CachedPortletResultHolder<T>, T extends Serializable>
CacheState<D, T> getPortletCacheState(
HttpServletRequest request,
IPortletWindow portletWindow,
PublicPortletCacheKey publicCacheKey,
... | [
"@",
"SuppressWarnings",
"(",
"\"unchecked\"",
")",
"protected",
"<",
"D",
"extends",
"CachedPortletResultHolder",
"<",
"T",
">",
",",
"T",
"extends",
"Serializable",
">",
"CacheState",
"<",
"D",
",",
"T",
">",
"getPortletCacheState",
"(",
"HttpServletRequest",
... | Get the cached portlet data looking in both the public and then private caches returning the
first found
@param request The current request
@param portletWindow The window to get data for
@param publicCacheKey The public cache key
@param publicOutputCache The public cache
@param privateOutputCache The private cache | [
"Get",
"the",
"cached",
"portlet",
"data",
"looking",
"in",
"both",
"the",
"public",
"and",
"then",
"private",
"caches",
"returning",
"the",
"first",
"found"
] | train | https://github.com/Jasig/uPortal/blob/c1986542abb9acd214268f2df21c6305ad2f262b/uPortal-rendering/src/main/java/org/apereo/portal/portlet/container/cache/PortletCacheControlServiceImpl.java#L345-L384 |
ACRA/acra | acra-core/src/main/java/org/acra/collector/DisplayManagerCollector.java | DisplayManagerCollector.activeFlags | @NonNull
private String activeFlags(SparseArray<String> flagNames, int bitfield) {
"""
Some fields contain multiple value types which can be isolated by
applying a bitmask. That method returns the concatenation of active
values.
@param bitfield The bitfield to inspect.
@return The names of the different ... | java | @NonNull
private String activeFlags(SparseArray<String> flagNames, int bitfield) {
final StringBuilder result = new StringBuilder();
// Look for masks, apply it an retrieve the masked value
for (int i = 0; i < flagNames.size(); i++) {
final int maskValue = flagNames.keyAt(i);
... | [
"@",
"NonNull",
"private",
"String",
"activeFlags",
"(",
"SparseArray",
"<",
"String",
">",
"flagNames",
",",
"int",
"bitfield",
")",
"{",
"final",
"StringBuilder",
"result",
"=",
"new",
"StringBuilder",
"(",
")",
";",
"// Look for masks, apply it an retrieve the ma... | Some fields contain multiple value types which can be isolated by
applying a bitmask. That method returns the concatenation of active
values.
@param bitfield The bitfield to inspect.
@return The names of the different values contained in the bitfield,
separated by '+'. | [
"Some",
"fields",
"contain",
"multiple",
"value",
"types",
"which",
"can",
"be",
"isolated",
"by",
"applying",
"a",
"bitmask",
".",
"That",
"method",
"returns",
"the",
"concatenation",
"of",
"active",
"values",
"."
] | train | https://github.com/ACRA/acra/blob/bfa3235ab110328c5ab2f792ddf8ee87be4a32d1/acra-core/src/main/java/org/acra/collector/DisplayManagerCollector.java#L219-L235 |
Cornutum/tcases | tcases-io/src/main/java/org/cornutum/tcases/io/ProjectJson.java | ProjectJson.asGeneratorSet | private static IGeneratorSet asGeneratorSet( JsonValue json) {
"""
Returns the generator set represented by the given JSON value.
"""
try
{
IGeneratorSet generators = null;
if( json != null && json.getValueType() == OBJECT)
{
generators = GeneratorSetJson.asGeneratorSet( (... | java | private static IGeneratorSet asGeneratorSet( JsonValue json)
{
try
{
IGeneratorSet generators = null;
if( json != null && json.getValueType() == OBJECT)
{
generators = GeneratorSetJson.asGeneratorSet( (JsonObject) json);
}
return generators;
}
catch( Ex... | [
"private",
"static",
"IGeneratorSet",
"asGeneratorSet",
"(",
"JsonValue",
"json",
")",
"{",
"try",
"{",
"IGeneratorSet",
"generators",
"=",
"null",
";",
"if",
"(",
"json",
"!=",
"null",
"&&",
"json",
".",
"getValueType",
"(",
")",
"==",
"OBJECT",
")",
"{",... | Returns the generator set represented by the given JSON value. | [
"Returns",
"the",
"generator",
"set",
"represented",
"by",
"the",
"given",
"JSON",
"value",
"."
] | train | https://github.com/Cornutum/tcases/blob/21e15cf107fa149620c40f4bda1829c1224fcfb1/tcases-io/src/main/java/org/cornutum/tcases/io/ProjectJson.java#L117-L133 |
vkostyukov/la4j | src/main/java/org/la4j/matrix/SparseMatrix.java | SparseMatrix.eachNonZeroInRow | public void eachNonZeroInRow(int i, VectorProcedure procedure) {
"""
Applies the given {@code procedure} to each non-zero element of the specified row of this matrix.
@param i the row index.
@param procedure the {@link VectorProcedure}.
"""
VectorIterator it = nonZeroIteratorOfRow(i);
whil... | java | public void eachNonZeroInRow(int i, VectorProcedure procedure) {
VectorIterator it = nonZeroIteratorOfRow(i);
while (it.hasNext()) {
double x = it.next();
int j = it.index();
procedure.apply(j, x);
}
} | [
"public",
"void",
"eachNonZeroInRow",
"(",
"int",
"i",
",",
"VectorProcedure",
"procedure",
")",
"{",
"VectorIterator",
"it",
"=",
"nonZeroIteratorOfRow",
"(",
"i",
")",
";",
"while",
"(",
"it",
".",
"hasNext",
"(",
")",
")",
"{",
"double",
"x",
"=",
"it... | Applies the given {@code procedure} to each non-zero element of the specified row of this matrix.
@param i the row index.
@param procedure the {@link VectorProcedure}. | [
"Applies",
"the",
"given",
"{",
"@code",
"procedure",
"}",
"to",
"each",
"non",
"-",
"zero",
"element",
"of",
"the",
"specified",
"row",
"of",
"this",
"matrix",
"."
] | train | https://github.com/vkostyukov/la4j/blob/dd1b917caf9606399a49afa6b0d738934cd3a7b3/src/main/java/org/la4j/matrix/SparseMatrix.java#L307-L315 |
Azure/azure-sdk-for-java | automation/resource-manager/v2015_10_31/src/main/java/com/microsoft/azure/management/automation/v2015_10_31/implementation/DscCompilationJobsInner.java | DscCompilationJobsInner.getStreamAsync | public Observable<JobStreamInner> getStreamAsync(String resourceGroupName, String automationAccountName, UUID jobId, String jobStreamId) {
"""
Retrieve the job stream identified by job stream id.
@param resourceGroupName Name of an Azure Resource group.
@param automationAccountName The name of the automation a... | java | public Observable<JobStreamInner> getStreamAsync(String resourceGroupName, String automationAccountName, UUID jobId, String jobStreamId) {
return getStreamWithServiceResponseAsync(resourceGroupName, automationAccountName, jobId, jobStreamId).map(new Func1<ServiceResponse<JobStreamInner>, JobStreamInner>() {
... | [
"public",
"Observable",
"<",
"JobStreamInner",
">",
"getStreamAsync",
"(",
"String",
"resourceGroupName",
",",
"String",
"automationAccountName",
",",
"UUID",
"jobId",
",",
"String",
"jobStreamId",
")",
"{",
"return",
"getStreamWithServiceResponseAsync",
"(",
"resourceG... | Retrieve the job stream identified by job stream id.
@param resourceGroupName Name of an Azure Resource group.
@param automationAccountName The name of the automation account.
@param jobId The job id.
@param jobStreamId The job stream id.
@throws IllegalArgumentException thrown if parameters fail the validation
@retur... | [
"Retrieve",
"the",
"job",
"stream",
"identified",
"by",
"job",
"stream",
"id",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/automation/resource-manager/v2015_10_31/src/main/java/com/microsoft/azure/management/automation/v2015_10_31/implementation/DscCompilationJobsInner.java#L559-L566 |
xcesco/kripton | kripton-processor/src/main/java/com/abubusoft/kripton/processor/core/AssertKripton.java | AssertKripton.failUnknownPropertyInJQLException | public static void failUnknownPropertyInJQLException(SQLiteModelMethod method,
Class<? extends Annotation> annotationClazz, AnnotationAttributeType attribute, String fieldName) {
"""
Fail unknown property in JQL exception.
@param method
the method
@param annotationClazz
the annotation clazz
@param attrib... | java | public static void failUnknownPropertyInJQLException(SQLiteModelMethod method,
Class<? extends Annotation> annotationClazz, AnnotationAttributeType attribute, String fieldName) {
throw (new UnknownPropertyInJQLException(method, annotationClazz, attribute, fieldName));
} | [
"public",
"static",
"void",
"failUnknownPropertyInJQLException",
"(",
"SQLiteModelMethod",
"method",
",",
"Class",
"<",
"?",
"extends",
"Annotation",
">",
"annotationClazz",
",",
"AnnotationAttributeType",
"attribute",
",",
"String",
"fieldName",
")",
"{",
"throw",
"(... | Fail unknown property in JQL exception.
@param method
the method
@param annotationClazz
the annotation clazz
@param attribute
the attribute
@param fieldName
the field name | [
"Fail",
"unknown",
"property",
"in",
"JQL",
"exception",
"."
] | train | https://github.com/xcesco/kripton/blob/90de2c0523d39b99e81b8d38aa996898762f594a/kripton-processor/src/main/java/com/abubusoft/kripton/processor/core/AssertKripton.java#L311-L315 |
adorsys/hbci4java-adorsys | src/main/java/org/kapott/cryptalgs/ISO9796p1.java | ISO9796p1.engineVerify | @Override
protected boolean engineVerify(byte[] sig)
throws SignatureException {
"""
/*private byte[] getRRfromIR(byte[] ir, int k, byte[] modulus, byte[] privExponent)
{
byte[] ir2 = new byte[ir.length];
System.arraycopy(ir, 0, ir2, 0, ir.length);
ir2[0] &= ((1 << (8 - ((ir.length << 3) - k))) - 1... | java | @Override
protected boolean engineVerify(byte[] sig)
throws SignatureException {
BigInteger bExponent = this.pubKey.getPublicExponent();
byte[] exponent = bExponent.toByteArray();
BigInteger bModulus = this.pubKey.getModulus();
byte[] modulus = bModulus.toByteArray();
... | [
"@",
"Override",
"protected",
"boolean",
"engineVerify",
"(",
"byte",
"[",
"]",
"sig",
")",
"throws",
"SignatureException",
"{",
"BigInteger",
"bExponent",
"=",
"this",
".",
"pubKey",
".",
"getPublicExponent",
"(",
")",
";",
"byte",
"[",
"]",
"exponent",
"="... | /*private byte[] getRRfromIR(byte[] ir, int k, byte[] modulus, byte[] privExponent)
{
byte[] ir2 = new byte[ir.length];
System.arraycopy(ir, 0, ir2, 0, ir.length);
ir2[0] &= ((1 << (8 - ((ir.length << 3) - k))) - 1);
BigInteger bIR = new BigInteger(+1, ir2);
BigInteger bModulus = new BigInteger(+1, modulus);
BigIntege... | [
"/",
"*",
"private",
"byte",
"[]",
"getRRfromIR",
"(",
"byte",
"[]",
"ir",
"int",
"k",
"byte",
"[]",
"modulus",
"byte",
"[]",
"privExponent",
")",
"{",
"byte",
"[]",
"ir2",
"=",
"new",
"byte",
"[",
"ir",
".",
"length",
"]",
";",
"System",
".",
"arr... | train | https://github.com/adorsys/hbci4java-adorsys/blob/5e24f7e429d6b555e1d993196b4cf1adda6433cf/src/main/java/org/kapott/cryptalgs/ISO9796p1.java#L429-L473 |
intuit/QuickBooks-V3-Java-SDK | ipp-v3-java-devkit/src/main/java/com/intuit/ipp/services/DataService.java | DataService.executeCDCQueryAsync | public void executeCDCQueryAsync(List<? extends IEntity> entities, String changedSince, CallbackHandler callbackHandler) throws FMSException {
"""
Method to retrieve records for the given list of query in asynchronous fashion
@param entities the list of entities to be listed in the response
@param changedSince... | java | public void executeCDCQueryAsync(List<? extends IEntity> entities, String changedSince, CallbackHandler callbackHandler) throws FMSException {
IntuitMessage intuitMessage = prepareCDCQuery(entities, changedSince);
//set callback handler
intuitMessage.getRequestElements().setCallbackHandler(call... | [
"public",
"void",
"executeCDCQueryAsync",
"(",
"List",
"<",
"?",
"extends",
"IEntity",
">",
"entities",
",",
"String",
"changedSince",
",",
"CallbackHandler",
"callbackHandler",
")",
"throws",
"FMSException",
"{",
"IntuitMessage",
"intuitMessage",
"=",
"prepareCDCQuer... | Method to retrieve records for the given list of query in asynchronous fashion
@param entities the list of entities to be listed in the response
@param changedSince the date where the entities should be listed from the last changed date
@param callbackHandler
the callback handler
@throws FMSException | [
"Method",
"to",
"retrieve",
"records",
"for",
"the",
"given",
"list",
"of",
"query",
"in",
"asynchronous",
"fashion"
] | train | https://github.com/intuit/QuickBooks-V3-Java-SDK/blob/59f988d0776d46620d0b34711c411b2b5b1da06b/ipp-v3-java-devkit/src/main/java/com/intuit/ipp/services/DataService.java#L984-L992 |
Appendium/flatpack | flatpack/src/main/java/net/sf/flatpack/util/ParserUtils.java | ParserUtils.getDelimiterOffset | public static int getDelimiterOffset(final String line, final int start, final char delimiter) {
"""
reads from the specified point in the line and returns how many chars to
the specified delimiter
@param line
@param start
@param delimiter
@return int
"""
int idx = line.indexOf(delimiter, start... | java | public static int getDelimiterOffset(final String line, final int start, final char delimiter) {
int idx = line.indexOf(delimiter, start);
if (idx >= 0) {
idx -= start - 1;
}
return idx;
} | [
"public",
"static",
"int",
"getDelimiterOffset",
"(",
"final",
"String",
"line",
",",
"final",
"int",
"start",
",",
"final",
"char",
"delimiter",
")",
"{",
"int",
"idx",
"=",
"line",
".",
"indexOf",
"(",
"delimiter",
",",
"start",
")",
";",
"if",
"(",
... | reads from the specified point in the line and returns how many chars to
the specified delimiter
@param line
@param start
@param delimiter
@return int | [
"reads",
"from",
"the",
"specified",
"point",
"in",
"the",
"line",
"and",
"returns",
"how",
"many",
"chars",
"to",
"the",
"specified",
"delimiter"
] | train | https://github.com/Appendium/flatpack/blob/5e09875d97db7038e3ba6af9468f5313d99b0082/flatpack/src/main/java/net/sf/flatpack/util/ParserUtils.java#L301-L307 |
ops4j/org.ops4j.base | ops4j-base-lang/src/main/java/org/ops4j/lang/PreConditionException.java | PreConditionException.validateGreaterThan | public static void validateGreaterThan( double value, double limit, String identifier )
throws PreConditionException {
"""
Validates that the value is greater than a limit.
<p/>
This method ensures that <code>value > limit</code>.
@param identifier The name of the object.
@param limit The limit ... | java | public static void validateGreaterThan( double value, double limit, String identifier )
throws PreConditionException
{
if( value > limit )
{
return;
}
throw new PreConditionException( identifier + " was not greater than " + limit + ". Was: " + value );
} | [
"public",
"static",
"void",
"validateGreaterThan",
"(",
"double",
"value",
",",
"double",
"limit",
",",
"String",
"identifier",
")",
"throws",
"PreConditionException",
"{",
"if",
"(",
"value",
">",
"limit",
")",
"{",
"return",
";",
"}",
"throw",
"new",
"PreC... | Validates that the value is greater than a limit.
<p/>
This method ensures that <code>value > limit</code>.
@param identifier The name of the object.
@param limit The limit that the value must exceed.
@param value The value to be tested.
@throws PreConditionException if the condition is not met. | [
"Validates",
"that",
"the",
"value",
"is",
"greater",
"than",
"a",
"limit",
".",
"<p",
"/",
">",
"This",
"method",
"ensures",
"that",
"<code",
">",
"value",
">",
"limit<",
"/",
"code",
">",
"."
] | train | https://github.com/ops4j/org.ops4j.base/blob/b0e742c0d9511f6b19ca64da2ebaf30b7a47256a/ops4j-base-lang/src/main/java/org/ops4j/lang/PreConditionException.java#L106-L114 |
khuxtable/seaglass | src/main/java/com/seaglasslookandfeel/ui/SeaGlassSeparatorUI.java | SeaGlassSeparatorUI.paint | protected void paint(SeaGlassContext context, Graphics g) {
"""
DOCUMENT ME!
@param context DOCUMENT ME!
@param g DOCUMENT ME!
"""
JSeparator separator = (JSeparator) context.getComponent();
context.getPainter().paintSeparatorForeground(context, g, 0, 0, separator.getWidth(), separat... | java | protected void paint(SeaGlassContext context, Graphics g) {
JSeparator separator = (JSeparator) context.getComponent();
context.getPainter().paintSeparatorForeground(context, g, 0, 0, separator.getWidth(), separator.getHeight(),
separator.getOrienta... | [
"protected",
"void",
"paint",
"(",
"SeaGlassContext",
"context",
",",
"Graphics",
"g",
")",
"{",
"JSeparator",
"separator",
"=",
"(",
"JSeparator",
")",
"context",
".",
"getComponent",
"(",
")",
";",
"context",
".",
"getPainter",
"(",
")",
".",
"paintSeparat... | DOCUMENT ME!
@param context DOCUMENT ME!
@param g DOCUMENT ME! | [
"DOCUMENT",
"ME!"
] | train | https://github.com/khuxtable/seaglass/blob/f25ecba622923d7b29b64cb7d6068dd8005989b3/src/main/java/com/seaglasslookandfeel/ui/SeaGlassSeparatorUI.java#L182-L187 |
captain-miao/OptionRoundCardview | optroundcardview/src/main/java/com/github/captain_miao/optroundcardview/OptRoundCardView.java | OptRoundCardView.setShadowPadding | @Override
public void setShadowPadding(int left, int top, int right, int bottom) {
"""
Internal method used by CardView implementations to update the padding.
@hide
"""
mShadowBounds.set(left, top, right, bottom);
super.setPadding(left + mContentPadding.left, top + mContentPadding.top,
... | java | @Override
public void setShadowPadding(int left, int top, int right, int bottom) {
mShadowBounds.set(left, top, right, bottom);
super.setPadding(left + mContentPadding.left, top + mContentPadding.top,
right + mContentPadding.right, bottom + mContentPadding.bottom);
} | [
"@",
"Override",
"public",
"void",
"setShadowPadding",
"(",
"int",
"left",
",",
"int",
"top",
",",
"int",
"right",
",",
"int",
"bottom",
")",
"{",
"mShadowBounds",
".",
"set",
"(",
"left",
",",
"top",
",",
"right",
",",
"bottom",
")",
";",
"super",
"... | Internal method used by CardView implementations to update the padding.
@hide | [
"Internal",
"method",
"used",
"by",
"CardView",
"implementations",
"to",
"update",
"the",
"padding",
"."
] | train | https://github.com/captain-miao/OptionRoundCardview/blob/aefad1e42351958724b916b8003a24f10634b3d8/optroundcardview/src/main/java/com/github/captain_miao/optroundcardview/OptRoundCardView.java#L347-L352 |
mgormley/pacaya | src/main/java/edu/jhu/pacaya/gm/model/FgModel.java | FgModel.setRandomStandardNormal | public void setRandomStandardNormal() {
"""
Fill the model parameters with values randomly drawn from ~ Normal(0, 1).
"""
FnIntDoubleToDouble lambda = new FnIntDoubleToDouble() {
@Override
public double call(int idx, double val) {
return Gaussian.nextDouble(0.0, ... | java | public void setRandomStandardNormal() {
FnIntDoubleToDouble lambda = new FnIntDoubleToDouble() {
@Override
public double call(int idx, double val) {
return Gaussian.nextDouble(0.0, 1.0);
}
};
apply(lambda);
} | [
"public",
"void",
"setRandomStandardNormal",
"(",
")",
"{",
"FnIntDoubleToDouble",
"lambda",
"=",
"new",
"FnIntDoubleToDouble",
"(",
")",
"{",
"@",
"Override",
"public",
"double",
"call",
"(",
"int",
"idx",
",",
"double",
"val",
")",
"{",
"return",
"Gaussian",... | Fill the model parameters with values randomly drawn from ~ Normal(0, 1). | [
"Fill",
"the",
"model",
"parameters",
"with",
"values",
"randomly",
"drawn",
"from",
"~",
"Normal",
"(",
"0",
"1",
")",
"."
] | train | https://github.com/mgormley/pacaya/blob/786294cbac7cc65dbc32210c10acc32ed0c69233/src/main/java/edu/jhu/pacaya/gm/model/FgModel.java#L178-L186 |
dkpro/dkpro-argumentation | dkpro-argumentation-misc/src/main/java/org/dkpro/argumentation/misc/uima/JCasUtil2.java | JCasUtil2.getPrecedingSentences | public static List<Sentence> getPrecedingSentences(JCas jCas, Sentence annotation) {
"""
Returns a list of annotations of the same type preceding the given annotation
@param jCas jcas
@param annotation sentence
@return list of sentences sorted incrementally by position
"""
List<Sentence> res... | java | public static List<Sentence> getPrecedingSentences(JCas jCas, Sentence annotation)
{
List<Sentence> result = new ArrayList<Sentence>();
for (Sentence sentence : JCasUtil.select(getInitialView(jCas), Sentence.class)) {
if (sentence.getBegin() < annotation.getBegin()) {
re... | [
"public",
"static",
"List",
"<",
"Sentence",
">",
"getPrecedingSentences",
"(",
"JCas",
"jCas",
",",
"Sentence",
"annotation",
")",
"{",
"List",
"<",
"Sentence",
">",
"result",
"=",
"new",
"ArrayList",
"<",
"Sentence",
">",
"(",
")",
";",
"for",
"(",
"Se... | Returns a list of annotations of the same type preceding the given annotation
@param jCas jcas
@param annotation sentence
@return list of sentences sorted incrementally by position | [
"Returns",
"a",
"list",
"of",
"annotations",
"of",
"the",
"same",
"type",
"preceding",
"the",
"given",
"annotation"
] | train | https://github.com/dkpro/dkpro-argumentation/blob/57ce6f5e73d8075b7088aeeebb107c85b3d4bbcb/dkpro-argumentation-misc/src/main/java/org/dkpro/argumentation/misc/uima/JCasUtil2.java#L408-L427 |
alkacon/opencms-core | src-gwt/org/opencms/gwt/client/util/CmsClientCollectionUtil.java | CmsClientCollectionUtil.updateMapAndRemoveNulls | public static <A, B> void updateMapAndRemoveNulls(Map<A, B> source, Map<A, B> target) {
"""
Copies entries from one map to another and deletes those entries in the target map for which
the value in the source map is null.<p>
@param <A> the key type of the map
@param <B> the value type of the map
@param sourc... | java | public static <A, B> void updateMapAndRemoveNulls(Map<A, B> source, Map<A, B> target) {
assert source != target;
for (Map.Entry<A, B> entry : source.entrySet()) {
A key = entry.getKey();
B value = entry.getValue();
if (value != null) {
target.put(key,... | [
"public",
"static",
"<",
"A",
",",
"B",
">",
"void",
"updateMapAndRemoveNulls",
"(",
"Map",
"<",
"A",
",",
"B",
">",
"source",
",",
"Map",
"<",
"A",
",",
"B",
">",
"target",
")",
"{",
"assert",
"source",
"!=",
"target",
";",
"for",
"(",
"Map",
".... | Copies entries from one map to another and deletes those entries in the target map for which
the value in the source map is null.<p>
@param <A> the key type of the map
@param <B> the value type of the map
@param source the source map
@param target the target map | [
"Copies",
"entries",
"from",
"one",
"map",
"to",
"another",
"and",
"deletes",
"those",
"entries",
"in",
"the",
"target",
"map",
"for",
"which",
"the",
"value",
"in",
"the",
"source",
"map",
"is",
"null",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src-gwt/org/opencms/gwt/client/util/CmsClientCollectionUtil.java#L135-L147 |
ManfredTremmel/gwt-commons-lang3 | src/main/java/org/apache/commons/lang3/Validate.java | Validate.inclusiveBetween | public static void inclusiveBetween(final double start, final double end, final double value, final String message) {
"""
Validate that the specified primitive value falls between the two
inclusive values specified; otherwise, throws an exception with the
specified message.
<pre>Validate.inclusiveBetween(0.1,... | java | public static void inclusiveBetween(final double start, final double end, final double value, final String message) {
// TODO when breaking BC, consider returning value
if (value < start || value > end) {
throw new IllegalArgumentException(message);
}
} | [
"public",
"static",
"void",
"inclusiveBetween",
"(",
"final",
"double",
"start",
",",
"final",
"double",
"end",
",",
"final",
"double",
"value",
",",
"final",
"String",
"message",
")",
"{",
"// TODO when breaking BC, consider returning value",
"if",
"(",
"value",
... | Validate that the specified primitive value falls between the two
inclusive values specified; otherwise, throws an exception with the
specified message.
<pre>Validate.inclusiveBetween(0.1, 2.1, 1.1, "Not in range");</pre>
@param start the inclusive start value
@param end the inclusive end value
@param value the val... | [
"Validate",
"that",
"the",
"specified",
"primitive",
"value",
"falls",
"between",
"the",
"two",
"inclusive",
"values",
"specified",
";",
"otherwise",
"throws",
"an",
"exception",
"with",
"the",
"specified",
"message",
"."
] | train | https://github.com/ManfredTremmel/gwt-commons-lang3/blob/9e2dfbbda3668cfa5d935fe76479d1426c294504/src/main/java/org/apache/commons/lang3/Validate.java#L1102-L1107 |
oehf/ipf-oht-atna | auditor/src/main/java/org/openhealthtools/ihe/atna/auditor/context/AuditorModuleConfig.java | AuditorModuleConfig.setAuditRepositoryTransport | public void setAuditRepositoryTransport(String transport) throws IllegalArgumentException {
"""
Set the transport of the target audit repository (TLS, UDP, or BSD)
@param transport The transport of the target audit repository
"""
if (!transport.equalsIgnoreCase("SYSLOG") && !transport.equalsIgnoreCase("U... | java | public void setAuditRepositoryTransport(String transport) throws IllegalArgumentException
{
if (!transport.equalsIgnoreCase("SYSLOG") && !transport.equalsIgnoreCase("UDP") && !transport.equalsIgnoreCase("TLS") && !transport.equalsIgnoreCase("BSD"))
throw new IllegalArgumentException("Audit Repository tra... | [
"public",
"void",
"setAuditRepositoryTransport",
"(",
"String",
"transport",
")",
"throws",
"IllegalArgumentException",
"{",
"if",
"(",
"!",
"transport",
".",
"equalsIgnoreCase",
"(",
"\"SYSLOG\"",
")",
"&&",
"!",
"transport",
".",
"equalsIgnoreCase",
"(",
"\"UDP\""... | Set the transport of the target audit repository (TLS, UDP, or BSD)
@param transport The transport of the target audit repository | [
"Set",
"the",
"transport",
"of",
"the",
"target",
"audit",
"repository",
"(",
"TLS",
"UDP",
"or",
"BSD",
")"
] | train | https://github.com/oehf/ipf-oht-atna/blob/25ed1e926825169c94923a2c89a4618f60478ae8/auditor/src/main/java/org/openhealthtools/ihe/atna/auditor/context/AuditorModuleConfig.java#L216-L221 |
google/j2objc | jre_emul/android/platform/libcore/ojluni/src/main/java/java/util/zip/GZIPOutputStream.java | GZIPOutputStream.writeShort | private void writeShort(int s, byte[] buf, int offset) throws IOException {
"""
/*
Writes short integer in Intel byte order to a byte array, starting
at a given offset
"""
buf[offset] = (byte)(s & 0xff);
buf[offset + 1] = (byte)((s >> 8) & 0xff);
} | java | private void writeShort(int s, byte[] buf, int offset) throws IOException {
buf[offset] = (byte)(s & 0xff);
buf[offset + 1] = (byte)((s >> 8) & 0xff);
} | [
"private",
"void",
"writeShort",
"(",
"int",
"s",
",",
"byte",
"[",
"]",
"buf",
",",
"int",
"offset",
")",
"throws",
"IOException",
"{",
"buf",
"[",
"offset",
"]",
"=",
"(",
"byte",
")",
"(",
"s",
"&",
"0xff",
")",
";",
"buf",
"[",
"offset",
"+",... | /*
Writes short integer in Intel byte order to a byte array, starting
at a given offset | [
"/",
"*",
"Writes",
"short",
"integer",
"in",
"Intel",
"byte",
"order",
"to",
"a",
"byte",
"array",
"starting",
"at",
"a",
"given",
"offset"
] | train | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/libcore/ojluni/src/main/java/java/util/zip/GZIPOutputStream.java#L218-L221 |
Netflix/Nicobar | nicobar-core/src/main/java/com/netflix/nicobar/core/execution/HystrixScriptModuleExecutor.java | HystrixScriptModuleExecutor.executeModules | public List<V> executeModules(List<String> moduleIds, ScriptModuleExecutable<V> executable, ScriptModuleLoader moduleLoader) {
"""
Execute a collection of ScriptModules identified by moduleId.
@param moduleIds moduleIds for modules to execute
@param executable execution logic to be performed for each module.
... | java | public List<V> executeModules(List<String> moduleIds, ScriptModuleExecutable<V> executable, ScriptModuleLoader moduleLoader) {
Objects.requireNonNull(moduleIds, "moduleIds");
Objects.requireNonNull(executable, "executable");
Objects.requireNonNull(moduleLoader, "moduleLoader");
List<Scr... | [
"public",
"List",
"<",
"V",
">",
"executeModules",
"(",
"List",
"<",
"String",
">",
"moduleIds",
",",
"ScriptModuleExecutable",
"<",
"V",
">",
"executable",
",",
"ScriptModuleLoader",
"moduleLoader",
")",
"{",
"Objects",
".",
"requireNonNull",
"(",
"moduleIds",
... | Execute a collection of ScriptModules identified by moduleId.
@param moduleIds moduleIds for modules to execute
@param executable execution logic to be performed for each module.
@param moduleLoader loader which manages the modules.
@return list of the outputs from the executable. | [
"Execute",
"a",
"collection",
"of",
"ScriptModules",
"identified",
"by",
"moduleId",
"."
] | train | https://github.com/Netflix/Nicobar/blob/507173dcae4a86a955afc3df222a855862fab8d7/nicobar-core/src/main/java/com/netflix/nicobar/core/execution/HystrixScriptModuleExecutor.java#L82-L95 |
lessthanoptimal/ejml | main/ejml-core/src/org/ejml/ops/ComplexMath_F64.java | ComplexMath_F64.multiply | public static void multiply(ComplexPolar_F64 a, ComplexPolar_F64 b, ComplexPolar_F64 result) {
"""
Division in polar notation.
@param a Complex number in polar notation. Not modified.
@param b Complex number in polar notation. Not modified.
@param result Storage for output.
"""
result.r = a.r*b.r;... | java | public static void multiply(ComplexPolar_F64 a, ComplexPolar_F64 b, ComplexPolar_F64 result)
{
result.r = a.r*b.r;
result.theta = a.theta + b.theta;
} | [
"public",
"static",
"void",
"multiply",
"(",
"ComplexPolar_F64",
"a",
",",
"ComplexPolar_F64",
"b",
",",
"ComplexPolar_F64",
"result",
")",
"{",
"result",
".",
"r",
"=",
"a",
".",
"r",
"*",
"b",
".",
"r",
";",
"result",
".",
"theta",
"=",
"a",
".",
"... | Division in polar notation.
@param a Complex number in polar notation. Not modified.
@param b Complex number in polar notation. Not modified.
@param result Storage for output. | [
"Division",
"in",
"polar",
"notation",
"."
] | train | https://github.com/lessthanoptimal/ejml/blob/1444680cc487af5e866730e62f48f5f9636850d9/main/ejml-core/src/org/ejml/ops/ComplexMath_F64.java#L133-L137 |
apiman/apiman | manager/api/es/src/main/java/io/apiman/manager/api/es/EsMarshalling.java | EsMarshalling.unmarshallClient | public static ClientBean unmarshallClient(Map<String, Object> source) {
"""
Unmarshals the given map source into a bean.
@param source the source
@return the client
"""
if (source == null) {
return null;
}
ClientBean bean = new ClientBean();
bean.setId(asString(sou... | java | public static ClientBean unmarshallClient(Map<String, Object> source) {
if (source == null) {
return null;
}
ClientBean bean = new ClientBean();
bean.setId(asString(source.get("id")));
bean.setName(asString(source.get("name")));
bean.setDescription(asString(so... | [
"public",
"static",
"ClientBean",
"unmarshallClient",
"(",
"Map",
"<",
"String",
",",
"Object",
">",
"source",
")",
"{",
"if",
"(",
"source",
"==",
"null",
")",
"{",
"return",
"null",
";",
"}",
"ClientBean",
"bean",
"=",
"new",
"ClientBean",
"(",
")",
... | Unmarshals the given map source into a bean.
@param source the source
@return the client | [
"Unmarshals",
"the",
"given",
"map",
"source",
"into",
"a",
"bean",
"."
] | train | https://github.com/apiman/apiman/blob/8c049c2a2f2e4a69bbb6125686a15edd26f29c21/manager/api/es/src/main/java/io/apiman/manager/api/es/EsMarshalling.java#L1023-L1035 |
finmath/finmath-lib | src/main/java6/net/finmath/montecarlo/assetderivativevaluation/products/BasketOption.java | BasketOption.getValue | @Override
public RandomVariableInterface getValue(double evaluationTime, AssetModelMonteCarloSimulationInterface model) throws CalculationException {
"""
This method returns the value random variable of the product within the specified model, evaluated at a given evalutationTime.
Note: For a lattice this is ofte... | java | @Override
public RandomVariableInterface getValue(double evaluationTime, AssetModelMonteCarloSimulationInterface model) throws CalculationException {
// Get underlying and numeraire
RandomVariableInterface values = model.getRandomVariableForConstant(0.0);
for(int underlyingIndex = 0; underlyingIndex<weights.len... | [
"@",
"Override",
"public",
"RandomVariableInterface",
"getValue",
"(",
"double",
"evaluationTime",
",",
"AssetModelMonteCarloSimulationInterface",
"model",
")",
"throws",
"CalculationException",
"{",
"// Get underlying and numeraire",
"RandomVariableInterface",
"values",
"=",
"... | This method returns the value random variable of the product within the specified model, evaluated at a given evalutationTime.
Note: For a lattice this is often the value conditional to evalutationTime, for a Monte-Carlo simulation this is the (sum of) value discounted to evaluation time.
Cashflows prior evaluationTime... | [
"This",
"method",
"returns",
"the",
"value",
"random",
"variable",
"of",
"the",
"product",
"within",
"the",
"specified",
"model",
"evaluated",
"at",
"a",
"given",
"evalutationTime",
".",
"Note",
":",
"For",
"a",
"lattice",
"this",
"is",
"often",
"the",
"valu... | train | https://github.com/finmath/finmath-lib/blob/a3c067d52dd33feb97d851df6cab130e4116759f/src/main/java6/net/finmath/montecarlo/assetderivativevaluation/products/BasketOption.java#L60-L85 |
structr/structr | structr-core/src/main/java/org/structr/core/graph/ModificationQueue.java | ModificationQueue.isPropertyModified | public boolean isPropertyModified(final GraphObject graphObject, final PropertyKey key) {
"""
Checks if the given key is present for the given graph object in the modifiedProperties of this queue.<br><br>
This method is convenient if only one key has to be checked. If different
actions should be taken for diff... | java | public boolean isPropertyModified(final GraphObject graphObject, final PropertyKey key) {
for (GraphObjectModificationState state : getSortedModifications()) {
for (PropertyKey k : state.getModifiedProperties().keySet()) {
if (k.equals(key) && graphObject.getUuid().equals(state.getGraphObject().getUuid()) )... | [
"public",
"boolean",
"isPropertyModified",
"(",
"final",
"GraphObject",
"graphObject",
",",
"final",
"PropertyKey",
"key",
")",
"{",
"for",
"(",
"GraphObjectModificationState",
"state",
":",
"getSortedModifications",
"(",
")",
")",
"{",
"for",
"(",
"PropertyKey",
... | Checks if the given key is present for the given graph object in the modifiedProperties of this queue.<br><br>
This method is convenient if only one key has to be checked. If different
actions should be taken for different keys one should rather use {@link #getModifiedProperties}.
Note: This method only works for reg... | [
"Checks",
"if",
"the",
"given",
"key",
"is",
"present",
"for",
"the",
"given",
"graph",
"object",
"in",
"the",
"modifiedProperties",
"of",
"this",
"queue",
".",
"<br",
">",
"<br",
">"
] | train | https://github.com/structr/structr/blob/c111a1d0c0201c7fea5574ed69aa5a5053185a97/structr-core/src/main/java/org/structr/core/graph/ModificationQueue.java#L406-L423 |
ops4j/org.ops4j.pax.logging | pax-logging-service/src/main/java/org/apache/log4j/rule/LikeRule.java | LikeRule.getRule | public static Rule getRule(final String field, final String pattern) {
"""
Create new instance.
@param field field
@param pattern pattern
@return new instance
"""
try {
return new LikeRule(field, Pattern.compile(pattern, Pattern.CASE_INSENSITIVE));
} catch (PatternSyntaxException e) {
... | java | public static Rule getRule(final String field, final String pattern) {
try {
return new LikeRule(field, Pattern.compile(pattern, Pattern.CASE_INSENSITIVE));
} catch (PatternSyntaxException e) {
throw new IllegalArgumentException(
"Invalid LIKE rule - " + e.getMessage());
}
... | [
"public",
"static",
"Rule",
"getRule",
"(",
"final",
"String",
"field",
",",
"final",
"String",
"pattern",
")",
"{",
"try",
"{",
"return",
"new",
"LikeRule",
"(",
"field",
",",
"Pattern",
".",
"compile",
"(",
"pattern",
",",
"Pattern",
".",
"CASE_INSENSITI... | Create new instance.
@param field field
@param pattern pattern
@return new instance | [
"Create",
"new",
"instance",
"."
] | train | https://github.com/ops4j/org.ops4j.pax.logging/blob/493de4e1db4fe9f981f3dd78b8e40e5bf2b2e59d/pax-logging-service/src/main/java/org/apache/log4j/rule/LikeRule.java#L100-L107 |
Azure/azure-sdk-for-java | batch/data-plane/src/main/java/com/microsoft/azure/batch/protocol/implementation/PoolsImpl.java | PoolsImpl.existsAsync | public Observable<Boolean> existsAsync(String poolId, PoolExistsOptions poolExistsOptions) {
"""
Gets basic properties of a pool.
@param poolId The ID of the pool to get.
@param poolExistsOptions Additional parameters for the operation
@throws IllegalArgumentException thrown if parameters fail the validation
... | java | public Observable<Boolean> existsAsync(String poolId, PoolExistsOptions poolExistsOptions) {
return existsWithServiceResponseAsync(poolId, poolExistsOptions).map(new Func1<ServiceResponseWithHeaders<Boolean, PoolExistsHeaders>, Boolean>() {
@Override
public Boolean call(ServiceResponseWi... | [
"public",
"Observable",
"<",
"Boolean",
">",
"existsAsync",
"(",
"String",
"poolId",
",",
"PoolExistsOptions",
"poolExistsOptions",
")",
"{",
"return",
"existsWithServiceResponseAsync",
"(",
"poolId",
",",
"poolExistsOptions",
")",
".",
"map",
"(",
"new",
"Func1",
... | Gets basic properties of a pool.
@param poolId The ID of the pool to get.
@param poolExistsOptions Additional parameters for the operation
@throws IllegalArgumentException thrown if parameters fail the validation
@return the observable to the Boolean object | [
"Gets",
"basic",
"properties",
"of",
"a",
"pool",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/batch/data-plane/src/main/java/com/microsoft/azure/batch/protocol/implementation/PoolsImpl.java#L1495-L1502 |
glyptodon/guacamole-client | extensions/guacamole-auth-header/src/main/java/org/apache/guacamole/auth/header/AuthenticationProviderService.java | AuthenticationProviderService.authenticateUser | public AuthenticatedUser authenticateUser(Credentials credentials)
throws GuacamoleException {
"""
Returns an AuthenticatedUser representing the user authenticated by the
given credentials.
@param credentials
The credentials to use for authentication.
@return
An AuthenticatedUser representing ... | java | public AuthenticatedUser authenticateUser(Credentials credentials)
throws GuacamoleException {
// Pull HTTP header from request if present
HttpServletRequest request = credentials.getRequest();
if (request != null) {
// Get the username from the header configured in gua... | [
"public",
"AuthenticatedUser",
"authenticateUser",
"(",
"Credentials",
"credentials",
")",
"throws",
"GuacamoleException",
"{",
"// Pull HTTP header from request if present",
"HttpServletRequest",
"request",
"=",
"credentials",
".",
"getRequest",
"(",
")",
";",
"if",
"(",
... | Returns an AuthenticatedUser representing the user authenticated by the
given credentials.
@param credentials
The credentials to use for authentication.
@return
An AuthenticatedUser representing the user authenticated by the
given credentials.
@throws GuacamoleException
If an error occurs while authenticating the us... | [
"Returns",
"an",
"AuthenticatedUser",
"representing",
"the",
"user",
"authenticated",
"by",
"the",
"given",
"credentials",
"."
] | train | https://github.com/glyptodon/guacamole-client/blob/ea1b10e9d1e3f1fa640dff2ca64d61b44bf1ace9/extensions/guacamole-auth-header/src/main/java/org/apache/guacamole/auth/header/AuthenticationProviderService.java#L65-L86 |
aws/aws-sdk-java | aws-java-sdk-greengrass/src/main/java/com/amazonaws/services/greengrass/model/CreateDeviceDefinitionRequest.java | CreateDeviceDefinitionRequest.withTags | public CreateDeviceDefinitionRequest withTags(java.util.Map<String, String> tags) {
"""
Tag(s) to add to the new resource
@param tags
Tag(s) to add to the new resource
@return Returns a reference to this object so that method calls can be chained together.
"""
setTags(tags);
return this;
... | java | public CreateDeviceDefinitionRequest withTags(java.util.Map<String, String> tags) {
setTags(tags);
return this;
} | [
"public",
"CreateDeviceDefinitionRequest",
"withTags",
"(",
"java",
".",
"util",
".",
"Map",
"<",
"String",
",",
"String",
">",
"tags",
")",
"{",
"setTags",
"(",
"tags",
")",
";",
"return",
"this",
";",
"}"
] | Tag(s) to add to the new resource
@param tags
Tag(s) to add to the new resource
@return Returns a reference to this object so that method calls can be chained together. | [
"Tag",
"(",
"s",
")",
"to",
"add",
"to",
"the",
"new",
"resource"
] | train | https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-greengrass/src/main/java/com/amazonaws/services/greengrass/model/CreateDeviceDefinitionRequest.java#L168-L171 |
elki-project/elki | elki-data-generator/src/main/java/de/lmu/ifi/dbs/elki/datasource/GeneratorXMLDatabaseConnection.java | GeneratorXMLDatabaseConnection.processElementStatic | private void processElementStatic(GeneratorMain gen, Node cur) {
"""
Process a 'static' cluster Element in the XML stream.
@param gen Generator
@param cur Current document nod
"""
String name = ((Element) cur).getAttribute(ATTR_NAME);
if(name == null) {
throw new AbortException("No cluster na... | java | private void processElementStatic(GeneratorMain gen, Node cur) {
String name = ((Element) cur).getAttribute(ATTR_NAME);
if(name == null) {
throw new AbortException("No cluster name given in specification file.");
}
ArrayList<double[]> points = new ArrayList<>();
// TODO: check for unknown att... | [
"private",
"void",
"processElementStatic",
"(",
"GeneratorMain",
"gen",
",",
"Node",
"cur",
")",
"{",
"String",
"name",
"=",
"(",
"(",
"Element",
")",
"cur",
")",
".",
"getAttribute",
"(",
"ATTR_NAME",
")",
";",
"if",
"(",
"name",
"==",
"null",
")",
"{... | Process a 'static' cluster Element in the XML stream.
@param gen Generator
@param cur Current document nod | [
"Process",
"a",
"static",
"cluster",
"Element",
"in",
"the",
"XML",
"stream",
"."
] | train | https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-data-generator/src/main/java/de/lmu/ifi/dbs/elki/datasource/GeneratorXMLDatabaseConnection.java#L635-L660 |
OpenLiberty/open-liberty | dev/com.ibm.websphere.javaee.jsf.2.2/src/javax/faces/validator/BeanValidator.java | _ValueReferenceResolver.getValue | @Override
public Object getValue(final ELContext context, final Object base, final Object property) {
"""
This method is the only one that matters. It keeps track of the objects in the EL expression.
It creates a new ValueReferenceWrapper and assigns it to lastObject.
@param context The ELContext.
@para... | java | @Override
public Object getValue(final ELContext context, final Object base, final Object property)
{
lastObject = new _ValueReferenceWrapper(base, property);
return resolver.getValue(context, base, property);
} | [
"@",
"Override",
"public",
"Object",
"getValue",
"(",
"final",
"ELContext",
"context",
",",
"final",
"Object",
"base",
",",
"final",
"Object",
"property",
")",
"{",
"lastObject",
"=",
"new",
"_ValueReferenceWrapper",
"(",
"base",
",",
"property",
")",
";",
"... | This method is the only one that matters. It keeps track of the objects in the EL expression.
It creates a new ValueReferenceWrapper and assigns it to lastObject.
@param context The ELContext.
@param base The base object, may be null.
@param property The property, may be null.
@return The resolved value | [
"This",
"method",
"is",
"the",
"only",
"one",
"that",
"matters",
".",
"It",
"keeps",
"track",
"of",
"the",
"objects",
"in",
"the",
"EL",
"expression",
"."
] | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.websphere.javaee.jsf.2.2/src/javax/faces/validator/BeanValidator.java#L619-L624 |
google/closure-compiler | src/com/google/javascript/jscomp/OptimizeParameters.java | OptimizeParameters.findFixedParameters | private boolean findFixedParameters(List<Parameter> parameters, Node cur) {
"""
Determine which parameters use the same expression.
@return Whether any parameter was found that can be updated.
"""
boolean anyMovable = false;
int index = 0;
while (cur != null) {
Parameter p;
if (index >... | java | private boolean findFixedParameters(List<Parameter> parameters, Node cur) {
boolean anyMovable = false;
int index = 0;
while (cur != null) {
Parameter p;
if (index >= parameters.size()) {
p = new Parameter(cur, false);
parameters.add(p);
setParameterSideEffectInfo(p, cur)... | [
"private",
"boolean",
"findFixedParameters",
"(",
"List",
"<",
"Parameter",
">",
"parameters",
",",
"Node",
"cur",
")",
"{",
"boolean",
"anyMovable",
"=",
"false",
";",
"int",
"index",
"=",
"0",
";",
"while",
"(",
"cur",
"!=",
"null",
")",
"{",
"Paramete... | Determine which parameters use the same expression.
@return Whether any parameter was found that can be updated. | [
"Determine",
"which",
"parameters",
"use",
"the",
"same",
"expression",
"."
] | train | https://github.com/google/closure-compiler/blob/d81e36740f6a9e8ac31a825ee8758182e1dc5aae/src/com/google/javascript/jscomp/OptimizeParameters.java#L680-L710 |
spotbugs/spotbugs | spotbugs/src/main/java/edu/umd/cs/findbugs/visitclass/LVTHelper.java | LVTHelper.getLocalVariableAtPC | public static LocalVariable getLocalVariableAtPC(@Nonnull LocalVariableTable lvt, int index, int pc) {
"""
returns the local variable at an index int the scope of PC
@param lvt
the local variable table
@param index
the variable index
@param pc
the PC where the variable is used
"""
int length = ... | java | public static LocalVariable getLocalVariableAtPC(@Nonnull LocalVariableTable lvt, int index, int pc) {
int length = lvt.getTableLength();
LocalVariable[] lvs = lvt.getLocalVariableTable();
for (int i = 0; i < length; i++) {
if (lvs[i].getIndex() == index) {
int start... | [
"public",
"static",
"LocalVariable",
"getLocalVariableAtPC",
"(",
"@",
"Nonnull",
"LocalVariableTable",
"lvt",
",",
"int",
"index",
",",
"int",
"pc",
")",
"{",
"int",
"length",
"=",
"lvt",
".",
"getTableLength",
"(",
")",
";",
"LocalVariable",
"[",
"]",
"lvs... | returns the local variable at an index int the scope of PC
@param lvt
the local variable table
@param index
the variable index
@param pc
the PC where the variable is used | [
"returns",
"the",
"local",
"variable",
"at",
"an",
"index",
"int",
"the",
"scope",
"of",
"PC"
] | train | https://github.com/spotbugs/spotbugs/blob/f6365c6eea6515035bded38efa4a7c8b46ccf28c/spotbugs/src/main/java/edu/umd/cs/findbugs/visitclass/LVTHelper.java#L43-L57 |
google/j2objc | xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xalan/transformer/TransformerHandlerImpl.java | TransformerHandlerImpl.internalEntityDecl | public void internalEntityDecl(String name, String value)
throws SAXException {
"""
Report an internal entity declaration.
<p>Only the effective (first) declaration for each entity
will be reported.</p>
@param name The name of the entity. If it is a parameter
entity, the name will begin with '%'... | java | public void internalEntityDecl(String name, String value)
throws SAXException
{
if (DEBUG)
System.out.println("TransformerHandlerImpl#internalEntityDecl: " + name
+ ", " + value);
if (null != m_declHandler)
{
m_declHandler.internalEntityDecl(name, value);
... | [
"public",
"void",
"internalEntityDecl",
"(",
"String",
"name",
",",
"String",
"value",
")",
"throws",
"SAXException",
"{",
"if",
"(",
"DEBUG",
")",
"System",
".",
"out",
".",
"println",
"(",
"\"TransformerHandlerImpl#internalEntityDecl: \"",
"+",
"name",
"+",
"\... | Report an internal entity declaration.
<p>Only the effective (first) declaration for each entity
will be reported.</p>
@param name The name of the entity. If it is a parameter
entity, the name will begin with '%'.
@param value The replacement text of the entity.
@throws SAXException The application may raise an exce... | [
"Report",
"an",
"internal",
"entity",
"declaration",
"."
] | train | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xalan/transformer/TransformerHandlerImpl.java#L995-L1007 |
Azure/azure-sdk-for-java | keyvault/data-plane/azure-keyvault/src/main/java/com/microsoft/azure/keyvault/implementation/KeyVaultClientBaseImpl.java | KeyVaultClientBaseImpl.getStorageAccount | public StorageBundle getStorageAccount(String vaultBaseUrl, String storageAccountName) {
"""
Gets information about a specified storage account. This operation requires the storage/get permission.
@param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net.
@param storageAccountName The nam... | java | public StorageBundle getStorageAccount(String vaultBaseUrl, String storageAccountName) {
return getStorageAccountWithServiceResponseAsync(vaultBaseUrl, storageAccountName).toBlocking().single().body();
} | [
"public",
"StorageBundle",
"getStorageAccount",
"(",
"String",
"vaultBaseUrl",
",",
"String",
"storageAccountName",
")",
"{",
"return",
"getStorageAccountWithServiceResponseAsync",
"(",
"vaultBaseUrl",
",",
"storageAccountName",
")",
".",
"toBlocking",
"(",
")",
".",
"s... | Gets information about a specified storage account. This operation requires the storage/get permission.
@param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net.
@param storageAccountName The name of the storage account.
@throws IllegalArgumentException thrown if parameters fail the validation
@... | [
"Gets",
"information",
"about",
"a",
"specified",
"storage",
"account",
".",
"This",
"operation",
"requires",
"the",
"storage",
"/",
"get",
"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#L9781-L9783 |
VoltDB/voltdb | src/hsqldb19b3/org/hsqldb_voltpatches/persist/HsqlProperties.java | HsqlProperties.addError | private void addError(int code, String key) {
"""
Adds the error code and the key to the list of errors. This list
is populated during construction or addition of elements and is used
outside this class to act upon the errors.
"""
errorCodes = (int[]) ArrayUtil.resizeArray(errorCodes,
... | java | private void addError(int code, String key) {
errorCodes = (int[]) ArrayUtil.resizeArray(errorCodes,
errorCodes.length + 1);
errorKeys = (String[]) ArrayUtil.resizeArray(errorKeys,
errorKeys.length + 1);
errorCodes[errorCodes.length - 1] = code;
errorKeys... | [
"private",
"void",
"addError",
"(",
"int",
"code",
",",
"String",
"key",
")",
"{",
"errorCodes",
"=",
"(",
"int",
"[",
"]",
")",
"ArrayUtil",
".",
"resizeArray",
"(",
"errorCodes",
",",
"errorCodes",
".",
"length",
"+",
"1",
")",
";",
"errorKeys",
"=",... | Adds the error code and the key to the list of errors. This list
is populated during construction or addition of elements and is used
outside this class to act upon the errors. | [
"Adds",
"the",
"error",
"code",
"and",
"the",
"key",
"to",
"the",
"list",
"of",
"errors",
".",
"This",
"list",
"is",
"populated",
"during",
"construction",
"or",
"addition",
"of",
"elements",
"and",
"is",
"used",
"outside",
"this",
"class",
"to",
"act",
... | train | https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/src/hsqldb19b3/org/hsqldb_voltpatches/persist/HsqlProperties.java#L315-L323 |
kuali/ojb-1.0.4 | src/java/org/apache/ojb/broker/query/QueryByCriteria.java | QueryByCriteria.addPathClass | public void addPathClass(String aPath, Class aClass) {
"""
Add a hint Class for a path. Used for relationships to extents.<br>
SqlStatment will use these hint classes when resolving the path.
Without these hints SqlStatment will use the base class the
relationship points to ie: Article instead of CdArticle.
... | java | public void addPathClass(String aPath, Class aClass)
{
List pathClasses = (List) m_pathClasses.get(aPath);
if(pathClasses == null)
{
setPathClass(aPath, aClass);
}
else
{
pathClasses.add(aClass);
}
} | [
"public",
"void",
"addPathClass",
"(",
"String",
"aPath",
",",
"Class",
"aClass",
")",
"{",
"List",
"pathClasses",
"=",
"(",
"List",
")",
"m_pathClasses",
".",
"get",
"(",
"aPath",
")",
";",
"if",
"(",
"pathClasses",
"==",
"null",
")",
"{",
"setPathClass... | Add a hint Class for a path. Used for relationships to extents.<br>
SqlStatment will use these hint classes when resolving the path.
Without these hints SqlStatment will use the base class the
relationship points to ie: Article instead of CdArticle.
@param aPath the path segment ie: allArticlesInGroup
@param aClass th... | [
"Add",
"a",
"hint",
"Class",
"for",
"a",
"path",
".",
"Used",
"for",
"relationships",
"to",
"extents",
".",
"<br",
">",
"SqlStatment",
"will",
"use",
"these",
"hint",
"classes",
"when",
"resolving",
"the",
"path",
".",
"Without",
"these",
"hints",
"SqlStat... | train | https://github.com/kuali/ojb-1.0.4/blob/9a544372f67ce965f662cdc71609dd03683c8f04/src/java/org/apache/ojb/broker/query/QueryByCriteria.java#L191-L202 |
BBN-E/bue-common-open | common-core-open/src/main/java/com/bbn/bue/common/StringUtils.java | StringUtils.nthOccurrenceOf | public static int nthOccurrenceOf(final String s, final char needle, int n) {
"""
* Returns the index of the {@code n}-th occurence of {@code needle} in {@code s}. If {@code needle}
does not appear in {@code s}, returns -1.
@param s The string to search. Cannot be null.
@param needle The character to sea... | java | public static int nthOccurrenceOf(final String s, final char needle, int n) {
checkNotNull(s);
checkArgument(n > 0);
for (int i = 0; i < s.length(); ++i) {
if (needle == s.charAt(i)) {
--n;
if (n == 0) {
return i;
}
}
}
return -1;
} | [
"public",
"static",
"int",
"nthOccurrenceOf",
"(",
"final",
"String",
"s",
",",
"final",
"char",
"needle",
",",
"int",
"n",
")",
"{",
"checkNotNull",
"(",
"s",
")",
";",
"checkArgument",
"(",
"n",
">",
"0",
")",
";",
"for",
"(",
"int",
"i",
"=",
"0... | * Returns the index of the {@code n}-th occurence of {@code needle} in {@code s}. If {@code needle}
does not appear in {@code s}, returns -1.
@param s The string to search. Cannot be null.
@param needle The character to search for.
@param n Return the {@code n}-th occurence | [
"*",
"Returns",
"the",
"index",
"of",
"the",
"{",
"@code",
"n",
"}",
"-",
"th",
"occurence",
"of",
"{",
"@code",
"needle",
"}",
"in",
"{",
"@code",
"s",
"}",
".",
"If",
"{",
"@code",
"needle",
"}",
"does",
"not",
"appear",
"in",
"{",
"@code",
"s"... | train | https://github.com/BBN-E/bue-common-open/blob/d618652674d647867306e2e4b987a21b7c29c015/common-core-open/src/main/java/com/bbn/bue/common/StringUtils.java#L141-L153 |
carewebframework/carewebframework-core | org.carewebframework.plugin-parent/org.carewebframework.plugin.infopanel/src/main/java/org/carewebframework/plugin/infopanel/service/InfoPanelService.java | InfoPanelService.findInfoPanel | public static IInfoPanel findInfoPanel(ElementBase element, boolean activeOnly) {
"""
Finds the "nearest" info panel.
@param element The UI element from which to begin the search.
@param activeOnly If true, only active info panels are considered.
@return The nearest active info panel, or null if none found.
... | java | public static IInfoPanel findInfoPanel(ElementBase element, boolean activeOnly) {
ElementBase parent = element;
ElementBase previousParent;
IInfoPanel infoPanel = searchChildren(element, null, activeOnly);
while ((infoPanel == null) && (parent != null)) {
previousPar... | [
"public",
"static",
"IInfoPanel",
"findInfoPanel",
"(",
"ElementBase",
"element",
",",
"boolean",
"activeOnly",
")",
"{",
"ElementBase",
"parent",
"=",
"element",
";",
"ElementBase",
"previousParent",
";",
"IInfoPanel",
"infoPanel",
"=",
"searchChildren",
"(",
"elem... | Finds the "nearest" info panel.
@param element The UI element from which to begin the search.
@param activeOnly If true, only active info panels are considered.
@return The nearest active info panel, or null if none found. | [
"Finds",
"the",
"nearest",
"info",
"panel",
"."
] | train | https://github.com/carewebframework/carewebframework-core/blob/fa3252d4f7541dbe151b92c3d4f6f91433cd1673/org.carewebframework.plugin-parent/org.carewebframework.plugin.infopanel/src/main/java/org/carewebframework/plugin/infopanel/service/InfoPanelService.java#L76-L88 |
googleapis/google-cloud-java | google-cloud-clients/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/Field.java | Field.newBuilder | public static Builder newBuilder(String name, LegacySQLTypeName type, Field... subFields) {
"""
Returns a builder for a Field object with given name and type.
"""
return new Builder().setName(name).setType(type, subFields);
} | java | public static Builder newBuilder(String name, LegacySQLTypeName type, Field... subFields) {
return new Builder().setName(name).setType(type, subFields);
} | [
"public",
"static",
"Builder",
"newBuilder",
"(",
"String",
"name",
",",
"LegacySQLTypeName",
"type",
",",
"Field",
"...",
"subFields",
")",
"{",
"return",
"new",
"Builder",
"(",
")",
".",
"setName",
"(",
"name",
")",
".",
"setType",
"(",
"type",
",",
"s... | Returns a builder for a Field object with given name and type. | [
"Returns",
"a",
"builder",
"for",
"a",
"Field",
"object",
"with",
"given",
"name",
"and",
"type",
"."
] | train | https://github.com/googleapis/google-cloud-java/blob/d2f0bc64a53049040fe9c9d338b12fab3dd1ad6a/google-cloud-clients/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/Field.java#L274-L276 |
apiman/apiman | gateway/engine/es/src/main/java/io/apiman/gateway/engine/es/ESRegistry.java | ESRegistry.getApiId | protected String getApiId(String orgId, String apiId, String version) {
"""
Generates a valid document ID for a api, used to index the api in ES.
@param orgId
@param apiId
@param version
@return a api id
"""
return ESUtils.escape(orgId + ":" + apiId + ":" + version); //$NON-NLS-1$ //$NON-NLS-2$
... | java | protected String getApiId(String orgId, String apiId, String version) {
return ESUtils.escape(orgId + ":" + apiId + ":" + version); //$NON-NLS-1$ //$NON-NLS-2$
} | [
"protected",
"String",
"getApiId",
"(",
"String",
"orgId",
",",
"String",
"apiId",
",",
"String",
"version",
")",
"{",
"return",
"ESUtils",
".",
"escape",
"(",
"orgId",
"+",
"\":\"",
"+",
"apiId",
"+",
"\":\"",
"+",
"version",
")",
";",
"//$NON-NLS-1$ //$N... | Generates a valid document ID for a api, used to index the api in ES.
@param orgId
@param apiId
@param version
@return a api id | [
"Generates",
"a",
"valid",
"document",
"ID",
"for",
"a",
"api",
"used",
"to",
"index",
"the",
"api",
"in",
"ES",
"."
] | train | https://github.com/apiman/apiman/blob/8c049c2a2f2e4a69bbb6125686a15edd26f29c21/gateway/engine/es/src/main/java/io/apiman/gateway/engine/es/ESRegistry.java#L628-L630 |
smartsheet-platform/smartsheet-java-sdk | src/main/java/com/smartsheet/api/internal/util/QueryUtil.java | QueryUtil.generateQueryString | protected static String generateQueryString(Map<String, Object> parameters) {
"""
Returns a query string.
@param parameters the map of query string keys and values
@return the query string
"""
if (parameters == null || parameters.size() == 0) {
return "";
}
StringBuilder... | java | protected static String generateQueryString(Map<String, Object> parameters) {
if (parameters == null || parameters.size() == 0) {
return "";
}
StringBuilder result = new StringBuilder();
try {
for(Map.Entry<String, Object> entry : parameters.entrySet()) {
... | [
"protected",
"static",
"String",
"generateQueryString",
"(",
"Map",
"<",
"String",
",",
"Object",
">",
"parameters",
")",
"{",
"if",
"(",
"parameters",
"==",
"null",
"||",
"parameters",
".",
"size",
"(",
")",
"==",
"0",
")",
"{",
"return",
"\"\"",
";",
... | Returns a query string.
@param parameters the map of query string keys and values
@return the query string | [
"Returns",
"a",
"query",
"string",
"."
] | train | https://github.com/smartsheet-platform/smartsheet-java-sdk/blob/f60e264412076271f83b65889ef9b891fad83df8/src/main/java/com/smartsheet/api/internal/util/QueryUtil.java#L63-L81 |
alkacon/opencms-core | src/org/opencms/ui/apps/user/CmsShowResourceTable.java | CmsShowResourceTable.getPermissionString | private String getPermissionString(CmsObject cms, CmsResource res, DialogType type) throws CmsException {
"""
Gets the permission string.<p>
@param cms CmsObject
@param res Resource to get permission for
@param type dialog type
@return permission string for given resource
@throws CmsException thrown if ACE ... | java | private String getPermissionString(CmsObject cms, CmsResource res, DialogType type) throws CmsException {
if (type.equals(DialogType.User)) {
cms.getPermissions(res.getRootPath(), m_principal.getName()).getPermissionString();
} else if (type.equals(DialogType.Group)) {
Iterator<... | [
"private",
"String",
"getPermissionString",
"(",
"CmsObject",
"cms",
",",
"CmsResource",
"res",
",",
"DialogType",
"type",
")",
"throws",
"CmsException",
"{",
"if",
"(",
"type",
".",
"equals",
"(",
"DialogType",
".",
"User",
")",
")",
"{",
"cms",
".",
"get... | Gets the permission string.<p>
@param cms CmsObject
@param res Resource to get permission for
@param type dialog type
@return permission string for given resource
@throws CmsException thrown if ACE can not be read | [
"Gets",
"the",
"permission",
"string",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/ui/apps/user/CmsShowResourceTable.java#L274-L288 |
OrienteerBAP/wicket-orientdb | wicket-orientdb/src/main/java/ru/ydn/wicket/wicketorientdb/rest/OrientDBHttpAPIResource.java | OrientDBHttpAPIResource.mountOrientDbRestApi | @SuppressWarnings("restriction")
public static void mountOrientDbRestApi(OrientDBHttpAPIResource resource, WebApplication app, String... mountPaths) {
"""
Mounts OrientDB REST API Bridge to an app
@param resource {@link OrientDBHttpAPIResource} to mount
@param app {@link WebApplication} to mount to
@param moun... | java | @SuppressWarnings("restriction")
public static void mountOrientDbRestApi(OrientDBHttpAPIResource resource, WebApplication app, String... mountPaths)
{
app.getSharedResources().add(ORIENT_DB_KEY, resource);
Authenticator.setDefault(new Authenticator() {
@Override
protected PasswordAuthentication getPasswordA... | [
"@",
"SuppressWarnings",
"(",
"\"restriction\"",
")",
"public",
"static",
"void",
"mountOrientDbRestApi",
"(",
"OrientDBHttpAPIResource",
"resource",
",",
"WebApplication",
"app",
",",
"String",
"...",
"mountPaths",
")",
"{",
"app",
".",
"getSharedResources",
"(",
"... | Mounts OrientDB REST API Bridge to an app
@param resource {@link OrientDBHttpAPIResource} to mount
@param app {@link WebApplication} to mount to
@param mountPaths array of paths to mount to | [
"Mounts",
"OrientDB",
"REST",
"API",
"Bridge",
"to",
"an",
"app"
] | train | https://github.com/OrienteerBAP/wicket-orientdb/blob/eb1d94f00a6bff9e266c5c032baa6043afc1db92/wicket-orientdb/src/main/java/ru/ydn/wicket/wicketorientdb/rest/OrientDBHttpAPIResource.java#L187-L217 |
Azure/azure-sdk-for-java | servicebus/data-plane/azure-servicebus/src/main/java/com/microsoft/azure/servicebus/management/ManagementClient.java | ManagementClient.getSubscription | public SubscriptionDescription getSubscription(String topicPath, String subscriptionName) throws ServiceBusException, InterruptedException {
"""
Retrieves a subscription for a given topic from the service namespace
@param topicPath - The path of the topic relative to service bus namespace.
@param subscriptionNam... | java | public SubscriptionDescription getSubscription(String topicPath, String subscriptionName) throws ServiceBusException, InterruptedException {
return Utils.completeFuture(this.asyncClient.getSubscriptionAsync(topicPath, subscriptionName));
} | [
"public",
"SubscriptionDescription",
"getSubscription",
"(",
"String",
"topicPath",
",",
"String",
"subscriptionName",
")",
"throws",
"ServiceBusException",
",",
"InterruptedException",
"{",
"return",
"Utils",
".",
"completeFuture",
"(",
"this",
".",
"asyncClient",
".",... | Retrieves a subscription for a given topic from the service namespace
@param topicPath - The path of the topic relative to service bus namespace.
@param subscriptionName - The name of the subscription
@return - SubscriptionDescription containing information about the subscription.
@throws IllegalArgumentException - Thr... | [
"Retrieves",
"a",
"subscription",
"for",
"a",
"given",
"topic",
"from",
"the",
"service",
"namespace"
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/servicebus/data-plane/azure-servicebus/src/main/java/com/microsoft/azure/servicebus/management/ManagementClient.java#L115-L117 |
amplexus/java-flac-encoder | src/main/java/net/sourceforge/javaflacencoder/EncodedElement.java | EncodedElement.addInt | public EncodedElement addInt(int input, int bitCount) {
"""
Add a number of bits from an int to the end of this list's data. Will
add a new element if necessary. The bits stored are taken from the lower-
order of input.
@param input Int containing bits to append to end.
@param bitCount Number of bits to appe... | java | public EncodedElement addInt(int input, int bitCount) {
if(next != null) {
EncodedElement end = EncodedElement.getEnd_S(next);
return end.addInt(input, bitCount);
}
else if(data.length*8 < usableBits+bitCount) {
//create child and attach to next.
//Set child's offset appropriately(i.... | [
"public",
"EncodedElement",
"addInt",
"(",
"int",
"input",
",",
"int",
"bitCount",
")",
"{",
"if",
"(",
"next",
"!=",
"null",
")",
"{",
"EncodedElement",
"end",
"=",
"EncodedElement",
".",
"getEnd_S",
"(",
"next",
")",
";",
"return",
"end",
".",
"addInt"... | Add a number of bits from an int to the end of this list's data. Will
add a new element if necessary. The bits stored are taken from the lower-
order of input.
@param input Int containing bits to append to end.
@param bitCount Number of bits to append.
@return EncodedElement which actually contains the appended value. | [
"Add",
"a",
"number",
"of",
"bits",
"from",
"an",
"int",
"to",
"the",
"end",
"of",
"this",
"list",
"s",
"data",
".",
"Will",
"add",
"a",
"new",
"element",
"if",
"necessary",
".",
"The",
"bits",
"stored",
"are",
"taken",
"from",
"the",
"lower",
"-",
... | train | https://github.com/amplexus/java-flac-encoder/blob/3d536b877dee2a3fd4ab2e0d9569e292cae93bc9/src/main/java/net/sourceforge/javaflacencoder/EncodedElement.java#L326-L360 |
lessthanoptimal/BoofCV | main/boofcv-geo/src/main/java/boofcv/abst/geo/bundle/SceneStructureMetric.java | SceneStructureMetric.connectViewToCamera | public void connectViewToCamera( int viewIndex , int cameraIndex ) {
"""
Specifies that the view uses the specified camera
@param viewIndex index of view
@param cameraIndex index of camera
"""
if( views[viewIndex].camera != -1 )
throw new RuntimeException("View has already been assigned a camera");
vi... | java | public void connectViewToCamera( int viewIndex , int cameraIndex ) {
if( views[viewIndex].camera != -1 )
throw new RuntimeException("View has already been assigned a camera");
views[viewIndex].camera = cameraIndex;
} | [
"public",
"void",
"connectViewToCamera",
"(",
"int",
"viewIndex",
",",
"int",
"cameraIndex",
")",
"{",
"if",
"(",
"views",
"[",
"viewIndex",
"]",
".",
"camera",
"!=",
"-",
"1",
")",
"throw",
"new",
"RuntimeException",
"(",
"\"View has already been assigned a cam... | Specifies that the view uses the specified camera
@param viewIndex index of view
@param cameraIndex index of camera | [
"Specifies",
"that",
"the",
"view",
"uses",
"the",
"specified",
"camera"
] | train | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-geo/src/main/java/boofcv/abst/geo/bundle/SceneStructureMetric.java#L183-L187 |
ManfredTremmel/gwt-commons-lang3 | src/main/java/org/apache/commons/lang3/StringUtils.java | StringUtils.defaultIfEmpty | public static <T extends CharSequence> T defaultIfEmpty(final T str, final T defaultStr) {
"""
<p>Returns either the passed in CharSequence, or if the CharSequence is
empty or {@code null}, the value of {@code defaultStr}.</p>
<pre>
StringUtils.defaultIfEmpty(null, "NULL") = "NULL"
StringUtils.defaultIfEmpt... | java | public static <T extends CharSequence> T defaultIfEmpty(final T str, final T defaultStr) {
return isEmpty(str) ? defaultStr : str;
} | [
"public",
"static",
"<",
"T",
"extends",
"CharSequence",
">",
"T",
"defaultIfEmpty",
"(",
"final",
"T",
"str",
",",
"final",
"T",
"defaultStr",
")",
"{",
"return",
"isEmpty",
"(",
"str",
")",
"?",
"defaultStr",
":",
"str",
";",
"}"
] | <p>Returns either the passed in CharSequence, or if the CharSequence is
empty or {@code null}, the value of {@code defaultStr}.</p>
<pre>
StringUtils.defaultIfEmpty(null, "NULL") = "NULL"
StringUtils.defaultIfEmpty("", "NULL") = "NULL"
StringUtils.defaultIfEmpty(" ", "NULL") = " "
StringUtils.defaultIfEmpty("bat... | [
"<p",
">",
"Returns",
"either",
"the",
"passed",
"in",
"CharSequence",
"or",
"if",
"the",
"CharSequence",
"is",
"empty",
"or",
"{",
"@code",
"null",
"}",
"the",
"value",
"of",
"{",
"@code",
"defaultStr",
"}",
".",
"<",
"/",
"p",
">"
] | train | https://github.com/ManfredTremmel/gwt-commons-lang3/blob/9e2dfbbda3668cfa5d935fe76479d1426c294504/src/main/java/org/apache/commons/lang3/StringUtils.java#L7440-L7442 |
m-m-m/util | io/src/main/java/net/sf/mmm/util/file/base/FileAccessPermissions.java | FileAccessPermissions.setFlag | private void setFlag(FileAccessClass fileModeClass, int bitMask, boolean flag) {
"""
This method sets the flag(s) given by {@code bitMask} of this this {@link #getMaskBits() mask} for the given
{@code fileModeClass} to the given value ({@code flag}).
@param fileModeClass is the class of access ( {@link FileA... | java | private void setFlag(FileAccessClass fileModeClass, int bitMask, boolean flag) {
setBits(shiftMask(fileModeClass, bitMask), flag);
} | [
"private",
"void",
"setFlag",
"(",
"FileAccessClass",
"fileModeClass",
",",
"int",
"bitMask",
",",
"boolean",
"flag",
")",
"{",
"setBits",
"(",
"shiftMask",
"(",
"fileModeClass",
",",
"bitMask",
")",
",",
"flag",
")",
";",
"}"
] | This method sets the flag(s) given by {@code bitMask} of this this {@link #getMaskBits() mask} for the given
{@code fileModeClass} to the given value ({@code flag}).
@param fileModeClass is the class of access ( {@link FileAccessClass#USER}, {@link FileAccessClass#GROUP}, or
{@link FileAccessClass#OTHERS}).
@param bi... | [
"This",
"method",
"sets",
"the",
"flag",
"(",
"s",
")",
"given",
"by",
"{",
"@code",
"bitMask",
"}",
"of",
"this",
"this",
"{",
"@link",
"#getMaskBits",
"()",
"mask",
"}",
"for",
"the",
"given",
"{",
"@code",
"fileModeClass",
"}",
"to",
"the",
"given",... | train | https://github.com/m-m-m/util/blob/f0e4e084448f8dfc83ca682a9e1618034a094ce6/io/src/main/java/net/sf/mmm/util/file/base/FileAccessPermissions.java#L337-L340 |
lessthanoptimal/BoofCV | main/boofcv-geo/src/main/java/boofcv/alg/geo/PerspectiveOps.java | PerspectiveOps.pinholeToMatrix | public static FMatrixRMaj pinholeToMatrix(CameraPinhole param , FMatrixRMaj K ) {
"""
Given the intrinsic parameters create a calibration matrix
@param param Intrinsic parameters structure that is to be converted into a matrix
@param K Storage for calibration matrix, must be 3x3. If null then a new matrix is ... | java | public static FMatrixRMaj pinholeToMatrix(CameraPinhole param , FMatrixRMaj K )
{
return ImplPerspectiveOps_F32.pinholeToMatrix(param, K);
} | [
"public",
"static",
"FMatrixRMaj",
"pinholeToMatrix",
"(",
"CameraPinhole",
"param",
",",
"FMatrixRMaj",
"K",
")",
"{",
"return",
"ImplPerspectiveOps_F32",
".",
"pinholeToMatrix",
"(",
"param",
",",
"K",
")",
";",
"}"
] | Given the intrinsic parameters create a calibration matrix
@param param Intrinsic parameters structure that is to be converted into a matrix
@param K Storage for calibration matrix, must be 3x3. If null then a new matrix is declared
@return Calibration matrix 3x3 | [
"Given",
"the",
"intrinsic",
"parameters",
"create",
"a",
"calibration",
"matrix"
] | train | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-geo/src/main/java/boofcv/alg/geo/PerspectiveOps.java#L271-L274 |
apache/groovy | subprojects/groovy-nio/src/main/java/org/codehaus/groovy/runtime/NioGroovyMethods.java | NioGroovyMethods.newWriter | public static BufferedWriter newWriter(Path self, String charset, boolean append, boolean writeBom) throws IOException {
"""
Helper method to create a buffered writer for a file. If the given
charset is "UTF-16BE" or "UTF-16LE" (or an equivalent alias), the
requisite byte order mark is written to the stream bef... | java | public static BufferedWriter newWriter(Path self, String charset, boolean append, boolean writeBom) throws IOException {
boolean shouldWriteBom = writeBom && !self.toFile().exists();
if (append) {
BufferedWriter writer = Files.newBufferedWriter(self, Charset.forName(charset), CREATE, APPEND)... | [
"public",
"static",
"BufferedWriter",
"newWriter",
"(",
"Path",
"self",
",",
"String",
"charset",
",",
"boolean",
"append",
",",
"boolean",
"writeBom",
")",
"throws",
"IOException",
"{",
"boolean",
"shouldWriteBom",
"=",
"writeBom",
"&&",
"!",
"self",
".",
"to... | Helper method to create a buffered writer for a file. If the given
charset is "UTF-16BE" or "UTF-16LE" (or an equivalent alias), the
requisite byte order mark is written to the stream before the writer
is returned.
@param self a Path
@param charset the name of the encoding used to write in this file
@param appen... | [
"Helper",
"method",
"to",
"create",
"a",
"buffered",
"writer",
"for",
"a",
"file",
".",
"If",
"the",
"given",
"charset",
"is",
"UTF",
"-",
"16BE",
"or",
"UTF",
"-",
"16LE",
"(",
"or",
"an",
"equivalent",
"alias",
")",
"the",
"requisite",
"byte",
"order... | train | https://github.com/apache/groovy/blob/71cf20addb611bb8d097a59e395fd20bc7f31772/subprojects/groovy-nio/src/main/java/org/codehaus/groovy/runtime/NioGroovyMethods.java#L1591-L1606 |
VoltDB/voltdb | src/frontend/org/voltdb/ElasticHashinator.java | ElasticHashinator.toJSONString | private String toJSONString() {
"""
Serializes the configuration into JSON, also updates the currently cached m_configJSON.
@return The JSONString of the current configuration.
"""
JSONStringer js = new JSONStringer();
try {
js.object();
for (Map.Entry<Integer, Integer>... | java | private String toJSONString() {
JSONStringer js = new JSONStringer();
try {
js.object();
for (Map.Entry<Integer, Integer> entry : m_tokensMap.get().entrySet()) {
js.key(entry.getKey().toString()).value(entry.getValue());
}
js.endObject();
... | [
"private",
"String",
"toJSONString",
"(",
")",
"{",
"JSONStringer",
"js",
"=",
"new",
"JSONStringer",
"(",
")",
";",
"try",
"{",
"js",
".",
"object",
"(",
")",
";",
"for",
"(",
"Map",
".",
"Entry",
"<",
"Integer",
",",
"Integer",
">",
"entry",
":",
... | Serializes the configuration into JSON, also updates the currently cached m_configJSON.
@return The JSONString of the current configuration. | [
"Serializes",
"the",
"configuration",
"into",
"JSON",
"also",
"updates",
"the",
"currently",
"cached",
"m_configJSON",
"."
] | train | https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/src/frontend/org/voltdb/ElasticHashinator.java#L233-L245 |
wildfly/wildfly-core | launcher/src/main/java/org/wildfly/core/launcher/CliCommandBuilder.java | CliCommandBuilder.setController | public CliCommandBuilder setController(final String hostname, final int port) {
"""
Sets the hostname and port to connect to.
@param hostname the host name
@param port the port
@return the builder
"""
setController(formatAddress(null, hostname, port));
return this;
} | java | public CliCommandBuilder setController(final String hostname, final int port) {
setController(formatAddress(null, hostname, port));
return this;
} | [
"public",
"CliCommandBuilder",
"setController",
"(",
"final",
"String",
"hostname",
",",
"final",
"int",
"port",
")",
"{",
"setController",
"(",
"formatAddress",
"(",
"null",
",",
"hostname",
",",
"port",
")",
")",
";",
"return",
"this",
";",
"}"
] | Sets the hostname and port to connect to.
@param hostname the host name
@param port the port
@return the builder | [
"Sets",
"the",
"hostname",
"and",
"port",
"to",
"connect",
"to",
"."
] | train | https://github.com/wildfly/wildfly-core/blob/cfaf0479dcbb2d320a44c5374b93b944ec39fade/launcher/src/main/java/org/wildfly/core/launcher/CliCommandBuilder.java#L199-L202 |
OpenLiberty/open-liberty | dev/com.ibm.ws.cdi.interfaces/src/com/ibm/ws/cdi/CDIServiceUtils.java | CDIServiceUtils.getAnnotatedTypeIdentifier | public static String getAnnotatedTypeIdentifier(AnnotatedType annotatedType, Class<?> extensionClass) {
"""
Returns a unique identifying string for an annotated type. This method should be used when calling BeforeBeanIdentifer.addAnnotatedType()
@param annotatedType the new annotated type you are createing. Nul... | java | public static String getAnnotatedTypeIdentifier(AnnotatedType annotatedType, Class<?> extensionClass) {
//We use the symbolic name as a compromise between makeing the ID unique enough to allow multiple annotated types based on the same type
//to quote the javadoc: " This method allows multiple annotate... | [
"public",
"static",
"String",
"getAnnotatedTypeIdentifier",
"(",
"AnnotatedType",
"annotatedType",
",",
"Class",
"<",
"?",
">",
"extensionClass",
")",
"{",
"//We use the symbolic name as a compromise between makeing the ID unique enough to allow multiple annotated types based on the sa... | Returns a unique identifying string for an annotated type. This method should be used when calling BeforeBeanIdentifer.addAnnotatedType()
@param annotatedType the new annotated type you are createing. Null is an accepted value but should only be used if you know exactly what you are doing.
@param extensionClass the CD... | [
"Returns",
"a",
"unique",
"identifying",
"string",
"for",
"an",
"annotated",
"type",
".",
"This",
"method",
"should",
"be",
"used",
"when",
"calling",
"BeforeBeanIdentifer",
".",
"addAnnotatedType",
"()"
] | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.cdi.interfaces/src/com/ibm/ws/cdi/CDIServiceUtils.java#L72-L84 |
crnk-project/crnk-framework | crnk-data/crnk-data-jpa/src/main/java/io/crnk/data/jpa/internal/JpaResourceInformationProvider.java | JpaResourceInformationProvider.handleIdOverride | private void handleIdOverride(Class<?> resourceClass, List<ResourceField> fields) {
"""
make sure that @JsonApiId wins over @Id and @EmbeddedId of JPA.
"""
List<ResourceField> idFields = fields.stream()
.filter(field -> field.getResourceFieldType() == ResourceFieldType.ID)
... | java | private void handleIdOverride(Class<?> resourceClass, List<ResourceField> fields) {
List<ResourceField> idFields = fields.stream()
.filter(field -> field.getResourceFieldType() == ResourceFieldType.ID)
.collect(Collectors.toList());
if (idFields.size() == 2) {
... | [
"private",
"void",
"handleIdOverride",
"(",
"Class",
"<",
"?",
">",
"resourceClass",
",",
"List",
"<",
"ResourceField",
">",
"fields",
")",
"{",
"List",
"<",
"ResourceField",
">",
"idFields",
"=",
"fields",
".",
"stream",
"(",
")",
".",
"filter",
"(",
"f... | make sure that @JsonApiId wins over @Id and @EmbeddedId of JPA. | [
"make",
"sure",
"that"
] | train | https://github.com/crnk-project/crnk-framework/blob/2fd3ef9a991788d46fd2e83b43c8ea37cbaf8681/crnk-data/crnk-data-jpa/src/main/java/io/crnk/data/jpa/internal/JpaResourceInformationProvider.java#L137-L160 |
ManfredTremmel/gwt-commons-lang3 | src/main/java/org/apache/commons/lang3/text/StrBuilder.java | StrBuilder.replaceFirst | public StrBuilder replaceFirst(final StrMatcher matcher, final String replaceStr) {
"""
Replaces the first match within the builder with the replace string.
<p>
Matchers can be used to perform advanced replace behaviour.
For example you could write a matcher to replace
where the character 'a' is followed by a ... | java | public StrBuilder replaceFirst(final StrMatcher matcher, final String replaceStr) {
return replace(matcher, replaceStr, 0, size, 1);
} | [
"public",
"StrBuilder",
"replaceFirst",
"(",
"final",
"StrMatcher",
"matcher",
",",
"final",
"String",
"replaceStr",
")",
"{",
"return",
"replace",
"(",
"matcher",
",",
"replaceStr",
",",
"0",
",",
"size",
",",
"1",
")",
";",
"}"
] | Replaces the first match within the builder with the replace string.
<p>
Matchers can be used to perform advanced replace behaviour.
For example you could write a matcher to replace
where the character 'a' is followed by a number.
@param matcher the matcher to use to find the deletion, null causes no action
@param re... | [
"Replaces",
"the",
"first",
"match",
"within",
"the",
"builder",
"with",
"the",
"replace",
"string",
".",
"<p",
">",
"Matchers",
"can",
"be",
"used",
"to",
"perform",
"advanced",
"replace",
"behaviour",
".",
"For",
"example",
"you",
"could",
"write",
"a",
... | train | https://github.com/ManfredTremmel/gwt-commons-lang3/blob/9e2dfbbda3668cfa5d935fe76479d1426c294504/src/main/java/org/apache/commons/lang3/text/StrBuilder.java#L2065-L2067 |
pip-services3-java/pip-services3-commons-java | src/org/pipservices3/commons/validate/PropertySchema.java | PropertySchema.performValidation | @Override
protected void performValidation(String path, Object value, List<ValidationResult> results) {
"""
Validates a given value against the schema and configured validation rules.
@param path a dot notation path to the value.
@param value a value to be validated.
@param results a list with validatio... | java | @Override
protected void performValidation(String path, Object value, List<ValidationResult> results) {
path = path == null || path.length() == 0 ? _name : path + "." + _name;
super.performValidation(path, value, results);
performTypeValidation(path, _type, value, results);
} | [
"@",
"Override",
"protected",
"void",
"performValidation",
"(",
"String",
"path",
",",
"Object",
"value",
",",
"List",
"<",
"ValidationResult",
">",
"results",
")",
"{",
"path",
"=",
"path",
"==",
"null",
"||",
"path",
".",
"length",
"(",
")",
"==",
"0",... | Validates a given value against the schema and configured validation rules.
@param path a dot notation path to the value.
@param value a value to be validated.
@param results a list with validation results to add new results. | [
"Validates",
"a",
"given",
"value",
"against",
"the",
"schema",
"and",
"configured",
"validation",
"rules",
"."
] | train | https://github.com/pip-services3-java/pip-services3-commons-java/blob/a8a0c3e5ec58f0663c295aa855c6b3afad2af86a/src/org/pipservices3/commons/validate/PropertySchema.java#L90-L96 |
jpardogo/GoogleProgressBar | example/src/main/java/com/jpardogo/android/googleprogressbar/calendarstock/ColorPickerPalette.java | ColorPickerPalette.addSwatchToRow | private void addSwatchToRow(TableRow row, View swatch, int rowNumber) {
"""
Appends a swatch to the end of the row for even-numbered rows (starting with row 0),
to the beginning of a row for odd-numbered rows.
"""
if (rowNumber % 2 == 0) {
row.addView(swatch);
} else {
... | java | private void addSwatchToRow(TableRow row, View swatch, int rowNumber) {
if (rowNumber % 2 == 0) {
row.addView(swatch);
} else {
row.addView(swatch, 0);
}
} | [
"private",
"void",
"addSwatchToRow",
"(",
"TableRow",
"row",
",",
"View",
"swatch",
",",
"int",
"rowNumber",
")",
"{",
"if",
"(",
"rowNumber",
"%",
"2",
"==",
"0",
")",
"{",
"row",
".",
"addView",
"(",
"swatch",
")",
";",
"}",
"else",
"{",
"row",
"... | Appends a swatch to the end of the row for even-numbered rows (starting with row 0),
to the beginning of a row for odd-numbered rows. | [
"Appends",
"a",
"swatch",
"to",
"the",
"end",
"of",
"the",
"row",
"for",
"even",
"-",
"numbered",
"rows",
"(",
"starting",
"with",
"row",
"0",
")",
"to",
"the",
"beginning",
"of",
"a",
"row",
"for",
"odd",
"-",
"numbered",
"rows",
"."
] | train | https://github.com/jpardogo/GoogleProgressBar/blob/c90bff19179335298ebccea5f4621dd887c55ef1/example/src/main/java/com/jpardogo/android/googleprogressbar/calendarstock/ColorPickerPalette.java#L133-L139 |
sebastiangraf/treetank | interfacemodules/jax-rx/src/main/java/org/jaxrx/resource/AResource.java | AResource.getResource | public Response getResource(final String system, final UriInfo uri, final String resource,
final HttpHeaders headers) {
"""
This method will be called when a HTTP client sends a POST request to an
existing resource with 'application/query+xml' as Content-Type.
@param system
The implementation system.... | java | public Response getResource(final String system, final UriInfo uri, final String resource,
final HttpHeaders headers) {
final JaxRx impl = Systems.getInstance(system);
final Map<QueryParameter, String> param = getParameters(uri, impl);
final ResourcePath path = new ResourcePath(res... | [
"public",
"Response",
"getResource",
"(",
"final",
"String",
"system",
",",
"final",
"UriInfo",
"uri",
",",
"final",
"String",
"resource",
",",
"final",
"HttpHeaders",
"headers",
")",
"{",
"final",
"JaxRx",
"impl",
"=",
"Systems",
".",
"getInstance",
"(",
"s... | This method will be called when a HTTP client sends a POST request to an
existing resource with 'application/query+xml' as Content-Type.
@param system
The implementation system.
@param uri
The context information due to the requested URI.
@param resource
The resource
@param headers
HTTP header attributes.
@return The ... | [
"This",
"method",
"will",
"be",
"called",
"when",
"a",
"HTTP",
"client",
"sends",
"a",
"POST",
"request",
"to",
"an",
"existing",
"resource",
"with",
"application",
"/",
"query",
"+",
"xml",
"as",
"Content",
"-",
"Type",
"."
] | train | https://github.com/sebastiangraf/treetank/blob/9b96d631b6c2a8502a0cc958dcb02bd6a6fd8b60/interfacemodules/jax-rx/src/main/java/org/jaxrx/resource/AResource.java#L332-L339 |
apache/flink | flink-runtime/src/main/java/org/apache/flink/runtime/state/KeyGroupPartitioner.java | KeyGroupPartitioner.reportKeyGroupOfElementAtIndex | protected void reportKeyGroupOfElementAtIndex(int index, int keyGroup) {
"""
This method reports in the bookkeeping data that the element at the given index belongs to the given key-group.
"""
final int keyGroupIndex = keyGroup - firstKeyGroup;
elementKeyGroups[index] = keyGroupIndex;
++counterHistogram[... | java | protected void reportKeyGroupOfElementAtIndex(int index, int keyGroup) {
final int keyGroupIndex = keyGroup - firstKeyGroup;
elementKeyGroups[index] = keyGroupIndex;
++counterHistogram[keyGroupIndex];
} | [
"protected",
"void",
"reportKeyGroupOfElementAtIndex",
"(",
"int",
"index",
",",
"int",
"keyGroup",
")",
"{",
"final",
"int",
"keyGroupIndex",
"=",
"keyGroup",
"-",
"firstKeyGroup",
";",
"elementKeyGroups",
"[",
"index",
"]",
"=",
"keyGroupIndex",
";",
"++",
"co... | This method reports in the bookkeeping data that the element at the given index belongs to the given key-group. | [
"This",
"method",
"reports",
"in",
"the",
"bookkeeping",
"data",
"that",
"the",
"element",
"at",
"the",
"given",
"index",
"belongs",
"to",
"the",
"given",
"key",
"-",
"group",
"."
] | train | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-runtime/src/main/java/org/apache/flink/runtime/state/KeyGroupPartitioner.java#L161-L165 |
line/armeria | core/src/main/java/com/linecorp/armeria/common/util/AbstractOptions.java | AbstractOptions.getOrElse0 | protected final <O extends AbstractOption<V>, V> V getOrElse0(O option, V defaultValue) {
"""
Returns the value of the specified {@code option}.
@param <O> the type of the option
@param <V> the type of the value
@return the value of the specified {@code option}. {@code defaultValue} if there's no such option.... | java | protected final <O extends AbstractOption<V>, V> V getOrElse0(O option, V defaultValue) {
return get0(option).orElse(defaultValue);
} | [
"protected",
"final",
"<",
"O",
"extends",
"AbstractOption",
"<",
"V",
">",
",",
"V",
">",
"V",
"getOrElse0",
"(",
"O",
"option",
",",
"V",
"defaultValue",
")",
"{",
"return",
"get0",
"(",
"option",
")",
".",
"orElse",
"(",
"defaultValue",
")",
";",
... | Returns the value of the specified {@code option}.
@param <O> the type of the option
@param <V> the type of the value
@return the value of the specified {@code option}. {@code defaultValue} if there's no such option. | [
"Returns",
"the",
"value",
"of",
"the",
"specified",
"{",
"@code",
"option",
"}",
"."
] | train | https://github.com/line/armeria/blob/67d29e019fd35a35f89c45cc8f9119ff9b12b44d/core/src/main/java/com/linecorp/armeria/common/util/AbstractOptions.java#L153-L155 |
intendia-oss/rxjava-gwt | src/main/modified/io/reactivex/super/io/reactivex/Maybe.java | Maybe.doAfterTerminate | @CheckReturnValue
@SchedulerSupport(SchedulerSupport.NONE)
public final Maybe<T> doAfterTerminate(Action onAfterTerminate) {
"""
Registers an {@link Action} to be called when this Maybe invokes either
{@link MaybeObserver#onComplete onSuccess},
{@link MaybeObserver#onComplete onComplete} or {@link MaybeO... | java | @CheckReturnValue
@SchedulerSupport(SchedulerSupport.NONE)
public final Maybe<T> doAfterTerminate(Action onAfterTerminate) {
return RxJavaPlugins.onAssembly(new MaybePeek<T>(this,
Functions.emptyConsumer(), // onSubscribe
Functions.emptyConsumer(), // onSuccess
... | [
"@",
"CheckReturnValue",
"@",
"SchedulerSupport",
"(",
"SchedulerSupport",
".",
"NONE",
")",
"public",
"final",
"Maybe",
"<",
"T",
">",
"doAfterTerminate",
"(",
"Action",
"onAfterTerminate",
")",
"{",
"return",
"RxJavaPlugins",
".",
"onAssembly",
"(",
"new",
"Ma... | Registers an {@link Action} to be called when this Maybe invokes either
{@link MaybeObserver#onComplete onSuccess},
{@link MaybeObserver#onComplete onComplete} or {@link MaybeObserver#onError onError}.
<p>
<img width="640" height="310" src="https://raw.github.com/wiki/ReactiveX/RxJava/images/rx-operators/finallyDo.png"... | [
"Registers",
"an",
"{",
"@link",
"Action",
"}",
"to",
"be",
"called",
"when",
"this",
"Maybe",
"invokes",
"either",
"{",
"@link",
"MaybeObserver#onComplete",
"onSuccess",
"}",
"{",
"@link",
"MaybeObserver#onComplete",
"onComplete",
"}",
"or",
"{",
"@link",
"Mayb... | train | https://github.com/intendia-oss/rxjava-gwt/blob/8d5635b12ce40da99e76b59dc6bfe6fc2fffc1fa/src/main/modified/io/reactivex/super/io/reactivex/Maybe.java#L2678-L2689 |
Azure/azure-sdk-for-java | network/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/network/v2018_04_01/implementation/SubnetsInner.java | SubnetsInner.createOrUpdate | public SubnetInner createOrUpdate(String resourceGroupName, String virtualNetworkName, String subnetName, SubnetInner subnetParameters) {
"""
Creates or updates a subnet in the specified virtual network.
@param resourceGroupName The name of the resource group.
@param virtualNetworkName The name of the virtual ... | java | public SubnetInner createOrUpdate(String resourceGroupName, String virtualNetworkName, String subnetName, SubnetInner subnetParameters) {
return createOrUpdateWithServiceResponseAsync(resourceGroupName, virtualNetworkName, subnetName, subnetParameters).toBlocking().last().body();
} | [
"public",
"SubnetInner",
"createOrUpdate",
"(",
"String",
"resourceGroupName",
",",
"String",
"virtualNetworkName",
",",
"String",
"subnetName",
",",
"SubnetInner",
"subnetParameters",
")",
"{",
"return",
"createOrUpdateWithServiceResponseAsync",
"(",
"resourceGroupName",
"... | Creates or updates a subnet in the specified virtual network.
@param resourceGroupName The name of the resource group.
@param virtualNetworkName The name of the virtual network.
@param subnetName The name of the subnet.
@param subnetParameters Parameters supplied to the create or update subnet operation.
@throws Illeg... | [
"Creates",
"or",
"updates",
"a",
"subnet",
"in",
"the",
"specified",
"virtual",
"network",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/network/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/network/v2018_04_01/implementation/SubnetsInner.java#L451-L453 |
apache/flink | flink-streaming-java/src/main/java/org/apache/flink/streaming/api/environment/StreamExecutionEnvironment.java | StreamExecutionEnvironment.addDefaultKryoSerializer | public void addDefaultKryoSerializer(Class<?> type, Class<? extends Serializer<?>> serializerClass) {
"""
Adds a new Kryo default serializer to the Runtime.
@param type
The class of the types serialized with the given serializer.
@param serializerClass
The class of the serializer to use.
"""
config.add... | java | public void addDefaultKryoSerializer(Class<?> type, Class<? extends Serializer<?>> serializerClass) {
config.addDefaultKryoSerializer(type, serializerClass);
} | [
"public",
"void",
"addDefaultKryoSerializer",
"(",
"Class",
"<",
"?",
">",
"type",
",",
"Class",
"<",
"?",
"extends",
"Serializer",
"<",
"?",
">",
">",
"serializerClass",
")",
"{",
"config",
".",
"addDefaultKryoSerializer",
"(",
"type",
",",
"serializerClass",... | Adds a new Kryo default serializer to the Runtime.
@param type
The class of the types serialized with the given serializer.
@param serializerClass
The class of the serializer to use. | [
"Adds",
"a",
"new",
"Kryo",
"default",
"serializer",
"to",
"the",
"Runtime",
"."
] | train | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-streaming-java/src/main/java/org/apache/flink/streaming/api/environment/StreamExecutionEnvironment.java#L566-L568 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.