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 |
|---|---|---|---|---|---|---|---|---|---|---|
google/cloud-reporting | src/main/java/com/google/cloud/metrics/MetricsUtils.java | MetricsUtils.buildPostBody | static UrlEncodedFormEntity buildPostBody(Event event, String analyticsId, Random random) {
"""
Creates the body of a POST request encoding the metric report for a single {@link Event}.
@param event The event to report.
@param analyticsId the Google Analytics ID to receive the report.
@param random Random num... | java | static UrlEncodedFormEntity buildPostBody(Event event, String analyticsId, Random random) {
checkNotNull(event);
checkNotNull(analyticsId);
checkNotNull(random);
String virtualPageName = buildVirtualPageName(event.type(),
event.objectType(), event.name());
String virtualPageTitle = buildVir... | [
"static",
"UrlEncodedFormEntity",
"buildPostBody",
"(",
"Event",
"event",
",",
"String",
"analyticsId",
",",
"Random",
"random",
")",
"{",
"checkNotNull",
"(",
"event",
")",
";",
"checkNotNull",
"(",
"analyticsId",
")",
";",
"checkNotNull",
"(",
"random",
")",
... | Creates the body of a POST request encoding the metric report for a single {@link Event}.
@param event The event to report.
@param analyticsId the Google Analytics ID to receive the report.
@param random Random number generator to use for cache busting.
@return A URL-encoded POST request body, in the format expected b... | [
"Creates",
"the",
"body",
"of",
"a",
"POST",
"request",
"encoding",
"the",
"metric",
"report",
"for",
"a",
"single",
"{",
"@link",
"Event",
"}",
"."
] | train | https://github.com/google/cloud-reporting/blob/af2a8ff6077a9763f7f2d405dd55c82efaead0ac/src/main/java/com/google/cloud/metrics/MetricsUtils.java#L95-L119 |
roboconf/roboconf-platform | core/roboconf-dm-templating/src/main/java/net/roboconf/dm/templating/internal/helpers/AllHelper.java | AllHelper.safeApply | private String safeApply( Collection<InstanceContextBean> instances, Options options, String componentPath )
throws IOException {
"""
Same as above, but with type-safe arguments.
@param instances the instances to which this helper is applied.
@param options the options of this helper invocation.
@return a ... | java | private String safeApply( Collection<InstanceContextBean> instances, Options options, String componentPath )
throws IOException {
// Parse the filter.
String installerName = (String) options.hash.get( "installer" );
final InstanceFilter filter = InstanceFilter.createFilter( componentPath, installerName );
//... | [
"private",
"String",
"safeApply",
"(",
"Collection",
"<",
"InstanceContextBean",
">",
"instances",
",",
"Options",
"options",
",",
"String",
"componentPath",
")",
"throws",
"IOException",
"{",
"// Parse the filter.",
"String",
"installerName",
"=",
"(",
"String",
")... | Same as above, but with type-safe arguments.
@param instances the instances to which this helper is applied.
@param options the options of this helper invocation.
@return a string result.
@throws IOException if a template cannot be loaded. | [
"Same",
"as",
"above",
"but",
"with",
"type",
"-",
"safe",
"arguments",
"."
] | train | https://github.com/roboconf/roboconf-platform/blob/add54eead479effb138d0ff53a2d637902b82702/core/roboconf-dm-templating/src/main/java/net/roboconf/dm/templating/internal/helpers/AllHelper.java#L100-L130 |
Azure/autorest-clientruntime-for-java | client-runtime/src/main/java/com/microsoft/rest/interceptors/CustomHeadersInterceptor.java | CustomHeadersInterceptor.replaceHeader | public CustomHeadersInterceptor replaceHeader(String name, String value) {
"""
Add a single header key-value pair. If one with the name already exists,
it gets replaced.
@param name the name of the header.
@param value the value of the header.
@return the interceptor instance itself.
"""
this.hea... | java | public CustomHeadersInterceptor replaceHeader(String name, String value) {
this.headers.put(name, new ArrayList<String>());
this.headers.get(name).add(value);
return this;
} | [
"public",
"CustomHeadersInterceptor",
"replaceHeader",
"(",
"String",
"name",
",",
"String",
"value",
")",
"{",
"this",
".",
"headers",
".",
"put",
"(",
"name",
",",
"new",
"ArrayList",
"<",
"String",
">",
"(",
")",
")",
";",
"this",
".",
"headers",
".",... | Add a single header key-value pair. If one with the name already exists,
it gets replaced.
@param name the name of the header.
@param value the value of the header.
@return the interceptor instance itself. | [
"Add",
"a",
"single",
"header",
"key",
"-",
"value",
"pair",
".",
"If",
"one",
"with",
"the",
"name",
"already",
"exists",
"it",
"gets",
"replaced",
"."
] | train | https://github.com/Azure/autorest-clientruntime-for-java/blob/04621e07dbb0456dd5459dd641f06a9fd4f3abad/client-runtime/src/main/java/com/microsoft/rest/interceptors/CustomHeadersInterceptor.java#L64-L68 |
Javacord/Javacord | javacord-api/src/main/java/org/javacord/api/entity/server/ServerBuilder.java | ServerBuilder.setIcon | public ServerBuilder setIcon(BufferedImage icon, String fileType) {
"""
Sets the server's icon.
@param icon The icon of the server.
@param fileType The type of the icon, e.g. "png" or "jpg".
@return The current instance in order to chain call methods.
"""
delegate.setIcon(icon, fileType);
... | java | public ServerBuilder setIcon(BufferedImage icon, String fileType) {
delegate.setIcon(icon, fileType);
return this;
} | [
"public",
"ServerBuilder",
"setIcon",
"(",
"BufferedImage",
"icon",
",",
"String",
"fileType",
")",
"{",
"delegate",
".",
"setIcon",
"(",
"icon",
",",
"fileType",
")",
";",
"return",
"this",
";",
"}"
] | Sets the server's icon.
@param icon The icon of the server.
@param fileType The type of the icon, e.g. "png" or "jpg".
@return The current instance in order to chain call methods. | [
"Sets",
"the",
"server",
"s",
"icon",
"."
] | train | https://github.com/Javacord/Javacord/blob/915aad084dc5e863284267529d0dccd625fc6886/javacord-api/src/main/java/org/javacord/api/entity/server/ServerBuilder.java#L120-L123 |
SahaginOrg/sahagin-java | src/main/java/org/sahagin/main/SahaginMain.java | SahaginMain.main | public static void main(String[] args)
throws YamlConvertException, IllegalDataStructureException, IllegalTestScriptException {
"""
first argument is action name (now "report" only), second argument is configuration file path
"""
if (args.length == 0) {
throw new IllegalArgument... | java | public static void main(String[] args)
throws YamlConvertException, IllegalDataStructureException, IllegalTestScriptException {
if (args.length == 0) {
throw new IllegalArgumentException(MSG_NO_COMMAND_LINE_ARGUMENT);
}
Action action = null;
try {
acti... | [
"public",
"static",
"void",
"main",
"(",
"String",
"[",
"]",
"args",
")",
"throws",
"YamlConvertException",
",",
"IllegalDataStructureException",
",",
"IllegalTestScriptException",
"{",
"if",
"(",
"args",
".",
"length",
"==",
"0",
")",
"{",
"throw",
"new",
"Il... | first argument is action name (now "report" only), second argument is configuration file path | [
"first",
"argument",
"is",
"action",
"name",
"(",
"now",
"report",
"only",
")",
"second",
"argument",
"is",
"configuration",
"file",
"path"
] | train | https://github.com/SahaginOrg/sahagin-java/blob/7ace428adebe3466ceb5826bc9681f8e3d52be68/src/main/java/org/sahagin/main/SahaginMain.java#L44-L78 |
avianey/facebook-api-android-maven | facebook/src/main/java/com/facebook/widget/ProfilePictureView.java | ProfilePictureView.onMeasure | @Override
protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {
"""
Overriding onMeasure to handle the case where WRAP_CONTENT might be
specified in the layout. Since we don't know the dimensions of the profile
photo, we need to handle this case specifically.
<p/>
The approach is to defau... | java | @Override
protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {
ViewGroup.LayoutParams params = getLayoutParams();
boolean customMeasure = false;
int newHeight = MeasureSpec.getSize(heightMeasureSpec);
int newWidth = MeasureSpec.getSize(widthMeasureSpec);
if... | [
"@",
"Override",
"protected",
"void",
"onMeasure",
"(",
"int",
"widthMeasureSpec",
",",
"int",
"heightMeasureSpec",
")",
"{",
"ViewGroup",
".",
"LayoutParams",
"params",
"=",
"getLayoutParams",
"(",
")",
";",
"boolean",
"customMeasure",
"=",
"false",
";",
"int",... | Overriding onMeasure to handle the case where WRAP_CONTENT might be
specified in the layout. Since we don't know the dimensions of the profile
photo, we need to handle this case specifically.
<p/>
The approach is to default to a NORMAL sized amount of space in the case that
a preset size is not specified. This logic is... | [
"Overriding",
"onMeasure",
"to",
"handle",
"the",
"case",
"where",
"WRAP_CONTENT",
"might",
"be",
"specified",
"in",
"the",
"layout",
".",
"Since",
"we",
"don",
"t",
"know",
"the",
"dimensions",
"of",
"the",
"profile",
"photo",
"we",
"need",
"to",
"handle",
... | train | https://github.com/avianey/facebook-api-android-maven/blob/ae6c7aa7ae45739ee19f18c1983e05f7e35b9ede/facebook/src/main/java/com/facebook/widget/ProfilePictureView.java#L267-L296 |
Mozu/mozu-java | mozu-java-core/src/main/java/com/mozu/api/urls/commerce/orders/ExtendedPropertyUrl.java | ExtendedPropertyUrl.updateExtendedPropertiesUrl | public static MozuUrl updateExtendedPropertiesUrl(String orderId, String updateMode, Boolean upsert, String version) {
"""
Get Resource Url for UpdateExtendedProperties
@param orderId Unique identifier of the order.
@param updateMode Specifies whether to update the original order, update the order in draft mode,... | java | public static MozuUrl updateExtendedPropertiesUrl(String orderId, String updateMode, Boolean upsert, String version)
{
UrlFormatter formatter = new UrlFormatter("/api/commerce/orders/{orderId}/extendedproperties?updatemode={updateMode}&version={version}&upsert={upsert}");
formatter.formatUrl("orderId", orderId)... | [
"public",
"static",
"MozuUrl",
"updateExtendedPropertiesUrl",
"(",
"String",
"orderId",
",",
"String",
"updateMode",
",",
"Boolean",
"upsert",
",",
"String",
"version",
")",
"{",
"UrlFormatter",
"formatter",
"=",
"new",
"UrlFormatter",
"(",
"\"/api/commerce/orders/{or... | Get Resource Url for UpdateExtendedProperties
@param orderId Unique identifier of the order.
@param updateMode Specifies whether to update the original order, update the order in draft mode, or update the order in draft mode and then commit the changes to the original. Draft mode enables users to make incremental order... | [
"Get",
"Resource",
"Url",
"for",
"UpdateExtendedProperties",
"@param",
"orderId",
"Unique",
"identifier",
"of",
"the",
"order",
".",
"@param",
"updateMode",
"Specifies",
"whether",
"to",
"update",
"the",
"original",
"order",
"update",
"the",
"order",
"in",
"draft"... | train | https://github.com/Mozu/mozu-java/blob/5beadde73601a859f845e3e2fc1077b39c8bea83/mozu-java-core/src/main/java/com/mozu/api/urls/commerce/orders/ExtendedPropertyUrl.java#L78-L86 |
jtablesaw/tablesaw | core/src/main/java/tech/tablesaw/aggregate/CrossTab.java | CrossTab.columnPercents | public static Table columnPercents(Table table, CategoricalColumn<?> column1, CategoricalColumn<?> column2) {
"""
Returns a table containing the column percents made from a source table, after first calculating the counts
cross-tabulated from the given columns
"""
Table xTabs = counts(table, column1, ... | java | public static Table columnPercents(Table table, CategoricalColumn<?> column1, CategoricalColumn<?> column2) {
Table xTabs = counts(table, column1, column2);
return columnPercents(xTabs);
} | [
"public",
"static",
"Table",
"columnPercents",
"(",
"Table",
"table",
",",
"CategoricalColumn",
"<",
"?",
">",
"column1",
",",
"CategoricalColumn",
"<",
"?",
">",
"column2",
")",
"{",
"Table",
"xTabs",
"=",
"counts",
"(",
"table",
",",
"column1",
",",
"col... | Returns a table containing the column percents made from a source table, after first calculating the counts
cross-tabulated from the given columns | [
"Returns",
"a",
"table",
"containing",
"the",
"column",
"percents",
"made",
"from",
"a",
"source",
"table",
"after",
"first",
"calculating",
"the",
"counts",
"cross",
"-",
"tabulated",
"from",
"the",
"given",
"columns"
] | train | https://github.com/jtablesaw/tablesaw/blob/68a75b4098ac677e9486df5572cf13ec39f9f701/core/src/main/java/tech/tablesaw/aggregate/CrossTab.java#L244-L247 |
alkacon/opencms-core | src/org/opencms/staticexport/CmsLinkManager.java | CmsLinkManager.getWorkplaceLink | public String getWorkplaceLink(CmsObject cms, String resourceName, boolean forceSecure) {
"""
Returns the link for the given workplace resource.
This should only be used for resources under /system or /shared.<p<
@param cms the current OpenCms user context
@param resourceName the resource to generate the on... | java | public String getWorkplaceLink(CmsObject cms, String resourceName, boolean forceSecure) {
String result = substituteLinkForUnknownTarget(cms, resourceName, forceSecure);
return appendServerPrefix(cms, result, resourceName, true);
} | [
"public",
"String",
"getWorkplaceLink",
"(",
"CmsObject",
"cms",
",",
"String",
"resourceName",
",",
"boolean",
"forceSecure",
")",
"{",
"String",
"result",
"=",
"substituteLinkForUnknownTarget",
"(",
"cms",
",",
"resourceName",
",",
"forceSecure",
")",
";",
"retu... | Returns the link for the given workplace resource.
This should only be used for resources under /system or /shared.<p<
@param cms the current OpenCms user context
@param resourceName the resource to generate the online link for
@param forceSecure forces the secure server prefix
@return the link for the given resourc... | [
"Returns",
"the",
"link",
"for",
"the",
"given",
"workplace",
"resource",
"."
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/staticexport/CmsLinkManager.java#L599-L604 |
TheCoder4eu/BootsFaces-OSP | src/main/java/net/bootsfaces/component/progressBar/ProgressBarRenderer.java | ProgressBarRenderer.encodeBegin | @Override
public void encodeBegin(FacesContext context, UIComponent component) throws IOException {
"""
This methods generates the HTML code of the current b:progressBar.
@param context the FacesContext.
@param component the current b:progressBar.
@throws IOException thrown if something goes wrong when writing... | java | @Override
public void encodeBegin(FacesContext context, UIComponent component) throws IOException {
if (!component.isRendered())
return;
ProgressBar progressBar = (ProgressBar) component;
ResponseWriter rw = context.getResponseWriter();
String clientId = progressBar.getClientId();
String span = st... | [
"@",
"Override",
"public",
"void",
"encodeBegin",
"(",
"FacesContext",
"context",
",",
"UIComponent",
"component",
")",
"throws",
"IOException",
"{",
"if",
"(",
"!",
"component",
".",
"isRendered",
"(",
")",
")",
"return",
";",
"ProgressBar",
"progressBar",
"=... | This methods generates the HTML code of the current b:progressBar.
@param context the FacesContext.
@param component the current b:progressBar.
@throws IOException thrown if something goes wrong when writing the HTML code. | [
"This",
"methods",
"generates",
"the",
"HTML",
"code",
"of",
"the",
"current",
"b",
":",
"progressBar",
"."
] | train | https://github.com/TheCoder4eu/BootsFaces-OSP/blob/d1a70952bc240979b5272fa4fe1c7f100873add0/src/main/java/net/bootsfaces/component/progressBar/ProgressBarRenderer.java#L45-L105 |
anotheria/configureme | src/main/java/org/configureme/sources/FileLoader.java | FileLoader.getFile | private File getFile(final ConfigurationSourceKey key) {
"""
Determine a {@link File} handle related to given {@link ConfigurationSourceKey}. This method returns
NULL if file does not exists - neither on file-system nor within a classpath-JAR-file.
Keep in mind, if file is located within JAR, {@link File#exists(... | java | private File getFile(final ConfigurationSourceKey key) {
final String fileName = getFileName(key);
if (externalConfigPath != null) {
final File f = new File(externalConfigPath, fileName);
if (f.exists())
return f; // return overwritten configuration location
}
// configuration-file was not overwrit... | [
"private",
"File",
"getFile",
"(",
"final",
"ConfigurationSourceKey",
"key",
")",
"{",
"final",
"String",
"fileName",
"=",
"getFileName",
"(",
"key",
")",
";",
"if",
"(",
"externalConfigPath",
"!=",
"null",
")",
"{",
"final",
"File",
"f",
"=",
"new",
"File... | Determine a {@link File} handle related to given {@link ConfigurationSourceKey}. This method returns
NULL if file does not exists - neither on file-system nor within a classpath-JAR-file.
Keep in mind, if file is located within JAR, {@link File#exists()} will return FALSE.
@param key
{@link ConfigurationSourceKey}
@re... | [
"Determine",
"a",
"{",
"@link",
"File",
"}",
"handle",
"related",
"to",
"given",
"{",
"@link",
"ConfigurationSourceKey",
"}",
".",
"This",
"method",
"returns",
"NULL",
"if",
"file",
"does",
"not",
"exists",
"-",
"neither",
"on",
"file",
"-",
"system",
"nor... | train | https://github.com/anotheria/configureme/blob/1f52dd9109349623190586bdf5a592de8016e1fa/src/main/java/org/configureme/sources/FileLoader.java#L106-L119 |
snowflakedb/snowflake-jdbc | src/main/java/net/snowflake/client/jdbc/telemetry/Telemetry.java | Telemetry.createTelemetry | public static Telemetry createTelemetry(Connection conn, int flushSize) {
"""
Initialize the telemetry connector
@param conn connection with the session to use for the connector
@param flushSize maximum size of telemetry batch before flush
@return a telemetry connector
"""
try
{
return ... | java | public static Telemetry createTelemetry(Connection conn, int flushSize)
{
try
{
return createTelemetry(conn.unwrap(SnowflakeConnectionV1.class).getSfSession(), flushSize);
}
catch (SQLException ex)
{
logger.debug("input connection is not a SnowflakeConnection");
return null;
... | [
"public",
"static",
"Telemetry",
"createTelemetry",
"(",
"Connection",
"conn",
",",
"int",
"flushSize",
")",
"{",
"try",
"{",
"return",
"createTelemetry",
"(",
"conn",
".",
"unwrap",
"(",
"SnowflakeConnectionV1",
".",
"class",
")",
".",
"getSfSession",
"(",
")... | Initialize the telemetry connector
@param conn connection with the session to use for the connector
@param flushSize maximum size of telemetry batch before flush
@return a telemetry connector | [
"Initialize",
"the",
"telemetry",
"connector"
] | train | https://github.com/snowflakedb/snowflake-jdbc/blob/98567b5a57753f29d51446809640b969a099658f/src/main/java/net/snowflake/client/jdbc/telemetry/Telemetry.java#L105-L116 |
jhalterman/failsafe | src/main/java/net/jodah/failsafe/CircuitBreaker.java | CircuitBreaker.withSuccessThreshold | public synchronized CircuitBreaker<R> withSuccessThreshold(int successes, int executions) {
"""
Sets the ratio of successive successful executions that must occur when in a half-open state in order to close the
circuit. For example: 5, 10 would close the circuit if 5 out of the last 10 executions were successful.... | java | public synchronized CircuitBreaker<R> withSuccessThreshold(int successes, int executions) {
Assert.isTrue(successes >= 1, "successes must be greater than or equal to 1");
Assert.isTrue(executions >= 1, "executions must be greater than or equal to 1");
Assert.isTrue(executions >= successes, "executions must ... | [
"public",
"synchronized",
"CircuitBreaker",
"<",
"R",
">",
"withSuccessThreshold",
"(",
"int",
"successes",
",",
"int",
"executions",
")",
"{",
"Assert",
".",
"isTrue",
"(",
"successes",
">=",
"1",
",",
"\"successes must be greater than or equal to 1\"",
")",
";",
... | Sets the ratio of successive successful executions that must occur when in a half-open state in order to close the
circuit. For example: 5, 10 would close the circuit if 5 out of the last 10 executions were successful. The circuit
will not be closed until at least the given number of {@code executions} have taken place... | [
"Sets",
"the",
"ratio",
"of",
"successive",
"successful",
"executions",
"that",
"must",
"occur",
"when",
"in",
"a",
"half",
"-",
"open",
"state",
"in",
"order",
"to",
"close",
"the",
"circuit",
".",
"For",
"example",
":",
"5",
"10",
"would",
"close",
"th... | train | https://github.com/jhalterman/failsafe/blob/65fcd3a82f7b232d2ff59bc525a59d693dd8e223/src/main/java/net/jodah/failsafe/CircuitBreaker.java#L343-L350 |
jayantk/jklol | src/com/jayantkrish/jklol/ccg/SyntacticCategory.java | SyntacticCategory.getWithoutFeatures | public SyntacticCategory getWithoutFeatures() {
"""
Get a syntactic category identical to this one except with all
feature values replaced by the default value.
@return
"""
if (isAtomic()) {
return createAtomic(value, DEFAULT_FEATURE_VALUE, -1);
} else {
return createFunctional(getDirec... | java | public SyntacticCategory getWithoutFeatures() {
if (isAtomic()) {
return createAtomic(value, DEFAULT_FEATURE_VALUE, -1);
} else {
return createFunctional(getDirection(), returnType.getWithoutFeatures(),
argumentType.getWithoutFeatures());
}
} | [
"public",
"SyntacticCategory",
"getWithoutFeatures",
"(",
")",
"{",
"if",
"(",
"isAtomic",
"(",
")",
")",
"{",
"return",
"createAtomic",
"(",
"value",
",",
"DEFAULT_FEATURE_VALUE",
",",
"-",
"1",
")",
";",
"}",
"else",
"{",
"return",
"createFunctional",
"(",... | Get a syntactic category identical to this one except with all
feature values replaced by the default value.
@return | [
"Get",
"a",
"syntactic",
"category",
"identical",
"to",
"this",
"one",
"except",
"with",
"all",
"feature",
"values",
"replaced",
"by",
"the",
"default",
"value",
"."
] | train | https://github.com/jayantk/jklol/blob/d27532ca83e212d51066cf28f52621acc3fd44cc/src/com/jayantkrish/jklol/ccg/SyntacticCategory.java#L369-L376 |
looly/hutool | hutool-core/src/main/java/cn/hutool/core/util/NumberUtil.java | NumberUtil.roundStr | public static String roundStr(double v, int scale, RoundingMode roundingMode) {
"""
保留固定位数小数<br>
例如保留四位小数:123.456789 =》 123.4567
@param v 值
@param scale 保留小数位数
@param roundingMode 保留小数的模式 {@link RoundingMode}
@return 新值
@since 3.2.2
"""
return round(v, scale, roundingMode).toString();
} | java | public static String roundStr(double v, int scale, RoundingMode roundingMode) {
return round(v, scale, roundingMode).toString();
} | [
"public",
"static",
"String",
"roundStr",
"(",
"double",
"v",
",",
"int",
"scale",
",",
"RoundingMode",
"roundingMode",
")",
"{",
"return",
"round",
"(",
"v",
",",
"scale",
",",
"roundingMode",
")",
".",
"toString",
"(",
")",
";",
"}"
] | 保留固定位数小数<br>
例如保留四位小数:123.456789 =》 123.4567
@param v 值
@param scale 保留小数位数
@param roundingMode 保留小数的模式 {@link RoundingMode}
@return 新值
@since 3.2.2 | [
"保留固定位数小数<br",
">",
"例如保留四位小数:123",
".",
"456789",
"=",
"》",
"123",
".",
"4567"
] | train | https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-core/src/main/java/cn/hutool/core/util/NumberUtil.java#L843-L845 |
mgormley/pacaya | src/main/java/edu/jhu/pacaya/gm/model/globalfac/ProjDepTreeFactor.java | ProjDepTreeFactor.getLogOddsRatios | private EdgeScores getLogOddsRatios(VarTensor[] inMsgs) {
"""
Computes the log odds ratio for each edge. w_i = \mu_i(1) / \mu_i(0)
"""
EdgeScores es = new EdgeScores(n, Double.NEGATIVE_INFINITY);
Algebra s = inMsgs[0].getAlgebra();
// Compute the odds ratios of the messages for each e... | java | private EdgeScores getLogOddsRatios(VarTensor[] inMsgs) {
EdgeScores es = new EdgeScores(n, Double.NEGATIVE_INFINITY);
Algebra s = inMsgs[0].getAlgebra();
// Compute the odds ratios of the messages for each edge in the tree.
for (VarTensor inMsg : inMsgs) {
LinkVar link = (... | [
"private",
"EdgeScores",
"getLogOddsRatios",
"(",
"VarTensor",
"[",
"]",
"inMsgs",
")",
"{",
"EdgeScores",
"es",
"=",
"new",
"EdgeScores",
"(",
"n",
",",
"Double",
".",
"NEGATIVE_INFINITY",
")",
";",
"Algebra",
"s",
"=",
"inMsgs",
"[",
"0",
"]",
".",
"ge... | Computes the log odds ratio for each edge. w_i = \mu_i(1) / \mu_i(0) | [
"Computes",
"the",
"log",
"odds",
"ratio",
"for",
"each",
"edge",
".",
"w_i",
"=",
"\\",
"mu_i",
"(",
"1",
")",
"/",
"\\",
"mu_i",
"(",
"0",
")"
] | train | https://github.com/mgormley/pacaya/blob/786294cbac7cc65dbc32210c10acc32ed0c69233/src/main/java/edu/jhu/pacaya/gm/model/globalfac/ProjDepTreeFactor.java#L365-L379 |
hsiafan/apk-parser | src/main/java/net/dongliu/apk/parser/parser/DexParser.java | DexParser.readStrings | private StringPool readStrings(long[] offsets) {
"""
read string pool for dex file.
dex file string pool diff a bit with binary xml file or resource table.
@param offsets
@return
@throws IOException
"""
// read strings.
// buffer some apk, the strings' offsets may not well ordered. we sor... | java | private StringPool readStrings(long[] offsets) {
// read strings.
// buffer some apk, the strings' offsets may not well ordered. we sort it first
StringPoolEntry[] entries = new StringPoolEntry[offsets.length];
for (int i = 0; i < offsets.length; i++) {
entries[i] = new Stri... | [
"private",
"StringPool",
"readStrings",
"(",
"long",
"[",
"]",
"offsets",
")",
"{",
"// read strings.",
"// buffer some apk, the strings' offsets may not well ordered. we sort it first",
"StringPoolEntry",
"[",
"]",
"entries",
"=",
"new",
"StringPoolEntry",
"[",
"offsets",
... | read string pool for dex file.
dex file string pool diff a bit with binary xml file or resource table.
@param offsets
@return
@throws IOException | [
"read",
"string",
"pool",
"for",
"dex",
"file",
".",
"dex",
"file",
"string",
"pool",
"diff",
"a",
"bit",
"with",
"binary",
"xml",
"file",
"or",
"resource",
"table",
"."
] | train | https://github.com/hsiafan/apk-parser/blob/8993ddd52017b37b8f2e784ae0a15417d9ede932/src/main/java/net/dongliu/apk/parser/parser/DexParser.java#L129-L153 |
Azure/azure-sdk-for-java | sql/resource-manager/v2017_10_01_preview/src/main/java/com/microsoft/azure/management/sql/v2017_10_01_preview/implementation/DatabasesInner.java | DatabasesInner.upgradeDataWarehouseAsync | public Observable<Void> upgradeDataWarehouseAsync(String resourceGroupName, String serverName, String databaseName) {
"""
Upgrades a data warehouse.
@param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal.
@... | java | public Observable<Void> upgradeDataWarehouseAsync(String resourceGroupName, String serverName, String databaseName) {
return upgradeDataWarehouseWithServiceResponseAsync(resourceGroupName, serverName, databaseName).map(new Func1<ServiceResponse<Void>, Void>() {
@Override
public Void call... | [
"public",
"Observable",
"<",
"Void",
">",
"upgradeDataWarehouseAsync",
"(",
"String",
"resourceGroupName",
",",
"String",
"serverName",
",",
"String",
"databaseName",
")",
"{",
"return",
"upgradeDataWarehouseWithServiceResponseAsync",
"(",
"resourceGroupName",
",",
"serve... | Upgrades a data warehouse.
@param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal.
@param serverName The name of the server.
@param databaseName The name of the database to be upgraded.
@throws IllegalArgumentExcep... | [
"Upgrades",
"a",
"data",
"warehouse",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/sql/resource-manager/v2017_10_01_preview/src/main/java/com/microsoft/azure/management/sql/v2017_10_01_preview/implementation/DatabasesInner.java#L179-L186 |
OpenLiberty/open-liberty | dev/com.ibm.ws.injection.core/src/com/ibm/wsspi/injectionengine/InjectionUtil.java | InjectionUtil.checkForRecursiveException | public static InjectionException checkForRecursiveException(Throwable t, String message) {
"""
D408351
Creates a new InjectionException with the specified message. It init's
the cause to the specified Throwable. This method attempts to determine
which InjectionException subclass to return based on the passed-in... | java | public static InjectionException checkForRecursiveException(Throwable t, String message)
{
InjectionException iex;
RecursiveInjectionException.RecursionDetection rd = RecursiveInjectionException.detectRecursiveInjection(t);
switch (rd) {
case Recursive:
iex = new ... | [
"public",
"static",
"InjectionException",
"checkForRecursiveException",
"(",
"Throwable",
"t",
",",
"String",
"message",
")",
"{",
"InjectionException",
"iex",
";",
"RecursiveInjectionException",
".",
"RecursionDetection",
"rd",
"=",
"RecursiveInjectionException",
".",
"d... | D408351
Creates a new InjectionException with the specified message. It init's
the cause to the specified Throwable. This method attempts to determine
which InjectionException subclass to return based on the passed-in
Throwable.
<br/>
@param t - the cause of this InjectionException
@param message - the message for the... | [
"D408351",
"Creates",
"a",
"new",
"InjectionException",
"with",
"the",
"specified",
"message",
".",
"It",
"init",
"s",
"the",
"cause",
"to",
"the",
"specified",
"Throwable",
".",
"This",
"method",
"attempts",
"to",
"determine",
"which",
"InjectionException",
"su... | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.injection.core/src/com/ibm/wsspi/injectionengine/InjectionUtil.java#L168-L186 |
HanSolo/SteelSeries-Swing | src/main/java/eu/hansolo/steelseries/gauges/AbstractLinearBargraph.java | AbstractLinearBargraph.create_BARGRAPH_LED_Image | protected BufferedImage create_BARGRAPH_LED_Image(final int WIDTH, final int HEIGHT,
final ColorDef COLOR,
final Color[] CUSTOM_COLORS) {
"""
Returns a buffered image of a bargr... | java | protected BufferedImage create_BARGRAPH_LED_Image(final int WIDTH, final int HEIGHT,
final ColorDef COLOR,
final Color[] CUSTOM_COLORS) {
if (WIDTH <= 20 || HEIGHT <= 20) // ... | [
"protected",
"BufferedImage",
"create_BARGRAPH_LED_Image",
"(",
"final",
"int",
"WIDTH",
",",
"final",
"int",
"HEIGHT",
",",
"final",
"ColorDef",
"COLOR",
",",
"final",
"Color",
"[",
"]",
"CUSTOM_COLORS",
")",
"{",
"if",
"(",
"WIDTH",
"<=",
"20",
"||",
"HEIG... | Returns a buffered image of a bargraph led with the given color
@param WIDTH
@param HEIGHT
@param COLOR
@param CUSTOM_COLORS
@return a buffered image of a bargraph led with the given color | [
"Returns",
"a",
"buffered",
"image",
"of",
"a",
"bargraph",
"led",
"with",
"the",
"given",
"color"
] | train | https://github.com/HanSolo/SteelSeries-Swing/blob/c2f7b45a477757ef21bbb6a1174ddedb2250ae57/src/main/java/eu/hansolo/steelseries/gauges/AbstractLinearBargraph.java#L126-L185 |
alkacon/opencms-core | src/org/opencms/util/CmsMacroResolver.java | CmsMacroResolver.isMacro | public static boolean isMacro(String input, String macroName) {
"""
Returns <code>true</code> if the given input String is a macro equal to the given macro name.<p>
@param input the input to check for a macro
@param macroName the macro name to check for
@return <code>true</code> if the given input String is... | java | public static boolean isMacro(String input, String macroName) {
if (isMacro(input)) {
return input.substring(2, input.length() - 1).equals(macroName);
}
return false;
} | [
"public",
"static",
"boolean",
"isMacro",
"(",
"String",
"input",
",",
"String",
"macroName",
")",
"{",
"if",
"(",
"isMacro",
"(",
"input",
")",
")",
"{",
"return",
"input",
".",
"substring",
"(",
"2",
",",
"input",
".",
"length",
"(",
")",
"-",
"1",... | Returns <code>true</code> if the given input String is a macro equal to the given macro name.<p>
@param input the input to check for a macro
@param macroName the macro name to check for
@return <code>true</code> if the given input String is a macro equal to the given macro name | [
"Returns",
"<code",
">",
"true<",
"/",
"code",
">",
"if",
"the",
"given",
"input",
"String",
"is",
"a",
"macro",
"equal",
"to",
"the",
"given",
"macro",
"name",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/util/CmsMacroResolver.java#L446-L452 |
eclipse/xtext-lib | org.eclipse.xtext.xbase.lib/src/org/eclipse/xtext/xbase/lib/ObjectExtensions.java | ObjectExtensions.operator_plus | @Pure /* not guaranteed pure , since toString() is invoked on the argument a*/
@Inline("($1 + $2)")
public static String operator_plus(Object a, String b) {
"""
The binary <code>+</code> operator that concatenates two strings.
@param a
an {@link Object}.
@param b
a {@link String}.
@return <code>a + b</cod... | java | @Pure /* not guaranteed pure , since toString() is invoked on the argument a*/
@Inline("($1 + $2)")
public static String operator_plus(Object a, String b) {
return a + b;
} | [
"@",
"Pure",
"/* not guaranteed pure , since toString() is invoked on the argument a*/",
"@",
"Inline",
"(",
"\"($1 + $2)\"",
")",
"public",
"static",
"String",
"operator_plus",
"(",
"Object",
"a",
",",
"String",
"b",
")",
"{",
"return",
"a",
"+",
"b",
";",
"}"
] | The binary <code>+</code> operator that concatenates two strings.
@param a
an {@link Object}.
@param b
a {@link String}.
@return <code>a + b</code>
@since 2.3 | [
"The",
"binary",
"<code",
">",
"+",
"<",
"/",
"code",
">",
"operator",
"that",
"concatenates",
"two",
"strings",
"."
] | train | https://github.com/eclipse/xtext-lib/blob/7063572e1f1bd713a3aa53bdf3a8dc60e25c169a/org.eclipse.xtext.xbase.lib/src/org/eclipse/xtext/xbase/lib/ObjectExtensions.java#L153-L157 |
att/AAF | authz/authz-gui/src/main/java/com/att/authz/gui/AuthGUI.java | AuthGUI.startDME2 | public void startDME2(Properties props) throws DME2Exception, CadiException {
"""
Start up AuthzAPI as DME2 Service
@param env
@param props
@throws DME2Exception
@throws CadiException
"""
DME2Manager dme2 = new DME2Manager("AAF GUI DME2Manager", props);
DME2ServiceHolder svcHolder;
Lis... | java | public void startDME2(Properties props) throws DME2Exception, CadiException {
DME2Manager dme2 = new DME2Manager("AAF GUI DME2Manager", props);
DME2ServiceHolder svcHolder;
List<DME2ServletHolder> slist = new ArrayList<DME2ServletHolder>();
svcHolder = new DME2ServiceHolder();
Strin... | [
"public",
"void",
"startDME2",
"(",
"Properties",
"props",
")",
"throws",
"DME2Exception",
",",
"CadiException",
"{",
"DME2Manager",
"dme2",
"=",
"new",
"DME2Manager",
"(",
"\"AAF GUI DME2Manager\"",
",",
"props",
")",
";",
"DME2ServiceHolder",
"svcHolder",
";",
"... | Start up AuthzAPI as DME2 Service
@param env
@param props
@throws DME2Exception
@throws CadiException | [
"Start",
"up",
"AuthzAPI",
"as",
"DME2",
"Service"
] | train | https://github.com/att/AAF/blob/090562e956c0035db972aafba844dc6d3fc948ee/authz/authz-gui/src/main/java/com/att/authz/gui/AuthGUI.java#L204-L271 |
NoraUi/NoraUi | src/main/java/com/github/noraui/application/steps/CommonSteps.java | CommonSteps.checkElementNotPresent | @Conditioned
@Et("Je vérifie que '(.*)-(.*)' n'est pas présent[\\.|\\?]")
@And("I check that '(.*)-(.*)' is not present[\\.|\\?]")
public void checkElementNotPresent(String page, String elementName, List<GherkinStepCondition> conditions) throws FailureException, TechnicalException {
"""
Checks if an... | java | @Conditioned
@Et("Je vérifie que '(.*)-(.*)' n'est pas présent[\\.|\\?]")
@And("I check that '(.*)-(.*)' is not present[\\.|\\?]")
public void checkElementNotPresent(String page, String elementName, List<GherkinStepCondition> conditions) throws FailureException, TechnicalException {
checkElement... | [
"@",
"Conditioned",
"@",
"Et",
"(",
"\"Je vérifie que '(.*)-(.*)' n'est pas présent[\\\\.|\\\\?]\")\r",
"",
"@",
"And",
"(",
"\"I check that '(.*)-(.*)' is not present[\\\\.|\\\\?]\"",
")",
"public",
"void",
"checkElementNotPresent",
"(",
"String",
"page",
",",
"String",
"ele... | Checks if an html element is not present.
@param page
The concerned page of elementName
@param elementName
The key of the PageElement to check
@param conditions
list of 'expected' values condition and 'actual' values ({@link com.github.noraui.gherkin.GherkinStepCondition}).
@throws TechnicalException
is throws if you ... | [
"Checks",
"if",
"an",
"html",
"element",
"is",
"not",
"present",
"."
] | train | https://github.com/NoraUi/NoraUi/blob/5f491a3339c7d3c20d7207760bdaf2acdb8f260c/src/main/java/com/github/noraui/application/steps/CommonSteps.java#L777-L782 |
mediathekview/MServer | src/main/java/mServer/crawler/sender/base/UrlUtils.java | UrlUtils.addDomainIfMissing | public static String addDomainIfMissing(final String aUrl, final String aDomain) {
"""
adds the domain if missing.
@param aUrl the url to check
@param aDomain the domain to add
@return the url including the domain
"""
if (aUrl != null && !aUrl.isEmpty() && aUrl.startsWith("/")) {
return aDomai... | java | public static String addDomainIfMissing(final String aUrl, final String aDomain) {
if (aUrl != null && !aUrl.isEmpty() && aUrl.startsWith("/")) {
return aDomain + aUrl;
}
return aUrl;
} | [
"public",
"static",
"String",
"addDomainIfMissing",
"(",
"final",
"String",
"aUrl",
",",
"final",
"String",
"aDomain",
")",
"{",
"if",
"(",
"aUrl",
"!=",
"null",
"&&",
"!",
"aUrl",
".",
"isEmpty",
"(",
")",
"&&",
"aUrl",
".",
"startsWith",
"(",
"\"/\"",
... | adds the domain if missing.
@param aUrl the url to check
@param aDomain the domain to add
@return the url including the domain | [
"adds",
"the",
"domain",
"if",
"missing",
"."
] | train | https://github.com/mediathekview/MServer/blob/ba8d03e6a1a303db3807a1327f553f1decd30388/src/main/java/mServer/crawler/sender/base/UrlUtils.java#L37-L43 |
jenkinsci/support-core-plugin | src/main/java/com/cloudbees/jenkins/support/filter/ContentMappings.java | ContentMappings.getMappingOrCreate | public @Nonnull ContentMapping getMappingOrCreate(@Nonnull String original, @Nonnull Function<String, ContentMapping> generator) {
"""
Looks up or creates a new ContentMapping for the given original string and a ContentMapping generator.
"""
boolean isNew = !mappings.containsKey(original);
Cont... | java | public @Nonnull ContentMapping getMappingOrCreate(@Nonnull String original, @Nonnull Function<String, ContentMapping> generator) {
boolean isNew = !mappings.containsKey(original);
ContentMapping mapping = mappings.computeIfAbsent(original, generator);
try {
if (isNew) {
... | [
"public",
"@",
"Nonnull",
"ContentMapping",
"getMappingOrCreate",
"(",
"@",
"Nonnull",
"String",
"original",
",",
"@",
"Nonnull",
"Function",
"<",
"String",
",",
"ContentMapping",
">",
"generator",
")",
"{",
"boolean",
"isNew",
"=",
"!",
"mappings",
".",
"cont... | Looks up or creates a new ContentMapping for the given original string and a ContentMapping generator. | [
"Looks",
"up",
"or",
"creates",
"a",
"new",
"ContentMapping",
"for",
"the",
"given",
"original",
"string",
"and",
"a",
"ContentMapping",
"generator",
"."
] | train | https://github.com/jenkinsci/support-core-plugin/blob/bcbe1dfd5bf48ac89903645cd48ed897c1a04688/src/main/java/com/cloudbees/jenkins/support/filter/ContentMappings.java#L167-L178 |
jparsec/jparsec | jparsec/src/main/java/org/jparsec/pattern/Patterns.java | Patterns.repeat | public static Pattern repeat(int n, CharPredicate predicate) {
"""
Returns a {@link Pattern} object that matches if the input has at least {@code n} characters and the first {@code
n} characters all satisfy {@code predicate}.
"""
Checks.checkNonNegative(n, "n < 0");
return new RepeatCharPredicatePatte... | java | public static Pattern repeat(int n, CharPredicate predicate) {
Checks.checkNonNegative(n, "n < 0");
return new RepeatCharPredicatePattern(n, predicate);
} | [
"public",
"static",
"Pattern",
"repeat",
"(",
"int",
"n",
",",
"CharPredicate",
"predicate",
")",
"{",
"Checks",
".",
"checkNonNegative",
"(",
"n",
",",
"\"n < 0\"",
")",
";",
"return",
"new",
"RepeatCharPredicatePattern",
"(",
"n",
",",
"predicate",
")",
";... | Returns a {@link Pattern} object that matches if the input has at least {@code n} characters and the first {@code
n} characters all satisfy {@code predicate}. | [
"Returns",
"a",
"{"
] | train | https://github.com/jparsec/jparsec/blob/df1280259f5da9eb5ffc537437569dddba66cb94/jparsec/src/main/java/org/jparsec/pattern/Patterns.java#L349-L352 |
looly/hutool | hutool-poi/src/main/java/cn/hutool/poi/excel/WorkbookUtil.java | WorkbookUtil.getOrCreateSheet | public static Sheet getOrCreateSheet(Workbook book, String sheetName) {
"""
获取或者创建sheet表<br>
如果sheet表在Workbook中已经存在,则获取之,否则创建之
@param book 工作簿{@link Workbook}
@param sheetName 工作表名
@return 工作表{@link Sheet}
@since 4.0.2
"""
if (null == book) {
return null;
}
sheetName = StrUtil.isBlank(sheet... | java | public static Sheet getOrCreateSheet(Workbook book, String sheetName) {
if (null == book) {
return null;
}
sheetName = StrUtil.isBlank(sheetName) ? "sheet1" : sheetName;
Sheet sheet = book.getSheet(sheetName);
if (null == sheet) {
sheet = book.createSheet(sheetName);
}
return sheet;
} | [
"public",
"static",
"Sheet",
"getOrCreateSheet",
"(",
"Workbook",
"book",
",",
"String",
"sheetName",
")",
"{",
"if",
"(",
"null",
"==",
"book",
")",
"{",
"return",
"null",
";",
"}",
"sheetName",
"=",
"StrUtil",
".",
"isBlank",
"(",
"sheetName",
")",
"?"... | 获取或者创建sheet表<br>
如果sheet表在Workbook中已经存在,则获取之,否则创建之
@param book 工作簿{@link Workbook}
@param sheetName 工作表名
@return 工作表{@link Sheet}
@since 4.0.2 | [
"获取或者创建sheet表<br",
">",
"如果sheet表在Workbook中已经存在,则获取之,否则创建之"
] | train | https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-poi/src/main/java/cn/hutool/poi/excel/WorkbookUtil.java#L220-L230 |
VoltDB/voltdb | src/frontend/org/voltdb/export/ExportManager.java | ExportManager.prepareTransferMastership | synchronized public void prepareTransferMastership(int partitionId, int hostId) {
"""
Indicate to associated {@link ExportGeneration}s to
prepare give up mastership for the given partition id to hostId
@param partitionId
"""
// remove mastership for partition id, so when failure happen during the mas... | java | synchronized public void prepareTransferMastership(int partitionId, int hostId) {
// remove mastership for partition id, so when failure happen during the mastership transfer
// this node can be elected as new master again.
m_masterOfPartitions.remove(partitionId);
if (exportLog.isDebug... | [
"synchronized",
"public",
"void",
"prepareTransferMastership",
"(",
"int",
"partitionId",
",",
"int",
"hostId",
")",
"{",
"// remove mastership for partition id, so when failure happen during the mastership transfer",
"// this node can be elected as new master again.",
"m_masterOfPartiti... | Indicate to associated {@link ExportGeneration}s to
prepare give up mastership for the given partition id to hostId
@param partitionId | [
"Indicate",
"to",
"associated",
"{"
] | train | https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/src/frontend/org/voltdb/export/ExportManager.java#L306-L319 |
s1ck/gdl | src/main/java/org/s1ck/gdl/GDLLoader.java | GDLLoader.initNewEdge | private Edge initNewEdge(GDLParser.EdgeBodyContext edgeBodyContext, boolean isIncoming) {
"""
Initializes a new edge from the given edge body context.
@param edgeBodyContext edge body context
@param isIncoming true, if it's an incoming edge, false for outgoing edge
@return new edge
"""
boolean ha... | java | private Edge initNewEdge(GDLParser.EdgeBodyContext edgeBodyContext, boolean isIncoming) {
boolean hasBody = edgeBodyContext != null;
Edge e = new Edge();
e.setId(getNewEdgeId());
e.setSourceVertexId(getSourceVertexId(isIncoming));
e.setTargetVertexId(getTargetVertexId(isIncoming));
if (hasBody)... | [
"private",
"Edge",
"initNewEdge",
"(",
"GDLParser",
".",
"EdgeBodyContext",
"edgeBodyContext",
",",
"boolean",
"isIncoming",
")",
"{",
"boolean",
"hasBody",
"=",
"edgeBodyContext",
"!=",
"null",
";",
"Edge",
"e",
"=",
"new",
"Edge",
"(",
")",
";",
"e",
".",
... | Initializes a new edge from the given edge body context.
@param edgeBodyContext edge body context
@param isIncoming true, if it's an incoming edge, false for outgoing edge
@return new edge | [
"Initializes",
"a",
"new",
"edge",
"from",
"the",
"given",
"edge",
"body",
"context",
"."
] | train | https://github.com/s1ck/gdl/blob/c89b0f83526661823ad3392f338dbf7dc3e3f834/src/main/java/org/s1ck/gdl/GDLLoader.java#L543-L568 |
m-m-m/util | event/src/main/java/net/sf/mmm/util/event/base/AbstractEventBus.java | AbstractEventBus.dispatchEvent | protected <E> void dispatchEvent(E event, Collection<Throwable> errors) {
"""
Dispatches the given {@link net.sf.mmm.util.event.api.Event}.
@param <E> is the generic type of {@code event}.
@param event is the {@link net.sf.mmm.util.event.api.Event} to dispatch.
@param errors is a {@link Collection} where erro... | java | protected <E> void dispatchEvent(E event, Collection<Throwable> errors) {
@SuppressWarnings({ "unchecked", "rawtypes" })
Class<E> eventType = (Class) event.getClass();
EventDispatcher<? super E> eventDispatcher = getEventDispatcherOptional(eventType);
boolean dispatched = false;
if (eventDispatcher... | [
"protected",
"<",
"E",
">",
"void",
"dispatchEvent",
"(",
"E",
"event",
",",
"Collection",
"<",
"Throwable",
">",
"errors",
")",
"{",
"@",
"SuppressWarnings",
"(",
"{",
"\"unchecked\"",
",",
"\"rawtypes\"",
"}",
")",
"Class",
"<",
"E",
">",
"eventType",
... | Dispatches the given {@link net.sf.mmm.util.event.api.Event}.
@param <E> is the generic type of {@code event}.
@param event is the {@link net.sf.mmm.util.event.api.Event} to dispatch.
@param errors is a {@link Collection} where errors are collected. | [
"Dispatches",
"the",
"given",
"{",
"@link",
"net",
".",
"sf",
".",
"mmm",
".",
"util",
".",
"event",
".",
"api",
".",
"Event",
"}",
"."
] | train | https://github.com/m-m-m/util/blob/f0e4e084448f8dfc83ca682a9e1618034a094ce6/event/src/main/java/net/sf/mmm/util/event/base/AbstractEventBus.java#L130-L142 |
Whiley/WhileyCompiler | src/main/java/wyc/io/WhileyFileParser.java | WhileyFileParser.parseArrayInitialiserOrGeneratorExpression | private Expr parseArrayInitialiserOrGeneratorExpression(EnclosingScope scope, boolean terminated) {
"""
Parse an array initialiser or generator expression, which is of the form:
<pre>
ArrayExpr ::= '[' [ Expr (',' Expr)+ ] ']'
| '[' Expr ';' Expr ']'
</pre>
@param scope
The enclosing scope for this state... | java | private Expr parseArrayInitialiserOrGeneratorExpression(EnclosingScope scope, boolean terminated) {
int start = index;
match(LeftSquare);
if (tryAndMatch(true, RightSquare) != null) {
// this is an empty array initialiser
index = start;
return parseArrayInitialiserExpression(scope, terminated);
} else ... | [
"private",
"Expr",
"parseArrayInitialiserOrGeneratorExpression",
"(",
"EnclosingScope",
"scope",
",",
"boolean",
"terminated",
")",
"{",
"int",
"start",
"=",
"index",
";",
"match",
"(",
"LeftSquare",
")",
";",
"if",
"(",
"tryAndMatch",
"(",
"true",
",",
"RightSq... | Parse an array initialiser or generator expression, which is of the form:
<pre>
ArrayExpr ::= '[' [ Expr (',' Expr)+ ] ']'
| '[' Expr ';' Expr ']'
</pre>
@param scope
The enclosing scope for this statement, which determines the
set of visible (i.e. declared) variables and also the current
indentation level.
@param te... | [
"Parse",
"an",
"array",
"initialiser",
"or",
"generator",
"expression",
"which",
"is",
"of",
"the",
"form",
":"
] | train | https://github.com/Whiley/WhileyCompiler/blob/680f8a657d3fc286f8cc422755988b6d74ab3f4c/src/main/java/wyc/io/WhileyFileParser.java#L2639-L2659 |
aaberg/sql2o | core/src/main/java/org/sql2o/Query.java | Query.addParameter | public Query addParameter(String name, final Object ... values) {
"""
Set an array parameter.<br>
For example:
<pre>
createQuery("SELECT * FROM user WHERE id IN(:ids)")
.addParameter("ids", 4, 5, 6)
.executeAndFetch(...)
</pre>
will generate the query : <code>SELECT * FROM user WHERE id IN(4,5,6)</code><br>... | java | public Query addParameter(String name, final Object ... values) {
if(values == null) {
throw new NullPointerException("Array parameter cannot be null");
}
addParameterInternal(name, new ParameterSetter(values.length) {
@Override
public void setParameter(int p... | [
"public",
"Query",
"addParameter",
"(",
"String",
"name",
",",
"final",
"Object",
"...",
"values",
")",
"{",
"if",
"(",
"values",
"==",
"null",
")",
"{",
"throw",
"new",
"NullPointerException",
"(",
"\"Array parameter cannot be null\"",
")",
";",
"}",
"addPara... | Set an array parameter.<br>
For example:
<pre>
createQuery("SELECT * FROM user WHERE id IN(:ids)")
.addParameter("ids", 4, 5, 6)
.executeAndFetch(...)
</pre>
will generate the query : <code>SELECT * FROM user WHERE id IN(4,5,6)</code><br>
<br>
It is not possible to use array parameters with a batch <code>PreparedStatem... | [
"Set",
"an",
"array",
"parameter",
".",
"<br",
">",
"For",
"example",
":",
"<pre",
">",
"createQuery",
"(",
"SELECT",
"*",
"FROM",
"user",
"WHERE",
"id",
"IN",
"(",
":",
"ids",
")",
")",
".",
"addParameter",
"(",
"ids",
"4",
"5",
"6",
")",
".",
"... | train | https://github.com/aaberg/sql2o/blob/01d3490a6d2440cf60f973d23508ac4ed57a8e20/core/src/main/java/org/sql2o/Query.java#L350-L368 |
voldemort/voldemort | src/java/voldemort/server/gossip/Gossiper.java | Gossiper.gossipKey | protected void gossipKey(Node node, String key) {
"""
Perform Gossip on a specified metadata key with a remote node. As
metadata is data, vector clocks are used to determine causality.
<p>
Method is <code>protected</code> rather than <code>private</code>, so
that it may be overridden if the behaviour for handl... | java | protected void gossipKey(Node node, String key) {
if(logger.isDebugEnabled()) {
logger.debug("Gossiping key " + key);
}
/*
* Retrieve local and remote versions of the key. Uses AdminClient for
* remote as well as local operations (rather than going directly to
... | [
"protected",
"void",
"gossipKey",
"(",
"Node",
"node",
",",
"String",
"key",
")",
"{",
"if",
"(",
"logger",
".",
"isDebugEnabled",
"(",
")",
")",
"{",
"logger",
".",
"debug",
"(",
"\"Gossiping key \"",
"+",
"key",
")",
";",
"}",
"/*\n * Retrieve lo... | Perform Gossip on a specified metadata key with a remote node. As
metadata is data, vector clocks are used to determine causality.
<p>
Method is <code>protected</code> rather than <code>private</code>, so
that it may be overridden if the behaviour for handling concurrent values
of the same key was to be changed e.g., i... | [
"Perform",
"Gossip",
"on",
"a",
"specified",
"metadata",
"key",
"with",
"a",
"remote",
"node",
".",
"As",
"metadata",
"is",
"data",
"vector",
"clocks",
"are",
"used",
"to",
"determine",
"causality",
".",
"<p",
">",
"Method",
"is",
"<code",
">",
"protected<... | train | https://github.com/voldemort/voldemort/blob/a7dbdea58032021361680faacf2782cf981c5332/src/java/voldemort/server/gossip/Gossiper.java#L150-L206 |
vanilladb/vanillacore | src/main/java/org/vanilladb/core/remote/jdbc/RemoteConnectionImpl.java | RemoteConnectionImpl.setTransactionIsolation | @Override
public void setTransactionIsolation(int level) throws RemoteException {
"""
Attempts to change the transaction isolation level for this connection.
This method will commit current transaction and start a new transaction.
Currently, the only supported isolation levels are
{@link Connection#TRANSACTIO... | java | @Override
public void setTransactionIsolation(int level) throws RemoteException {
if (getAutoCommit() != false)
throw new RemoteException(
"the auto-commit mode need to be set to false before changing the isolation level");
if (this.isolationLevel == level)
return;
tx.commit();
this.isolatio... | [
"@",
"Override",
"public",
"void",
"setTransactionIsolation",
"(",
"int",
"level",
")",
"throws",
"RemoteException",
"{",
"if",
"(",
"getAutoCommit",
"(",
")",
"!=",
"false",
")",
"throw",
"new",
"RemoteException",
"(",
"\"the auto-commit mode need to be set to false ... | Attempts to change the transaction isolation level for this connection.
This method will commit current transaction and start a new transaction.
Currently, the only supported isolation levels are
{@link Connection#TRANSACTION_SERIALIZABLE} and
{@link Connection#TRANSACTION_REPEATABLE_READ}. The auto-commit mode must
be... | [
"Attempts",
"to",
"change",
"the",
"transaction",
"isolation",
"level",
"for",
"this",
"connection",
".",
"This",
"method",
"will",
"commit",
"current",
"transaction",
"and",
"start",
"a",
"new",
"transaction",
".",
"Currently",
"the",
"only",
"supported",
"isol... | train | https://github.com/vanilladb/vanillacore/blob/d9a34e876b1b83226036d1fa982a614bbef59bd1/src/main/java/org/vanilladb/core/remote/jdbc/RemoteConnectionImpl.java#L112-L126 |
apache/incubator-gobblin | gobblin-data-management/src/main/java/org/apache/gobblin/data/management/trash/ProxiedTrash.java | ProxiedTrash.getUserTrash | protected Trash getUserTrash(final String user) throws IOException {
"""
Get {@link org.apache.gobblin.data.management.trash.Trash} instance for the specified user.
@param user user for whom {@link org.apache.gobblin.data.management.trash.Trash} should be generated.
@return {@link org.apache.gobblin.data.managem... | java | protected Trash getUserTrash(final String user) throws IOException {
if (UserGroupInformation.getCurrentUser().getShortUserName().equals(user)) {
return this;
}
try {
return this.trashCache.get(user, new Callable<Trash>() {
@Override
public Trash call() throws Exception {
... | [
"protected",
"Trash",
"getUserTrash",
"(",
"final",
"String",
"user",
")",
"throws",
"IOException",
"{",
"if",
"(",
"UserGroupInformation",
".",
"getCurrentUser",
"(",
")",
".",
"getShortUserName",
"(",
")",
".",
"equals",
"(",
"user",
")",
")",
"{",
"return... | Get {@link org.apache.gobblin.data.management.trash.Trash} instance for the specified user.
@param user user for whom {@link org.apache.gobblin.data.management.trash.Trash} should be generated.
@return {@link org.apache.gobblin.data.management.trash.Trash} as generated by proxied user.
@throws IOException | [
"Get",
"{"
] | train | https://github.com/apache/incubator-gobblin/blob/f029b4c0fea0fe4aa62f36dda2512344ff708bae/gobblin-data-management/src/main/java/org/apache/gobblin/data/management/trash/ProxiedTrash.java#L145-L159 |
liferay/com-liferay-commerce | commerce-product-service/src/main/java/com/liferay/commerce/product/service/persistence/impl/CPOptionPersistenceImpl.java | CPOptionPersistenceImpl.removeByC_ERC | @Override
public CPOption removeByC_ERC(long companyId, String externalReferenceCode)
throws NoSuchCPOptionException {
"""
Removes the cp option where companyId = ? and externalReferenceCode = ? from the database.
@param companyId the company ID
@param externalReferenceCode the external reference co... | java | @Override
public CPOption removeByC_ERC(long companyId, String externalReferenceCode)
throws NoSuchCPOptionException {
CPOption cpOption = findByC_ERC(companyId, externalReferenceCode);
return remove(cpOption);
} | [
"@",
"Override",
"public",
"CPOption",
"removeByC_ERC",
"(",
"long",
"companyId",
",",
"String",
"externalReferenceCode",
")",
"throws",
"NoSuchCPOptionException",
"{",
"CPOption",
"cpOption",
"=",
"findByC_ERC",
"(",
"companyId",
",",
"externalReferenceCode",
")",
";... | Removes the cp option where companyId = ? and externalReferenceCode = ? from the database.
@param companyId the company ID
@param externalReferenceCode the external reference code
@return the cp option that was removed | [
"Removes",
"the",
"cp",
"option",
"where",
"companyId",
"=",
"?",
";",
"and",
"externalReferenceCode",
"=",
"?",
";",
"from",
"the",
"database",
"."
] | train | https://github.com/liferay/com-liferay-commerce/blob/9e54362d7f59531fc684016ba49ee7cdc3a2f22b/commerce-product-service/src/main/java/com/liferay/commerce/product/service/persistence/impl/CPOptionPersistenceImpl.java#L2397-L2403 |
google/error-prone | check_api/src/main/java/com/google/errorprone/matchers/Matchers.java | Matchers.hasAnnotation | public static <T extends Tree> Matcher<T> hasAnnotation(final String annotationClass) {
"""
Determines whether an expression has an annotation of the given type. This includes annotations
inherited from superclasses due to @Inherited.
@param annotationClass the binary class name of the annotation (e.g.
"javax... | java | public static <T extends Tree> Matcher<T> hasAnnotation(final String annotationClass) {
return new Matcher<T>() {
@Override
public boolean matches(T tree, VisitorState state) {
return ASTHelpers.hasAnnotation(ASTHelpers.getDeclaredSymbol(tree), annotationClass, state);
}
};
} | [
"public",
"static",
"<",
"T",
"extends",
"Tree",
">",
"Matcher",
"<",
"T",
">",
"hasAnnotation",
"(",
"final",
"String",
"annotationClass",
")",
"{",
"return",
"new",
"Matcher",
"<",
"T",
">",
"(",
")",
"{",
"@",
"Override",
"public",
"boolean",
"matches... | Determines whether an expression has an annotation of the given type. This includes annotations
inherited from superclasses due to @Inherited.
@param annotationClass the binary class name of the annotation (e.g.
"javax.annotation.Nullable", or "some.package.OuterClassName$InnerClassName") | [
"Determines",
"whether",
"an",
"expression",
"has",
"an",
"annotation",
"of",
"the",
"given",
"type",
".",
"This",
"includes",
"annotations",
"inherited",
"from",
"superclasses",
"due",
"to",
"@Inherited",
"."
] | train | https://github.com/google/error-prone/blob/fe2e3cc2cf1958cb7c487bfe89852bb4c225ba9d/check_api/src/main/java/com/google/errorprone/matchers/Matchers.java#L757-L764 |
BorderTech/wcomponents | wcomponents-core/src/main/java/com/github/bordertech/wcomponents/render/webxml/WDefinitionListRenderer.java | WDefinitionListRenderer.doRender | @Override
public void doRender(final WComponent component, final WebXmlRenderContext renderContext) {
"""
Paints the given definition list.
@param component the list to paint.
@param renderContext the RenderContext to paint to.
"""
WDefinitionList list = (WDefinitionList) component;
XmlStringBuilder x... | java | @Override
public void doRender(final WComponent component, final WebXmlRenderContext renderContext) {
WDefinitionList list = (WDefinitionList) component;
XmlStringBuilder xml = renderContext.getWriter();
xml.appendTagOpen("ui:definitionlist");
xml.appendAttribute("id", component.getId());
xml.appendOptional... | [
"@",
"Override",
"public",
"void",
"doRender",
"(",
"final",
"WComponent",
"component",
",",
"final",
"WebXmlRenderContext",
"renderContext",
")",
"{",
"WDefinitionList",
"list",
"=",
"(",
"WDefinitionList",
")",
"component",
";",
"XmlStringBuilder",
"xml",
"=",
"... | Paints the given definition list.
@param component the list to paint.
@param renderContext the RenderContext to paint to. | [
"Paints",
"the",
"given",
"definition",
"list",
"."
] | train | https://github.com/BorderTech/wcomponents/blob/d1a2b2243270067db030feb36ca74255aaa94436/wcomponents-core/src/main/java/com/github/bordertech/wcomponents/render/webxml/WDefinitionListRenderer.java#L27-L77 |
jembi/openhim-mediator-engine-java | src/main/java/org/openhim/mediator/engine/RoutingTable.java | RoutingTable.addRegexRoute | public void addRegexRoute(String urlPattern, Class<? extends Actor> actorClass) throws RouteAlreadyMappedException {
"""
Add a URL pattern to the routing table.
@param urlPattern A regular expression
@throws RouteAlreadyMappedException
"""
addRoute(new Route(urlPattern, true), actorClass);
} | java | public void addRegexRoute(String urlPattern, Class<? extends Actor> actorClass) throws RouteAlreadyMappedException {
addRoute(new Route(urlPattern, true), actorClass);
} | [
"public",
"void",
"addRegexRoute",
"(",
"String",
"urlPattern",
",",
"Class",
"<",
"?",
"extends",
"Actor",
">",
"actorClass",
")",
"throws",
"RouteAlreadyMappedException",
"{",
"addRoute",
"(",
"new",
"Route",
"(",
"urlPattern",
",",
"true",
")",
",",
"actorC... | Add a URL pattern to the routing table.
@param urlPattern A regular expression
@throws RouteAlreadyMappedException | [
"Add",
"a",
"URL",
"pattern",
"to",
"the",
"routing",
"table",
"."
] | train | https://github.com/jembi/openhim-mediator-engine-java/blob/02adc0da4302cbde26cc9a5c1ce91ec6277e4f68/src/main/java/org/openhim/mediator/engine/RoutingTable.java#L71-L73 |
Hygieia/Hygieia | collectors/feature/jira/src/main/java/com/capitalone/dashboard/collector/DefaultJiraClient.java | DefaultJiraClient.processAssigneeData | @SuppressWarnings("PMD.NPathComplexity")
protected static void processAssigneeData(Feature feature, JSONObject assignee) {
"""
Process Assignee data for a feature, updating the passed in feature
@param feature
@param assignee
"""
if (assignee == null) {
return;
}
Str... | java | @SuppressWarnings("PMD.NPathComplexity")
protected static void processAssigneeData(Feature feature, JSONObject assignee) {
if (assignee == null) {
return;
}
String key = getString(assignee, "key");
String name = getString(assignee, "name");
String displayName = ge... | [
"@",
"SuppressWarnings",
"(",
"\"PMD.NPathComplexity\"",
")",
"protected",
"static",
"void",
"processAssigneeData",
"(",
"Feature",
"feature",
",",
"JSONObject",
"assignee",
")",
"{",
"if",
"(",
"assignee",
"==",
"null",
")",
"{",
"return",
";",
"}",
"String",
... | Process Assignee data for a feature, updating the passed in feature
@param feature
@param assignee | [
"Process",
"Assignee",
"data",
"for",
"a",
"feature",
"updating",
"the",
"passed",
"in",
"feature"
] | train | https://github.com/Hygieia/Hygieia/blob/d8b67a590da2744acf59bcd99d9b34ef1bb84890/collectors/feature/jira/src/main/java/com/capitalone/dashboard/collector/DefaultJiraClient.java#L602-L614 |
openbaton/openbaton-client | sdk/src/main/java/org/openbaton/sdk/api/rest/NetworkServiceDescriptorAgent.java | NetworkServiceDescriptorAgent.getVNFDependency | @Help(
help =
"get the VirtualNetworkFunctionDescriptor dependency with specific id of a NetworkServiceDescriptor with specific id"
)
public VNFDependency getVNFDependency(final String idNSD, final String idVnfd)
throws SDKException {
"""
Return a specific VNFDependency that is contained in a... | java | @Help(
help =
"get the VirtualNetworkFunctionDescriptor dependency with specific id of a NetworkServiceDescriptor with specific id"
)
public VNFDependency getVNFDependency(final String idNSD, final String idVnfd)
throws SDKException {
String url = idNSD + "/vnfdependencies" + "/" + idVnfd;
... | [
"@",
"Help",
"(",
"help",
"=",
"\"get the VirtualNetworkFunctionDescriptor dependency with specific id of a NetworkServiceDescriptor with specific id\"",
")",
"public",
"VNFDependency",
"getVNFDependency",
"(",
"final",
"String",
"idNSD",
",",
"final",
"String",
"idVnfd",
")",
... | Return a specific VNFDependency that is contained in a particular NetworkServiceDescriptor.
@param idNSD the ID of the NetworkServiceDescriptor
@param idVnfd the VNFDependencies' ID
@return the VNFDependency
@throws SDKException if the request fails | [
"Return",
"a",
"specific",
"VNFDependency",
"that",
"is",
"contained",
"in",
"a",
"particular",
"NetworkServiceDescriptor",
"."
] | train | https://github.com/openbaton/openbaton-client/blob/6ca6dd6b62a23940d312213d6fa489d5b636061a/sdk/src/main/java/org/openbaton/sdk/api/rest/NetworkServiceDescriptorAgent.java#L227-L235 |
keenlabs/KeenClient-Java | core/src/main/java/io/keen/client/java/FileEventStore.java | FileEventStore.getCollectionDir | private File getCollectionDir(String projectId, String eventCollection) throws IOException {
"""
Gets the directory for events in the given collection. Creates the directory (and any
necessary parents) if it does not exist already.
@param projectId The project ID.
@param eventCollection The name of the ... | java | private File getCollectionDir(String projectId, String eventCollection) throws IOException {
File collectionDir = new File(getProjectDir(projectId, true), eventCollection);
if (!collectionDir.exists()) {
KeenLogging.log("Cache directory for event collection '" + eventCollection +
... | [
"private",
"File",
"getCollectionDir",
"(",
"String",
"projectId",
",",
"String",
"eventCollection",
")",
"throws",
"IOException",
"{",
"File",
"collectionDir",
"=",
"new",
"File",
"(",
"getProjectDir",
"(",
"projectId",
",",
"true",
")",
",",
"eventCollection",
... | Gets the directory for events in the given collection. Creates the directory (and any
necessary parents) if it does not exist already.
@param projectId The project ID.
@param eventCollection The name of the event collection.
@return The directory for events in the collection. | [
"Gets",
"the",
"directory",
"for",
"events",
"in",
"the",
"given",
"collection",
".",
"Creates",
"the",
"directory",
"(",
"and",
"any",
"necessary",
"parents",
")",
"if",
"it",
"does",
"not",
"exist",
"already",
"."
] | train | https://github.com/keenlabs/KeenClient-Java/blob/2ea021547b5338257c951a2596bd49749038d018/core/src/main/java/io/keen/client/java/FileEventStore.java#L296-L307 |
sarl/sarl | products/sarlc/src/main/java/io/sarl/lang/sarlc/modules/commands/ExtraLanguageListCommandModule.java | ExtraLanguageListCommandModule.provideExtraLanguageListCommand | @SuppressWarnings("static-method")
@Provides
@Singleton
public ExtraLanguageListCommand provideExtraLanguageListCommand(BootLogger bootLogger,
Provider<IExtraLanguageContributions> contributions) {
"""
Provide the command for displaying the available extra-language generators.
@param bootLogger the logger... | java | @SuppressWarnings("static-method")
@Provides
@Singleton
public ExtraLanguageListCommand provideExtraLanguageListCommand(BootLogger bootLogger,
Provider<IExtraLanguageContributions> contributions) {
return new ExtraLanguageListCommand(bootLogger, contributions);
} | [
"@",
"SuppressWarnings",
"(",
"\"static-method\"",
")",
"@",
"Provides",
"@",
"Singleton",
"public",
"ExtraLanguageListCommand",
"provideExtraLanguageListCommand",
"(",
"BootLogger",
"bootLogger",
",",
"Provider",
"<",
"IExtraLanguageContributions",
">",
"contributions",
")... | Provide the command for displaying the available extra-language generators.
@param bootLogger the logger.
@param contributions the provider of the extra-language contributions.
@return the command. | [
"Provide",
"the",
"command",
"for",
"displaying",
"the",
"available",
"extra",
"-",
"language",
"generators",
"."
] | train | https://github.com/sarl/sarl/blob/ca00ff994598c730339972def4e19a60e0b8cace/products/sarlc/src/main/java/io/sarl/lang/sarlc/modules/commands/ExtraLanguageListCommandModule.java#L56-L62 |
audit4j/audit4j-core | src/main/java/org/audit4j/core/util/ReflectUtil.java | ReflectUtil.getNewInstance | public I getNewInstance(Class<I> clazz) {
"""
Gets the new instance.
@param clazz the clazz
@return the new instance
"""
Constructor<I> ctor;
try {
ctor = clazz.getConstructor();
return ctor.newInstance();
} catch (NoSuchMethodException | SecurityException | ... | java | public I getNewInstance(Class<I> clazz) {
Constructor<I> ctor;
try {
ctor = clazz.getConstructor();
return ctor.newInstance();
} catch (NoSuchMethodException | SecurityException | InstantiationException | IllegalAccessException
| IllegalArgumentException |... | [
"public",
"I",
"getNewInstance",
"(",
"Class",
"<",
"I",
">",
"clazz",
")",
"{",
"Constructor",
"<",
"I",
">",
"ctor",
";",
"try",
"{",
"ctor",
"=",
"clazz",
".",
"getConstructor",
"(",
")",
";",
"return",
"ctor",
".",
"newInstance",
"(",
")",
";",
... | Gets the new instance.
@param clazz the clazz
@return the new instance | [
"Gets",
"the",
"new",
"instance",
"."
] | train | https://github.com/audit4j/audit4j-core/blob/dc8569108851e64cb0ecc7a39048db0ad070fba2/src/main/java/org/audit4j/core/util/ReflectUtil.java#L44-L53 |
jbundle/jbundle | base/base/src/main/java/org/jbundle/base/field/PasswordPropertiesField.java | PasswordPropertiesField.setProperty | public int setProperty(String strProperty, String strValue, boolean bDisplayOption, int iMoveMode) {
"""
Set this property in the user's property area.
@param strProperty The property key.
@param strValue The property value.
@param iDisplayOption If true, display the new field.
@param iMoveMove The move mode.
... | java | public int setProperty(String strProperty, String strValue, boolean bDisplayOption, int iMoveMode)
{
if (m_setPropertiesDescriptions != null)
if (m_setPropertiesDescriptions.contains(strProperty))
{
byte[] rgbValue = strValue.getBytes();
rgbValue = XorEncr... | [
"public",
"int",
"setProperty",
"(",
"String",
"strProperty",
",",
"String",
"strValue",
",",
"boolean",
"bDisplayOption",
",",
"int",
"iMoveMode",
")",
"{",
"if",
"(",
"m_setPropertiesDescriptions",
"!=",
"null",
")",
"if",
"(",
"m_setPropertiesDescriptions",
"."... | Set this property in the user's property area.
@param strProperty The property key.
@param strValue The property value.
@param iDisplayOption If true, display the new field.
@param iMoveMove The move mode.
@return An error code (NORMAL_RETURN for success). | [
"Set",
"this",
"property",
"in",
"the",
"user",
"s",
"property",
"area",
"."
] | train | https://github.com/jbundle/jbundle/blob/4037fcfa85f60c7d0096c453c1a3cd573c2b0abc/base/base/src/main/java/org/jbundle/base/field/PasswordPropertiesField.java#L106-L117 |
gitblit/fathom | fathom-x509/src/main/java/fathom/x509/X509Utils.java | X509Utils.prepareX509Infrastructure | public static void prepareX509Infrastructure(X509Metadata metadata, File serverKeyStore, File serverTrustStore) {
"""
Prepare all the certificates and stores necessary for a Fathom server.
@param metadata
@param serverKeyStore
@param serverTrustStore
"""
prepareX509Infrastructure(metadata, serverK... | java | public static void prepareX509Infrastructure(X509Metadata metadata, File serverKeyStore, File serverTrustStore) {
prepareX509Infrastructure(metadata, serverKeyStore, serverTrustStore, message -> {
});
} | [
"public",
"static",
"void",
"prepareX509Infrastructure",
"(",
"X509Metadata",
"metadata",
",",
"File",
"serverKeyStore",
",",
"File",
"serverTrustStore",
")",
"{",
"prepareX509Infrastructure",
"(",
"metadata",
",",
"serverKeyStore",
",",
"serverTrustStore",
",",
"messag... | Prepare all the certificates and stores necessary for a Fathom server.
@param metadata
@param serverKeyStore
@param serverTrustStore | [
"Prepare",
"all",
"the",
"certificates",
"and",
"stores",
"necessary",
"for",
"a",
"Fathom",
"server",
"."
] | train | https://github.com/gitblit/fathom/blob/f2f820eb16e9fea1e36ad4eda4ed51b35f056538/fathom-x509/src/main/java/fathom/x509/X509Utils.java#L247-L250 |
fhoeben/hsac-fitnesse-fixtures | src/main/java/nl/hsac/fitnesse/fixture/util/JsonPathHelper.java | JsonPathHelper.getJsonPath | public Object getJsonPath(String json, String jsonPath) {
"""
Evaluates a JsonPath expression returning a single element.
@param json JSON value.
@param jsonPath expression to evaluate.
@return result result of expression.
@throws java.lang.RuntimeException if jsonPath would return multiple elements.
"""
... | java | public Object getJsonPath(String json, String jsonPath) {
if (!JsonPath.isPathDefinite(jsonPath)) {
throw new RuntimeException(jsonPath + " returns a list of results, not a single.");
}
return parseJson(json).read(jsonPath);
} | [
"public",
"Object",
"getJsonPath",
"(",
"String",
"json",
",",
"String",
"jsonPath",
")",
"{",
"if",
"(",
"!",
"JsonPath",
".",
"isPathDefinite",
"(",
"jsonPath",
")",
")",
"{",
"throw",
"new",
"RuntimeException",
"(",
"jsonPath",
"+",
"\" returns a list of re... | Evaluates a JsonPath expression returning a single element.
@param json JSON value.
@param jsonPath expression to evaluate.
@return result result of expression.
@throws java.lang.RuntimeException if jsonPath would return multiple elements. | [
"Evaluates",
"a",
"JsonPath",
"expression",
"returning",
"a",
"single",
"element",
"."
] | train | https://github.com/fhoeben/hsac-fitnesse-fixtures/blob/4e9018d7386a9aa65bfcbf07eb28ae064edd1732/src/main/java/nl/hsac/fitnesse/fixture/util/JsonPathHelper.java#L34-L39 |
google/error-prone-javac | src/jdk.compiler/share/classes/com/sun/tools/javac/code/TypeAnnotationPosition.java | TypeAnnotationPosition.constructorRefTypeArg | public static TypeAnnotationPosition
constructorRefTypeArg(final List<TypePathEntry> location,
final int type_index) {
"""
Create a {@code TypeAnnotationPosition} for a constructor reference
type argument.
@param location The type path.
@param type_index The index of the ... | java | public static TypeAnnotationPosition
constructorRefTypeArg(final List<TypePathEntry> location,
final int type_index) {
return constructorRefTypeArg(location, null, type_index, -1);
} | [
"public",
"static",
"TypeAnnotationPosition",
"constructorRefTypeArg",
"(",
"final",
"List",
"<",
"TypePathEntry",
">",
"location",
",",
"final",
"int",
"type_index",
")",
"{",
"return",
"constructorRefTypeArg",
"(",
"location",
",",
"null",
",",
"type_index",
",",
... | Create a {@code TypeAnnotationPosition} for a constructor reference
type argument.
@param location The type path.
@param type_index The index of the type argument. | [
"Create",
"a",
"{",
"@code",
"TypeAnnotationPosition",
"}",
"for",
"a",
"constructor",
"reference",
"type",
"argument",
"."
] | train | https://github.com/google/error-prone-javac/blob/a53d069bbdb2c60232ed3811c19b65e41c3e60e0/src/jdk.compiler/share/classes/com/sun/tools/javac/code/TypeAnnotationPosition.java#L1103-L1107 |
google/j2objc | xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xpath/XPath.java | XPath.getMatchScore | public double getMatchScore(XPathContext xctxt, int context)
throws javax.xml.transform.TransformerException {
"""
Get the match score of the given node.
@param xctxt XPath runtime context.
@param context The current source tree context node.
@return score, one of {@link #MATCH_SCORE_NODETEST},
{... | java | public double getMatchScore(XPathContext xctxt, int context)
throws javax.xml.transform.TransformerException
{
xctxt.pushCurrentNode(context);
xctxt.pushCurrentExpressionNode(context);
try
{
XObject score = m_mainExp.execute(xctxt);
if (DEBUG_MATCHES)
{
DTM dtm =... | [
"public",
"double",
"getMatchScore",
"(",
"XPathContext",
"xctxt",
",",
"int",
"context",
")",
"throws",
"javax",
".",
"xml",
".",
"transform",
".",
"TransformerException",
"{",
"xctxt",
".",
"pushCurrentNode",
"(",
"context",
")",
";",
"xctxt",
".",
"pushCurr... | Get the match score of the given node.
@param xctxt XPath runtime context.
@param context The current source tree context node.
@return score, one of {@link #MATCH_SCORE_NODETEST},
{@link #MATCH_SCORE_NONE}, {@link #MATCH_SCORE_OTHER},
or {@link #MATCH_SCORE_QNAME}.
@throws javax.xml.transform.TransformerException | [
"Get",
"the",
"match",
"score",
"of",
"the",
"given",
"node",
"."
] | train | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xpath/XPath.java#L478-L506 |
kaichunlin/android-transition | core/src/main/java/com/kaichunlin/transition/internal/TransitionControllerManager.java | TransitionControllerManager.addAnimatorAsTransition | public TransitionController addAnimatorAsTransition(@Nullable View target, @NonNull Animator animator) {
"""
Adds an Animator as {@link TransitionController}
@param target
@param animator
@return
"""
AnimatorSet as = new AnimatorSet();
as.play(animator);
return addAnimatorSetAsTran... | java | public TransitionController addAnimatorAsTransition(@Nullable View target, @NonNull Animator animator) {
AnimatorSet as = new AnimatorSet();
as.play(animator);
return addAnimatorSetAsTransition(target, as);
} | [
"public",
"TransitionController",
"addAnimatorAsTransition",
"(",
"@",
"Nullable",
"View",
"target",
",",
"@",
"NonNull",
"Animator",
"animator",
")",
"{",
"AnimatorSet",
"as",
"=",
"new",
"AnimatorSet",
"(",
")",
";",
"as",
".",
"play",
"(",
"animator",
")",
... | Adds an Animator as {@link TransitionController}
@param target
@param animator
@return | [
"Adds",
"an",
"Animator",
"as",
"{",
"@link",
"TransitionController",
"}"
] | train | https://github.com/kaichunlin/android-transition/blob/7b53074206622f5cf5d82091d891a7ed8b9f06cd/core/src/main/java/com/kaichunlin/transition/internal/TransitionControllerManager.java#L53-L57 |
zaproxy/zaproxy | src/org/zaproxy/zap/utils/ApiUtils.java | ApiUtils.getIntParam | public static int getIntParam(JSONObject params, String paramName) throws ApiException {
"""
Gets the int param with a given name and throws an exception accordingly if not found or
valid.
@param params the params
@param paramName the param name
@return the int param
@throws ApiException the api exception
... | java | public static int getIntParam(JSONObject params, String paramName) throws ApiException {
if (!params.containsKey(paramName)) {
throw new ApiException(ApiException.Type.MISSING_PARAMETER, paramName);
}
try {
return params.getInt(paramName);
} catch (JSONException e) {
throw new ApiException(ApiExceptio... | [
"public",
"static",
"int",
"getIntParam",
"(",
"JSONObject",
"params",
",",
"String",
"paramName",
")",
"throws",
"ApiException",
"{",
"if",
"(",
"!",
"params",
".",
"containsKey",
"(",
"paramName",
")",
")",
"{",
"throw",
"new",
"ApiException",
"(",
"ApiExc... | Gets the int param with a given name and throws an exception accordingly if not found or
valid.
@param params the params
@param paramName the param name
@return the int param
@throws ApiException the api exception | [
"Gets",
"the",
"int",
"param",
"with",
"a",
"given",
"name",
"and",
"throws",
"an",
"exception",
"accordingly",
"if",
"not",
"found",
"or",
"valid",
"."
] | train | https://github.com/zaproxy/zaproxy/blob/0cbe5121f2ae1ecca222513d182759210c569bec/src/org/zaproxy/zap/utils/ApiUtils.java#L46-L56 |
phax/ph-commons | ph-commons/src/main/java/com/helger/commons/typeconvert/TypeConverter.java | TypeConverter.convertToInt | public static int convertToInt (@Nonnull final Object aSrcValue) {
"""
Convert the passed source value to int
@param aSrcValue
The source value. May not be <code>null</code>.
@return The converted value.
@throws TypeConverterException
if the source value is <code>null</code> or if no converter was
found or... | java | public static int convertToInt (@Nonnull final Object aSrcValue)
{
if (aSrcValue == null)
throw new TypeConverterException (int.class, EReason.NULL_SOURCE_NOT_ALLOWED);
final Integer aValue = convert (aSrcValue, Integer.class);
return aValue.intValue ();
} | [
"public",
"static",
"int",
"convertToInt",
"(",
"@",
"Nonnull",
"final",
"Object",
"aSrcValue",
")",
"{",
"if",
"(",
"aSrcValue",
"==",
"null",
")",
"throw",
"new",
"TypeConverterException",
"(",
"int",
".",
"class",
",",
"EReason",
".",
"NULL_SOURCE_NOT_ALLOW... | Convert the passed source value to int
@param aSrcValue
The source value. May not be <code>null</code>.
@return The converted value.
@throws TypeConverterException
if the source value is <code>null</code> or if no converter was
found or if the converter returned a <code>null</code> object.
@throws RuntimeException
If ... | [
"Convert",
"the",
"passed",
"source",
"value",
"to",
"int"
] | train | https://github.com/phax/ph-commons/blob/d28c03565f44a0b804d96028d0969f9bb38c4313/ph-commons/src/main/java/com/helger/commons/typeconvert/TypeConverter.java#L314-L320 |
TheCoder4eu/BootsFaces-OSP | src/main/java/net/bootsfaces/component/selectMultiMenu/SelectMultiMenuRenderer.java | SelectMultiMenuRenderer.renderOption | protected void renderOption(ResponseWriter rw, UISelectItem selectItem, String[] selectedOption, int index)
throws IOException {
"""
Renders a single <option> tag. For some reason,
<code>SelectItem</code> and <code>UISelectItem</code> don't share a
common interface, so this method is repeated twice.
... | java | protected void renderOption(ResponseWriter rw, UISelectItem selectItem, String[] selectedOption, int index)
throws IOException {
String itemLabel = selectItem.getItemLabel();
final String itemDescription = selectItem.getItemDescription();
final Object itemValue = selectItem.getItemValue();
boolean isItemLa... | [
"protected",
"void",
"renderOption",
"(",
"ResponseWriter",
"rw",
",",
"UISelectItem",
"selectItem",
",",
"String",
"[",
"]",
"selectedOption",
",",
"int",
"index",
")",
"throws",
"IOException",
"{",
"String",
"itemLabel",
"=",
"selectItem",
".",
"getItemLabel",
... | Renders a single <option> tag. For some reason,
<code>SelectItem</code> and <code>UISelectItem</code> don't share a
common interface, so this method is repeated twice.
@param rw
The response writer
@param selectItem
The current SelectItem
@param selectedOption
the currently selected option
@throws IOException
th... | [
"Renders",
"a",
"single",
"<",
";",
"option>",
";",
"tag",
".",
"For",
"some",
"reason",
"<code",
">",
"SelectItem<",
"/",
"code",
">",
"and",
"<code",
">",
"UISelectItem<",
"/",
"code",
">",
"don",
"t",
"share",
"a",
"common",
"interface",
"so",
"... | train | https://github.com/TheCoder4eu/BootsFaces-OSP/blob/d1a70952bc240979b5272fa4fe1c7f100873add0/src/main/java/net/bootsfaces/component/selectMultiMenu/SelectMultiMenuRenderer.java#L614-L625 |
stratosphere/stratosphere | stratosphere-addons/hadoop-compatibility/src/main/java/eu/stratosphere/hadoopcompatibility/HadoopOutputFormatWrapper.java | HadoopOutputFormatWrapper.open | @Override
public void open(int taskNumber, int numTasks) throws IOException {
"""
create the temporary output file for hadoop RecordWriter.
@param taskNumber The number of the parallel instance.
@param numTasks The number of parallel tasks.
@throws IOException
"""
this.fileOutputCommitterWrapper.setupJob... | java | @Override
public void open(int taskNumber, int numTasks) throws IOException {
this.fileOutputCommitterWrapper.setupJob(this.jobConf);
if (Integer.toString(taskNumber + 1).length() <= 6) {
this.jobConf.set("mapred.task.id", "attempt__0000_r_" + String.format("%" + (6 - Integer.toString(taskNumber + 1).length()) ... | [
"@",
"Override",
"public",
"void",
"open",
"(",
"int",
"taskNumber",
",",
"int",
"numTasks",
")",
"throws",
"IOException",
"{",
"this",
".",
"fileOutputCommitterWrapper",
".",
"setupJob",
"(",
"this",
".",
"jobConf",
")",
";",
"if",
"(",
"Integer",
".",
"t... | create the temporary output file for hadoop RecordWriter.
@param taskNumber The number of the parallel instance.
@param numTasks The number of parallel tasks.
@throws IOException | [
"create",
"the",
"temporary",
"output",
"file",
"for",
"hadoop",
"RecordWriter",
"."
] | train | https://github.com/stratosphere/stratosphere/blob/c543a08f9676c5b2b0a7088123bd6e795a8ae0c8/stratosphere-addons/hadoop-compatibility/src/main/java/eu/stratosphere/hadoopcompatibility/HadoopOutputFormatWrapper.java#L67-L78 |
box/box-java-sdk | src/main/java/com/box/sdk/BoxItem.java | BoxItem.getWatermark | protected BoxWatermark getWatermark(URLTemplate itemUrl, String... fields) {
"""
Used to retrieve the watermark for the item.
If the item does not have a watermark applied to it, a 404 Not Found will be returned by API.
@param itemUrl url template for the item.
@param fields the fields to retrieve.
@return the... | java | protected BoxWatermark getWatermark(URLTemplate itemUrl, String... fields) {
URL watermarkUrl = itemUrl.build(this.getAPI().getBaseURL(), this.getID());
QueryStringBuilder builder = new QueryStringBuilder();
if (fields.length > 0) {
builder.appendParam("fields", fields);
}
... | [
"protected",
"BoxWatermark",
"getWatermark",
"(",
"URLTemplate",
"itemUrl",
",",
"String",
"...",
"fields",
")",
"{",
"URL",
"watermarkUrl",
"=",
"itemUrl",
".",
"build",
"(",
"this",
".",
"getAPI",
"(",
")",
".",
"getBaseURL",
"(",
")",
",",
"this",
".",
... | Used to retrieve the watermark for the item.
If the item does not have a watermark applied to it, a 404 Not Found will be returned by API.
@param itemUrl url template for the item.
@param fields the fields to retrieve.
@return the watermark associated with the item. | [
"Used",
"to",
"retrieve",
"the",
"watermark",
"for",
"the",
"item",
".",
"If",
"the",
"item",
"does",
"not",
"have",
"a",
"watermark",
"applied",
"to",
"it",
"a",
"404",
"Not",
"Found",
"will",
"be",
"returned",
"by",
"API",
"."
] | train | https://github.com/box/box-java-sdk/blob/35b4ba69417f9d6a002c19dfaab57527750ef349/src/main/java/com/box/sdk/BoxItem.java#L87-L97 |
apache/incubator-gobblin | gobblin-modules/gobblin-http/src/main/java/org/apache/gobblin/converter/AsyncHttpJoinConverter.java | AsyncHttpJoinConverter.convertRecordAsync | @Override
public final CompletableFuture<DO> convertRecordAsync(SO outputSchema, DI inputRecord, WorkUnitState workUnitState)
throws DataConversionException {
"""
Convert an input record to a future object where an output record will be filled in sometime later
Sequence:
Convert input (DI) to an http req... | java | @Override
public final CompletableFuture<DO> convertRecordAsync(SO outputSchema, DI inputRecord, WorkUnitState workUnitState)
throws DataConversionException {
// Convert DI to HttpOperation
HttpOperation operation = generateHttpOperation(inputRecord, workUnitState);
BufferedRecord<GenericRecord> bu... | [
"@",
"Override",
"public",
"final",
"CompletableFuture",
"<",
"DO",
">",
"convertRecordAsync",
"(",
"SO",
"outputSchema",
",",
"DI",
"inputRecord",
",",
"WorkUnitState",
"workUnitState",
")",
"throws",
"DataConversionException",
"{",
"// Convert DI to HttpOperation",
"H... | Convert an input record to a future object where an output record will be filled in sometime later
Sequence:
Convert input (DI) to an http request
Send http request asynchronously, and registers an http callback
Create an {@link CompletableFuture} object. When the callback is invoked, this future object is filled in by... | [
"Convert",
"an",
"input",
"record",
"to",
"a",
"future",
"object",
"where",
"an",
"output",
"record",
"will",
"be",
"filled",
"in",
"sometime",
"later",
"Sequence",
":",
"Convert",
"input",
"(",
"DI",
")",
"to",
"an",
"http",
"request",
"Send",
"http",
"... | train | https://github.com/apache/incubator-gobblin/blob/f029b4c0fea0fe4aa62f36dda2512344ff708bae/gobblin-modules/gobblin-http/src/main/java/org/apache/gobblin/converter/AsyncHttpJoinConverter.java#L169-L193 |
zaproxy/zaproxy | src/org/zaproxy/zap/utils/FontUtils.java | FontUtils.getFontWithFallback | public static Font getFontWithFallback(FontType fontType, String fallbackFontName) {
"""
Gets font for the given {@link FontType} or the fallback font with the given
name if no font is set for the given {@code FontType}
@param fontType
the {@code FontType} for which the font should be returned
@param fallbac... | java | public static Font getFontWithFallback(FontType fontType, String fallbackFontName) {
if (isDefaultFontSet(fontType)) {
return getFont(fontType);
} else {
return getFont(fallbackFontName);
}
} | [
"public",
"static",
"Font",
"getFontWithFallback",
"(",
"FontType",
"fontType",
",",
"String",
"fallbackFontName",
")",
"{",
"if",
"(",
"isDefaultFontSet",
"(",
"fontType",
")",
")",
"{",
"return",
"getFont",
"(",
"fontType",
")",
";",
"}",
"else",
"{",
"ret... | Gets font for the given {@link FontType} or the fallback font with the given
name if no font is set for the given {@code FontType}
@param fontType
the {@code FontType} for which the font should be returned
@param fallbackFontName
the name ({@code String}) of the font which will be returned of no
font is set for the gi... | [
"Gets",
"font",
"for",
"the",
"given",
"{",
"@link",
"FontType",
"}",
"or",
"the",
"fallback",
"font",
"with",
"the",
"given",
"name",
"if",
"no",
"font",
"is",
"set",
"for",
"the",
"given",
"{",
"@code",
"FontType",
"}"
] | train | https://github.com/zaproxy/zaproxy/blob/0cbe5121f2ae1ecca222513d182759210c569bec/src/org/zaproxy/zap/utils/FontUtils.java#L155-L161 |
raphw/byte-buddy | byte-buddy-dep/src/main/java/net/bytebuddy/dynamic/loading/ClassReloadingStrategy.java | ClassReloadingStrategy.preregistered | public ClassReloadingStrategy preregistered(Class<?>... type) {
"""
Registers a type to be explicitly available without explicit lookup.
@param type The loaded types that are explicitly available.
@return This class reloading strategy with the given types being explicitly available.
"""
Map<String,... | java | public ClassReloadingStrategy preregistered(Class<?>... type) {
Map<String, Class<?>> preregisteredTypes = new HashMap<String, Class<?>>(this.preregisteredTypes);
for (Class<?> aType : type) {
preregisteredTypes.put(TypeDescription.ForLoadedType.getName(aType), aType);
}
retu... | [
"public",
"ClassReloadingStrategy",
"preregistered",
"(",
"Class",
"<",
"?",
">",
"...",
"type",
")",
"{",
"Map",
"<",
"String",
",",
"Class",
"<",
"?",
">",
">",
"preregisteredTypes",
"=",
"new",
"HashMap",
"<",
"String",
",",
"Class",
"<",
"?",
">",
... | Registers a type to be explicitly available without explicit lookup.
@param type The loaded types that are explicitly available.
@return This class reloading strategy with the given types being explicitly available. | [
"Registers",
"a",
"type",
"to",
"be",
"explicitly",
"available",
"without",
"explicit",
"lookup",
"."
] | train | https://github.com/raphw/byte-buddy/blob/4d2dac80efb6bed89367567260f6811c2f712d12/byte-buddy-dep/src/main/java/net/bytebuddy/dynamic/loading/ClassReloadingStrategy.java#L289-L295 |
google/j2objc | jre_emul/android/platform/libcore/ojluni/src/main/java/java/util/ComparableTimSort.java | ComparableTimSort.mergeAt | @SuppressWarnings("unchecked")
private void mergeAt(int i) {
"""
Merges the two runs at stack indices i and i+1. Run i must be
the penultimate or antepenultimate run on the stack. In other words,
i must be equal to stackSize-2 or stackSize-3.
@param i stack index of the first of the two runs to merge
... | java | @SuppressWarnings("unchecked")
private void mergeAt(int i) {
assert stackSize >= 2;
assert i >= 0;
assert i == stackSize - 2 || i == stackSize - 3;
int base1 = runBase[i];
int len1 = runLen[i];
int base2 = runBase[i + 1];
int len2 = runLen[i + 1];
ass... | [
"@",
"SuppressWarnings",
"(",
"\"unchecked\"",
")",
"private",
"void",
"mergeAt",
"(",
"int",
"i",
")",
"{",
"assert",
"stackSize",
">=",
"2",
";",
"assert",
"i",
">=",
"0",
";",
"assert",
"i",
"==",
"stackSize",
"-",
"2",
"||",
"i",
"==",
"stackSize",... | Merges the two runs at stack indices i and i+1. Run i must be
the penultimate or antepenultimate run on the stack. In other words,
i must be equal to stackSize-2 or stackSize-3.
@param i stack index of the first of the two runs to merge | [
"Merges",
"the",
"two",
"runs",
"at",
"stack",
"indices",
"i",
"and",
"i",
"+",
"1",
".",
"Run",
"i",
"must",
"be",
"the",
"penultimate",
"or",
"antepenultimate",
"run",
"on",
"the",
"stack",
".",
"In",
"other",
"words",
"i",
"must",
"be",
"equal",
"... | train | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/libcore/ojluni/src/main/java/java/util/ComparableTimSort.java#L433-L484 |
Azure/azure-sdk-for-java | network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/NetworkWatchersInner.java | NetworkWatchersInner.beginGetNetworkConfigurationDiagnostic | public NetworkConfigurationDiagnosticResponseInner beginGetNetworkConfigurationDiagnostic(String resourceGroupName, String networkWatcherName, NetworkConfigurationDiagnosticParameters parameters) {
"""
Get network configuration diagnostic.
@param resourceGroupName The name of the resource group.
@param network... | java | public NetworkConfigurationDiagnosticResponseInner beginGetNetworkConfigurationDiagnostic(String resourceGroupName, String networkWatcherName, NetworkConfigurationDiagnosticParameters parameters) {
return beginGetNetworkConfigurationDiagnosticWithServiceResponseAsync(resourceGroupName, networkWatcherName, param... | [
"public",
"NetworkConfigurationDiagnosticResponseInner",
"beginGetNetworkConfigurationDiagnostic",
"(",
"String",
"resourceGroupName",
",",
"String",
"networkWatcherName",
",",
"NetworkConfigurationDiagnosticParameters",
"parameters",
")",
"{",
"return",
"beginGetNetworkConfigurationDi... | Get network configuration diagnostic.
@param resourceGroupName The name of the resource group.
@param networkWatcherName The name of the network watcher.
@param parameters Parameters to get network configuration diagnostic.
@throws IllegalArgumentException thrown if parameters fail the validation
@throws ErrorResponse... | [
"Get",
"network",
"configuration",
"diagnostic",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/NetworkWatchersInner.java#L2732-L2734 |
alkacon/opencms-core | src/org/opencms/loader/CmsResourceManager.java | CmsResourceManager.getTemplateName | private String getTemplateName(CmsObject cms, CmsResource resource) throws CmsException {
"""
Gets the template name for a template resource, using a cache for efficiency.<p>
@param cms the current CMS context
@param resource the template resource
@return the template name
@throws CmsException if something... | java | private String getTemplateName(CmsObject cms, CmsResource resource) throws CmsException {
String templateName = (String)(m_templateNameCache.getCachedObject(cms, resource.getRootPath()));
if (templateName == null) {
CmsProperty nameProperty = cms.readPropertyObject(
resource... | [
"private",
"String",
"getTemplateName",
"(",
"CmsObject",
"cms",
",",
"CmsResource",
"resource",
")",
"throws",
"CmsException",
"{",
"String",
"templateName",
"=",
"(",
"String",
")",
"(",
"m_templateNameCache",
".",
"getCachedObject",
"(",
"cms",
",",
"resource",... | Gets the template name for a template resource, using a cache for efficiency.<p>
@param cms the current CMS context
@param resource the template resource
@return the template name
@throws CmsException if something goes wrong | [
"Gets",
"the",
"template",
"name",
"for",
"a",
"template",
"resource",
"using",
"a",
"cache",
"for",
"efficiency",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/loader/CmsResourceManager.java#L1292-L1309 |
j256/ormlite-core | src/main/java/com/j256/ormlite/stmt/StatementExecutor.java | StatementExecutor.buildIterator | public SelectIterator<T, ID> buildIterator(BaseDaoImpl<T, ID> classDao, ConnectionSource connectionSource,
int resultFlags, ObjectCache objectCache) throws SQLException {
"""
Create and return a SelectIterator for the class using the default mapped query for all statement.
"""
prepareQueryForAll();
retu... | java | public SelectIterator<T, ID> buildIterator(BaseDaoImpl<T, ID> classDao, ConnectionSource connectionSource,
int resultFlags, ObjectCache objectCache) throws SQLException {
prepareQueryForAll();
return buildIterator(classDao, connectionSource, preparedQueryForAll, objectCache, resultFlags);
} | [
"public",
"SelectIterator",
"<",
"T",
",",
"ID",
">",
"buildIterator",
"(",
"BaseDaoImpl",
"<",
"T",
",",
"ID",
">",
"classDao",
",",
"ConnectionSource",
"connectionSource",
",",
"int",
"resultFlags",
",",
"ObjectCache",
"objectCache",
")",
"throws",
"SQLExcepti... | Create and return a SelectIterator for the class using the default mapped query for all statement. | [
"Create",
"and",
"return",
"a",
"SelectIterator",
"for",
"the",
"class",
"using",
"the",
"default",
"mapped",
"query",
"for",
"all",
"statement",
"."
] | train | https://github.com/j256/ormlite-core/blob/154d85bbb9614a0ea65a012251257831fb4fba21/src/main/java/com/j256/ormlite/stmt/StatementExecutor.java#L214-L218 |
openengsb/openengsb | api/workflow/src/main/java/org/openengsb/core/workflow/api/model/ProcessBag.java | ProcessBag.addProperty | public void addProperty(String key, Object value) throws ProcessBagException {
"""
Adds a new property only if it does not exist already
@throws ProcessBagException if the key is already present
"""
if (properties.containsKey(key)) {
throw new ProcessBagException(key + " already used!");... | java | public void addProperty(String key, Object value) throws ProcessBagException {
if (properties.containsKey(key)) {
throw new ProcessBagException(key + " already used!");
} else {
properties.put(key, value);
}
} | [
"public",
"void",
"addProperty",
"(",
"String",
"key",
",",
"Object",
"value",
")",
"throws",
"ProcessBagException",
"{",
"if",
"(",
"properties",
".",
"containsKey",
"(",
"key",
")",
")",
"{",
"throw",
"new",
"ProcessBagException",
"(",
"key",
"+",
"\" alre... | Adds a new property only if it does not exist already
@throws ProcessBagException if the key is already present | [
"Adds",
"a",
"new",
"property",
"only",
"if",
"it",
"does",
"not",
"exist",
"already"
] | train | https://github.com/openengsb/openengsb/blob/d39058000707f617cd405629f9bc7f17da7b414a/api/workflow/src/main/java/org/openengsb/core/workflow/api/model/ProcessBag.java#L134-L140 |
aws/aws-sdk-java | aws-java-sdk-greengrass/src/main/java/com/amazonaws/services/greengrass/model/CreateSubscriptionDefinitionRequest.java | CreateSubscriptionDefinitionRequest.withTags | public CreateSubscriptionDefinitionRequest withTags(java.util.Map<String, String> tags) {
"""
Tag(s) to add to the new resource
@param tags
Tag(s) to add to the new resource
@return Returns a reference to this object so that method calls can be chained together.
"""
setTags(tags);
return t... | java | public CreateSubscriptionDefinitionRequest withTags(java.util.Map<String, String> tags) {
setTags(tags);
return this;
} | [
"public",
"CreateSubscriptionDefinitionRequest",
"withTags",
"(",
"java",
".",
"util",
".",
"Map",
"<",
"String",
",",
"String",
">",
"tags",
")",
"{",
"setTags",
"(",
"tags",
")",
";",
"return",
"this",
";",
"}"
] | Tag(s) to add to the new resource
@param tags
Tag(s) to add to the new resource
@return Returns a reference to this object so that method calls can be chained together. | [
"Tag",
"(",
"s",
")",
"to",
"add",
"to",
"the",
"new",
"resource"
] | train | https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-greengrass/src/main/java/com/amazonaws/services/greengrass/model/CreateSubscriptionDefinitionRequest.java#L168-L171 |
unbescape/unbescape | src/main/java/org/unbescape/uri/UriEscape.java | UriEscape.unescapeUriQueryParam | public static String unescapeUriQueryParam(final String text, final String encoding) {
"""
<p>
Perform am URI query parameter (name or value) <strong>unescape</strong> operation
on a <tt>String</tt> input.
</p>
<p>
This method will unescape every percent-encoded (<tt>%HH</tt>) sequences present in input,
eve... | java | public static String unescapeUriQueryParam(final String text, final String encoding) {
if (encoding == null) {
throw new IllegalArgumentException("Argument 'encoding' cannot be null");
}
return UriEscapeUtil.unescape(text, UriEscapeUtil.UriEscapeType.QUERY_PARAM, encoding);
} | [
"public",
"static",
"String",
"unescapeUriQueryParam",
"(",
"final",
"String",
"text",
",",
"final",
"String",
"encoding",
")",
"{",
"if",
"(",
"encoding",
"==",
"null",
")",
"{",
"throw",
"new",
"IllegalArgumentException",
"(",
"\"Argument 'encoding' cannot be null... | <p>
Perform am URI query parameter (name or value) <strong>unescape</strong> operation
on a <tt>String</tt> input.
</p>
<p>
This method will unescape every percent-encoded (<tt>%HH</tt>) sequences present in input,
even for those characters that do not need to be percent-encoded in this context (unreserved characters
c... | [
"<p",
">",
"Perform",
"am",
"URI",
"query",
"parameter",
"(",
"name",
"or",
"value",
")",
"<strong",
">",
"unescape<",
"/",
"strong",
">",
"operation",
"on",
"a",
"<tt",
">",
"String<",
"/",
"tt",
">",
"input",
".",
"<",
"/",
"p",
">",
"<p",
">",
... | train | https://github.com/unbescape/unbescape/blob/ec5435fb3508c2eed25d8165dc27ded2602cae13/src/main/java/org/unbescape/uri/UriEscape.java#L1698-L1703 |
unbescape/unbescape | src/main/java/org/unbescape/css/CssEscape.java | CssEscape.escapeCssStringMinimal | public static void escapeCssStringMinimal(final Reader reader, final Writer writer)
throws IOException {
"""
<p>
Perform a CSS String level 1 (only basic set) <strong>escape</strong> operation
on a <tt>Reader</tt> input, writing results to a <tt>Writer</tt>.
</p>
<p>
<em>Level 1</em> means this me... | java | public static void escapeCssStringMinimal(final Reader reader, final Writer writer)
throws IOException {
escapeCssString(reader, writer,
CssStringEscapeType.BACKSLASH_ESCAPES_DEFAULT_TO_COMPACT_HEXA,
CssStringEscapeLevel.LEVEL_1_BASIC_ESCAPE_SET);
} | [
"public",
"static",
"void",
"escapeCssStringMinimal",
"(",
"final",
"Reader",
"reader",
",",
"final",
"Writer",
"writer",
")",
"throws",
"IOException",
"{",
"escapeCssString",
"(",
"reader",
",",
"writer",
",",
"CssStringEscapeType",
".",
"BACKSLASH_ESCAPES_DEFAULT_TO... | <p>
Perform a CSS String level 1 (only basic set) <strong>escape</strong> operation
on a <tt>Reader</tt> input, writing results to a <tt>Writer</tt>.
</p>
<p>
<em>Level 1</em> means this method will only escape the CSS String basic escape set:
</p>
<ul>
<li>The <em>Backslash Escapes</em>:
<tt>\"</tt> (<tt>U+00... | [
"<p",
">",
"Perform",
"a",
"CSS",
"String",
"level",
"1",
"(",
"only",
"basic",
"set",
")",
"<strong",
">",
"escape<",
"/",
"strong",
">",
"operation",
"on",
"a",
"<tt",
">",
"Reader<",
"/",
"tt",
">",
"input",
"writing",
"results",
"to",
"a",
"<tt",... | train | https://github.com/unbescape/unbescape/blob/ec5435fb3508c2eed25d8165dc27ded2602cae13/src/main/java/org/unbescape/css/CssEscape.java#L505-L510 |
wmdietl/jsr308-langtools | src/share/classes/com/sun/tools/doclets/internal/toolkit/builders/ProfileSummaryBuilder.java | ProfileSummaryBuilder.buildProfileDoc | public void buildProfileDoc(XMLNode node, Content contentTree) throws Exception {
"""
Build the profile documentation.
@param node the XML element that specifies which components to document
@param contentTree the content tree to which the documentation will be added
"""
contentTree = profileWriter... | java | public void buildProfileDoc(XMLNode node, Content contentTree) throws Exception {
contentTree = profileWriter.getProfileHeader(profile.name);
buildChildren(node, contentTree);
profileWriter.addProfileFooter(contentTree);
profileWriter.printDocument(contentTree);
profileWriter.clo... | [
"public",
"void",
"buildProfileDoc",
"(",
"XMLNode",
"node",
",",
"Content",
"contentTree",
")",
"throws",
"Exception",
"{",
"contentTree",
"=",
"profileWriter",
".",
"getProfileHeader",
"(",
"profile",
".",
"name",
")",
";",
"buildChildren",
"(",
"node",
",",
... | Build the profile documentation.
@param node the XML element that specifies which components to document
@param contentTree the content tree to which the documentation will be added | [
"Build",
"the",
"profile",
"documentation",
"."
] | train | https://github.com/wmdietl/jsr308-langtools/blob/8812d28c20f4de070a0dd6de1b45602431379834/src/share/classes/com/sun/tools/doclets/internal/toolkit/builders/ProfileSummaryBuilder.java#L125-L132 |
jcuda/jcusparse | JCusparseJava/src/main/java/jcuda/jcusparse/JCusparse.java | JCusparse.cusparseScsrilu02_numericBoost | public static int cusparseScsrilu02_numericBoost(
cusparseHandle handle,
csrilu02Info info,
int enable_boost,
Pointer tol,
Pointer boost_val) {
"""
<pre>
Description: Compute the incomplete-LU factorization with 0 fill-in (ILU0)
of the matrix A stored in CSR forma... | java | public static int cusparseScsrilu02_numericBoost(
cusparseHandle handle,
csrilu02Info info,
int enable_boost,
Pointer tol,
Pointer boost_val)
{
return checkResult(cusparseScsrilu02_numericBoostNative(handle, info, enable_boost, tol, boost_val));
} | [
"public",
"static",
"int",
"cusparseScsrilu02_numericBoost",
"(",
"cusparseHandle",
"handle",
",",
"csrilu02Info",
"info",
",",
"int",
"enable_boost",
",",
"Pointer",
"tol",
",",
"Pointer",
"boost_val",
")",
"{",
"return",
"checkResult",
"(",
"cusparseScsrilu02_numeri... | <pre>
Description: Compute the incomplete-LU factorization with 0 fill-in (ILU0)
of the matrix A stored in CSR format based on the information in the opaque
structure info that was obtained from the analysis phase (csrsv2_analysis).
This routine implements algorithm 2 for this problem.
</pre> | [
"<pre",
">",
"Description",
":",
"Compute",
"the",
"incomplete",
"-",
"LU",
"factorization",
"with",
"0",
"fill",
"-",
"in",
"(",
"ILU0",
")",
"of",
"the",
"matrix",
"A",
"stored",
"in",
"CSR",
"format",
"based",
"on",
"the",
"information",
"in",
"the",
... | train | https://github.com/jcuda/jcusparse/blob/7687a62a4ef6b76cb91cf7da93d4cf5ade96a791/JCusparseJava/src/main/java/jcuda/jcusparse/JCusparse.java#L5856-L5864 |
apache/incubator-atlas | repository/src/main/java/org/apache/atlas/repository/graph/GraphHelper.java | GraphHelper.getEdgeForLabel | public AtlasEdge getEdgeForLabel(AtlasVertex vertex, String edgeLabel) {
"""
Returns the active edge for the given edge label.
If the vertex is deleted and there is no active edge, it returns the latest deleted edge
@param vertex
@param edgeLabel
@return
"""
return getEdgeForLabel(vertex, edgeLabel... | java | public AtlasEdge getEdgeForLabel(AtlasVertex vertex, String edgeLabel) {
return getEdgeForLabel(vertex, edgeLabel, AtlasEdgeDirection.OUT);
} | [
"public",
"AtlasEdge",
"getEdgeForLabel",
"(",
"AtlasVertex",
"vertex",
",",
"String",
"edgeLabel",
")",
"{",
"return",
"getEdgeForLabel",
"(",
"vertex",
",",
"edgeLabel",
",",
"AtlasEdgeDirection",
".",
"OUT",
")",
";",
"}"
] | Returns the active edge for the given edge label.
If the vertex is deleted and there is no active edge, it returns the latest deleted edge
@param vertex
@param edgeLabel
@return | [
"Returns",
"the",
"active",
"edge",
"for",
"the",
"given",
"edge",
"label",
".",
"If",
"the",
"vertex",
"is",
"deleted",
"and",
"there",
"is",
"no",
"active",
"edge",
"it",
"returns",
"the",
"latest",
"deleted",
"edge"
] | train | https://github.com/apache/incubator-atlas/blob/e0d2cdc27c32742ebecd24db4cca62dc04dcdf4b/repository/src/main/java/org/apache/atlas/repository/graph/GraphHelper.java#L399-L401 |
cdk/cdk | tool/tautomer/src/main/java/org/openscience/cdk/tautomers/InChITautomerGenerator.java | InChITautomerGenerator.mapInputMoleculeToInchiMolgraph | private void mapInputMoleculeToInchiMolgraph(IAtomContainer inchiMolGraph, IAtomContainer mol) throws CDKException {
"""
Atom-atom mapping of the input molecule to the bare container constructed from the InChI connection table.
This makes it possible to map the positions of the mobile hydrogens in the InChI back ... | java | private void mapInputMoleculeToInchiMolgraph(IAtomContainer inchiMolGraph, IAtomContainer mol) throws CDKException {
Iterator<Map<IAtom, IAtom>> iter = org.openscience.cdk.isomorphism.VentoFoggia.findIdentical(inchiMolGraph,
... | [
"private",
"void",
"mapInputMoleculeToInchiMolgraph",
"(",
"IAtomContainer",
"inchiMolGraph",
",",
"IAtomContainer",
"mol",
")",
"throws",
"CDKException",
"{",
"Iterator",
"<",
"Map",
"<",
"IAtom",
",",
"IAtom",
">",
">",
"iter",
"=",
"org",
".",
"openscience",
... | Atom-atom mapping of the input molecule to the bare container constructed from the InChI connection table.
This makes it possible to map the positions of the mobile hydrogens in the InChI back to the input molecule.
@param inchiMolGraph molecule (bare) as defined in InChI
@param mol user input molecule
@throws CDKExcep... | [
"Atom",
"-",
"atom",
"mapping",
"of",
"the",
"input",
"molecule",
"to",
"the",
"bare",
"container",
"constructed",
"from",
"the",
"InChI",
"connection",
"table",
".",
"This",
"makes",
"it",
"possible",
"to",
"map",
"the",
"positions",
"of",
"the",
"mobile",
... | train | https://github.com/cdk/cdk/blob/c3d0f16502bf08df50365fee392e11d7c9856657/tool/tautomer/src/main/java/org/openscience/cdk/tautomers/InChITautomerGenerator.java#L322-L342 |
UrielCh/ovh-java-sdk | ovh-java-sdk-ipLoadbalancing/src/main/java/net/minidev/ovh/api/ApiOvhIpLoadbalancing.java | ApiOvhIpLoadbalancing.serviceName_http_route_routeId_PUT | public void serviceName_http_route_routeId_PUT(String serviceName, Long routeId, OvhRouteHttp body) throws IOException {
"""
Alter this object properties
REST: PUT /ipLoadbalancing/{serviceName}/http/route/{routeId}
@param body [required] New object properties
@param serviceName [required] The internal name o... | java | public void serviceName_http_route_routeId_PUT(String serviceName, Long routeId, OvhRouteHttp body) throws IOException {
String qPath = "/ipLoadbalancing/{serviceName}/http/route/{routeId}";
StringBuilder sb = path(qPath, serviceName, routeId);
exec(qPath, "PUT", sb.toString(), body);
} | [
"public",
"void",
"serviceName_http_route_routeId_PUT",
"(",
"String",
"serviceName",
",",
"Long",
"routeId",
",",
"OvhRouteHttp",
"body",
")",
"throws",
"IOException",
"{",
"String",
"qPath",
"=",
"\"/ipLoadbalancing/{serviceName}/http/route/{routeId}\"",
";",
"StringBuild... | Alter this object properties
REST: PUT /ipLoadbalancing/{serviceName}/http/route/{routeId}
@param body [required] New object properties
@param serviceName [required] The internal name of your IP load balancing
@param routeId [required] Id of your route | [
"Alter",
"this",
"object",
"properties"
] | train | https://github.com/UrielCh/ovh-java-sdk/blob/6d531a40e56e09701943e334c25f90f640c55701/ovh-java-sdk-ipLoadbalancing/src/main/java/net/minidev/ovh/api/ApiOvhIpLoadbalancing.java#L240-L244 |
google/closure-templates | java/src/com/google/template/soy/data/UnsafeSanitizedContentOrdainer.java | UnsafeSanitizedContentOrdainer.ordainAsSafe | public static SanitizedContent ordainAsSafe(String value, ContentKind kind, @Nullable Dir dir) {
"""
Faithfully assumes the provided value is "safe" and marks it not to be re-escaped. Also assumes
the provided direction; null means unknown and thus to be estimated when necessary.
<p>When you "ordain" a string ... | java | public static SanitizedContent ordainAsSafe(String value, ContentKind kind, @Nullable Dir dir) {
if (kind == ContentKind.TEXT) {
if (dir != null) {
throw new IllegalArgumentException("TEXT objects don't support contend directions.");
}
return UnsanitizedString.create(value);
}
retu... | [
"public",
"static",
"SanitizedContent",
"ordainAsSafe",
"(",
"String",
"value",
",",
"ContentKind",
"kind",
",",
"@",
"Nullable",
"Dir",
"dir",
")",
"{",
"if",
"(",
"kind",
"==",
"ContentKind",
".",
"TEXT",
")",
"{",
"if",
"(",
"dir",
"!=",
"null",
")",
... | Faithfully assumes the provided value is "safe" and marks it not to be re-escaped. Also assumes
the provided direction; null means unknown and thus to be estimated when necessary.
<p>When you "ordain" a string as safe content, it means that Soy will NOT re-escape or validate
the contents if printed in the relevant con... | [
"Faithfully",
"assumes",
"the",
"provided",
"value",
"is",
"safe",
"and",
"marks",
"it",
"not",
"to",
"be",
"re",
"-",
"escaped",
".",
"Also",
"assumes",
"the",
"provided",
"direction",
";",
"null",
"means",
"unknown",
"and",
"thus",
"to",
"be",
"estimated... | train | https://github.com/google/closure-templates/blob/cc61e1dff70ae97f24f417a57410081bc498bd56/java/src/com/google/template/soy/data/UnsafeSanitizedContentOrdainer.java#L75-L83 |
aws/aws-sdk-java | aws-java-sdk-dynamodb/src/main/java/com/amazonaws/services/dynamodbv2/datamodeling/TransactionWriteRequest.java | TransactionWriteRequest.addDelete | public TransactionWriteRequest addDelete(Object key, DynamoDBTransactionWriteExpression transactionWriteExpression) {
"""
Adds delete operation (to be executed on the object represented by key) to the list of transaction write operations.
transactionWriteExpression is used to conditionally delete the object repre... | java | public TransactionWriteRequest addDelete(Object key, DynamoDBTransactionWriteExpression transactionWriteExpression) {
return addDelete(key, transactionWriteExpression, null /* returnValuesOnConditionCheckFailure */);
} | [
"public",
"TransactionWriteRequest",
"addDelete",
"(",
"Object",
"key",
",",
"DynamoDBTransactionWriteExpression",
"transactionWriteExpression",
")",
"{",
"return",
"addDelete",
"(",
"key",
",",
"transactionWriteExpression",
",",
"null",
"/* returnValuesOnConditionCheckFailure ... | Adds delete operation (to be executed on the object represented by key) to the list of transaction write operations.
transactionWriteExpression is used to conditionally delete the object represented by key. | [
"Adds",
"delete",
"operation",
"(",
"to",
"be",
"executed",
"on",
"the",
"object",
"represented",
"by",
"key",
")",
"to",
"the",
"list",
"of",
"transaction",
"write",
"operations",
".",
"transactionWriteExpression",
"is",
"used",
"to",
"conditionally",
"delete",... | train | https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-dynamodb/src/main/java/com/amazonaws/services/dynamodbv2/datamodeling/TransactionWriteRequest.java#L112-L114 |
liferay/com-liferay-commerce | commerce-product-service/src/main/java/com/liferay/commerce/product/service/persistence/impl/CPTaxCategoryPersistenceImpl.java | CPTaxCategoryPersistenceImpl.findAll | @Override
public List<CPTaxCategory> findAll(int start, int end) {
"""
Returns a range of all the cp tax categories.
<p>
Useful when paginating results. Returns a maximum of <code>end - start</code> instances. <code>start</code> and <code>end</code> are not primary keys, they are indexes in the result set. Th... | java | @Override
public List<CPTaxCategory> findAll(int start, int end) {
return findAll(start, end, null);
} | [
"@",
"Override",
"public",
"List",
"<",
"CPTaxCategory",
">",
"findAll",
"(",
"int",
"start",
",",
"int",
"end",
")",
"{",
"return",
"findAll",
"(",
"start",
",",
"end",
",",
"null",
")",
";",
"}"
] | Returns a range of all the cp tax categories.
<p>
Useful when paginating results. Returns a maximum of <code>end - start</code> instances. <code>start</code> and <code>end</code> are not primary keys, they are indexes in the result set. Thus, <code>0</code> refers to the first result in the set. Setting both <code>sta... | [
"Returns",
"a",
"range",
"of",
"all",
"the",
"cp",
"tax",
"categories",
"."
] | train | https://github.com/liferay/com-liferay-commerce/blob/9e54362d7f59531fc684016ba49ee7cdc3a2f22b/commerce-product-service/src/main/java/com/liferay/commerce/product/service/persistence/impl/CPTaxCategoryPersistenceImpl.java#L1103-L1106 |
SeleniumHQ/selenium | java/client/src/org/openqa/selenium/remote/RemoteWebDriverBuilder.java | RemoteWebDriverBuilder.build | public WebDriver build() {
"""
Actually create a new WebDriver session. The returned webdriver is not guaranteed to be a
{@link RemoteWebDriver}.
"""
if (options.isEmpty() && additionalCapabilities.isEmpty()) {
throw new SessionNotCreatedException("Refusing to create session without any capabilities... | java | public WebDriver build() {
if (options.isEmpty() && additionalCapabilities.isEmpty()) {
throw new SessionNotCreatedException("Refusing to create session without any capabilities");
}
Plan plan = getPlan();
CommandExecutor executor;
if (plan.isUsingDriverService()) {
AtomicReference<Dri... | [
"public",
"WebDriver",
"build",
"(",
")",
"{",
"if",
"(",
"options",
".",
"isEmpty",
"(",
")",
"&&",
"additionalCapabilities",
".",
"isEmpty",
"(",
")",
")",
"{",
"throw",
"new",
"SessionNotCreatedException",
"(",
"\"Refusing to create session without any capabiliti... | Actually create a new WebDriver session. The returned webdriver is not guaranteed to be a
{@link RemoteWebDriver}. | [
"Actually",
"create",
"a",
"new",
"WebDriver",
"session",
".",
"The",
"returned",
"webdriver",
"is",
"not",
"guaranteed",
"to",
"be",
"a",
"{"
] | train | https://github.com/SeleniumHQ/selenium/blob/7af172729f17b20269c8ca4ea6f788db48616535/java/client/src/org/openqa/selenium/remote/RemoteWebDriverBuilder.java#L194-L227 |
hazelcast/hazelcast | hazelcast/src/main/java/com/hazelcast/map/impl/event/DefaultEntryEventFilteringStrategy.java | DefaultEntryEventFilteringStrategy.processQueryEventFilter | private boolean processQueryEventFilter(EventFilter filter, EntryEventType eventType,
Data dataKey, Object oldValue, Object dataValue, String mapNameOrNull) {
"""
Evaluate if the filter matches the map event. In case of a remove, evict or expire event
the old value will... | java | private boolean processQueryEventFilter(EventFilter filter, EntryEventType eventType,
Data dataKey, Object oldValue, Object dataValue, String mapNameOrNull) {
Object testValue;
if (eventType == REMOVED || eventType == EVICTED || eventType == EXPIRED) {
... | [
"private",
"boolean",
"processQueryEventFilter",
"(",
"EventFilter",
"filter",
",",
"EntryEventType",
"eventType",
",",
"Data",
"dataKey",
",",
"Object",
"oldValue",
",",
"Object",
"dataValue",
",",
"String",
"mapNameOrNull",
")",
"{",
"Object",
"testValue",
";",
... | Evaluate if the filter matches the map event. In case of a remove, evict or expire event
the old value will be used for evaluation, otherwise we use the new value.
The filter must be of {@link QueryEventFilter} type.
@param filter a {@link QueryEventFilter} filter
@param eventType the event type
@param data... | [
"Evaluate",
"if",
"the",
"filter",
"matches",
"the",
"map",
"event",
".",
"In",
"case",
"of",
"a",
"remove",
"evict",
"or",
"expire",
"event",
"the",
"old",
"value",
"will",
"be",
"used",
"for",
"evaluation",
"otherwise",
"we",
"use",
"the",
"new",
"valu... | train | https://github.com/hazelcast/hazelcast/blob/8c4bc10515dbbfb41a33e0302c0caedf3cda1baf/hazelcast/src/main/java/com/hazelcast/map/impl/event/DefaultEntryEventFilteringStrategy.java#L117-L127 |
mygreen/xlsmapper | src/main/java/com/gh/mygreen/xlsmapper/cellconverter/BaseCellConverter.java | BaseCellConverter.newTypeBindExceptionOnParse | public TypeBindException newTypeBindExceptionOnParse(final Exception error, final Cell cell, final Object cellValue) {
"""
セルの値をパースしJavaオブジェクトに型変換するとこに失敗したときの例外{@link TypeBindException}を作成します。
@since 2.0
@param error 例外情報
@param cell パースに失敗したセル
@param cellValue パースに失敗した値
@return マッピングに失敗したときの例外のインスタンス
""... | java | public TypeBindException newTypeBindExceptionOnParse(final Exception error, final Cell cell, final Object cellValue) {
final String message = MessageBuilder.create("cell.typeBind.failParse")
.var("property", field.getNameWithClass())
.var("cellAddress", POIUtils.formatCellA... | [
"public",
"TypeBindException",
"newTypeBindExceptionOnParse",
"(",
"final",
"Exception",
"error",
",",
"final",
"Cell",
"cell",
",",
"final",
"Object",
"cellValue",
")",
"{",
"final",
"String",
"message",
"=",
"MessageBuilder",
".",
"create",
"(",
"\"cell.typeBind.f... | セルの値をパースしJavaオブジェクトに型変換するとこに失敗したときの例外{@link TypeBindException}を作成します。
@since 2.0
@param error 例外情報
@param cell パースに失敗したセル
@param cellValue パースに失敗した値
@return マッピングに失敗したときの例外のインスタンス | [
"セルの値をパースしJavaオブジェクトに型変換するとこに失敗したときの例外",
"{"
] | train | https://github.com/mygreen/xlsmapper/blob/a0c6b25c622e5f3a50b199ef685d2ee46ad5483c/src/main/java/com/gh/mygreen/xlsmapper/cellconverter/BaseCellConverter.java#L141-L157 |
open-pay/openpay-java | src/main/java/mx/openpay/client/core/requests/RequestBuilder.java | RequestBuilder.with | @SuppressWarnings("unchecked")
public <T extends RequestBuilder> T with(final String jsonParam, final Object obj) {
"""
Adds the given parameter to the map and returns this same object.
@param jsonParam JSON name of the parameter to add
@param obj Object to add to the map
@return This same object
"""
... | java | @SuppressWarnings("unchecked")
public <T extends RequestBuilder> T with(final String jsonParam, final Object obj) {
this.parameters.put(jsonParam, obj);
return (T) this;
} | [
"@",
"SuppressWarnings",
"(",
"\"unchecked\"",
")",
"public",
"<",
"T",
"extends",
"RequestBuilder",
">",
"T",
"with",
"(",
"final",
"String",
"jsonParam",
",",
"final",
"Object",
"obj",
")",
"{",
"this",
".",
"parameters",
".",
"put",
"(",
"jsonParam",
",... | Adds the given parameter to the map and returns this same object.
@param jsonParam JSON name of the parameter to add
@param obj Object to add to the map
@return This same object | [
"Adds",
"the",
"given",
"parameter",
"to",
"the",
"map",
"and",
"returns",
"this",
"same",
"object",
"."
] | train | https://github.com/open-pay/openpay-java/blob/7f4220466b394dd54e2b1642821dde7daebc5433/src/main/java/mx/openpay/client/core/requests/RequestBuilder.java#L37-L41 |
apache/incubator-gobblin | gobblin-service/src/main/java/org/apache/gobblin/service/modules/flow/MultiHopsFlowToJobSpecCompiler.java | MultiHopsFlowToJobSpecCompiler.convertHopToJobSpec | private JobSpec convertHopToJobSpec (ServiceNode sourceNode, ServiceNode targetNode, FlowSpec flowSpec) {
"""
A naive implementation of resolving templates in each JobSpec among Multi-hop FlowSpec.
Handle the case when edge is not specified.
Always select the first available template.
"""
FlowEdge flowEd... | java | private JobSpec convertHopToJobSpec (ServiceNode sourceNode, ServiceNode targetNode, FlowSpec flowSpec) {
FlowEdge flowEdge = weightedGraph.getAllEdges(sourceNode, targetNode).iterator().next();
URI templateURI = getTemplateURI (sourceNode, targetNode, flowSpec, flowEdge);
return buildJobSpec(sourceNode, ta... | [
"private",
"JobSpec",
"convertHopToJobSpec",
"(",
"ServiceNode",
"sourceNode",
",",
"ServiceNode",
"targetNode",
",",
"FlowSpec",
"flowSpec",
")",
"{",
"FlowEdge",
"flowEdge",
"=",
"weightedGraph",
".",
"getAllEdges",
"(",
"sourceNode",
",",
"targetNode",
")",
".",
... | A naive implementation of resolving templates in each JobSpec among Multi-hop FlowSpec.
Handle the case when edge is not specified.
Always select the first available template. | [
"A",
"naive",
"implementation",
"of",
"resolving",
"templates",
"in",
"each",
"JobSpec",
"among",
"Multi",
"-",
"hop",
"FlowSpec",
".",
"Handle",
"the",
"case",
"when",
"edge",
"is",
"not",
"specified",
".",
"Always",
"select",
"the",
"first",
"available",
"... | train | https://github.com/apache/incubator-gobblin/blob/f029b4c0fea0fe4aa62f36dda2512344ff708bae/gobblin-service/src/main/java/org/apache/gobblin/service/modules/flow/MultiHopsFlowToJobSpecCompiler.java#L327-L331 |
Azure/azure-sdk-for-java | network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/VirtualNetworkGatewaysInner.java | VirtualNetworkGatewaysInner.beginResetVpnClientSharedKey | public void beginResetVpnClientSharedKey(String resourceGroupName, String virtualNetworkGatewayName) {
"""
Resets the VPN client shared key of the virtual network gateway in the specified resource group.
@param resourceGroupName The name of the resource group.
@param virtualNetworkGatewayName The name of the v... | java | public void beginResetVpnClientSharedKey(String resourceGroupName, String virtualNetworkGatewayName) {
beginResetVpnClientSharedKeyWithServiceResponseAsync(resourceGroupName, virtualNetworkGatewayName).toBlocking().single().body();
} | [
"public",
"void",
"beginResetVpnClientSharedKey",
"(",
"String",
"resourceGroupName",
",",
"String",
"virtualNetworkGatewayName",
")",
"{",
"beginResetVpnClientSharedKeyWithServiceResponseAsync",
"(",
"resourceGroupName",
",",
"virtualNetworkGatewayName",
")",
".",
"toBlocking",
... | Resets the VPN client shared key of the virtual network gateway in the specified resource group.
@param resourceGroupName The name of the resource group.
@param virtualNetworkGatewayName The name of the virtual network gateway.
@throws IllegalArgumentException thrown if parameters fail the validation
@throws CloudExce... | [
"Resets",
"the",
"VPN",
"client",
"shared",
"key",
"of",
"the",
"virtual",
"network",
"gateway",
"in",
"the",
"specified",
"resource",
"group",
"."
] | 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/VirtualNetworkGatewaysInner.java#L1537-L1539 |
dadoonet/fscrawler | core/src/main/java/fr/pilato/elasticsearch/crawler/fs/FsParserAbstract.java | FsParserAbstract.updateFsJob | private void updateFsJob(String jobName, LocalDateTime scanDate) throws Exception {
"""
Update the job metadata
@param jobName job name
@param scanDate last date we scan the dirs
@throws Exception In case of error
"""
// We need to round that latest date to the lower second and
// remove 2 s... | java | private void updateFsJob(String jobName, LocalDateTime scanDate) throws Exception {
// We need to round that latest date to the lower second and
// remove 2 seconds.
// See #82: https://github.com/dadoonet/fscrawler/issues/82
scanDate = scanDate.minus(2, ChronoUnit.SECONDS);
FsJo... | [
"private",
"void",
"updateFsJob",
"(",
"String",
"jobName",
",",
"LocalDateTime",
"scanDate",
")",
"throws",
"Exception",
"{",
"// We need to round that latest date to the lower second and",
"// remove 2 seconds.",
"// See #82: https://github.com/dadoonet/fscrawler/issues/82",
"scanD... | Update the job metadata
@param jobName job name
@param scanDate last date we scan the dirs
@throws Exception In case of error | [
"Update",
"the",
"job",
"metadata"
] | train | https://github.com/dadoonet/fscrawler/blob/cca00a14e21ef9986aa30e19b160463aed6bf921/core/src/main/java/fr/pilato/elasticsearch/crawler/fs/FsParserAbstract.java#L208-L220 |
Stratio/stratio-cassandra | src/java/org/apache/cassandra/db/commitlog/CommitLog.java | CommitLog.discardCompletedSegments | public void discardCompletedSegments(final UUID cfId, final ReplayPosition context) {
"""
Modifies the per-CF dirty cursors of any commit log segments for the column family according to the position
given. Discards any commit log segments that are no longer used.
@param cfId the column family ID that was fl... | java | public void discardCompletedSegments(final UUID cfId, final ReplayPosition context)
{
logger.debug("discard completed log segments for {}, column family {}", context, cfId);
// Go thru the active segment files, which are ordered oldest to newest, marking the
// flushed CF as clean, until we... | [
"public",
"void",
"discardCompletedSegments",
"(",
"final",
"UUID",
"cfId",
",",
"final",
"ReplayPosition",
"context",
")",
"{",
"logger",
".",
"debug",
"(",
"\"discard completed log segments for {}, column family {}\"",
",",
"context",
",",
"cfId",
")",
";",
"// Go t... | Modifies the per-CF dirty cursors of any commit log segments for the column family according to the position
given. Discards any commit log segments that are no longer used.
@param cfId the column family ID that was flushed
@param context the replay position of the flush | [
"Modifies",
"the",
"per",
"-",
"CF",
"dirty",
"cursors",
"of",
"any",
"commit",
"log",
"segments",
"for",
"the",
"column",
"family",
"according",
"to",
"the",
"position",
"given",
".",
"Discards",
"any",
"commit",
"log",
"segments",
"that",
"are",
"no",
"l... | train | https://github.com/Stratio/stratio-cassandra/blob/f6416b43ad5309083349ad56266450fa8c6a2106/src/java/org/apache/cassandra/db/commitlog/CommitLog.java#L263-L292 |
GenesysPureEngage/authentication-client-java | src/main/java/com/genesys/authentication/AuthenticationApi.java | AuthenticationApi.retrieveAuthScheme | public ModelApiResponse retrieveAuthScheme(AuthSchemeLookupData lookupData) throws AuthenticationApiException {
"""
Get authentication scheme.
Get the authentication scheme by user name or tenant name. The return value is 'saml' if the contact center has [Security Assertion Markup Language](https://en.w... | java | public ModelApiResponse retrieveAuthScheme(AuthSchemeLookupData lookupData) throws AuthenticationApiException {
try {
ApiRequestAuthSchemeLookupData req = new ApiRequestAuthSchemeLookupData();
req.data(lookupData);
return authenticationApi.tenantInfo(req);
} catch (Ap... | [
"public",
"ModelApiResponse",
"retrieveAuthScheme",
"(",
"AuthSchemeLookupData",
"lookupData",
")",
"throws",
"AuthenticationApiException",
"{",
"try",
"{",
"ApiRequestAuthSchemeLookupData",
"req",
"=",
"new",
"ApiRequestAuthSchemeLookupData",
"(",
")",
";",
"req",
".",
"... | Get authentication scheme.
Get the authentication scheme by user name or tenant name. The return value is 'saml' if the contact center has [Security Assertion Markup Language](https://en.wikipedia.org/wiki/Security_Assertion_Markup_Language) (SAML) enabled; otherwise, the return value is 'basic'.
@... | [
"Get",
"authentication",
"scheme",
".",
"Get",
"the",
"authentication",
"scheme",
"by",
"user",
"name",
"or",
"tenant",
"name",
".",
"The",
"return",
"value",
"is",
"'",
";",
"saml'",
";",
"if",
"the",
"contact",
"center",
"has",
"[",
"Security",
"As... | train | https://github.com/GenesysPureEngage/authentication-client-java/blob/eb0d58343ee42ebd3c037163c1137f611dfcbb3a/src/main/java/com/genesys/authentication/AuthenticationApi.java#L185-L193 |
unbescape/unbescape | src/main/java/org/unbescape/css/CssEscape.java | CssEscape.escapeCssString | public static void escapeCssString(final Reader reader, final Writer writer)
throws IOException {
"""
<p>
Perform a CSS String level 2 (basic set and all non-ASCII chars) <strong>escape</strong> operation
on a <tt>Reader</tt> input, writing results to a <tt>Writer</tt>.
</p>
<p>
<em>Level 2</em> m... | java | public static void escapeCssString(final Reader reader, final Writer writer)
throws IOException {
escapeCssString(reader, writer,
CssStringEscapeType.BACKSLASH_ESCAPES_DEFAULT_TO_COMPACT_HEXA,
CssStringEscapeLevel.LEVEL_2_ALL_NON_ASCII_PLUS_BASIC_ESCAPE_SET);
} | [
"public",
"static",
"void",
"escapeCssString",
"(",
"final",
"Reader",
"reader",
",",
"final",
"Writer",
"writer",
")",
"throws",
"IOException",
"{",
"escapeCssString",
"(",
"reader",
",",
"writer",
",",
"CssStringEscapeType",
".",
"BACKSLASH_ESCAPES_DEFAULT_TO_COMPAC... | <p>
Perform a CSS String level 2 (basic set and all non-ASCII chars) <strong>escape</strong> operation
on a <tt>Reader</tt> input, writing results to a <tt>Writer</tt>.
</p>
<p>
<em>Level 2</em> means this method will escape:
</p>
<ul>
<li>The CSS String basic escape set:
<ul>
<li>The <em>Backslash Escapes</em>:
<tt>&#... | [
"<p",
">",
"Perform",
"a",
"CSS",
"String",
"level",
"2",
"(",
"basic",
"set",
"and",
"all",
"non",
"-",
"ASCII",
"chars",
")",
"<strong",
">",
"escape<",
"/",
"strong",
">",
"operation",
"on",
"a",
"<tt",
">",
"Reader<",
"/",
"tt",
">",
"input",
"... | train | https://github.com/unbescape/unbescape/blob/ec5435fb3508c2eed25d8165dc27ded2602cae13/src/main/java/org/unbescape/css/CssEscape.java#L563-L568 |
OpenLiberty/open-liberty | dev/com.ibm.ws.monitor/src/com/ibm/ws/pmi/stat/StatsCreator.java | StatsCreator.addStatisticsToParent | public static void addStatisticsToParent(SPIStats parentStats, SPIStatistic statistic) {
"""
This method adds one Statistic object as the child of a Stats object
@param parentStats This stats is the parent
@param statistic This statistic should be added
"""
StatsImpl p = (StatsImpl) parentStats;
... | java | public static void addStatisticsToParent(SPIStats parentStats, SPIStatistic statistic) {
StatsImpl p = (StatsImpl) parentStats;
StatisticImpl s = (StatisticImpl) statistic;
p.add(s);
} | [
"public",
"static",
"void",
"addStatisticsToParent",
"(",
"SPIStats",
"parentStats",
",",
"SPIStatistic",
"statistic",
")",
"{",
"StatsImpl",
"p",
"=",
"(",
"StatsImpl",
")",
"parentStats",
";",
"StatisticImpl",
"s",
"=",
"(",
"StatisticImpl",
")",
"statistic",
... | This method adds one Statistic object as the child of a Stats object
@param parentStats This stats is the parent
@param statistic This statistic should be added | [
"This",
"method",
"adds",
"one",
"Statistic",
"object",
"as",
"the",
"child",
"of",
"a",
"Stats",
"object"
] | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.monitor/src/com/ibm/ws/pmi/stat/StatsCreator.java#L147-L151 |
bmwcarit/joynr | java/messaging/bounceproxy-controller-service/src/main/java/io/joynr/messaging/info/PerformanceMeasures.java | PerformanceMeasures.addMeasures | public void addMeasures(Map<String, Integer> valueMap) {
"""
Adds measures from a map with keys and integer values. If a key can't be
mapped to a known {@link Key}, the value is ignored without any warning.
@param valueMap
the measures to be added as a Map of string-integer key-value pairs
"""
fo... | java | public void addMeasures(Map<String, Integer> valueMap) {
for (Entry<String, Integer> values : valueMap.entrySet()) {
try {
addMeasure(values.getKey(), values.getValue().intValue());
} catch (NumberFormatException e) {
// TODO for now, we ignore malformed... | [
"public",
"void",
"addMeasures",
"(",
"Map",
"<",
"String",
",",
"Integer",
">",
"valueMap",
")",
"{",
"for",
"(",
"Entry",
"<",
"String",
",",
"Integer",
">",
"values",
":",
"valueMap",
".",
"entrySet",
"(",
")",
")",
"{",
"try",
"{",
"addMeasure",
... | Adds measures from a map with keys and integer values. If a key can't be
mapped to a known {@link Key}, the value is ignored without any warning.
@param valueMap
the measures to be added as a Map of string-integer key-value pairs | [
"Adds",
"measures",
"from",
"a",
"map",
"with",
"keys",
"and",
"integer",
"values",
".",
"If",
"a",
"key",
"can",
"t",
"be",
"mapped",
"to",
"a",
"known",
"{",
"@link",
"Key",
"}",
"the",
"value",
"is",
"ignored",
"without",
"any",
"warning",
"."
] | train | https://github.com/bmwcarit/joynr/blob/b7a92bad1cf2f093de080facd2c803560f4c6c26/java/messaging/bounceproxy-controller-service/src/main/java/io/joynr/messaging/info/PerformanceMeasures.java#L91-L103 |
Erudika/para | para-server/src/main/java/com/erudika/para/security/SecurityUtils.java | SecurityUtils.checkIfUserCanModifyObject | public static boolean checkIfUserCanModifyObject(App app, ParaObject object) {
"""
Check if a user can modify an object. If there's no user principal found, this returns true.
@param app app in context
@param object some object
@return true if user is the owner/creator of the object.
"""
User user = Sec... | java | public static boolean checkIfUserCanModifyObject(App app, ParaObject object) {
User user = SecurityUtils.getAuthenticatedUser();
if (user != null && app != null && object != null) {
if (app.permissionsContainOwnKeyword(user, object)) {
return user.canModify(object);
}
}
return true; // skip
} | [
"public",
"static",
"boolean",
"checkIfUserCanModifyObject",
"(",
"App",
"app",
",",
"ParaObject",
"object",
")",
"{",
"User",
"user",
"=",
"SecurityUtils",
".",
"getAuthenticatedUser",
"(",
")",
";",
"if",
"(",
"user",
"!=",
"null",
"&&",
"app",
"!=",
"null... | Check if a user can modify an object. If there's no user principal found, this returns true.
@param app app in context
@param object some object
@return true if user is the owner/creator of the object. | [
"Check",
"if",
"a",
"user",
"can",
"modify",
"an",
"object",
".",
"If",
"there",
"s",
"no",
"user",
"principal",
"found",
"this",
"returns",
"true",
"."
] | train | https://github.com/Erudika/para/blob/5ba096c477042ea7b18e9a0e8b5b1ee0f5bd6ce9/para-server/src/main/java/com/erudika/para/security/SecurityUtils.java#L200-L208 |
graphhopper/graphhopper | reader-osm/src/main/java/com/graphhopper/reader/osm/OSMReader.java | OSMReader.isOnePassable | private static boolean isOnePassable(List<BooleanEncodedValue> checkEncoders, IntsRef edgeFlags) {
"""
The nodeFlags store the encoders to check for accessibility in edgeFlags. E.g. if nodeFlags==3, then the
accessibility of the first two encoders will be check in edgeFlags
"""
for (BooleanEncodedValu... | java | private static boolean isOnePassable(List<BooleanEncodedValue> checkEncoders, IntsRef edgeFlags) {
for (BooleanEncodedValue accessEnc : checkEncoders) {
if (accessEnc.getBool(false, edgeFlags) || accessEnc.getBool(true, edgeFlags))
return true;
}
return false;
} | [
"private",
"static",
"boolean",
"isOnePassable",
"(",
"List",
"<",
"BooleanEncodedValue",
">",
"checkEncoders",
",",
"IntsRef",
"edgeFlags",
")",
"{",
"for",
"(",
"BooleanEncodedValue",
"accessEnc",
":",
"checkEncoders",
")",
"{",
"if",
"(",
"accessEnc",
".",
"g... | The nodeFlags store the encoders to check for accessibility in edgeFlags. E.g. if nodeFlags==3, then the
accessibility of the first two encoders will be check in edgeFlags | [
"The",
"nodeFlags",
"store",
"the",
"encoders",
"to",
"check",
"for",
"accessibility",
"in",
"edgeFlags",
".",
"E",
".",
"g",
".",
"if",
"nodeFlags",
"==",
"3",
"then",
"the",
"accessibility",
"of",
"the",
"first",
"two",
"encoders",
"will",
"be",
"check",... | train | https://github.com/graphhopper/graphhopper/blob/c235e306e6e823043cadcc41ead0e685bdebf737/reader-osm/src/main/java/com/graphhopper/reader/osm/OSMReader.java#L553-L559 |
watchrabbit/rabbit-commons | src/main/java/com/watchrabbit/commons/sleep/SleepBuilder.java | SleepBuilder.build | public T build() {
"""
Causes the current thread to wait until the value returned by statement
is evaluated by comparer to {@code false}, or the specified waiting time
elapses.
<p>
Condition is checked with interval.
<p>
Any {@code InterruptedException}'s are suppress and logged. Any
{@code Exception}'s... | java | public T build() {
long start = System.currentTimeMillis();
long sleepingFor = start + timeout - System.currentTimeMillis();
T result;
try {
result = statement.call();
while (comparer.call(result) && 0 < sleepingFor) {
LOGGER.debug("Sleeping... | [
"public",
"T",
"build",
"(",
")",
"{",
"long",
"start",
"=",
"System",
".",
"currentTimeMillis",
"(",
")",
";",
"long",
"sleepingFor",
"=",
"start",
"+",
"timeout",
"-",
"System",
".",
"currentTimeMillis",
"(",
")",
";",
"T",
"result",
";",
"try",
"{",... | Causes the current thread to wait until the value returned by statement
is evaluated by comparer to {@code false}, or the specified waiting time
elapses.
<p>
Condition is checked with interval.
<p>
Any {@code InterruptedException}'s are suppress and logged. Any
{@code Exception}'s thrown by callable are propagate as ... | [
"Causes",
"the",
"current",
"thread",
"to",
"wait",
"until",
"the",
"value",
"returned",
"by",
"statement",
"is",
"evaluated",
"by",
"comparer",
"to",
"{",
"@code",
"false",
"}",
"or",
"the",
"specified",
"waiting",
"time",
"elapses",
"."
] | train | https://github.com/watchrabbit/rabbit-commons/blob/b11c9f804b5ab70b9264635c34a02f5029bd2a5d/src/main/java/com/watchrabbit/commons/sleep/SleepBuilder.java#L121-L144 |
jbundle/jbundle | base/base/src/main/java/org/jbundle/base/field/FloatField.java | FloatField.getSQLType | public String getSQLType(boolean bIncludeLength, Map<String, Object> properties) {
"""
Get the SQL type of this field.
Typically FLOAT.
@param bIncludeLength Include the field length in this description.
@param properties Database properties to determine the SQL type.
"""
String strType = (String)pr... | java | public String getSQLType(boolean bIncludeLength, Map<String, Object> properties)
{
String strType = (String)properties.get(DBSQLTypes.FLOAT);
if (strType == null)
strType = DBSQLTypes.FLOAT; // The default SQL Type (Byte)
return strType; // The default SQL Type
} | [
"public",
"String",
"getSQLType",
"(",
"boolean",
"bIncludeLength",
",",
"Map",
"<",
"String",
",",
"Object",
">",
"properties",
")",
"{",
"String",
"strType",
"=",
"(",
"String",
")",
"properties",
".",
"get",
"(",
"DBSQLTypes",
".",
"FLOAT",
")",
";",
... | Get the SQL type of this field.
Typically FLOAT.
@param bIncludeLength Include the field length in this description.
@param properties Database properties to determine the SQL type. | [
"Get",
"the",
"SQL",
"type",
"of",
"this",
"field",
".",
"Typically",
"FLOAT",
"."
] | train | https://github.com/jbundle/jbundle/blob/4037fcfa85f60c7d0096c453c1a3cd573c2b0abc/base/base/src/main/java/org/jbundle/base/field/FloatField.java#L315-L321 |
kite-sdk/kite | kite-data/kite-data-core/src/main/java/org/kitesdk/data/spi/filesystem/FileSystemDatasets.java | FileSystemDatasets.viewForUri | public static <E> View<E> viewForUri(Dataset<E> dataset, String uri) {
"""
Convert a URI for a partition directory in a filesystem dataset to a {@link View}
object representing that partition.
@param dataset the (partitioned) filesystem dataset
@param uri the path to the partition directory
@return a view of t... | java | public static <E> View<E> viewForUri(Dataset<E> dataset, String uri) {
return viewForUri(dataset, URI.create(uri));
} | [
"public",
"static",
"<",
"E",
">",
"View",
"<",
"E",
">",
"viewForUri",
"(",
"Dataset",
"<",
"E",
">",
"dataset",
",",
"String",
"uri",
")",
"{",
"return",
"viewForUri",
"(",
"dataset",
",",
"URI",
".",
"create",
"(",
"uri",
")",
")",
";",
"}"
] | Convert a URI for a partition directory in a filesystem dataset to a {@link View}
object representing that partition.
@param dataset the (partitioned) filesystem dataset
@param uri the path to the partition directory
@return a view of the partition | [
"Convert",
"a",
"URI",
"for",
"a",
"partition",
"directory",
"in",
"a",
"filesystem",
"dataset",
"to",
"a",
"{"
] | train | https://github.com/kite-sdk/kite/blob/72bfb4b1a881af85808cd7f14bc3e15160a1e811/kite-data/kite-data-core/src/main/java/org/kitesdk/data/spi/filesystem/FileSystemDatasets.java#L52-L54 |
OpenLiberty/open-liberty | dev/com.ibm.ws.monitor/src/com/ibm/ws/monitor/internal/ProbeManagerImpl.java | ProbeManagerImpl.removeListenerByProbe | boolean removeListenerByProbe(ProbeImpl probe, ProbeListener listener) {
"""
Remove the specified listener from the collection of listeners associated
with the specified probe.
@param probe the probe that fired for the listener
@param listener the listener that was driven by the probe
@return true if remov... | java | boolean removeListenerByProbe(ProbeImpl probe, ProbeListener listener) {
boolean deactivatedProbe = false;
Set<ProbeListener> listeners = listenersByProbe.get(probe);
if (listeners != null) {
listeners.remove(listener);
if (listeners.isEmpty()) {
deactiva... | [
"boolean",
"removeListenerByProbe",
"(",
"ProbeImpl",
"probe",
",",
"ProbeListener",
"listener",
")",
"{",
"boolean",
"deactivatedProbe",
"=",
"false",
";",
"Set",
"<",
"ProbeListener",
">",
"listeners",
"=",
"listenersByProbe",
".",
"get",
"(",
"probe",
")",
";... | Remove the specified listener from the collection of listeners associated
with the specified probe.
@param probe the probe that fired for the listener
@param listener the listener that was driven by the probe
@return true if removing the listener caused the probe to become disabled | [
"Remove",
"the",
"specified",
"listener",
"from",
"the",
"collection",
"of",
"listeners",
"associated",
"with",
"the",
"specified",
"probe",
"."
] | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.monitor/src/com/ibm/ws/monitor/internal/ProbeManagerImpl.java#L710-L723 |
cdk/cdk | legacy/src/main/java/org/openscience/cdk/smsd/tools/ExtAtomContainerManipulator.java | ExtAtomContainerManipulator.getExplicitHydrogenCount | public static int getExplicitHydrogenCount(IAtomContainer atomContainer, IAtom atom) {
"""
Returns The number of explicit hydrogens for a given IAtom.
@param atomContainer
@param atom
@return The number of explicit hydrogens on the given IAtom.
"""
int hCount = 0;
for (IAtom iAtom : atomCont... | java | public static int getExplicitHydrogenCount(IAtomContainer atomContainer, IAtom atom) {
int hCount = 0;
for (IAtom iAtom : atomContainer.getConnectedAtomsList(atom)) {
IAtom connectedAtom = iAtom;
if (connectedAtom.getSymbol().equals("H")) {
hCount++;
}... | [
"public",
"static",
"int",
"getExplicitHydrogenCount",
"(",
"IAtomContainer",
"atomContainer",
",",
"IAtom",
"atom",
")",
"{",
"int",
"hCount",
"=",
"0",
";",
"for",
"(",
"IAtom",
"iAtom",
":",
"atomContainer",
".",
"getConnectedAtomsList",
"(",
"atom",
")",
"... | Returns The number of explicit hydrogens for a given IAtom.
@param atomContainer
@param atom
@return The number of explicit hydrogens on the given IAtom. | [
"Returns",
"The",
"number",
"of",
"explicit",
"hydrogens",
"for",
"a",
"given",
"IAtom",
"."
] | train | https://github.com/cdk/cdk/blob/c3d0f16502bf08df50365fee392e11d7c9856657/legacy/src/main/java/org/openscience/cdk/smsd/tools/ExtAtomContainerManipulator.java#L188-L197 |
looly/hutool | hutool-core/src/main/java/cn/hutool/core/img/ImgUtil.java | ImgUtil.createGraphics | public static Graphics2D createGraphics(BufferedImage image, Color color) {
"""
创建{@link Graphics2D}
@param image {@link BufferedImage}
@param color {@link Color}背景颜色以及当前画笔颜色
@return {@link Graphics2D}
@since 3.2.3
@see GraphicsUtil#createGraphics(BufferedImage, Color)
"""
return GraphicsUtil.createG... | java | public static Graphics2D createGraphics(BufferedImage image, Color color) {
return GraphicsUtil.createGraphics(image, color);
} | [
"public",
"static",
"Graphics2D",
"createGraphics",
"(",
"BufferedImage",
"image",
",",
"Color",
"color",
")",
"{",
"return",
"GraphicsUtil",
".",
"createGraphics",
"(",
"image",
",",
"color",
")",
";",
"}"
] | 创建{@link Graphics2D}
@param image {@link BufferedImage}
@param color {@link Color}背景颜色以及当前画笔颜色
@return {@link Graphics2D}
@since 3.2.3
@see GraphicsUtil#createGraphics(BufferedImage, Color) | [
"创建",
"{",
"@link",
"Graphics2D",
"}"
] | train | https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-core/src/main/java/cn/hutool/core/img/ImgUtil.java#L1343-L1345 |
apache/incubator-gobblin | gobblin-utility/src/main/java/org/apache/gobblin/util/recordcount/LateFileRecordCountProvider.java | LateFileRecordCountProvider.constructLateFilePath | public Path constructLateFilePath(String originalFilename, FileSystem fs, Path outputDir) throws IOException {
"""
Construct filename for a late file. If the file does not exists in the output dir, retain the original name.
Otherwise, append a LATE_COMPONENT{RandomInteger} to the original file name.
For example,... | java | public Path constructLateFilePath(String originalFilename, FileSystem fs, Path outputDir) throws IOException {
if (!fs.exists(new Path(outputDir, originalFilename))) {
return new Path(outputDir, originalFilename);
}
return constructLateFilePath(FilenameUtils.getBaseName(originalFilename) + LATE_COMPON... | [
"public",
"Path",
"constructLateFilePath",
"(",
"String",
"originalFilename",
",",
"FileSystem",
"fs",
",",
"Path",
"outputDir",
")",
"throws",
"IOException",
"{",
"if",
"(",
"!",
"fs",
".",
"exists",
"(",
"new",
"Path",
"(",
"outputDir",
",",
"originalFilenam... | Construct filename for a late file. If the file does not exists in the output dir, retain the original name.
Otherwise, append a LATE_COMPONENT{RandomInteger} to the original file name.
For example, if file "part1.123.avro" exists in dir "/a/b/", the returned path will be "/a/b/part1.123.late12345.avro". | [
"Construct",
"filename",
"for",
"a",
"late",
"file",
".",
"If",
"the",
"file",
"does",
"not",
"exists",
"in",
"the",
"output",
"dir",
"retain",
"the",
"original",
"name",
".",
"Otherwise",
"append",
"a",
"LATE_COMPONENT",
"{",
"RandomInteger",
"}",
"to",
"... | train | https://github.com/apache/incubator-gobblin/blob/f029b4c0fea0fe4aa62f36dda2512344ff708bae/gobblin-utility/src/main/java/org/apache/gobblin/util/recordcount/LateFileRecordCountProvider.java#L45-L52 |
Azure/azure-sdk-for-java | resources/resource-manager/v2018_02_01/src/main/java/com/microsoft/azure/management/resources/v2018_02_01/implementation/ResourcesInner.java | ResourcesInner.moveResourcesAsync | public Observable<Void> moveResourcesAsync(String sourceResourceGroupName, ResourcesMoveInfo parameters) {
"""
Moves resources from one resource group to another resource group.
The resources to move must be in the same source resource group. The target resource group may be in a different subscription. When movi... | java | public Observable<Void> moveResourcesAsync(String sourceResourceGroupName, ResourcesMoveInfo parameters) {
return moveResourcesWithServiceResponseAsync(sourceResourceGroupName, parameters).map(new Func1<ServiceResponse<Void>, Void>() {
@Override
public Void call(ServiceResponse<Void> res... | [
"public",
"Observable",
"<",
"Void",
">",
"moveResourcesAsync",
"(",
"String",
"sourceResourceGroupName",
",",
"ResourcesMoveInfo",
"parameters",
")",
"{",
"return",
"moveResourcesWithServiceResponseAsync",
"(",
"sourceResourceGroupName",
",",
"parameters",
")",
".",
"map... | Moves resources from one resource group to another resource group.
The resources to move must be in the same source resource group. The target resource group may be in a different subscription. When moving resources, both the source group and the target group are locked for the duration of the operation. Write and dele... | [
"Moves",
"resources",
"from",
"one",
"resource",
"group",
"to",
"another",
"resource",
"group",
".",
"The",
"resources",
"to",
"move",
"must",
"be",
"in",
"the",
"same",
"source",
"resource",
"group",
".",
"The",
"target",
"resource",
"group",
"may",
"be",
... | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/resources/resource-manager/v2018_02_01/src/main/java/com/microsoft/azure/management/resources/v2018_02_01/implementation/ResourcesInner.java#L445-L452 |
datastax/java-driver | query-builder/src/main/java/com/datastax/oss/driver/api/querybuilder/SchemaBuilder.java | SchemaBuilder.dropMaterializedView | @NonNull
public static Drop dropMaterializedView(
@Nullable CqlIdentifier keyspace, @NonNull CqlIdentifier viewName) {
"""
Starts a DROP MATERIALIZED VIEW query for the given view name for the given keyspace name.
"""
return new DefaultDrop(keyspace, viewName, "MATERIALIZED VIEW");
} | java | @NonNull
public static Drop dropMaterializedView(
@Nullable CqlIdentifier keyspace, @NonNull CqlIdentifier viewName) {
return new DefaultDrop(keyspace, viewName, "MATERIALIZED VIEW");
} | [
"@",
"NonNull",
"public",
"static",
"Drop",
"dropMaterializedView",
"(",
"@",
"Nullable",
"CqlIdentifier",
"keyspace",
",",
"@",
"NonNull",
"CqlIdentifier",
"viewName",
")",
"{",
"return",
"new",
"DefaultDrop",
"(",
"keyspace",
",",
"viewName",
",",
"\"MATERIALIZE... | Starts a DROP MATERIALIZED VIEW query for the given view name for the given keyspace name. | [
"Starts",
"a",
"DROP",
"MATERIALIZED",
"VIEW",
"query",
"for",
"the",
"given",
"view",
"name",
"for",
"the",
"given",
"keyspace",
"name",
"."
] | train | https://github.com/datastax/java-driver/blob/612a63f2525618e2020e86c9ad75ab37adba6132/query-builder/src/main/java/com/datastax/oss/driver/api/querybuilder/SchemaBuilder.java#L304-L308 |
alkacon/opencms-core | src-gwt/org/opencms/ade/containerpage/client/CmsContainerpageController.java | CmsContainerpageController.setPageChanged | protected void setPageChanged(boolean changed, boolean unlock) {
"""
Sets the page changed flag and initializes the window closing handler if necessary.<p>
@param changed if <code>true</code> the page has changed
@param unlock if <code>true</code> the page will be unlocked for unchanged pages
"""
... | java | protected void setPageChanged(boolean changed, boolean unlock) {
if (changed) {
if (!m_pageChanged) {
m_pageChanged = changed;
lockContainerpage(new I_CmsSimpleCallback<Boolean>() {
public void execute(Boolean arg) {
// n... | [
"protected",
"void",
"setPageChanged",
"(",
"boolean",
"changed",
",",
"boolean",
"unlock",
")",
"{",
"if",
"(",
"changed",
")",
"{",
"if",
"(",
"!",
"m_pageChanged",
")",
"{",
"m_pageChanged",
"=",
"changed",
";",
"lockContainerpage",
"(",
"new",
"I_CmsSimp... | Sets the page changed flag and initializes the window closing handler if necessary.<p>
@param changed if <code>true</code> the page has changed
@param unlock if <code>true</code> the page will be unlocked for unchanged pages | [
"Sets",
"the",
"page",
"changed",
"flag",
"and",
"initializes",
"the",
"window",
"closing",
"handler",
"if",
"necessary",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src-gwt/org/opencms/ade/containerpage/client/CmsContainerpageController.java#L3742-L3761 |
ontop/ontop | engine/reformulation/sql/src/main/java/it/unibz/inf/ontop/answering/reformulation/generation/impl/OneShotSQLGeneratorEngine.java | OneShotSQLGeneratorEngine.getTableDefinition | private String getTableDefinition(Function atom, AliasIndex index, String indent) {
"""
Returns the table definition for the given atom. If the atom is a simple
table or view, then it returns the value as defined by the
AliasIndex. If the atom is a Join or Left Join, it will call
getTableDefinitions on the nest... | java | private String getTableDefinition(Function atom, AliasIndex index, String indent) {
if (atom.isAlgebraFunction()) {
Predicate functionSymbol = atom.getFunctionSymbol();
ImmutableList<Function> joinAtoms = convert(atom.getTerms());
if (functionSymbol.equals(datalogFactory.getSparqlJoinPredicate())) {
// ... | [
"private",
"String",
"getTableDefinition",
"(",
"Function",
"atom",
",",
"AliasIndex",
"index",
",",
"String",
"indent",
")",
"{",
"if",
"(",
"atom",
".",
"isAlgebraFunction",
"(",
")",
")",
"{",
"Predicate",
"functionSymbol",
"=",
"atom",
".",
"getFunctionSym... | Returns the table definition for the given atom. If the atom is a simple
table or view, then it returns the value as defined by the
AliasIndex. If the atom is a Join or Left Join, it will call
getTableDefinitions on the nested term list. | [
"Returns",
"the",
"table",
"definition",
"for",
"the",
"given",
"atom",
".",
"If",
"the",
"atom",
"is",
"a",
"simple",
"table",
"or",
"view",
"then",
"it",
"returns",
"the",
"value",
"as",
"defined",
"by",
"the",
"AliasIndex",
".",
"If",
"the",
"atom",
... | train | https://github.com/ontop/ontop/blob/ddf78b26981b6129ee9a1a59310016830f5352e4/engine/reformulation/sql/src/main/java/it/unibz/inf/ontop/answering/reformulation/generation/impl/OneShotSQLGeneratorEngine.java#L743-L769 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.