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 |
|---|---|---|---|---|---|---|---|---|---|---|
apache/flink | flink-libraries/flink-gelly/src/main/java/org/apache/flink/graph/asm/translate/Translate.java | Translate.translateEdgeValues | public static <K, OLD, NEW> DataSet<Edge<K, NEW>> translateEdgeValues(DataSet<Edge<K, OLD>> edges, TranslateFunction<OLD, NEW> translator) {
"""
Translate {@link Edge} values using the given {@link TranslateFunction}.
@param edges input edges
@param translator implements conversion from {@code OLD} to {@code N... | java | public static <K, OLD, NEW> DataSet<Edge<K, NEW>> translateEdgeValues(DataSet<Edge<K, OLD>> edges, TranslateFunction<OLD, NEW> translator) {
return translateEdgeValues(edges, translator, PARALLELISM_DEFAULT);
} | [
"public",
"static",
"<",
"K",
",",
"OLD",
",",
"NEW",
">",
"DataSet",
"<",
"Edge",
"<",
"K",
",",
"NEW",
">",
">",
"translateEdgeValues",
"(",
"DataSet",
"<",
"Edge",
"<",
"K",
",",
"OLD",
">",
">",
"edges",
",",
"TranslateFunction",
"<",
"OLD",
",... | Translate {@link Edge} values using the given {@link TranslateFunction}.
@param edges input edges
@param translator implements conversion from {@code OLD} to {@code NEW}
@param <K> edge ID type
@param <OLD> old edge value type
@param <NEW> new edge value type
@return translated edges | [
"Translate",
"{",
"@link",
"Edge",
"}",
"values",
"using",
"the",
"given",
"{",
"@link",
"TranslateFunction",
"}",
"."
] | train | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-libraries/flink-gelly/src/main/java/org/apache/flink/graph/asm/translate/Translate.java#L304-L306 |
khuxtable/seaglass | src/main/java/com/seaglasslookandfeel/painter/AbstractRegionPainter.java | AbstractRegionPainter.paintWithCaching | private void paintWithCaching(Graphics2D g, JComponent c, int w, int h, Object[] extendedCacheKeys) {
"""
Paint the component, using a cached image if possible.
@param g the Graphics2D context to paint with.
@param c the component to paint.
@param w the componen... | java | private void paintWithCaching(Graphics2D g, JComponent c, int w, int h, Object[] extendedCacheKeys) {
VolatileImage img = getImage(g.getDeviceConfiguration(), c, w, h, extendedCacheKeys);
if (img != null) {
// render cached image
g.drawImage(img, 0, 0, null);
} else {
... | [
"private",
"void",
"paintWithCaching",
"(",
"Graphics2D",
"g",
",",
"JComponent",
"c",
",",
"int",
"w",
",",
"int",
"h",
",",
"Object",
"[",
"]",
"extendedCacheKeys",
")",
"{",
"VolatileImage",
"img",
"=",
"getImage",
"(",
"g",
".",
"getDeviceConfiguration",... | Paint the component, using a cached image if possible.
@param g the Graphics2D context to paint with.
@param c the component to paint.
@param w the component width.
@param h the component height.
@param extendedCacheKeys extended cache keys. | [
"Paint",
"the",
"component",
"using",
"a",
"cached",
"image",
"if",
"possible",
"."
] | train | https://github.com/khuxtable/seaglass/blob/f25ecba622923d7b29b64cb7d6068dd8005989b3/src/main/java/com/seaglasslookandfeel/painter/AbstractRegionPainter.java#L610-L622 |
hltcoe/annotated-nyt | src/main/java/com/nytlabs/corpus/NYTCorpusDocumentParser.java | NYTCorpusDocumentParser.parseNYTCorpusDocumentFromFile | public NYTCorpusDocument parseNYTCorpusDocumentFromFile(File file,
boolean validating) {
"""
Parse an New York Times Document from a file.
@param file
The file from which to parse the document.
@param validating
True if the file is to be validated against the nitf DTD and
false if it is not. It is recomm... | java | public NYTCorpusDocument parseNYTCorpusDocumentFromFile(File file,
boolean validating) {
Document document = null;
if (validating) {
document = loadValidating(file);
} else {
document = loadNonValidating(file);
}
return parseNYTCorpusDocumentFromDOMDocument(file, document);
} | [
"public",
"NYTCorpusDocument",
"parseNYTCorpusDocumentFromFile",
"(",
"File",
"file",
",",
"boolean",
"validating",
")",
"{",
"Document",
"document",
"=",
"null",
";",
"if",
"(",
"validating",
")",
"{",
"document",
"=",
"loadValidating",
"(",
"file",
")",
";",
... | Parse an New York Times Document from a file.
@param file
The file from which to parse the document.
@param validating
True if the file is to be validated against the nitf DTD and
false if it is not. It is recommended that validation be
disabled, as all documents in the corpus have previously been
validated against th... | [
"Parse",
"an",
"New",
"York",
"Times",
"Document",
"from",
"a",
"file",
"."
] | train | https://github.com/hltcoe/annotated-nyt/blob/0a4daa97705591cefea9de61614770ae2665a48e/src/main/java/com/nytlabs/corpus/NYTCorpusDocumentParser.java#L289-L299 |
Erudika/para | para-client/src/main/java/com/erudika/para/client/ParaClient.java | ParaClient.invokeGet | public Response invokeGet(String resourcePath, MultivaluedMap<String, String> params) {
"""
Invoke a GET request to the Para API.
@param resourcePath the subpath after '/v1/', should not start with '/'
@param params query parameters
@return a {@link Response} object
"""
logger.debug("GET {}, params: {}", ... | java | public Response invokeGet(String resourcePath, MultivaluedMap<String, String> params) {
logger.debug("GET {}, params: {}", getFullPath(resourcePath), params);
return invokeSignedRequest(getApiClient(), accessKey, key(!JWT_PATH.equals(resourcePath)), GET,
getEndpoint(), getFullPath(resourcePath), null, params, n... | [
"public",
"Response",
"invokeGet",
"(",
"String",
"resourcePath",
",",
"MultivaluedMap",
"<",
"String",
",",
"String",
">",
"params",
")",
"{",
"logger",
".",
"debug",
"(",
"\"GET {}, params: {}\"",
",",
"getFullPath",
"(",
"resourcePath",
")",
",",
"params",
... | Invoke a GET request to the Para API.
@param resourcePath the subpath after '/v1/', should not start with '/'
@param params query parameters
@return a {@link Response} object | [
"Invoke",
"a",
"GET",
"request",
"to",
"the",
"Para",
"API",
"."
] | train | https://github.com/Erudika/para/blob/5ba096c477042ea7b18e9a0e8b5b1ee0f5bd6ce9/para-client/src/main/java/com/erudika/para/client/ParaClient.java#L324-L328 |
dlemmermann/CalendarFX | CalendarFXView/src/main/java/com/calendarfx/model/Entry.java | Entry.locationProperty | public final StringProperty locationProperty() {
"""
A property used to store a free-text location specification for the given
entry. This could be as simple as "New York" or a full address as in
"128 Madison Avenue, New York, USA".
@return the location of the event specified by the entry
"""
if (... | java | public final StringProperty locationProperty() {
if (location == null) {
location = new SimpleStringProperty(null, "location") { //$NON-NLS-1$
@Override
public void set(String newLocation) {
String oldLocation = get();
if (!Uti... | [
"public",
"final",
"StringProperty",
"locationProperty",
"(",
")",
"{",
"if",
"(",
"location",
"==",
"null",
")",
"{",
"location",
"=",
"new",
"SimpleStringProperty",
"(",
"null",
",",
"\"location\"",
")",
"{",
"//$NON-NLS-1$",
"@",
"Override",
"public",
"void... | A property used to store a free-text location specification for the given
entry. This could be as simple as "New York" or a full address as in
"128 Madison Avenue, New York, USA".
@return the location of the event specified by the entry | [
"A",
"property",
"used",
"to",
"store",
"a",
"free",
"-",
"text",
"location",
"specification",
"for",
"the",
"given",
"entry",
".",
"This",
"could",
"be",
"as",
"simple",
"as",
"New",
"York",
"or",
"a",
"full",
"address",
"as",
"in",
"128",
"Madison",
... | train | https://github.com/dlemmermann/CalendarFX/blob/f2b91c2622c3f29d004485b6426b23b86c331f96/CalendarFXView/src/main/java/com/calendarfx/model/Entry.java#L1062-L1083 |
UrielCh/ovh-java-sdk | ovh-java-sdk-telephony/src/main/java/net/minidev/ovh/api/ApiOvhTelephony.java | ApiOvhTelephony.billingAccount_ovhPabx_serviceName_dialplan_dialplanId_extension_extensionId_rule_POST | public OvhOvhPabxDialplanExtensionRule billingAccount_ovhPabx_serviceName_dialplan_dialplanId_extension_extensionId_rule_POST(String billingAccount, String serviceName, Long dialplanId, Long extensionId, OvhOvhPabxDialplanExtensionRuleActionEnum action, String actionParam, Boolean negativeAction, Long position) throws ... | java | public OvhOvhPabxDialplanExtensionRule billingAccount_ovhPabx_serviceName_dialplan_dialplanId_extension_extensionId_rule_POST(String billingAccount, String serviceName, Long dialplanId, Long extensionId, OvhOvhPabxDialplanExtensionRuleActionEnum action, String actionParam, Boolean negativeAction, Long position) throws ... | [
"public",
"OvhOvhPabxDialplanExtensionRule",
"billingAccount_ovhPabx_serviceName_dialplan_dialplanId_extension_extensionId_rule_POST",
"(",
"String",
"billingAccount",
",",
"String",
"serviceName",
",",
"Long",
"dialplanId",
",",
"Long",
"extensionId",
",",
"OvhOvhPabxDialplanExtensi... | Create a new rule for an extension
REST: POST /telephony/{billingAccount}/ovhPabx/{serviceName}/dialplan/{dialplanId}/extension/{extensionId}/rule
@param actionParam [required] The parameter of the chosen action
@param action [required] The action made by the rule
@param position [required] The position of the rule in... | [
"Create",
"a",
"new",
"rule",
"for",
"an",
"extension"
] | train | https://github.com/UrielCh/ovh-java-sdk/blob/6d531a40e56e09701943e334c25f90f640c55701/ovh-java-sdk-telephony/src/main/java/net/minidev/ovh/api/ApiOvhTelephony.java#L7312-L7322 |
ops4j/org.ops4j.base | ops4j-base-io/src/main/java/org/ops4j/io/ListerUtils.java | ListerUtils.parseFilter | public static Pattern parseFilter( final String spec ) {
"""
Parses a usual filter into a regex pattern.
@param spec the filter to be parsed
@return a regexp pattern corresponding to the filter
@throws IllegalArgumentException - If the filter could not be compiled to a pattern
"""
StringBuffer... | java | public static Pattern parseFilter( final String spec )
{
StringBuffer sb = new StringBuffer();
for( int j = 0; j < spec.length(); j++ )
{
char c = spec.charAt( j );
switch( c )
{
case '.':
sb.append( "\\." );
... | [
"public",
"static",
"Pattern",
"parseFilter",
"(",
"final",
"String",
"spec",
")",
"{",
"StringBuffer",
"sb",
"=",
"new",
"StringBuffer",
"(",
")",
";",
"for",
"(",
"int",
"j",
"=",
"0",
";",
"j",
"<",
"spec",
".",
"length",
"(",
")",
";",
"j",
"++... | Parses a usual filter into a regex pattern.
@param spec the filter to be parsed
@return a regexp pattern corresponding to the filter
@throws IllegalArgumentException - If the filter could not be compiled to a pattern | [
"Parses",
"a",
"usual",
"filter",
"into",
"a",
"regex",
"pattern",
"."
] | train | https://github.com/ops4j/org.ops4j.base/blob/b0e742c0d9511f6b19ca64da2ebaf30b7a47256a/ops4j-base-io/src/main/java/org/ops4j/io/ListerUtils.java#L45-L83 |
deeplearning4j/deeplearning4j | nd4j/nd4j-backends/nd4j-api-parent/nd4j-api/src/main/java/org/nd4j/autodiff/functions/DifferentialFunctionFactory.java | DifferentialFunctionFactory.maxPooling3d | public SDVariable maxPooling3d(SDVariable input, Pooling3DConfig pooling3DConfig) {
"""
Max pooling 3d operation.
@param input the inputs to pooling
@param pooling3DConfig the configuration
@return
"""
pooling3DConfig.setType(Pooling3D.Pooling3DType.MAX);
return pooling3d(input, ... | java | public SDVariable maxPooling3d(SDVariable input, Pooling3DConfig pooling3DConfig) {
pooling3DConfig.setType(Pooling3D.Pooling3DType.MAX);
return pooling3d(input, pooling3DConfig);
} | [
"public",
"SDVariable",
"maxPooling3d",
"(",
"SDVariable",
"input",
",",
"Pooling3DConfig",
"pooling3DConfig",
")",
"{",
"pooling3DConfig",
".",
"setType",
"(",
"Pooling3D",
".",
"Pooling3DType",
".",
"MAX",
")",
";",
"return",
"pooling3d",
"(",
"input",
",",
"p... | Max pooling 3d operation.
@param input the inputs to pooling
@param pooling3DConfig the configuration
@return | [
"Max",
"pooling",
"3d",
"operation",
"."
] | train | https://github.com/deeplearning4j/deeplearning4j/blob/effce52f2afd7eeb53c5bcca699fcd90bd06822f/nd4j/nd4j-backends/nd4j-api-parent/nd4j-api/src/main/java/org/nd4j/autodiff/functions/DifferentialFunctionFactory.java#L364-L367 |
Graylog2/graylog2-server | graylog2-server/src/main/java/org/graylog2/database/PaginatedDbService.java | PaginatedDbService.streamByIds | public Stream<DTO> streamByIds(Set<String> idSet) {
"""
Returns an unordered stream of all entries in the database for the given IDs.
<p>
The returned stream needs to be closed to free the underlying database resources.
@param idSet set of IDs to query
@return stream of database entries for the given IDs
... | java | public Stream<DTO> streamByIds(Set<String> idSet) {
final List<ObjectId> objectIds = idSet.stream()
.map(ObjectId::new)
.collect(Collectors.toList());
return streamQuery(DBQuery.in("_id", objectIds));
} | [
"public",
"Stream",
"<",
"DTO",
">",
"streamByIds",
"(",
"Set",
"<",
"String",
">",
"idSet",
")",
"{",
"final",
"List",
"<",
"ObjectId",
">",
"objectIds",
"=",
"idSet",
".",
"stream",
"(",
")",
".",
"map",
"(",
"ObjectId",
"::",
"new",
")",
".",
"c... | Returns an unordered stream of all entries in the database for the given IDs.
<p>
The returned stream needs to be closed to free the underlying database resources.
@param idSet set of IDs to query
@return stream of database entries for the given IDs | [
"Returns",
"an",
"unordered",
"stream",
"of",
"all",
"entries",
"in",
"the",
"database",
"for",
"the",
"given",
"IDs",
".",
"<p",
">",
"The",
"returned",
"stream",
"needs",
"to",
"be",
"closed",
"to",
"free",
"the",
"underlying",
"database",
"resources",
"... | train | https://github.com/Graylog2/graylog2-server/blob/50b565dcead6e0a372236d5c2f8530dc5726fa9b/graylog2-server/src/main/java/org/graylog2/database/PaginatedDbService.java#L184-L190 |
geomajas/geomajas-project-client-gwt2 | impl/src/main/java/org/geomajas/gwt2/client/service/JsonService.java | JsonService.getIntValue | public static Integer getIntValue(JSONObject jsonObject, String key) throws JSONException {
"""
Get a integer value from a {@link JSONObject}.
@param jsonObject The object to get the key value from.
@param key The name of the key to search the value for.
@return Returns the value for the key in the object .
... | java | public static Integer getIntValue(JSONObject jsonObject, String key) throws JSONException {
checkArguments(jsonObject, key);
JSONValue value = jsonObject.get(key);
if (value != null && value.isNumber() != null) {
double number = ((JSONNumber) value).doubleValue();
return new Integer((int) number);
}
ret... | [
"public",
"static",
"Integer",
"getIntValue",
"(",
"JSONObject",
"jsonObject",
",",
"String",
"key",
")",
"throws",
"JSONException",
"{",
"checkArguments",
"(",
"jsonObject",
",",
"key",
")",
";",
"JSONValue",
"value",
"=",
"jsonObject",
".",
"get",
"(",
"key"... | Get a integer value from a {@link JSONObject}.
@param jsonObject The object to get the key value from.
@param key The name of the key to search the value for.
@return Returns the value for the key in the object .
@throws JSONException Thrown in case the key could not be found in the JSON object. | [
"Get",
"a",
"integer",
"value",
"from",
"a",
"{",
"@link",
"JSONObject",
"}",
"."
] | train | https://github.com/geomajas/geomajas-project-client-gwt2/blob/bd8d7904e861fa80522eed7b83c4ea99844180c7/impl/src/main/java/org/geomajas/gwt2/client/service/JsonService.java#L259-L267 |
Azure/azure-sdk-for-java | dns/resource-manager/v2017_10_01/src/main/java/com/microsoft/azure/management/dns/v2017_10_01/implementation/ZonesInner.java | ZonesInner.updateAsync | public Observable<ZoneInner> updateAsync(String resourceGroupName, String zoneName, String ifMatch, Map<String, String> tags) {
"""
Updates a DNS zone. Does not modify DNS records within the zone.
@param resourceGroupName The name of the resource group.
@param zoneName The name of the DNS zone (without a termi... | java | public Observable<ZoneInner> updateAsync(String resourceGroupName, String zoneName, String ifMatch, Map<String, String> tags) {
return updateWithServiceResponseAsync(resourceGroupName, zoneName, ifMatch, tags).map(new Func1<ServiceResponse<ZoneInner>, ZoneInner>() {
@Override
public Zone... | [
"public",
"Observable",
"<",
"ZoneInner",
">",
"updateAsync",
"(",
"String",
"resourceGroupName",
",",
"String",
"zoneName",
",",
"String",
"ifMatch",
",",
"Map",
"<",
"String",
",",
"String",
">",
"tags",
")",
"{",
"return",
"updateWithServiceResponseAsync",
"(... | Updates a DNS zone. Does not modify DNS records within the zone.
@param resourceGroupName The name of the resource group.
@param zoneName The name of the DNS zone (without a terminating dot).
@param ifMatch The etag of the DNS zone. Omit this value to always overwrite the current zone. Specify the last-seen etag value... | [
"Updates",
"a",
"DNS",
"zone",
".",
"Does",
"not",
"modify",
"DNS",
"records",
"within",
"the",
"zone",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/dns/resource-manager/v2017_10_01/src/main/java/com/microsoft/azure/management/dns/v2017_10_01/implementation/ZonesInner.java#L820-L827 |
knowm/Sundial | src/main/java/org/knowm/sundial/SundialJobScheduler.java | SundialJobScheduler.createScheduler | public static Scheduler createScheduler(SchedulerFactory schedulerFactory)
throws SundialSchedulerException {
"""
Creates the Sundial Scheduler
@param schedulerFactory factory to create the scheduler
@return
"""
if (scheduler == null) {
try {
scheduler = schedulerFactory.getSc... | java | public static Scheduler createScheduler(SchedulerFactory schedulerFactory)
throws SundialSchedulerException {
if (scheduler == null) {
try {
scheduler = schedulerFactory.getScheduler();
} catch (SchedulerException e) {
throw new SundialSchedulerException("COULD NOT CREATE... | [
"public",
"static",
"Scheduler",
"createScheduler",
"(",
"SchedulerFactory",
"schedulerFactory",
")",
"throws",
"SundialSchedulerException",
"{",
"if",
"(",
"scheduler",
"==",
"null",
")",
"{",
"try",
"{",
"scheduler",
"=",
"schedulerFactory",
".",
"getScheduler",
"... | Creates the Sundial Scheduler
@param schedulerFactory factory to create the scheduler
@return | [
"Creates",
"the",
"Sundial",
"Scheduler"
] | train | https://github.com/knowm/Sundial/blob/0d61549fdfb8d6f884a1f2eed7e32ad39e2f4c62/src/main/java/org/knowm/sundial/SundialJobScheduler.java#L123-L135 |
BranchMetrics/android-branch-deep-linking | Branch-SDK/src/io/branch/indexing/BranchUniversalObject.java | BranchUniversalObject.getShortUrl | public String getShortUrl(@NonNull Context context, @NonNull LinkProperties linkProperties) {
"""
Creates a short url for the BUO synchronously.
@param context {@link Context} instance
@param linkProperties An object of {@link LinkProperties} specifying the properties of this link
@return A {@link Stri... | java | public String getShortUrl(@NonNull Context context, @NonNull LinkProperties linkProperties) {
return getLinkBuilder(context, linkProperties).getShortUrl();
} | [
"public",
"String",
"getShortUrl",
"(",
"@",
"NonNull",
"Context",
"context",
",",
"@",
"NonNull",
"LinkProperties",
"linkProperties",
")",
"{",
"return",
"getLinkBuilder",
"(",
"context",
",",
"linkProperties",
")",
".",
"getShortUrl",
"(",
")",
";",
"}"
] | Creates a short url for the BUO synchronously.
@param context {@link Context} instance
@param linkProperties An object of {@link LinkProperties} specifying the properties of this link
@return A {@link String} with value of the short url created for this BUO. A long url for the BUO is returned in case link creat... | [
"Creates",
"a",
"short",
"url",
"for",
"the",
"BUO",
"synchronously",
"."
] | train | https://github.com/BranchMetrics/android-branch-deep-linking/blob/e3bee2ccfcbf6d4bf1a5815b5b86666e4ff8f848/Branch-SDK/src/io/branch/indexing/BranchUniversalObject.java#L597-L599 |
OpenLiberty/open-liberty | dev/com.ibm.ws.opentracing.1.1/src/com/ibm/ws/opentracing/OpentracingService.java | OpentracingService.process | public static boolean process(final URI uri, final SpanFilterType type) {
"""
Return true if a span for the specified URI and type should be included.
@param uri The URI of the request.
@param type The type of the request.
@return true if a span for the specified URI and type should be included.
"""
... | java | public static boolean process(final URI uri, final SpanFilterType type) {
final String methodName = "process";
boolean result = true;
// Copy the static reference locally so that it doesn't matter if the static list
// is updated while we're processing since that will just overwrite th... | [
"public",
"static",
"boolean",
"process",
"(",
"final",
"URI",
"uri",
",",
"final",
"SpanFilterType",
"type",
")",
"{",
"final",
"String",
"methodName",
"=",
"\"process\"",
";",
"boolean",
"result",
"=",
"true",
";",
"// Copy the static reference locally so that it ... | Return true if a span for the specified URI and type should be included.
@param uri The URI of the request.
@param type The type of the request.
@return true if a span for the specified URI and type should be included. | [
"Return",
"true",
"if",
"a",
"span",
"for",
"the",
"specified",
"URI",
"and",
"type",
"should",
"be",
"included",
"."
] | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.opentracing.1.1/src/com/ibm/ws/opentracing/OpentracingService.java#L132-L150 |
casbin/jcasbin | src/main/java/org/casbin/jcasbin/main/ManagementEnforcer.java | ManagementEnforcer.hasNamedGroupingPolicy | public boolean hasNamedGroupingPolicy(String ptype, String... params) {
"""
hasNamedGroupingPolicy determines whether a named role inheritance rule exists.
@param ptype the policy type, can be "g", "g2", "g3", ..
@param params the "g" policy rule.
@return whether the rule exists.
"""
return hasNam... | java | public boolean hasNamedGroupingPolicy(String ptype, String... params) {
return hasNamedGroupingPolicy(ptype, Arrays.asList(params));
} | [
"public",
"boolean",
"hasNamedGroupingPolicy",
"(",
"String",
"ptype",
",",
"String",
"...",
"params",
")",
"{",
"return",
"hasNamedGroupingPolicy",
"(",
"ptype",
",",
"Arrays",
".",
"asList",
"(",
"params",
")",
")",
";",
"}"
] | hasNamedGroupingPolicy determines whether a named role inheritance rule exists.
@param ptype the policy type, can be "g", "g2", "g3", ..
@param params the "g" policy rule.
@return whether the rule exists. | [
"hasNamedGroupingPolicy",
"determines",
"whether",
"a",
"named",
"role",
"inheritance",
"rule",
"exists",
"."
] | train | https://github.com/casbin/jcasbin/blob/b46d7a756b6c39cdb17e0600607e5fcdc66edd11/src/main/java/org/casbin/jcasbin/main/ManagementEnforcer.java#L411-L413 |
liyiorg/weixin-popular | src/main/java/weixin/popular/api/BizwifiAPI.java | BizwifiAPI.shopUpdate | public static BaseResult shopUpdate(String accessToken, ShopUpdate shopUpdate) {
"""
Wi-Fi门店管理-修改门店网络信息
@param accessToken accessToken
@param shopUpdate shopUpdate
@return BaseResult
"""
return shopUpdate(accessToken, JsonUtil.toJSONString(shopUpdate));
} | java | public static BaseResult shopUpdate(String accessToken, ShopUpdate shopUpdate) {
return shopUpdate(accessToken, JsonUtil.toJSONString(shopUpdate));
} | [
"public",
"static",
"BaseResult",
"shopUpdate",
"(",
"String",
"accessToken",
",",
"ShopUpdate",
"shopUpdate",
")",
"{",
"return",
"shopUpdate",
"(",
"accessToken",
",",
"JsonUtil",
".",
"toJSONString",
"(",
"shopUpdate",
")",
")",
";",
"}"
] | Wi-Fi门店管理-修改门店网络信息
@param accessToken accessToken
@param shopUpdate shopUpdate
@return BaseResult | [
"Wi",
"-",
"Fi门店管理",
"-",
"修改门店网络信息"
] | train | https://github.com/liyiorg/weixin-popular/blob/c64255292d41463bdb671938feaabf42a335d82c/src/main/java/weixin/popular/api/BizwifiAPI.java#L254-L256 |
deeplearning4j/deeplearning4j | deeplearning4j/deeplearning4j-nearestneighbors-parent/nearestneighbor-core/src/main/java/org/deeplearning4j/clustering/randomprojection/RPUtils.java | RPUtils.sortCandidates | public static List<Pair<Double,Integer>> sortCandidates(INDArray x,INDArray X,
List<Integer> candidates,
String similarityFunction) {
"""
Get the sorted distances given the
query vector, input d... | java | public static List<Pair<Double,Integer>> sortCandidates(INDArray x,INDArray X,
List<Integer> candidates,
String similarityFunction) {
int prevIdx = -1;
List<Pair<Double,Integer>> ret =... | [
"public",
"static",
"List",
"<",
"Pair",
"<",
"Double",
",",
"Integer",
">",
">",
"sortCandidates",
"(",
"INDArray",
"x",
",",
"INDArray",
"X",
",",
"List",
"<",
"Integer",
">",
"candidates",
",",
"String",
"similarityFunction",
")",
"{",
"int",
"prevIdx",... | Get the sorted distances given the
query vector, input data, given the list of possible search candidates
@param x the query vector
@param X the input data to use
@param candidates the possible search candidates
@param similarityFunction the similarity function to use
@return the sorted distances | [
"Get",
"the",
"sorted",
"distances",
"given",
"the",
"query",
"vector",
"input",
"data",
"given",
"the",
"list",
"of",
"possible",
"search",
"candidates"
] | train | https://github.com/deeplearning4j/deeplearning4j/blob/effce52f2afd7eeb53c5bcca699fcd90bd06822f/deeplearning4j/deeplearning4j-nearestneighbors-parent/nearestneighbor-core/src/main/java/org/deeplearning4j/clustering/randomprojection/RPUtils.java#L197-L219 |
zeroturnaround/zt-exec | src/main/java/org/zeroturnaround/exec/ProcessExecutor.java | ProcessExecutor.redirectOutput | public ProcessExecutor redirectOutput(OutputStream output) {
"""
Redirects the process' output stream to given output stream.
If this method is invoked multiple times each call overwrites the previous.
Use {@link #redirectOutputAlsoTo(OutputStream)} if you want to redirect the output to multiple streams.
@par... | java | public ProcessExecutor redirectOutput(OutputStream output) {
if (output == null)
output = NullOutputStream.NULL_OUTPUT_STREAM;
PumpStreamHandler pumps = pumps();
// Only set the output stream handler, preserve the same error stream handler
return streams(new PumpStreamHandler(output, pumps == null... | [
"public",
"ProcessExecutor",
"redirectOutput",
"(",
"OutputStream",
"output",
")",
"{",
"if",
"(",
"output",
"==",
"null",
")",
"output",
"=",
"NullOutputStream",
".",
"NULL_OUTPUT_STREAM",
";",
"PumpStreamHandler",
"pumps",
"=",
"pumps",
"(",
")",
";",
"// Only... | Redirects the process' output stream to given output stream.
If this method is invoked multiple times each call overwrites the previous.
Use {@link #redirectOutputAlsoTo(OutputStream)} if you want to redirect the output to multiple streams.
@param output output stream where the process output is redirected to (<code>n... | [
"Redirects",
"the",
"process",
"output",
"stream",
"to",
"given",
"output",
"stream",
".",
"If",
"this",
"method",
"is",
"invoked",
"multiple",
"times",
"each",
"call",
"overwrites",
"the",
"previous",
".",
"Use",
"{",
"@link",
"#redirectOutputAlsoTo",
"(",
"O... | train | https://github.com/zeroturnaround/zt-exec/blob/6c3b93b99bf3c69c9f41d6350bf7707005b6a4cd/src/main/java/org/zeroturnaround/exec/ProcessExecutor.java#L485-L491 |
google/error-prone-javac | src/jdk.javadoc/share/classes/com/sun/tools/doclets/internal/toolkit/builders/SerializedFormBuilder.java | SerializedFormBuilder.buildFieldDeprecationInfo | public void buildFieldDeprecationInfo(XMLNode node, Content fieldsContentTree) {
"""
Build the field deprecation information.
@param node the XML element that specifies which components to document
@param fieldsContentTree content tree to which the documentation will be added
"""
if (!currentClass.... | java | public void buildFieldDeprecationInfo(XMLNode node, Content fieldsContentTree) {
if (!currentClass.definesSerializableFields()) {
FieldDoc field = (FieldDoc)currentMember;
fieldWriter.addMemberDeprecatedInfo(field, fieldsContentTree);
}
} | [
"public",
"void",
"buildFieldDeprecationInfo",
"(",
"XMLNode",
"node",
",",
"Content",
"fieldsContentTree",
")",
"{",
"if",
"(",
"!",
"currentClass",
".",
"definesSerializableFields",
"(",
")",
")",
"{",
"FieldDoc",
"field",
"=",
"(",
"FieldDoc",
")",
"currentMe... | Build the field deprecation information.
@param node the XML element that specifies which components to document
@param fieldsContentTree content tree to which the documentation will be added | [
"Build",
"the",
"field",
"deprecation",
"information",
"."
] | train | https://github.com/google/error-prone-javac/blob/a53d069bbdb2c60232ed3811c19b65e41c3e60e0/src/jdk.javadoc/share/classes/com/sun/tools/doclets/internal/toolkit/builders/SerializedFormBuilder.java#L456-L461 |
OpenLiberty/open-liberty | dev/com.ibm.ws.messaging.runtime/src/com/ibm/ws/sib/processor/gd/GuaranteedTargetStream.java | GuaranteedTargetStream.removeAlarm | protected static void removeAlarm(Object key, Object alarmObject) {
"""
Utility method for removing an alarm from the alarm set. Has no
effect if either no alarms are associated with the given key, or
the given alarm object does not exist.
@param key The key for the set of alarms from which an alarm will
be ... | java | protected static void removeAlarm(Object key, Object alarmObject)
{
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.entry(tc, "removeAlarm", new Object[] { key, alarmObject });
synchronized (pendingAlarms)
{
if (pendingAlarms.containsKey(key))
... | [
"protected",
"static",
"void",
"removeAlarm",
"(",
"Object",
"key",
",",
"Object",
"alarmObject",
")",
"{",
"if",
"(",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
"&&",
"tc",
".",
"isEntryEnabled",
"(",
")",
")",
"SibTr",
".",
"entry",
"(",
"tc... | Utility method for removing an alarm from the alarm set. Has no
effect if either no alarms are associated with the given key, or
the given alarm object does not exist.
@param key The key for the set of alarms from which an alarm will
be removed. Normally this is a stream instance.
@param alarmObject The alarm object t... | [
"Utility",
"method",
"for",
"removing",
"an",
"alarm",
"from",
"the",
"alarm",
"set",
".",
"Has",
"no",
"effect",
"if",
"either",
"no",
"alarms",
"are",
"associated",
"with",
"the",
"given",
"key",
"or",
"the",
"given",
"alarm",
"object",
"does",
"not",
... | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.messaging.runtime/src/com/ibm/ws/sib/processor/gd/GuaranteedTargetStream.java#L1842-L1855 |
fernandospr/javapns-jdk16 | src/main/java/javapns/notification/Payload.java | Payload.addCustomDictionary | public void addCustomDictionary(String name, String value) throws JSONException {
"""
Add a custom dictionnary with a string value
@param name
@param value
@throws JSONException
"""
logger.debug("Adding custom Dictionary [" + name + "] = [" + value + "]");
put(name, value, payload, false);
} | java | public void addCustomDictionary(String name, String value) throws JSONException {
logger.debug("Adding custom Dictionary [" + name + "] = [" + value + "]");
put(name, value, payload, false);
} | [
"public",
"void",
"addCustomDictionary",
"(",
"String",
"name",
",",
"String",
"value",
")",
"throws",
"JSONException",
"{",
"logger",
".",
"debug",
"(",
"\"Adding custom Dictionary [\"",
"+",
"name",
"+",
"\"] = [\"",
"+",
"value",
"+",
"\"]\"",
")",
";",
"pu... | Add a custom dictionnary with a string value
@param name
@param value
@throws JSONException | [
"Add",
"a",
"custom",
"dictionnary",
"with",
"a",
"string",
"value"
] | train | https://github.com/fernandospr/javapns-jdk16/blob/84de6d9328ab01af92f77cc60c4554de02420909/src/main/java/javapns/notification/Payload.java#L77-L80 |
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.listDataLakeStoreAccountsAsync | public Observable<Page<DataLakeStoreAccountInfoInner>> listDataLakeStoreAccountsAsync(final String resourceGroupName, final String accountName, final String filter, final Integer top, final Integer skip, final String expand, final String select, final String orderby, final Boolean count, final String search, final Stri... | java | public Observable<Page<DataLakeStoreAccountInfoInner>> listDataLakeStoreAccountsAsync(final String resourceGroupName, final String accountName, final String filter, final Integer top, final Integer skip, final String expand, final String select, final String orderby, final Boolean count, final String search, final Stri... | [
"public",
"Observable",
"<",
"Page",
"<",
"DataLakeStoreAccountInfoInner",
">",
">",
"listDataLakeStoreAccountsAsync",
"(",
"final",
"String",
"resourceGroupName",
",",
"final",
"String",
"accountName",
",",
"final",
"String",
"filter",
",",
"final",
"Integer",
"top",... | Gets the first page of Data Lake Store accounts linked to the specified Data Lake Analytics account. The response includes a link to the next page, if any.
@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... | [
"Gets",
"the",
"first",
"page",
"of",
"Data",
"Lake",
"Store",
"accounts",
"linked",
"to",
"the",
"specified",
"Data",
"Lake",
"Analytics",
"account",
".",
"The",
"response",
"includes",
"a",
"link",
"to",
"the",
"next",
"page",
"if",
"any",
"."
] | 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#L1715-L1723 |
pwheel/spring-security-oauth2-client | src/main/java/com/racquettrack/security/oauth/OAuth2AuthenticationFilter.java | OAuth2AuthenticationFilter.checkForErrors | protected void checkForErrors(Map<String, String[]> parameters) throws AuthenticationException {
"""
Checks to see if an error was returned by the OAuth Provider and throws an {@link AuthenticationException} if
it was.
@param parameters Parameters received from the OAuth Provider.
@throws AuthenticationExceptio... | java | protected void checkForErrors(Map<String, String[]> parameters) throws AuthenticationException {
final String errorValues[] = parameters.get("error");
final String errorReasonValues[] = parameters.get("error_reason");
final String errorDescriptionValues[] = parameters.get("error_description");
... | [
"protected",
"void",
"checkForErrors",
"(",
"Map",
"<",
"String",
",",
"String",
"[",
"]",
">",
"parameters",
")",
"throws",
"AuthenticationException",
"{",
"final",
"String",
"errorValues",
"[",
"]",
"=",
"parameters",
".",
"get",
"(",
"\"error\"",
")",
";"... | Checks to see if an error was returned by the OAuth Provider and throws an {@link AuthenticationException} if
it was.
@param parameters Parameters received from the OAuth Provider.
@throws AuthenticationException If an error was returned by the OAuth Provider. | [
"Checks",
"to",
"see",
"if",
"an",
"error",
"was",
"returned",
"by",
"the",
"OAuth",
"Provider",
"and",
"throws",
"an",
"{"
] | train | https://github.com/pwheel/spring-security-oauth2-client/blob/c0258823493e268495c9752c5d752f74c6809c6b/src/main/java/com/racquettrack/security/oauth/OAuth2AuthenticationFilter.java#L129-L145 |
FasterXML/woodstox | src/main/java/com/ctc/wstx/util/BijectiveNsMap.java | BijectiveNsMap.addMapping | public String addMapping(String prefix, String uri) {
"""
Method to add a new prefix-to-URI mapping for the current scope.
Note that it should NOT be used for the default namespace
declaration
@param prefix Prefix to bind
@param uri URI to bind to the prefix
@return If the prefix was already bound, the UR... | java | public String addMapping(String prefix, String uri)
{
String[] strs = mNsStrings;
int phash = prefix.hashCode();
for (int ix = mScopeStart, end = mScopeEnd; ix < end; ix += 2) {
String thisP = strs[ix];
if (thisP == prefix ||
(thisP.hashCode() == phas... | [
"public",
"String",
"addMapping",
"(",
"String",
"prefix",
",",
"String",
"uri",
")",
"{",
"String",
"[",
"]",
"strs",
"=",
"mNsStrings",
";",
"int",
"phash",
"=",
"prefix",
".",
"hashCode",
"(",
")",
";",
"for",
"(",
"int",
"ix",
"=",
"mScopeStart",
... | Method to add a new prefix-to-URI mapping for the current scope.
Note that it should NOT be used for the default namespace
declaration
@param prefix Prefix to bind
@param uri URI to bind to the prefix
@return If the prefix was already bound, the URI it was bound to:
null if it's a new binding for the current scope. | [
"Method",
"to",
"add",
"a",
"new",
"prefix",
"-",
"to",
"-",
"URI",
"mapping",
"for",
"the",
"current",
"scope",
".",
"Note",
"that",
"it",
"should",
"NOT",
"be",
"used",
"for",
"the",
"default",
"namespace",
"declaration"
] | train | https://github.com/FasterXML/woodstox/blob/ffcaabdc06672d9564c48c25d601d029b7fd6548/src/main/java/com/ctc/wstx/util/BijectiveNsMap.java#L226-L251 |
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/ManagedInstancesInner.java | ManagedInstancesInner.beginUpdate | public ManagedInstanceInner beginUpdate(String resourceGroupName, String managedInstanceName, ManagedInstanceUpdate parameters) {
"""
Updates a managed instance.
@param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or t... | java | public ManagedInstanceInner beginUpdate(String resourceGroupName, String managedInstanceName, ManagedInstanceUpdate parameters) {
return beginUpdateWithServiceResponseAsync(resourceGroupName, managedInstanceName, parameters).toBlocking().single().body();
} | [
"public",
"ManagedInstanceInner",
"beginUpdate",
"(",
"String",
"resourceGroupName",
",",
"String",
"managedInstanceName",
",",
"ManagedInstanceUpdate",
"parameters",
")",
"{",
"return",
"beginUpdateWithServiceResponseAsync",
"(",
"resourceGroupName",
",",
"managedInstanceName"... | Updates a managed instance.
@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 managedInstanceName The name of the managed instance.
@param parameters The requested managed instance resource state.
@thr... | [
"Updates",
"a",
"managed",
"instance",
"."
] | 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/ManagedInstancesInner.java#L839-L841 |
aaberg/sql2o | core/src/main/java/org/sql2o/Sql2o.java | Sql2o.beginTransaction | public Connection beginTransaction(ConnectionSource connectionSource, int isolationLevel) {
"""
Begins a transaction with the given isolation level. Every statement executed on the return {@link Connection}
instance, will be executed in the transaction. It is very important to always call either the {@link org.sq... | java | public Connection beginTransaction(ConnectionSource connectionSource, int isolationLevel) {
Connection connection = new Connection(this, connectionSource, false);
boolean success = false;
try {
connection.getJdbcConnection().setAutoCommit(false);
connection.getJdbcConne... | [
"public",
"Connection",
"beginTransaction",
"(",
"ConnectionSource",
"connectionSource",
",",
"int",
"isolationLevel",
")",
"{",
"Connection",
"connection",
"=",
"new",
"Connection",
"(",
"this",
",",
"connectionSource",
",",
"false",
")",
";",
"boolean",
"success",... | Begins a transaction with the given isolation level. Every statement executed on the return {@link Connection}
instance, will be executed in the transaction. It is very important to always call either the {@link org.sql2o.Connection#commit()}
method or the {@link org.sql2o.Connection#rollback()} method to close the tra... | [
"Begins",
"a",
"transaction",
"with",
"the",
"given",
"isolation",
"level",
".",
"Every",
"statement",
"executed",
"on",
"the",
"return",
"{"
] | train | https://github.com/aaberg/sql2o/blob/01d3490a6d2440cf60f973d23508ac4ed57a8e20/core/src/main/java/org/sql2o/Sql2o.java#L293-L311 |
headius/invokebinder | src/main/java/com/headius/invokebinder/SmartBinder.java | SmartBinder.dropFirst | public SmartBinder dropFirst(int count) {
"""
Drop the first N arguments.
@param count the count of arguments to drop
@return a new SmartBinder with the drop applied
"""
return new SmartBinder(this, signature().dropFirst(count), binder.dropFirst(count));
} | java | public SmartBinder dropFirst(int count) {
return new SmartBinder(this, signature().dropFirst(count), binder.dropFirst(count));
} | [
"public",
"SmartBinder",
"dropFirst",
"(",
"int",
"count",
")",
"{",
"return",
"new",
"SmartBinder",
"(",
"this",
",",
"signature",
"(",
")",
".",
"dropFirst",
"(",
"count",
")",
",",
"binder",
".",
"dropFirst",
"(",
"count",
")",
")",
";",
"}"
] | Drop the first N arguments.
@param count the count of arguments to drop
@return a new SmartBinder with the drop applied | [
"Drop",
"the",
"first",
"N",
"arguments",
"."
] | train | https://github.com/headius/invokebinder/blob/ce6bfeb8e33265480daa7b797989dd915d51238d/src/main/java/com/headius/invokebinder/SmartBinder.java#L828-L830 |
facebookarchive/hadoop-20 | src/core/org/apache/hadoop/metrics/ContextFactory.java | ContextFactory.getContext | public synchronized MetricsContext getContext(String refName, String contextName)
throws IOException, ClassNotFoundException, InstantiationException, IllegalAccessException {
"""
Returns the named MetricsContext instance, constructing it if necessary
using the factory's current configuration attributes.
<... | java | public synchronized MetricsContext getContext(String refName, String contextName)
throws IOException, ClassNotFoundException, InstantiationException, IllegalAccessException {
MetricsContext metricsContext = contextMap.get(refName);
if (metricsContext == null) {
String classNameAttribute = refNam... | [
"public",
"synchronized",
"MetricsContext",
"getContext",
"(",
"String",
"refName",
",",
"String",
"contextName",
")",
"throws",
"IOException",
",",
"ClassNotFoundException",
",",
"InstantiationException",
",",
"IllegalAccessException",
"{",
"MetricsContext",
"metricsContex... | Returns the named MetricsContext instance, constructing it if necessary
using the factory's current configuration attributes.
<p/>
When constructing the instance, if the factory property
<i>contextName</i>.class</code> exists, its value is taken to be the name
of the class to instantiate. Otherwise, the default is to ... | [
"Returns",
"the",
"named",
"MetricsContext",
"instance",
"constructing",
"it",
"if",
"necessary",
"using",
"the",
"factory",
"s",
"current",
"configuration",
"attributes",
".",
"<p",
"/",
">"
] | train | https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/core/org/apache/hadoop/metrics/ContextFactory.java#L136-L151 |
versionone/VersionOne.SDK.Java.ObjectModel | src/main/java/com/versionone/om/Project.java | Project.createDefect | public Defect createDefect(String name, Map<String, Object> attributes) {
"""
Create a new Defect in this Project.
@param name The initial name of the Defect.
@param attributes additional attributes for defect
@return A new Defect.
"""
return getInstance().create().defect(name, this, attribu... | java | public Defect createDefect(String name, Map<String, Object> attributes) {
return getInstance().create().defect(name, this, attributes);
} | [
"public",
"Defect",
"createDefect",
"(",
"String",
"name",
",",
"Map",
"<",
"String",
",",
"Object",
">",
"attributes",
")",
"{",
"return",
"getInstance",
"(",
")",
".",
"create",
"(",
")",
".",
"defect",
"(",
"name",
",",
"this",
",",
"attributes",
")... | Create a new Defect in this Project.
@param name The initial name of the Defect.
@param attributes additional attributes for defect
@return A new Defect. | [
"Create",
"a",
"new",
"Defect",
"in",
"this",
"Project",
"."
] | train | https://github.com/versionone/VersionOne.SDK.Java.ObjectModel/blob/59d35b67c849299631bca45ee94143237eb2ae1a/src/main/java/com/versionone/om/Project.java#L230-L232 |
mebigfatguy/fb-contrib | src/main/java/com/mebigfatguy/fbcontrib/detect/PossibleUnsuspectedSerialization.java | PossibleUnsuspectedSerialization.sawOpcode | @Override
public void sawOpcode(int seen) {
"""
implements the visitor to look for serialization of an object that is an non-static inner class.
@param seen
the context object of the currently parsed instruction
"""
try {
stack.precomputation(this);
if (seen == Const.IN... | java | @Override
public void sawOpcode(int seen) {
try {
stack.precomputation(this);
if (seen == Const.INVOKEVIRTUAL) {
String clsName = getClassConstantOperand();
if ("java/io/ObjectOutputStream".equals(clsName)) {
String name = getNameC... | [
"@",
"Override",
"public",
"void",
"sawOpcode",
"(",
"int",
"seen",
")",
"{",
"try",
"{",
"stack",
".",
"precomputation",
"(",
"this",
")",
";",
"if",
"(",
"seen",
"==",
"Const",
".",
"INVOKEVIRTUAL",
")",
"{",
"String",
"clsName",
"=",
"getClassConstant... | implements the visitor to look for serialization of an object that is an non-static inner class.
@param seen
the context object of the currently parsed instruction | [
"implements",
"the",
"visitor",
"to",
"look",
"for",
"serialization",
"of",
"an",
"object",
"that",
"is",
"an",
"non",
"-",
"static",
"inner",
"class",
"."
] | train | https://github.com/mebigfatguy/fb-contrib/blob/3b5203196f627b399fbcea3c2ab2b1f4e56cc7b8/src/main/java/com/mebigfatguy/fbcontrib/detect/PossibleUnsuspectedSerialization.java#L89-L114 |
finmath/finmath-lib | src/main/java6/net/finmath/marketdata/model/curves/ForwardCurve.java | ForwardCurve.createForwardCurveFromForwards | public static ForwardCurve createForwardCurveFromForwards(String name, LocalDate referenceDate, String paymentOffsetCode, InterpolationEntityForward interpolationEntityForward, String discountCurveName, AnalyticModelInterface model, double[] times, double[] givenForwards) {
"""
Create a forward curve from given ti... | java | public static ForwardCurve createForwardCurveFromForwards(String name, LocalDate referenceDate, String paymentOffsetCode, InterpolationEntityForward interpolationEntityForward, String discountCurveName, AnalyticModelInterface model, double[] times, double[] givenForwards) {
ForwardCurve forwardCurve = new ForwardCurv... | [
"public",
"static",
"ForwardCurve",
"createForwardCurveFromForwards",
"(",
"String",
"name",
",",
"LocalDate",
"referenceDate",
",",
"String",
"paymentOffsetCode",
",",
"InterpolationEntityForward",
"interpolationEntityForward",
",",
"String",
"discountCurveName",
",",
"Analy... | Create a forward curve from given times and given forwards.
@param name The name of this curve.
@param referenceDate The reference date for this code, i.e., the date which defines t=0.
@param paymentOffsetCode The maturity of the index modeled by this curve.
@param interpolationEntityForward Interpolation entity used ... | [
"Create",
"a",
"forward",
"curve",
"from",
"given",
"times",
"and",
"given",
"forwards",
"."
] | train | https://github.com/finmath/finmath-lib/blob/a3c067d52dd33feb97d851df6cab130e4116759f/src/main/java6/net/finmath/marketdata/model/curves/ForwardCurve.java#L208-L216 |
codelibs/fess | src/main/java/org/codelibs/fess/mylasta/action/FessMessages.java | FessMessages.addErrorsCrudFailedToUpdateCrudTable | public FessMessages addErrorsCrudFailedToUpdateCrudTable(String property, String arg0) {
"""
Add the created action message for the key 'errors.crud_failed_to_update_crud_table' with parameters.
<pre>
message: Failed to update the data. ({0})
</pre>
@param property The property name for the message. (NotNull)
... | java | public FessMessages addErrorsCrudFailedToUpdateCrudTable(String property, String arg0) {
assertPropertyNotNull(property);
add(property, new UserMessage(ERRORS_crud_failed_to_update_crud_table, arg0));
return this;
} | [
"public",
"FessMessages",
"addErrorsCrudFailedToUpdateCrudTable",
"(",
"String",
"property",
",",
"String",
"arg0",
")",
"{",
"assertPropertyNotNull",
"(",
"property",
")",
";",
"add",
"(",
"property",
",",
"new",
"UserMessage",
"(",
"ERRORS_crud_failed_to_update_crud_t... | Add the created action message for the key 'errors.crud_failed_to_update_crud_table' with parameters.
<pre>
message: Failed to update the data. ({0})
</pre>
@param property The property name for the message. (NotNull)
@param arg0 The parameter arg0 for message. (NotNull)
@return this. (NotNull) | [
"Add",
"the",
"created",
"action",
"message",
"for",
"the",
"key",
"errors",
".",
"crud_failed_to_update_crud_table",
"with",
"parameters",
".",
"<pre",
">",
"message",
":",
"Failed",
"to",
"update",
"the",
"data",
".",
"(",
"{",
"0",
"}",
")",
"<",
"/",
... | train | https://github.com/codelibs/fess/blob/e5e4b722549d32a4958dfd94965b21937bfe64cf/src/main/java/org/codelibs/fess/mylasta/action/FessMessages.java#L2140-L2144 |
alkacon/opencms-core | src/org/opencms/acacia/shared/CmsEntity.java | CmsEntity.insertAttributeValue | public void insertAttributeValue(String attributeName, CmsEntity value, int index) {
"""
Inserts a new attribute value at the given index.<p>
@param attributeName the attribute name
@param value the attribute value
@param index the value index
"""
if (m_entityAttributes.containsKey(attributeNam... | java | public void insertAttributeValue(String attributeName, CmsEntity value, int index) {
if (m_entityAttributes.containsKey(attributeName)) {
m_entityAttributes.get(attributeName).add(index, value);
} else {
setAttributeValue(attributeName, value);
}
registerC... | [
"public",
"void",
"insertAttributeValue",
"(",
"String",
"attributeName",
",",
"CmsEntity",
"value",
",",
"int",
"index",
")",
"{",
"if",
"(",
"m_entityAttributes",
".",
"containsKey",
"(",
"attributeName",
")",
")",
"{",
"m_entityAttributes",
".",
"get",
"(",
... | Inserts a new attribute value at the given index.<p>
@param attributeName the attribute name
@param value the attribute value
@param index the value index | [
"Inserts",
"a",
"new",
"attribute",
"value",
"at",
"the",
"given",
"index",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/acacia/shared/CmsEntity.java#L491-L500 |
apache/groovy | src/main/groovy/groovy/beans/VetoableASTTransformation.java | VetoableASTTransformation.createConstrainedStatement | protected Statement createConstrainedStatement(PropertyNode propertyNode, Expression fieldExpression) {
"""
Creates a statement body similar to:
<code>this.fireVetoableChange("field", field, field = value)</code>
@param propertyNode the field node for the property
@param fieldExpression a field expr... | java | protected Statement createConstrainedStatement(PropertyNode propertyNode, Expression fieldExpression) {
return stmt(callThisX("fireVetoableChange", args(constX(propertyNode.getName()), fieldExpression, varX("value"))));
} | [
"protected",
"Statement",
"createConstrainedStatement",
"(",
"PropertyNode",
"propertyNode",
",",
"Expression",
"fieldExpression",
")",
"{",
"return",
"stmt",
"(",
"callThisX",
"(",
"\"fireVetoableChange\"",
",",
"args",
"(",
"constX",
"(",
"propertyNode",
".",
"getNa... | Creates a statement body similar to:
<code>this.fireVetoableChange("field", field, field = value)</code>
@param propertyNode the field node for the property
@param fieldExpression a field expression for setting the property value
@return the created statement | [
"Creates",
"a",
"statement",
"body",
"similar",
"to",
":",
"<code",
">",
"this",
".",
"fireVetoableChange",
"(",
"field",
"field",
"field",
"=",
"value",
")",
"<",
"/",
"code",
">"
] | train | https://github.com/apache/groovy/blob/71cf20addb611bb8d097a59e395fd20bc7f31772/src/main/groovy/groovy/beans/VetoableASTTransformation.java#L238-L240 |
cdk/cdk | misc/extra/src/main/java/org/openscience/cdk/tools/GridGenerator.java | GridGenerator.getCoordinatesFromGridPoint | public Point3d getCoordinatesFromGridPoint(int gridPoint) {
"""
Method calculates coordinates from a given grid array position.
"""
int dimCounter = 0;
Point3d point = new Point3d(0, 0, 0);
for (int z = 0; z < grid[0][0].length; z++) {
for (int y = 0; y < grid[0].length; y++... | java | public Point3d getCoordinatesFromGridPoint(int gridPoint) {
int dimCounter = 0;
Point3d point = new Point3d(0, 0, 0);
for (int z = 0; z < grid[0][0].length; z++) {
for (int y = 0; y < grid[0].length; y++) {
for (int x = 0; x < grid.length; x++) {
i... | [
"public",
"Point3d",
"getCoordinatesFromGridPoint",
"(",
"int",
"gridPoint",
")",
"{",
"int",
"dimCounter",
"=",
"0",
";",
"Point3d",
"point",
"=",
"new",
"Point3d",
"(",
"0",
",",
"0",
",",
"0",
")",
";",
"for",
"(",
"int",
"z",
"=",
"0",
";",
"z",
... | Method calculates coordinates from a given grid array position. | [
"Method",
"calculates",
"coordinates",
"from",
"a",
"given",
"grid",
"array",
"position",
"."
] | train | https://github.com/cdk/cdk/blob/c3d0f16502bf08df50365fee392e11d7c9856657/misc/extra/src/main/java/org/openscience/cdk/tools/GridGenerator.java#L200-L217 |
finmath/finmath-lib | src/main/java/net/finmath/marketdata/model/curves/DiscountCurveInterpolation.java | DiscountCurveInterpolation.createDiscountCurveFromDiscountFactors | public static DiscountCurveInterpolation createDiscountCurveFromDiscountFactors(
String name, LocalDate referenceDate,
double[] times, double[] givenDiscountFactors, boolean[] isParameter,
InterpolationMethod interpolationMethod, ExtrapolationMethod extrapolationMethod, InterpolationEntity interpolationEntity)... | java | public static DiscountCurveInterpolation createDiscountCurveFromDiscountFactors(
String name, LocalDate referenceDate,
double[] times, double[] givenDiscountFactors, boolean[] isParameter,
InterpolationMethod interpolationMethod, ExtrapolationMethod extrapolationMethod, InterpolationEntity interpolationEntity)... | [
"public",
"static",
"DiscountCurveInterpolation",
"createDiscountCurveFromDiscountFactors",
"(",
"String",
"name",
",",
"LocalDate",
"referenceDate",
",",
"double",
"[",
"]",
"times",
",",
"double",
"[",
"]",
"givenDiscountFactors",
",",
"boolean",
"[",
"]",
"isParame... | Create a discount curve from given times and given discount factors using given interpolation and extrapolation methods.
@param name The name of this discount curve.
@param referenceDate The reference date for this curve, i.e., the date which defined t=0.
@param times Array of times as doubles.
@param givenDiscountFac... | [
"Create",
"a",
"discount",
"curve",
"from",
"given",
"times",
"and",
"given",
"discount",
"factors",
"using",
"given",
"interpolation",
"and",
"extrapolation",
"methods",
"."
] | train | https://github.com/finmath/finmath-lib/blob/a3c067d52dd33feb97d851df6cab130e4116759f/src/main/java/net/finmath/marketdata/model/curves/DiscountCurveInterpolation.java#L89-L101 |
sarl/sarl | sre/io.janusproject/io.janusproject.eclipse/src/io/janusproject/eclipse/JanusEclipsePlugin.java | JanusEclipsePlugin.createStatus | @SuppressWarnings("static-method")
public IStatus createStatus(int severity, String message) {
"""
Create a status.
@param severity the severity level, see {@link IStatus}.
@param message the message associated to the status.
@return the status.
"""
return new Status(severity, PLUGIN_ID, message);
} | java | @SuppressWarnings("static-method")
public IStatus createStatus(int severity, String message) {
return new Status(severity, PLUGIN_ID, message);
} | [
"@",
"SuppressWarnings",
"(",
"\"static-method\"",
")",
"public",
"IStatus",
"createStatus",
"(",
"int",
"severity",
",",
"String",
"message",
")",
"{",
"return",
"new",
"Status",
"(",
"severity",
",",
"PLUGIN_ID",
",",
"message",
")",
";",
"}"
] | Create a status.
@param severity the severity level, see {@link IStatus}.
@param message the message associated to the status.
@return the status. | [
"Create",
"a",
"status",
"."
] | train | https://github.com/sarl/sarl/blob/ca00ff994598c730339972def4e19a60e0b8cace/sre/io.janusproject/io.janusproject.eclipse/src/io/janusproject/eclipse/JanusEclipsePlugin.java#L139-L142 |
lessthanoptimal/BoofCV | main/boofcv-sfm/src/main/java/boofcv/alg/sfm/d3/VisOdomMonoPlaneInfinity.java | VisOdomMonoPlaneInfinity.addNewTracks | private void addNewTracks() {
"""
Requests that new tracks are spawned, determines if they are on the plane or not, and computes other required
data structures.
"""
tracker.spawnTracks();
List<PointTrack> spawned = tracker.getNewTracks(null);
// estimate 3D coordinate using stereo vision
for (PointTr... | java | private void addNewTracks() {
tracker.spawnTracks();
List<PointTrack> spawned = tracker.getNewTracks(null);
// estimate 3D coordinate using stereo vision
for (PointTrack t : spawned) {
// System.out.println("track spawn "+t.x+" "+t.y);
VoTrack p = t.getCookie();
if (p == null) {
t.cookie = p = new ... | [
"private",
"void",
"addNewTracks",
"(",
")",
"{",
"tracker",
".",
"spawnTracks",
"(",
")",
";",
"List",
"<",
"PointTrack",
">",
"spawned",
"=",
"tracker",
".",
"getNewTracks",
"(",
"null",
")",
";",
"// estimate 3D coordinate using stereo vision",
"for",
"(",
... | Requests that new tracks are spawned, determines if they are on the plane or not, and computes other required
data structures. | [
"Requests",
"that",
"new",
"tracks",
"are",
"spawned",
"determines",
"if",
"they",
"are",
"on",
"the",
"plane",
"or",
"not",
"and",
"computes",
"other",
"required",
"data",
"structures",
"."
] | train | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-sfm/src/main/java/boofcv/alg/sfm/d3/VisOdomMonoPlaneInfinity.java#L261-L306 |
thinkaurelius/titan | titan-core/src/main/java/com/thinkaurelius/titan/core/TitanFactory.java | TitanFactory.startTransactionRecovery | public static TransactionRecovery startTransactionRecovery(TitanGraph graph, Instant start) {
"""
Returns a {@link TransactionRecovery} process for recovering partially failed transactions. The recovery process
will start processing the write-ahead transaction log at the specified transaction time.
@param grap... | java | public static TransactionRecovery startTransactionRecovery(TitanGraph graph, Instant start) {
return new StandardTransactionLogProcessor((StandardTitanGraph)graph, start);
} | [
"public",
"static",
"TransactionRecovery",
"startTransactionRecovery",
"(",
"TitanGraph",
"graph",
",",
"Instant",
"start",
")",
"{",
"return",
"new",
"StandardTransactionLogProcessor",
"(",
"(",
"StandardTitanGraph",
")",
"graph",
",",
"start",
")",
";",
"}"
] | Returns a {@link TransactionRecovery} process for recovering partially failed transactions. The recovery process
will start processing the write-ahead transaction log at the specified transaction time.
@param graph
@param start
@return | [
"Returns",
"a",
"{",
"@link",
"TransactionRecovery",
"}",
"process",
"for",
"recovering",
"partially",
"failed",
"transactions",
".",
"The",
"recovery",
"process",
"will",
"start",
"processing",
"the",
"write",
"-",
"ahead",
"transaction",
"log",
"at",
"the",
"s... | train | https://github.com/thinkaurelius/titan/blob/ee226e52415b8bf43b700afac75fa5b9767993a5/titan-core/src/main/java/com/thinkaurelius/titan/core/TitanFactory.java#L164-L166 |
Azure/azure-sdk-for-java | batch/data-plane/src/main/java/com/microsoft/azure/batch/JobOperations.java | JobOperations.getJob | public CloudJob getJob(String jobId) throws BatchErrorException, IOException {
"""
Gets the specified {@link CloudJob}.
@param jobId The ID of the job to get.
@return A {@link CloudJob} containing information about the specified Azure Batch job.
@throws BatchErrorException Exception thrown when an error respo... | java | public CloudJob getJob(String jobId) throws BatchErrorException, IOException {
return getJob(jobId, null, null);
} | [
"public",
"CloudJob",
"getJob",
"(",
"String",
"jobId",
")",
"throws",
"BatchErrorException",
",",
"IOException",
"{",
"return",
"getJob",
"(",
"jobId",
",",
"null",
",",
"null",
")",
";",
"}"
] | Gets the specified {@link CloudJob}.
@param jobId The ID of the job to get.
@return A {@link CloudJob} containing information about the specified Azure Batch job.
@throws BatchErrorException Exception thrown when an error response is received from the Batch service.
@throws IOException Exception thrown when there is a... | [
"Gets",
"the",
"specified",
"{",
"@link",
"CloudJob",
"}",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/batch/data-plane/src/main/java/com/microsoft/azure/batch/JobOperations.java#L114-L116 |
google/error-prone-javac | src/jdk.javadoc/share/classes/com/sun/tools/doclets/internal/toolkit/builders/AnnotationTypeRequiredMemberBuilder.java | AnnotationTypeRequiredMemberBuilder.buildDeprecationInfo | public void buildDeprecationInfo(XMLNode node, Content annotationDocTree) {
"""
Build the deprecation information.
@param node the XML element that specifies which components to document
@param annotationDocTree the content tree to which the documentation will be added
"""
writer.addDeprecated((Mem... | java | public void buildDeprecationInfo(XMLNode node, Content annotationDocTree) {
writer.addDeprecated((MemberDoc) members.get(currentMemberIndex),
annotationDocTree);
} | [
"public",
"void",
"buildDeprecationInfo",
"(",
"XMLNode",
"node",
",",
"Content",
"annotationDocTree",
")",
"{",
"writer",
".",
"addDeprecated",
"(",
"(",
"MemberDoc",
")",
"members",
".",
"get",
"(",
"currentMemberIndex",
")",
",",
"annotationDocTree",
")",
";"... | Build the deprecation information.
@param node the XML element that specifies which components to document
@param annotationDocTree the content tree to which the documentation will be added | [
"Build",
"the",
"deprecation",
"information",
"."
] | train | https://github.com/google/error-prone-javac/blob/a53d069bbdb2c60232ed3811c19b65e41c3e60e0/src/jdk.javadoc/share/classes/com/sun/tools/doclets/internal/toolkit/builders/AnnotationTypeRequiredMemberBuilder.java#L202-L205 |
GerdHolz/TOVAL | src/de/invation/code/toval/time/TimeUtils.java | TimeUtils.futureFromDate | public static Date futureFromDate(Date date, TimeValue value, boolean clearTimeOfDay) {
"""
Caution: Difference calculation is based on adding/subtracting milliseconds and omits time zones.<br>
In some cases the method might return possibly unexpected results due to time zones.<br>
When for example to the last d... | java | public static Date futureFromDate(Date date, TimeValue value, boolean clearTimeOfDay){
return diffFromDate(date, value.getValueInMilliseconds(), clearTimeOfDay);
} | [
"public",
"static",
"Date",
"futureFromDate",
"(",
"Date",
"date",
",",
"TimeValue",
"value",
",",
"boolean",
"clearTimeOfDay",
")",
"{",
"return",
"diffFromDate",
"(",
"date",
",",
"value",
".",
"getValueInMilliseconds",
"(",
")",
",",
"clearTimeOfDay",
")",
... | Caution: Difference calculation is based on adding/subtracting milliseconds and omits time zones.<br>
In some cases the method might return possibly unexpected results due to time zones.<br>
When for example to the last day of CEST without time of day information (in 2016: 30.10.2016 00:00:00 000) milliseconds for one ... | [
"Caution",
":",
"Difference",
"calculation",
"is",
"based",
"on",
"adding",
"/",
"subtracting",
"milliseconds",
"and",
"omits",
"time",
"zones",
".",
"<br",
">",
"In",
"some",
"cases",
"the",
"method",
"might",
"return",
"possibly",
"unexpected",
"results",
"d... | train | https://github.com/GerdHolz/TOVAL/blob/036922cdfd710fa53b18e5dbe1e07f226f731fde/src/de/invation/code/toval/time/TimeUtils.java#L108-L110 |
OrienteerBAP/wicket-orientdb | wicket-orientdb/src/main/java/ru/ydn/wicket/wicketorientdb/utils/OSchemaHelper.java | OSchemaHelper.oDocument | public OSchemaHelper oDocument(String pkField, Object pkValue) {
"""
Create an {@link ODocument} if required of an current class.
Existance of an document checked by specified primary key field name and required value
@param pkField primary key field name
@param pkValue required primary key value
@return this ... | java | public OSchemaHelper oDocument(String pkField, Object pkValue)
{
checkOClass();
List<ODocument> docs = db.query(new OSQLSynchQuery<ODocument>("select from "+lastClass.getName()+" where "+pkField+" = ?", 1), pkValue);
if(docs!=null && !docs.isEmpty())
{
lastDocument = docs.get(0);
}
else
{
lastDocum... | [
"public",
"OSchemaHelper",
"oDocument",
"(",
"String",
"pkField",
",",
"Object",
"pkValue",
")",
"{",
"checkOClass",
"(",
")",
";",
"List",
"<",
"ODocument",
">",
"docs",
"=",
"db",
".",
"query",
"(",
"new",
"OSQLSynchQuery",
"<",
"ODocument",
">",
"(",
... | Create an {@link ODocument} if required of an current class.
Existance of an document checked by specified primary key field name and required value
@param pkField primary key field name
@param pkValue required primary key value
@return this helper | [
"Create",
"an",
"{"
] | train | https://github.com/OrienteerBAP/wicket-orientdb/blob/eb1d94f00a6bff9e266c5c032baa6043afc1db92/wicket-orientdb/src/main/java/ru/ydn/wicket/wicketorientdb/utils/OSchemaHelper.java#L323-L337 |
demidenko05/beigesoft-webstore | src/main/java/org/beigesoft/webstore/processor/PrcRefreshItemsInList.java | PrcRefreshItemsInList.createItemInList | protected final <I extends IHasIdLongVersionName> ItemInList createItemInList(final Map<String, Object> pReqVars, final I pItem) throws Exception {
"""
<p>Create ItemInList for item.</p>
@param <I> item type
@param pReqVars additional param
@param pItem Item
@return ItemInList
@throws Exception - an exception... | java | protected final <I extends IHasIdLongVersionName> ItemInList createItemInList(final Map<String, Object> pReqVars, final I pItem) throws Exception {
ItemInList itemInList = new ItemInList();
itemInList.setIsNew(true);
EShopItemType itemType;
if (pItem.getClass() == InvItem.class) {
itemType = EShop... | [
"protected",
"final",
"<",
"I",
"extends",
"IHasIdLongVersionName",
">",
"ItemInList",
"createItemInList",
"(",
"final",
"Map",
"<",
"String",
",",
"Object",
">",
"pReqVars",
",",
"final",
"I",
"pItem",
")",
"throws",
"Exception",
"{",
"ItemInList",
"itemInList"... | <p>Create ItemInList for item.</p>
@param <I> item type
@param pReqVars additional param
@param pItem Item
@return ItemInList
@throws Exception - an exception | [
"<p",
">",
"Create",
"ItemInList",
"for",
"item",
".",
"<",
"/",
"p",
">"
] | train | https://github.com/demidenko05/beigesoft-webstore/blob/41ed2e2f1c640d37951d5fb235f26856008b87e1/src/main/java/org/beigesoft/webstore/processor/PrcRefreshItemsInList.java#L1202-L1222 |
MariaDB/mariadb-connector-j | src/main/java/org/mariadb/jdbc/MariaDbStatement.java | MariaDbStatement.executeInternal | private boolean executeInternal(String sql, int fetchSize, int autoGeneratedKeys)
throws SQLException {
"""
Executes a query.
@param sql the query
@param fetchSize fetch size
@param autoGeneratedKeys a flag indicating whether auto-generated keys should be returned; one
of
<code>S... | java | private boolean executeInternal(String sql, int fetchSize, int autoGeneratedKeys)
throws SQLException {
lock.lock();
try {
executeQueryPrologue(false);
results = new Results(this,
fetchSize,
false,
1,
false,
resultSetScrollType,
res... | [
"private",
"boolean",
"executeInternal",
"(",
"String",
"sql",
",",
"int",
"fetchSize",
",",
"int",
"autoGeneratedKeys",
")",
"throws",
"SQLException",
"{",
"lock",
".",
"lock",
"(",
")",
";",
"try",
"{",
"executeQueryPrologue",
"(",
"false",
")",
";",
"resu... | Executes a query.
@param sql the query
@param fetchSize fetch size
@param autoGeneratedKeys a flag indicating whether auto-generated keys should be returned; one
of
<code>Statement.RETURN_GENERATED_KEYS</code>
or <code>Statement.NO_GENERATED_KEYS</code>
@return true if there was a result set, fal... | [
"Executes",
"a",
"query",
"."
] | train | https://github.com/MariaDB/mariadb-connector-j/blob/d148c7cd347c4680617be65d9e511b289d38a30b/src/main/java/org/mariadb/jdbc/MariaDbStatement.java#L304-L333 |
Azure/azure-sdk-for-java | batch/data-plane/src/main/java/com/microsoft/azure/batch/protocol/implementation/TasksImpl.java | TasksImpl.updateAsync | public Observable<Void> updateAsync(String jobId, String taskId) {
"""
Updates the properties of the specified task.
@param jobId The ID of the job containing the task.
@param taskId The ID of the task to update.
@throws IllegalArgumentException thrown if parameters fail the validation
@return the {@link Ser... | java | public Observable<Void> updateAsync(String jobId, String taskId) {
return updateWithServiceResponseAsync(jobId, taskId).map(new Func1<ServiceResponseWithHeaders<Void, TaskUpdateHeaders>, Void>() {
@Override
public Void call(ServiceResponseWithHeaders<Void, TaskUpdateHeaders> response) {
... | [
"public",
"Observable",
"<",
"Void",
">",
"updateAsync",
"(",
"String",
"jobId",
",",
"String",
"taskId",
")",
"{",
"return",
"updateWithServiceResponseAsync",
"(",
"jobId",
",",
"taskId",
")",
".",
"map",
"(",
"new",
"Func1",
"<",
"ServiceResponseWithHeaders",
... | Updates the properties of the specified task.
@param jobId The ID of the job containing the task.
@param taskId The ID of the task to update.
@throws IllegalArgumentException thrown if parameters fail the validation
@return the {@link ServiceResponseWithHeaders} object if successful. | [
"Updates",
"the",
"properties",
"of",
"the",
"specified",
"task",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/batch/data-plane/src/main/java/com/microsoft/azure/batch/protocol/implementation/TasksImpl.java#L1402-L1409 |
alkacon/opencms-core | src-modules/org/opencms/workplace/commons/CmsHistoryList.java | CmsHistoryList.fillDetailProject | private void fillDetailProject(CmsListItem item, String detailId) {
"""
Fills details of the project into the given item. <p>
@param item the list item to fill
@param detailId the id for the detail to fill
"""
StringBuffer html = new StringBuffer();
// search /read for the corresponding... | java | private void fillDetailProject(CmsListItem item, String detailId) {
StringBuffer html = new StringBuffer();
// search /read for the corresponding history project: it's tag id transmitted from getListItems()
// in a hidden column
Object tagIdObj = item.get(LIST_COLUMN_PUBLISH_TAG);
... | [
"private",
"void",
"fillDetailProject",
"(",
"CmsListItem",
"item",
",",
"String",
"detailId",
")",
"{",
"StringBuffer",
"html",
"=",
"new",
"StringBuffer",
"(",
")",
";",
"// search /read for the corresponding history project: it's tag id transmitted from getListItems()",
"/... | Fills details of the project into the given item. <p>
@param item the list item to fill
@param detailId the id for the detail to fill | [
"Fills",
"details",
"of",
"the",
"project",
"into",
"the",
"given",
"item",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src-modules/org/opencms/workplace/commons/CmsHistoryList.java#L871-L890 |
mockito/mockito | src/main/java/org/mockito/internal/configuration/plugins/PluginLoader.java | PluginLoader.loadPlugin | @SuppressWarnings("unchecked")
<PreferredType, AlternateType> Object loadPlugin(final Class<PreferredType> preferredPluginType, final Class<AlternateType> alternatePluginType) {
"""
Scans the classpath for given {@code preferredPluginType}. If not found scan for {@code
alternatePluginType}. If neither a prefe... | java | @SuppressWarnings("unchecked")
<PreferredType, AlternateType> Object loadPlugin(final Class<PreferredType> preferredPluginType, final Class<AlternateType> alternatePluginType) {
try {
PreferredType preferredPlugin = initializer.loadImpl(preferredPluginType);
if (preferredPlugin != nu... | [
"@",
"SuppressWarnings",
"(",
"\"unchecked\"",
")",
"<",
"PreferredType",
",",
"AlternateType",
">",
"Object",
"loadPlugin",
"(",
"final",
"Class",
"<",
"PreferredType",
">",
"preferredPluginType",
",",
"final",
"Class",
"<",
"AlternateType",
">",
"alternatePluginTy... | Scans the classpath for given {@code preferredPluginType}. If not found scan for {@code
alternatePluginType}. If neither a preferred or alternate plugin is found, default to default
class of {@code preferredPluginType}.
@return An object of either {@code preferredPluginType} or {@code alternatePluginType} | [
"Scans",
"the",
"classpath",
"for",
"given",
"{",
"@code",
"preferredPluginType",
"}",
".",
"If",
"not",
"found",
"scan",
"for",
"{",
"@code",
"alternatePluginType",
"}",
".",
"If",
"neither",
"a",
"preferred",
"or",
"alternate",
"plugin",
"is",
"found",
"de... | train | https://github.com/mockito/mockito/blob/c5e2b80af76e3192cae7c9550b70c4d1ab312034/src/main/java/org/mockito/internal/configuration/plugins/PluginLoader.java#L54-L78 |
apache/incubator-shardingsphere | sharding-proxy/sharding-proxy-backend/src/main/java/org/apache/shardingsphere/shardingproxy/backend/communication/DatabaseCommunicationEngineFactory.java | DatabaseCommunicationEngineFactory.newBinaryProtocolInstance | public DatabaseCommunicationEngine newBinaryProtocolInstance(final LogicSchema logicSchema, final String sql, final List<Object> parameters, final BackendConnection backendConnection) {
"""
Create new instance of text protocol backend handler.
@param logicSchema logic schema
@param sql SQL to be executed
@par... | java | public DatabaseCommunicationEngine newBinaryProtocolInstance(final LogicSchema logicSchema, final String sql, final List<Object> parameters, final BackendConnection backendConnection) {
return new JDBCDatabaseCommunicationEngine(logicSchema, sql, new JDBCExecuteEngine(backendConnection, new PreparedStatementExe... | [
"public",
"DatabaseCommunicationEngine",
"newBinaryProtocolInstance",
"(",
"final",
"LogicSchema",
"logicSchema",
",",
"final",
"String",
"sql",
",",
"final",
"List",
"<",
"Object",
">",
"parameters",
",",
"final",
"BackendConnection",
"backendConnection",
")",
"{",
"... | Create new instance of text protocol backend handler.
@param logicSchema logic schema
@param sql SQL to be executed
@param parameters SQL parameters
@param backendConnection backend connection
@return instance of text protocol backend handler | [
"Create",
"new",
"instance",
"of",
"text",
"protocol",
"backend",
"handler",
"."
] | train | https://github.com/apache/incubator-shardingsphere/blob/f88fd29fc345dfb31fdce12e9e96cbfa0fd2402d/sharding-proxy/sharding-proxy-backend/src/main/java/org/apache/shardingsphere/shardingproxy/backend/communication/DatabaseCommunicationEngineFactory.java#L73-L75 |
census-instrumentation/opencensus-java | impl_core/src/main/java/io/opencensus/implcore/internal/VarInt.java | VarInt.getVarInt | public static int getVarInt(byte[] src, int offset, int[] dst) {
"""
Reads a varint from src, places its values into the first element of dst and returns the offset
in to src of the first byte after the varint.
@param src source buffer to retrieve from
@param offset offset within src
@param dst the resulting... | java | public static int getVarInt(byte[] src, int offset, int[] dst) {
int result = 0;
int shift = 0;
int b;
do {
if (shift >= 32) {
// Out of range
throw new IndexOutOfBoundsException("varint too long");
}
// Get 7 bits from next byte
b = src[offset++];
result |=... | [
"public",
"static",
"int",
"getVarInt",
"(",
"byte",
"[",
"]",
"src",
",",
"int",
"offset",
",",
"int",
"[",
"]",
"dst",
")",
"{",
"int",
"result",
"=",
"0",
";",
"int",
"shift",
"=",
"0",
";",
"int",
"b",
";",
"do",
"{",
"if",
"(",
"shift",
... | Reads a varint from src, places its values into the first element of dst and returns the offset
in to src of the first byte after the varint.
@param src source buffer to retrieve from
@param offset offset within src
@param dst the resulting int value
@return the updated offset after reading the varint | [
"Reads",
"a",
"varint",
"from",
"src",
"places",
"its",
"values",
"into",
"the",
"first",
"element",
"of",
"dst",
"and",
"returns",
"the",
"offset",
"in",
"to",
"src",
"of",
"the",
"first",
"byte",
"after",
"the",
"varint",
"."
] | train | https://github.com/census-instrumentation/opencensus-java/blob/deefac9bed77e40a2297bff1ca5ec5aa48a5f755/impl_core/src/main/java/io/opencensus/implcore/internal/VarInt.java#L61-L77 |
kiswanij/jk-util | src/main/java/com/jk/util/JKObjectUtil.java | JKObjectUtil.addItemToList | public static void addItemToList(final Object target, final String fieldName, final Object value) {
"""
Adds the item to list.
@param target the target
@param fieldName the field name
@param value the value
"""
try {
List list = (List) getFieldValue(target, fieldName);
list.add(value);
... | java | public static void addItemToList(final Object target, final String fieldName, final Object value) {
try {
List list = (List) getFieldValue(target, fieldName);
list.add(value);
} catch (Exception e) {
throw new RuntimeException(e);
}
} | [
"public",
"static",
"void",
"addItemToList",
"(",
"final",
"Object",
"target",
",",
"final",
"String",
"fieldName",
",",
"final",
"Object",
"value",
")",
"{",
"try",
"{",
"List",
"list",
"=",
"(",
"List",
")",
"getFieldValue",
"(",
"target",
",",
"fieldNam... | Adds the item to list.
@param target the target
@param fieldName the field name
@param value the value | [
"Adds",
"the",
"item",
"to",
"list",
"."
] | train | https://github.com/kiswanij/jk-util/blob/8e0c85818423406f769444c76194a748e0a0fc0a/src/main/java/com/jk/util/JKObjectUtil.java#L284-L291 |
dlemmermann/CalendarFX | CalendarFXGoogle/src/main/java/com/calendarfx/google/service/GoogleCalendarService.java | GoogleCalendarService.deleteEntry | public void deleteEntry(GoogleEntry entry, GoogleCalendar calendar) throws IOException {
"""
Sends a delete request to the google server for the given entry.
@param entry The entry to be deleted from the backend google calendar.
@param calendar The calendar from the entry was deleted.
@throws IOException For ... | java | public void deleteEntry(GoogleEntry entry, GoogleCalendar calendar) throws IOException {
dao.events().delete(calendar.getId(), entry.getId()).execute();
} | [
"public",
"void",
"deleteEntry",
"(",
"GoogleEntry",
"entry",
",",
"GoogleCalendar",
"calendar",
")",
"throws",
"IOException",
"{",
"dao",
".",
"events",
"(",
")",
".",
"delete",
"(",
"calendar",
".",
"getId",
"(",
")",
",",
"entry",
".",
"getId",
"(",
"... | Sends a delete request to the google server for the given entry.
@param entry The entry to be deleted from the backend google calendar.
@param calendar The calendar from the entry was deleted.
@throws IOException For unexpected errors. | [
"Sends",
"a",
"delete",
"request",
"to",
"the",
"google",
"server",
"for",
"the",
"given",
"entry",
"."
] | train | https://github.com/dlemmermann/CalendarFX/blob/f2b91c2622c3f29d004485b6426b23b86c331f96/CalendarFXGoogle/src/main/java/com/calendarfx/google/service/GoogleCalendarService.java#L127-L129 |
GCRC/nunaliit | nunaliit2-jdbc/src/main/java/ca/carleton/gcrc/jdbc/JdbcConnections.java | JdbcConnections.getDb | synchronized public Connection getDb(String db) throws Exception {
"""
This method checks for the presence of a Connection associated with the input db parameter.
It attempts to create the Connection and adds it to the connection map if it does not
already exist. If the Connection exists or is created, it is re... | java | synchronized public Connection getDb(String db) throws Exception {
Connection con = null;
if (nameToConnection.containsKey(db)) {
con = nameToConnection.get(db);
} else {
ConnectionInfo info = nameToInfo.get(db);
if( null == info ) {
throw new Exception("No information provided for database named... | [
"synchronized",
"public",
"Connection",
"getDb",
"(",
"String",
"db",
")",
"throws",
"Exception",
"{",
"Connection",
"con",
"=",
"null",
";",
"if",
"(",
"nameToConnection",
".",
"containsKey",
"(",
"db",
")",
")",
"{",
"con",
"=",
"nameToConnection",
".",
... | This method checks for the presence of a Connection associated with the input db parameter.
It attempts to create the Connection and adds it to the connection map if it does not
already exist. If the Connection exists or is created, it is returned.
@param db database name.
@return Returns the desired Connection insta... | [
"This",
"method",
"checks",
"for",
"the",
"presence",
"of",
"a",
"Connection",
"associated",
"with",
"the",
"input",
"db",
"parameter",
".",
"It",
"attempts",
"to",
"create",
"the",
"Connection",
"and",
"adds",
"it",
"to",
"the",
"connection",
"map",
"if",
... | train | https://github.com/GCRC/nunaliit/blob/0b4abfc64eef2eb8b94f852ce697de2e851d8e67/nunaliit2-jdbc/src/main/java/ca/carleton/gcrc/jdbc/JdbcConnections.java#L149-L175 |
deeplearning4j/deeplearning4j | nd4j/nd4j-backends/nd4j-api-parent/nd4j-api/src/main/java/org/nd4j/linalg/api/ops/performance/PerformanceTracker.java | PerformanceTracker.addMemoryTransaction | public long addMemoryTransaction(int deviceId, long timeSpentNanos, long numberOfBytes) {
"""
This method stores bandwidth used for given transaction.
PLEASE NOTE: Bandwidth is stored in per millisecond value.
@param deviceId device used for this transaction
@param timeSpent time spent on this transaction i... | java | public long addMemoryTransaction(int deviceId, long timeSpentNanos, long numberOfBytes) {
// default is H2H transaction
return addMemoryTransaction(deviceId, timeSpentNanos, numberOfBytes, MemcpyDirection.HOST_TO_HOST);
} | [
"public",
"long",
"addMemoryTransaction",
"(",
"int",
"deviceId",
",",
"long",
"timeSpentNanos",
",",
"long",
"numberOfBytes",
")",
"{",
"// default is H2H transaction",
"return",
"addMemoryTransaction",
"(",
"deviceId",
",",
"timeSpentNanos",
",",
"numberOfBytes",
",",... | This method stores bandwidth used for given transaction.
PLEASE NOTE: Bandwidth is stored in per millisecond value.
@param deviceId device used for this transaction
@param timeSpent time spent on this transaction in nanoseconds
@param numberOfBytes number of bytes | [
"This",
"method",
"stores",
"bandwidth",
"used",
"for",
"given",
"transaction",
"."
] | train | https://github.com/deeplearning4j/deeplearning4j/blob/effce52f2afd7eeb53c5bcca699fcd90bd06822f/nd4j/nd4j-backends/nd4j-api-parent/nd4j-api/src/main/java/org/nd4j/linalg/api/ops/performance/PerformanceTracker.java#L64-L67 |
OpenLiberty/open-liberty | dev/com.ibm.ws.management.j2ee.mejb/src/com/ibm/ws/management/j2ee/mejb/ManagementEJB.java | ManagementEJB.getAttribute | public Object getAttribute(ObjectName name, String attribute)
throws MBeanException, AttributeNotFoundException, InstanceNotFoundException,
ReflectionException {
"""
/*
Gets the value of a specific attribute of a named managed object. The
managed object is identified by it... | java | public Object getAttribute(ObjectName name, String attribute)
throws MBeanException, AttributeNotFoundException, InstanceNotFoundException,
ReflectionException {
Object o = getMBeanServer().getAttribute(name, attribute);
return o;
} | [
"public",
"Object",
"getAttribute",
"(",
"ObjectName",
"name",
",",
"String",
"attribute",
")",
"throws",
"MBeanException",
",",
"AttributeNotFoundException",
",",
"InstanceNotFoundException",
",",
"ReflectionException",
"{",
"Object",
"o",
"=",
"getMBeanServer",
"(",
... | /*
Gets the value of a specific attribute of a named managed object. The
managed object is identified by its object name.
Throws:
javax.management.MBeanException
javax.management.AttributeNotFoundException
javax.management.InstanceNotFoundException
javax.management.ReflectionException
java.rmi.RemoteException
Parameter... | [
"/",
"*",
"Gets",
"the",
"value",
"of",
"a",
"specific",
"attribute",
"of",
"a",
"named",
"managed",
"object",
".",
"The",
"managed",
"object",
"is",
"identified",
"by",
"its",
"object",
"name",
".",
"Throws",
":",
"javax",
".",
"management",
".",
"MBean... | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.management.j2ee.mejb/src/com/ibm/ws/management/j2ee/mejb/ManagementEJB.java#L171-L178 |
alkacon/opencms-core | src/org/opencms/db/CmsExportPointDriver.java | CmsExportPointDriver.writeFile | public void writeFile(String resourceName, String exportpoint, byte[] content) {
"""
Writes the file with the given root path to the real file system.<p>
If required, missing parent folders in the real file system are automatically created.<p>
@param resourceName the root path of the file to write
@param ex... | java | public void writeFile(String resourceName, String exportpoint, byte[] content) {
writeResource(resourceName, exportpoint, content);
} | [
"public",
"void",
"writeFile",
"(",
"String",
"resourceName",
",",
"String",
"exportpoint",
",",
"byte",
"[",
"]",
"content",
")",
"{",
"writeResource",
"(",
"resourceName",
",",
"exportpoint",
",",
"content",
")",
";",
"}"
] | Writes the file with the given root path to the real file system.<p>
If required, missing parent folders in the real file system are automatically created.<p>
@param resourceName the root path of the file to write
@param exportpoint the export point to write file to
@param content the contents of the file to write | [
"Writes",
"the",
"file",
"with",
"the",
"given",
"root",
"path",
"to",
"the",
"real",
"file",
"system",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/db/CmsExportPointDriver.java#L162-L165 |
Wadpam/guja | guja-core/src/main/java/com/wadpam/guja/oauth2/dao/GeneratedDUserDaoImpl.java | GeneratedDUserDaoImpl.queryByPreferredLanguage | public Iterable<DUser> queryByPreferredLanguage(java.lang.String preferredLanguage) {
"""
query-by method for field preferredLanguage
@param preferredLanguage the specified attribute
@return an Iterable of DUsers for the specified preferredLanguage
"""
return queryByField(null, DUserMapper.Field.PREFERRE... | java | public Iterable<DUser> queryByPreferredLanguage(java.lang.String preferredLanguage) {
return queryByField(null, DUserMapper.Field.PREFERREDLANGUAGE.getFieldName(), preferredLanguage);
} | [
"public",
"Iterable",
"<",
"DUser",
">",
"queryByPreferredLanguage",
"(",
"java",
".",
"lang",
".",
"String",
"preferredLanguage",
")",
"{",
"return",
"queryByField",
"(",
"null",
",",
"DUserMapper",
".",
"Field",
".",
"PREFERREDLANGUAGE",
".",
"getFieldName",
"... | query-by method for field preferredLanguage
@param preferredLanguage the specified attribute
@return an Iterable of DUsers for the specified preferredLanguage | [
"query",
"-",
"by",
"method",
"for",
"field",
"preferredLanguage"
] | train | https://github.com/Wadpam/guja/blob/eb8ba8e6794a96ea0dd9744cada4f9ad9618f114/guja-core/src/main/java/com/wadpam/guja/oauth2/dao/GeneratedDUserDaoImpl.java#L205-L207 |
matthewhorridge/owlapi-gwt | owlapi-gwt-serialization/src/main/java/uk/ac/manchester/cs/owl/owlapi/OWLSubPropertyChainAxiomImpl_CustomFieldSerializer.java | OWLSubPropertyChainAxiomImpl_CustomFieldSerializer.serializeInstance | @Override
public void serializeInstance(SerializationStreamWriter streamWriter, OWLSubPropertyChainAxiomImpl instance) throws SerializationException {
"""
Serializes the content of the object into the
{@link com.google.gwt.user.client.rpc.SerializationStreamWriter}.
@param streamWriter the {@link com.googl... | java | @Override
public void serializeInstance(SerializationStreamWriter streamWriter, OWLSubPropertyChainAxiomImpl instance) throws SerializationException {
serialize(streamWriter, instance);
} | [
"@",
"Override",
"public",
"void",
"serializeInstance",
"(",
"SerializationStreamWriter",
"streamWriter",
",",
"OWLSubPropertyChainAxiomImpl",
"instance",
")",
"throws",
"SerializationException",
"{",
"serialize",
"(",
"streamWriter",
",",
"instance",
")",
";",
"}"
] | Serializes the content of the object into the
{@link com.google.gwt.user.client.rpc.SerializationStreamWriter}.
@param streamWriter the {@link com.google.gwt.user.client.rpc.SerializationStreamWriter} to write the
object's content to
@param instance the object instance to serialize
@throws com.google.gwt.user.clie... | [
"Serializes",
"the",
"content",
"of",
"the",
"object",
"into",
"the",
"{",
"@link",
"com",
".",
"google",
".",
"gwt",
".",
"user",
".",
"client",
".",
"rpc",
".",
"SerializationStreamWriter",
"}",
"."
] | train | https://github.com/matthewhorridge/owlapi-gwt/blob/7ab975fb6cef3c8947099983551672a3b5d4e2fd/owlapi-gwt-serialization/src/main/java/uk/ac/manchester/cs/owl/owlapi/OWLSubPropertyChainAxiomImpl_CustomFieldSerializer.java#L77-L80 |
lucee/Lucee | core/src/main/java/lucee/commons/io/res/util/ResourceUtil.java | ResourceUtil.isEmptyDirectory | public static boolean isEmptyDirectory(Resource res, ResourceFilter filter) {
"""
return Boolean.True when directory is empty, Boolean.FALSE when directory s not empty and null if
directory does not exists
@param res
@return
"""
if (res.isDirectory()) {
Resource[] children = filter == null ? res.lis... | java | public static boolean isEmptyDirectory(Resource res, ResourceFilter filter) {
if (res.isDirectory()) {
Resource[] children = filter == null ? res.listResources() : res.listResources(filter);
if (children == null || children.length == 0) return true;
for (int i = 0; i < children.length; i++) {
if (chi... | [
"public",
"static",
"boolean",
"isEmptyDirectory",
"(",
"Resource",
"res",
",",
"ResourceFilter",
"filter",
")",
"{",
"if",
"(",
"res",
".",
"isDirectory",
"(",
")",
")",
"{",
"Resource",
"[",
"]",
"children",
"=",
"filter",
"==",
"null",
"?",
"res",
"."... | return Boolean.True when directory is empty, Boolean.FALSE when directory s not empty and null if
directory does not exists
@param res
@return | [
"return",
"Boolean",
".",
"True",
"when",
"directory",
"is",
"empty",
"Boolean",
".",
"FALSE",
"when",
"directory",
"s",
"not",
"empty",
"and",
"null",
"if",
"directory",
"does",
"not",
"exists"
] | train | https://github.com/lucee/Lucee/blob/29b153fc4e126e5edb97da937f2ee2e231b87593/core/src/main/java/lucee/commons/io/res/util/ResourceUtil.java#L1190-L1202 |
raphw/byte-buddy | byte-buddy-dep/src/main/java/net/bytebuddy/utility/visitor/ExceptionTableSensitiveMethodVisitor.java | ExceptionTableSensitiveMethodVisitor.onVisitTableSwitchInsn | protected void onVisitTableSwitchInsn(int minimum, int maximum, Label defaultTarget, Label... label) {
"""
Visits a table switch instruction.
@param minimum The minimum index.
@param maximum The maximum index.
@param defaultTarget A label indicating the default value.
@param label ... | java | protected void onVisitTableSwitchInsn(int minimum, int maximum, Label defaultTarget, Label... label) {
super.visitTableSwitchInsn(minimum, maximum, defaultTarget, label);
} | [
"protected",
"void",
"onVisitTableSwitchInsn",
"(",
"int",
"minimum",
",",
"int",
"maximum",
",",
"Label",
"defaultTarget",
",",
"Label",
"...",
"label",
")",
"{",
"super",
".",
"visitTableSwitchInsn",
"(",
"minimum",
",",
"maximum",
",",
"defaultTarget",
",",
... | Visits a table switch instruction.
@param minimum The minimum index.
@param maximum The maximum index.
@param defaultTarget A label indicating the default value.
@param label Labels indicating the jump targets. | [
"Visits",
"a",
"table",
"switch",
"instruction",
"."
] | train | https://github.com/raphw/byte-buddy/blob/4d2dac80efb6bed89367567260f6811c2f712d12/byte-buddy-dep/src/main/java/net/bytebuddy/utility/visitor/ExceptionTableSensitiveMethodVisitor.java#L262-L264 |
deeplearning4j/deeplearning4j | nd4j/nd4j-backends/nd4j-api-parent/nd4j-api/src/main/java/org/nd4j/autodiff/samediff/flow/FlowPath.java | FlowPath.setRewindPosition | public void setRewindPosition(@NonNull String frameName, int position) {
"""
This method allows to set position for next rewind within graph
@param frameName
@param position
"""
frames.get(frameName).setRewindPosition(position);
} | java | public void setRewindPosition(@NonNull String frameName, int position) {
frames.get(frameName).setRewindPosition(position);
} | [
"public",
"void",
"setRewindPosition",
"(",
"@",
"NonNull",
"String",
"frameName",
",",
"int",
"position",
")",
"{",
"frames",
".",
"get",
"(",
"frameName",
")",
".",
"setRewindPosition",
"(",
"position",
")",
";",
"}"
] | This method allows to set position for next rewind within graph
@param frameName
@param position | [
"This",
"method",
"allows",
"to",
"set",
"position",
"for",
"next",
"rewind",
"within",
"graph"
] | train | https://github.com/deeplearning4j/deeplearning4j/blob/effce52f2afd7eeb53c5bcca699fcd90bd06822f/nd4j/nd4j-backends/nd4j-api-parent/nd4j-api/src/main/java/org/nd4j/autodiff/samediff/flow/FlowPath.java#L197-L199 |
orbisgis/h2gis | h2gis-functions/src/main/java/org/h2gis/functions/io/utility/PRJUtil.java | PRJUtil.readPRJFile | private static String readPRJFile(File prjFile) throws FileNotFoundException, IOException {
"""
Return the content of the PRJ file as a single string
@param prjFile
@return
@throws FileNotFoundException
@throws IOException
"""
try (FileInputStream fis = new FileInputStream(prjFile)) {
... | java | private static String readPRJFile(File prjFile) throws FileNotFoundException, IOException {
try (FileInputStream fis = new FileInputStream(prjFile)) {
BufferedReader r = new BufferedReader(new InputStreamReader(fis, Charset.defaultCharset()));
StringBuilder b = new StringBuilder();
... | [
"private",
"static",
"String",
"readPRJFile",
"(",
"File",
"prjFile",
")",
"throws",
"FileNotFoundException",
",",
"IOException",
"{",
"try",
"(",
"FileInputStream",
"fis",
"=",
"new",
"FileInputStream",
"(",
"prjFile",
")",
")",
"{",
"BufferedReader",
"r",
"=",... | Return the content of the PRJ file as a single string
@param prjFile
@return
@throws FileNotFoundException
@throws IOException | [
"Return",
"the",
"content",
"of",
"the",
"PRJ",
"file",
"as",
"a",
"single",
"string"
] | train | https://github.com/orbisgis/h2gis/blob/9cd70b447e6469cecbc2fc64b16774b59491df3b/h2gis-functions/src/main/java/org/h2gis/functions/io/utility/PRJUtil.java#L111-L120 |
gallandarakhneorg/afc | core/maths/mathphysics/src/main/java/org/arakhne/afc/math/physics/MeasureUnitUtil.java | MeasureUnitUtil.toRadiansPerSecond | @Pure
public static double toRadiansPerSecond(double value, AngularUnit inputUnit) {
"""
Convert the given value expressed in the given unit to radians per second.
@param value is the value to convert
@param inputUnit is the unit of the {@code value}
@return the result of the convertion.
"""
switch (in... | java | @Pure
public static double toRadiansPerSecond(double value, AngularUnit inputUnit) {
switch (inputUnit) {
case TURNS_PER_SECOND:
return value * (2. * MathConstants.PI);
case DEGREES_PER_SECOND:
return Math.toRadians(value);
case RADIANS_PER_SECOND:
default:
}
return value;
} | [
"@",
"Pure",
"public",
"static",
"double",
"toRadiansPerSecond",
"(",
"double",
"value",
",",
"AngularUnit",
"inputUnit",
")",
"{",
"switch",
"(",
"inputUnit",
")",
"{",
"case",
"TURNS_PER_SECOND",
":",
"return",
"value",
"*",
"(",
"2.",
"*",
"MathConstants",
... | Convert the given value expressed in the given unit to radians per second.
@param value is the value to convert
@param inputUnit is the unit of the {@code value}
@return the result of the convertion. | [
"Convert",
"the",
"given",
"value",
"expressed",
"in",
"the",
"given",
"unit",
"to",
"radians",
"per",
"second",
"."
] | train | https://github.com/gallandarakhneorg/afc/blob/0c7d2e1ddefd4167ef788416d970a6c1ef6f8bbb/core/maths/mathphysics/src/main/java/org/arakhne/afc/math/physics/MeasureUnitUtil.java#L639-L650 |
nilsreiter/uima-util | src/main/java/de/unistuttgart/ims/uimautil/AnnotationUtil.java | AnnotationUtil.trimEnd | public static <T extends Annotation> T trimEnd(T annotation, char... ws) {
"""
Moves the end-index as long a character that is contained in the array is
at the end.
@param annotation
The annotation to be trimmed.
@param ws
An array of characters which are considered whitespace
@return The trimmed annotatio... | java | public static <T extends Annotation> T trimEnd(T annotation, char... ws) {
char[] s = annotation.getCoveredText().toCharArray();
if (s.length == 0)
return annotation;
int e = 0;
while (ArrayUtils.contains(ws, s[(s.length - 1) - e])) {
e++;
}
annotation.setEnd(annotation.getEnd() - e);
return annota... | [
"public",
"static",
"<",
"T",
"extends",
"Annotation",
">",
"T",
"trimEnd",
"(",
"T",
"annotation",
",",
"char",
"...",
"ws",
")",
"{",
"char",
"[",
"]",
"s",
"=",
"annotation",
".",
"getCoveredText",
"(",
")",
".",
"toCharArray",
"(",
")",
";",
"if"... | Moves the end-index as long a character that is contained in the array is
at the end.
@param annotation
The annotation to be trimmed.
@param ws
An array of characters which are considered whitespace
@return The trimmed annotation
@since 0.4.2 | [
"Moves",
"the",
"end",
"-",
"index",
"as",
"long",
"a",
"character",
"that",
"is",
"contained",
"in",
"the",
"array",
"is",
"at",
"the",
"end",
"."
] | train | https://github.com/nilsreiter/uima-util/blob/6f3bc3b8785702fe4ab9b670b87eaa215006f593/src/main/java/de/unistuttgart/ims/uimautil/AnnotationUtil.java#L172-L183 |
drinkjava2/jDialects | core/src/main/java/com/github/drinkjava2/jdialects/springsrc/utils/ReflectionUtils.java | ReflectionUtils.shallowCopyFieldState | public static void shallowCopyFieldState(final Object src, final Object dest) {
"""
Given the source object and the destination, which must be the same class
or a subclass, copy all fields, including inherited fields. Designed to
work on objects with public no-arg constructors.
"""
if (src == null) {
th... | java | public static void shallowCopyFieldState(final Object src, final Object dest) {
if (src == null) {
throw new IllegalArgumentException("Source for field copy cannot be null");
}
if (dest == null) {
throw new IllegalArgumentException("Destination for field copy cannot be null");
}
if (!src.getClass().isAs... | [
"public",
"static",
"void",
"shallowCopyFieldState",
"(",
"final",
"Object",
"src",
",",
"final",
"Object",
"dest",
")",
"{",
"if",
"(",
"src",
"==",
"null",
")",
"{",
"throw",
"new",
"IllegalArgumentException",
"(",
"\"Source for field copy cannot be null\"",
")"... | Given the source object and the destination, which must be the same class
or a subclass, copy all fields, including inherited fields. Designed to
work on objects with public no-arg constructors. | [
"Given",
"the",
"source",
"object",
"and",
"the",
"destination",
"which",
"must",
"be",
"the",
"same",
"class",
"or",
"a",
"subclass",
"copy",
"all",
"fields",
"including",
"inherited",
"fields",
".",
"Designed",
"to",
"work",
"on",
"objects",
"with",
"publi... | train | https://github.com/drinkjava2/jDialects/blob/1c165f09c6042a599b681c279024abcc1b848b88/core/src/main/java/com/github/drinkjava2/jdialects/springsrc/utils/ReflectionUtils.java#L727-L746 |
alexvasilkov/Events | library/src/main/java/com/alexvasilkov/events/internal/Dispatcher.java | Dispatcher.scheduleActiveStatusesUpdates | @MainThread
private void scheduleActiveStatusesUpdates(EventTarget target, EventStatus status) {
"""
Schedules status updates of all active events for given target.
"""
for (Event event : activeEvents) {
for (EventMethod method : target.methods) {
if (event.getKey().equa... | java | @MainThread
private void scheduleActiveStatusesUpdates(EventTarget target, EventStatus status) {
for (Event event : activeEvents) {
for (EventMethod method : target.methods) {
if (event.getKey().equals(method.eventKey)
&& method.type == EventMethod.Type.ST... | [
"@",
"MainThread",
"private",
"void",
"scheduleActiveStatusesUpdates",
"(",
"EventTarget",
"target",
",",
"EventStatus",
"status",
")",
"{",
"for",
"(",
"Event",
"event",
":",
"activeEvents",
")",
"{",
"for",
"(",
"EventMethod",
"method",
":",
"target",
".",
"... | Schedules status updates of all active events for given target. | [
"Schedules",
"status",
"updates",
"of",
"all",
"active",
"events",
"for",
"given",
"target",
"."
] | train | https://github.com/alexvasilkov/Events/blob/4208e11fab35d99229fe6c3b3d434ca1948f3fc5/library/src/main/java/com/alexvasilkov/events/internal/Dispatcher.java#L80-L91 |
bwkimmel/jdcp | jdcp-server/src/main/java/ca/eandb/jdcp/server/TemporaryJobServer.java | TemporaryJobServer.removeScheduledJob | private void removeScheduledJob(UUID jobId, boolean complete) {
"""
Removes a job.
@param jobId The <code>UUID</code> identifying the job to be removed.
@param complete A value indicating whether the job has been completed.
"""
ScheduledJob sched = jobs.remove(jobId);
if (sched != null) {
if (c... | java | private void removeScheduledJob(UUID jobId, boolean complete) {
ScheduledJob sched = jobs.remove(jobId);
if (sched != null) {
if (complete) {
sched.monitor.notifyComplete();
if (logger.isInfoEnabled()) {
logger.info("Job complete (" + jobId.toString() + ")");
}
} el... | [
"private",
"void",
"removeScheduledJob",
"(",
"UUID",
"jobId",
",",
"boolean",
"complete",
")",
"{",
"ScheduledJob",
"sched",
"=",
"jobs",
".",
"remove",
"(",
"jobId",
")",
";",
"if",
"(",
"sched",
"!=",
"null",
")",
"{",
"if",
"(",
"complete",
")",
"{... | Removes a job.
@param jobId The <code>UUID</code> identifying the job to be removed.
@param complete A value indicating whether the job has been completed. | [
"Removes",
"a",
"job",
"."
] | train | https://github.com/bwkimmel/jdcp/blob/630c5150c245054e2556ff370f4bad2ec793dfb7/jdcp-server/src/main/java/ca/eandb/jdcp/server/TemporaryJobServer.java#L340-L362 |
JodaOrg/joda-money | src/main/java/org/joda/money/BigMoney.java | BigMoney.withScale | public BigMoney withScale(int scale, RoundingMode roundingMode) {
"""
Returns a copy of this monetary value with the specified scale,
using the specified rounding mode if necessary.
<p>
The returned instance will have this currency and the new scaled amount.
For example, scaling 'USD 43.271' to a scale of 1 wi... | java | public BigMoney withScale(int scale, RoundingMode roundingMode) {
MoneyUtils.checkNotNull(roundingMode, "RoundingMode must not be null");
if (scale == amount.scale()) {
return this;
}
return BigMoney.of(currency, amount.setScale(scale, roundingMode));
} | [
"public",
"BigMoney",
"withScale",
"(",
"int",
"scale",
",",
"RoundingMode",
"roundingMode",
")",
"{",
"MoneyUtils",
".",
"checkNotNull",
"(",
"roundingMode",
",",
"\"RoundingMode must not be null\"",
")",
";",
"if",
"(",
"scale",
"==",
"amount",
".",
"scale",
"... | Returns a copy of this monetary value with the specified scale,
using the specified rounding mode if necessary.
<p>
The returned instance will have this currency and the new scaled amount.
For example, scaling 'USD 43.271' to a scale of 1 with HALF_EVEN rounding
will yield 'USD 43.3'.
A negative scale may be passed in,... | [
"Returns",
"a",
"copy",
"of",
"this",
"monetary",
"value",
"with",
"the",
"specified",
"scale",
"using",
"the",
"specified",
"rounding",
"mode",
"if",
"necessary",
".",
"<p",
">",
"The",
"returned",
"instance",
"will",
"have",
"this",
"currency",
"and",
"the... | train | https://github.com/JodaOrg/joda-money/blob/e1f2de75aa36610a695358696c8a88a18ca66cde/src/main/java/org/joda/money/BigMoney.java#L541-L547 |
ops4j/org.ops4j.base | ops4j-base-util-collections/src/main/java/org/ops4j/util/collections/PropertyResolver.java | PropertyResolver.processToken | private static void processToken( String token, Stack<String> stack, Properties props ) {
"""
Process one token.
@param token The token to process.
@param stack The parser Stack.
@param props The Properties to replace.
"""
if( "}".equals( token ) )
{
String name = stack.pop();
... | java | private static void processToken( String token, Stack<String> stack, Properties props )
{
if( "}".equals( token ) )
{
String name = stack.pop();
String open = stack.pop();
if( "${".equals( open ) )
{
startProperty( name, props, stack );... | [
"private",
"static",
"void",
"processToken",
"(",
"String",
"token",
",",
"Stack",
"<",
"String",
">",
"stack",
",",
"Properties",
"props",
")",
"{",
"if",
"(",
"\"}\"",
".",
"equals",
"(",
"token",
")",
")",
"{",
"String",
"name",
"=",
"stack",
".",
... | Process one token.
@param token The token to process.
@param stack The parser Stack.
@param props The Properties to replace. | [
"Process",
"one",
"token",
"."
] | train | https://github.com/ops4j/org.ops4j.base/blob/b0e742c0d9511f6b19ca64da2ebaf30b7a47256a/ops4j-base-util-collections/src/main/java/org/ops4j/util/collections/PropertyResolver.java#L92-L118 |
finmath/finmath-lib | src/main/java6/net/finmath/time/ScheduleGenerator.java | ScheduleGenerator.createScheduleFromConventions | public static ScheduleInterface createScheduleFromConventions(
LocalDate referenceDate,
int spotOffsetDays,
String startOffsetString,
String maturityString,
String frequency,
String daycountConvention,
String shortPeriodConvention,
String dateRollConvention,
BusinessdayCalendarInterface busin... | java | public static ScheduleInterface createScheduleFromConventions(
LocalDate referenceDate,
int spotOffsetDays,
String startOffsetString,
String maturityString,
String frequency,
String daycountConvention,
String shortPeriodConvention,
String dateRollConvention,
BusinessdayCalendarInterface busin... | [
"public",
"static",
"ScheduleInterface",
"createScheduleFromConventions",
"(",
"LocalDate",
"referenceDate",
",",
"int",
"spotOffsetDays",
",",
"String",
"startOffsetString",
",",
"String",
"maturityString",
",",
"String",
"frequency",
",",
"String",
"daycountConvention",
... | Simple schedule generation where startDate and maturityDate are calculated based on referenceDate, spotOffsetDays, startOffsetString and maturityString.
The schedule generation considers short periods. Date rolling is ignored.
@param referenceDate The date which is used in the schedule to internally convert dates to ... | [
"Simple",
"schedule",
"generation",
"where",
"startDate",
"and",
"maturityDate",
"are",
"calculated",
"based",
"on",
"referenceDate",
"spotOffsetDays",
"startOffsetString",
"and",
"maturityString",
"."
] | train | https://github.com/finmath/finmath-lib/blob/a3c067d52dd33feb97d851df6cab130e4116759f/src/main/java6/net/finmath/time/ScheduleGenerator.java#L614-L630 |
UrielCh/ovh-java-sdk | ovh-java-sdk-dedicatedinstallationTemplate/src/main/java/net/minidev/ovh/api/ApiOvhDedicatedinstallationTemplate.java | ApiOvhDedicatedinstallationTemplate.templateName_partitionScheme_schemeName_partition_mountpoint_GET | public OvhTemplatePartitions templateName_partitionScheme_schemeName_partition_mountpoint_GET(String templateName, String schemeName, String mountpoint) throws IOException {
"""
Get this object properties
REST: GET /dedicated/installationTemplate/{templateName}/partitionScheme/{schemeName}/partition/{mountpoint... | java | public OvhTemplatePartitions templateName_partitionScheme_schemeName_partition_mountpoint_GET(String templateName, String schemeName, String mountpoint) throws IOException {
String qPath = "/dedicated/installationTemplate/{templateName}/partitionScheme/{schemeName}/partition/{mountpoint}";
StringBuilder sb = path(q... | [
"public",
"OvhTemplatePartitions",
"templateName_partitionScheme_schemeName_partition_mountpoint_GET",
"(",
"String",
"templateName",
",",
"String",
"schemeName",
",",
"String",
"mountpoint",
")",
"throws",
"IOException",
"{",
"String",
"qPath",
"=",
"\"/dedicated/installationT... | Get this object properties
REST: GET /dedicated/installationTemplate/{templateName}/partitionScheme/{schemeName}/partition/{mountpoint}
@param templateName [required] This template name
@param schemeName [required] name of this partitioning scheme
@param mountpoint [required] partition mount point | [
"Get",
"this",
"object",
"properties"
] | train | https://github.com/UrielCh/ovh-java-sdk/blob/6d531a40e56e09701943e334c25f90f640c55701/ovh-java-sdk-dedicatedinstallationTemplate/src/main/java/net/minidev/ovh/api/ApiOvhDedicatedinstallationTemplate.java#L88-L93 |
belaban/jgroups-raft | src/org/jgroups/protocols/raft/RaftImpl.java | RaftImpl.handleAppendEntriesRequest | protected AppendResult handleAppendEntriesRequest(byte[] data, int offset, int length, Address leader,
int prev_log_index, int prev_log_term, int entry_term,
int leader_commit, boolean internal) {
"""
Called... | java | protected AppendResult handleAppendEntriesRequest(byte[] data, int offset, int length, Address leader,
int prev_log_index, int prev_log_term, int entry_term,
int leader_commit, boolean internal) {
// todo... | [
"protected",
"AppendResult",
"handleAppendEntriesRequest",
"(",
"byte",
"[",
"]",
"data",
",",
"int",
"offset",
",",
"int",
"length",
",",
"Address",
"leader",
",",
"int",
"prev_log_index",
",",
"int",
"prev_log_term",
",",
"int",
"entry_term",
",",
"int",
"le... | Called (on a follower) when an AppendEntries request is received
@param data The data (command to be appended to the log)
@param offset The offset
@param length The length
@param leader The leader's address (= the sender)
@param prev_log_index The index of the previous log entry
@param prev_log_term The term of the pre... | [
"Called",
"(",
"on",
"a",
"follower",
")",
"when",
"an",
"AppendEntries",
"request",
"is",
"received"
] | train | https://github.com/belaban/jgroups-raft/blob/5923a4761df50bfd203cc82cefc138694b4d7fc3/src/org/jgroups/protocols/raft/RaftImpl.java#L40-L70 |
threerings/narya | core/src/main/java/com/threerings/presents/server/net/PresentsConnectionManager.java | PresentsConnectionManager.handleDatagram | protected int handleDatagram (DatagramChannel listener, long when) {
"""
Called when a datagram message is ready to be read off its channel.
"""
InetSocketAddress source;
_databuf.clear();
try {
source = (InetSocketAddress)listener.receive(_databuf);
} catch (IOExcep... | java | protected int handleDatagram (DatagramChannel listener, long when)
{
InetSocketAddress source;
_databuf.clear();
try {
source = (InetSocketAddress)listener.receive(_databuf);
} catch (IOException ioe) {
log.warning("Failure receiving datagram.", ioe);
... | [
"protected",
"int",
"handleDatagram",
"(",
"DatagramChannel",
"listener",
",",
"long",
"when",
")",
"{",
"InetSocketAddress",
"source",
";",
"_databuf",
".",
"clear",
"(",
")",
";",
"try",
"{",
"source",
"=",
"(",
"InetSocketAddress",
")",
"listener",
".",
"... | Called when a datagram message is ready to be read off its channel. | [
"Called",
"when",
"a",
"datagram",
"message",
"is",
"ready",
"to",
"be",
"read",
"off",
"its",
"channel",
"."
] | train | https://github.com/threerings/narya/blob/5b01edc8850ed0c32d004b4049e1ac4a02027ede/core/src/main/java/com/threerings/presents/server/net/PresentsConnectionManager.java#L215-L251 |
apereo/cas | core/cas-server-core-util-api/src/main/java/org/apereo/cas/util/scripting/ScriptingUtils.java | ScriptingUtils.executeGroovyScript | public static <T> T executeGroovyScript(final Resource groovyScript,
final Object[] args, final Class<T> clazz,
final boolean failOnError) {
"""
Execute groovy script via run object.
@param <T> the type parameter
@... | java | public static <T> T executeGroovyScript(final Resource groovyScript,
final Object[] args, final Class<T> clazz,
final boolean failOnError) {
return executeGroovyScript(groovyScript, "run", args, clazz, failOnError);
} | [
"public",
"static",
"<",
"T",
">",
"T",
"executeGroovyScript",
"(",
"final",
"Resource",
"groovyScript",
",",
"final",
"Object",
"[",
"]",
"args",
",",
"final",
"Class",
"<",
"T",
">",
"clazz",
",",
"final",
"boolean",
"failOnError",
")",
"{",
"return",
... | Execute groovy script via run object.
@param <T> the type parameter
@param groovyScript the groovy script
@param args the args
@param clazz the clazz
@param failOnError the fail on error
@return the object | [
"Execute",
"groovy",
"script",
"via",
"run",
"object",
"."
] | train | https://github.com/apereo/cas/blob/b4b306433a8782cef803a39bea5b1f96740e0e9b/core/cas-server-core-util-api/src/main/java/org/apereo/cas/util/scripting/ScriptingUtils.java#L135-L139 |
alkacon/opencms-core | src-gwt/org/opencms/ade/containerpage/client/CmsContainerpageController.java | CmsContainerpageController.loadContextMenu | public void loadContextMenu(final CmsUUID structureId, final AdeContext context) {
"""
Loads the context menu entries.<p>
@param structureId the structure id of the resource to get the context menu entries for
@param context the ade context (sitemap or containerpae)
"""
/** The RPC menu action for... | java | public void loadContextMenu(final CmsUUID structureId, final AdeContext context) {
/** The RPC menu action for the container page dialog. */
CmsRpcAction<List<CmsContextMenuEntryBean>> menuAction = new CmsRpcAction<List<CmsContextMenuEntryBean>>() {
/**
* @see org.opencms.gwt.c... | [
"public",
"void",
"loadContextMenu",
"(",
"final",
"CmsUUID",
"structureId",
",",
"final",
"AdeContext",
"context",
")",
"{",
"/** The RPC menu action for the container page dialog. */",
"CmsRpcAction",
"<",
"List",
"<",
"CmsContextMenuEntryBean",
">>",
"menuAction",
"=",
... | Loads the context menu entries.<p>
@param structureId the structure id of the resource to get the context menu entries for
@param context the ade context (sitemap or containerpae) | [
"Loads",
"the",
"context",
"menu",
"entries",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src-gwt/org/opencms/ade/containerpage/client/CmsContainerpageController.java#L2237-L2262 |
Azure/azure-sdk-for-java | network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/ExpressRouteCircuitsInner.java | ExpressRouteCircuitsInner.beginCreateOrUpdate | public ExpressRouteCircuitInner beginCreateOrUpdate(String resourceGroupName, String circuitName, ExpressRouteCircuitInner parameters) {
"""
Creates or updates an express route circuit.
@param resourceGroupName The name of the resource group.
@param circuitName The name of the circuit.
@param parameters Param... | java | public ExpressRouteCircuitInner beginCreateOrUpdate(String resourceGroupName, String circuitName, ExpressRouteCircuitInner parameters) {
return beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, circuitName, parameters).toBlocking().single().body();
} | [
"public",
"ExpressRouteCircuitInner",
"beginCreateOrUpdate",
"(",
"String",
"resourceGroupName",
",",
"String",
"circuitName",
",",
"ExpressRouteCircuitInner",
"parameters",
")",
"{",
"return",
"beginCreateOrUpdateWithServiceResponseAsync",
"(",
"resourceGroupName",
",",
"circu... | Creates or updates an express route circuit.
@param resourceGroupName The name of the resource group.
@param circuitName The name of the circuit.
@param parameters Parameters supplied to the create or update express route circuit operation.
@throws IllegalArgumentException thrown if parameters fail the validation
@thr... | [
"Creates",
"or",
"updates",
"an",
"express",
"route",
"circuit",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/ExpressRouteCircuitsInner.java#L470-L472 |
facebook/fresco | drawee/src/main/java/com/facebook/drawee/generic/GenericDraweeHierarchy.java | GenericDraweeHierarchy.setProgressBarImage | public void setProgressBarImage(int resourceId, ScalingUtils.ScaleType scaleType) {
"""
Sets a new progress bar drawable with scale type.
@param resourceId an identifier of an Android drawable or color resource.
@param ScalingUtils.ScaleType a new scale type.
"""
setProgressBarImage(mResources.getDrawa... | java | public void setProgressBarImage(int resourceId, ScalingUtils.ScaleType scaleType) {
setProgressBarImage(mResources.getDrawable(resourceId), scaleType);
} | [
"public",
"void",
"setProgressBarImage",
"(",
"int",
"resourceId",
",",
"ScalingUtils",
".",
"ScaleType",
"scaleType",
")",
"{",
"setProgressBarImage",
"(",
"mResources",
".",
"getDrawable",
"(",
"resourceId",
")",
",",
"scaleType",
")",
";",
"}"
] | Sets a new progress bar drawable with scale type.
@param resourceId an identifier of an Android drawable or color resource.
@param ScalingUtils.ScaleType a new scale type. | [
"Sets",
"a",
"new",
"progress",
"bar",
"drawable",
"with",
"scale",
"type",
"."
] | train | https://github.com/facebook/fresco/blob/0b85879d51c5036d5e46e627a6651afefc0b971a/drawee/src/main/java/com/facebook/drawee/generic/GenericDraweeHierarchy.java#L543-L545 |
google/error-prone-javac | src/jdk.jshell/share/classes/jdk/jshell/Eval.java | Eval.compileFailResult | private List<Snippet> compileFailResult(DiagList diags, String userSource, Kind probableKind) {
"""
The snippet has failed, return with the rejected snippet
@param diags the failure diagnostics
@param userSource the incoming bad user source
@return a rejected snippet
"""
ErroneousKey key = state.k... | java | private List<Snippet> compileFailResult(DiagList diags, String userSource, Kind probableKind) {
ErroneousKey key = state.keyMap.keyForErroneous();
Snippet snip = new ErroneousSnippet(key, userSource, null,
probableKind, SubKind.UNKNOWN_SUBKIND);
snip.setFailed(diags);
//... | [
"private",
"List",
"<",
"Snippet",
">",
"compileFailResult",
"(",
"DiagList",
"diags",
",",
"String",
"userSource",
",",
"Kind",
"probableKind",
")",
"{",
"ErroneousKey",
"key",
"=",
"state",
".",
"keyMap",
".",
"keyForErroneous",
"(",
")",
";",
"Snippet",
"... | The snippet has failed, return with the rejected snippet
@param diags the failure diagnostics
@param userSource the incoming bad user source
@return a rejected snippet | [
"The",
"snippet",
"has",
"failed",
"return",
"with",
"the",
"rejected",
"snippet"
] | train | https://github.com/google/error-prone-javac/blob/a53d069bbdb2c60232ed3811c19b65e41c3e60e0/src/jdk.jshell/share/classes/jdk/jshell/Eval.java#L472-L500 |
lunisolar/magma | magma-func/src/main/java/eu/lunisolar/magma/func/Function4U.java | Function4U.biFunction | public static <T1, T2, R> BiFunction biFunction(final BiFunction<T1, T2, R> lambda) {
"""
Convenient method in case lambda expression is ambiguous for the compiler.
"""
return lambda;
} | java | public static <T1, T2, R> BiFunction biFunction(final BiFunction<T1, T2, R> lambda) {
return lambda;
} | [
"public",
"static",
"<",
"T1",
",",
"T2",
",",
"R",
">",
"BiFunction",
"biFunction",
"(",
"final",
"BiFunction",
"<",
"T1",
",",
"T2",
",",
"R",
">",
"lambda",
")",
"{",
"return",
"lambda",
";",
"}"
] | Convenient method in case lambda expression is ambiguous for the compiler. | [
"Convenient",
"method",
"in",
"case",
"lambda",
"expression",
"is",
"ambiguous",
"for",
"the",
"compiler",
"."
] | train | https://github.com/lunisolar/magma/blob/83809c6d1a33d913aec6c49920251e4f0be8b213/magma-func/src/main/java/eu/lunisolar/magma/func/Function4U.java#L242-L244 |
killbill/killbill | invoice/src/main/java/org/killbill/billing/invoice/tree/ItemsNodeInterval.java | ItemsNodeInterval.mergeExistingAndProposed | public void mergeExistingAndProposed(final Collection<Item> output, final UUID targetInvoiceId) {
"""
The merge tree is initially constructed by flattening all the existing items and reversing them (CANCEL node).
<p/>
That means that if we were to not merge any new proposed items, we would end up with only those... | java | public void mergeExistingAndProposed(final Collection<Item> output, final UUID targetInvoiceId) {
build(output, targetInvoiceId, true);
} | [
"public",
"void",
"mergeExistingAndProposed",
"(",
"final",
"Collection",
"<",
"Item",
">",
"output",
",",
"final",
"UUID",
"targetInvoiceId",
")",
"{",
"build",
"(",
"output",
",",
"targetInvoiceId",
",",
"true",
")",
";",
"}"
] | The merge tree is initially constructed by flattening all the existing items and reversing them (CANCEL node).
<p/>
That means that if we were to not merge any new proposed items, we would end up with only those reversed existing
items, and they would all end up repaired-- which is what we want.
<p/>
However, if there ... | [
"The",
"merge",
"tree",
"is",
"initially",
"constructed",
"by",
"flattening",
"all",
"the",
"existing",
"items",
"and",
"reversing",
"them",
"(",
"CANCEL",
"node",
")",
".",
"<p",
"/",
">",
"That",
"means",
"that",
"if",
"we",
"were",
"to",
"not",
"merge... | train | https://github.com/killbill/killbill/blob/6457b485fb32a182c76197a83f428123331f1380/invoice/src/main/java/org/killbill/billing/invoice/tree/ItemsNodeInterval.java#L194-L196 |
brianwhu/xillium | base/src/main/java/org/xillium/base/beans/Strings.java | Strings.splitCamelCase | public static String splitCamelCase(String text, String separator) {
"""
Splits a single camel-case word into a word sequence.
@param text - a single camel-case word
@param separator - a word separator
@return a word sequence with each word separated by the given separator
"""
return CAMEL_REGEX.m... | java | public static String splitCamelCase(String text, String separator) {
return CAMEL_REGEX.matcher(text).replaceAll(separator);
} | [
"public",
"static",
"String",
"splitCamelCase",
"(",
"String",
"text",
",",
"String",
"separator",
")",
"{",
"return",
"CAMEL_REGEX",
".",
"matcher",
"(",
"text",
")",
".",
"replaceAll",
"(",
"separator",
")",
";",
"}"
] | Splits a single camel-case word into a word sequence.
@param text - a single camel-case word
@param separator - a word separator
@return a word sequence with each word separated by the given separator | [
"Splits",
"a",
"single",
"camel",
"-",
"case",
"word",
"into",
"a",
"word",
"sequence",
"."
] | train | https://github.com/brianwhu/xillium/blob/e8dbf8cb6589fa1031a0bfcdcb58cb03d2ba7799/base/src/main/java/org/xillium/base/beans/Strings.java#L138-L140 |
jbundle/jbundle | base/base/src/main/java/org/jbundle/base/db/KeyField.java | KeyField.init | public void init(KeyArea keyArea, BaseField field, boolean keyOrder) {
"""
Constructor.
@param keyArea The parent key area.
@param field The key field.
@param keyOrder Ascending or Descending.
"""
this.m_keyArea = keyArea;
this.m_field = field;
this.m_bOrder = keyOrder;
m_bIs... | java | public void init(KeyArea keyArea, BaseField field, boolean keyOrder)
{
this.m_keyArea = keyArea;
this.m_field = field;
this.m_bOrder = keyOrder;
m_bIsTemporary = false;
m_keyArea.addKeyField(this);
} | [
"public",
"void",
"init",
"(",
"KeyArea",
"keyArea",
",",
"BaseField",
"field",
",",
"boolean",
"keyOrder",
")",
"{",
"this",
".",
"m_keyArea",
"=",
"keyArea",
";",
"this",
".",
"m_field",
"=",
"field",
";",
"this",
".",
"m_bOrder",
"=",
"keyOrder",
";",... | Constructor.
@param keyArea The parent key area.
@param field The key field.
@param keyOrder Ascending or Descending. | [
"Constructor",
"."
] | train | https://github.com/jbundle/jbundle/blob/4037fcfa85f60c7d0096c453c1a3cd573c2b0abc/base/base/src/main/java/org/jbundle/base/db/KeyField.java#L76-L83 |
Azure/azure-sdk-for-java | privatedns/resource-manager/v2018_09_01/src/main/java/com/microsoft/azure/management/privatedns/v2018_09_01/implementation/VirtualNetworkLinksInner.java | VirtualNetworkLinksInner.beginUpdateAsync | public Observable<VirtualNetworkLinkInner> beginUpdateAsync(String resourceGroupName, String privateZoneName, String virtualNetworkLinkName, VirtualNetworkLinkInner parameters, String ifMatch) {
"""
Updates a virtual network link to the specified Private DNS zone.
@param resourceGroupName The name of the resour... | java | public Observable<VirtualNetworkLinkInner> beginUpdateAsync(String resourceGroupName, String privateZoneName, String virtualNetworkLinkName, VirtualNetworkLinkInner parameters, String ifMatch) {
return beginUpdateWithServiceResponseAsync(resourceGroupName, privateZoneName, virtualNetworkLinkName, parameters, if... | [
"public",
"Observable",
"<",
"VirtualNetworkLinkInner",
">",
"beginUpdateAsync",
"(",
"String",
"resourceGroupName",
",",
"String",
"privateZoneName",
",",
"String",
"virtualNetworkLinkName",
",",
"VirtualNetworkLinkInner",
"parameters",
",",
"String",
"ifMatch",
")",
"{"... | Updates a virtual network link to the specified Private DNS zone.
@param resourceGroupName The name of the resource group.
@param privateZoneName The name of the Private DNS zone (without a terminating dot).
@param virtualNetworkLinkName The name of the virtual network link.
@param parameters Parameters supplied to th... | [
"Updates",
"a",
"virtual",
"network",
"link",
"to",
"the",
"specified",
"Private",
"DNS",
"zone",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/privatedns/resource-manager/v2018_09_01/src/main/java/com/microsoft/azure/management/privatedns/v2018_09_01/implementation/VirtualNetworkLinksInner.java#L798-L805 |
apache/incubator-heron | heron/packing/src/java/org/apache/heron/packing/roundrobin/ResourceCompliantRRPacking.java | ResourceCompliantRRPacking.flexibleRRpolicy | private void flexibleRRpolicy(PackingPlanBuilder planBuilder,
String componentName) throws ResourceExceededException {
"""
Performs a RR placement. Tries to place the instance on any container with space, starting at
containerId and cycling through the container set until it can be... | java | private void flexibleRRpolicy(PackingPlanBuilder planBuilder,
String componentName) throws ResourceExceededException {
// If there is not enough space on containerId look at other containers in a RR fashion
// starting from containerId.
ContainerIdScorer scorer = new Containe... | [
"private",
"void",
"flexibleRRpolicy",
"(",
"PackingPlanBuilder",
"planBuilder",
",",
"String",
"componentName",
")",
"throws",
"ResourceExceededException",
"{",
"// If there is not enough space on containerId look at other containers in a RR fashion",
"// starting from containerId.",
... | Performs a RR placement. Tries to place the instance on any container with space, starting at
containerId and cycling through the container set until it can be placed.
@param planBuilder packing plan builder
@param componentName the component name of the instance that needs to be placed in the container
@throws Resour... | [
"Performs",
"a",
"RR",
"placement",
".",
"Tries",
"to",
"place",
"the",
"instance",
"on",
"any",
"container",
"with",
"space",
"starting",
"at",
"containerId",
"and",
"cycling",
"through",
"the",
"container",
"set",
"until",
"it",
"can",
"be",
"placed",
"."
... | train | https://github.com/apache/incubator-heron/blob/776abe2b5a45b93a0eb957fd65cbc149d901a92a/heron/packing/src/java/org/apache/heron/packing/roundrobin/ResourceCompliantRRPacking.java#L303-L309 |
dain/leveldb | leveldb/src/main/java/org/iq80/leveldb/impl/VersionEdit.java | VersionEdit.addFile | public void addFile(int level, long fileNumber,
long fileSize,
InternalKey smallest,
InternalKey largest) {
"""
REQUIRES: "smallest" and "largest" are smallest and largest keys in file
"""
FileMetaData fileMetaData = new FileMetaData(fileNumber, fileSize, smallest, l... | java | public void addFile(int level, long fileNumber,
long fileSize,
InternalKey smallest,
InternalKey largest)
{
FileMetaData fileMetaData = new FileMetaData(fileNumber, fileSize, smallest, largest);
addFile(level, fileMetaData);
} | [
"public",
"void",
"addFile",
"(",
"int",
"level",
",",
"long",
"fileNumber",
",",
"long",
"fileSize",
",",
"InternalKey",
"smallest",
",",
"InternalKey",
"largest",
")",
"{",
"FileMetaData",
"fileMetaData",
"=",
"new",
"FileMetaData",
"(",
"fileNumber",
",",
"... | REQUIRES: "smallest" and "largest" are smallest and largest keys in file | [
"REQUIRES",
":",
"smallest",
"and",
"largest",
"are",
"smallest",
"and",
"largest",
"keys",
"in",
"file"
] | train | https://github.com/dain/leveldb/blob/7994065b48eada2ef29e7fefd172c2ad1e0110eb/leveldb/src/main/java/org/iq80/leveldb/impl/VersionEdit.java#L130-L137 |
rundeck/rundeck | core/src/main/java/com/dtolabs/rundeck/core/utils/ExecToolCommandLogger.java | ExecToolCommandLogger.expandMessage | private String expandMessage(final BuildEvent event, final String message) {
"""
Process string specified by the framework.log.dispatch.console.format property replacing any well known tokens with values
from the event.
@param event The BuildEvent
@param message The concatenated message
@return message str... | java | private String expandMessage(final BuildEvent event, final String message) {
final HashMap<String,String> data=new HashMap<String, String>();
final String user = retrieveUserName(event);
if(null!=user){
data.put("user", user);
}
final String node = retrieveNodeName(e... | [
"private",
"String",
"expandMessage",
"(",
"final",
"BuildEvent",
"event",
",",
"final",
"String",
"message",
")",
"{",
"final",
"HashMap",
"<",
"String",
",",
"String",
">",
"data",
"=",
"new",
"HashMap",
"<",
"String",
",",
"String",
">",
"(",
")",
";"... | Process string specified by the framework.log.dispatch.console.format property replacing any well known tokens with values
from the event.
@param event The BuildEvent
@param message The concatenated message
@return message string with tokens replaced by values. | [
"Process",
"string",
"specified",
"by",
"the",
"framework",
".",
"log",
".",
"dispatch",
".",
"console",
".",
"format",
"property",
"replacing",
"any",
"well",
"known",
"tokens",
"with",
"values",
"from",
"the",
"event",
"."
] | train | https://github.com/rundeck/rundeck/blob/8070f774f55bffaa1118ff0c03aea319d40a9668/core/src/main/java/com/dtolabs/rundeck/core/utils/ExecToolCommandLogger.java#L76-L94 |
ops4j/org.ops4j.pax.exam2 | containers/pax-exam-container-karaf/src/main/java/org/ops4j/pax/exam/karaf/options/KarafDistributionOption.java | KarafDistributionOption.editConfigurationFileExtend | public static Option[] editConfigurationFileExtend(final String configurationFilePath,
File source, String... keysToUseFromSource) {
"""
This option allows to configure each configuration file based on the karaf.home location. The
value is "extend" which means it is either replaced or added. For simpler c... | java | public static Option[] editConfigurationFileExtend(final String configurationFilePath,
File source, String... keysToUseFromSource) {
return createOptionListFromFile(source, new FileOptionFactory() {
@Override
public Option createOption(String key, Object value) {
... | [
"public",
"static",
"Option",
"[",
"]",
"editConfigurationFileExtend",
"(",
"final",
"String",
"configurationFilePath",
",",
"File",
"source",
",",
"String",
"...",
"keysToUseFromSource",
")",
"{",
"return",
"createOptionListFromFile",
"(",
"source",
",",
"new",
"Fi... | This option allows to configure each configuration file based on the karaf.home location. The
value is "extend" which means it is either replaced or added. For simpler configuration you
can add a file source. If you want to put all values from this file do not configure any
keysToUseFromSource; otherwise define them to... | [
"This",
"option",
"allows",
"to",
"configure",
"each",
"configuration",
"file",
"based",
"on",
"the",
"karaf",
".",
"home",
"location",
".",
"The",
"value",
"is",
"extend",
"which",
"means",
"it",
"is",
"either",
"replaced",
"or",
"added",
".",
"For",
"sim... | train | https://github.com/ops4j/org.ops4j.pax.exam2/blob/7f83796cbbb857123d8fc7fe817a7637218d5d77/containers/pax-exam-container-karaf/src/main/java/org/ops4j/pax/exam/karaf/options/KarafDistributionOption.java#L295-L305 |
GenesysPureEngage/workspace-client-java | src/main/java/com/genesys/internal/workspace/api/SessionApi.java | SessionApi.getObjects | public ApiSuccessResponse getObjects(String type, String names) throws ApiException {
"""
Get list of objects describes by type and names
Get list of objects describes by type and names
@param type Type of object (required)
@param names list of object names seperate by coma. (required)
@return ApiSuccessRespon... | java | public ApiSuccessResponse getObjects(String type, String names) throws ApiException {
ApiResponse<ApiSuccessResponse> resp = getObjectsWithHttpInfo(type, names);
return resp.getData();
} | [
"public",
"ApiSuccessResponse",
"getObjects",
"(",
"String",
"type",
",",
"String",
"names",
")",
"throws",
"ApiException",
"{",
"ApiResponse",
"<",
"ApiSuccessResponse",
">",
"resp",
"=",
"getObjectsWithHttpInfo",
"(",
"type",
",",
"names",
")",
";",
"return",
... | Get list of objects describes by type and names
Get list of objects describes by type and names
@param type Type of object (required)
@param names list of object names seperate by coma. (required)
@return ApiSuccessResponse
@throws ApiException If fail to call the API, e.g. server error or cannot deserialize the respon... | [
"Get",
"list",
"of",
"objects",
"describes",
"by",
"type",
"and",
"names",
"Get",
"list",
"of",
"objects",
"describes",
"by",
"type",
"and",
"names"
] | train | https://github.com/GenesysPureEngage/workspace-client-java/blob/509fdd9e89b9359d012f9a72be95037a3cef53e6/src/main/java/com/genesys/internal/workspace/api/SessionApi.java#L851-L854 |
JoeKerouac/utils | src/main/java/com/joe/utils/reflect/BeanUtils.java | BeanUtils.setProperty | public static boolean setProperty(Object obj, String propName, Object value) {
"""
为对象的属性注入指定值
@param obj 指定对象
@param propName 属性名称
@param value 要注入的属性值
@return 如果注入成功则返回<code>true</code>
"""
try {
setFieldValue(obj, propName, value);
return true;
} catch (... | java | public static boolean setProperty(Object obj, String propName, Object value) {
try {
setFieldValue(obj, propName, value);
return true;
} catch (Throwable e) {
return false;
}
} | [
"public",
"static",
"boolean",
"setProperty",
"(",
"Object",
"obj",
",",
"String",
"propName",
",",
"Object",
"value",
")",
"{",
"try",
"{",
"setFieldValue",
"(",
"obj",
",",
"propName",
",",
"value",
")",
";",
"return",
"true",
";",
"}",
"catch",
"(",
... | 为对象的属性注入指定值
@param obj 指定对象
@param propName 属性名称
@param value 要注入的属性值
@return 如果注入成功则返回<code>true</code> | [
"为对象的属性注入指定值"
] | train | https://github.com/JoeKerouac/utils/blob/45e1b2dc4d736956674fc4dcbe6cf84eaee69278/src/main/java/com/joe/utils/reflect/BeanUtils.java#L109-L116 |
forge/core | convert/impl/src/main/java/org/jboss/forge/addon/convert/impl/ConverterFactoryImpl.java | ConverterFactoryImpl.areTypesAssignable | private boolean areTypesAssignable(Class<?> source, Class<?> target) {
"""
Check if the parameters are primitive and if they can be assignable
"""
if (target.isAssignableFrom(source))
{
return true;
}
else if (!source.isPrimitive() && !target.isPrimitive())
{
ret... | java | private boolean areTypesAssignable(Class<?> source, Class<?> target)
{
if (target.isAssignableFrom(source))
{
return true;
}
else if (!source.isPrimitive() && !target.isPrimitive())
{
return false;
}
else if (source.isPrimitive())
{
// source... | [
"private",
"boolean",
"areTypesAssignable",
"(",
"Class",
"<",
"?",
">",
"source",
",",
"Class",
"<",
"?",
">",
"target",
")",
"{",
"if",
"(",
"target",
".",
"isAssignableFrom",
"(",
"source",
")",
")",
"{",
"return",
"true",
";",
"}",
"else",
"if",
... | Check if the parameters are primitive and if they can be assignable | [
"Check",
"if",
"the",
"parameters",
"are",
"primitive",
"and",
"if",
"they",
"can",
"be",
"assignable"
] | train | https://github.com/forge/core/blob/e140eb03bbe2b3409478ad70c86c3edbef6d9a0c/convert/impl/src/main/java/org/jboss/forge/addon/convert/impl/ConverterFactoryImpl.java#L107-L127 |
Red5/red5-server-common | src/main/java/org/red5/server/so/SharedObjectService.java | SharedObjectService.getStore | private IPersistenceStore getStore(IScope scope, boolean persistent) {
"""
Return scope store
@param scope
Scope
@param persistent
Persistent store or not?
@return Scope's store
"""
IPersistenceStore store;
if (!persistent) {
// Use special store for non-persistent shared ... | java | private IPersistenceStore getStore(IScope scope, boolean persistent) {
IPersistenceStore store;
if (!persistent) {
// Use special store for non-persistent shared objects
if (!scope.hasAttribute(SO_TRANSIENT_STORE)) {
store = new RamPersistence(scope);
... | [
"private",
"IPersistenceStore",
"getStore",
"(",
"IScope",
"scope",
",",
"boolean",
"persistent",
")",
"{",
"IPersistenceStore",
"store",
";",
"if",
"(",
"!",
"persistent",
")",
"{",
"// Use special store for non-persistent shared objects\r",
"if",
"(",
"!",
"scope",
... | Return scope store
@param scope
Scope
@param persistent
Persistent store or not?
@return Scope's store | [
"Return",
"scope",
"store"
] | train | https://github.com/Red5/red5-server-common/blob/39ae73710c25bda86d70b13ef37ae707962217b9/src/main/java/org/red5/server/so/SharedObjectService.java#L112-L136 |
bbottema/simple-java-mail | modules/simple-java-mail/src/main/java/org/simplejavamail/converter/EmailConverter.java | EmailConverter.emlToEmail | public static Email emlToEmail(@Nonnull final InputStream emlInputStream) {
"""
Delegates to {@link #emlToEmail(String)} with the full string value read from the given <code>InputStream</code>.
"""
try {
return emlToEmail(readInputStreamToString(checkNonEmptyArgument(emlInputStream, "emlInputStream"), UTF... | java | public static Email emlToEmail(@Nonnull final InputStream emlInputStream) {
try {
return emlToEmail(readInputStreamToString(checkNonEmptyArgument(emlInputStream, "emlInputStream"), UTF_8));
} catch (IOException e) {
throw new EmailConverterException(EmailConverterException.ERROR_READING_EML_INPUTSTREAM, e);
... | [
"public",
"static",
"Email",
"emlToEmail",
"(",
"@",
"Nonnull",
"final",
"InputStream",
"emlInputStream",
")",
"{",
"try",
"{",
"return",
"emlToEmail",
"(",
"readInputStreamToString",
"(",
"checkNonEmptyArgument",
"(",
"emlInputStream",
",",
"\"emlInputStream\"",
")",... | Delegates to {@link #emlToEmail(String)} with the full string value read from the given <code>InputStream</code>. | [
"Delegates",
"to",
"{"
] | train | https://github.com/bbottema/simple-java-mail/blob/b03635328aeecd525e35eddfef8f5b9a184559d8/modules/simple-java-mail/src/main/java/org/simplejavamail/converter/EmailConverter.java#L113-L119 |
looly/hutool | hutool-core/src/main/java/cn/hutool/core/lang/Assert.java | Assert.isNull | public static void isNull(Object object, String errorMsgTemplate, Object... params) throws IllegalArgumentException {
"""
断言对象是否为{@code null} ,如果不为{@code null} 抛出{@link IllegalArgumentException} 异常
<pre class="code">
Assert.isNull(value, "The value must be null");
</pre>
@param object 被检查的对象
@param errorM... | java | public static void isNull(Object object, String errorMsgTemplate, Object... params) throws IllegalArgumentException {
if (object != null) {
throw new IllegalArgumentException(StrUtil.format(errorMsgTemplate, params));
}
} | [
"public",
"static",
"void",
"isNull",
"(",
"Object",
"object",
",",
"String",
"errorMsgTemplate",
",",
"Object",
"...",
"params",
")",
"throws",
"IllegalArgumentException",
"{",
"if",
"(",
"object",
"!=",
"null",
")",
"{",
"throw",
"new",
"IllegalArgumentExcepti... | 断言对象是否为{@code null} ,如果不为{@code null} 抛出{@link IllegalArgumentException} 异常
<pre class="code">
Assert.isNull(value, "The value must be null");
</pre>
@param object 被检查的对象
@param errorMsgTemplate 消息模板,变量使用{}表示
@param params 参数列表
@throws IllegalArgumentException if the object is not {@code null} | [
"断言对象是否为",
"{",
"@code",
"null",
"}",
",如果不为",
"{",
"@code",
"null",
"}",
"抛出",
"{",
"@link",
"IllegalArgumentException",
"}",
"异常"
] | train | https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-core/src/main/java/cn/hutool/core/lang/Assert.java#L95-L99 |
medallia/Word2VecJava | src/main/java/com/medallia/word2vec/util/ProfilingTimer.java | ProfilingTimer.createLoggingSubtasks | public static ProfilingTimer createLoggingSubtasks(final Log log, final String processName, final Object... args) {
"""
Same as {@link #create(Log, String, Object...)} but logs subtasks as well
"""
return create(log, false, null, processName, args);
} | java | public static ProfilingTimer createLoggingSubtasks(final Log log, final String processName, final Object... args) {
return create(log, false, null, processName, args);
} | [
"public",
"static",
"ProfilingTimer",
"createLoggingSubtasks",
"(",
"final",
"Log",
"log",
",",
"final",
"String",
"processName",
",",
"final",
"Object",
"...",
"args",
")",
"{",
"return",
"create",
"(",
"log",
",",
"false",
",",
"null",
",",
"processName",
... | Same as {@link #create(Log, String, Object...)} but logs subtasks as well | [
"Same",
"as",
"{"
] | train | https://github.com/medallia/Word2VecJava/blob/eb31fbb99ac6bbab82d7f807b3e2240edca50eb7/src/main/java/com/medallia/word2vec/util/ProfilingTimer.java#L177-L179 |
structr/structr | structr-core/src/main/java/org/structr/core/graph/SyncCommand.java | SyncCommand.serializeData | public static void serializeData(DataOutputStream outputStream, byte[] data) throws IOException {
"""
Serializes the given object into the given writer. The following format will
be used to serialize objects. The first two characters are the type index, see
typeMap above. After that, a single digit that indicate... | java | public static void serializeData(DataOutputStream outputStream, byte[] data) throws IOException {
outputStream.writeInt(data.length);
outputStream.write(data);
outputStream.flush();
} | [
"public",
"static",
"void",
"serializeData",
"(",
"DataOutputStream",
"outputStream",
",",
"byte",
"[",
"]",
"data",
")",
"throws",
"IOException",
"{",
"outputStream",
".",
"writeInt",
"(",
"data",
".",
"length",
")",
";",
"outputStream",
".",
"write",
"(",
... | Serializes the given object into the given writer. The following format will
be used to serialize objects. The first two characters are the type index, see
typeMap above. After that, a single digit that indicates the length of the following
length field follows. After that, the length field is serialized, followed by t... | [
"Serializes",
"the",
"given",
"object",
"into",
"the",
"given",
"writer",
".",
"The",
"following",
"format",
"will",
"be",
"used",
"to",
"serialize",
"objects",
".",
"The",
"first",
"two",
"characters",
"are",
"the",
"type",
"index",
"see",
"typeMap",
"above... | train | https://github.com/structr/structr/blob/c111a1d0c0201c7fea5574ed69aa5a5053185a97/structr-core/src/main/java/org/structr/core/graph/SyncCommand.java#L359-L365 |
khuxtable/seaglass | src/main/java/com/seaglasslookandfeel/painter/ArrowButtonPainter.java | ArrowButtonPainter.paintForegroundEnabled | private void paintForegroundEnabled(Graphics2D g, int width, int height) {
"""
Paint the arrow in enabled state.
@param g the Graphics2D context to paint with.
@param width the width.
@param height the height.
"""
Shape s = decodeArrowPath(width, height);
g.setPaint(enabledColor);
... | java | private void paintForegroundEnabled(Graphics2D g, int width, int height) {
Shape s = decodeArrowPath(width, height);
g.setPaint(enabledColor);
g.fill(s);
} | [
"private",
"void",
"paintForegroundEnabled",
"(",
"Graphics2D",
"g",
",",
"int",
"width",
",",
"int",
"height",
")",
"{",
"Shape",
"s",
"=",
"decodeArrowPath",
"(",
"width",
",",
"height",
")",
";",
"g",
".",
"setPaint",
"(",
"enabledColor",
")",
";",
"g... | Paint the arrow in enabled state.
@param g the Graphics2D context to paint with.
@param width the width.
@param height the height. | [
"Paint",
"the",
"arrow",
"in",
"enabled",
"state",
"."
] | train | https://github.com/khuxtable/seaglass/blob/f25ecba622923d7b29b64cb7d6068dd8005989b3/src/main/java/com/seaglasslookandfeel/painter/ArrowButtonPainter.java#L109-L115 |
box/box-java-sdk | src/main/java/com/box/sdk/BoxRetentionPolicy.java | BoxRetentionPolicy.getAll | public static Iterable<BoxRetentionPolicy.Info> getAll(
String name, String type, String userID, int limit, final BoxAPIConnection api, String ... fields) {
"""
Returns all the retention policies with specified filters.
@param name a name to filter the retention policies by. A trailing partial match ... | java | public static Iterable<BoxRetentionPolicy.Info> getAll(
String name, String type, String userID, int limit, final BoxAPIConnection api, String ... fields) {
QueryStringBuilder queryString = new QueryStringBuilder();
if (name != null) {
queryString.appendParam("policy_name", n... | [
"public",
"static",
"Iterable",
"<",
"BoxRetentionPolicy",
".",
"Info",
">",
"getAll",
"(",
"String",
"name",
",",
"String",
"type",
",",
"String",
"userID",
",",
"int",
"limit",
",",
"final",
"BoxAPIConnection",
"api",
",",
"String",
"...",
"fields",
")",
... | Returns all the retention policies with specified filters.
@param name a name to filter the retention policies by. A trailing partial match search is performed.
Set to null if no name filtering is required.
@param type a policy type to filter the retention policies by. Set to null if no type filtering is required.
@par... | [
"Returns",
"all",
"the",
"retention",
"policies",
"with",
"specified",
"filters",
"."
] | train | https://github.com/box/box-java-sdk/blob/35b4ba69417f9d6a002c19dfaab57527750ef349/src/main/java/com/box/sdk/BoxRetentionPolicy.java#L361-L386 |
selenide/selenide | src/main/java/com/codeborne/selenide/Selectors.java | Selectors.byAttribute | public static By byAttribute(String attributeName, String attributeValue) {
"""
Find elements having attribute with given value.
Examples:
{@code <div binding="fieldValue"></div>}
Find element with attribute 'binding' EXACTLY containing text 'fieldValue' , use:
byAttribute("binding", "fieldValue")
For fin... | java | public static By byAttribute(String attributeName, String attributeValue) {
return By.cssSelector(String.format("[%s='%s']", attributeName, attributeValue));
} | [
"public",
"static",
"By",
"byAttribute",
"(",
"String",
"attributeName",
",",
"String",
"attributeValue",
")",
"{",
"return",
"By",
".",
"cssSelector",
"(",
"String",
".",
"format",
"(",
"\"[%s='%s']\"",
",",
"attributeName",
",",
"attributeValue",
")",
")",
"... | Find elements having attribute with given value.
Examples:
{@code <div binding="fieldValue"></div>}
Find element with attribute 'binding' EXACTLY containing text 'fieldValue' , use:
byAttribute("binding", "fieldValue")
For finding difficult/generated data attribute which contains some value:
{@code <div binding="user... | [
"Find",
"elements",
"having",
"attribute",
"with",
"given",
"value",
"."
] | train | https://github.com/selenide/selenide/blob/b867baf171942cf07725d83a985237428569883f/src/main/java/com/codeborne/selenide/Selectors.java#L64-L66 |
rzwitserloot/lombok | src/core/lombok/javac/HandlerLibrary.java | HandlerLibrary.javacError | public void javacError(String message, Throwable t) {
"""
Generates an error in the Messager that was used to initialize this HandlerLibrary.
"""
messager.printMessage(Diagnostic.Kind.ERROR, message + (t == null ? "" : (": " + t)));
if (t != null) t.printStackTrace();
} | java | public void javacError(String message, Throwable t) {
messager.printMessage(Diagnostic.Kind.ERROR, message + (t == null ? "" : (": " + t)));
if (t != null) t.printStackTrace();
} | [
"public",
"void",
"javacError",
"(",
"String",
"message",
",",
"Throwable",
"t",
")",
"{",
"messager",
".",
"printMessage",
"(",
"Diagnostic",
".",
"Kind",
".",
"ERROR",
",",
"message",
"+",
"(",
"t",
"==",
"null",
"?",
"\"\"",
":",
"(",
"\": \"",
"+",... | Generates an error in the Messager that was used to initialize this HandlerLibrary. | [
"Generates",
"an",
"error",
"in",
"the",
"Messager",
"that",
"was",
"used",
"to",
"initialize",
"this",
"HandlerLibrary",
"."
] | train | https://github.com/rzwitserloot/lombok/blob/75601240760bd81ff95fcde7a1b8185769ce64e8/src/core/lombok/javac/HandlerLibrary.java#L218-L221 |
vakinge/jeesuite-libs | jeesuite-common/src/main/java/com/jeesuite/common/util/ReflectUtils.java | ReflectUtils.isInstance | public static boolean isInstance(Object obj, String interfaceClazzName) {
"""
检查对象是否是指定接口的实现。
<p>
不会触发到指定接口的{@link Class},所以如果ClassLoader中没有指定接口类时,也不会出错。
@param obj
要检查的对象
@param interfaceClazzName
指定的接口名
@return 返回{@code true},如果对象实现了指定接口;否则返回{@code false}。
"""
for (Class<?> clazz = obj.getClass();... | java | public static boolean isInstance(Object obj, String interfaceClazzName) {
for (Class<?> clazz = obj.getClass(); clazz != null
&& !clazz.equals(Object.class); clazz = clazz.getSuperclass()) {
Class<?>[] interfaces = clazz.getInterfaces();
for (Class<?> itf : interfaces) {
if (itf.getName().equals(interfa... | [
"public",
"static",
"boolean",
"isInstance",
"(",
"Object",
"obj",
",",
"String",
"interfaceClazzName",
")",
"{",
"for",
"(",
"Class",
"<",
"?",
">",
"clazz",
"=",
"obj",
".",
"getClass",
"(",
")",
";",
"clazz",
"!=",
"null",
"&&",
"!",
"clazz",
".",
... | 检查对象是否是指定接口的实现。
<p>
不会触发到指定接口的{@link Class},所以如果ClassLoader中没有指定接口类时,也不会出错。
@param obj
要检查的对象
@param interfaceClazzName
指定的接口名
@return 返回{@code true},如果对象实现了指定接口;否则返回{@code false}。 | [
"检查对象是否是指定接口的实现。",
"<p",
">",
"不会触发到指定接口的",
"{",
"@link",
"Class",
"}",
",所以如果ClassLoader中没有指定接口类时,也不会出错。"
] | train | https://github.com/vakinge/jeesuite-libs/blob/c48fe2c7fbd294892cf4030dbec96e744dd3e386/jeesuite-common/src/main/java/com/jeesuite/common/util/ReflectUtils.java#L930-L941 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.