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 |
|---|---|---|---|---|---|---|---|---|---|---|
kuali/ojb-1.0.4 | src/xdoclet/java/src/xdoclet/modules/ojb/OjbTagsHandler.java | OjbTagsHandler.ifHasProperty | public void ifHasProperty(String template, Properties attributes) throws XDocletException {
"""
Determines whether the current object on the specified level has a specific property, and if so, processes the
template
@param template The template
@param attributes The attributes of the t... | java | public void ifHasProperty(String template, Properties attributes) throws XDocletException
{
String value = getPropertyValue(attributes.getProperty(ATTRIBUTE_LEVEL), attributes.getProperty(ATTRIBUTE_NAME));
if (value != null)
{
generate(template);
}
} | [
"public",
"void",
"ifHasProperty",
"(",
"String",
"template",
",",
"Properties",
"attributes",
")",
"throws",
"XDocletException",
"{",
"String",
"value",
"=",
"getPropertyValue",
"(",
"attributes",
".",
"getProperty",
"(",
"ATTRIBUTE_LEVEL",
")",
",",
"attributes",
... | Determines whether the current object on the specified level has a specific property, and if so, processes the
template
@param template The template
@param attributes The attributes of the tag
@exception XDocletException If an error occurs
@doc.tag type="block"
@doc.param ... | [
"Determines",
"whether",
"the",
"current",
"object",
"on",
"the",
"specified",
"level",
"has",
"a",
"specific",
"property",
"and",
"if",
"so",
"processes",
"the",
"template"
] | train | https://github.com/kuali/ojb-1.0.4/blob/9a544372f67ce965f662cdc71609dd03683c8f04/src/xdoclet/java/src/xdoclet/modules/ojb/OjbTagsHandler.java#L1490-L1498 |
Azure/azure-sdk-for-java | network/resource-manager/v2017_10_01/src/main/java/com/microsoft/azure/management/network/v2017_10_01/implementation/NetworkWatchersInner.java | NetworkWatchersInner.checkConnectivity | public ConnectivityInformationInner checkConnectivity(String resourceGroupName, String networkWatcherName, ConnectivityParameters parameters) {
"""
Verifies the possibility of establishing a direct TCP connection from a virtual machine to a given endpoint including another VM or an arbitrary remote server.
@par... | java | public ConnectivityInformationInner checkConnectivity(String resourceGroupName, String networkWatcherName, ConnectivityParameters parameters) {
return checkConnectivityWithServiceResponseAsync(resourceGroupName, networkWatcherName, parameters).toBlocking().last().body();
} | [
"public",
"ConnectivityInformationInner",
"checkConnectivity",
"(",
"String",
"resourceGroupName",
",",
"String",
"networkWatcherName",
",",
"ConnectivityParameters",
"parameters",
")",
"{",
"return",
"checkConnectivityWithServiceResponseAsync",
"(",
"resourceGroupName",
",",
"... | Verifies the possibility of establishing a direct TCP connection from a virtual machine to a given endpoint including another VM or an arbitrary remote server.
@param resourceGroupName The name of the network watcher resource group.
@param networkWatcherName The name of the network watcher resource.
@param parameters ... | [
"Verifies",
"the",
"possibility",
"of",
"establishing",
"a",
"direct",
"TCP",
"connection",
"from",
"a",
"virtual",
"machine",
"to",
"a",
"given",
"endpoint",
"including",
"another",
"VM",
"or",
"an",
"arbitrary",
"remote",
"server",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/network/resource-manager/v2017_10_01/src/main/java/com/microsoft/azure/management/network/v2017_10_01/implementation/NetworkWatchersInner.java#L2140-L2142 |
Azure/azure-sdk-for-java | notificationhubs/resource-manager/v2014_09_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2014_09_01/implementation/NotificationHubsInner.java | NotificationHubsInner.getPnsCredentialsAsync | public Observable<NotificationHubResourceInner> getPnsCredentialsAsync(String resourceGroupName, String namespaceName, String notificationHubName) {
"""
Lists the PNS Credentials associated with a notification hub .
@param resourceGroupName The name of the resource group.
@param namespaceName The namespace nam... | java | public Observable<NotificationHubResourceInner> getPnsCredentialsAsync(String resourceGroupName, String namespaceName, String notificationHubName) {
return getPnsCredentialsWithServiceResponseAsync(resourceGroupName, namespaceName, notificationHubName).map(new Func1<ServiceResponse<NotificationHubResourceInner>... | [
"public",
"Observable",
"<",
"NotificationHubResourceInner",
">",
"getPnsCredentialsAsync",
"(",
"String",
"resourceGroupName",
",",
"String",
"namespaceName",
",",
"String",
"notificationHubName",
")",
"{",
"return",
"getPnsCredentialsWithServiceResponseAsync",
"(",
"resourc... | Lists the PNS Credentials associated with a notification hub .
@param resourceGroupName The name of the resource group.
@param namespaceName The namespace name.
@param notificationHubName The notification hub name.
@throws IllegalArgumentException thrown if parameters fail the validation
@return the observable to the ... | [
"Lists",
"the",
"PNS",
"Credentials",
"associated",
"with",
"a",
"notification",
"hub",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/notificationhubs/resource-manager/v2014_09_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2014_09_01/implementation/NotificationHubsInner.java#L1203-L1210 |
PeterisP/LVTagger | src/main/java/edu/stanford/nlp/io/IOUtils.java | IOUtils.encodedOutputStreamWriter | public static Writer encodedOutputStreamWriter(OutputStream stream, String encoding) throws IOException {
"""
Create a Reader with an explicit encoding around an InputStream.
This static method will treat null as meaning to use the platform default,
unlike the Java library methods that disallow a null encoding.
... | java | public static Writer encodedOutputStreamWriter(OutputStream stream, String encoding) throws IOException {
// OutputStreamWriter doesn't allow encoding to be null;
if (encoding == null) {
return new OutputStreamWriter(stream);
} else {
return new OutputStreamWriter(stream, encoding);
}
... | [
"public",
"static",
"Writer",
"encodedOutputStreamWriter",
"(",
"OutputStream",
"stream",
",",
"String",
"encoding",
")",
"throws",
"IOException",
"{",
"// OutputStreamWriter doesn't allow encoding to be null;\r",
"if",
"(",
"encoding",
"==",
"null",
")",
"{",
"return",
... | Create a Reader with an explicit encoding around an InputStream.
This static method will treat null as meaning to use the platform default,
unlike the Java library methods that disallow a null encoding.
@param stream An InputStream
@param encoding A charset encoding
@return A Reader
@throws IOException If any IO probl... | [
"Create",
"a",
"Reader",
"with",
"an",
"explicit",
"encoding",
"around",
"an",
"InputStream",
".",
"This",
"static",
"method",
"will",
"treat",
"null",
"as",
"meaning",
"to",
"use",
"the",
"platform",
"default",
"unlike",
"the",
"Java",
"library",
"methods",
... | train | https://github.com/PeterisP/LVTagger/blob/b3d44bab9ec07ace0d13612c448a6b7298c1f681/src/main/java/edu/stanford/nlp/io/IOUtils.java#L1339-L1346 |
bushidowallet/bushido-java-service | bushido-service-lib/src/main/java/com/bccapi/bitlib/util/CoinUtil.java | CoinUtil.fullValueString | public static String fullValueString(long value, Denomination denomination) {
"""
Get the given value in satoshis as a string on the form "10.12345000"
using the specified denomination.
<p>
This method always returns a string with all decimal points. If you only
wish to have the necessary digits use
{@link Co... | java | public static String fullValueString(long value, Denomination denomination) {
BigDecimal d = BigDecimal.valueOf(value);
d = d.movePointLeft(denomination.getDecimalPlaces());
return d.toPlainString();
} | [
"public",
"static",
"String",
"fullValueString",
"(",
"long",
"value",
",",
"Denomination",
"denomination",
")",
"{",
"BigDecimal",
"d",
"=",
"BigDecimal",
".",
"valueOf",
"(",
"value",
")",
";",
"d",
"=",
"d",
".",
"movePointLeft",
"(",
"denomination",
".",... | Get the given value in satoshis as a string on the form "10.12345000"
using the specified denomination.
<p>
This method always returns a string with all decimal points. If you only
wish to have the necessary digits use
{@link CoinUtil#valueString(long, Denomination)}
@param value
The number of satoshis
@param denomina... | [
"Get",
"the",
"given",
"value",
"in",
"satoshis",
"as",
"a",
"string",
"on",
"the",
"form",
"10",
".",
"12345000",
"using",
"the",
"specified",
"denomination",
".",
"<p",
">",
"This",
"method",
"always",
"returns",
"a",
"string",
"with",
"all",
"decimal",
... | train | https://github.com/bushidowallet/bushido-java-service/blob/e1a0157527e57459b509718044d2df44084876a2/bushido-service-lib/src/main/java/com/bccapi/bitlib/util/CoinUtil.java#L153-L157 |
jenkinsci/pipeline-maven-plugin | jenkins-plugin/src/main/java/org/jenkinsci/plugins/pipeline/maven/publishers/InvokerRunsPublisher.java | InvokerRunsPublisher.process | @Override
public void process(@Nonnull StepContext context, @Nonnull Element mavenSpyLogsElt) throws IOException, InterruptedException {
"""
/*
<ExecutionEvent type="MojoSucceeded" class="org.apache.maven.lifecycle.internal.DefaultExecutionEvent" _time="2017-06-25 20:47:25.741">
<project baseDir="/home/jenki... | java | @Override
public void process(@Nonnull StepContext context, @Nonnull Element mavenSpyLogsElt) throws IOException, InterruptedException {
TaskListener listener = context.get(TaskListener.class);
if (listener == null) {
LOGGER.warning("TaskListener is NULL, default to stderr");
... | [
"@",
"Override",
"public",
"void",
"process",
"(",
"@",
"Nonnull",
"StepContext",
"context",
",",
"@",
"Nonnull",
"Element",
"mavenSpyLogsElt",
")",
"throws",
"IOException",
",",
"InterruptedException",
"{",
"TaskListener",
"listener",
"=",
"context",
".",
"get",
... | /*
<ExecutionEvent type="MojoSucceeded" class="org.apache.maven.lifecycle.internal.DefaultExecutionEvent" _time="2017-06-25 20:47:25.741">
<project baseDir="/home/jenkins/workspace/aProject" file="/home/jenkins/workspace/aProject/pom.xml" groupId="org.myorg" name="My Project" artifactId="my-maven-plugin" version="1.0.0... | [
"/",
"*",
"<ExecutionEvent",
"type",
"=",
"MojoSucceeded",
"class",
"=",
"org",
".",
"apache",
".",
"maven",
".",
"lifecycle",
".",
"internal",
".",
"DefaultExecutionEvent",
"_time",
"=",
"2017",
"-",
"06",
"-",
"25",
"20",
":",
"47",
":",
"25",
".",
"... | train | https://github.com/jenkinsci/pipeline-maven-plugin/blob/685d7dbb894fb4c976dbfa922e3caba8e8d5bed8/jenkins-plugin/src/main/java/org/jenkinsci/plugins/pipeline/maven/publishers/InvokerRunsPublisher.java#L79-L112 |
apache/incubator-gobblin | gobblin-data-management/src/main/java/org/apache/gobblin/data/management/trash/TrashFactory.java | TrashFactory.createTrash | public static Trash createTrash(FileSystem fs, Properties props, String user)
throws IOException {
"""
Creates a {@link org.apache.gobblin.data.management.trash.Trash} instance.
@param fs {@link org.apache.hadoop.fs.FileSystem} where trash is located.
@param props {@link java.util.Properties} used to gener... | java | public static Trash createTrash(FileSystem fs, Properties props, String user)
throws IOException {
if(props.containsKey(TRASH_TEST) && Boolean.parseBoolean(props.getProperty(TRASH_TEST))) {
LOG.info("Creating a test trash. Nothing will actually be deleted.");
return new TestTrash(fs, props, user);... | [
"public",
"static",
"Trash",
"createTrash",
"(",
"FileSystem",
"fs",
",",
"Properties",
"props",
",",
"String",
"user",
")",
"throws",
"IOException",
"{",
"if",
"(",
"props",
".",
"containsKey",
"(",
"TRASH_TEST",
")",
"&&",
"Boolean",
".",
"parseBoolean",
"... | Creates a {@link org.apache.gobblin.data.management.trash.Trash} instance.
@param fs {@link org.apache.hadoop.fs.FileSystem} where trash is located.
@param props {@link java.util.Properties} used to generate trash.
@param user $USER tokens in the trash path will be replaced by this string.
@return instance of {@link or... | [
"Creates",
"a",
"{"
] | train | https://github.com/apache/incubator-gobblin/blob/f029b4c0fea0fe4aa62f36dda2512344ff708bae/gobblin-data-management/src/main/java/org/apache/gobblin/data/management/trash/TrashFactory.java#L60-L75 |
netscaler/sdx_nitro | src/main/java/com/citrix/sdx/nitro/resource/config/xen/xen_smx_gsbvpx_image.java | xen_smx_gsbvpx_image.get_nitro_bulk_response | protected base_resource[] get_nitro_bulk_response(nitro_service service, String response) throws Exception {
"""
<pre>
Converts API response of bulk operation into object and returns the object array in case of get request.
</pre>
"""
xen_smx_gsbvpx_image_responses result = (xen_smx_gsbvpx_image_responses... | java | protected base_resource[] get_nitro_bulk_response(nitro_service service, String response) throws Exception
{
xen_smx_gsbvpx_image_responses result = (xen_smx_gsbvpx_image_responses) service.get_payload_formatter().string_to_resource(xen_smx_gsbvpx_image_responses.class, response);
if(result.errorcode != 0)
{... | [
"protected",
"base_resource",
"[",
"]",
"get_nitro_bulk_response",
"(",
"nitro_service",
"service",
",",
"String",
"response",
")",
"throws",
"Exception",
"{",
"xen_smx_gsbvpx_image_responses",
"result",
"=",
"(",
"xen_smx_gsbvpx_image_responses",
")",
"service",
".",
"... | <pre>
Converts API response of bulk operation into object and returns the object array in case of get request.
</pre> | [
"<pre",
">",
"Converts",
"API",
"response",
"of",
"bulk",
"operation",
"into",
"object",
"and",
"returns",
"the",
"object",
"array",
"in",
"case",
"of",
"get",
"request",
".",
"<",
"/",
"pre",
">"
] | train | https://github.com/netscaler/sdx_nitro/blob/c840919f1a8f7c0a5634c0f23d34fa14d1765ff1/src/main/java/com/citrix/sdx/nitro/resource/config/xen/xen_smx_gsbvpx_image.java#L264-L281 |
liferay/com-liferay-commerce | commerce-price-list-service/src/main/java/com/liferay/commerce/price/list/service/persistence/impl/CommercePriceListAccountRelPersistenceImpl.java | CommercePriceListAccountRelPersistenceImpl.findAll | @Override
public List<CommercePriceListAccountRel> findAll() {
"""
Returns all the commerce price list account rels.
@return the commerce price list account rels
"""
return findAll(QueryUtil.ALL_POS, QueryUtil.ALL_POS, null);
} | java | @Override
public List<CommercePriceListAccountRel> findAll() {
return findAll(QueryUtil.ALL_POS, QueryUtil.ALL_POS, null);
} | [
"@",
"Override",
"public",
"List",
"<",
"CommercePriceListAccountRel",
">",
"findAll",
"(",
")",
"{",
"return",
"findAll",
"(",
"QueryUtil",
".",
"ALL_POS",
",",
"QueryUtil",
".",
"ALL_POS",
",",
"null",
")",
";",
"}"
] | Returns all the commerce price list account rels.
@return the commerce price list account rels | [
"Returns",
"all",
"the",
"commerce",
"price",
"list",
"account",
"rels",
"."
] | train | https://github.com/liferay/com-liferay-commerce/blob/9e54362d7f59531fc684016ba49ee7cdc3a2f22b/commerce-price-list-service/src/main/java/com/liferay/commerce/price/list/service/persistence/impl/CommercePriceListAccountRelPersistenceImpl.java#L2958-L2961 |
SimonVT/android-menudrawer | menudrawer/src/net/simonvt/menudrawer/MenuDrawer.java | MenuDrawer.setActiveView | public void setActiveView(View v, int position) {
"""
Set the active view.
If the mdActiveIndicator attribute is set, this View will have the indicator drawn next to it.
@param v The active view.
@param position Optional position, usually used with ListView. v.setTag(R.id.mdActiveViewPosition, position... | java | public void setActiveView(View v, int position) {
final View oldView = mActiveView;
mActiveView = v;
mActivePosition = position;
if (mAllowIndicatorAnimation && oldView != null) {
startAnimatingIndicator();
}
invalidate();
} | [
"public",
"void",
"setActiveView",
"(",
"View",
"v",
",",
"int",
"position",
")",
"{",
"final",
"View",
"oldView",
"=",
"mActiveView",
";",
"mActiveView",
"=",
"v",
";",
"mActivePosition",
"=",
"position",
";",
"if",
"(",
"mAllowIndicatorAnimation",
"&&",
"o... | Set the active view.
If the mdActiveIndicator attribute is set, this View will have the indicator drawn next to it.
@param v The active view.
@param position Optional position, usually used with ListView. v.setTag(R.id.mdActiveViewPosition, position)
must be called first. | [
"Set",
"the",
"active",
"view",
".",
"If",
"the",
"mdActiveIndicator",
"attribute",
"is",
"set",
"this",
"View",
"will",
"have",
"the",
"indicator",
"drawn",
"next",
"to",
"it",
"."
] | train | https://github.com/SimonVT/android-menudrawer/blob/59e8d18e109c77d911b8b63232d66d5f0551cf6a/menudrawer/src/net/simonvt/menudrawer/MenuDrawer.java#L1005-L1015 |
pravega/pravega | segmentstore/storage/impl/src/main/java/io/pravega/segmentstore/storage/impl/bookkeeper/BookKeeperLog.java | BookKeeperLog.handleWriteException | private void handleWriteException(int responseCode, Write write) {
"""
Handles an exception after a Write operation, converts it to a Pravega Exception and completes the given future
exceptionally using it.
@param responseCode The BookKeeper response code to interpret.
@param write The Write that f... | java | private void handleWriteException(int responseCode, Write write) {
assert responseCode != BKException.Code.OK : "cannot handle an exception when responseCode == " + BKException.Code.OK;
Exception ex = BKException.create(responseCode);
try {
if (ex instanceof BKException.BKLedgerFence... | [
"private",
"void",
"handleWriteException",
"(",
"int",
"responseCode",
",",
"Write",
"write",
")",
"{",
"assert",
"responseCode",
"!=",
"BKException",
".",
"Code",
".",
"OK",
":",
"\"cannot handle an exception when responseCode == \"",
"+",
"BKException",
".",
"Code",... | Handles an exception after a Write operation, converts it to a Pravega Exception and completes the given future
exceptionally using it.
@param responseCode The BookKeeper response code to interpret.
@param write The Write that failed. | [
"Handles",
"an",
"exception",
"after",
"a",
"Write",
"operation",
"converts",
"it",
"to",
"a",
"Pravega",
"Exception",
"and",
"completes",
"the",
"given",
"future",
"exceptionally",
"using",
"it",
"."
] | train | https://github.com/pravega/pravega/blob/6e24df7470669b3956a07018f52b2c6b3c2a3503/segmentstore/storage/impl/src/main/java/io/pravega/segmentstore/storage/impl/bookkeeper/BookKeeperLog.java#L616-L643 |
jbundle/jbundle | base/screen/view/xml/src/main/java/org/jbundle/base/screen/view/xml/XTEView.java | XTEView.printData | public boolean printData(PrintWriter out, int iPrintOptions) {
"""
Print this field's data in XML format.
@return true if default params were found for this form.
@param out The http output stream.
@exception DBException File exception.
"""
if ((this.getScreenField().getConverter().getField() instan... | java | public boolean printData(PrintWriter out, int iPrintOptions)
{
if ((this.getScreenField().getConverter().getField() instanceof XmlField)
|| (this.getScreenField().getConverter().getField() instanceof HtmlField)
|| (this.getScreenField().getConverter().getField() instanceof XMLPropert... | [
"public",
"boolean",
"printData",
"(",
"PrintWriter",
"out",
",",
"int",
"iPrintOptions",
")",
"{",
"if",
"(",
"(",
"this",
".",
"getScreenField",
"(",
")",
".",
"getConverter",
"(",
")",
".",
"getField",
"(",
")",
"instanceof",
"XmlField",
")",
"||",
"(... | Print this field's data in XML format.
@return true if default params were found for this form.
@param out The http output stream.
@exception DBException File exception. | [
"Print",
"this",
"field",
"s",
"data",
"in",
"XML",
"format",
"."
] | train | https://github.com/jbundle/jbundle/blob/4037fcfa85f60c7d0096c453c1a3cd573c2b0abc/base/screen/view/xml/src/main/java/org/jbundle/base/screen/view/xml/XTEView.java#L73-L88 |
dbracewell/mango | src/main/java/com/davidbracewell/conversion/Val.java | Val.asList | @SuppressWarnings("unchecked")
public <T> List<T> asList(Class<T> itemType) {
"""
Converts the object to a List
@param <T> the type parameter
@param itemType The class of the item in the List
@return The object as a List
"""
return asCollection(List.class, itemType);
} | java | @SuppressWarnings("unchecked")
public <T> List<T> asList(Class<T> itemType) {
return asCollection(List.class, itemType);
} | [
"@",
"SuppressWarnings",
"(",
"\"unchecked\"",
")",
"public",
"<",
"T",
">",
"List",
"<",
"T",
">",
"asList",
"(",
"Class",
"<",
"T",
">",
"itemType",
")",
"{",
"return",
"asCollection",
"(",
"List",
".",
"class",
",",
"itemType",
")",
";",
"}"
] | Converts the object to a List
@param <T> the type parameter
@param itemType The class of the item in the List
@return The object as a List | [
"Converts",
"the",
"object",
"to",
"a",
"List"
] | train | https://github.com/dbracewell/mango/blob/2cec08826f1fccd658694dd03abce10fc97618ec/src/main/java/com/davidbracewell/conversion/Val.java#L730-L733 |
Credntia/MVBarcodeReader | mvbarcodereader/src/main/java/devliving/online/mvbarcodereader/BarcodeGraphicTracker.java | BarcodeGraphicTracker.onNewItem | @Override
public void onNewItem(int id, Barcode item) {
"""
Start tracking the detected item instance within the item overlay.
"""
mGraphic.setId(id);
if (mListener != null) mListener.onNewBarcodeDetected(id, item);
} | java | @Override
public void onNewItem(int id, Barcode item) {
mGraphic.setId(id);
if (mListener != null) mListener.onNewBarcodeDetected(id, item);
} | [
"@",
"Override",
"public",
"void",
"onNewItem",
"(",
"int",
"id",
",",
"Barcode",
"item",
")",
"{",
"mGraphic",
".",
"setId",
"(",
"id",
")",
";",
"if",
"(",
"mListener",
"!=",
"null",
")",
"mListener",
".",
"onNewBarcodeDetected",
"(",
"id",
",",
"ite... | Start tracking the detected item instance within the item overlay. | [
"Start",
"tracking",
"the",
"detected",
"item",
"instance",
"within",
"the",
"item",
"overlay",
"."
] | train | https://github.com/Credntia/MVBarcodeReader/blob/2a2561f1c3b4d4e3c046a341fbf23a31eabfda8d/mvbarcodereader/src/main/java/devliving/online/mvbarcodereader/BarcodeGraphicTracker.java#L50-L54 |
couchbase/couchbase-java-client | src/main/java/com/couchbase/client/java/analytics/AnalyticsQuery.java | AnalyticsQuery.parameterized | public static ParameterizedAnalyticsQuery parameterized(final String statement,
final JsonArray positionalParams) {
"""
Creates an {@link AnalyticsQuery} with positional parameters as part of the query.
@param statement the statement to send.
@param positionalParams the positional parameters which will... | java | public static ParameterizedAnalyticsQuery parameterized(final String statement,
final JsonArray positionalParams) {
return new ParameterizedAnalyticsQuery(statement, positionalParams, null, null);
} | [
"public",
"static",
"ParameterizedAnalyticsQuery",
"parameterized",
"(",
"final",
"String",
"statement",
",",
"final",
"JsonArray",
"positionalParams",
")",
"{",
"return",
"new",
"ParameterizedAnalyticsQuery",
"(",
"statement",
",",
"positionalParams",
",",
"null",
",",... | Creates an {@link AnalyticsQuery} with positional parameters as part of the query.
@param statement the statement to send.
@param positionalParams the positional parameters which will be put in for the placeholders.
@return a {@link AnalyticsQuery}. | [
"Creates",
"an",
"{",
"@link",
"AnalyticsQuery",
"}",
"with",
"positional",
"parameters",
"as",
"part",
"of",
"the",
"query",
"."
] | train | https://github.com/couchbase/couchbase-java-client/blob/f36a0ee0c66923bdde47838ca543e50cbaa99e14/src/main/java/com/couchbase/client/java/analytics/AnalyticsQuery.java#L80-L83 |
mcxiaoke/Android-Next | recycler/src/main/java/com/mcxiaoke/next/recycler/HeaderFooterRecyclerAdapter.java | HeaderFooterRecyclerAdapter.notifyFooterItemRangeChanged | public final void notifyFooterItemRangeChanged(int positionStart, int itemCount) {
"""
Notifies that multiple footer items are changed.
@param positionStart the position.
@param itemCount the item count.
"""
if (positionStart < 0 || itemCount < 0 || positionStart + itemCount > footerItemCount) ... | java | public final void notifyFooterItemRangeChanged(int positionStart, int itemCount) {
if (positionStart < 0 || itemCount < 0 || positionStart + itemCount > footerItemCount) {
throw new IndexOutOfBoundsException("The given range [" + positionStart + " - "
+ (positionStart + itemCount... | [
"public",
"final",
"void",
"notifyFooterItemRangeChanged",
"(",
"int",
"positionStart",
",",
"int",
"itemCount",
")",
"{",
"if",
"(",
"positionStart",
"<",
"0",
"||",
"itemCount",
"<",
"0",
"||",
"positionStart",
"+",
"itemCount",
">",
"footerItemCount",
")",
... | Notifies that multiple footer items are changed.
@param positionStart the position.
@param itemCount the item count. | [
"Notifies",
"that",
"multiple",
"footer",
"items",
"are",
"changed",
"."
] | train | https://github.com/mcxiaoke/Android-Next/blob/1bfdf99d0b81a849aa0fa6697c53ed673151ca39/recycler/src/main/java/com/mcxiaoke/next/recycler/HeaderFooterRecyclerAdapter.java#L361-L368 |
NordicSemiconductor/Android-DFU-Library | dfu/src/main/java/no/nordicsemi/android/dfu/DfuBaseService.java | DfuBaseService.report | private void report(final int error) {
"""
Creates or updates the notification in the Notification Manager. Sends broadcast with given
error number to the activity.
@param error the error number.
"""
sendErrorBroadcast(error);
if (mDisableNotification)
return;
// create or update notification:
... | java | private void report(final int error) {
sendErrorBroadcast(error);
if (mDisableNotification)
return;
// create or update notification:
final String deviceAddress = mDeviceAddress;
final String deviceName = mDeviceName != null ? mDeviceName : getString(R.string.dfu_unknown_name);
final NotificationCompa... | [
"private",
"void",
"report",
"(",
"final",
"int",
"error",
")",
"{",
"sendErrorBroadcast",
"(",
"error",
")",
";",
"if",
"(",
"mDisableNotification",
")",
"return",
";",
"// create or update notification:",
"final",
"String",
"deviceAddress",
"=",
"mDeviceAddress",
... | Creates or updates the notification in the Notification Manager. Sends broadcast with given
error number to the activity.
@param error the error number. | [
"Creates",
"or",
"updates",
"the",
"notification",
"in",
"the",
"Notification",
"Manager",
".",
"Sends",
"broadcast",
"with",
"given",
"error",
"number",
"to",
"the",
"activity",
"."
] | train | https://github.com/NordicSemiconductor/Android-DFU-Library/blob/ec14c8c522bebe801a9a4c3dfbbeb1f53262c03f/dfu/src/main/java/no/nordicsemi/android/dfu/DfuBaseService.java#L1741-L1775 |
ralscha/wampspring | src/main/java/ch/rasc/wampspring/method/InvocableWampHandlerMethod.java | InvocableWampHandlerMethod.assertTargetBean | private void assertTargetBean(Method method, Object targetBean, Object[] args) {
"""
Assert that the target bean class is an instance of the class where the given
method is declared. In some cases the actual controller instance at request-
processing time may be a JDK dynamic proxy (lazy initialization, prototyp... | java | private void assertTargetBean(Method method, Object targetBean, Object[] args) {
Class<?> methodDeclaringClass = method.getDeclaringClass();
Class<?> targetBeanClass = targetBean.getClass();
if (!methodDeclaringClass.isAssignableFrom(targetBeanClass)) {
String msg = "The mapped controller method class '"
... | [
"private",
"void",
"assertTargetBean",
"(",
"Method",
"method",
",",
"Object",
"targetBean",
",",
"Object",
"[",
"]",
"args",
")",
"{",
"Class",
"<",
"?",
">",
"methodDeclaringClass",
"=",
"method",
".",
"getDeclaringClass",
"(",
")",
";",
"Class",
"<",
"?... | Assert that the target bean class is an instance of the class where the given
method is declared. In some cases the actual controller instance at request-
processing time may be a JDK dynamic proxy (lazy initialization, prototype beans,
and others). {@code @Controller}'s that require proxying should prefer class-based
... | [
"Assert",
"that",
"the",
"target",
"bean",
"class",
"is",
"an",
"instance",
"of",
"the",
"class",
"where",
"the",
"given",
"method",
"is",
"declared",
".",
"In",
"some",
"cases",
"the",
"actual",
"controller",
"instance",
"at",
"request",
"-",
"processing",
... | train | https://github.com/ralscha/wampspring/blob/7571bb6773b848c580b29890587eb35397bfe5b5/src/main/java/ch/rasc/wampspring/method/InvocableWampHandlerMethod.java#L202-L214 |
Azure/azure-sdk-for-java | network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/PacketCapturesInner.java | PacketCapturesInner.beginCreate | public PacketCaptureResultInner beginCreate(String resourceGroupName, String networkWatcherName, String packetCaptureName, PacketCaptureInner parameters) {
"""
Create and start a packet capture on the specified VM.
@param resourceGroupName The name of the resource group.
@param networkWatcherName The name of t... | java | public PacketCaptureResultInner beginCreate(String resourceGroupName, String networkWatcherName, String packetCaptureName, PacketCaptureInner parameters) {
return beginCreateWithServiceResponseAsync(resourceGroupName, networkWatcherName, packetCaptureName, parameters).toBlocking().single().body();
} | [
"public",
"PacketCaptureResultInner",
"beginCreate",
"(",
"String",
"resourceGroupName",
",",
"String",
"networkWatcherName",
",",
"String",
"packetCaptureName",
",",
"PacketCaptureInner",
"parameters",
")",
"{",
"return",
"beginCreateWithServiceResponseAsync",
"(",
"resource... | Create and start a packet capture on the specified VM.
@param resourceGroupName The name of the resource group.
@param networkWatcherName The name of the network watcher.
@param packetCaptureName The name of the packet capture session.
@param parameters Parameters that define the create packet capture operation.
@thro... | [
"Create",
"and",
"start",
"a",
"packet",
"capture",
"on",
"the",
"specified",
"VM",
"."
] | 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/PacketCapturesInner.java#L200-L202 |
raydac/netbeans-mmd-plugin | mind-map/mind-map-swing-panel/src/main/java/com/igormaznitsa/mindmap/swing/panel/utils/Utils.java | Utils.findInputStreamForResource | @Nullable
public static InputStream findInputStreamForResource(@Nonnull final ZipFile zipFile, @Nonnull final String resourcePath) throws IOException {
"""
Get input stream for resource in zip file.
@param zipFile zip file
@param resourcePath path to resource
@return input stream for resource or null if not... | java | @Nullable
public static InputStream findInputStreamForResource(@Nonnull final ZipFile zipFile, @Nonnull final String resourcePath) throws IOException {
final ZipEntry entry = zipFile.getEntry(resourcePath);
InputStream result = null;
if (entry != null && !entry.isDirectory()) {
result = zipFile.ge... | [
"@",
"Nullable",
"public",
"static",
"InputStream",
"findInputStreamForResource",
"(",
"@",
"Nonnull",
"final",
"ZipFile",
"zipFile",
",",
"@",
"Nonnull",
"final",
"String",
"resourcePath",
")",
"throws",
"IOException",
"{",
"final",
"ZipEntry",
"entry",
"=",
"zip... | Get input stream for resource in zip file.
@param zipFile zip file
@param resourcePath path to resource
@return input stream for resource or null if not found or directory
@throws IOException if there is any transport error | [
"Get",
"input",
"stream",
"for",
"resource",
"in",
"zip",
"file",
"."
] | train | https://github.com/raydac/netbeans-mmd-plugin/blob/997493d23556a25354372b6419a64a0fbd0ac6ba/mind-map/mind-map-swing-panel/src/main/java/com/igormaznitsa/mindmap/swing/panel/utils/Utils.java#L99-L110 |
Azure/azure-sdk-for-java | eventhubs/data-plane/azure-eventhubs-eph/src/main/java/com/microsoft/azure/eventprocessorhost/EventProcessorHost.java | EventProcessorHost.registerEventProcessor | public <T extends IEventProcessor> CompletableFuture<Void> registerEventProcessor(Class<T> eventProcessorType) {
"""
Register class for event processor and start processing.
<p>
This overload uses the default event processor factory, which simply creates new instances of
the registered event processor class, an... | java | public <T extends IEventProcessor> CompletableFuture<Void> registerEventProcessor(Class<T> eventProcessorType) {
DefaultEventProcessorFactory<T> defaultFactory = new DefaultEventProcessorFactory<T>();
defaultFactory.setEventProcessorClass(eventProcessorType);
return registerEventProcessorFactory... | [
"public",
"<",
"T",
"extends",
"IEventProcessor",
">",
"CompletableFuture",
"<",
"Void",
">",
"registerEventProcessor",
"(",
"Class",
"<",
"T",
">",
"eventProcessorType",
")",
"{",
"DefaultEventProcessorFactory",
"<",
"T",
">",
"defaultFactory",
"=",
"new",
"Defau... | Register class for event processor and start processing.
<p>
This overload uses the default event processor factory, which simply creates new instances of
the registered event processor class, and uses all the default options.
<p>
The returned CompletableFuture completes when host initialization is finished. Initializa... | [
"Register",
"class",
"for",
"event",
"processor",
"and",
"start",
"processing",
".",
"<p",
">",
"This",
"overload",
"uses",
"the",
"default",
"event",
"processor",
"factory",
"which",
"simply",
"creates",
"new",
"instances",
"of",
"the",
"registered",
"event",
... | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/eventhubs/data-plane/azure-eventhubs-eph/src/main/java/com/microsoft/azure/eventprocessorhost/EventProcessorHost.java#L404-L408 |
roboconf/roboconf-platform | core/roboconf-target-docker/src/main/java/net/roboconf/target/docker/internal/DockerUtils.java | DockerUtils.findImageByTag | public static Image findImageByTag( String imageTag, List<Image> images ) {
"""
Finds an image by tag.
@param imageTag the image tag (not null)
@param images a non-null list of images
@return an image, or null if none was found
"""
Image result = null;
for( Image img : images ) {
String[] tags = img... | java | public static Image findImageByTag( String imageTag, List<Image> images ) {
Image result = null;
for( Image img : images ) {
String[] tags = img.getRepoTags();
if( tags == null )
continue;
for( String s : tags ) {
if( s.contains( imageTag )) {
result = img;
break;
}
}
}
retu... | [
"public",
"static",
"Image",
"findImageByTag",
"(",
"String",
"imageTag",
",",
"List",
"<",
"Image",
">",
"images",
")",
"{",
"Image",
"result",
"=",
"null",
";",
"for",
"(",
"Image",
"img",
":",
"images",
")",
"{",
"String",
"[",
"]",
"tags",
"=",
"... | Finds an image by tag.
@param imageTag the image tag (not null)
@param images a non-null list of images
@return an image, or null if none was found | [
"Finds",
"an",
"image",
"by",
"tag",
"."
] | train | https://github.com/roboconf/roboconf-platform/blob/add54eead479effb138d0ff53a2d637902b82702/core/roboconf-target-docker/src/main/java/net/roboconf/target/docker/internal/DockerUtils.java#L161-L178 |
hawkular/hawkular-agent | hawkular-agent-core/src/main/java/org/hawkular/agent/monitor/cmd/AbstractDMRResourcePathCommand.java | AbstractDMRResourcePathCommand.setServerRefreshIndicator | protected void setServerRefreshIndicator(OperationResult<?> opResults, RESP response) {
"""
Given the results of an operation, this will set the {@link ServerRefreshIndicator}
found in those results in the given response.
@param opResults contains the DMR results
@param response the response message
"""
... | java | protected void setServerRefreshIndicator(OperationResult<?> opResults, RESP response) {
Optional<String> processState = opResults.getOptionalProcessState();
if (processState.isPresent()) {
try {
response.setServerRefreshIndicator(ServerRefreshIndicator.fromValue(processState.... | [
"protected",
"void",
"setServerRefreshIndicator",
"(",
"OperationResult",
"<",
"?",
">",
"opResults",
",",
"RESP",
"response",
")",
"{",
"Optional",
"<",
"String",
">",
"processState",
"=",
"opResults",
".",
"getOptionalProcessState",
"(",
")",
";",
"if",
"(",
... | Given the results of an operation, this will set the {@link ServerRefreshIndicator}
found in those results in the given response.
@param opResults contains the DMR results
@param response the response message | [
"Given",
"the",
"results",
"of",
"an",
"operation",
"this",
"will",
"set",
"the",
"{",
"@link",
"ServerRefreshIndicator",
"}",
"found",
"in",
"those",
"results",
"in",
"the",
"given",
"response",
"."
] | train | https://github.com/hawkular/hawkular-agent/blob/a7a88fc7e4f12302e4c4306d1c91e11f81c8b811/hawkular-agent-core/src/main/java/org/hawkular/agent/monitor/cmd/AbstractDMRResourcePathCommand.java#L171-L180 |
stratosphere/stratosphere | stratosphere-addons/spargel/src/main/java/eu/stratosphere/spargel/java/VertexCentricIteration.java | VertexCentricIteration.setInput | @Override
public void setInput(DataSet<Tuple2<VertexKey, VertexValue>> inputData) {
"""
Sets the input data set for this operator. In the case of this operator this input data set represents
the set of vertices with their initial state.
@param inputData The input data set, which in the case of this operator r... | java | @Override
public void setInput(DataSet<Tuple2<VertexKey, VertexValue>> inputData) {
// sanity check that we really have two tuples
TypeInformation<Tuple2<VertexKey, VertexValue>> inputType = inputData.getType();
Validate.isTrue(inputType.isTupleType() && inputType.getArity() == 2, "The input data set (the initia... | [
"@",
"Override",
"public",
"void",
"setInput",
"(",
"DataSet",
"<",
"Tuple2",
"<",
"VertexKey",
",",
"VertexValue",
">",
">",
"inputData",
")",
"{",
"// sanity check that we really have two tuples",
"TypeInformation",
"<",
"Tuple2",
"<",
"VertexKey",
",",
"VertexVal... | Sets the input data set for this operator. In the case of this operator this input data set represents
the set of vertices with their initial state.
@param inputData The input data set, which in the case of this operator represents the set of
vertices with their initial state.
@see eu.stratosphere.api.java.operators.... | [
"Sets",
"the",
"input",
"data",
"set",
"for",
"this",
"operator",
".",
"In",
"the",
"case",
"of",
"this",
"operator",
"this",
"input",
"data",
"set",
"represents",
"the",
"set",
"of",
"vertices",
"with",
"their",
"initial",
"state",
"."
] | train | https://github.com/stratosphere/stratosphere/blob/c543a08f9676c5b2b0a7088123bd6e795a8ae0c8/stratosphere-addons/spargel/src/main/java/eu/stratosphere/spargel/java/VertexCentricIteration.java#L244-L260 |
openengsb/openengsb | components/ekb/transformation-wonderland/src/main/java/org/openengsb/core/ekb/transformation/wonderland/internal/operation/AbstractStandardTransformationOperation.java | AbstractStandardTransformationOperation.getParameterOrDefault | protected String getParameterOrDefault(Map<String, String> parameters, String paramName, String defaultValue)
throws TransformationOperationException {
"""
Get the parameter with the given parameter name from the parameter map. If the parameters does not contain such a
parameter, take the default value in... | java | protected String getParameterOrDefault(Map<String, String> parameters, String paramName, String defaultValue)
throws TransformationOperationException {
return getParameter(parameters, paramName, false, defaultValue);
} | [
"protected",
"String",
"getParameterOrDefault",
"(",
"Map",
"<",
"String",
",",
"String",
">",
"parameters",
",",
"String",
"paramName",
",",
"String",
"defaultValue",
")",
"throws",
"TransformationOperationException",
"{",
"return",
"getParameter",
"(",
"parameters",... | Get the parameter with the given parameter name from the parameter map. If the parameters does not contain such a
parameter, take the default value instead. | [
"Get",
"the",
"parameter",
"with",
"the",
"given",
"parameter",
"name",
"from",
"the",
"parameter",
"map",
".",
"If",
"the",
"parameters",
"does",
"not",
"contain",
"such",
"a",
"parameter",
"take",
"the",
"default",
"value",
"instead",
"."
] | train | https://github.com/openengsb/openengsb/blob/d39058000707f617cd405629f9bc7f17da7b414a/components/ekb/transformation-wonderland/src/main/java/org/openengsb/core/ekb/transformation/wonderland/internal/operation/AbstractStandardTransformationOperation.java#L85-L88 |
joniles/mpxj | src/main/java/net/sf/mpxj/mspdi/DatatypeConverter.java | DatatypeConverter.parseDurationInThousanthsOfMinutes | public static final Duration parseDurationInThousanthsOfMinutes(ProjectProperties properties, Number value, TimeUnit targetTimeUnit) {
"""
Parse duration represented in thousandths of minutes.
@param properties project properties
@param value duration value
@param targetTimeUnit required output time units
@r... | java | public static final Duration parseDurationInThousanthsOfMinutes(ProjectProperties properties, Number value, TimeUnit targetTimeUnit)
{
return parseDurationInFractionsOfMinutes(properties, value, targetTimeUnit, 1000);
} | [
"public",
"static",
"final",
"Duration",
"parseDurationInThousanthsOfMinutes",
"(",
"ProjectProperties",
"properties",
",",
"Number",
"value",
",",
"TimeUnit",
"targetTimeUnit",
")",
"{",
"return",
"parseDurationInFractionsOfMinutes",
"(",
"properties",
",",
"value",
",",... | Parse duration represented in thousandths of minutes.
@param properties project properties
@param value duration value
@param targetTimeUnit required output time units
@return Duration instance | [
"Parse",
"duration",
"represented",
"in",
"thousandths",
"of",
"minutes",
"."
] | train | https://github.com/joniles/mpxj/blob/143ea0e195da59cd108f13b3b06328e9542337e8/src/main/java/net/sf/mpxj/mspdi/DatatypeConverter.java#L1309-L1312 |
VoltDB/voltdb | src/frontend/org/voltdb/jdbc/JDBC4PreparedStatement.java | JDBC4PreparedStatement.setRowId | @Override
public void setRowId(int parameterIndex, RowId x) throws SQLException {
"""
Sets the designated parameter to the given java.sql.RowId object.
"""
checkParameterBounds(parameterIndex);
throw SQLError.noSupport();
} | java | @Override
public void setRowId(int parameterIndex, RowId x) throws SQLException
{
checkParameterBounds(parameterIndex);
throw SQLError.noSupport();
} | [
"@",
"Override",
"public",
"void",
"setRowId",
"(",
"int",
"parameterIndex",
",",
"RowId",
"x",
")",
"throws",
"SQLException",
"{",
"checkParameterBounds",
"(",
"parameterIndex",
")",
";",
"throw",
"SQLError",
".",
"noSupport",
"(",
")",
";",
"}"
] | Sets the designated parameter to the given java.sql.RowId object. | [
"Sets",
"the",
"designated",
"parameter",
"to",
"the",
"given",
"java",
".",
"sql",
".",
"RowId",
"object",
"."
] | train | https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/src/frontend/org/voltdb/jdbc/JDBC4PreparedStatement.java#L526-L531 |
rhuss/jolokia | agent/core/src/main/java/org/jolokia/request/JmxExecRequest.java | JmxExecRequest.newCreator | static RequestCreator<JmxExecRequest> newCreator() {
"""
Creator for {@link JmxExecRequest}s
@return the creator implementation
"""
return new RequestCreator<JmxExecRequest>() {
/** {@inheritDoc} */
public JmxExecRequest create(Stack<String> pStack, ProcessingParameters pPara... | java | static RequestCreator<JmxExecRequest> newCreator() {
return new RequestCreator<JmxExecRequest>() {
/** {@inheritDoc} */
public JmxExecRequest create(Stack<String> pStack, ProcessingParameters pParams) throws MalformedObjectNameException {
return new JmxExecRequest(
... | [
"static",
"RequestCreator",
"<",
"JmxExecRequest",
">",
"newCreator",
"(",
")",
"{",
"return",
"new",
"RequestCreator",
"<",
"JmxExecRequest",
">",
"(",
")",
"{",
"/** {@inheritDoc} */",
"public",
"JmxExecRequest",
"create",
"(",
"Stack",
"<",
"String",
">",
"pS... | Creator for {@link JmxExecRequest}s
@return the creator implementation | [
"Creator",
"for",
"{",
"@link",
"JmxExecRequest",
"}",
"s"
] | train | https://github.com/rhuss/jolokia/blob/dc95e7bef859b1829776c5a84c8f7738f5d7d9c3/agent/core/src/main/java/org/jolokia/request/JmxExecRequest.java#L111-L128 |
czyzby/gdx-lml | lml/src/main/java/com/github/czyzby/lml/parser/impl/tag/Dtd.java | Dtd.saveSchema | public static void saveSchema(final LmlParser parser, final Appendable appendable) {
"""
Saves DTD schema file containing all possible tags and their attributes. Any problems with the generation will
be logged. This is a relatively heavy operation and should be done only during development.
@param parser conta... | java | public static void saveSchema(final LmlParser parser, final Appendable appendable) {
try {
new Dtd().getDtdSchema(parser, appendable);
} catch (final IOException exception) {
throw new GdxRuntimeException("Unable to append to file.", exception);
}
} | [
"public",
"static",
"void",
"saveSchema",
"(",
"final",
"LmlParser",
"parser",
",",
"final",
"Appendable",
"appendable",
")",
"{",
"try",
"{",
"new",
"Dtd",
"(",
")",
".",
"getDtdSchema",
"(",
"parser",
",",
"appendable",
")",
";",
"}",
"catch",
"(",
"fi... | Saves DTD schema file containing all possible tags and their attributes. Any problems with the generation will
be logged. This is a relatively heavy operation and should be done only during development.
@param parser contains parsing data. Used to create mock-up actors. The skin MUST be fully loaded and contain all
us... | [
"Saves",
"DTD",
"schema",
"file",
"containing",
"all",
"possible",
"tags",
"and",
"their",
"attributes",
".",
"Any",
"problems",
"with",
"the",
"generation",
"will",
"be",
"logged",
".",
"This",
"is",
"a",
"relatively",
"heavy",
"operation",
"and",
"should",
... | train | https://github.com/czyzby/gdx-lml/blob/7623b322e6afe49ad4dd636c80c230150a1cfa4e/lml/src/main/java/com/github/czyzby/lml/parser/impl/tag/Dtd.java#L54-L60 |
j-easy/easy-random | easy-random-core/src/main/java/org/jeasy/random/randomizers/text/StringRandomizer.java | StringRandomizer.aNewStringRandomizer | public static StringRandomizer aNewStringRandomizer(final Charset charset, final int minLength, final int maxLength, final long seed) {
"""
Create a new {@link StringRandomizer}.
@param charset to use
@param maxLength of the String to generate
@param minLength of the String to generate
@param seed ini... | java | public static StringRandomizer aNewStringRandomizer(final Charset charset, final int minLength, final int maxLength, final long seed) {
if (minLength > maxLength) {
throw new IllegalArgumentException("minLength should be less than or equal to maxLength");
}
return new StringRandomize... | [
"public",
"static",
"StringRandomizer",
"aNewStringRandomizer",
"(",
"final",
"Charset",
"charset",
",",
"final",
"int",
"minLength",
",",
"final",
"int",
"maxLength",
",",
"final",
"long",
"seed",
")",
"{",
"if",
"(",
"minLength",
">",
"maxLength",
")",
"{",
... | Create a new {@link StringRandomizer}.
@param charset to use
@param maxLength of the String to generate
@param minLength of the String to generate
@param seed initial seed
@return a new {@link StringRandomizer}. | [
"Create",
"a",
"new",
"{",
"@link",
"StringRandomizer",
"}",
"."
] | train | https://github.com/j-easy/easy-random/blob/816b0d6a74c7288af111e70ae1b0b57d7fe3b59d/easy-random-core/src/main/java/org/jeasy/random/randomizers/text/StringRandomizer.java#L246-L251 |
phax/ph-commons | ph-commons/src/main/java/com/helger/commons/io/stream/StreamHelper.java | StreamHelper.writeStream | @Nonnull
public static ESuccess writeStream (@WillClose @Nonnull final OutputStream aOS, @Nonnull final byte [] aBuf) {
"""
Write bytes to an {@link OutputStream}.
@param aOS
The output stream to write to. May not be <code>null</code>. Is closed
independent of error or success.
@param aBuf
The byte array ... | java | @Nonnull
public static ESuccess writeStream (@WillClose @Nonnull final OutputStream aOS, @Nonnull final byte [] aBuf)
{
return writeStream (aOS, aBuf, 0, aBuf.length);
} | [
"@",
"Nonnull",
"public",
"static",
"ESuccess",
"writeStream",
"(",
"@",
"WillClose",
"@",
"Nonnull",
"final",
"OutputStream",
"aOS",
",",
"@",
"Nonnull",
"final",
"byte",
"[",
"]",
"aBuf",
")",
"{",
"return",
"writeStream",
"(",
"aOS",
",",
"aBuf",
",",
... | Write bytes to an {@link OutputStream}.
@param aOS
The output stream to write to. May not be <code>null</code>. Is closed
independent of error or success.
@param aBuf
The byte array to be written. May not be <code>null</code>.
@return {@link ESuccess} | [
"Write",
"bytes",
"to",
"an",
"{",
"@link",
"OutputStream",
"}",
"."
] | train | https://github.com/phax/ph-commons/blob/d28c03565f44a0b804d96028d0969f9bb38c4313/ph-commons/src/main/java/com/helger/commons/io/stream/StreamHelper.java#L1303-L1307 |
SonarSource/sonarqube | sonar-core/src/main/java/org/sonar/core/util/Protobuf.java | Protobuf.writeStream | public static <MSG extends Message> void writeStream(Iterable<MSG> messages, OutputStream output) {
"""
Streams multiple messages to {@code output}. Reading the messages back requires to
call methods {@code readStream(...)}.
<p>
See https://developers.google.com/protocol-buffers/docs/techniques#streaming
</p>
... | java | public static <MSG extends Message> void writeStream(Iterable<MSG> messages, OutputStream output) {
try {
for (Message message : messages) {
message.writeDelimitedTo(output);
}
} catch (Exception e) {
throw ContextException.of("Unable to write messages", e);
}
} | [
"public",
"static",
"<",
"MSG",
"extends",
"Message",
">",
"void",
"writeStream",
"(",
"Iterable",
"<",
"MSG",
">",
"messages",
",",
"OutputStream",
"output",
")",
"{",
"try",
"{",
"for",
"(",
"Message",
"message",
":",
"messages",
")",
"{",
"message",
"... | Streams multiple messages to {@code output}. Reading the messages back requires to
call methods {@code readStream(...)}.
<p>
See https://developers.google.com/protocol-buffers/docs/techniques#streaming
</p> | [
"Streams",
"multiple",
"messages",
"to",
"{"
] | train | https://github.com/SonarSource/sonarqube/blob/2fffa4c2f79ae3714844d7742796e82822b6a98a/sonar-core/src/main/java/org/sonar/core/util/Protobuf.java#L111-L119 |
j256/ormlite-core | src/main/java/com/j256/ormlite/stmt/StatementExecutor.java | StatementExecutor.callBatchTasks | public <CT> CT callBatchTasks(ConnectionSource connectionSource, Callable<CT> callable) throws SQLException {
"""
Call batch tasks inside of a connection which may, or may not, have been "saved".
"""
if (connectionSource.isSingleConnection(tableInfo.getTableName())) {
synchronized (this) {
return doCa... | java | public <CT> CT callBatchTasks(ConnectionSource connectionSource, Callable<CT> callable) throws SQLException {
if (connectionSource.isSingleConnection(tableInfo.getTableName())) {
synchronized (this) {
return doCallBatchTasks(connectionSource, callable);
}
} else {
return doCallBatchTasks(connectionSour... | [
"public",
"<",
"CT",
">",
"CT",
"callBatchTasks",
"(",
"ConnectionSource",
"connectionSource",
",",
"Callable",
"<",
"CT",
">",
"callable",
")",
"throws",
"SQLException",
"{",
"if",
"(",
"connectionSource",
".",
"isSingleConnection",
"(",
"tableInfo",
".",
"getT... | Call batch tasks inside of a connection which may, or may not, have been "saved". | [
"Call",
"batch",
"tasks",
"inside",
"of",
"a",
"connection",
"which",
"may",
"or",
"may",
"not",
"have",
"been",
"saved",
"."
] | train | https://github.com/j256/ormlite-core/blob/154d85bbb9614a0ea65a012251257831fb4fba21/src/main/java/com/j256/ormlite/stmt/StatementExecutor.java#L594-L602 |
knowm/XChart | xchart/src/main/java/org/knowm/xchart/CSVExporter.java | CSVExporter.writeCSVRows | public static void writeCSVRows(XYSeries series, String path2Dir) {
"""
Export a XYChart series into rows in a CSV file.
@param series
@param path2Dir - ex. "./path/to/directory/" *make sure you have the '/' on the end
"""
File newFile = new File(path2Dir + series.getName() + ".csv");
Writer out =... | java | public static void writeCSVRows(XYSeries series, String path2Dir) {
File newFile = new File(path2Dir + series.getName() + ".csv");
Writer out = null;
try {
out = new BufferedWriter(new OutputStreamWriter(new FileOutputStream(newFile), "UTF8"));
String csv = join(series.getXData(), ",") + Syste... | [
"public",
"static",
"void",
"writeCSVRows",
"(",
"XYSeries",
"series",
",",
"String",
"path2Dir",
")",
"{",
"File",
"newFile",
"=",
"new",
"File",
"(",
"path2Dir",
"+",
"series",
".",
"getName",
"(",
")",
"+",
"\".csv\"",
")",
";",
"Writer",
"out",
"=",
... | Export a XYChart series into rows in a CSV file.
@param series
@param path2Dir - ex. "./path/to/directory/" *make sure you have the '/' on the end | [
"Export",
"a",
"XYChart",
"series",
"into",
"rows",
"in",
"a",
"CSV",
"file",
"."
] | train | https://github.com/knowm/XChart/blob/677a105753a855edf24782fab1bf1f5aec3e642b/xchart/src/main/java/org/knowm/xchart/CSVExporter.java#L33-L60 |
Azure/azure-sdk-for-java | datamigration/resource-manager/v2018_07_15_preview/src/main/java/com/microsoft/azure/management/datamigration/v2018_07_15_preview/implementation/FilesInner.java | FilesInner.createOrUpdateAsync | public Observable<ProjectFileInner> createOrUpdateAsync(String groupName, String serviceName, String projectName, String fileName, ProjectFileInner parameters) {
"""
Create a file resource.
The PUT method creates a new file or updates an existing one.
@param groupName Name of the resource group
@param service... | java | public Observable<ProjectFileInner> createOrUpdateAsync(String groupName, String serviceName, String projectName, String fileName, ProjectFileInner parameters) {
return createOrUpdateWithServiceResponseAsync(groupName, serviceName, projectName, fileName, parameters).map(new Func1<ServiceResponse<ProjectFileInne... | [
"public",
"Observable",
"<",
"ProjectFileInner",
">",
"createOrUpdateAsync",
"(",
"String",
"groupName",
",",
"String",
"serviceName",
",",
"String",
"projectName",
",",
"String",
"fileName",
",",
"ProjectFileInner",
"parameters",
")",
"{",
"return",
"createOrUpdateWi... | Create a file resource.
The PUT method creates a new file or updates an existing one.
@param groupName Name of the resource group
@param serviceName Name of the service
@param projectName Name of the project
@param fileName Name of the File
@param parameters Information about the file
@throws IllegalArgumentException ... | [
"Create",
"a",
"file",
"resource",
".",
"The",
"PUT",
"method",
"creates",
"a",
"new",
"file",
"or",
"updates",
"an",
"existing",
"one",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/datamigration/resource-manager/v2018_07_15_preview/src/main/java/com/microsoft/azure/management/datamigration/v2018_07_15_preview/implementation/FilesInner.java#L387-L394 |
aol/micro-server | micro-s3/src/main/java/com/oath/micro/server/s3/data/ReadUtils.java | ReadUtils.getInputStream | public InputStream getInputStream(String bucketName, String key)
throws AmazonServiceException, AmazonClientException, InterruptedException, IOException {
"""
Method returns InputStream from S3Object. Multi-part download is used to
get file. s3.tmp.dir property used to store temporary files.
@param... | java | public InputStream getInputStream(String bucketName, String key)
throws AmazonServiceException, AmazonClientException, InterruptedException, IOException {
Supplier<File> tempFileSupplier = ExceptionSoftener.softenSupplier(() -> Files.createTempFile(FileSystems.getDefault()
... | [
"public",
"InputStream",
"getInputStream",
"(",
"String",
"bucketName",
",",
"String",
"key",
")",
"throws",
"AmazonServiceException",
",",
"AmazonClientException",
",",
"InterruptedException",
",",
"IOException",
"{",
"Supplier",
"<",
"File",
">",
"tempFileSupplier",
... | Method returns InputStream from S3Object. Multi-part download is used to
get file. s3.tmp.dir property used to store temporary files.
@param bucketName
@param key
@return
@throws AmazonServiceException
@throws AmazonClientException
@throws InterruptedException
@throws IOException | [
"Method",
"returns",
"InputStream",
"from",
"S3Object",
".",
"Multi",
"-",
"part",
"download",
"is",
"used",
"to",
"get",
"file",
".",
"s3",
".",
"tmp",
".",
"dir",
"property",
"used",
"to",
"store",
"temporary",
"files",
"."
] | train | https://github.com/aol/micro-server/blob/5c7103c5b43d2f4d16350dbd2f9802af307c63f7/micro-s3/src/main/java/com/oath/micro/server/s3/data/ReadUtils.java#L68-L76 |
sailthru/sailthru-java-client | src/main/com/sailthru/client/params/Content.java | Content.setImages | public Content setImages(Map<String, Map<String, String>> images) {
"""
/*
A map of image names to { “url” : <url> } image maps.
Use the name “full” to denote the full-sized image, and “thumb” to denote
the thumbnail-sized image. Other image names are not reserved.
Or use setFullImage and setThumbImage to set ... | java | public Content setImages(Map<String, Map<String, String>> images) {
this.images = images;
return this;
} | [
"public",
"Content",
"setImages",
"(",
"Map",
"<",
"String",
",",
"Map",
"<",
"String",
",",
"String",
">",
">",
"images",
")",
"{",
"this",
".",
"images",
"=",
"images",
";",
"return",
"this",
";",
"}"
] | /*
A map of image names to { “url” : <url> } image maps.
Use the name “full” to denote the full-sized image, and “thumb” to denote
the thumbnail-sized image. Other image names are not reserved.
Or use setFullImage and setThumbImage to set them separately. | [
"/",
"*",
"A",
"map",
"of",
"image",
"names",
"to",
"{",
"“url”",
":",
"<url",
">",
"}",
"image",
"maps",
".",
"Use",
"the",
"name",
"“full”",
"to",
"denote",
"the",
"full",
"-",
"sized",
"image",
"and",
"“thumb”",
"to",
"denote",
"the",
"thumbnail",... | train | https://github.com/sailthru/sailthru-java-client/blob/62b491f6a39b41b836bfc021779200d29b6d2069/src/main/com/sailthru/client/params/Content.java#L109-L112 |
OpenLiberty/open-liberty | dev/com.ibm.ws.security.token.ltpa/src/com/ibm/ws/security/token/ltpa/internal/LTPATokenizer.java | LTPATokenizer.convertStringToArrayList | private static final ArrayList<String> convertStringToArrayList(String value) {
"""
/*
Convert a String form of an array to the array list
@param value The String form of an array
@return The array list
"""
if (value != null && value.length() > 0) {
ArrayList<String> result = new Arr... | java | private static final ArrayList<String> convertStringToArrayList(String value) {
if (value != null && value.length() > 0) {
ArrayList<String> result = new ArrayList<String>();
StringTokenizer st = new StringTokenizer(value, STRING_ATTRIB_DELIM);
while (st.hasMoreTokens()) {
... | [
"private",
"static",
"final",
"ArrayList",
"<",
"String",
">",
"convertStringToArrayList",
"(",
"String",
"value",
")",
"{",
"if",
"(",
"value",
"!=",
"null",
"&&",
"value",
".",
"length",
"(",
")",
">",
"0",
")",
"{",
"ArrayList",
"<",
"String",
">",
... | /*
Convert a String form of an array to the array list
@param value The String form of an array
@return The array list | [
"/",
"*",
"Convert",
"a",
"String",
"form",
"of",
"an",
"array",
"to",
"the",
"array",
"list"
] | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.security.token.ltpa/src/com/ibm/ws/security/token/ltpa/internal/LTPATokenizer.java#L198-L211 |
salesforce/Argus | ArgusWebServices/src/main/java/com/salesforce/dva/argus/ws/resources/AbstractResource.java | AbstractResource.validateResourceAuthorization | protected void validateResourceAuthorization(HttpServletRequest req, PrincipalUser actualOwner, PrincipalUser currentOwner) {
"""
Validates the resource authorization. Throws exception if the user is not authorized to access the resource.
@param req The HTTP request.
@param actualOwner The owne... | java | protected void validateResourceAuthorization(HttpServletRequest req, PrincipalUser actualOwner, PrincipalUser currentOwner) {
if (!getRemoteUser(req).isPrivileged() && !actualOwner.equals(currentOwner)) {
throw new WebApplicationException(Status.FORBIDDEN.getReasonPhrase(), Status.FORBIDDEN);
... | [
"protected",
"void",
"validateResourceAuthorization",
"(",
"HttpServletRequest",
"req",
",",
"PrincipalUser",
"actualOwner",
",",
"PrincipalUser",
"currentOwner",
")",
"{",
"if",
"(",
"!",
"getRemoteUser",
"(",
"req",
")",
".",
"isPrivileged",
"(",
")",
"&&",
"!",... | Validates the resource authorization. Throws exception if the user is not authorized to access the resource.
@param req The HTTP request.
@param actualOwner The owner of the resource.
@param currentOwner The logged in user.
@throws WebApplicationException Throws exception if user is not authorize... | [
"Validates",
"the",
"resource",
"authorization",
".",
"Throws",
"exception",
"if",
"the",
"user",
"is",
"not",
"authorized",
"to",
"access",
"the",
"resource",
"."
] | train | https://github.com/salesforce/Argus/blob/121b59a268da264316cded6a3e9271366a23cd86/ArgusWebServices/src/main/java/com/salesforce/dva/argus/ws/resources/AbstractResource.java#L221-L225 |
eBay/parallec | src/main/java/io/parallec/core/FilterRegex.java | FilterRegex.stringMatcherByPattern | public static String stringMatcherByPattern(String input, String patternStr) {
"""
this remove the linebreak.
@param input
the input
@param patternStr
the pattern str
@return the string
"""
String output = PcConstants.SYSTEM_FAIL_MATCH_REGEX;
// 20140105: fix the NPE issue
if (... | java | public static String stringMatcherByPattern(String input, String patternStr) {
String output = PcConstants.SYSTEM_FAIL_MATCH_REGEX;
// 20140105: fix the NPE issue
if (patternStr == null) {
logger.error("patternStr is NULL! (Expected when the aggregation rule is not defined at "
... | [
"public",
"static",
"String",
"stringMatcherByPattern",
"(",
"String",
"input",
",",
"String",
"patternStr",
")",
"{",
"String",
"output",
"=",
"PcConstants",
".",
"SYSTEM_FAIL_MATCH_REGEX",
";",
"// 20140105: fix the NPE issue",
"if",
"(",
"patternStr",
"==",
"null",... | this remove the linebreak.
@param input
the input
@param patternStr
the pattern str
@return the string | [
"this",
"remove",
"the",
"linebreak",
"."
] | train | https://github.com/eBay/parallec/blob/1b4f1628f34fedfb06b24c33a5372d64d3df0952/src/main/java/io/parallec/core/FilterRegex.java#L65-L94 |
sawano/java-commons | src/main/java/se/sawano/java/commons/lang/validate/AbstractValidate.java | AbstractValidate.inclusiveBetween | public long inclusiveBetween(long start, long end, long value) {
"""
Validate that the specified primitive value falls between the two inclusive values specified; otherwise, throws an exception.
<pre>Validate.inclusiveBetween(0, 2, 1);</pre>
@param start
the inclusive start value
@param end
the inclusive en... | java | public long inclusiveBetween(long start, long end, long value) {
if (value < start || value > end) {
fail(String.format(DEFAULT_INCLUSIVE_BETWEEN_EX_MESSAGE, value, start, end));
}
return value;
} | [
"public",
"long",
"inclusiveBetween",
"(",
"long",
"start",
",",
"long",
"end",
",",
"long",
"value",
")",
"{",
"if",
"(",
"value",
"<",
"start",
"||",
"value",
">",
"end",
")",
"{",
"fail",
"(",
"String",
".",
"format",
"(",
"DEFAULT_INCLUSIVE_BETWEEN_E... | Validate that the specified primitive value falls between the two inclusive values specified; otherwise, throws an exception.
<pre>Validate.inclusiveBetween(0, 2, 1);</pre>
@param start
the inclusive start value
@param end
the inclusive end value
@param value
the value to validate
@return the value
@throws IllegalAr... | [
"Validate",
"that",
"the",
"specified",
"primitive",
"value",
"falls",
"between",
"the",
"two",
"inclusive",
"values",
"specified",
";",
"otherwise",
"throws",
"an",
"exception",
".",
"<pre",
">",
"Validate",
".",
"inclusiveBetween",
"(",
"0",
"2",
"1",
")",
... | train | https://github.com/sawano/java-commons/blob/6f219c9e8dec4401dbe528d17ae6ec1ef9c0d284/src/main/java/se/sawano/java/commons/lang/validate/AbstractValidate.java#L1283-L1288 |
Carbonado/Carbonado | src/main/java/com/amazon/carbonado/repo/jdbc/JDBCRepository.java | JDBCRepository.selectIsolationLevel | IsolationLevel selectIsolationLevel(Transaction parent, IsolationLevel desiredLevel) {
"""
Returns the highest supported level for the given desired level.
@return null if not supported
"""
if (desiredLevel == null) {
if (parent == null) {
desiredLevel = mDefaultIsolat... | java | IsolationLevel selectIsolationLevel(Transaction parent, IsolationLevel desiredLevel) {
if (desiredLevel == null) {
if (parent == null) {
desiredLevel = mDefaultIsolationLevel;
} else {
desiredLevel = parent.getIsolationLevel();
}
... | [
"IsolationLevel",
"selectIsolationLevel",
"(",
"Transaction",
"parent",
",",
"IsolationLevel",
"desiredLevel",
")",
"{",
"if",
"(",
"desiredLevel",
"==",
"null",
")",
"{",
"if",
"(",
"parent",
"==",
"null",
")",
"{",
"desiredLevel",
"=",
"mDefaultIsolationLevel",
... | Returns the highest supported level for the given desired level.
@return null if not supported | [
"Returns",
"the",
"highest",
"supported",
"level",
"for",
"the",
"given",
"desired",
"level",
"."
] | train | https://github.com/Carbonado/Carbonado/blob/eee29b365a61c8f03e1a1dc6bed0692e6b04b1db/src/main/java/com/amazon/carbonado/repo/jdbc/JDBCRepository.java#L548-L579 |
wso2/transport-http | components/org.wso2.transport.http.netty/src/main/java/org/wso2/transport/http/netty/contractimpl/common/Util.java | Util.isKeepAlive | public static boolean isKeepAlive(KeepAliveConfig keepAliveConfig, HttpCarbonMessage outboundRequestMsg)
throws ConfigurationException {
"""
Check whether a connection should alive or not.
@param keepAliveConfig of the connection
@param outboundRequestMsg of this particular transaction
@return true ... | java | public static boolean isKeepAlive(KeepAliveConfig keepAliveConfig, HttpCarbonMessage outboundRequestMsg)
throws ConfigurationException {
switch (keepAliveConfig) {
case AUTO:
return Float.valueOf((String) outboundRequestMsg.getProperty(Constants.HTTP_VERSION)) > Constants.HTTP_1_... | [
"public",
"static",
"boolean",
"isKeepAlive",
"(",
"KeepAliveConfig",
"keepAliveConfig",
",",
"HttpCarbonMessage",
"outboundRequestMsg",
")",
"throws",
"ConfigurationException",
"{",
"switch",
"(",
"keepAliveConfig",
")",
"{",
"case",
"AUTO",
":",
"return",
"Float",
"... | Check whether a connection should alive or not.
@param keepAliveConfig of the connection
@param outboundRequestMsg of this particular transaction
@return true if the connection should be kept alive
@throws ConfigurationException for invalid configurations | [
"Check",
"whether",
"a",
"connection",
"should",
"alive",
"or",
"not",
"."
] | train | https://github.com/wso2/transport-http/blob/c51aa715b473db6c1b82a7d7b22f6e65f74df4c9/components/org.wso2.transport.http.netty/src/main/java/org/wso2/transport/http/netty/contractimpl/common/Util.java#L771-L786 |
xwiki/xwiki-rendering | xwiki-rendering-syntaxes/xwiki-rendering-syntax-xhtml/src/main/java/org/xwiki/rendering/internal/renderer/xhtml/link/AbstractXHTMLLinkTypeRenderer.java | AbstractXHTMLLinkTypeRenderer.handleTargetAttribute | private void handleTargetAttribute(Map<String, String> anchorAttributes) {
"""
When a link is open in an other window or in an other frame, the loaded page has some restricted access to the
parent window. Among other things, it has the ability to redirect it to an other page, which can lead to
dangerous phishing... | java | private void handleTargetAttribute(Map<String, String> anchorAttributes)
{
String target = anchorAttributes.get("target");
// Target can have these values:
//
// "_blank" which opens the link in a new window
// "_self" which opens the link in the same window (default)
... | [
"private",
"void",
"handleTargetAttribute",
"(",
"Map",
"<",
"String",
",",
"String",
">",
"anchorAttributes",
")",
"{",
"String",
"target",
"=",
"anchorAttributes",
".",
"get",
"(",
"\"target\"",
")",
";",
"// Target can have these values:",
"//",
"// \"_blank\" wh... | When a link is open in an other window or in an other frame, the loaded page has some restricted access to the
parent window. Among other things, it has the ability to redirect it to an other page, which can lead to
dangerous phishing attacks.
See: https://mathiasbynens.github.io/rel-noopener/ or https://dev.to/phishi... | [
"When",
"a",
"link",
"is",
"open",
"in",
"an",
"other",
"window",
"or",
"in",
"an",
"other",
"frame",
"the",
"loaded",
"page",
"has",
"some",
"restricted",
"access",
"to",
"the",
"parent",
"window",
".",
"Among",
"other",
"things",
"it",
"has",
"the",
... | train | https://github.com/xwiki/xwiki-rendering/blob/a21cdfcb64ef5b76872e3eedf78c530f26d7beb0/xwiki-rendering-syntaxes/xwiki-rendering-syntax-xhtml/src/main/java/org/xwiki/rendering/internal/renderer/xhtml/link/AbstractXHTMLLinkTypeRenderer.java#L180-L217 |
alkacon/opencms-core | src/org/opencms/xml/content/CmsDefaultXmlContentHandler.java | CmsDefaultXmlContentHandler.initLayouts | protected void initLayouts(Element root, CmsXmlContentDefinition contentDefinition) throws CmsXmlException {
"""
Initializes the layout for this content handler.<p>
Unless otherwise instructed, the editor uses one specific GUI widget for each
XML value schema type. For example, for a {@link org.opencms.xml.typ... | java | protected void initLayouts(Element root, CmsXmlContentDefinition contentDefinition) throws CmsXmlException {
m_useAcacia = safeParseBoolean(root.attributeValue(ATTR_USE_ACACIA), true);
Iterator<Element> i = CmsXmlGenericWrapper.elementIterator(root, APPINFO_LAYOUT);
while (i.hasNext()) {
... | [
"protected",
"void",
"initLayouts",
"(",
"Element",
"root",
",",
"CmsXmlContentDefinition",
"contentDefinition",
")",
"throws",
"CmsXmlException",
"{",
"m_useAcacia",
"=",
"safeParseBoolean",
"(",
"root",
".",
"attributeValue",
"(",
"ATTR_USE_ACACIA",
")",
",",
"true"... | Initializes the layout for this content handler.<p>
Unless otherwise instructed, the editor uses one specific GUI widget for each
XML value schema type. For example, for a {@link org.opencms.xml.types.CmsXmlStringValue}
the default widget is the {@link org.opencms.widgets.CmsInputWidget}.
However, certain values can a... | [
"Initializes",
"the",
"layout",
"for",
"this",
"content",
"handler",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/xml/content/CmsDefaultXmlContentHandler.java#L2702-L2724 |
ysc/HtmlExtractor | html-extractor/src/main/java/org/apdplat/extractor/html/impl/ExtractFunctionExecutor.java | ExtractFunctionExecutor.executeSubstring | public static String executeSubstring(String text, String parseExpression) {
"""
截取指定范围的文本 使用方法:substring(0,19)
括号内的参数为2个,分别是字符索引下标,截取从0开始到19的字符串,索引包括0,不包括19,即[0 - 19)
@param text CSS路径抽取出来的文本
@param parseExpression 抽取函数
@return 抽取函数处理之后的文本
"""
LOGGER.debug("substring抽取函数之前:" + text);
Str... | java | public static String executeSubstring(String text, String parseExpression) {
LOGGER.debug("substring抽取函数之前:" + text);
String parameter = parseExpression.replace("substring(", "");
parameter = parameter.substring(0, parameter.length() - 1);
String[] attr = parameter.split(",");
if... | [
"public",
"static",
"String",
"executeSubstring",
"(",
"String",
"text",
",",
"String",
"parseExpression",
")",
"{",
"LOGGER",
".",
"debug",
"(",
"\"substring抽取函数之前:\" + text);",
"",
"",
"",
"",
"String",
"parameter",
"=",
"parseExpression",
".",
"replace",
"(",... | 截取指定范围的文本 使用方法:substring(0,19)
括号内的参数为2个,分别是字符索引下标,截取从0开始到19的字符串,索引包括0,不包括19,即[0 - 19)
@param text CSS路径抽取出来的文本
@param parseExpression 抽取函数
@return 抽取函数处理之后的文本 | [
"截取指定范围的文本",
"使用方法:substring",
"(",
"0",
"19",
")",
"括号内的参数为2个,分别是字符索引下标,截取从0开始到19的字符串,索引包括0,不包括19",
"即",
"[",
"0",
"-",
"19",
")"
] | train | https://github.com/ysc/HtmlExtractor/blob/5378bc5f94138562c55506cf81de1ffe72ab701e/html-extractor/src/main/java/org/apdplat/extractor/html/impl/ExtractFunctionExecutor.java#L74-L86 |
aws/aws-sdk-java | aws-java-sdk-api-gateway/src/main/java/com/amazonaws/services/apigateway/model/Stage.java | Stage.withMethodSettings | public Stage withMethodSettings(java.util.Map<String, MethodSetting> methodSettings) {
"""
<p>
A map that defines the method settings for a <a>Stage</a> resource. Keys (designated as
<code>/{method_setting_key</code> below) are method paths defined as <code>{resource_path}/{http_method}</code>
for an individual... | java | public Stage withMethodSettings(java.util.Map<String, MethodSetting> methodSettings) {
setMethodSettings(methodSettings);
return this;
} | [
"public",
"Stage",
"withMethodSettings",
"(",
"java",
".",
"util",
".",
"Map",
"<",
"String",
",",
"MethodSetting",
">",
"methodSettings",
")",
"{",
"setMethodSettings",
"(",
"methodSettings",
")",
";",
"return",
"this",
";",
"}"
] | <p>
A map that defines the method settings for a <a>Stage</a> resource. Keys (designated as
<code>/{method_setting_key</code> below) are method paths defined as <code>{resource_path}/{http_method}</code>
for an individual method override, or <code>/\*/\*</code> for overriding all methods in the stage.
</p>
@param ... | [
"<p",
">",
"A",
"map",
"that",
"defines",
"the",
"method",
"settings",
"for",
"a",
"<a",
">",
"Stage<",
"/",
"a",
">",
"resource",
".",
"Keys",
"(",
"designated",
"as",
"<code",
">",
"/",
"{",
"method_setting_key<",
"/",
"code",
">",
"below",
")",
"a... | train | https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-api-gateway/src/main/java/com/amazonaws/services/apigateway/model/Stage.java#L518-L521 |
apache/incubator-druid | processing/src/main/java/org/apache/druid/query/filter/NotDimFilter.java | NotDimFilter.getDimensionRangeSet | @Override
public RangeSet<String> getDimensionRangeSet(String dimension) {
"""
There are some special cases involving null that require special casing for And and Or instead of simply taking
the complement
Example 1 : "NOT ( [0,INF) OR null)" The inside of NOT would evaluate to null, and the complement would... | java | @Override
public RangeSet<String> getDimensionRangeSet(String dimension)
{
if (field instanceof AndDimFilter) {
List<DimFilter> fields = ((AndDimFilter) field).getFields();
return new OrDimFilter(Lists.transform(fields, NotDimFilter::new)).getDimensionRangeSet(dimension);
}
if (field instanc... | [
"@",
"Override",
"public",
"RangeSet",
"<",
"String",
">",
"getDimensionRangeSet",
"(",
"String",
"dimension",
")",
"{",
"if",
"(",
"field",
"instanceof",
"AndDimFilter",
")",
"{",
"List",
"<",
"DimFilter",
">",
"fields",
"=",
"(",
"(",
"AndDimFilter",
")",
... | There are some special cases involving null that require special casing for And and Or instead of simply taking
the complement
Example 1 : "NOT ( [0,INF) OR null)" The inside of NOT would evaluate to null, and the complement would also
be null. However, by breaking the NOT, this statement is "NOT([0,INF)) AND NOT(null... | [
"There",
"are",
"some",
"special",
"cases",
"involving",
"null",
"that",
"require",
"special",
"casing",
"for",
"And",
"and",
"Or",
"instead",
"of",
"simply",
"taking",
"the",
"complement"
] | train | https://github.com/apache/incubator-druid/blob/f776b9408962b9006cfcfe4d6c1794751972cc8e/processing/src/main/java/org/apache/druid/query/filter/NotDimFilter.java#L86-L102 |
facebookarchive/hadoop-20 | src/contrib/corona/src/java/org/apache/hadoop/mapred/CoronaJobInProgress.java | CoronaJobInProgress.meterTaskAttemptUnprotected | @SuppressWarnings("deprecation")
private void meterTaskAttemptUnprotected(TaskInProgress tip, TaskStatus status) {
"""
Metering: Occupied Slots * (Finish - Start)
@param tip {@link TaskInProgress} to be metered which just completed,
cannot be <code>null</code>
@param status {@link TaskStatus} of the completed... | java | @SuppressWarnings("deprecation")
private void meterTaskAttemptUnprotected(TaskInProgress tip, TaskStatus status) {
Counter slotCounter =
(tip.isMapTask()) ? Counter.SLOTS_MILLIS_MAPS :
Counter.SLOTS_MILLIS_REDUCES;
jobCounters.incrCounter(slotCounter,
... | [
"@",
"SuppressWarnings",
"(",
"\"deprecation\"",
")",
"private",
"void",
"meterTaskAttemptUnprotected",
"(",
"TaskInProgress",
"tip",
",",
"TaskStatus",
"status",
")",
"{",
"Counter",
"slotCounter",
"=",
"(",
"tip",
".",
"isMapTask",
"(",
")",
")",
"?",
"Counter... | Metering: Occupied Slots * (Finish - Start)
@param tip {@link TaskInProgress} to be metered which just completed,
cannot be <code>null</code>
@param status {@link TaskStatus} of the completed task, cannot be
<code>null</code> | [
"Metering",
":",
"Occupied",
"Slots",
"*",
"(",
"Finish",
"-",
"Start",
")"
] | train | https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/contrib/corona/src/java/org/apache/hadoop/mapred/CoronaJobInProgress.java#L2052-L2071 |
moparisthebest/beehive | beehive-netui-tags/src/main/java/org/apache/beehive/netui/tags/tree/TreeHelpers.java | TreeHelpers.processTreeRequest | public static void processTreeRequest(String treeId, TreeElement treeRoot, HttpServletRequest request, HttpServletResponse response) {
"""
If this tree was selected or expanded this will handle that processing.
@param treeId
@param treeRoot
@param request
"""
assert(treeId != null) : "parameter tree... | java | public static void processTreeRequest(String treeId, TreeElement treeRoot, HttpServletRequest request, HttpServletResponse response)
{
assert(treeId != null) : "parameter treeId must not be null.";
assert(treeRoot != null) : "parameter treeRoot must not be null.";
assert(request != null) : "... | [
"public",
"static",
"void",
"processTreeRequest",
"(",
"String",
"treeId",
",",
"TreeElement",
"treeRoot",
",",
"HttpServletRequest",
"request",
",",
"HttpServletResponse",
"response",
")",
"{",
"assert",
"(",
"treeId",
"!=",
"null",
")",
":",
"\"parameter treeId mu... | If this tree was selected or expanded this will handle that processing.
@param treeId
@param treeRoot
@param request | [
"If",
"this",
"tree",
"was",
"selected",
"or",
"expanded",
"this",
"will",
"handle",
"that",
"processing",
"."
] | train | https://github.com/moparisthebest/beehive/blob/4246a0cc40ce3c05f1a02c2da2653ac622703d77/beehive-netui-tags/src/main/java/org/apache/beehive/netui/tags/tree/TreeHelpers.java#L41-L75 |
riversun/string-grabber | src/main/java/org/riversun/string_grabber/StringCropper.java | StringCropper.getBeforeOf | public String getBeforeOf(String srcStr, String token) {
"""
returns the string that is cropped before token with position-detail-info<br>
@param srcStr
@param token
@return
"""
return getBeforeOfWithDetails(srcStr, token).str;
} | java | public String getBeforeOf(String srcStr, String token) {
return getBeforeOfWithDetails(srcStr, token).str;
} | [
"public",
"String",
"getBeforeOf",
"(",
"String",
"srcStr",
",",
"String",
"token",
")",
"{",
"return",
"getBeforeOfWithDetails",
"(",
"srcStr",
",",
"token",
")",
".",
"str",
";",
"}"
] | returns the string that is cropped before token with position-detail-info<br>
@param srcStr
@param token
@return | [
"returns",
"the",
"string",
"that",
"is",
"cropped",
"before",
"token",
"with",
"position",
"-",
"detail",
"-",
"info<br",
">"
] | train | https://github.com/riversun/string-grabber/blob/b5aadc21fe15f50d35392188dec6ab81dcf8d464/src/main/java/org/riversun/string_grabber/StringCropper.java#L221-L223 |
sdl/Testy | src/main/java/com/sdl/selenium/web/XPathBuilder.java | XPathBuilder.setLabel | @SuppressWarnings("unchecked")
public <T extends XPathBuilder> T setLabel(final String label, final SearchType... searchTypes) {
"""
<p><b>Used for finding element process (to generate xpath address)</b></p>
@param label text label element
@param searchTypes type search text element: see more details... | java | @SuppressWarnings("unchecked")
public <T extends XPathBuilder> T setLabel(final String label, final SearchType... searchTypes) {
this.label = label;
if (searchTypes != null && searchTypes.length > 0) {
setSearchLabelType(searchTypes);
}
return (T) this;
} | [
"@",
"SuppressWarnings",
"(",
"\"unchecked\"",
")",
"public",
"<",
"T",
"extends",
"XPathBuilder",
">",
"T",
"setLabel",
"(",
"final",
"String",
"label",
",",
"final",
"SearchType",
"...",
"searchTypes",
")",
"{",
"this",
".",
"label",
"=",
"label",
";",
"... | <p><b>Used for finding element process (to generate xpath address)</b></p>
@param label text label element
@param searchTypes type search text element: see more details see {@link SearchType}
@param <T> the element which calls this method
@return this element | [
"<p",
">",
"<b",
">",
"Used",
"for",
"finding",
"element",
"process",
"(",
"to",
"generate",
"xpath",
"address",
")",
"<",
"/",
"b",
">",
"<",
"/",
"p",
">"
] | train | https://github.com/sdl/Testy/blob/b3ae061554016f926f04694a39ff00dab7576609/src/main/java/com/sdl/selenium/web/XPathBuilder.java#L525-L532 |
HanSolo/SteelSeries-Swing | src/main/java/eu/hansolo/steelseries/gauges/SparkLine.java | SparkLine.calcHiLoValues | private void calcHiLoValues(double y, int index) {
"""
Calculates the max and min measured values and stores the index of the
related values in in loIndex and hiIndex.
@param y
@param index
"""
if (y < lo) {
lo = y;
loIndex = index;
}
if (y > hi) {
... | java | private void calcHiLoValues(double y, int index) {
if (y < lo) {
lo = y;
loIndex = index;
}
if (y > hi) {
hi = y;
hiIndex = index;
}
} | [
"private",
"void",
"calcHiLoValues",
"(",
"double",
"y",
",",
"int",
"index",
")",
"{",
"if",
"(",
"y",
"<",
"lo",
")",
"{",
"lo",
"=",
"y",
";",
"loIndex",
"=",
"index",
";",
"}",
"if",
"(",
"y",
">",
"hi",
")",
"{",
"hi",
"=",
"y",
";",
"... | Calculates the max and min measured values and stores the index of the
related values in in loIndex and hiIndex.
@param y
@param index | [
"Calculates",
"the",
"max",
"and",
"min",
"measured",
"values",
"and",
"stores",
"the",
"index",
"of",
"the",
"related",
"values",
"in",
"in",
"loIndex",
"and",
"hiIndex",
"."
] | train | https://github.com/HanSolo/SteelSeries-Swing/blob/c2f7b45a477757ef21bbb6a1174ddedb2250ae57/src/main/java/eu/hansolo/steelseries/gauges/SparkLine.java#L1036-L1046 |
killbilling/recurly-java-library | src/main/java/com/ning/billing/recurly/RecurlyClient.java | RecurlyClient.getAccountAdjustments | public Adjustments getAccountAdjustments(final String accountCode, final Adjustments.AdjustmentType type, final Adjustments.AdjustmentState state, final QueryParams params) {
"""
Get Account Adjustments
<p>
@param accountCode recurly account id
@param type {@link com.ning.billing.recurly.model.Adjustments.Adj... | java | public Adjustments getAccountAdjustments(final String accountCode, final Adjustments.AdjustmentType type, final Adjustments.AdjustmentState state, final QueryParams params) {
final String url = Account.ACCOUNT_RESOURCE + "/" + accountCode + Adjustments.ADJUSTMENTS_RESOURCE;
if (type != null) params.put... | [
"public",
"Adjustments",
"getAccountAdjustments",
"(",
"final",
"String",
"accountCode",
",",
"final",
"Adjustments",
".",
"AdjustmentType",
"type",
",",
"final",
"Adjustments",
".",
"AdjustmentState",
"state",
",",
"final",
"QueryParams",
"params",
")",
"{",
"final... | Get Account Adjustments
<p>
@param accountCode recurly account id
@param type {@link com.ning.billing.recurly.model.Adjustments.AdjustmentType}
@param state {@link com.ning.billing.recurly.model.Adjustments.AdjustmentState}
@param params {@link QueryParams}
@return the adjustments on the account | [
"Get",
"Account",
"Adjustments",
"<p",
">"
] | train | https://github.com/killbilling/recurly-java-library/blob/5e05eedd91885a51e1aa8293bd41139d082cf7f4/src/main/java/com/ning/billing/recurly/RecurlyClient.java#L414-L421 |
lessthanoptimal/ejml | main/ejml-ddense/src/org/ejml/dense/fixed/CommonOps_DDF2.java | CommonOps_DDF2.elementDiv | public static void elementDiv( DMatrix2 a , DMatrix2 b) {
"""
<p>Performs an element by element division operation:<br>
<br>
a<sub>i</sub> = a<sub>i</sub> / b<sub>i</sub> <br>
</p>
@param a The left vector in the division operation. Modified.
@param b The right vector in the division operation. Not modified.
... | java | public static void elementDiv( DMatrix2 a , DMatrix2 b) {
a.a1 /= b.a1;
a.a2 /= b.a2;
} | [
"public",
"static",
"void",
"elementDiv",
"(",
"DMatrix2",
"a",
",",
"DMatrix2",
"b",
")",
"{",
"a",
".",
"a1",
"/=",
"b",
".",
"a1",
";",
"a",
".",
"a2",
"/=",
"b",
".",
"a2",
";",
"}"
] | <p>Performs an element by element division operation:<br>
<br>
a<sub>i</sub> = a<sub>i</sub> / b<sub>i</sub> <br>
</p>
@param a The left vector in the division operation. Modified.
@param b The right vector in the division operation. Not modified. | [
"<p",
">",
"Performs",
"an",
"element",
"by",
"element",
"division",
"operation",
":",
"<br",
">",
"<br",
">",
"a<sub",
">",
"i<",
"/",
"sub",
">",
"=",
"a<sub",
">",
"i<",
"/",
"sub",
">",
"/",
"b<sub",
">",
"i<",
"/",
"sub",
">",
"<br",
">",
... | train | https://github.com/lessthanoptimal/ejml/blob/1444680cc487af5e866730e62f48f5f9636850d9/main/ejml-ddense/src/org/ejml/dense/fixed/CommonOps_DDF2.java#L933-L936 |
Azure/azure-sdk-for-java | iotcentral/resource-manager/v2017_07_01_privatepreview/src/main/java/com/microsoft/azure/management/iotcentral/v2017_07_01_privatepreview/implementation/AppsInner.java | AppsInner.beginUpdateAsync | public Observable<AppInner> beginUpdateAsync(String resourceGroupName, String resourceName, AppPatch appPatch) {
"""
Update the metadata of an IoT Central application.
@param resourceGroupName The name of the resource group that contains the IoT Central application.
@param resourceName The ARM resource name of... | java | public Observable<AppInner> beginUpdateAsync(String resourceGroupName, String resourceName, AppPatch appPatch) {
return beginUpdateWithServiceResponseAsync(resourceGroupName, resourceName, appPatch).map(new Func1<ServiceResponse<AppInner>, AppInner>() {
@Override
public AppInner call(Ser... | [
"public",
"Observable",
"<",
"AppInner",
">",
"beginUpdateAsync",
"(",
"String",
"resourceGroupName",
",",
"String",
"resourceName",
",",
"AppPatch",
"appPatch",
")",
"{",
"return",
"beginUpdateWithServiceResponseAsync",
"(",
"resourceGroupName",
",",
"resourceName",
",... | Update the metadata of an IoT Central application.
@param resourceGroupName The name of the resource group that contains the IoT Central application.
@param resourceName The ARM resource name of the IoT Central application.
@param appPatch The IoT Central application metadata and security metadata.
@throws IllegalArgu... | [
"Update",
"the",
"metadata",
"of",
"an",
"IoT",
"Central",
"application",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/iotcentral/resource-manager/v2017_07_01_privatepreview/src/main/java/com/microsoft/azure/management/iotcentral/v2017_07_01_privatepreview/implementation/AppsInner.java#L495-L502 |
sai-pullabhotla/catatumbo | src/main/java/com/jmethods/catatumbo/impl/Marshaller.java | Marshaller.isValidId | private static boolean isValidId(Object idValue, DataType identifierType) {
"""
Checks to see if the given value is a valid identifier for the given ID type.
@param idValue
the ID value
@param identifierType
the identifier type
@return <code>true</code>, if the given value is a valid identifier; <code>false... | java | private static boolean isValidId(Object idValue, DataType identifierType) {
boolean validId = false;
if (idValue != null) {
switch (identifierType) {
case LONG:
case LONG_OBJECT:
validId = (long) idValue != 0;
break;
case STRING:
validId = ((String) id... | [
"private",
"static",
"boolean",
"isValidId",
"(",
"Object",
"idValue",
",",
"DataType",
"identifierType",
")",
"{",
"boolean",
"validId",
"=",
"false",
";",
"if",
"(",
"idValue",
"!=",
"null",
")",
"{",
"switch",
"(",
"identifierType",
")",
"{",
"case",
"L... | Checks to see if the given value is a valid identifier for the given ID type.
@param idValue
the ID value
@param identifierType
the identifier type
@return <code>true</code>, if the given value is a valid identifier; <code>false</code>,
otherwise. For STRING type, the ID is valid if it it contains at least one printab... | [
"Checks",
"to",
"see",
"if",
"the",
"given",
"value",
"is",
"a",
"valid",
"identifier",
"for",
"the",
"given",
"ID",
"type",
"."
] | train | https://github.com/sai-pullabhotla/catatumbo/blob/96d4c6dce3a5009624f7112a398406914dd19165/src/main/java/com/jmethods/catatumbo/impl/Marshaller.java#L322-L339 |
deeplearning4j/deeplearning4j | deeplearning4j/deeplearning4j-nlp-parent/deeplearning4j-nlp/src/main/java/org/deeplearning4j/models/embeddings/loader/WordVectorSerializer.java | WordVectorSerializer.writeWordVectors | @Deprecated
public static void writeWordVectors(@NonNull Word2Vec vec, @NonNull File file) throws IOException {
"""
Writes the word vectors to the given path. Note that this assumes an in memory cache
@param vec the word2vec to write
@param file the file to write
@throws IOException
"""
try (... | java | @Deprecated
public static void writeWordVectors(@NonNull Word2Vec vec, @NonNull File file) throws IOException {
try (BufferedWriter write = new BufferedWriter(new OutputStreamWriter(new FileOutputStream(file), StandardCharsets.UTF_8))) {
writeWordVectors(vec, write);
}
} | [
"@",
"Deprecated",
"public",
"static",
"void",
"writeWordVectors",
"(",
"@",
"NonNull",
"Word2Vec",
"vec",
",",
"@",
"NonNull",
"File",
"file",
")",
"throws",
"IOException",
"{",
"try",
"(",
"BufferedWriter",
"write",
"=",
"new",
"BufferedWriter",
"(",
"new",
... | Writes the word vectors to the given path. Note that this assumes an in memory cache
@param vec the word2vec to write
@param file the file to write
@throws IOException | [
"Writes",
"the",
"word",
"vectors",
"to",
"the",
"given",
"path",
".",
"Note",
"that",
"this",
"assumes",
"an",
"in",
"memory",
"cache"
] | train | https://github.com/deeplearning4j/deeplearning4j/blob/effce52f2afd7eeb53c5bcca699fcd90bd06822f/deeplearning4j/deeplearning4j-nlp-parent/deeplearning4j-nlp/src/main/java/org/deeplearning4j/models/embeddings/loader/WordVectorSerializer.java#L1496-L1501 |
jmxtrans/embedded-jmxtrans | src/main/java/org/jmxtrans/embedded/util/net/ssl/SslUtils.java | SslUtils.getSSLSocketFactory | @Nonnull
public static SSLSocketFactory getSSLSocketFactory(@Nullable String keyStore, @Nullable String keyStorePassword, @Nullable String trustStore, @Nullable String trustStorePassword) {
"""
Build an {@link SSLSocketFactory} with the given trust store and key store.
@param keyStore path to the ... | java | @Nonnull
public static SSLSocketFactory getSSLSocketFactory(@Nullable String keyStore, @Nullable String keyStorePassword, @Nullable String trustStore, @Nullable String trustStorePassword) {
SSLContext sslContext = getSslContext(keyStore, keyStorePassword, trustStore, trustStorePassword);
return sslC... | [
"@",
"Nonnull",
"public",
"static",
"SSLSocketFactory",
"getSSLSocketFactory",
"(",
"@",
"Nullable",
"String",
"keyStore",
",",
"@",
"Nullable",
"String",
"keyStorePassword",
",",
"@",
"Nullable",
"String",
"trustStore",
",",
"@",
"Nullable",
"String",
"trustStorePa... | Build an {@link SSLSocketFactory} with the given trust store and key store.
@param keyStore path to the given JKS key store. Can be a classpath resource ("classpath:com/example/keystore.jks") of file system related. Optional, if {code null}, then the JVM key store is used.
@param keyStorePassword password ... | [
"Build",
"an",
"{",
"@link",
"SSLSocketFactory",
"}",
"with",
"the",
"given",
"trust",
"store",
"and",
"key",
"store",
"."
] | train | https://github.com/jmxtrans/embedded-jmxtrans/blob/17224389e7d8323284cabc2a5167fc03bed6d223/src/main/java/org/jmxtrans/embedded/util/net/ssl/SslUtils.java#L55-L59 |
openbase/jul | extension/type/processing/src/main/java/org/openbase/jul/extension/type/processing/LabelProcessor.java | LabelProcessor.getBestMatch | public static String getBestMatch(final Locale locale, final LabelOrBuilder label) throws NotAvailableException {
"""
Get the first label for a languageCode from a label type. This is equivalent to calling
{@link #getLabelByLanguage(String, LabelOrBuilder)} but the language code is extracted from the locale by ca... | java | public static String getBestMatch(final Locale locale, final LabelOrBuilder label) throws NotAvailableException {
try {
// resolve label via preferred locale.
return getLabelByLanguage(locale.getLanguage(), label);
} catch (NotAvailableException ex) {
try {
... | [
"public",
"static",
"String",
"getBestMatch",
"(",
"final",
"Locale",
"locale",
",",
"final",
"LabelOrBuilder",
"label",
")",
"throws",
"NotAvailableException",
"{",
"try",
"{",
"// resolve label via preferred locale.",
"return",
"getLabelByLanguage",
"(",
"locale",
"."... | Get the first label for a languageCode from a label type. This is equivalent to calling
{@link #getLabelByLanguage(String, LabelOrBuilder)} but the language code is extracted from the locale by calling
{@link Locale#getLanguage()}. If no label matches the languageCode, than the first label of any other provided languag... | [
"Get",
"the",
"first",
"label",
"for",
"a",
"languageCode",
"from",
"a",
"label",
"type",
".",
"This",
"is",
"equivalent",
"to",
"calling",
"{",
"@link",
"#getLabelByLanguage",
"(",
"String",
"LabelOrBuilder",
")",
"}",
"but",
"the",
"language",
"code",
"is"... | train | https://github.com/openbase/jul/blob/662e98c3a853085e475be54c3be3deb72193c72d/extension/type/processing/src/main/java/org/openbase/jul/extension/type/processing/LabelProcessor.java#L215-L228 |
cchabanois/transmorph | src/main/java/net/entropysoft/transmorph/converters/beans/BeanPropertyTypeProvider.java | BeanPropertyTypeProvider.setPropertyDestinationType | public void setPropertyDestinationType(Class<?> clazz, String propertyName,
TypeReference<?> destinationType) {
"""
set the property destination type for given property
@param propertyName
@param destinationType
"""
propertiesDestinationTypes.put(new ClassProperty(clazz, propertyName), destinationTy... | java | public void setPropertyDestinationType(Class<?> clazz, String propertyName,
TypeReference<?> destinationType) {
propertiesDestinationTypes.put(new ClassProperty(clazz, propertyName), destinationType);
} | [
"public",
"void",
"setPropertyDestinationType",
"(",
"Class",
"<",
"?",
">",
"clazz",
",",
"String",
"propertyName",
",",
"TypeReference",
"<",
"?",
">",
"destinationType",
")",
"{",
"propertiesDestinationTypes",
".",
"put",
"(",
"new",
"ClassProperty",
"(",
"cl... | set the property destination type for given property
@param propertyName
@param destinationType | [
"set",
"the",
"property",
"destination",
"type",
"for",
"given",
"property"
] | train | https://github.com/cchabanois/transmorph/blob/118550f30b9680a84eab7496bd8b04118740dcec/src/main/java/net/entropysoft/transmorph/converters/beans/BeanPropertyTypeProvider.java#L40-L43 |
wildfly/wildfly-core | embedded/src/main/java/org/wildfly/core/embedded/EmbeddedProcessFactory.java | EmbeddedProcessFactory.createStandaloneServer | public static StandaloneServer createStandaloneServer(ModuleLoader moduleLoader, File jbossHomeDir, String... cmdargs) {
"""
Create an embedded standalone server with an already established module loader.
@param moduleLoader the module loader. Cannot be {@code null}
@param jbossHomeDir the location of the root... | java | public static StandaloneServer createStandaloneServer(ModuleLoader moduleLoader, File jbossHomeDir, String... cmdargs) {
return createStandaloneServer(
Configuration.Builder.of(jbossHomeDir)
.setCommandArguments(cmdargs)
.setModuleLoader(moduleLoad... | [
"public",
"static",
"StandaloneServer",
"createStandaloneServer",
"(",
"ModuleLoader",
"moduleLoader",
",",
"File",
"jbossHomeDir",
",",
"String",
"...",
"cmdargs",
")",
"{",
"return",
"createStandaloneServer",
"(",
"Configuration",
".",
"Builder",
".",
"of",
"(",
"... | Create an embedded standalone server with an already established module loader.
@param moduleLoader the module loader. Cannot be {@code null}
@param jbossHomeDir the location of the root of server installation. Cannot be {@code null} or empty.
@param cmdargs any additional arguments to pass to the embedded server... | [
"Create",
"an",
"embedded",
"standalone",
"server",
"with",
"an",
"already",
"established",
"module",
"loader",
"."
] | train | https://github.com/wildfly/wildfly-core/blob/cfaf0479dcbb2d320a44c5374b93b944ec39fade/embedded/src/main/java/org/wildfly/core/embedded/EmbeddedProcessFactory.java#L133-L140 |
facebookarchive/hadoop-20 | src/mapred/org/apache/hadoop/mapred/TaskInProgress.java | TaskInProgress.getTaskToRun | public Task getTaskToRun(String taskTracker) {
"""
Return a Task that can be sent to a TaskTracker for execution.
"""
// Create the 'taskid'; do not count the 'killed' tasks against the job!
TaskAttemptID taskid = null;
if (nextTaskId < (MAX_TASK_EXECS + maxTaskAttempts + numKilledTasks)) {
... | java | public Task getTaskToRun(String taskTracker) {
// Create the 'taskid'; do not count the 'killed' tasks against the job!
TaskAttemptID taskid = null;
if (nextTaskId < (MAX_TASK_EXECS + maxTaskAttempts + numKilledTasks)) {
// Make sure that the attempts are unqiue across restarts
int attemptId = ... | [
"public",
"Task",
"getTaskToRun",
"(",
"String",
"taskTracker",
")",
"{",
"// Create the 'taskid'; do not count the 'killed' tasks against the job!",
"TaskAttemptID",
"taskid",
"=",
"null",
";",
"if",
"(",
"nextTaskId",
"<",
"(",
"MAX_TASK_EXECS",
"+",
"maxTaskAttempts",
... | Return a Task that can be sent to a TaskTracker for execution. | [
"Return",
"a",
"Task",
"that",
"can",
"be",
"sent",
"to",
"a",
"TaskTracker",
"for",
"execution",
"."
] | train | https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/mapred/org/apache/hadoop/mapred/TaskInProgress.java#L1223-L1246 |
mapbox/mapbox-plugins-android | plugin-localization/src/main/java/com/mapbox/mapboxsdk/plugins/localization/MapLocale.java | MapLocale.addMapLocale | public static void addMapLocale(@NonNull Locale locale, @NonNull MapLocale mapLocale) {
"""
When creating a new MapLocale, you'll need to associate a {@link Locale} so that
{@link Locale#getDefault()} will find the correct corresponding {@link MapLocale}.
@param locale a valid {@link Locale} instance shares... | java | public static void addMapLocale(@NonNull Locale locale, @NonNull MapLocale mapLocale) {
LOCALE_SET.put(locale, mapLocale);
} | [
"public",
"static",
"void",
"addMapLocale",
"(",
"@",
"NonNull",
"Locale",
"locale",
",",
"@",
"NonNull",
"MapLocale",
"mapLocale",
")",
"{",
"LOCALE_SET",
".",
"put",
"(",
"locale",
",",
"mapLocale",
")",
";",
"}"
] | When creating a new MapLocale, you'll need to associate a {@link Locale} so that
{@link Locale#getDefault()} will find the correct corresponding {@link MapLocale}.
@param locale a valid {@link Locale} instance shares a 1 to 1 relationship with the
{@link MapLocale}
@param mapLocale the {@link MapLocale} which share... | [
"When",
"creating",
"a",
"new",
"MapLocale",
"you",
"ll",
"need",
"to",
"associate",
"a",
"{",
"@link",
"Locale",
"}",
"so",
"that",
"{",
"@link",
"Locale#getDefault",
"()",
"}",
"will",
"find",
"the",
"correct",
"corresponding",
"{",
"@link",
"MapLocale",
... | train | https://github.com/mapbox/mapbox-plugins-android/blob/c683cad4d8306945d71838d96fae73b8cbe2e6c9/plugin-localization/src/main/java/com/mapbox/mapboxsdk/plugins/localization/MapLocale.java#L384-L386 |
alibaba/canal | driver/src/main/java/com/alibaba/otter/canal/parse/driver/mysql/packets/UUIDSet.java | UUIDSet.parseInterval | public static Interval parseInterval(String str) {
"""
解析如下格式字符串为Interval: 1 => Interval{start:1, stop:2} 1-3 =>
Interval{start:1, stop:4} 注意!字符串格式表达时[n,m]是两侧都包含的,Interval表达时[n,m)右侧开
@param str
@return
"""
String[] ss = str.split("-");
Interval interval = new Interval();
switch (s... | java | public static Interval parseInterval(String str) {
String[] ss = str.split("-");
Interval interval = new Interval();
switch (ss.length) {
case 1:
interval.start = Long.parseLong(ss[0]);
interval.stop = interval.start + 1;
break;
... | [
"public",
"static",
"Interval",
"parseInterval",
"(",
"String",
"str",
")",
"{",
"String",
"[",
"]",
"ss",
"=",
"str",
".",
"split",
"(",
"\"-\"",
")",
";",
"Interval",
"interval",
"=",
"new",
"Interval",
"(",
")",
";",
"switch",
"(",
"ss",
".",
"len... | 解析如下格式字符串为Interval: 1 => Interval{start:1, stop:2} 1-3 =>
Interval{start:1, stop:4} 注意!字符串格式表达时[n,m]是两侧都包含的,Interval表达时[n,m)右侧开
@param str
@return | [
"解析如下格式字符串为Interval",
":",
"1",
"=",
">",
"Interval",
"{",
"start",
":",
"1",
"stop",
":",
"2",
"}",
"1",
"-",
"3",
"=",
">",
"Interval",
"{",
"start",
":",
"1",
"stop",
":",
"4",
"}",
"注意!字符串格式表达时",
"[",
"n",
"m",
"]",
"是两侧都包含的,Interval表达时",
"[",
... | train | https://github.com/alibaba/canal/blob/8f088cddc0755f4350c5aaae95c6e4002d90a40f/driver/src/main/java/com/alibaba/otter/canal/parse/driver/mysql/packets/UUIDSet.java#L147-L165 |
OpenLiberty/open-liberty | dev/com.ibm.ws.app.manager/src/com/ibm/ws/app/manager/ApplicationManager.java | ApplicationManager.modified | @Modified
protected void modified(ComponentContext compcontext, Map<String, Object> properties) {
"""
DS method to modify the configuration of this component
@param compcontext the context of this component
@param properties the updated configuration properties
"""
Boolean autoExpandValue = (Bo... | java | @Modified
protected void modified(ComponentContext compcontext, Map<String, Object> properties) {
Boolean autoExpandValue = (Boolean) properties.get("autoExpand");
setExpandApps(autoExpandValue == null ? false : autoExpandValue);
Boolean useJandexValue = getProperty(properties, "useJandex",... | [
"@",
"Modified",
"protected",
"void",
"modified",
"(",
"ComponentContext",
"compcontext",
",",
"Map",
"<",
"String",
",",
"Object",
">",
"properties",
")",
"{",
"Boolean",
"autoExpandValue",
"=",
"(",
"Boolean",
")",
"properties",
".",
"get",
"(",
"\"autoExpan... | DS method to modify the configuration of this component
@param compcontext the context of this component
@param properties the updated configuration properties | [
"DS",
"method",
"to",
"modify",
"the",
"configuration",
"of",
"this",
"component"
] | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.app.manager/src/com/ibm/ws/app/manager/ApplicationManager.java#L53-L68 |
jferard/fastods | fastods/src/main/java/com/github/jferard/fastods/ParagraphBuilder.java | ParagraphBuilder.styledLink | public ParagraphBuilder styledLink(final String text, final TextStyle ts, final URL url) {
"""
Create a styled link in the current paragraph.
@param text the text
@param ts the style
@param url the destination
@return this for fluent style
"""
final ParagraphElement paragraphElement = Link.create(text, t... | java | public ParagraphBuilder styledLink(final String text, final TextStyle ts, final URL url) {
final ParagraphElement paragraphElement = Link.create(text, ts, url);
this.paragraphElements.add(paragraphElement);
return this;
} | [
"public",
"ParagraphBuilder",
"styledLink",
"(",
"final",
"String",
"text",
",",
"final",
"TextStyle",
"ts",
",",
"final",
"URL",
"url",
")",
"{",
"final",
"ParagraphElement",
"paragraphElement",
"=",
"Link",
".",
"create",
"(",
"text",
",",
"ts",
",",
"url"... | Create a styled link in the current paragraph.
@param text the text
@param ts the style
@param url the destination
@return this for fluent style | [
"Create",
"a",
"styled",
"link",
"in",
"the",
"current",
"paragraph",
"."
] | train | https://github.com/jferard/fastods/blob/a034d173083ffa602dc525699b97f753082eaef9/fastods/src/main/java/com/github/jferard/fastods/ParagraphBuilder.java#L161-L165 |
albfernandez/itext2 | src/main/java/com/lowagie/text/Table.java | Table.setCurrentLocationToNextValidPosition | private void setCurrentLocationToNextValidPosition(Point aLocation) {
"""
Sets current col/row to valid(empty) pos after addCell/Table
@param aLocation a location in the Table
"""
// set latest location to next valid position
int i, j;
i = aLocation.x;
j = aLocation.y;
... | java | private void setCurrentLocationToNextValidPosition(Point aLocation) {
// set latest location to next valid position
int i, j;
i = aLocation.x;
j = aLocation.y;
do {
if ( (j + 1) == columns ) { // goto next row
i++;
j = 0;
... | [
"private",
"void",
"setCurrentLocationToNextValidPosition",
"(",
"Point",
"aLocation",
")",
"{",
"// set latest location to next valid position",
"int",
"i",
",",
"j",
";",
"i",
"=",
"aLocation",
".",
"x",
";",
"j",
"=",
"aLocation",
".",
"y",
";",
"do",
"{",
... | Sets current col/row to valid(empty) pos after addCell/Table
@param aLocation a location in the Table | [
"Sets",
"current",
"col",
"/",
"row",
"to",
"valid",
"(",
"empty",
")",
"pos",
"after",
"addCell",
"/",
"Table"
] | train | https://github.com/albfernandez/itext2/blob/438fc1899367fd13dfdfa8dfdca9a3c1a7783b84/src/main/java/com/lowagie/text/Table.java#L1294-L1312 |
HadoopGenomics/Hadoop-BAM | src/main/java/org/seqdoop/hadoop_bam/util/BGZFSplitCompressionInputStream.java | BGZFSplitCompressionInputStream.readWithinBlock | private int readWithinBlock(byte[] b, int off, int len) throws IOException {
"""
Read up to <code>len</code> bytes from the stream, but no further than the end of the
compressed block. If at the end of the block then no bytes will be read and a return
value of -2 will be returned; on the next call to read, bytes... | java | private int readWithinBlock(byte[] b, int off, int len) throws IOException {
if (input.endOfBlock()) {
final int available = input.available(); // this will read the next block, if there is one
processedPosition = input.getPosition() >> 16;
if (available == 0) { // end of stream
return -1;... | [
"private",
"int",
"readWithinBlock",
"(",
"byte",
"[",
"]",
"b",
",",
"int",
"off",
",",
"int",
"len",
")",
"throws",
"IOException",
"{",
"if",
"(",
"input",
".",
"endOfBlock",
"(",
")",
")",
"{",
"final",
"int",
"available",
"=",
"input",
".",
"avai... | Read up to <code>len</code> bytes from the stream, but no further than the end of the
compressed block. If at the end of the block then no bytes will be read and a return
value of -2 will be returned; on the next call to read, bytes from the next block
will be returned. This is the same contract as CBZip2InputStream in... | [
"Read",
"up",
"to",
"<code",
">",
"len<",
"/",
"code",
">",
"bytes",
"from",
"the",
"stream",
"but",
"no",
"further",
"than",
"the",
"end",
"of",
"the",
"compressed",
"block",
".",
"If",
"at",
"the",
"end",
"of",
"the",
"block",
"then",
"no",
"bytes"... | train | https://github.com/HadoopGenomics/Hadoop-BAM/blob/9f974cf635a8d72f69604021cc3d5f3469d38d2f/src/main/java/org/seqdoop/hadoop_bam/util/BGZFSplitCompressionInputStream.java#L70-L83 |
liferay/com-liferay-commerce | commerce-service/src/main/java/com/liferay/commerce/service/persistence/impl/CommerceShippingMethodPersistenceImpl.java | CommerceShippingMethodPersistenceImpl.findAll | @Override
public List<CommerceShippingMethod> findAll() {
"""
Returns all the commerce shipping methods.
@return the commerce shipping methods
"""
return findAll(QueryUtil.ALL_POS, QueryUtil.ALL_POS, null);
} | java | @Override
public List<CommerceShippingMethod> findAll() {
return findAll(QueryUtil.ALL_POS, QueryUtil.ALL_POS, null);
} | [
"@",
"Override",
"public",
"List",
"<",
"CommerceShippingMethod",
">",
"findAll",
"(",
")",
"{",
"return",
"findAll",
"(",
"QueryUtil",
".",
"ALL_POS",
",",
"QueryUtil",
".",
"ALL_POS",
",",
"null",
")",
";",
"}"
] | Returns all the commerce shipping methods.
@return the commerce shipping methods | [
"Returns",
"all",
"the",
"commerce",
"shipping",
"methods",
"."
] | train | https://github.com/liferay/com-liferay-commerce/blob/9e54362d7f59531fc684016ba49ee7cdc3a2f22b/commerce-service/src/main/java/com/liferay/commerce/service/persistence/impl/CommerceShippingMethodPersistenceImpl.java#L2007-L2010 |
jblas-project/jblas | src/main/java/org/jblas/util/LibraryLoader.java | LibraryLoader.fatJarLibraryPath | private String fatJarLibraryPath(String linkage, String flavor) {
"""
Compute the path to the library. The path is basically
"/" + os.name + "/" + os.arch + "/" + libname.
"""
String sep = "/"; //System.getProperty("file.separator");
String os_name = getUnifiedOSName();
String os_arch = System.... | java | private String fatJarLibraryPath(String linkage, String flavor) {
String sep = "/"; //System.getProperty("file.separator");
String os_name = getUnifiedOSName();
String os_arch = System.getProperty("os.arch");
String path = sep + "lib" + sep + linkage + sep + os_name + sep + os_arch + sep;
if (n... | [
"private",
"String",
"fatJarLibraryPath",
"(",
"String",
"linkage",
",",
"String",
"flavor",
")",
"{",
"String",
"sep",
"=",
"\"/\"",
";",
"//System.getProperty(\"file.separator\");\r",
"String",
"os_name",
"=",
"getUnifiedOSName",
"(",
")",
";",
"String",
"os_arch"... | Compute the path to the library. The path is basically
"/" + os.name + "/" + os.arch + "/" + libname. | [
"Compute",
"the",
"path",
"to",
"the",
"library",
".",
"The",
"path",
"is",
"basically",
"/",
"+",
"os",
".",
"name",
"+",
"/",
"+",
"os",
".",
"arch",
"+",
"/",
"+",
"libname",
"."
] | train | https://github.com/jblas-project/jblas/blob/2818f231228e655cda80dfd8e0b87709fdfd8a70/src/main/java/org/jblas/util/LibraryLoader.java#L220-L228 |
ACRA/acra | acra-core/src/main/java/org/acra/util/ToastSender.java | ToastSender.sendToast | public static void sendToast(@NonNull Context context, String toast, @IntRange(from = 0, to = 1) int toastLength) {
"""
Sends a Toast and ensures that any Exception thrown during sending is handled.
@param context Application context.
@param toast toast message.
@param toastLength Length of the Toas... | java | public static void sendToast(@NonNull Context context, String toast, @IntRange(from = 0, to = 1) int toastLength) {
try {
Toast.makeText(context, toast, toastLength).show();
} catch (RuntimeException e) {
ACRA.log.w(LOG_TAG, "Could not send crash Toast", e);
}
} | [
"public",
"static",
"void",
"sendToast",
"(",
"@",
"NonNull",
"Context",
"context",
",",
"String",
"toast",
",",
"@",
"IntRange",
"(",
"from",
"=",
"0",
",",
"to",
"=",
"1",
")",
"int",
"toastLength",
")",
"{",
"try",
"{",
"Toast",
".",
"makeText",
"... | Sends a Toast and ensures that any Exception thrown during sending is handled.
@param context Application context.
@param toast toast message.
@param toastLength Length of the Toast. | [
"Sends",
"a",
"Toast",
"and",
"ensures",
"that",
"any",
"Exception",
"thrown",
"during",
"sending",
"is",
"handled",
"."
] | train | https://github.com/ACRA/acra/blob/bfa3235ab110328c5ab2f792ddf8ee87be4a32d1/acra-core/src/main/java/org/acra/util/ToastSender.java#L45-L51 |
Omertron/api-themoviedb | src/main/java/com/omertron/themoviedbapi/methods/TmdbLists.java | TmdbLists.deleteList | public StatusCode deleteList(String sessionId, String listId) throws MovieDbException {
"""
This method lets users delete a list that they created. A valid session id is required.
@param sessionId
@param listId
@return
@throws MovieDbException
"""
TmdbParameters parameters = new TmdbParameters();... | java | public StatusCode deleteList(String sessionId, String listId) throws MovieDbException {
TmdbParameters parameters = new TmdbParameters();
parameters.add(Param.ID, listId);
parameters.add(Param.SESSION_ID, sessionId);
URL url = new ApiUrl(apiKey, MethodBase.LIST).buildUrl(parameters);
... | [
"public",
"StatusCode",
"deleteList",
"(",
"String",
"sessionId",
",",
"String",
"listId",
")",
"throws",
"MovieDbException",
"{",
"TmdbParameters",
"parameters",
"=",
"new",
"TmdbParameters",
"(",
")",
";",
"parameters",
".",
"add",
"(",
"Param",
".",
"ID",
"... | This method lets users delete a list that they created. A valid session id is required.
@param sessionId
@param listId
@return
@throws MovieDbException | [
"This",
"method",
"lets",
"users",
"delete",
"a",
"list",
"that",
"they",
"created",
".",
"A",
"valid",
"session",
"id",
"is",
"required",
"."
] | train | https://github.com/Omertron/api-themoviedb/blob/bf132d7c7271734e13b58ba3bc92bba46f220118/src/main/java/com/omertron/themoviedbapi/methods/TmdbLists.java#L140-L153 |
couchbaselabs/couchbase-lite-java-forestdb | src/main/java/com/couchbase/lite/store/ForestBridge.java | ForestBridge.revisionObject | public static RevisionInternal revisionObject(
Document doc,
String docID,
String revID,
boolean withBody) {
"""
in CBLForestBridge.m
+ (CBL_MutableRevision*) revisionObjectFromForestDoc: (VersionedDocument&)doc
revID: (NSString*)revID
withBody: (BOOL)withBody
... | java | public static RevisionInternal revisionObject(
Document doc,
String docID,
String revID,
boolean withBody) {
boolean deleted = doc.selectedRevDeleted();
if (revID == null)
revID = doc.getSelectedRevID();
RevisionInternal rev = new Revi... | [
"public",
"static",
"RevisionInternal",
"revisionObject",
"(",
"Document",
"doc",
",",
"String",
"docID",
",",
"String",
"revID",
",",
"boolean",
"withBody",
")",
"{",
"boolean",
"deleted",
"=",
"doc",
".",
"selectedRevDeleted",
"(",
")",
";",
"if",
"(",
"re... | in CBLForestBridge.m
+ (CBL_MutableRevision*) revisionObjectFromForestDoc: (VersionedDocument&)doc
revID: (NSString*)revID
withBody: (BOOL)withBody | [
"in",
"CBLForestBridge",
".",
"m",
"+",
"(",
"CBL_MutableRevision",
"*",
")",
"revisionObjectFromForestDoc",
":",
"(",
"VersionedDocument&",
")",
"doc",
"revID",
":",
"(",
"NSString",
"*",
")",
"revID",
"withBody",
":",
"(",
"BOOL",
")",
"withBody"
] | train | https://github.com/couchbaselabs/couchbase-lite-java-forestdb/blob/fd806b251dd7dcc7a76ab7a8db618e30c3419f06/src/main/java/com/couchbase/lite/store/ForestBridge.java#L40-L57 |
pebble/pebble-android-sdk | PebbleKit/PebbleKit/src/main/java/com/getpebble/android/kit/PebbleKit.java | PebbleKit.sendNackToPebble | public static void sendNackToPebble(final Context context, final int transactionId)
throws IllegalArgumentException {
"""
Send a message to the connected watch that the previously sent PebbleDictionary was not received successfully. To
avoid protocol timeouts on the watch, applications <em>must</em> A... | java | public static void sendNackToPebble(final Context context, final int transactionId)
throws IllegalArgumentException {
if ((transactionId & ~0xff) != 0) {
throw new IllegalArgumentException(String.format(
"transaction id must be between (0, 255); got '%d'", transactio... | [
"public",
"static",
"void",
"sendNackToPebble",
"(",
"final",
"Context",
"context",
",",
"final",
"int",
"transactionId",
")",
"throws",
"IllegalArgumentException",
"{",
"if",
"(",
"(",
"transactionId",
"&",
"~",
"0xff",
")",
"!=",
"0",
")",
"{",
"throw",
"n... | Send a message to the connected watch that the previously sent PebbleDictionary was not received successfully. To
avoid protocol timeouts on the watch, applications <em>must</em> ACK or NACK all received messages.
@param context
The context used to send the broadcast.
@param transactionId
The transaction id of the mes... | [
"Send",
"a",
"message",
"to",
"the",
"connected",
"watch",
"that",
"the",
"previously",
"sent",
"PebbleDictionary",
"was",
"not",
"received",
"successfully",
".",
"To",
"avoid",
"protocol",
"timeouts",
"on",
"the",
"watch",
"applications",
"<em",
">",
"must<",
... | train | https://github.com/pebble/pebble-android-sdk/blob/ddfc53ecf3950deebb62a1f205aa21fbe9bce45d/PebbleKit/PebbleKit/src/main/java/com/getpebble/android/kit/PebbleKit.java#L357-L368 |
Mozu/mozu-java | mozu-javaasync-core/src/main/java/com/mozu/api/urls/platform/appdev/AppPackageUrl.java | AppPackageUrl.clonePackageUrl | public static MozuUrl clonePackageUrl(String applicationKey, String packageName, String responseFields) {
"""
Get Resource Url for ClonePackage
@param applicationKey The application key uniquely identifies the developer namespace, application ID, version, and package in Dev Center. The format is {Dev Account name... | java | public static MozuUrl clonePackageUrl(String applicationKey, String packageName, String responseFields)
{
UrlFormatter formatter = new UrlFormatter("/api/platform/appdev/apppackages/{applicationKey}/clone/{packageName}?responseFields={responseFields}");
formatter.formatUrl("applicationKey", applicationKey);
... | [
"public",
"static",
"MozuUrl",
"clonePackageUrl",
"(",
"String",
"applicationKey",
",",
"String",
"packageName",
",",
"String",
"responseFields",
")",
"{",
"UrlFormatter",
"formatter",
"=",
"new",
"UrlFormatter",
"(",
"\"/api/platform/appdev/apppackages/{applicationKey}/clo... | Get Resource Url for ClonePackage
@param applicationKey The application key uniquely identifies the developer namespace, application ID, version, and package in Dev Center. The format is {Dev Account namespace}.{Application ID}.{Application Version}.{Package name}.
@param packageName
@param responseFields Filtering syn... | [
"Get",
"Resource",
"Url",
"for",
"ClonePackage"
] | train | https://github.com/Mozu/mozu-java/blob/5beadde73601a859f845e3e2fc1077b39c8bea83/mozu-javaasync-core/src/main/java/com/mozu/api/urls/platform/appdev/AppPackageUrl.java#L115-L122 |
fuinorg/utils4j | src/main/java/org/fuin/utils4j/PropertiesUtils.java | PropertiesUtils.loadProperties | public static Properties loadProperties(final URL baseUrl, final String filename) {
"""
Load a file from an directory.
@param baseUrl
Directory URL - Cannot be <code>null</code>.
@param filename
Filename without path - Cannot be <code>null</code>.
@return Properties.
"""
return loadProperties(... | java | public static Properties loadProperties(final URL baseUrl, final String filename) {
return loadProperties(createUrl(baseUrl, "", filename));
} | [
"public",
"static",
"Properties",
"loadProperties",
"(",
"final",
"URL",
"baseUrl",
",",
"final",
"String",
"filename",
")",
"{",
"return",
"loadProperties",
"(",
"createUrl",
"(",
"baseUrl",
",",
"\"\"",
",",
"filename",
")",
")",
";",
"}"
] | Load a file from an directory.
@param baseUrl
Directory URL - Cannot be <code>null</code>.
@param filename
Filename without path - Cannot be <code>null</code>.
@return Properties. | [
"Load",
"a",
"file",
"from",
"an",
"directory",
"."
] | train | https://github.com/fuinorg/utils4j/blob/71cf88e0a8d8ed67bbac513bf3cab165cd7e3280/src/main/java/org/fuin/utils4j/PropertiesUtils.java#L147-L149 |
roboconf/roboconf-platform | core/roboconf-dm-templating/src/main/java/net/roboconf/dm/templating/internal/helpers/AllHelper.java | AllHelper.apply | @Override
public CharSequence apply( final Object computedContext, final Options options ) throws IOException {
"""
Selects instances according to a selection path.
<p>For example:</p>
<pre>
{{#all children path="/VM/Apache" installer="script"}}
{{path}}
{{/all}}
</pre>
"""
// Get parameters
Object... | java | @Override
public CharSequence apply( final Object computedContext, final Options options ) throws IOException {
// Get parameters
Object context = options.context.model();
String componentPath = null;
if( computedContext instanceof String )
componentPath = (String) computedContext;
if( Utils.isEmptyOrWh... | [
"@",
"Override",
"public",
"CharSequence",
"apply",
"(",
"final",
"Object",
"computedContext",
",",
"final",
"Options",
"options",
")",
"throws",
"IOException",
"{",
"// Get parameters",
"Object",
"context",
"=",
"options",
".",
"context",
".",
"model",
"(",
")"... | Selects instances according to a selection path.
<p>For example:</p>
<pre>
{{#all children path="/VM/Apache" installer="script"}}
{{path}}
{{/all}}
</pre> | [
"Selects",
"instances",
"according",
"to",
"a",
"selection",
"path",
".",
"<p",
">",
"For",
"example",
":",
"<",
"/",
"p",
">",
"<pre",
">",
"{{",
"#all",
"children",
"path",
"=",
"/",
"VM",
"/",
"Apache",
"installer",
"=",
"script",
"}}",
"{{",
"pat... | train | https://github.com/roboconf/roboconf-platform/blob/add54eead479effb138d0ff53a2d637902b82702/core/roboconf-dm-templating/src/main/java/net/roboconf/dm/templating/internal/helpers/AllHelper.java#L62-L89 |
ixa-ehu/ixa-pipe-ml | src/main/java/eus/ixa/ixa/pipe/ml/utils/IOUtils.java | IOUtils.writeObjectToFile | public static File writeObjectToFile(final Object o, final String fileName)
throws IOException {
"""
Serialize java object to a file.
@param o
the java object
@param fileName
the name of the file
@return the file
@throws IOException
if io problems
"""
final File outFile = new File(fileName);... | java | public static File writeObjectToFile(final Object o, final String fileName)
throws IOException {
final File outFile = new File(fileName);
OutputStream outputStream = new FileOutputStream(outFile);
if (fileName.endsWith(".gz")) {
outputStream = new GZIPOutputStream(outputStream);
}
output... | [
"public",
"static",
"File",
"writeObjectToFile",
"(",
"final",
"Object",
"o",
",",
"final",
"String",
"fileName",
")",
"throws",
"IOException",
"{",
"final",
"File",
"outFile",
"=",
"new",
"File",
"(",
"fileName",
")",
";",
"OutputStream",
"outputStream",
"=",... | Serialize java object to a file.
@param o
the java object
@param fileName
the name of the file
@return the file
@throws IOException
if io problems | [
"Serialize",
"java",
"object",
"to",
"a",
"file",
"."
] | train | https://github.com/ixa-ehu/ixa-pipe-ml/blob/c817fa1e40e96ed15fc79d22c3a7c25f1a40d172/src/main/java/eus/ixa/ixa/pipe/ml/utils/IOUtils.java#L307-L319 |
apache/flink | flink-optimizer/src/main/java/org/apache/flink/optimizer/dataproperties/GlobalProperties.java | GlobalProperties.setRangePartitioned | public void setRangePartitioned(Ordering ordering, DataDistribution distribution) {
"""
Set the parameters for range partition.
@param ordering Order of the partitioned fields
@param distribution The data distribution for range partition. User can supply a customized data distribution,
also the data distribut... | java | public void setRangePartitioned(Ordering ordering, DataDistribution distribution) {
if (ordering == null) {
throw new NullPointerException();
}
this.partitioning = PartitioningProperty.RANGE_PARTITIONED;
this.ordering = ordering;
this.partitioningFields = ordering.getInvolvedIndexes();
this.distributi... | [
"public",
"void",
"setRangePartitioned",
"(",
"Ordering",
"ordering",
",",
"DataDistribution",
"distribution",
")",
"{",
"if",
"(",
"ordering",
"==",
"null",
")",
"{",
"throw",
"new",
"NullPointerException",
"(",
")",
";",
"}",
"this",
".",
"partitioning",
"="... | Set the parameters for range partition.
@param ordering Order of the partitioned fields
@param distribution The data distribution for range partition. User can supply a customized data distribution,
also the data distribution can be null. | [
"Set",
"the",
"parameters",
"for",
"range",
"partition",
"."
] | train | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-optimizer/src/main/java/org/apache/flink/optimizer/dataproperties/GlobalProperties.java#L109-L118 |
beihaifeiwu/dolphin | dolphin-mybatis-generator/src/main/java/com/freetmp/mbg/plugin/XMLMergePlugin.java | XMLMergePlugin.getDirectory | public File getDirectory(String targetProject, String targetPackage)
throws ShellException {
"""
从DefaultShellCallback中借用的解析文件夹的函数
@param targetProject target project
@param targetPackage target package
@return file instance
@throws ShellException Cannot get infos form environment
"""
// target... | java | public File getDirectory(String targetProject, String targetPackage)
throws ShellException {
// targetProject is interpreted as a directory that must exist
//
// targetPackage is interpreted as a sub directory, but in package
// format (with dots instead of slashes). The sub directory will be
... | [
"public",
"File",
"getDirectory",
"(",
"String",
"targetProject",
",",
"String",
"targetPackage",
")",
"throws",
"ShellException",
"{",
"// targetProject is interpreted as a directory that must exist",
"//",
"// targetPackage is interpreted as a sub directory, but in package",
"// fo... | 从DefaultShellCallback中借用的解析文件夹的函数
@param targetProject target project
@param targetPackage target package
@return file instance
@throws ShellException Cannot get infos form environment | [
"从DefaultShellCallback中借用的解析文件夹的函数"
] | train | https://github.com/beihaifeiwu/dolphin/blob/b100579cc6986dce5eba5593ebb5fbae7bad9d1a/dolphin-mybatis-generator/src/main/java/com/freetmp/mbg/plugin/XMLMergePlugin.java#L61-L93 |
Azure/azure-sdk-for-java | network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/ExpressRouteCircuitAuthorizationsInner.java | ExpressRouteCircuitAuthorizationsInner.beginCreateOrUpdateAsync | public Observable<ExpressRouteCircuitAuthorizationInner> beginCreateOrUpdateAsync(String resourceGroupName, String circuitName, String authorizationName, ExpressRouteCircuitAuthorizationInner authorizationParameters) {
"""
Creates or updates an authorization in the specified express route circuit.
@param resour... | java | public Observable<ExpressRouteCircuitAuthorizationInner> beginCreateOrUpdateAsync(String resourceGroupName, String circuitName, String authorizationName, ExpressRouteCircuitAuthorizationInner authorizationParameters) {
return beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, circuitName, authorizat... | [
"public",
"Observable",
"<",
"ExpressRouteCircuitAuthorizationInner",
">",
"beginCreateOrUpdateAsync",
"(",
"String",
"resourceGroupName",
",",
"String",
"circuitName",
",",
"String",
"authorizationName",
",",
"ExpressRouteCircuitAuthorizationInner",
"authorizationParameters",
")... | Creates or updates an authorization in the specified express route circuit.
@param resourceGroupName The name of the resource group.
@param circuitName The name of the express route circuit.
@param authorizationName The name of the authorization.
@param authorizationParameters Parameters supplied to the create or upda... | [
"Creates",
"or",
"updates",
"an",
"authorization",
"in",
"the",
"specified",
"express",
"route",
"circuit",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/ExpressRouteCircuitAuthorizationsInner.java#L473-L480 |
PeterisP/LVTagger | src/main/java/edu/stanford/nlp/trees/TransformingTreebank.java | TransformingTreebank.main | public static void main(String[] args) {
"""
Loads treebank grammar from first argument and prints it.
Just a demonstration of functionality. <br>
<code>usage: java MemoryTreebank treebankFilesPath</code>
@param args array of command-line arguments
"""
Timing.startTime();
Treebank treebank = new... | java | public static void main(String[] args) {
Timing.startTime();
Treebank treebank = new DiskTreebank(new TreeReaderFactory() {
public TreeReader newTreeReader(Reader in) {
return new PennTreeReader(in);
}
});
Treebank treebank2 = new MemoryTreebank(new TreeReaderFactory() {
... | [
"public",
"static",
"void",
"main",
"(",
"String",
"[",
"]",
"args",
")",
"{",
"Timing",
".",
"startTime",
"(",
")",
";",
"Treebank",
"treebank",
"=",
"new",
"DiskTreebank",
"(",
"new",
"TreeReaderFactory",
"(",
")",
"{",
"public",
"TreeReader",
"newTreeRe... | Loads treebank grammar from first argument and prints it.
Just a demonstration of functionality. <br>
<code>usage: java MemoryTreebank treebankFilesPath</code>
@param args array of command-line arguments | [
"Loads",
"treebank",
"grammar",
"from",
"first",
"argument",
"and",
"prints",
"it",
".",
"Just",
"a",
"demonstration",
"of",
"functionality",
".",
"<br",
">",
"<code",
">",
"usage",
":",
"java",
"MemoryTreebank",
"treebankFilesPath<",
"/",
"code",
">"
] | train | https://github.com/PeterisP/LVTagger/blob/b3d44bab9ec07ace0d13612c448a6b7298c1f681/src/main/java/edu/stanford/nlp/trees/TransformingTreebank.java#L127-L181 |
dkpro/dkpro-jwpl | de.tudarmstadt.ukp.wikipedia.api/src/main/java/de/tudarmstadt/ukp/wikipedia/api/CategoryGraph.java | CategoryGraph.getLCS | public Category getLCS(Category category1, Category category2) throws WikiApiException {
"""
Gets the lowest common subsumer (LCS) of two nodes.
The LCS of two nodes is first node on the path to the root, that has both nodes as sons.
Nodes that are not in the same connected component as the root node are defined... | java | public Category getLCS(Category category1, Category category2) throws WikiApiException {
return getLCS(category1.getPageId(),category2.getPageId());
} | [
"public",
"Category",
"getLCS",
"(",
"Category",
"category1",
",",
"Category",
"category2",
")",
"throws",
"WikiApiException",
"{",
"return",
"getLCS",
"(",
"category1",
".",
"getPageId",
"(",
")",
",",
"category2",
".",
"getPageId",
"(",
")",
")",
";",
"}"
... | Gets the lowest common subsumer (LCS) of two nodes.
The LCS of two nodes is first node on the path to the root, that has both nodes as sons.
Nodes that are not in the same connected component as the root node are defined to have no LCS.
@param category1 The first category node.
@param category2 The second category node... | [
"Gets",
"the",
"lowest",
"common",
"subsumer",
"(",
"LCS",
")",
"of",
"two",
"nodes",
".",
"The",
"LCS",
"of",
"two",
"nodes",
"is",
"first",
"node",
"on",
"the",
"path",
"to",
"the",
"root",
"that",
"has",
"both",
"nodes",
"as",
"sons",
".",
"Nodes"... | train | https://github.com/dkpro/dkpro-jwpl/blob/0a0304b6a0aa13acc18838957994e06dd4613a58/de.tudarmstadt.ukp.wikipedia.api/src/main/java/de/tudarmstadt/ukp/wikipedia/api/CategoryGraph.java#L397-L399 |
linkedin/dexmaker | dexmaker-mockito-inline/src/main/java/com/android/dx/mockito/inline/MockMethodAdvice.java | MockMethodAdvice.isOverridden | public boolean isOverridden(Object instance, Method origin) {
"""
Check if a method is overridden.
@param instance mocked instance
@param origin method that might be overridden
@return {@code true} iff the method is overridden
"""
Class<?> currentType = instance.getClass();
do {
... | java | public boolean isOverridden(Object instance, Method origin) {
Class<?> currentType = instance.getClass();
do {
try {
return !origin.equals(currentType.getDeclaredMethod(origin.getName(),
origin.getParameterTypes()));
} catch (NoSuchMethodE... | [
"public",
"boolean",
"isOverridden",
"(",
"Object",
"instance",
",",
"Method",
"origin",
")",
"{",
"Class",
"<",
"?",
">",
"currentType",
"=",
"instance",
".",
"getClass",
"(",
")",
";",
"do",
"{",
"try",
"{",
"return",
"!",
"origin",
".",
"equals",
"(... | Check if a method is overridden.
@param instance mocked instance
@param origin method that might be overridden
@return {@code true} iff the method is overridden | [
"Check",
"if",
"a",
"method",
"is",
"overridden",
"."
] | train | https://github.com/linkedin/dexmaker/blob/c58ffebcbb2564c7d1fa6fb58b48f351c330296d/dexmaker-mockito-inline/src/main/java/com/android/dx/mockito/inline/MockMethodAdvice.java#L239-L252 |
looly/hutool | hutool-crypto/src/main/java/cn/hutool/crypto/SecureUtil.java | SecureUtil.getCertificate | public static Certificate getCertificate(KeyStore keyStore, String alias) {
"""
获得 Certification
@param keyStore {@link KeyStore}
@param alias 别名
@return {@link Certificate}
"""
return KeyUtil.getCertificate(keyStore, alias);
} | java | public static Certificate getCertificate(KeyStore keyStore, String alias) {
return KeyUtil.getCertificate(keyStore, alias);
} | [
"public",
"static",
"Certificate",
"getCertificate",
"(",
"KeyStore",
"keyStore",
",",
"String",
"alias",
")",
"{",
"return",
"KeyUtil",
".",
"getCertificate",
"(",
"keyStore",
",",
"alias",
")",
";",
"}"
] | 获得 Certification
@param keyStore {@link KeyStore}
@param alias 别名
@return {@link Certificate} | [
"获得",
"Certification"
] | train | https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-crypto/src/main/java/cn/hutool/crypto/SecureUtil.java#L388-L390 |
google/j2objc | xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xalan/transformer/TransformerImpl.java | TransformerImpl.replaceOrPushUserParam | private void replaceOrPushUserParam(QName qname, XObject xval) {
"""
NEEDSDOC Method replaceOrPushUserParam
NEEDSDOC @param qname
NEEDSDOC @param xval
"""
int n = m_userParams.size();
for (int i = n - 1; i >= 0; i--)
{
Arg arg = (Arg) m_userParams.elementAt(i);
if (arg.getQName... | java | private void replaceOrPushUserParam(QName qname, XObject xval)
{
int n = m_userParams.size();
for (int i = n - 1; i >= 0; i--)
{
Arg arg = (Arg) m_userParams.elementAt(i);
if (arg.getQName().equals(qname))
{
m_userParams.setElementAt(new Arg(qname, xval, true), i);
re... | [
"private",
"void",
"replaceOrPushUserParam",
"(",
"QName",
"qname",
",",
"XObject",
"xval",
")",
"{",
"int",
"n",
"=",
"m_userParams",
".",
"size",
"(",
")",
";",
"for",
"(",
"int",
"i",
"=",
"n",
"-",
"1",
";",
"i",
">=",
"0",
";",
"i",
"--",
")... | NEEDSDOC Method replaceOrPushUserParam
NEEDSDOC @param qname
NEEDSDOC @param xval | [
"NEEDSDOC",
"Method",
"replaceOrPushUserParam"
] | train | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xalan/transformer/TransformerImpl.java#L1461-L1479 |
google/Accessibility-Test-Framework-for-Android | src/main/java/com/googlecode/eyesfree/utils/AccessibilityNodeInfoUtils.java | AccessibilityNodeInfoUtils.isClickable | public static boolean isClickable(AccessibilityNodeInfoCompat node) {
"""
Returns whether a node is clickable. That is, the node supports at least one of the
following:
<ul>
<li>{@link AccessibilityNodeInfoCompat#isClickable()}</li>
<li>{@link AccessibilityNodeInfoCompat#ACTION_CLICK}</li>
</ul>
@param nod... | java | public static boolean isClickable(AccessibilityNodeInfoCompat node) {
if (node == null) {
return false;
}
if (node.isClickable()) {
return true;
}
return supportsAnyAction(node, AccessibilityNodeInfoCompat.ACTION_CLICK);
} | [
"public",
"static",
"boolean",
"isClickable",
"(",
"AccessibilityNodeInfoCompat",
"node",
")",
"{",
"if",
"(",
"node",
"==",
"null",
")",
"{",
"return",
"false",
";",
"}",
"if",
"(",
"node",
".",
"isClickable",
"(",
")",
")",
"{",
"return",
"true",
";",
... | Returns whether a node is clickable. That is, the node supports at least one of the
following:
<ul>
<li>{@link AccessibilityNodeInfoCompat#isClickable()}</li>
<li>{@link AccessibilityNodeInfoCompat#ACTION_CLICK}</li>
</ul>
@param node The node to examine.
@return {@code true} if node is clickable. | [
"Returns",
"whether",
"a",
"node",
"is",
"clickable",
".",
"That",
"is",
"the",
"node",
"supports",
"at",
"least",
"one",
"of",
"the",
"following",
":",
"<ul",
">",
"<li",
">",
"{",
"@link",
"AccessibilityNodeInfoCompat#isClickable",
"()",
"}",
"<",
"/",
"... | train | https://github.com/google/Accessibility-Test-Framework-for-Android/blob/a6117fe0059c82dd764fa628d3817d724570f69e/src/main/java/com/googlecode/eyesfree/utils/AccessibilityNodeInfoUtils.java#L364-L374 |
pierre/serialization | thrift/src/main/java/com/ning/metrics/serialization/event/ThriftToThriftEnvelopeEvent.java | ThriftToThriftEnvelopeEvent.extractEvent | public static ThriftEnvelopeEvent extractEvent(final String type, final byte[] payload) throws TException {
"""
Given a serialized Thrift, generate a ThrifTEnvelopeEvent
@param type Thrift schema name
@param payload serialized Thrift
@return ThriftEnvelopeEvent representing the Thrift (the event timestamp ... | java | public static ThriftEnvelopeEvent extractEvent(final String type, final byte[] payload) throws TException
{
return extractEvent(type, new DateTime(), payload);
} | [
"public",
"static",
"ThriftEnvelopeEvent",
"extractEvent",
"(",
"final",
"String",
"type",
",",
"final",
"byte",
"[",
"]",
"payload",
")",
"throws",
"TException",
"{",
"return",
"extractEvent",
"(",
"type",
",",
"new",
"DateTime",
"(",
")",
",",
"payload",
"... | Given a serialized Thrift, generate a ThrifTEnvelopeEvent
@param type Thrift schema name
@param payload serialized Thrift
@return ThriftEnvelopeEvent representing the Thrift (the event timestamp defaults to now())
@throws TException if the payload is not a valid Thrift | [
"Given",
"a",
"serialized",
"Thrift",
"generate",
"a",
"ThrifTEnvelopeEvent"
] | train | https://github.com/pierre/serialization/blob/b15b7c749ba78bfe94dce8fc22f31b30b2e6830b/thrift/src/main/java/com/ning/metrics/serialization/event/ThriftToThriftEnvelopeEvent.java#L86-L89 |
OpenLiberty/open-liberty | dev/com.ibm.json4j/src/com/ibm/json/xml/internal/JSONObject.java | JSONObject.writeAttribute | private void writeAttribute(Writer writer, String name, String value, int depth, boolean compact)
throws IOException {
"""
Internal method to write out a proper JSON attribute string.
@param writer The writer to use while serializing
@param name The attribute name to use.
@param value The value to assign to... | java | private void writeAttribute(Writer writer, String name, String value, int depth, boolean compact)
throws IOException
{
if (logger.isLoggable(Level.FINER)) logger.entering(className, "writeAttribute(Writer, String, String, int)");
if (!compact)
{
writeIndention(writer, depth)... | [
"private",
"void",
"writeAttribute",
"(",
"Writer",
"writer",
",",
"String",
"name",
",",
"String",
"value",
",",
"int",
"depth",
",",
"boolean",
"compact",
")",
"throws",
"IOException",
"{",
"if",
"(",
"logger",
".",
"isLoggable",
"(",
"Level",
".",
"FINE... | Internal method to write out a proper JSON attribute string.
@param writer The writer to use while serializing
@param name The attribute name to use.
@param value The value to assign to the attribute.
@param depth How far to indent the JSON text.
@param compact Flag to denote whether or not to use pretty indention, or ... | [
"Internal",
"method",
"to",
"write",
"out",
"a",
"proper",
"JSON",
"attribute",
"string",
"."
] | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.json4j/src/com/ibm/json/xml/internal/JSONObject.java#L205-L234 |
jamesdbloom/mockserver | mockserver-core/src/main/java/org/mockserver/model/HttpRequest.java | HttpRequest.withBody | public HttpRequest withBody(String body, Charset charset) {
"""
The exact string body to match on such as "this is an exact string body"
@param body the body on such as "this is an exact string body"
@param charset character set the string will be encoded in
"""
if (body != null) {
t... | java | public HttpRequest withBody(String body, Charset charset) {
if (body != null) {
this.body = new StringBody(body, charset);
}
return this;
} | [
"public",
"HttpRequest",
"withBody",
"(",
"String",
"body",
",",
"Charset",
"charset",
")",
"{",
"if",
"(",
"body",
"!=",
"null",
")",
"{",
"this",
".",
"body",
"=",
"new",
"StringBody",
"(",
"body",
",",
"charset",
")",
";",
"}",
"return",
"this",
"... | The exact string body to match on such as "this is an exact string body"
@param body the body on such as "this is an exact string body"
@param charset character set the string will be encoded in | [
"The",
"exact",
"string",
"body",
"to",
"match",
"on",
"such",
"as",
"this",
"is",
"an",
"exact",
"string",
"body"
] | train | https://github.com/jamesdbloom/mockserver/blob/8b84fdd877e57b4eb780c9f8c8b1d65bcb448025/mockserver-core/src/main/java/org/mockserver/model/HttpRequest.java#L249-L254 |
UrielCh/ovh-java-sdk | ovh-java-sdk-me/src/main/java/net/minidev/ovh/api/ApiOvhMe.java | ApiOvhMe.task_contactChange_id_GET | public net.minidev.ovh.api.nichandle.contactchange.OvhTask task_contactChange_id_GET(Long id) throws IOException {
"""
Get this object properties
REST: GET /me/task/contactChange/{id}
@param id [required]
"""
String qPath = "/me/task/contactChange/{id}";
StringBuilder sb = path(qPath, id);
String res... | java | public net.minidev.ovh.api.nichandle.contactchange.OvhTask task_contactChange_id_GET(Long id) throws IOException {
String qPath = "/me/task/contactChange/{id}";
StringBuilder sb = path(qPath, id);
String resp = exec(qPath, "GET", sb.toString(), null);
return convertTo(resp, net.minidev.ovh.api.nichandle.contact... | [
"public",
"net",
".",
"minidev",
".",
"ovh",
".",
"api",
".",
"nichandle",
".",
"contactchange",
".",
"OvhTask",
"task_contactChange_id_GET",
"(",
"Long",
"id",
")",
"throws",
"IOException",
"{",
"String",
"qPath",
"=",
"\"/me/task/contactChange/{id}\"",
";",
"S... | Get this object properties
REST: GET /me/task/contactChange/{id}
@param id [required] | [
"Get",
"this",
"object",
"properties"
] | train | https://github.com/UrielCh/ovh-java-sdk/blob/6d531a40e56e09701943e334c25f90f640c55701/ovh-java-sdk-me/src/main/java/net/minidev/ovh/api/ApiOvhMe.java#L2491-L2496 |
apache/fluo | modules/core/src/main/java/org/apache/fluo/core/impl/FluoConfigurationImpl.java | FluoConfigurationImpl.getTxIfoCacheTimeout | public static long getTxIfoCacheTimeout(FluoConfiguration conf, TimeUnit tu) {
"""
Gets the time before stale entries in the cache are evicted based on age. This method returns a
long representing the time converted from the TimeUnit passed in.
@param conf The FluoConfiguration
@param tu The TimeUnit desired ... | java | public static long getTxIfoCacheTimeout(FluoConfiguration conf, TimeUnit tu) {
long millis = conf.getLong(TX_INFO_CACHE_TIMEOUT, TX_INFO_CACHE_TIMEOUT_DEFAULT);
if (millis <= 0) {
throw new IllegalArgumentException("Timeout must positive for " + TX_INFO_CACHE_TIMEOUT);
}
return tu.convert(millis, ... | [
"public",
"static",
"long",
"getTxIfoCacheTimeout",
"(",
"FluoConfiguration",
"conf",
",",
"TimeUnit",
"tu",
")",
"{",
"long",
"millis",
"=",
"conf",
".",
"getLong",
"(",
"TX_INFO_CACHE_TIMEOUT",
",",
"TX_INFO_CACHE_TIMEOUT_DEFAULT",
")",
";",
"if",
"(",
"millis",... | Gets the time before stale entries in the cache are evicted based on age. This method returns a
long representing the time converted from the TimeUnit passed in.
@param conf The FluoConfiguration
@param tu The TimeUnit desired to represent the cache timeout | [
"Gets",
"the",
"time",
"before",
"stale",
"entries",
"in",
"the",
"cache",
"are",
"evicted",
"based",
"on",
"age",
".",
"This",
"method",
"returns",
"a",
"long",
"representing",
"the",
"time",
"converted",
"from",
"the",
"TimeUnit",
"passed",
"in",
"."
] | train | https://github.com/apache/fluo/blob/8e06204d4167651e2d3b5219b8c1397644e6ba6e/modules/core/src/main/java/org/apache/fluo/core/impl/FluoConfigurationImpl.java#L138-L144 |
strator-dev/greenpepper | greenpepper-open/confluence/greenpepper-confluence-code/src/main/java/com/greenpepper/confluence/macros/historic/AbstractChartBuilder.java | AbstractChartBuilder.addSubTitle | protected void addSubTitle(JFreeChart chart, String subTitle, Font font) {
"""
<p>addSubTitle.</p>
@param chart a {@link org.jfree.chart.JFreeChart} object.
@param subTitle a {@link java.lang.String} object.
@param font a {@link java.awt.Font} object.
"""
if (StringUtils.isNotEmpty(subTitle))
{
Tex... | java | protected void addSubTitle(JFreeChart chart, String subTitle, Font font)
{
if (StringUtils.isNotEmpty(subTitle))
{
TextTitle chartSubTitle = new TextTitle(subTitle);
customizeTitle(chartSubTitle, font);
chart.addSubtitle(chartSubTitle);
}
} | [
"protected",
"void",
"addSubTitle",
"(",
"JFreeChart",
"chart",
",",
"String",
"subTitle",
",",
"Font",
"font",
")",
"{",
"if",
"(",
"StringUtils",
".",
"isNotEmpty",
"(",
"subTitle",
")",
")",
"{",
"TextTitle",
"chartSubTitle",
"=",
"new",
"TextTitle",
"(",... | <p>addSubTitle.</p>
@param chart a {@link org.jfree.chart.JFreeChart} object.
@param subTitle a {@link java.lang.String} object.
@param font a {@link java.awt.Font} object. | [
"<p",
">",
"addSubTitle",
".",
"<",
"/",
"p",
">"
] | train | https://github.com/strator-dev/greenpepper/blob/2a61e6c179b74085babcc559d677490b0cad2d30/greenpepper-open/confluence/greenpepper-confluence-code/src/main/java/com/greenpepper/confluence/macros/historic/AbstractChartBuilder.java#L180-L188 |
box/box-java-sdk | src/main/java/com/box/sdk/BoxUser.java | BoxUser.getAllEnterpriseUsers | public static Iterable<BoxUser.Info> getAllEnterpriseUsers(final BoxAPIConnection api, final String filterTerm,
final String... fields) {
"""
Returns an iterable containing all the enterprise users that matches the filter and specifies which child fields
to retrieve from the API.
@param api t... | java | public static Iterable<BoxUser.Info> getAllEnterpriseUsers(final BoxAPIConnection api, final String filterTerm,
final String... fields) {
return getUsersInfoForType(api, filterTerm, null, null, fields);
} | [
"public",
"static",
"Iterable",
"<",
"BoxUser",
".",
"Info",
">",
"getAllEnterpriseUsers",
"(",
"final",
"BoxAPIConnection",
"api",
",",
"final",
"String",
"filterTerm",
",",
"final",
"String",
"...",
"fields",
")",
"{",
"return",
"getUsersInfoForType",
"(",
"ap... | Returns an iterable containing all the enterprise users that matches the filter and specifies which child fields
to retrieve from the API.
@param api the API connection to be used when retrieving the users.
@param filterTerm used to filter the results to only users starting with this string in either the name ... | [
"Returns",
"an",
"iterable",
"containing",
"all",
"the",
"enterprise",
"users",
"that",
"matches",
"the",
"filter",
"and",
"specifies",
"which",
"child",
"fields",
"to",
"retrieve",
"from",
"the",
"API",
"."
] | train | https://github.com/box/box-java-sdk/blob/35b4ba69417f9d6a002c19dfaab57527750ef349/src/main/java/com/box/sdk/BoxUser.java#L191-L194 |
Azure/azure-sdk-for-java | policy/resource-manager/v2016_12_01/src/main/java/com/microsoft/azure/management/policy/v2016_12_01/implementation/PolicyAssignmentsInner.java | PolicyAssignmentsInner.createAsync | public Observable<PolicyAssignmentInner> createAsync(String scope, String policyAssignmentName, PolicyAssignmentInner parameters) {
"""
Creates a policy assignment.
Policy assignments are inherited by child resources. For example, when you apply a policy to a resource group that policy is assigned to all resource... | java | public Observable<PolicyAssignmentInner> createAsync(String scope, String policyAssignmentName, PolicyAssignmentInner parameters) {
return createWithServiceResponseAsync(scope, policyAssignmentName, parameters).map(new Func1<ServiceResponse<PolicyAssignmentInner>, PolicyAssignmentInner>() {
@Overrid... | [
"public",
"Observable",
"<",
"PolicyAssignmentInner",
">",
"createAsync",
"(",
"String",
"scope",
",",
"String",
"policyAssignmentName",
",",
"PolicyAssignmentInner",
"parameters",
")",
"{",
"return",
"createWithServiceResponseAsync",
"(",
"scope",
",",
"policyAssignmentN... | Creates a policy assignment.
Policy assignments are inherited by child resources. For example, when you apply a policy to a resource group that policy is assigned to all resources in the group.
@param scope The scope of the policy assignment.
@param policyAssignmentName The name of the policy assignment.
@param parame... | [
"Creates",
"a",
"policy",
"assignment",
".",
"Policy",
"assignments",
"are",
"inherited",
"by",
"child",
"resources",
".",
"For",
"example",
"when",
"you",
"apply",
"a",
"policy",
"to",
"a",
"resource",
"group",
"that",
"policy",
"is",
"assigned",
"to",
"all... | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/policy/resource-manager/v2016_12_01/src/main/java/com/microsoft/azure/management/policy/v2016_12_01/implementation/PolicyAssignmentsInner.java#L241-L248 |
ehcache/ehcache3 | impl/src/main/java/org/ehcache/config/builders/CacheConfigurationBuilder.java | CacheConfigurationBuilder.withDiskStoreThreadPool | public CacheConfigurationBuilder<K, V> withDiskStoreThreadPool(String threadPoolAlias, int concurrency) {
"""
Adds a {@link ServiceConfiguration} for the {@link org.ehcache.impl.internal.store.disk.OffHeapDiskStore.Provider}
indicating thread pool alias and write concurrency.
@param threadPoolAlias the thread ... | java | public CacheConfigurationBuilder<K, V> withDiskStoreThreadPool(String threadPoolAlias, int concurrency) {
return addOrReplaceConfiguration(new OffHeapDiskStoreConfiguration(threadPoolAlias, concurrency));
} | [
"public",
"CacheConfigurationBuilder",
"<",
"K",
",",
"V",
">",
"withDiskStoreThreadPool",
"(",
"String",
"threadPoolAlias",
",",
"int",
"concurrency",
")",
"{",
"return",
"addOrReplaceConfiguration",
"(",
"new",
"OffHeapDiskStoreConfiguration",
"(",
"threadPoolAlias",
... | Adds a {@link ServiceConfiguration} for the {@link org.ehcache.impl.internal.store.disk.OffHeapDiskStore.Provider}
indicating thread pool alias and write concurrency.
@param threadPoolAlias the thread pool alias
@param concurrency the write concurrency
@return a new builder with the added configuration | [
"Adds",
"a",
"{",
"@link",
"ServiceConfiguration",
"}",
"for",
"the",
"{",
"@link",
"org",
".",
"ehcache",
".",
"impl",
".",
"internal",
".",
"store",
".",
"disk",
".",
"OffHeapDiskStore",
".",
"Provider",
"}",
"indicating",
"thread",
"pool",
"alias",
"and... | train | https://github.com/ehcache/ehcache3/blob/3cceda57185e522f8d241ddb75146d67ee2af898/impl/src/main/java/org/ehcache/config/builders/CacheConfigurationBuilder.java#L526-L528 |
alkacon/opencms-core | src-gwt/org/opencms/ugc/client/CmsRpcCallHelper.java | CmsRpcCallHelper.executeRpc | @SuppressWarnings("synthetic-access")
public void executeRpc(RequestBuilder requestBuilder) {
"""
Executes the RPC call.<p>
@param requestBuilder the request builder returned by the service interface
"""
final RequestCallback callback = requestBuilder.getCallback();
RequestCallback call... | java | @SuppressWarnings("synthetic-access")
public void executeRpc(RequestBuilder requestBuilder) {
final RequestCallback callback = requestBuilder.getCallback();
RequestCallback callbackWrapper = new RequestCallback() {
public void onError(com.google.gwt.http.client.Request request, Throwab... | [
"@",
"SuppressWarnings",
"(",
"\"synthetic-access\"",
")",
"public",
"void",
"executeRpc",
"(",
"RequestBuilder",
"requestBuilder",
")",
"{",
"final",
"RequestCallback",
"callback",
"=",
"requestBuilder",
".",
"getCallback",
"(",
")",
";",
"RequestCallback",
"callback... | Executes the RPC call.<p>
@param requestBuilder the request builder returned by the service interface | [
"Executes",
"the",
"RPC",
"call",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src-gwt/org/opencms/ugc/client/CmsRpcCallHelper.java#L57-L84 |
hawkular/hawkular-inventory | hawkular-inventory-api/src/main/java/org/hawkular/inventory/base/Traversal.java | Traversal.getSingle | protected BE getSingle(Query query, SegmentType entityType) {
"""
A helper method to retrieve a single result from the query or throw an exception if the query yields no results.
@param query the query to run
@param entityType the expected type of the entity (used only for error reporting)
@return the si... | java | protected BE getSingle(Query query, SegmentType entityType) {
return inTx(tx -> Util.getSingle(tx, query, entityType));
} | [
"protected",
"BE",
"getSingle",
"(",
"Query",
"query",
",",
"SegmentType",
"entityType",
")",
"{",
"return",
"inTx",
"(",
"tx",
"->",
"Util",
".",
"getSingle",
"(",
"tx",
",",
"query",
",",
"entityType",
")",
")",
";",
"}"
] | A helper method to retrieve a single result from the query or throw an exception if the query yields no results.
@param query the query to run
@param entityType the expected type of the entity (used only for error reporting)
@return the single result
@throws EntityNotFoundException if the query doesn't return any... | [
"A",
"helper",
"method",
"to",
"retrieve",
"a",
"single",
"result",
"from",
"the",
"query",
"or",
"throw",
"an",
"exception",
"if",
"the",
"query",
"yields",
"no",
"results",
"."
] | train | https://github.com/hawkular/hawkular-inventory/blob/f56dc10323dca21777feb5b609a9e9cc70ffaf62/hawkular-inventory-api/src/main/java/org/hawkular/inventory/base/Traversal.java#L62-L64 |
JetBrains/xodus | openAPI/src/main/java/jetbrains/exodus/env/EnvironmentConfig.java | EnvironmentConfig.setGcFileMinAge | public EnvironmentConfig setGcFileMinAge(int minAge) throws InvalidSettingException {
"""
Returns the minimum age of a {@code Log} file (.xd file) to consider it for cleaning by the database garbage
collector. The age of the last (the newest, the rightmost) {@code Log} file is {@code 0}, the age of previous
file... | java | public EnvironmentConfig setGcFileMinAge(int minAge) throws InvalidSettingException {
if (minAge < 1) {
throw new InvalidSettingException("Invalid file minimum age: " + minAge);
}
return setSetting(GC_MIN_FILE_AGE, minAge);
} | [
"public",
"EnvironmentConfig",
"setGcFileMinAge",
"(",
"int",
"minAge",
")",
"throws",
"InvalidSettingException",
"{",
"if",
"(",
"minAge",
"<",
"1",
")",
"{",
"throw",
"new",
"InvalidSettingException",
"(",
"\"Invalid file minimum age: \"",
"+",
"minAge",
")",
";",... | Returns the minimum age of a {@code Log} file (.xd file) to consider it for cleaning by the database garbage
collector. The age of the last (the newest, the rightmost) {@code Log} file is {@code 0}, the age of previous
file is {@code 1}, etc. Default value is {@code 2}. The age cannot be less than {@code 1}.
<p>Mutable... | [
"Returns",
"the",
"minimum",
"age",
"of",
"a",
"{",
"@code",
"Log",
"}",
"file",
"(",
".",
"xd",
"file",
")",
"to",
"consider",
"it",
"for",
"cleaning",
"by",
"the",
"database",
"garbage",
"collector",
".",
"The",
"age",
"of",
"the",
"last",
"(",
"th... | train | https://github.com/JetBrains/xodus/blob/7b3476c4e81db66f9c7529148c761605cc8eea6d/openAPI/src/main/java/jetbrains/exodus/env/EnvironmentConfig.java#L1925-L1930 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.